예제 #1
0
 @Override
 public void updateTick(World world, int x, int y, int z, Random random) {
   IEnergy tileEntity = (IEnergy) world.getTileEntity(x, y, z);
   ((TileEntityBattery) tileEntity).updateEntity();
   world.scheduleBlockUpdate(x, y, z, this, 1);
 }
예제 #2
0
 @SideOnly(Side.CLIENT)
 public IIcon getIcon(int side, int meta) {
   if (side == 0) {
     if (tileentity != null && tileentity.outputSide == ForgeDirection.DOWN) {
       return bottomIconOutput;
     } else return bottomIcon;
   } else if (side == 1) {
     if (tileentity != null && tileentity.outputSide == ForgeDirection.UP) {
       return topIconOutput;
     } else return topIcon;
   } else if (side == 2) {
     if (tileentity != null && tileentity.outputSide == ForgeDirection.NORTH) {
       return sideIconOutput;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) == 0) {
       return sideIconEmpty;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 12) {
       return sideIcon12;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 25) {
       return sideIcon25;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 37) {
       return sideIcon37;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 50) {
       return sideIcon50;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 62) {
       return sideIcon62;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 75) {
       return sideIcon75;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 87) {
       return sideIcon87;
     } else return sideIconFull;
   } else if (side == 3) {
     if (tileentity != null && tileentity.outputSide == ForgeDirection.SOUTH) {
       return sideIconOutput;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) == 0) {
       return sideIconEmpty;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 12) {
       return sideIcon12;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 25) {
       return sideIcon25;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 37) {
       return sideIcon37;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 50) {
       return sideIcon50;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 62) {
       return sideIcon62;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 75) {
       return sideIcon75;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 87) {
       return sideIcon87;
     } else return sideIconFull;
   } else if (side == 4) {
     if (tileentity != null && tileentity.outputSide == ForgeDirection.WEST) {
       return sideIconOutput;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) == 0) {
       return sideIconEmpty;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 12) {
       return sideIcon12;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 25) {
       return sideIcon25;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 37) {
       return sideIcon37;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 50) {
       return sideIcon50;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 62) {
       return sideIcon62;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 75) {
       return sideIcon75;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 87) {
       return sideIcon87;
     } else return sideIconFull;
   } else if (side == 5) {
     if (tileentity != null && tileentity.outputSide == ForgeDirection.EAST) {
       return sideIconOutput;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) == 0) {
       return sideIconEmpty;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 12) {
       return sideIcon12;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 25) {
       return sideIcon25;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 37) {
       return sideIcon37;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 50) {
       return sideIcon50;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 62) {
       return sideIcon62;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 75) {
       return sideIcon75;
     } else if (tileentity != null && tileentity.getEnergyBar().getEnergyScaled(100) <= 87) {
       return sideIcon87;
     } else return sideIconFull;
   }
   return sideIconEmpty;
 }