Advertisement
Guest User

CarbonCondenser - update texture onBlockActivated + getIco

a guest
Jul 29th, 2015
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.19 KB | None | 0 0
  1.     @Override
  2.     public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int face, float hitX, float hitY, float hitZ)
  3.     {
  4.         if (!world.isRemote)
  5.         {
  6.             player.openGui(LimpCraft2.INSTANCE, 0, world, x, y, z);
  7.  
  8.             ((TileEntityCarbonCondenser) world.getTileEntity(x, y, z)).meta = world.getBlockMetadata(x, y, z);
  9.             ((TileEntityCarbonCondenser) world.getTileEntity(x, y, z)).updateCircuitTextures(world, x, y, z);
  10.            
  11.             world.markBlockForUpdate(x, y, z);
  12.         }
  13.         return true;
  14.     }
  15.    
  16.     @Override
  17.     @SideOnly(Side.CLIENT)
  18.     public IIcon getIcon(IBlockAccess block, int x, int y, int z, int side)
  19.     {
  20.        
  21.         if (side == block.getBlockMetadata(x, y, z))
  22.         {
  23.             return this.sideFront;
  24.         }
  25.         if (side != block.getBlockMetadata(x, y, z))
  26.         {
  27.             if (side == ((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).top)
  28.             {
  29.                 if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sTop == 0)
  30.                 {
  31.                     System.out.println("0");
  32.                     return this.blockIcon;
  33.                 }
  34.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sTop == 1)
  35.                 {
  36.                     System.out.println("1");
  37.                     return this.sideImport;
  38.                 }
  39.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sTop == 2)
  40.                 {
  41.                     System.out.println("2");
  42.                     return this.sideExport;
  43.                 }
  44.             }
  45.             if (side == ((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).left)
  46.             {
  47.                 if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sLeft == 0)
  48.                 {
  49.                     return this.blockIcon;
  50.                 }
  51.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sLeft == 1)
  52.                 {
  53.                     return this.sideImport;
  54.                 }
  55.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sLeft == 2)
  56.                 {
  57.                     return this.sideExport;
  58.                 }
  59.             }
  60.             if (side == ((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).back)
  61.             {
  62.                 if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sBack == 0)
  63.                 {
  64.                     return this.blockIcon;
  65.                 }
  66.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sBack == 1)
  67.                 {
  68.                     return this.sideImport;
  69.                 }
  70.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sBack == 2)
  71.                 {
  72.                     return this.sideExport;
  73.                 }
  74.             }
  75.             if (side == ((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).right)
  76.             {
  77.                 if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sRight == 0)
  78.                 {
  79.                     return this.blockIcon;
  80.                 }
  81.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sRight == 1)
  82.                 {
  83.                     return this.sideImport;
  84.                 }
  85.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sRight == 2)
  86.                 {
  87.                     return this.sideExport;
  88.                 }
  89.             }
  90.             if (side == ((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).bot)
  91.             {
  92.                 if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sBot == 0)
  93.                 {
  94.                     return this.blockIcon;
  95.                 }
  96.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sBot == 1)
  97.                 {
  98.                     return this.sideImport;
  99.                 }
  100.                 else if (((TileEntityCarbonCondenser) block.getTileEntity(x, y, z)).sBot == 2)
  101.                 {
  102.                     return this.sideExport;
  103.                 }
  104.             }
  105.         }
  106.  
  107.         return this.blockIcon;
  108.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement