Clean up global state for cable render mode (#4539)

* Clean up the global state used to hack part interaction into respecting
the player's facade render mode. Make the name more indicative of
what is actually happening.

* Fun.
This commit is contained in:
shartte
2020-08-03 14:46:39 +02:00
committed by GitHub
parent 1801302d8f
commit 872d8d33cb
7 changed files with 50 additions and 29 deletions
@@ -330,11 +330,12 @@ public class PartPlacement {
}
private static SelectedPart selectPart(final PlayerEntity player, final IPartHost host, final Vector3d pos) {
AppEng.proxy.updateRenderMode(player);
final SelectedPart sp = host.selectPart(pos);
AppEng.proxy.updateRenderMode(null);
return sp;
AppEng.proxy.setPartInteractionPlayer(player);
try {
return host.selectPart(pos);
} finally {
AppEng.proxy.setPartInteractionPlayer(null);
}
}
public static IFacadePart isFacade(final ItemStack held, final AEPartLocation side) {