Skip to content

Commit

Permalink
Check if pos is in multiblockPositions so chest tab is highlighted re…
Browse files Browse the repository at this point in the history
…gardless of which half is opened. (#21)
  • Loading branch information
Compasses authored Jan 6, 2024
1 parent d62d79b commit 1db5f0e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/folk/sisby/inventory_tabs/TabManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public static Tab guessOpenedTab(MinecraftClient client, HandledScreen<?> screen
BlockEntity blockEntity = world.getBlockEntity(pos);
for (Tab tab : tabs) {
if (tab instanceof BlockTab bt) {
if (pos.equals(bt.pos) || blockEntity == world.getBlockEntity(bt.pos)) return tab;
if (pos.equals(bt.pos) || blockEntity == world.getBlockEntity(bt.pos) || bt.multiblockPositions.contains(pos)) return tab;
}
}
} else if (client.crosshairTarget instanceof EntityHitResult result) {
Expand Down

0 comments on commit 1db5f0e

Please sign in to comment.