mrkirby153

Untitled

Dec 6th, 2012
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.65 KB | None | 0 0
  1. package mrkirby153.periodicraft;
  2.  
  3. import cpw.mods.fml.common.registry.GameRegistry;
  4. import net.minecraft.src.Block;
  5. import net.minecraft.src.BlockContainer;
  6. import net.minecraft.src.EntityPlayer;
  7. import net.minecraft.src.Material;
  8. import net.minecraft.src.TileEntity;
  9. import net.minecraft.src.World;
  10.  
  11. public class BlockPam extends BlockContainer{
  12.  
  13.     public BlockPam(int par1, int par2) {
  14.         super(par1, par2, Material.rock);
  15.         this.setCreativeTab(periodiCraft_main.tabPeriodicraft_Block);
  16.         this.blockHardness = 1F;
  17.         this.blockResistance = 1F;
  18.         GameRegistry.registerBlock(this);
  19.        
  20.        
  21.     }
  22.     @Override
  23.     public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
  24.  
  25.         if(!world.isRemote){
  26.             TileEntityPAM p =(TileEntityPAM) world.getBlockTileEntity(par2, par3, par4);
  27.             p.create(par5EntityPlayer, world);
  28.         }
  29.         if(par5EntityPlayer.isSneaking()){
  30.             if(!world.isRemote){
  31.                 TileEntityPAM p =(TileEntityPAM) world.getBlockTileEntity(par2, par3, par4);
  32.                 p.clearRecipie(world);
  33.             }
  34.             return false;
  35.         }
  36.         return true;
  37.        
  38.     }
  39.     public boolean hasTileEntity(int metadata){
  40.         return true;
  41.     }
  42.    
  43.     @Override
  44.     public TileEntity createNewTileEntity(World world){
  45.         try{
  46.             return new TileEntityPAM();
  47.         }catch (Exception var3){
  48.             throw new RuntimeException(var3);
  49.         }
  50.     }
  51.    
  52.     public int getBlockTextureFromSide(int par1)
  53.     {
  54.        switch(par1){
  55.        case 1: return 43;
  56.        case 2: return 48;
  57.        case 3: return 48;
  58.        case 4: return 48;
  59.        case 5: return 48;
  60.        case 6: return 48;
  61.        }
  62.        return 5;
  63.     }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment