diff --git a/src/main/java/com/dark/zewo2/Addon.java b/src/main/java/com/dark/zewo2/Addon.java index d4f8fd5..03cdf78 100644 --- a/src/main/java/com/dark/zewo2/Addon.java +++ b/src/main/java/com/dark/zewo2/Addon.java @@ -60,6 +60,7 @@ public void onInitialize() { Modules.get().add(new SitModule()); Modules.get().add(new StorageVoider()); Modules.get().add(new Girlboss()); + Modules.get().add(new TotemNotifier()); // Commands Commands.add(new CheckCMD()); @@ -70,6 +71,7 @@ public void onInitialize() { Commands.add(new SpamCommand()); Commands.add(new CrackedOpSpamCommand()); Commands.add(new MinefortJoin()); + Commands.add(new DupeCommand()); // HUD // Hud.get().register(HudExample.INFO); diff --git a/src/main/java/com/dark/zewo2/commands/DupeCommand.java b/src/main/java/com/dark/zewo2/commands/DupeCommand.java new file mode 100644 index 0000000..8dfd0cc --- /dev/null +++ b/src/main/java/com/dark/zewo2/commands/DupeCommand.java @@ -0,0 +1,26 @@ +package com.dark.zewo2.commands; + +import com.mojang.brigadier.builder.LiteralArgumentBuilder; +import meteordevelopment.meteorclient.commands.Command; +import net.minecraft.command.CommandSource; +import net.minecraft.network.packet.c2s.play.BookUpdateC2SPacket; +import net.minecraft.screen.slot.SlotActionType; + +import java.util.ArrayList; +import java.util.Optional; + +public class DupeCommand extends Command { + public DupeCommand() { + super("dupe", "popbobsexdupe"); + } + + @Override + public void build(LiteralArgumentBuilder builder) { + builder.executes(context -> { + ArrayList pages = new ArrayList<>(); + pages.add("real"); + mc.player.networkHandler.sendPacket(new BookUpdateC2SPacket(mc.player.getInventory().selectedSlot, pages, Optional.of("veryrealpopbobsexdupe2024realpopbobrealreal"))); + return 1; + }); + } +} diff --git a/src/main/java/com/dark/zewo2/modules/TotemNotifier.java b/src/main/java/com/dark/zewo2/modules/TotemNotifier.java new file mode 100644 index 0000000..4097f11 --- /dev/null +++ b/src/main/java/com/dark/zewo2/modules/TotemNotifier.java @@ -0,0 +1,66 @@ +package com.dark.zewo2.modules; + +import com.dark.zewo2.Addon; +import meteordevelopment.meteorclient.events.packets.PacketEvent; +import meteordevelopment.meteorclient.settings.BoolSetting; +import meteordevelopment.meteorclient.settings.Setting; +import meteordevelopment.meteorclient.settings.SettingGroup; +import meteordevelopment.meteorclient.systems.modules.Module; +import meteordevelopment.meteorclient.utils.player.ChatUtils; +import meteordevelopment.orbit.EventHandler; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.network.packet.s2c.play.EntityStatusS2CPacket; + +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +public class TotemNotifier extends Module { + final Map popMap = new HashMap<>(); + + private final SettingGroup sgGeneral = settings.getDefaultGroup(); + + private Setting announce = sgGeneral.add(new BoolSetting.Builder() + .name("Announce") + .description("Announce the pop in chat") + .defaultValue(false) + .build()); + + private Setting self = sgGeneral.add(new BoolSetting.Builder() + .name("Self") + .description("Include yourself in the pops.") + .defaultValue(false) + .build()); + + public TotemNotifier() { + super(Addon.CATEGORY, "TotemNotifier", "Notify you when someone pops a totem"); + } + + @Override + public void onActivate() { + popMap.clear(); + } + + @EventHandler + private void onReceivePacket(PacketEvent.Receive event) { + if (!(event.packet instanceof EntityStatusS2CPacket packet)) return; + + if (packet.getStatus() != 35) return; + + Entity entity = packet.getEntity(mc.world); + + if (entity == mc.player && !self.get()) return; + + if (!(entity instanceof PlayerEntity player)) return; + + int pops = popMap.getOrDefault(player.getUuid(), 0); + popMap.put(player.getUuid(), ++pops); + + String message = "%s has popped their %s totem".formatted(player.getGameProfile().getName(), pops); + + if (announce.get()) ChatUtils.sendPlayerMsg(message); + else ChatUtils.info(message); + } +}