diff --git a/src/main/java/ftbsc/bscv/modules/motion/GuiMove.java b/src/main/java/ftbsc/bscv/modules/motion/GuiMove.java new file mode 100644 index 0000000..9d3bf1c --- /dev/null +++ b/src/main/java/ftbsc/bscv/modules/motion/GuiMove.java @@ -0,0 +1,49 @@ +package ftbsc.bscv.modules.motion; + +import com.google.auto.service.AutoService; + +import ftbsc.bscv.ICommons; +import ftbsc.bscv.api.ILoadable; +import ftbsc.bscv.modules.AbstractModule; +import net.minecraft.client.gui.screen.IngameMenuScreen; +import net.minecraft.client.gui.screen.OptionsScreen; +import net.minecraft.client.gui.screen.OptionsSoundsScreen; +import net.minecraft.client.gui.screen.VideoSettingsScreen; +import net.minecraft.client.gui.screen.inventory.ContainerScreen; +import net.minecraft.client.settings.KeyBinding; +import net.minecraft.client.util.InputMappings; +import net.minecraftforge.event.entity.living.LivingEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; + +@AutoService(ILoadable.class) +public class GuiMove extends AbstractModule implements ICommons { + + @SubscribeEvent + public void onPlayerUpdate(LivingEvent.LivingUpdateEvent event) { + if (MC.player == null) return; + if (event.getEntityLiving() != MC.player) return; + + KeyBinding[] keys = { + MC.options.keyUp, + MC.options.keyDown, + MC.options.keyLeft, + MC.options.keyRight, + MC.options.keyJump, + }; + + if ( + MC.screen instanceof ContainerScreen + || MC.screen instanceof OptionsScreen + || MC.screen instanceof VideoSettingsScreen + || MC.screen instanceof OptionsSoundsScreen + || MC.screen instanceof IngameMenuScreen + ) { + for (KeyBinding key : keys) { + boolean state = InputMappings.isKeyDown(MC.getWindow().getWindow(), key.getKey().getValue()); + KeyBinding.set(key.getKey(), state); + key.setDown(state); + } + } + } + +} diff --git a/src/main/java/ftbsc/bscv/modules/self/FastInteract.java b/src/main/java/ftbsc/bscv/modules/self/FastInteract.java index c256e00..9f82b20 100644 --- a/src/main/java/ftbsc/bscv/modules/self/FastInteract.java +++ b/src/main/java/ftbsc/bscv/modules/self/FastInteract.java @@ -20,6 +20,6 @@ public class FastInteract extends QuickModule implements ICommons { public void onTick(TickEvent.ClientTickEvent event) { if (MC == null) return; - MC.rightClickDelay = 0; + MC.rightClickDelay = 0; // ACCESSTRANSFORMER } }