Skip to content

Commit 8bd3cda

Browse files
committed
Add an option to disable the inventory sorter when in creative mode
closes #4638
1 parent d2a3497 commit 8bd3cda

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/main/java/meteordevelopment/meteorclient/systems/modules/misc/InventoryTweaks.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package meteordevelopment.meteorclient.systems.modules.misc;
77

8+
import meteordevelopment.meteorclient.MeteorClient;
89
import meteordevelopment.meteorclient.events.entity.DropItemsEvent;
910
import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
1011
import meteordevelopment.meteorclient.events.meteor.KeyEvent;
@@ -101,6 +102,14 @@ public class InventoryTweaks extends Module {
101102
.build()
102103
);
103104

105+
private final Setting<Boolean> disableInCreative = sgSorting.add(new BoolSetting.Builder()
106+
.name("disable-in-creative")
107+
.description("Disables the inventory sorter when in creative mode.")
108+
.defaultValue(true)
109+
.visible(sortingEnabled::get)
110+
.build()
111+
);
112+
104113
// Auto Drop
105114

106115
private final Setting<List<Item>> autoDropItems = sgAutoDrop.add(new ItemListSetting.Builder()
@@ -272,7 +281,7 @@ private void onMouseButton(MouseButtonEvent event) {
272281
}
273282

274283
private boolean sort() {
275-
if (!sortingEnabled.get() || !(mc.currentScreen instanceof HandledScreen<?> screen) || sorter != null)
284+
if (!sortingEnabled.get() || !(mc.currentScreen instanceof HandledScreen<?> screen) || sorter != null || (mc.player.isCreative() && disableInCreative.get()))
276285
return false;
277286

278287
if (!mc.player.currentScreenHandler.getCursorStack().isEmpty()) {
@@ -359,7 +368,7 @@ private void moveSlots(ScreenHandler handler, int start, int end, boolean steal)
359368
try {
360369
Thread.sleep(sleep);
361370
} catch (InterruptedException e) {
362-
e.printStackTrace();
371+
MeteorClient.LOG.error("Error when sleeping the slot mover", e);
363372
}
364373
}
365374

0 commit comments

Comments
 (0)