| Type: | Bug | ||
| Reporter: | Leon | Assignee: | [Mojang] Grum (Erik Broes) |
| Resolution: | Fixed | Votes: | 10 |
| Labels: | fence_gate, hitbox | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||
| CHK: | |||||||||||||||||||||||||||||||||||||||||
| Confirmation Status: | Confirmed | ||||||||||||||||||||||||||||||||||||||||
| Description |
|
When a fence gate is between 2 cobblestone walls, the fence gate has incorrect hitboxes. |
| Comments |
| Comment by George Gates [ 19/Nov/15 ] |
|
Still there in 15w47a. |
| Comment by Alexander [ 30/Oct/15 ] |
|
Confirmed for 15w44b. |
| Comment by George Gates [ 18/Oct/14 ] |
|
Confirmed in 1.8.1-pre2. |
| Comment by Marcono1234 [ 19/Jun/14 ] |
|
Confirmed for 14w25b |
| Comment by Itouch2 [ 25/May/14 ] |
|
Confirmed for 14w21b. |
| Comment by Itouch2 [ 23/Feb/14 ] |
|
Confirmed for 08a |
| Comment by branza [ 06/Oct/13 ] |
|
Affects 1.6.4. |
| Comment by Markku [ 10/Jul/13 ] |
|
A 20 seconds test in creative mode confirms this exists in 1.6.2 (as expected). |
| Comment by Leon [ 25/Jun/13 ] |
|
:/ |
| Comment by Markku [ 28/Feb/13 ] |
|
Affects 13w09b. |
| Comment by Markku [ 09/Feb/13 ] |
|
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. |
| Comment by Markku [ 03/Feb/13 ] |
|
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. |
| Comment by Dean Baset [ 03/Feb/13 ] |
|
Intended. 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. |
| Comment by Alex Campbell [ 09/Nov/12 ] |
|
@Meta |
| Comment by Meta [ 02/Nov/12 ] |
|
I think that's intented as you could jump over those gates if they would lower the collision box. |