mojira.dev

Rando Jones

Assigned

No issues.

Reported

No issues.

Comments

Affects version 14w28a as well.

Using code from MCP 9.08 for MC1.7.10 I've been able to correct this in my personal mod with the following changes:

blocks/BlockFence.java

public void addCollisionBoxesToList(World par1, int par2, int par3, int par4, AxisAlignedBB par5, List par6, Entity par7)
    {
        boolean var8 = this.func_149826_e(par1, par2, par3, par4 - 1) && (!(par1.getBlock(par2, par3, par4 - 1) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2, par3, par4 - 1) & 1) == 1);
        boolean var9 = this.func_149826_e(par1, par2, par3, par4 + 1) && (!(par1.getBlock(par2, par3, par4 + 1) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2, par3, par4 + 1) & 1) == 1);
        boolean var10 = this.func_149826_e(par1, par2 - 1, par3, par4) && (!(par1.getBlock(par2 - 1, par3, par4) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2 - 1, par3, par4) & 1) == 0);
        boolean var11 = this.func_149826_e(par1, par2 + 1, par3, par4) && (!(par1.getBlock(par2 + 1, par3, par4) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2 + 1, par3, par4) & 1) == 0);
.
.
.

    public void setBlockBoundsBasedOnState(IBlockAccess par1, int par2, int par3, int par4)
    {
        boolean var5 = this.func_149826_e(par1, par2, par3, par4 - 1) && (!(par1.getBlock(par2, par3, par4 - 1) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2, par3, par4 - 1) & 1) == 1);
        boolean var6 = this.func_149826_e(par1, par2, par3, par4 + 1) && (!(par1.getBlock(par2, par3, par4 + 1) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2, par3, par4 + 1) & 1) == 1);
        boolean var7 = this.func_149826_e(par1, par2 - 1, par3, par4) && (!(par1.getBlock(par2 - 1, par3, par4) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2 - 1, par3, par4) & 1) == 0);
        boolean var8 = this.func_149826_e(par1, par2 + 1, par3, par4) && (!(par1.getBlock(par2 + 1, par3, par4) instanceof BlockFenceGate) || (par1.getBlockMetadata(par2 + 1, par3, par4) & 1) == 0);
.
.
.
   public boolean func_149826_e(IBlockAccess par1, int par2, int par3, int par4)
    {
        Block var5 = par1.getBlock(par2, par3, par4);
        
        boolean ret = (var5 == this);
        if (!ret)
        {
	        if (var5 instanceof BlockFence)
	        {
	        	ret = this.blockMaterial == var5.blockMaterial;
	        }
	        else if (var5 instanceof BlockFenceGate)
	        {
	        	ret = true;
	        }
	        else if (var5.blockMaterial.isOpaque() && var5.renderAsNormalBlock())
	        {
	        	ret = var5.blockMaterial != Material.field_151572_C; //don't connect to melons or pumpkins
	        	ret = ret && var5 != Blocks.hay_block;
	        }
        }
        else //always connect to self
        {
        	ret = true;
        }
        
        return ret;
    }

client/renderer/RenderBlocks.java

public boolean renderBlockFence(BlockFence par1, int par2, int par3, int par4)
    {
.
.
.
				Block nearBlock = null;

        if (par1.func_149826_e(this.blockAccess, par2 - 1, par3, par4) || par1.func_149826_e(this.blockAccess, par2 + 1, par3, par4))
        {
            if (!(this.blockAccess.getBlock(par2 - 1, par3, par4) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2 - 1, par3, par4) & 1) == 0)
            {
            	var8 = true;
            }
            else if (!(this.blockAccess.getBlock(par2 + 1, par3, par4) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2 + 1, par3, par4) & 1) == 0)
            {
            	var8 = true;
            }
        }

        if (par1.func_149826_e(this.blockAccess, par2, par3, par4 - 1) || par1.func_149826_e(this.blockAccess, par2, par3, par4 + 1))
        {
            if (!(this.blockAccess.getBlock(par2, par3, par4 - 1) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2, par3, par4 - 1) & 1) == 1)
            {
            	var9 = true;
            }
            else if (!(this.blockAccess.getBlock(par2, par3, par4 + 1) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2, par3, par4 + 1) & 1) == 1)
            {
            	var9 = true;
            }
				}

        boolean var10 = par1.func_149826_e(this.blockAccess, par2 - 1, par3, par4) && (!(this.blockAccess.getBlock(par2 - 1, par3, par4) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2 - 1, par3, par4) & 1) == 0);
        boolean var11 = par1.func_149826_e(this.blockAccess, par2 + 1, par3, par4) && (!(this.blockAccess.getBlock(par2 + 1, par3, par4) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2 + 1, par3, par4) & 1) == 0); 
        boolean var12 = par1.func_149826_e(this.blockAccess, par2, par3, par4 - 1) && (!(this.blockAccess.getBlock(par2, par3, par4 - 1) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2, par3, par4 - 1) & 1) == 1);
        boolean var13 = par1.func_149826_e(this.blockAccess, par2, par3, par4 + 1) && (!(this.blockAccess.getBlock(par2, par3, par4 + 1) instanceof BlockFenceGate) || (this.blockAccess.getBlockMetadata(par2, par3, par4 + 1) & 1) == 1);
.
.
.

Sorry to dump this on you - I hope your open to coding changes with actual code examples. I just made a suggestion in reddit/minecraftSuggestions about this very issue.

This same code can be used to fix BlockWall as well.

Note that changes to BlockFence.java/func_149826_e contain some alterations to make fences not connect to melons or hay blocks; exclude that at your preference.

Yes, this is still an issue in 14w05a, for hoes at least (I just checked it).

Hoes don't play a break sound when you use up the last point of their durability (0 of x points left) tilling dirt. Other tools (pickaxe, shovel, axe, sword, ...) don't play a break sound or break animation when using the last of their durability attacking a mob, but do both when breaking blocks with them.