public class ItemPowerableHelpers
extends java.lang.Object
| Constructor and Description |
|---|
ItemPowerableHelpers() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addPostInformation(net.minecraft.item.ItemStack itemStack,
java.util.List<net.minecraft.util.text.ITextComponent> lines)
Add the power to the item information, should be called after super.
|
static void |
addPreInformation(net.minecraft.item.ItemStack itemStack,
java.util.List<net.minecraft.util.text.ITextComponent> lines)
Add the power to the item information, should be called before super.
|
static int |
getPower(net.minecraft.item.ItemStack itemStack)
Get the power level of the given ItemStack.
|
static boolean |
onPowerableItemItemRightClick(net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.player.PlayerEntity player,
int powerLevels,
boolean onSneak)
Should be called by powerable items on right click.
|
static void |
setPower(net.minecraft.item.ItemStack itemStack,
int power)
Set the power level of the given ItemStack.
|
public static int getPower(net.minecraft.item.ItemStack itemStack)
itemStack - The item to check.public static void setPower(net.minecraft.item.ItemStack itemStack,
int power)
itemStack - The item to change.power - The new power level.public static boolean onPowerableItemItemRightClick(net.minecraft.item.ItemStack itemStack,
net.minecraft.world.World world,
net.minecraft.entity.player.PlayerEntity player,
int powerLevels,
boolean onSneak)
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.public static void addPreInformation(net.minecraft.item.ItemStack itemStack,
java.util.List<net.minecraft.util.text.ITextComponent> lines)
itemStack - The itemstack with a powerlines - The lines to add the information to.public static void addPostInformation(net.minecraft.item.ItemStack itemStack,
java.util.List<net.minecraft.util.text.ITextComponent> lines)
itemStack - The itemstack with a powerlines - The lines to add the information to.