Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mrkirby153.periodicraft;
- import cpw.mods.fml.common.registry.GameRegistry;
- import net.minecraft.src.Block;
- import net.minecraft.src.BlockContainer;
- import net.minecraft.src.EntityPlayer;
- import net.minecraft.src.Material;
- import net.minecraft.src.TileEntity;
- import net.minecraft.src.World;
- public class BlockPam extends BlockContainer{
- public BlockPam(int par1, int par2) {
- super(par1, par2, Material.rock);
- this.setCreativeTab(periodiCraft_main.tabPeriodicraft_Block);
- this.blockHardness = 1F;
- this.blockResistance = 1F;
- GameRegistry.registerBlock(this);
- }
- @Override
- public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) {
- if(!world.isRemote){
- TileEntityPAM p =(TileEntityPAM) world.getBlockTileEntity(par2, par3, par4);
- p.create(par5EntityPlayer, world);
- }
- if(par5EntityPlayer.isSneaking()){
- if(!world.isRemote){
- TileEntityPAM p =(TileEntityPAM) world.getBlockTileEntity(par2, par3, par4);
- p.clearRecipie(world);
- }
- return false;
- }
- return true;
- }
- public boolean hasTileEntity(int metadata){
- return true;
- }
- @Override
- public TileEntity createNewTileEntity(World world){
- try{
- return new TileEntityPAM();
- }catch (Exception var3){
- throw new RuntimeException(var3);
- }
- }
- public int getBlockTextureFromSide(int par1)
- {
- switch(par1){
- case 1: return 43;
- case 2: return 48;
- case 3: return 48;
- case 4: return 48;
- case 5: return 48;
- case 6: return 48;
- }
- return 5;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment