public boolean onItemUse( ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par7 != 1) { return false; } else { ++par5; Block block = this.doorBlock; if (par2EntityPlayer.canPlayerEdit(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.canPlayerEdit(par4, par5 + 1, par6, par7, par1ItemStack)) { if (!block.canPlaceBlockAt(par3World, par4, par5, par6)) { return false; } else { int i1 = MathHelper.floor_double( (double) ((par2EntityPlayer.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; ItemDoor.placeDoorBlock(par3World, par4, par5, par6, i1, block); --par1ItemStack.stackSize; return true; } } else { return false; } } }
protected void func_74881_a( World p_74881_1_, StructureBoundingBox p_74881_2_, Random p_74881_3_, int p_74881_4_, int p_74881_5_, int p_74881_6_, int p_74881_7_) { int var8 = this.func_74865_a(p_74881_4_, p_74881_6_); int var9 = this.func_74862_a(p_74881_5_); int var10 = this.func_74873_b(p_74881_4_, p_74881_6_); if (p_74881_2_.func_78890_b(var8, var9, var10)) { ItemDoor.func_77869_a(p_74881_1_, var8, var9, var10, p_74881_7_, Block.field_72054_aE); } }