Skip to content

Commit

Permalink
use hasInfiniteMaterials instead of isCreative
Browse files Browse the repository at this point in the history
  • Loading branch information
JaisDK committed Aug 8, 2024
1 parent 4469cfb commit 286ac51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/invtweaks/events/ClientEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public static void onMouseButtonPressed(ScreenEvent.MouseButtonPressed.Pre event
Slot slot = screen.getSlotUnderMouse();
if (slot != null) {
// Disable sort if in creative and has clicked a non-empty slot
if (Minecraft.getInstance().player.isCreative() && slot.hasItem()) {
if (Minecraft.getInstance().player != null && Minecraft.getInstance().player.hasInfiniteMaterials() && !slot.getItem().isEmpty()) {
return;
}
boolean isPlayerSort = Utils.isPlayerContainer(slot.container, screen, Minecraft.getInstance().player);
Expand Down

0 comments on commit 286ac51

Please sign in to comment.