What I expected to happen was...:
The blocks should have connected while being pushed.
What actually happened was...:
When they were being pushed, they connected to solid blocks but not to each other.
Steps to Reproduce:
1. Push multiple bars, panes, fences or walls with a piston.
2. Put solid blocks next to them.
3. They will connect to the solid blocks but not to each other while they are pushed.
Linked issues
is duplicated by 3
relates to 4
Attachments
Comments 20
(Perhaps a moderator would adjust the summary to remove the pistons part, as that seems to be irrelevant for this issue.)
The behavior seems to have nothing to do with pistons, but with the overall visual rendering of all the "slim" shaped blocks (fences, panes, bars, walls, fencegates). See the screenshot 'borked_fences.png' (which is with 1.4.7 and no pistons needed).
I made the necessary fixes to connect each of them with each other type, and now it works also when they are both in static case and when been moved by pistons. That is, they automatically connect or "switch direction" as needed after moved. In fact, it is impossible to move them so that they would keep their original orientation (except fencegate), as there is no direction info (except for that fencegate). See the screenshot 'fixed_fences_pistons.png' for the fixed situation.
The needed code changes are quite small and straight forward... coming right up...
Fixes
BlockPane
public final boolean canThisPaneConnectToThisBlockID(int par1) {
return Block.opaqueCubeLookup[par1] || par1 == Block.thinGlass.blockID || par1 == Block.glass.blockID // MINOR CHANGE
|| par1 == Block.fence.blockID || par1 == Block.fenceIron.blockID // ADDED
|| par1 == Block.netherFence.blockID || par1 == Block.cobblestoneWall.blockID // ADDED
|| par1 == Block.fenceGate.blockID; // ADDED
}
BlockFence
public boolean canConnectFenceTo(IBlockAccess blockAccess, int par2, int par3, int par4) {
int bid = blockAccess.getBlockId(par2, par3, par4);
if (bid != Block.fence.blockID && bid != Block.fenceGate.blockID // MINOR CHANGE
&& bid != Block.fenceIron.blockID && bid != Block.netherFence.blockID // ADDED
&& bid != Block.cobblestoneWall.blockID && bid != Block.thinGlass.blockID) { // ADDED
...
BlockWall
public boolean canConnectWallTo(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {
int var5 = par1IBlockAccess.getBlockId(par2, par3, par4);
if (var5 != this.blockID && var5 != Block.fenceGate.blockID
&& var5 != Block.fenceIron.blockID && var5 != Block.netherFence.blockID // ADDED
&& var5 != Block.fence.blockID && var5 != Block.thinGlass.blockID) { // ADDED
...
The minor changes are needed so that iron bars connect to glass panes, and for nether fences to connect with normal fences. Also note that fence gate orientation is not checked, but it wasn't checked earlier either (for those blocks with which there was connection), but that would be another bug/"feature".
Fixes tested on 1.4.7
I'd change all these block types to use a single method, along the lines of "isSlimFenceStyleBlockWithAutoOrientation()" and adjust the fixes correspondingly. That would make the code cleaner, and would be more "future proof". (This issue is a good example what happens when that guideline is not followed.) The above fixes are in the current design/style just to keep the fixes simple and easier to understand what the change does.
Note that some of them do not connect visually well (especially walls and fences), but then again, the current way of not connecting at all looks even worse.
Since several different bugs were made duplicates of this issue, but only one part of them was now fixed and/or made WAI, it might be proper to detach and reopen the other ones. For example, have the bars/panes or connecting to back of stairs been fixed or declared WAI (latter would be just stupid, imho)?
Or maybe better to actually detach the MC-27428 and MC-34985 from this and declare them as WAI, leave this one open.
Edit: would also be nice if Mojang would stop using Twitter as the official bug management system. Apparently reporting issues there works, and Mojang likes to state the results there, too, instead of this JIRA.
That still leaves (partially overlapping) issues:
MC-10613 Fences doesn't connect with stairs
MC-11527 Iron Bars & Glass Panes with Cobblestone Walls
MC-20733 Glass Panes do not connect to iron bars
MC-35272 Iron bars/glass panes sticky piston graphical glitch
MC-35665 Glass panes don't join up correctly with ice blocks
MC-41886 Piston Glass Bug
MC-49644 Glass panes not connecting to ice
I think MC-36454 Fences Not Attaching is also WAI and should now be detached.
That is why I thought it might be better leave this issue open, as it is mostly about other issues than the ones that have now been solved. The way the issues are now marked, the fence vs. wall connection resolved as WAI and marked (previously) to this issue translates to all the other issues marked as WAI, too (via duplication resolution) 😛
Where is the bug ? That's at most an annoyance.