feat: added crude fastcraft
This commit is contained in:
parent
939a0f7a40
commit
34b96b67d3
1 changed files with 39 additions and 0 deletions
39
src/main/java/ftbsc/bscv/modules/self/FastCraft.java
Normal file
39
src/main/java/ftbsc/bscv/modules/self/FastCraft.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package ftbsc.bscv.modules.self;
|
||||
|
||||
import com.google.auto.service.AutoService;
|
||||
import ftbsc.bscv.api.ILoadable;
|
||||
import ftbsc.bscv.modules.AbstractModule;
|
||||
import ftbsc.bscv.tools.Inventory;
|
||||
import ftbsc.bscv.tools.Setting;
|
||||
import net.minecraft.client.gui.screen.inventory.InventoryScreen;
|
||||
import net.minecraft.inventory.container.ClickType;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.event.TickEvent.ClientTickEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
@AutoService(ILoadable.class)
|
||||
public class FastCraft extends AbstractModule {
|
||||
|
||||
public final ForgeConfigSpec.ConfigValue<Boolean> drop;
|
||||
|
||||
public FastCraft() {
|
||||
super();
|
||||
|
||||
this.drop = Setting.Bool.builder()
|
||||
.fallback(false)
|
||||
.name("drop")
|
||||
.comment("throw cradted items away instead of moving them back in inventory")
|
||||
.build(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTick(ClientTickEvent event) {
|
||||
if (MC.screen == null) return;
|
||||
if (!(MC.screen instanceof InventoryScreen)) return;
|
||||
InventoryScreen inventory = (InventoryScreen) MC.screen;
|
||||
if (inventory.getMenu().slots.get(0).hasItem()) {
|
||||
// TODO can we throw them all? like this it throws one by one
|
||||
Inventory.clickSlot(0, this.drop.get() ? ClickType.THROW : ClickType.QUICK_MOVE);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue