1.19.1 update (#145)

Co-authored-by: Cloudburst <18114966+C10udburst@users.noreply.github.com>
This commit is contained in:
RacoonDog
2022-07-31 04:27:25 -04:00
committed by GitHub
parent 36bc339e74
commit 8d0ea9869e
17 changed files with 19 additions and 142 deletions

View File

@@ -4,6 +4,7 @@ import java.util.HashMap;
import anticope.rejects.MeteorRejectsAddon;
import meteordevelopment.meteorclient.gui.utils.StarscriptTextBoxRenderer;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtString;
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
@@ -70,13 +71,13 @@ public class ChatBot extends Module {
for (String cmd : commands.keySet()) {
if (msg.endsWith(prefix.get()+cmd)) {
Script script = compile(commands.get(cmd));
if (script == null) mc.player.sendChatMessage("An error occurred");
if (script == null) ChatUtils.sendPlayerMsg("An error occurred");
try {
var section = MeteorStarscript.ss.run(script);
mc.player.sendChatMessage(section.text);
ChatUtils.sendPlayerMsg(section.text);
} catch (StarscriptError e) {
MeteorStarscript.printChatError(e);
mc.player.sendChatMessage("An error occurred");
ChatUtils.sendPlayerMsg("An error occurred");
}
return;
}