From c13c0529858b081767acd1f7dae5fe6d91be0768 Mon Sep 17 00:00:00 2001 From: Bella Date: Fri, 6 Dec 2019 11:02:24 -0500 Subject: [PATCH] close #245 --- .../module/modules/sdashb/misc/PearlDupe.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/main/java/me/zeroeightsix/kami/module/modules/sdashb/misc/PearlDupe.java diff --git a/src/main/java/me/zeroeightsix/kami/module/modules/sdashb/misc/PearlDupe.java b/src/main/java/me/zeroeightsix/kami/module/modules/sdashb/misc/PearlDupe.java new file mode 100644 index 00000000..55e4f5c2 --- /dev/null +++ b/src/main/java/me/zeroeightsix/kami/module/modules/sdashb/misc/PearlDupe.java @@ -0,0 +1,41 @@ +package me.zeroeightsix.kami.module.modules.sdashb.misc; + +import me.zero.alpine.listener.EventHandler; +import me.zero.alpine.listener.Listener; +import me.zeroeightsix.kami.command.Command; +import me.zeroeightsix.kami.event.events.PacketEvent; +import me.zeroeightsix.kami.module.Module; +import me.zeroeightsix.kami.setting.Setting; +import me.zeroeightsix.kami.setting.Settings; +import net.minecraft.client.Minecraft; +import net.minecraft.network.play.client.CPacketChatMessage; +import net.minecraft.network.play.client.CPacketConfirmTeleport; + +@Module.Info(name = "PearlDupe", description = "Duplicates your inventory", category = Module.Category.MISC) +public class PearlDupe extends Module { + + private Setting info = register(Settings.b("Info", true)); + private Setting warn = register(Settings.b("Warning", true)); + private Setting disable = register(Settings.b("Disable on death", true)); + + public void onEnable() { + if (info.getValue()) { + Command.sendChatMessage("Instructions: throw a pearl, it /kills on death "); + Command.sendChatMessage("This doesn't always work, and it doesn't work for 2b2t and 9b9t"); + } + if (warn.getValue()) { + Command.sendWarningMessage("Warning is still on, please disable the option once you've read the instructions"); + this.disable(); + } + } + @EventHandler + Listener receiveListener = new Listener<>(event -> { + if (event.getPacket() instanceof CPacketConfirmTeleport) { + if (mc.player == null) return; + Minecraft.getMinecraft().playerController.connection.sendPacket(new CPacketChatMessage("/kill")); + if (disable.getValue()) { + this.disable(); + } + } + }); +}