Package com.petrolpark.core.item.decay
Interface ItemDecay
public interface ItemDecay
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic net.minecraft.world.item.ItemStackcheckDecay(net.minecraft.world.item.ItemStack stack) Get the form of the given ItemStack accounting for the currentgame timeand any possibleIDecayProducts the Item has.static net.minecraft.world.item.ItemStackcheckDecay(net.minecraft.world.item.ItemStack stack, UnaryOperator<net.minecraft.world.item.ItemStack> newDecay) Get the form of the given ItemStack accounting for the currentgame timeand any possibleIDecayProducts the Item has.static net.minecraft.world.item.ItemStackcopyIgnoringDecay(net.minecraft.world.item.ItemStack stack) static voidextendLifetime(net.minecraft.world.item.ItemStack decayingItemStack, int additionalLifetime) static longstatic longgetLifetimeOrNone(net.minecraft.world.item.ItemStack stack) static longgetRemainingTime(long lifetime, long creationTime) static longgetRemainingTime(net.minecraft.world.item.ItemStack decayingItemStack, long creationTime) static Optional<net.minecraft.network.chat.Component> getTooltip(net.minecraft.world.item.ItemStack stack) static net.minecraft.world.item.ItemStackremoveAppliedDecay(net.minecraft.world.item.ItemStack stack) static voidstartDecay(net.minecraft.world.item.ItemStack stack) static voidstartDecay(net.minecraft.world.item.ItemStack stack, long timeElapsed)
-
Method Details
-
getGameTime
static long getGameTime() -
checkDecay
static net.minecraft.world.item.ItemStack checkDecay(net.minecraft.world.item.ItemStack stack) Get the form of the given ItemStack accounting for the currentgame timeand any possibleIDecayProducts the Item has. This is recursive and will give the ItemStack accurate to the original decay start time.- Parameters:
stack-- Returns:
- The "true" ItemStack, accounting for that into which it may have decayed
- See Also:
-
checkDecay
static net.minecraft.world.item.ItemStack checkDecay(net.minecraft.world.item.ItemStack stack, UnaryOperator<net.minecraft.world.item.ItemStack> newDecay) Get the form of the given ItemStack accounting for the currentgame timeand any possibleIDecayProducts the Item has. This is recursive and will give the ItemStack accurate to the original decay start time.- Parameters:
stack-newDecay- Use this to get a different decay for the product, beyond any decay added by its prototype or theIDecayProduct- Returns:
- The "true" ItemStack, accounting for that into which it may have decayed
- See Also:
-
copyIgnoringDecay
static net.minecraft.world.item.ItemStack copyIgnoringDecay(net.minecraft.world.item.ItemStack stack) -
removeAppliedDecay
static net.minecraft.world.item.ItemStack removeAppliedDecay(net.minecraft.world.item.ItemStack stack) -
getLifetimeOrNone
static long getLifetimeOrNone(net.minecraft.world.item.ItemStack stack) -
getRemainingTime
static long getRemainingTime(net.minecraft.world.item.ItemStack decayingItemStack, long creationTime) -
getRemainingTime
static long getRemainingTime(long lifetime, long creationTime) -
startDecay
static void startDecay(net.minecraft.world.item.ItemStack stack) -
startDecay
static void startDecay(net.minecraft.world.item.ItemStack stack, long timeElapsed) -
extendLifetime
static void extendLifetime(net.minecraft.world.item.ItemStack decayingItemStack, int additionalLifetime) -
getTooltip
static Optional<net.minecraft.network.chat.Component> getTooltip(net.minecraft.world.item.ItemStack stack)
-