package org.freeforums.geforce.securitycraft.blocks; import net.minecraft.block.Block; import net.minecraft.block.BlockFenceGate; import net.minecraft.block.ITileEntityProvider; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; import org.freeforums.geforce.securitycraft.main.mod_SecurityCraft; import org.freeforums.geforce.securitycraft.tileentity.TileEntityOwnable; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class BlockReinforcedFenceGate extends BlockFenceGate implements ITileEntityProvider{ public BlockReinforcedFenceGate(){ super(); } /** * Called upon block activation (right click on the block.) */ public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { return false; } public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack){ super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack); ((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId(), par5EntityLivingBase.getCommandSenderName()); } public void breakBlock(World par1World, int par2, int par3, int par4, Block par5Block, int par6) { super.breakBlock(par1World, par2, par3, par4, par5Block, par6); par1World.removeTileEntity(par2, par3, par4); } public boolean onBlockEventReceived(World par1World, int par2, int par3, int par4, int par5, int par6) { super.onBlockEventReceived(par1World, par2, par3, par4, par5, par6); TileEntity tileentity = par1World.getTileEntity(par2, par3, par4); return tileentity != null ? tileentity.receiveClientEvent(par5, par6) : false; } /** * Gets the block's texture. Args: side, meta */ @SideOnly(Side.CLIENT) public IIcon getIcon(int p_149691_1_, int p_149691_2_) { return mod_SecurityCraft.doorIndestructableIron.getBlockTextureFromSide(p_149691_1_); } public TileEntity createNewTileEntity(World var1, int var2) { return new TileEntityOwnable(); } }