Interface IAffinityItem
public interface IAffinityItem
Represents an item that has an affinity in the stack
-
Method Summary
Modifier and TypeMethodDescriptiondefault AffinitygetAffinity(net.minecraft.world.item.ItemStack stack) default booleandefault net.minecraft.world.item.ItemStacksetAffinity(net.minecraft.world.item.ItemStack stack, Affinity affinity)
-
Method Details
-
hasNoneVariant
default boolean hasNoneVariant()- Returns:
- Whether this item should have a variant without an affinity or not.
-
getAffinity
- 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.
-
setAffinity
default net.minecraft.world.item.ItemStack setAffinity(net.minecraft.world.item.ItemStack stack, Affinity affinity) - Parameters:
stack- The item stack to set the affinity on.affinity- The affinity to set.- Returns:
- The stack, now with the given affinity set on it.
-