mrkirby153

Untitled

Nov 24th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. package mrkirby153.periodicraft;
  2.  
  3. import cpw.mods.fml.common.registry.GameRegistry;
  4. import net.minecraft.src.BlockContainer;
  5. import net.minecraft.src.EntityPlayer;
  6. import net.minecraft.src.Material;
  7. import net.minecraft.src.TileEntity;
  8. import net.minecraft.src.World;
  9.  
  10. public class BlockPam extends BlockContainer{
  11.  
  12. public BlockPam(int par1, int par2) {
  13. super(par1, par2, Material.rock);
  14. this.setCreativeTab(periodiCraft_main.tabPeriodicraft_Block);
  15. this.blockHardness = 1F;
  16. this.blockResistance = 1F;
  17. GameRegistry.registerBlock(this);
  18. }
  19.  
  20. public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, float par6, float par7, float par8, float par9){
  21. if(!world.isRemote){
  22. TileEntityPAM p =(TileEntityPAM) world.getBlockTileEntity(par2, par3, par4);
  23. p.create(par5EntityPlayer, world);
  24. }
  25. return true;
  26. }
  27.  
  28. public boolean hasTileEntity(int metadata){
  29. return true;
  30. }
  31.  
  32. @Override
  33. public TileEntity createNewTileEntity(World world){
  34. try{
  35. return new TileEntityPAM();
  36. }catch (Exception var3){
  37. throw new RuntimeException(var3);
  38. }
  39. }
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment