When a fence gate is between 2 cobblestone walls, the fence gate has incorrect hitboxes.
Related issues
relates to
Attachments
Comments


I think that's intented as you could jump over those gates if they would lower the collision box.

@Meta
The selection box and collision box are different things - look at fences or stone walls.

Intended.
They want to control the fence gate's height without changing the selection box (As that would require a new metadata value rather than an NBT)
The fence model gets lowered to match the cobblestone wall's height, but they don't want to change the selection box, resulting in the small gap between the top of the gate and the top of the collision box.

The rendering code adjusts the rendered height location of the gate depending on what it has on its sides. I see no reason why the code which decides the selection box could not do the same just as well, it is just a bit more coding (or, as customary in Minecraft code, copying). No changes to metadata is needed for that.

And another bites the dust.
Current code
BlockFenceGate
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {
int var5 = getDirection(blockAccess.getBlockMetadata(x, y, z));
if (var5 != 2 && var5 != 0) {
this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F);
} else {
this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F);
}
}
Fixed
BlockFenceGate
public void setBlockBoundsBasedOnState(IBlockAccess blockAccess, int x, int y, int z) {
int var5 = getDirection(blockAccess.getBlockMetadata(x, y, z));
if (var5 != 2 && var5 != 0) {
if (blockAccess.getBlockId(x, y, z - 1) == Block.cobblestoneWall.blockID
&& blockAccess.getBlockId(x, y, z + 1) == Block.cobblestoneWall.blockID)
this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 0.8125F, 1.0F); // Lower the top
else
this.setBlockBounds(0.375F, 0.0F, 0.0F, 0.625F, 1.0F, 1.0F);
} else {
if (blockAccess.getBlockId(x - 1, y, z) == Block.cobblestoneWall.blockID
&& blockAccess.getBlockId(x + 1, y, z) == Block.cobblestoneWall.blockID)
this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 0.8125F, 0.625F); // Lower the top
else
this.setBlockBounds(0.0F, 0.0F, 0.375F, 1.0F, 1.0F, 0.625F);
}
}
Tested on 1.4.7 very briefly. May have some unexpected side results, but at least adding and removing worked as expected, and the selection box got adjusted as wished. I attached a screenshot showing the result.
However, while testing I noticed that at least in my opinion, the logical operation between the two cobblestone walls should be "or" instead of "and". It looks quite stupid as it is now, as the fencegate will be higher than the lower side block. (As also seen in the screenshot). If changed, there are two places to do the same change. This method here, and also in the RenderBlocks-class.

Affects 13w09b.

:/

A 20 seconds test in creative mode confirms this exists in 1.6.2 (as expected).

Affects 1.6.4.

Confirmed for 08a

Confirmed for 14w21b.

Confirmed for 14w25b

Confirmed in 1.8.1-pre2.
https://gfycat.com/PiercingCreativeHummingbird

Confirmed for 15w44b.

Still there in 15w47a.