diff --git a/src/main/java/techreborn/init/ModItems.java b/src/main/java/techreborn/init/ModItems.java index cba8404eb..c6d797227 100644 --- a/src/main/java/techreborn/init/ModItems.java +++ b/src/main/java/techreborn/init/ModItems.java @@ -273,7 +273,7 @@ public class ModItems wrench = new ItemWrench(); registerItem(wrench, "wrench"); - nanosaber = new ItemNanosaber(); + nanosaber = PoweredItem.createItem(ItemNanosaber.class); registerItem(nanosaber, "nanosaber"); scrapBox = new ItemScrapBox(); diff --git a/src/main/java/techreborn/items/tools/ItemNanosaber.java b/src/main/java/techreborn/items/tools/ItemNanosaber.java index 862ff6054..c8d96bc0a 100644 --- a/src/main/java/techreborn/items/tools/ItemNanosaber.java +++ b/src/main/java/techreborn/items/tools/ItemNanosaber.java @@ -97,7 +97,6 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo ItemStack inactiveUncharged = new ItemStack(ModItems.nanosaber); inactiveUncharged.setTagCompound(new NBTTagCompound()); inactiveUncharged.getTagCompound().setBoolean("isActive", false); - PoweredItem.setEnergy(0, inactiveUncharged); ItemStack inactiveCharged = new ItemStack(ModItems.nanosaber); inactiveCharged.setTagCompound(new NBTTagCompound()); @@ -107,7 +106,6 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo ItemStack activeUncharged = new ItemStack(ModItems.nanosaber); activeUncharged.setTagCompound(new NBTTagCompound()); activeUncharged.getTagCompound().setBoolean("isActive", true); - PoweredItem.setEnergy(0, activeUncharged); ItemStack activeCharged = new ItemStack(ModItems.nanosaber); activeCharged.setTagCompound(new NBTTagCompound()); @@ -169,9 +167,14 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo @Override public double getDurabilityForDisplay(ItemStack stack) { + if (PoweredItem.getEnergy(stack) > getMaxPower(stack)) + { + return 0; + } double charge = (PoweredItem.getEnergy(stack) / getMaxPower(stack)); return 1 - charge; + } @Override public boolean isRepairable()