From 8390451ef86d5d935265b7d523b3ee747da56714 Mon Sep 17 00:00:00 2001 From: blockparole <48992448+blockparole@users.noreply.github.com> Date: Thu, 21 Nov 2019 17:56:03 +0100 Subject: [PATCH 1/2] AutoRespawn anti bug --- .../kami/module/modules/misc/AutoRespawn.java | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java b/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java index 12aaeec3..52a576aa 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java @@ -11,24 +11,31 @@ import net.minecraft.client.gui.GuiGameOver; /** * Created by 086 on 9/04/2018. + * Updated 16 November 2019 by hub */ -@Module.Info(name = "AutoRespawn", description = "Automatically respawns upon death and tells you where you died", category = Module.Category.MISC) +@Module.Info(name = "AutoRespawn", description = "Respawn utility", category = Module.Category.MISC) public class AutoRespawn extends Module { - private Setting deathCoords = register(Settings.b("DeathCoords", false)); private Setting respawn = register(Settings.b("Respawn", true)); + private Setting deathCoords = register(Settings.b("DeathCoords", false)); + private Setting antiBug = register(Settings.b("Anti Bug", true)); @EventHandler public Listener listener = new Listener<>(event -> { - if (event.getScreen() instanceof GuiGameOver) { - if (deathCoords.getValue()) - Command.sendChatMessage(String.format("You died at x %d y %d z %d", (int)mc.player.posX, (int)mc.player.posY, (int)mc.player.posZ)); - if (respawn.getValue()) { - mc.player.respawnPlayer(); - mc.displayGuiScreen(null); - } + if (!(event.getScreen() instanceof GuiGameOver)) { + return; } + + if (deathCoords.getValue() && mc.player.getHealth() <= 0) { + Command.sendChatMessage(String.format("You died at x %d y %d z %d", (int) mc.player.posX, (int) mc.player.posY, (int) mc.player.posZ)); + } + + if (respawn.getValue() || (antiBug.getValue() && mc.player.getHealth() > 0)) { + mc.player.respawnPlayer(); + mc.displayGuiScreen(null); + } + }); } From 9bc05ebac8aae252cb21c6c314a0e16259892636 Mon Sep 17 00:00:00 2001 From: blockparole <48992448+blockparole@users.noreply.github.com> Date: Thu, 21 Nov 2019 23:09:55 +0100 Subject: [PATCH 2/2] AutoRespawn more clear naming and description "Anti Bug" -> "Anti Glitch Screen" --- .../me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java b/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java index 52a576aa..9838c7c3 100644 --- a/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java +++ b/src/main/java/me/zeroeightsix/kami/module/modules/misc/AutoRespawn.java @@ -18,7 +18,7 @@ public class AutoRespawn extends Module { private Setting respawn = register(Settings.b("Respawn", true)); private Setting deathCoords = register(Settings.b("DeathCoords", false)); - private Setting antiBug = register(Settings.b("Anti Bug", true)); + private Setting antiGlitchScreen = register(Settings.b("Anti Glitch Screen", true)); @EventHandler public Listener listener = new Listener<>(event -> { @@ -31,7 +31,7 @@ public class AutoRespawn extends Module { Command.sendChatMessage(String.format("You died at x %d y %d z %d", (int) mc.player.posX, (int) mc.player.posY, (int) mc.player.posZ)); } - if (respawn.getValue() || (antiBug.getValue() && mc.player.getHealth() > 0)) { + if (respawn.getValue() || (antiGlitchScreen.getValue() && mc.player.getHealth() > 0)) { mc.player.respawnPlayer(); mc.displayGuiScreen(null); }