public static void addEmpoweredTip(IMultiModeItem item, ItemStack stack, List<String> tooltip) { if (item.getMode(stack) == 1) { tooltip.add(StringHelper.localizeFormat("info.redstonearsenal.tool.chargeOff", StringHelper.getKeyName(KeyBindingItemMultiMode.INSTANCE.getKey()))); } else { tooltip.add(StringHelper.localizeFormat("info.redstonearsenal.tool.chargeOn", StringHelper.getKeyName(KeyBindingItemMultiMode.INSTANCE.getKey()))); } }
/** * Decrement the current mode of an item. */ default boolean decrMode(ItemStack stack) { if (getNumModes(stack) <= 1) { return false; } if (!stack.hasTagCompound()) { stack.setTagCompound(new NBTTagCompound()); } int curMode = getMode(stack); curMode--; if (curMode <= 0) { curMode = getNumModes(stack) - 1; } stack.getTagCompound().setInteger("Mode", curMode); return true; }
/** * Increment the current mode of an item. */ default boolean incrMode(ItemStack stack) { if (getNumModes(stack) <= 1) { return false; } if (!stack.hasTagCompound()) { stack.setTagCompound(new NBTTagCompound()); } int curMode = getMode(stack); curMode++; if (curMode >= getNumModes(stack)) { curMode = 0; } stack.getTagCompound().setInteger("Mode", curMode); return true; }