From f5f64260e32f8ce529f4a6f19c384a3def45ddd0 Mon Sep 17 00:00:00 2001 From: TheBritishMidget Date: Sun, 21 Feb 2021 16:54:09 +0000 Subject: [PATCH] GuiMove - Setting to stop movement in signs --- .../seppuku/impl/module/movement/GuiMoveModule.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/rigamortis/seppuku/impl/module/movement/GuiMoveModule.java b/src/main/java/me/rigamortis/seppuku/impl/module/movement/GuiMoveModule.java index acb21e3..9416ea8 100644 --- a/src/main/java/me/rigamortis/seppuku/impl/module/movement/GuiMoveModule.java +++ b/src/main/java/me/rigamortis/seppuku/impl/module/movement/GuiMoveModule.java @@ -3,8 +3,10 @@ package me.rigamortis.seppuku.impl.module.movement; import me.rigamortis.seppuku.api.event.EventStageable; import me.rigamortis.seppuku.api.event.player.EventPlayerUpdate; import me.rigamortis.seppuku.api.module.Module; +import me.rigamortis.seppuku.api.value.Value; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiChat; +import net.minecraft.client.gui.inventory.GuiEditSign; import net.minecraft.client.settings.KeyBinding; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -16,6 +18,8 @@ import team.stiff.pomelo.impl.annotated.handler.annotation.Listener; */ public final class GuiMoveModule extends Module { + public final Value allowSignMove = new Value("AllowSignMove", new String[]{"sign", "allowsign", "as"}, "If enabled you will be able to move while in a sign GUI.", false); + public GuiMoveModule() { super("GUIMove", new String[]{"InvMove", "InventoryMove", "GUIM"}, "Allows you to move while guis are open", "NONE", -1, ModuleType.MOVEMENT); } @@ -25,7 +29,7 @@ public final class GuiMoveModule extends Module { if (event.getStage() == EventStageable.EventStage.PRE) { final Minecraft mc = Minecraft.getMinecraft(); - if (mc.currentScreen instanceof GuiChat || mc.currentScreen == null) { + if (mc.currentScreen instanceof GuiChat || (!allowSignMove.getValue() && mc.currentScreen instanceof GuiEditSign) || mc.currentScreen == null) { return; }