From 69eb4387f292da3de0a4d584bc43afa2d37fbe31 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 27 Sep 2024 16:41:31 +0200 Subject: [PATCH] fixed mouse being centered when switching between pipe tabs --- .../java/de/ellpeck/prettypipes/packets/PacketButton.java | 4 ++++ .../java/de/ellpeck/prettypipes/pipe/PipeBlockEntity.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/de/ellpeck/prettypipes/packets/PacketButton.java b/src/main/java/de/ellpeck/prettypipes/packets/PacketButton.java index 7f868c2..b9b6f9c 100644 --- a/src/main/java/de/ellpeck/prettypipes/packets/PacketButton.java +++ b/src/main/java/de/ellpeck/prettypipes/packets/PacketButton.java @@ -80,6 +80,10 @@ public record PacketButton(BlockPos pos, int result, List data) impleme return ((IModule) stack.getItem()).getContainer(stack, tile, windowId, inv, player, data.getFirst()); } + @Override + public boolean shouldTriggerClientSideContainerClosingOnOpen() { + return false; + } }, buf -> { buf.writeBlockPos(pos); buf.writeInt(data.getFirst()); diff --git a/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlockEntity.java b/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlockEntity.java index 11f7b9a..554f458 100644 --- a/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlockEntity.java +++ b/src/main/java/de/ellpeck/prettypipes/pipe/PipeBlockEntity.java @@ -427,6 +427,11 @@ public class PipeBlockEntity extends BlockEntity implements MenuProvider, IPipeC return new MainPipeContainer(Registry.pipeContainer, window, player, PipeBlockEntity.this.worldPosition); } + @Override + public boolean shouldTriggerClientSideContainerClosingOnOpen() { + return false; + } + @Override public ConnectionType getConnectionType(BlockPos pipePos, Direction direction) { var state = this.level.getBlockState(pipePos.relative(direction));