feat: initial work on GuiMove
This commit is contained in:
parent
fbee153272
commit
0184889798
2 changed files with 50 additions and 1 deletions
49
src/main/java/ftbsc/bscv/modules/motion/GuiMove.java
Normal file
49
src/main/java/ftbsc/bscv/modules/motion/GuiMove.java
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue