Interface IAffinityHelper
public interface IAffinityHelper
Interface for affinity related helper methods.
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyAffinityShift(net.minecraft.world.entity.player.Player player, Affinity affinity, float shift) Applies the affinity shift for the given player and affinity.voidapplyAffinityShift(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float shift) Applies the affinity shift for the given player and affinity.voidapplyAffinityShift(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float shift) Applies the affinity shift for the given player and affinity.voiddecreaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount) voiddecreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float amount) voiddecreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount) doublegetAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity) doublegetAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity) doublegetAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity) doublegetAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, Affinity affinity, double defaultValue) doublegetAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, double defaultValue) doublegetAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, double defaultValue) getAffinityForStack(net.minecraft.world.item.ItemStack stack) net.minecraft.world.item.ItemStackgetEssenceForAffinity(Affinity affinity) net.minecraft.world.item.ItemStackgetEssenceForAffinity(net.minecraft.core.Holder<Affinity> affinity) net.minecraft.world.item.ItemStackgetEssenceForAffinity(net.minecraft.resources.ResourceLocation affinity) <T extends net.minecraft.world.item.Item & IAffinityItem>
net.minecraft.world.item.ItemStackgetStackForAffinity(T item, Affinity affinity) <T extends net.minecraft.world.item.Item & IAffinityItem>
net.minecraft.world.item.ItemStackgetStackForAffinity(T item, net.minecraft.core.Holder<Affinity> affinity) <T extends net.minecraft.world.item.Item & IAffinityItem>
net.minecraft.world.item.ItemStackgetStackForAffinity(T item, net.minecraft.resources.ResourceLocation affinity) net.minecraft.world.item.ItemStackgetTomeForAffinity(Affinity affinity) net.minecraft.world.item.ItemStackgetTomeForAffinity(net.minecraft.core.Holder<Affinity> affinity) net.minecraft.world.item.ItemStackgetTomeForAffinity(net.minecraft.resources.ResourceLocation affinity) voidincreaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount) voidincreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float amount) voidincreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount) voidlock(net.minecraft.world.entity.player.Player player) Locks the player's affinities.voidsetAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount) voidsetAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float amount) voidsetAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount) voidunlock(net.minecraft.world.entity.player.Player player) Unlocks the player's affinities.voidupdateLock(net.minecraft.world.entity.player.Player player) Locks or unlocks the player's affinities, depending on whether an affinity is at 1.0 or not.
-
Method Details
-
getEssenceForAffinity
net.minecraft.world.item.ItemStack getEssenceForAffinity(net.minecraft.resources.ResourceLocation affinity) - Parameters:
affinity- The id of the affinity to get the essence stack for.- Returns:
- An item stack containing the affinity essence.
-
getEssenceForAffinity
- Parameters:
affinity- The affinity to get the essence stack for.- Returns:
- An item stack containing the affinity essence.
-
getEssenceForAffinity
net.minecraft.world.item.ItemStack getEssenceForAffinity(net.minecraft.core.Holder<Affinity> affinity) - Parameters:
affinity- The affinity to get the essence stack for.- Returns:
- An item stack containing the affinity essence.
-
getTomeForAffinity
net.minecraft.world.item.ItemStack getTomeForAffinity(net.minecraft.resources.ResourceLocation affinity) - Parameters:
affinity- The id of the affinity to get the tome stack for.- Returns:
- An item stack containing the affinity tome.
-
getTomeForAffinity
- Parameters:
affinity- The affinity to get the tome stack for.- Returns:
- An item stack containing the affinity tome.
-
getTomeForAffinity
- Parameters:
affinity- The affinity to get the tome stack for.- Returns:
- An item stack containing the affinity tome.
-
getStackForAffinity
<T extends net.minecraft.world.item.Item & IAffinityItem> net.minecraft.world.item.ItemStack getStackForAffinity(T item, net.minecraft.resources.ResourceLocation affinity) - Type Parameters:
T- The item implementing AffinityItem.- Parameters:
item- The item to make the item stack from.affinity- The id of the affinity to set on the item stack.- Returns:
- An item stack of the given item with the given affinity stored in it.
-
getStackForAffinity
<T extends net.minecraft.world.item.Item & IAffinityItem> net.minecraft.world.item.ItemStack getStackForAffinity(T item, Affinity affinity) - Type Parameters:
T- The item implementing AffinityItem.- Parameters:
item- The item to make the item stack from.affinity- The affinity to set on the item stack.- Returns:
- An item stack of the given item with the given affinity stored in it.
-
getStackForAffinity
<T extends net.minecraft.world.item.Item & IAffinityItem> net.minecraft.world.item.ItemStack getStackForAffinity(T item, net.minecraft.core.Holder<Affinity> affinity) - Type Parameters:
T- The item implementing AffinityItem.- Parameters:
item- The item to make the item stack from.affinity- The affinity to set on the item stack.- Returns:
- An item stack of the given item with the given affinity stored in it.
-
getAffinityForStack
- Parameters:
stack- The stack to get the affinity from.- Returns:
- The affinity stored in the stack, or the NONE affinity if the stack does not contain one.
-
getAffinityDepth
double getAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity) - Parameters:
player- The player to get the affinity depth for.affinity- The id of the affinity to get the depth for.- Returns:
- The depth of the given player in the given affinity.
-
getAffinityDepth
- Parameters:
player- The player to get the affinity depth for.affinity- The affinity to get the depth for.- Returns:
- The depth of the given player in the given affinity.
-
getAffinityDepth
double getAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity) - Parameters:
player- The player to get the affinity depth for.affinity- The affinity to get the depth for.- Returns:
- The depth of the given player in the given affinity.
-
getAffinityDepthOrElse
double getAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, double defaultValue) - Parameters:
player- The player to get the affinity depth for.affinity- The id of the affinity to get the depth for.defaultValue- The default value that will be returned if the affinity depth cannot be retrieved.- Returns:
- The depth of the given player in the given affinity, or
defaultValueif the affinity depth cannot be determined.
-
getAffinityDepthOrElse
double getAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, Affinity affinity, double defaultValue) - Parameters:
player- The player to get the affinity depth for.affinity- The affinity to get the depth for.defaultValue- The default value that will be returned if the affinity depth cannot be retrieved.- Returns:
- The depth of the given player in the given affinity, or
defaultValueif the affinity depth cannot be determined.
-
getAffinityDepthOrElse
double getAffinityDepthOrElse(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, double defaultValue) - Parameters:
player- The player to get the affinity depth for.affinity- The affinity to get the depth for.defaultValue- The default value that will be returned if the affinity depth cannot be retrieved.- Returns:
- The depth of the given player in the given affinity, or
defaultValueif the affinity depth cannot be determined.
-
setAffinityDepth
void setAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount) - Parameters:
player- The player to set the affinity depth for.affinity- The id of the affinity to set the depth for.amount- The amount the affinity should have.
-
setAffinityDepth
void setAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount) - Parameters:
player- The player to set the affinity depth for.affinity- The affinity to set the depth for.amount- The amount the affinity should have.
-
setAffinityDepth
void setAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float amount) - Parameters:
player- The player to set the affinity depth for.affinity- The affinity to set the depth for.amount- The amount the affinity should have.
-
increaseAffinityDepth
void increaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount) - Parameters:
player- The player to add the affinity depth for.affinity- The id of the affinity to add the depth for.amount- The amount to add.
-
increaseAffinityDepth
void increaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount) - Parameters:
player- The player to add the affinity depth for.affinity- The affinity to add the depth for.amount- The amount to add.
-
increaseAffinityDepth
void increaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float amount) - Parameters:
player- The player to add the affinity depth for.affinity- The affinity to add the depth for.amount- The amount to add.
-
decreaseAffinityDepth
void decreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float amount) - Parameters:
player- The player to subtract the affinity depth for.affinity- The id of the affinity to subtract the depth for.amount- The amount to subtract.
-
decreaseAffinityDepth
void decreaseAffinityDepth(net.minecraft.world.entity.player.Player player, Affinity affinity, float amount) - Parameters:
player- The player to subtract the affinity depth for.affinity- The affinity to subtract the depth for.amount- The amount to subtract.
-
decreaseAffinityDepth
void decreaseAffinityDepth(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float amount) - Parameters:
player- The player to subtract the affinity depth for.affinity- The affinity to subtract the depth for.amount- The amount to subtract.
-
applyAffinityShift
void applyAffinityShift(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation affinity, float shift) Applies the affinity shift for the given player and affinity.- Parameters:
player- The player to shift the affinity for.affinity- The affinity to shift.shift- The amount to shift.
-
applyAffinityShift
void applyAffinityShift(net.minecraft.world.entity.player.Player player, Affinity affinity, float shift) Applies the affinity shift for the given player and affinity.- Parameters:
player- The player to shift the affinity for.affinity- The affinity to shift.shift- The amount to shift.
-
applyAffinityShift
void applyAffinityShift(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<Affinity> affinity, float shift) Applies the affinity shift for the given player and affinity.- Parameters:
player- The player to shift the affinity for.affinity- The affinity to shift.shift- The amount to shift.
-
lock
void lock(net.minecraft.world.entity.player.Player player) Locks the player's affinities.- Parameters:
player- The player to lock the affinities for.
-
unlock
void unlock(net.minecraft.world.entity.player.Player player) Unlocks the player's affinities.- Parameters:
player- The player to unlock the affinities for.
-
updateLock
void updateLock(net.minecraft.world.entity.player.Player player) Locks or unlocks the player's affinities, depending on whether an affinity is at 1.0 or not.- Parameters:
player- The player to lock or unlock the affinities for.
-