Advertisement
Guest User

BlockStickyWorkbench

a guest
Dec 21st, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.25 KB | None | 0 0
  1. package net.minecraft.src;
  2.  
  3. import net.minecraft.client.Minecraft;
  4.  
  5. public class BlockStickyWorkbench extends Block
  6. {
  7.     public Minecraft mc;
  8.     public EntityClientPlayerMP player = mc.thePlayer;
  9.     protected BlockStickyWorkbench(int par1)
  10.     {
  11.         super(par1, Material.wood);
  12.         this.blockIndexInTexture = 59;
  13.         this.setCreativeTab(CreativeTabs.tabDecorations);
  14.     }
  15.  
  16.     /**
  17.      * Returns the block texture based on the side being looked at.  Args: side
  18.      */
  19.     public int getBlockTextureFromSide(int par1)
  20.     {
  21.         return par1 == 1 ? this.blockIndexInTexture - 16 : (par1 == 0 ? Block.planks.getBlockTextureFromSide(0) : (par1 != 2 && par1 != 4 ? this.blockIndexInTexture : this.blockIndexInTexture + 1));
  22.     }
  23.  
  24.     /**
  25.      * Called upon block activation (right click on the block.)
  26.      */
  27.     public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
  28.     {
  29.         if (par1World.isRemote)
  30.         {
  31.             return true;
  32.         }
  33.         else
  34.         {
  35.             mc.displayGuiScreen(new GuiStickyCrafting(player.inventory, player.worldObj, par2, par3, par4));
  36.             return true;
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement