@SideOnly(Side.CLIENT)
 public int getDisplayColorAtRelativePosition(World world, int x, int y, int z) {
   TileEntityControlRod rod = this.getControlRodAtRelativePosition(world, x, y, z);
   if (rod != null) {
     if (((TileEntityCPU) controller.getTileEntity()).getPower() >= this.getMinPower())
       return rod.isActive() ? 0x00ff00 : 0xff0000;
     else return 0xa0a0a0;
   }
   return 0x6a6a6a;
 }
Exemplo n.º 2
0
 public void readFromNBT(NBTTagCompound tag) {
   NBTTagList li = tag.getTagList("locs", NBTTypes.COMPOUND.ID);
   for (Object o : li.tagList) {
     NBTTagCompound data = (NBTTagCompound) o;
     WorldLocation loc = WorldLocation.readFromNBT(data);
     TileEntity te = loc.getTileEntity();
     try {
       V v = (V) te;
       this.data.put(loc, v);
     } catch (ClassCastException e) { // ugly, but no other way to test if te instanceof V
       ReikaJavaLibrary.pConsole("Tried to load a TileEntityCache from invalid NBT!");
     }
   }
 }