Closed Qendolin closed 3 years ago
I will try to look at when I have the time and energy. Both connectible and connectable are correct.
I'll try to look into it myself and open a PR but idk if I have time. (sure both a fine but -able is 'more' correct)
The fix is quite easy so I won't make a PR.
In ChainKnotEntity.attachChain
change the return type to boolean and add these two checks to prevent overlapping connections:
// Check if we have a connection to them
if(this.holdingEntities.containsKey(entity.getId())) return false;
// Check if they have a connection to us
if(entity instanceof ChainKnotEntity knot && knot.holdingEntities.containsKey(this.getId())) {
return false;
}
Also return true at the end of the function.
Then in ConnectibleChains:66
change
} else {
knot.attachChain(player, true, 0);
knot.onPlace();
to
} else if(knot.attachChain(player, true, 0)) {
knot.onPlace();
With this simple fix nothing will happen when trying to connect to a fence where a connection already exists.
Also in ChainKnotEntity
you could add this check at the start of createCollision
but it's not required
if(COLLISION_STORAGE.containsKey(entity.getId())) return;
PS: Not tested in multiplayer
The same two fences or walls can be connected multiple times which leads to multiple issues.
How to reproduce:
Note that the issue does not happen when one connection is formed from A to B and another one from B to A.
Environment: Minecraft 1.17.1 Connectible Chains 1.2.2
ps: connect A ble would be the correct word (not connect I ble)