This commit is contained in:
modmuss50 2018-04-18 15:59:08 +01:00
parent 09a75893e4
commit 90e0ea23b9

View file

@ -190,10 +190,12 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
@Override @Override
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
if (stack.getTagCompound() != null && stack.getTagCompound().getBoolean("isActive") && !PoweredItem.canUseEnergy(cost, stack)) { if (stack.getTagCompound() != null && stack.getTagCompound().getBoolean("isActive") && !PoweredItem.canUseEnergy(cost, stack)) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( if(worldIn.isRemote){
TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyError") + " " ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
+ TextFormatting.GOLD + I18n TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyError") + " "
.format("techreborn.message.nanosaberDeactivating"))); + TextFormatting.GOLD + I18n
.format("techreborn.message.nanosaberDeactivating")));
}
stack.getTagCompound().setBoolean("isActive", false); stack.getTagCompound().setBoolean("isActive", false);
} }
} }