Exemplo n.º 1
0
 @Override
 @SideOnly(Side.CLIENT)
 public void addInformation(
     ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
   list.add(
       Lang.localize("tile.enderio.blockCapacitorBank.tooltipPrefix", false)
           + " "
           + PowerDisplayUtil.formatPower(PowerHandlerUtil.getStoredEnergyForItem(itemStack))
           + " "
           + PowerDisplayUtil.abrevation());
   super.addInformation(itemStack, par2EntityPlayer, list, par4);
 }
Exemplo n.º 2
0
 @Override
 public void onBlockPlacedBy(
     World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
   if (world.isRemote) {
     return;
   }
   TileEntity te = world.getBlockTileEntity(x, y, z);
   if (te instanceof TileCapacitorBank) {
     TileCapacitorBank cb = (TileCapacitorBank) te;
     cb.addEnergy(PowerHandlerUtil.getStoredEnergyForItem(stack));
   }
   world.markBlockForUpdate(x, y, z);
 }
Exemplo n.º 3
0
 public static ItemStack createItemStackWithPower(float storedEnergy) {
   ItemStack res = new ItemStack(EnderIO.blockCapacitorBank);
   PowerHandlerUtil.setStoredEnergyForItem(res, storedEnergy);
   return res;
 }