From 63cfbaa56ccf67da7b65cf058a68a4b843af5748 Mon Sep 17 00:00:00 2001 From: alemi Date: Sun, 26 Nov 2023 00:07:22 +0100 Subject: feat[containercleaner]: throw whole stacks --- src/main/java/ftbsc/bscv/modules/self/ContainerCleaner.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/ftbsc/bscv/modules/self/ContainerCleaner.java b/src/main/java/ftbsc/bscv/modules/self/ContainerCleaner.java index 059c4bb..c53fed0 100644 --- a/src/main/java/ftbsc/bscv/modules/self/ContainerCleaner.java +++ b/src/main/java/ftbsc/bscv/modules/self/ContainerCleaner.java @@ -24,6 +24,7 @@ public class ContainerCleaner extends AbstractModule { public final ForgeConfigSpec.ConfigValue cooldown; public final ForgeConfigSpec.ConfigValue limit; + public final ForgeConfigSpec.ConfigValue all; public final ForgeConfigSpec.ConfigValue> blacklist; private int counter; @@ -43,6 +44,12 @@ public class ContainerCleaner extends AbstractModule { .comment("limit to one action per tick") .build(this); + this.all = Setting.Bool.builder() + .fallback(true) + .name("all") + .comment("throw whole stacks instead of single items") + .build(this); + this.blacklist = new Setting.Many(ItemArgument.item(), ItemInput.class) .writer(x -> Item.getId(x.getItem())) .fallback(new ArrayList()) @@ -62,7 +69,8 @@ public class ContainerCleaner extends AbstractModule { ContainerScreen screen = (ContainerScreen) MC.screen; for (Slot slot : screen.getMenu().slots) { if (this.blacklist.get().contains(Item.getId(slot.getItem().getItem()))) { - Inventory.clickSlot(screen.getMenu().containerId, slot.index, ClickType.THROW); + int button = this.all.get() ? 1 : 0; + Inventory.clickSlot(screen.getMenu().containerId, slot.index, button, ClickType.THROW); this.counter = this.cooldown.get(); if (this.limit.get()) return; // only throw one item per tick } -- cgit v1.2.3-56-ga3b1