Skip to content

Commit

Permalink
popbobsexdupe 1.21 && totemNotifier
Browse files Browse the repository at this point in the history
  • Loading branch information
nxyi committed Sep 10, 2024
1 parent 34af99c commit ca08a2e
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/dark/zewo2/Addon.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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);
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/dark/zewo2/commands/DupeCommand.java
Original file line number Diff line number Diff line change
@@ -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<CommandSource> builder) {
builder.executes(context -> {
ArrayList<String> pages = new ArrayList<>();
pages.add("real");
mc.player.networkHandler.sendPacket(new BookUpdateC2SPacket(mc.player.getInventory().selectedSlot, pages, Optional.of("veryrealpopbobsexdupe2024realpopbobrealreal")));
return 1;
});
}
}
66 changes: 66 additions & 0 deletions src/main/java/com/dark/zewo2/modules/TotemNotifier.java
Original file line number Diff line number Diff line change
@@ -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<UUID, Integer> popMap = new HashMap<>();

private final SettingGroup sgGeneral = settings.getDefaultGroup();

private Setting<Boolean> announce = sgGeneral.add(new BoolSetting.Builder()
.name("Announce")
.description("Announce the pop in chat")
.defaultValue(false)
.build());

private Setting<Boolean> 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);
}
}

0 comments on commit ca08a2e

Please sign in to comment.