Skip to content

Commit 207f338

Browse files
committed
Eugay
1 parent bf610bd commit 207f338

File tree

5 files changed

+67
-2
lines changed

5 files changed

+67
-2
lines changed

src/main/java/com/nxyi/addon/Addon.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public void onInitialize() {
7171
Commands.add(new ImageLoreCommand());
7272
Commands.add(new TrashCommand());
7373
Commands.add(new ReloadCapes());
74+
Commands.add(new SpamCommand());
75+
Commands.add(new CrackedOpSpamCommand());
7476

7577
// HUD
7678
Hud.get().register(HudExample.INFO);
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.nxyi.addon.commands;
2+
3+
import com.mojang.brigadier.arguments.IntegerArgumentType;
4+
import com.mojang.brigadier.arguments.StringArgumentType;
5+
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
6+
import meteordevelopment.meteorclient.commands.Command;
7+
import net.minecraft.client.MinecraftClient;
8+
import net.minecraft.command.CommandSource;
9+
10+
public class CrackedOpSpamCommand extends Command {
11+
public CrackedOpSpamCommand() {
12+
super("CrackedOpSpam", "Spam op accounts on cracked servers", "cop", "crackedopspam");
13+
}
14+
15+
@Override
16+
public void build(LiteralArgumentBuilder<CommandSource> builder) {
17+
builder.then(argument("name", StringArgumentType.string())
18+
.then(argument("amount", IntegerArgumentType.integer(0)).executes(ctx -> {
19+
int amount = IntegerArgumentType.getInteger(ctx, "amount");
20+
String name = StringArgumentType.getString(ctx, "name");
21+
22+
//make new thread to try to prevent some lag
23+
new Thread(() -> {
24+
for (int i = 0; i < amount; i++){
25+
MinecraftClient.getInstance().player.networkHandler.sendChatCommand("op " + name + amount);
26+
}
27+
}).start();
28+
29+
return 1;
30+
})));
31+
}
32+
}

src/main/java/com/nxyi/addon/commands/HologramCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
2222

23-
public class HologramCommand extends Command {
23+
public class HologramCommand extends Command {
2424
// crappy hack to make it compile
2525
private final MinecraftClient mc = MinecraftClient.getInstance();
2626

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.nxyi.addon.commands;
2+
3+
import com.mojang.brigadier.arguments.IntegerArgumentType;
4+
import com.mojang.brigadier.arguments.StringArgumentType;
5+
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
6+
import meteordevelopment.meteorclient.commands.Command;
7+
import net.minecraft.client.MinecraftClient;
8+
import net.minecraft.command.CommandSource;
9+
10+
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
11+
12+
public class SpamCommand extends Command {
13+
public SpamCommand() {
14+
super("Spam", "Spam a message in chat", "spawm");
15+
}
16+
17+
@Override
18+
public void build(LiteralArgumentBuilder<CommandSource> builder) {
19+
builder.then(argument("amount" ,IntegerArgumentType.integer(0))
20+
.then(argument("text", StringArgumentType.string())).executes(ctx -> {
21+
int amount = IntegerArgumentType.getInteger(ctx, "amount");
22+
String text = StringArgumentType.getString(ctx, "text");
23+
24+
for (int i = 0; i < amount; i++){
25+
MinecraftClient.getInstance().player.networkHandler.sendChatMessage(text);
26+
}
27+
28+
return SINGLE_SUCCESS;
29+
}));
30+
}
31+
}

src/main/java/com/nxyi/addon/modules/Bookchat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private void ontick(TickEvent.Pre event){
6868
if (playerEntity == null) return;
6969

7070
if (playerEntity.getMainHandStack().getItem().equals(Items.WRITABLE_BOOK)){
71-
if (playerEntity.getMainHandStack().getNbt().get("pages").toString() == null) return;
71+
if (playerEntity.getMainHandStack().getNbt().toString() == null) return;
7272
String text = playerEntity.getMainHandStack().getNbt().get("pages").toString()
7373
.replaceAll("\\]", "")
7474
.replaceAll("\\[", "")

0 commit comments

Comments
 (0)