Package org.cyclops.evilcraft.item
Class ItemPowerableHelpers
java.lang.Object
org.cyclops.evilcraft.item.ItemPowerableHelpers
Helpers for items.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddPostInformation(net.minecraft.world.item.ItemStack itemStack, List<net.minecraft.network.chat.Component> lines) Add the power to the item information, should be called after super.static voidaddPreInformation(net.minecraft.world.item.ItemStack itemStack, List<net.minecraft.network.chat.Component> lines) Add the power to the item information, should be called before super.static intgetPower(net.minecraft.world.item.ItemStack itemStack) Get the power level of the given ItemStack.static booleanonPowerableItemItemRightClick(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, int powerLevels, boolean onSneak) Should be called by powerable items on right click.static voidsetPower(net.minecraft.world.item.ItemStack itemStack, int power) Set the power level of the given ItemStack.
-
Constructor Details
-
ItemPowerableHelpers
public ItemPowerableHelpers()
-
-
Method Details
-
getPower
public static int getPower(net.minecraft.world.item.ItemStack itemStack) Get the power level of the given ItemStack.- Parameters:
itemStack- The item to check.- Returns:
- The power this Mace currently has.
-
setPower
public static void setPower(net.minecraft.world.item.ItemStack itemStack, int power) Set the power level of the given ItemStack.- Parameters:
itemStack- The item to change.power- The new power level.
-
onPowerableItemItemRightClick
public static boolean onPowerableItemItemRightClick(net.minecraft.world.item.ItemStack itemStack, net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, int powerLevels, boolean onSneak) Should be called by powerable items on right click.- Parameters:
itemStack- The item stack, this will possibly have an updated power level.world- The world.player- The playerpowerLevels- The maximum power levels.onSneak- If the action should be executed for a sneaking player.- Returns:
- If the power level was changed.
-
addPreInformation
public static void addPreInformation(net.minecraft.world.item.ItemStack itemStack, List<net.minecraft.network.chat.Component> lines) Add the power to the item information, should be called before super.- Parameters:
itemStack- The itemstack with a powerlines- The lines to add the information to.
-
addPostInformation
public static void addPostInformation(net.minecraft.world.item.ItemStack itemStack, List<net.minecraft.network.chat.Component> lines) Add the power to the item information, should be called after super.- Parameters:
itemStack- The itemstack with a powerlines- The lines to add the information to.
-