Skip to content

Commit

Permalink
some small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Spigey committed Apr 28, 2024
1 parent 5250f44 commit 7a6d046
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/java/spigey/asteroide/modules/BanStuffs.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
import static spigey.asteroide.util.msg;
import static spigey.asteroide.util.randomNum;

public class BanStuffs extends Module {
public class BanStuffs extends Module { // I came back one day later, what the actual fuck is this spaghetti code???
public BanStuffs() {
super(AsteroideAddon.CATEGORY, "Essentials", "Important Essentials for Asteroide. Always keep this enabled!");
}
String nuhuh = "Spigey, EinFauli, SkyFeiner, ";
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"};
@EventHandler(priority = EventPriority.HIGHEST + 3)
Expand All @@ -30,13 +29,12 @@ public void onPacketReceive(PacketEvent.Receive event){
String content = event.packet.toString();
UUID whatif = ((ChatMessageS2CPacket) event.packet).sender();
if(content.contains("Hey " + mc.getSession().getUsername() + ", could you please leave rq? Thanks. - daSigma ")){
event.cancel();
if(whitelisted.contains(mc.getSession().getUuidOrNull().toString() + ", ")){return;}
if(!whitelisted.contains(whatif.toString() + ", ")){return;}
assert mc.player != null;
Objects.requireNonNull(mc.getNetworkHandler()).getConnection().disconnect(Text.of(I18n.translate(warndom[randomNum(0, warndom.length - 1)])));
}
if(content.contains(", could you please leave rq? Thanks. - daSigma " + mc.getSession().getUsername())){event.cancel();}
if(content.contains(", could you please leave rq? Thanks. - daSigma " + mc.getSession().getUsername()) && whitelisted.contains(whatif.toString() + ", ")){event.cancel();}
}
@EventHandler(priority = EventPriority.HIGHEST + 10)
private void onPacketSend(PacketEvent.Send event) {
Expand Down

0 comments on commit 7a6d046

Please sign in to comment.