update to devbuild 1520 (fixes #130)
This commit is contained in:
@@ -3,6 +3,7 @@ package anticope.rejects.modules;
|
||||
import java.util.HashMap;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.gui.utils.StarscriptTextBoxRenderer;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
import net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket;
|
||||
@@ -71,7 +72,8 @@ public class ChatBot extends Module {
|
||||
Script script = compile(commands.get(cmd));
|
||||
if (script == null) mc.player.sendChatMessage("An error occurred");
|
||||
try {
|
||||
mc.player.sendChatMessage(MeteorStarscript.ss.run(script));
|
||||
var section = MeteorStarscript.ss.run(script);
|
||||
mc.player.sendChatMessage(section.text);
|
||||
} catch (StarscriptError e) {
|
||||
MeteorStarscript.printChatError(e);
|
||||
mc.player.sendChatMessage("An error occurred");
|
||||
@@ -104,7 +106,7 @@ public class ChatBot extends Module {
|
||||
textBoxK.action = () -> {
|
||||
currMsgK = textBoxK.get();
|
||||
};
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV)).minWidth(100).expandX().widget();
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV, (text1, c) -> true, StarscriptTextBoxRenderer.class)).minWidth(100).expandX().widget();
|
||||
textBoxV.action = () -> {
|
||||
currMsgV = textBoxV.get();
|
||||
};
|
||||
|
||||
@@ -4,6 +4,8 @@ import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.gui.screens.InteractionScreen;
|
||||
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
|
||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||
import meteordevelopment.meteorclient.gui.utils.CharFilter;
|
||||
import meteordevelopment.meteorclient.gui.utils.StarscriptTextBoxRenderer;
|
||||
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
|
||||
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
||||
@@ -120,7 +122,7 @@ public class InteractionMenu extends Module {
|
||||
textBoxK.action = () -> {
|
||||
currMsgK = textBoxK.get();
|
||||
};
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV)).minWidth(100).expandX().widget();
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV, (text1, c) -> true, StarscriptTextBoxRenderer.class)).minWidth(100).expandX().widget();
|
||||
textBoxV.action = () -> {
|
||||
currMsgV = textBoxV.get();
|
||||
};
|
||||
@@ -163,6 +165,19 @@ public class InteractionMenu extends Module {
|
||||
}
|
||||
|
||||
private static Value wrap(Entity entity) {
|
||||
if (entity == null) {
|
||||
return Value.map(new ValueMap()
|
||||
.set("_toString", Value.null_())
|
||||
.set("health", Value.null_())
|
||||
.set("pos", Value.map(new ValueMap()
|
||||
.set("_toString", Value.null_())
|
||||
.set("x", Value.null_())
|
||||
.set("y", Value.null_())
|
||||
.set("z", Value.null_())
|
||||
))
|
||||
.set("uuid", Value.null_())
|
||||
);
|
||||
}
|
||||
return Value.map(new ValueMap()
|
||||
.set("_toString", Value.string(entity.getName().getString()))
|
||||
.set("health", Value.number(entity instanceof LivingEntity e ? e.getHealth() : 0))
|
||||
|
||||
Reference in New Issue
Block a user