New Modules and update to 1.19.3 (#186)
This commit is contained in:
@@ -37,14 +37,13 @@ public class AntiVanish extends Module {
|
||||
|
||||
@EventHandler
|
||||
public void onPacket(PacketEvent.Receive event) {
|
||||
if (event.packet instanceof PlayerListS2CPacket) {
|
||||
PlayerListS2CPacket packet = (PlayerListS2CPacket) event.packet;
|
||||
if (packet.getAction() == PlayerListS2CPacket.Action.UPDATE_LATENCY) {
|
||||
if (event.packet instanceof PlayerListS2CPacket packet) {
|
||||
if (packet.getActions().contains(PlayerListS2CPacket.Action.UPDATE_LATENCY)) {
|
||||
try {
|
||||
for (PlayerListS2CPacket.Entry entry : packet.getEntries()) {
|
||||
if (mc.getNetworkHandler().getPlayerListEntry(entry.getProfile().getId()) != null)
|
||||
if (mc.getNetworkHandler().getPlayerListEntry(entry.profileId()) != null)
|
||||
continue;
|
||||
toLookup.add(entry.getProfile().getId());
|
||||
toLookup.add(entry.profileId());
|
||||
}
|
||||
} catch (Exception ignore) {}
|
||||
}
|
||||
|
||||
66
src/main/java/anticope/rejects/modules/ArrowDmg.java
Normal file
66
src/main/java/anticope/rejects/modules/ArrowDmg.java
Normal file
@@ -0,0 +1,66 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.events.StopUsingItemEvent;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
|
||||
|
||||
public class ArrowDmg extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
public final Setting<Integer> packets = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("packets")
|
||||
.description("Amount of packets to send. More packets = higher damage.")
|
||||
.defaultValue(200)
|
||||
.min(2)
|
||||
.sliderMax(2000)
|
||||
.build()
|
||||
);
|
||||
|
||||
public final Setting<Boolean> tridents = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("tridents")
|
||||
.description("When enabled, tridents fly much further. Doesn't seem to affect damage or Riptide. WARNING: You can easily lose your trident by enabling this option!")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
|
||||
public ArrowDmg() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "arrow-damage", "Massively increases arrow damage, but also consumes a lot of hunger and reduces accuracy. Does not work with crossbows and seems to be patched on Paper servers.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onStopUsingItem(StopUsingItemEvent event) {
|
||||
if (!isValidItem(event.itemStack.getItem()))
|
||||
return;
|
||||
|
||||
ClientPlayerEntity p = mc.player;
|
||||
|
||||
p.networkHandler.sendPacket(
|
||||
new ClientCommandC2SPacket(p, ClientCommandC2SPacket.Mode.START_SPRINTING));
|
||||
|
||||
double x = p.getX();
|
||||
double y = p.getY();
|
||||
double z = p.getZ();
|
||||
|
||||
for (int i = 0; i < packets.get() / 2; i++) {
|
||||
p.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x,
|
||||
y - 1e-10, z, true));
|
||||
p.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(x,
|
||||
y + 1e-10, z, false));
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isValidItem(Item item) {
|
||||
return tridents.get() && item == Items.TRIDENT || item == Items.BOW;
|
||||
}
|
||||
}
|
||||
@@ -17,11 +17,11 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -83,7 +83,7 @@ public class AutoExtinguish extends Module {
|
||||
private BlockPos blockPos = null;
|
||||
private boolean doesWaterBucketWork = true;
|
||||
|
||||
private static final StatusEffect FIRE_RESISTANCE = Registry.STATUS_EFFECT.get(new Identifier("fire_resistance"));
|
||||
private static final StatusEffect FIRE_RESISTANCE = Registries.STATUS_EFFECT.get(new Identifier("fire_resistance"));
|
||||
|
||||
public AutoExtinguish() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-extinguish", "Automatically extinguishes fire around you");
|
||||
|
||||
94
src/main/java/anticope/rejects/modules/AutoGrind.java
Normal file
94
src/main/java/anticope/rejects/modules/AutoGrind.java
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
|
||||
* Copyright (c) Meteor Development.
|
||||
*/
|
||||
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import meteordevelopment.meteorclient.events.game.OpenScreenEvent;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.network.MeteorExecutor;
|
||||
import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.screen.GrindstoneScreenHandler;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AutoGrind extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("delay")
|
||||
.description("The tick delay between grinding items.")
|
||||
.defaultValue(50)
|
||||
.sliderMax(500)
|
||||
.min(0)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<List<Item>> itemBlacklist = sgGeneral.add(new ItemListSetting.Builder()
|
||||
.name("item-blacklist")
|
||||
.description("Items that should be ignored.")
|
||||
.defaultValue()
|
||||
.filter(Item::isDamageable)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<List<Enchantment>> enchantmentBlacklist = sgGeneral.add(new EnchantmentListSetting.Builder()
|
||||
.name("enchantment-blacklist")
|
||||
.description("Enchantments that should be ignored.")
|
||||
.defaultValue()
|
||||
.build()
|
||||
);
|
||||
|
||||
public AutoGrind() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-grind", "Automatically disenchants items.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onOpenScreen(OpenScreenEvent event) {
|
||||
if (!(mc.player.currentScreenHandler instanceof GrindstoneScreenHandler))
|
||||
return;
|
||||
|
||||
MeteorExecutor.execute(() -> {
|
||||
for (int i = 0; i <= mc.player.getInventory().size(); i++) {
|
||||
if (canGrind(mc.player.getInventory().getStack(i))) {
|
||||
try {
|
||||
Thread.sleep(delay.get());
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (mc.currentScreen == null) break;
|
||||
|
||||
InvUtils.quickMove().slot(i);
|
||||
InvUtils.move().fromId(2).to(i);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private boolean canGrind(ItemStack stack) {
|
||||
if (itemBlacklist.get().contains(stack.getItem())) return false;
|
||||
|
||||
Map<Enchantment, Integer> enchantments = EnchantmentHelper.get(stack);
|
||||
int availEnchs = 0;
|
||||
|
||||
for (Enchantment enchantment : enchantments.keySet()) {
|
||||
availEnchs++;
|
||||
if (enchantment.isCursed())
|
||||
availEnchs--;
|
||||
if (enchantmentBlacklist.get().contains(enchantment))
|
||||
return false;
|
||||
}
|
||||
|
||||
return enchantments.size() > 0 && availEnchs > 0;
|
||||
}
|
||||
}
|
||||
110
src/main/java/anticope/rejects/modules/AutoLogin.java
Normal file
110
src/main/java/anticope/rejects/modules/AutoLogin.java
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
|
||||
* Copyright (c) Meteor Development.
|
||||
*/
|
||||
|
||||
package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.settings.StringMapSetting;
|
||||
import anticope.rejects.utils.RejectsUtils;
|
||||
import meteordevelopment.meteorclient.MeteorClient;
|
||||
import meteordevelopment.meteorclient.events.game.GameJoinedEvent;
|
||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WHorizontalList;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WButton;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.IntSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.Utils;
|
||||
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket;
|
||||
import net.minecraft.text.ClickEvent;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class AutoLogin extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<Integer> delay = sgGeneral.add(new IntSetting.Builder()
|
||||
.name("delay")
|
||||
.description("Delay in ms before executing the command.")
|
||||
.defaultValue(1000)
|
||||
.min(0)
|
||||
.sliderMax(10000)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> smart = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("smart")
|
||||
.description("Auto add the entries.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Map<String, String>> commands = sgGeneral.add(new StringMapSetting.Builder()
|
||||
.name("commands")
|
||||
.description("Server and commands. (* for universal)")
|
||||
.defaultValue(new LinkedHashMap<>() {{
|
||||
put("localhost", "/login 123456");
|
||||
}})
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Timer timer = new Timer();
|
||||
|
||||
public AutoLogin() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "auto-login", "Runs command when joining specified server.");
|
||||
MeteorClient.EVENT_BUS.subscribe(new Listener());
|
||||
}
|
||||
|
||||
@Override
|
||||
public WWidget getWidget(GuiTheme theme) {
|
||||
WHorizontalList l = theme.horizontalList();
|
||||
WButton btn = l.add(theme.button("Random generate password")).widget();
|
||||
btn.action = () -> {
|
||||
String password = RejectsUtils.getRandomPassword(16);
|
||||
MutableText text = Text.literal(Formatting.BOLD + "Click here to register securely.");
|
||||
text.setStyle(text.getStyle().withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, String.format("/register %s %s", password, password))));
|
||||
info(text);
|
||||
};
|
||||
return l;
|
||||
}
|
||||
|
||||
private class Listener {
|
||||
@EventHandler
|
||||
private void onGameJoined(GameJoinedEvent event) {
|
||||
String command = commands.get().getOrDefault("*", commands.get().get(Utils.getWorldName()));
|
||||
if (command != null) {
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (mc.player != null) ChatUtils.sendPlayerMsg(command);
|
||||
}
|
||||
}, delay.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
private void onPacketSent(PacketEvent.Send event) {
|
||||
if (!smart.get()) return;
|
||||
|
||||
if (event.packet instanceof CommandExecutionC2SPacket packet) {
|
||||
String command = packet.command();
|
||||
List<String> hint = Arrays.asList("reg", "register", "l", "login", "log");
|
||||
String[] cmds = command.split(" ");
|
||||
if (cmds.length >= 2 && hint.contains(cmds[0])) {
|
||||
commands.get().put(Utils.getWorldName(), "/login " + cmds[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +1,34 @@
|
||||
package anticope.rejects.modules;
|
||||
|
||||
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;
|
||||
|
||||
import anticope.rejects.settings.StringMapSetting;
|
||||
import meteordevelopment.meteorclient.events.game.ReceiveMessageEvent;
|
||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||
import meteordevelopment.meteorclient.gui.widgets.WWidget;
|
||||
import meteordevelopment.meteorclient.gui.widgets.containers.WTable;
|
||||
import meteordevelopment.meteorclient.gui.widgets.input.WTextBox;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WMinus;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WPlus;
|
||||
import meteordevelopment.meteorclient.gui.utils.StarscriptTextBoxRenderer;
|
||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||
import meteordevelopment.meteorclient.settings.Setting;
|
||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.settings.StringSetting;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.misc.MeteorStarscript;
|
||||
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import meteordevelopment.starscript.Script;
|
||||
import meteordevelopment.starscript.compiler.Compiler;
|
||||
import meteordevelopment.starscript.compiler.Parser;
|
||||
import meteordevelopment.starscript.utils.StarscriptError;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class ChatBot extends Module {
|
||||
|
||||
public final HashMap<String, String> commands = new HashMap<>() {{
|
||||
put("ping", "Pong!");
|
||||
put("tps", "Current TPS: {server.tps}");
|
||||
put("time", "It's currently {server.time}");
|
||||
put("pos", "I am @ {player.pos}");
|
||||
}};
|
||||
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<String> prefix = sgGeneral.add(new StringSetting.Builder()
|
||||
.name("prefix")
|
||||
.description("Command prefix for the bot.")
|
||||
.defaultValue("!")
|
||||
.build()
|
||||
.name("prefix")
|
||||
.description("Command prefix for the bot.")
|
||||
.defaultValue("!")
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Boolean> help = sgGeneral.add(new BoolSetting.Builder()
|
||||
@@ -54,23 +38,33 @@ public class ChatBot extends Module {
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Setting<Map<String, String>> commands = sgGeneral.add(new StringMapSetting.Builder()
|
||||
.name("commands")
|
||||
.description("Commands.")
|
||||
.renderer(StarscriptTextBoxRenderer.class)
|
||||
.defaultValue(new LinkedHashMap<>() {{
|
||||
put("ping", "Pong!");
|
||||
put("tps", "Current TPS: {server.tps}");
|
||||
put("time", "It's currently {server.time}");
|
||||
put("pos", "I am @ {player.pos}");
|
||||
}})
|
||||
.build()
|
||||
);
|
||||
|
||||
public ChatBot() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "chat-bot", "Bot which automatically responds to chat messages.");
|
||||
}
|
||||
|
||||
private String currMsgK = "", currMsgV = "";
|
||||
|
||||
@EventHandler
|
||||
private void onMessageRecieve(ReceiveMessageEvent event) {
|
||||
String msg = event.getMessage().getString();
|
||||
if (help.get() && msg.endsWith(prefix.get()+"help")) {
|
||||
mc.player.sendMessage(Text.of("Avaliable commands: " + String.join(", ", commands.keySet())), false);
|
||||
// mc.getNetworkHandler().sendPacket(new ChatMessageC2SPacket("Avaliable commands: " + String.join(", ", commands.keySet())), );
|
||||
if (help.get() && msg.endsWith(prefix.get() + "help")) {
|
||||
ChatUtils.sendPlayerMsg("Available commands: " + String.join(", ", commands.get().keySet()));
|
||||
return;
|
||||
}
|
||||
for (String cmd : commands.keySet()) {
|
||||
if (msg.endsWith(prefix.get()+cmd)) {
|
||||
Script script = compile(commands.get(cmd));
|
||||
for (String cmd : commands.get().keySet()) {
|
||||
if (msg.endsWith(prefix.get() + cmd)) {
|
||||
Script script = compile(commands.get().get(cmd));
|
||||
if (script == null) ChatUtils.sendPlayerMsg("An error occurred");
|
||||
try {
|
||||
var section = MeteorStarscript.ss.run(script);
|
||||
@@ -84,71 +78,6 @@ public class ChatBot extends Module {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WWidget getWidget(GuiTheme theme) {
|
||||
WTable table = theme.table();
|
||||
fillTable(theme, table);
|
||||
return table;
|
||||
}
|
||||
|
||||
private void fillTable(GuiTheme theme, WTable table) {
|
||||
table.clear();
|
||||
commands.keySet().forEach((key) -> {
|
||||
table.add(theme.label(key)).expandCellX();
|
||||
table.add(theme.label(commands.get(key))).expandCellX();
|
||||
WMinus delete = table.add(theme.minus()).widget();
|
||||
delete.action = () -> {
|
||||
commands.remove(key);
|
||||
fillTable(theme,table);
|
||||
};
|
||||
table.row();
|
||||
});
|
||||
WTextBox textBoxK = table.add(theme.textBox(currMsgK)).minWidth(100).expandX().widget();
|
||||
textBoxK.action = () -> {
|
||||
currMsgK = textBoxK.get();
|
||||
};
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV, (text1, c) -> true, StarscriptTextBoxRenderer.class)).minWidth(100).expandX().widget();
|
||||
textBoxV.action = () -> {
|
||||
currMsgV = textBoxV.get();
|
||||
};
|
||||
WPlus add = table.add(theme.plus()).widget();
|
||||
add.action = () -> {
|
||||
if (currMsgK != "" && currMsgV != "") {
|
||||
commands.put(currMsgK, currMsgV);
|
||||
currMsgK = ""; currMsgV = "";
|
||||
fillTable(theme,table);
|
||||
}
|
||||
};
|
||||
table.row();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NbtCompound toTag() {
|
||||
NbtCompound tag = super.toTag();
|
||||
|
||||
NbtCompound messTag = new NbtCompound();
|
||||
commands.keySet().forEach((key) -> {
|
||||
messTag.put(key, NbtString.of(commands.get(key)));
|
||||
});
|
||||
|
||||
tag.put("commands", messTag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Module fromTag(NbtCompound tag) {
|
||||
|
||||
commands.clear();
|
||||
if (tag.contains("commands")) {
|
||||
NbtCompound msgs = tag.getCompound("commands");
|
||||
msgs.getKeys().forEach((key) -> {
|
||||
commands.put(key, msgs.getString(key));
|
||||
});
|
||||
}
|
||||
|
||||
return super.fromTag(tag);
|
||||
}
|
||||
|
||||
private static Script compile(String script) {
|
||||
if (script == null) return null;
|
||||
Parser.Result result = Parser.parse(script);
|
||||
|
||||
@@ -2,14 +2,9 @@ package anticope.rejects.modules;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import anticope.rejects.gui.screens.InteractionScreen;
|
||||
import anticope.rejects.settings.StringMapSetting;
|
||||
import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
|
||||
import meteordevelopment.meteorclient.gui.GuiTheme;
|
||||
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;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WMinus;
|
||||
import meteordevelopment.meteorclient.gui.widgets.pressable.WPlus;
|
||||
import meteordevelopment.meteorclient.settings.*;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.meteorclient.utils.Utils;
|
||||
@@ -22,10 +17,8 @@ import net.minecraft.client.render.debug.DebugRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.nbt.NbtString;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
public class InteractionMenu extends Module {
|
||||
@@ -85,8 +78,12 @@ public class InteractionMenu extends Module {
|
||||
.build()
|
||||
);
|
||||
|
||||
public final HashMap<String, String> messages = new HashMap<>();
|
||||
private String currMsgK = "", currMsgV = "";
|
||||
public final Setting<Map<String, String>> messages = sgGeneral.add(new StringMapSetting.Builder()
|
||||
.name("messages")
|
||||
.description("Messages.")
|
||||
.renderer(StarscriptTextBoxRenderer.class)
|
||||
.build()
|
||||
);
|
||||
|
||||
public InteractionMenu() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "interaction-menu", "An interaction screen when looking at an entity.");
|
||||
@@ -111,64 +108,6 @@ public class InteractionMenu extends Module {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public WWidget getWidget(GuiTheme theme) {
|
||||
WTable table = theme.table();
|
||||
fillTable(theme, table);
|
||||
return table;
|
||||
}
|
||||
|
||||
private void fillTable(GuiTheme theme, WTable table) {
|
||||
table.clear();
|
||||
messages.keySet().forEach((key) -> {
|
||||
table.add(theme.label(key)).expandCellX();
|
||||
table.add(theme.label(messages.get(key))).expandCellX();
|
||||
WMinus delete = table.add(theme.minus()).widget();
|
||||
delete.action = () -> {
|
||||
messages.remove(key);
|
||||
fillTable(theme, table);
|
||||
};
|
||||
table.row();
|
||||
});
|
||||
WTextBox textBoxK = table.add(theme.textBox(currMsgK)).minWidth(100).expandX().widget();
|
||||
textBoxK.action = () -> currMsgK = textBoxK.get();
|
||||
WTextBox textBoxV = table.add(theme.textBox(currMsgV, (text1, c) -> true, StarscriptTextBoxRenderer.class)).minWidth(100).expandX().widget();
|
||||
textBoxV.action = () -> currMsgV = textBoxV.get();
|
||||
WPlus add = table.add(theme.plus()).widget();
|
||||
add.action = () -> {
|
||||
if (!currMsgK.equals("") && !currMsgV.equals("")) {
|
||||
messages.put(currMsgK, currMsgV);
|
||||
currMsgK = "";
|
||||
currMsgV = "";
|
||||
fillTable(theme, table);
|
||||
}
|
||||
};
|
||||
table.row();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NbtCompound toTag() {
|
||||
NbtCompound tag = super.toTag();
|
||||
|
||||
NbtCompound messTag = new NbtCompound();
|
||||
messages.keySet().forEach((key) -> messTag.put(key, NbtString.of(messages.get(key))));
|
||||
|
||||
tag.put("messages", messTag);
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Module fromTag(NbtCompound tag) {
|
||||
|
||||
messages.clear();
|
||||
if (tag.contains("messages")) {
|
||||
NbtCompound msgs = tag.getCompound("messages");
|
||||
msgs.getKeys().forEach((key) -> messages.put(key, msgs.getString(key)));
|
||||
}
|
||||
|
||||
return super.fromTag(tag);
|
||||
}
|
||||
|
||||
private static Value wrap(Entity entity) {
|
||||
if (entity == null) {
|
||||
return Value.map(new ValueMap()
|
||||
|
||||
@@ -11,9 +11,9 @@ import meteordevelopment.meteorclient.utils.player.InvUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.network.packet.c2s.play.CreativeInventoryActionC2SPacket;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.registry.RegistryEntry;
|
||||
|
||||
public class ItemGenerator extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
@@ -56,7 +56,7 @@ public class ItemGenerator extends Module {
|
||||
int stacks = speed.get();
|
||||
int size = stackSize.get();
|
||||
for(int i = 9; i < 9 + stacks; i++) {
|
||||
mc.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(i, new ItemStack(Registry.ITEM.getRandom(random).map(RegistryEntry::value).orElse(Items.DIRT), size)));
|
||||
mc.player.networkHandler.sendPacket(new CreativeInventoryActionC2SPacket(i, new ItemStack(Registries.ITEM.getRandom(random).map(RegistryEntry::value).orElse(Items.DIRT), size)));
|
||||
}
|
||||
|
||||
for(int i = 9; i < 9 + stacks; i++) {
|
||||
|
||||
@@ -18,6 +18,7 @@ import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||
import meteordevelopment.orbit.EventHandler;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.registry.RegistryKeys;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
@@ -25,11 +26,8 @@ import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.math.random.ChunkRandom;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.ChunkStatus;
|
||||
//import net.minecraft.world.chunk.world.random.ChunkRandom;
|
||||
import com.seedfinding.mccore.version.MCVersion;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -37,7 +35,6 @@ import java.util.BitSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class OreSim extends Module {
|
||||
|
||||
@@ -282,7 +279,7 @@ public class OreSim extends Module {
|
||||
long populationSeed = random.setPopulationSeed(worldSeed.seed, chunkX, chunkZ);
|
||||
|
||||
var optional = world.getBiomeAccess().getBiomeForNoiseGen(new BlockPos(chunkX, 0, chunkZ)).getKeyOrValue();
|
||||
Identifier id = (optional.right().isPresent()) ? world.getRegistryManager().get(Registry.BIOME_KEY).getId(optional.right().get()) : optional.left().get().getValue();
|
||||
Identifier id = (optional.right().isPresent()) ? world.getRegistryManager().get(RegistryKeys.BIOME).getId(optional.right().get()) : optional.left().get().getValue();
|
||||
if (id == null) {
|
||||
error("Something went wrong, you may have some mods that mess with world generation");
|
||||
toggle();
|
||||
|
||||
@@ -3,7 +3,7 @@ package anticope.rejects.modules;
|
||||
import java.io.IOException;
|
||||
|
||||
import anticope.rejects.MeteorRejectsAddon;
|
||||
import net.minecraft.client.gl.ShaderEffect;
|
||||
import net.minecraft.client.gl.PostEffectProcessor;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import meteordevelopment.meteorclient.settings.EnumSetting;
|
||||
@@ -86,7 +86,7 @@ public class Rendering extends Module {
|
||||
.build()
|
||||
);
|
||||
|
||||
private ShaderEffect shader = null;
|
||||
private PostEffectProcessor shader = null;
|
||||
|
||||
public Rendering() {
|
||||
super(MeteorRejectsAddon.CATEGORY, "rendering", "Various Render Tweaks");
|
||||
@@ -109,7 +109,7 @@ public class Rendering extends Module {
|
||||
else name = s.toString().toLowerCase();
|
||||
Identifier shaderID = new Identifier(String.format("shaders/post/%s.json", name));
|
||||
try {
|
||||
ShaderEffect shader = new ShaderEffect(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
|
||||
PostEffectProcessor shader = new PostEffectProcessor(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID);
|
||||
this.shader = shader;
|
||||
} catch (IOException e) {
|
||||
this.shader = null;
|
||||
@@ -120,7 +120,7 @@ public class Rendering extends Module {
|
||||
return this.isActive() && structureVoid.get();
|
||||
}
|
||||
|
||||
public ShaderEffect getShaderEffect() {
|
||||
public PostEffectProcessor getShaderEffect() {
|
||||
if (!this.isActive()) return null;
|
||||
return shader;
|
||||
}
|
||||
|
||||
@@ -26,23 +26,27 @@ import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.math.*;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RotationAxis;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import org.joml.Matrix4f;
|
||||
import org.joml.Quaternionf;
|
||||
|
||||
public class SkeletonESP extends Module {
|
||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||
|
||||
private final Setting<SettingColor> skeletonColorSetting = sgGeneral.add(new ColorSetting.Builder()
|
||||
.name("players-color")
|
||||
.description("The other player's color.")
|
||||
.defaultValue(new SettingColor(255, 255, 255))
|
||||
.build()
|
||||
.name("players-color")
|
||||
.description("The other player's color.")
|
||||
.defaultValue(new SettingColor(255, 255, 255))
|
||||
.build()
|
||||
);
|
||||
|
||||
public final Setting<Boolean> distance = sgGeneral.add(new BoolSetting.Builder()
|
||||
.name("distance-colors")
|
||||
.description("Changes the color of skeletons depending on distance.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
.name("distance-colors")
|
||||
.description("Changes the color of skeletons depending on distance.")
|
||||
.defaultValue(false)
|
||||
.build()
|
||||
);
|
||||
|
||||
private final Freecam freecam;
|
||||
@@ -57,7 +61,7 @@ public class SkeletonESP extends Module {
|
||||
MatrixStack matrixStack = event.matrices;
|
||||
float g = event.tickDelta;
|
||||
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
|
||||
RenderSystem.disableTexture();
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
@@ -67,7 +71,8 @@ public class SkeletonESP extends Module {
|
||||
|
||||
mc.world.getEntities().forEach(entity -> {
|
||||
if (!(entity instanceof PlayerEntity)) return;
|
||||
if (mc.options.getPerspective() == Perspective.FIRST_PERSON && !freecam.isActive() && mc.player == entity) return;
|
||||
if (mc.options.getPerspective() == Perspective.FIRST_PERSON && !freecam.isActive() && mc.player == entity)
|
||||
return;
|
||||
int rotationHoldTicks = Config.get().rotationHoldTicks.get();
|
||||
|
||||
Color skeletonColor = PlayerUtils.getPlayerColor((PlayerEntity) entity, skeletonColorSetting.get());
|
||||
@@ -75,8 +80,8 @@ public class SkeletonESP extends Module {
|
||||
PlayerEntity playerEntity = (PlayerEntity) entity;
|
||||
|
||||
Vec3d footPos = getEntityRenderPosition(playerEntity, g);
|
||||
PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer)(LivingEntityRenderer<?, ?>) mc.getEntityRenderDispatcher().getRenderer(playerEntity);
|
||||
PlayerEntityModel<PlayerEntity> playerEntityModel = (PlayerEntityModel)livingEntityRenderer.getModel();
|
||||
PlayerEntityRenderer livingEntityRenderer = (PlayerEntityRenderer) (LivingEntityRenderer<?, ?>) mc.getEntityRenderDispatcher().getRenderer(playerEntity);
|
||||
PlayerEntityModel<PlayerEntity> playerEntityModel = (PlayerEntityModel) livingEntityRenderer.getModel();
|
||||
|
||||
float h = MathHelper.lerpAngleDegrees(g, playerEntity.prevBodyYaw, playerEntity.bodyYaw);
|
||||
if (mc.player == entity && Rotations.rotationTimer < rotationHoldTicks) h = Rotations.serverYaw;
|
||||
@@ -106,8 +111,9 @@ public class SkeletonESP extends Module {
|
||||
matrixStack.translate(footPos.x, footPos.y, footPos.z);
|
||||
if (swimming) matrixStack.translate(0, 0.35f, 0);
|
||||
|
||||
matrixStack.multiply(new Quaternion(new Vec3f(0, -1, 0), h + 180, true));
|
||||
if (swimming || flying) matrixStack.multiply(new Quaternion(new Vec3f(-1, 0, 0), 90 + m, true));
|
||||
matrixStack.multiply(new Quaternionf().setAngleAxis((h + 180) * Math.PI / 180F, 0, -1, 0));
|
||||
if (swimming || flying)
|
||||
matrixStack.multiply(new Quaternionf().setAngleAxis((90 + m) * Math.PI / 180F, -1, 0, 0));
|
||||
if (swimming) matrixStack.translate(0, -0.95f, 0);
|
||||
|
||||
BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();
|
||||
@@ -169,13 +175,14 @@ public class SkeletonESP extends Module {
|
||||
matrixStack.pop();
|
||||
|
||||
bufferBuilder.clear();
|
||||
BufferRenderer.drawWithShader(bufferBuilder.end());
|
||||
BufferRenderer.drawWithGlobalProgram(bufferBuilder.end());
|
||||
|
||||
if (swimming) matrixStack.translate(0, 0.95f, 0);
|
||||
if (swimming || flying) matrixStack.multiply(new Quaternion(new Vec3f(1, 0, 0), 90 + m, true));
|
||||
if (swimming || flying)
|
||||
matrixStack.multiply(new Quaternionf().setAngleAxis((90 + m) * Math.PI / 180F, 1, 0, 0));
|
||||
if (swimming) matrixStack.translate(0, -0.35f, 0);
|
||||
|
||||
matrixStack.multiply(new Quaternion(new Vec3f(0, 1, 0), h + 180, true));
|
||||
matrixStack.multiply(new Quaternionf().setAngleAxis((h + 180) * Math.PI / 180F, 0, 1, 0));
|
||||
matrixStack.translate(-footPos.x, -footPos.y, -footPos.z);
|
||||
});
|
||||
|
||||
@@ -184,20 +191,20 @@ public class SkeletonESP extends Module {
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.enableDepthTest();
|
||||
RenderSystem.depthMask(true);
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorShader);
|
||||
RenderSystem.setShader(GameRenderer::getPositionColorProgram);
|
||||
}
|
||||
|
||||
private void rotate(MatrixStack matrix, ModelPart modelPart) {
|
||||
if (modelPart.roll != 0.0F) {
|
||||
matrix.multiply(Vec3f.POSITIVE_Z.getRadialQuaternion(modelPart.roll));
|
||||
matrix.multiply(RotationAxis.POSITIVE_Z.rotation(modelPart.roll));
|
||||
}
|
||||
|
||||
if (modelPart.yaw != 0.0F) {
|
||||
matrix.multiply(Vec3f.NEGATIVE_Y.getRadialQuaternion(modelPart.yaw));
|
||||
matrix.multiply(RotationAxis.NEGATIVE_Y.rotation(modelPart.yaw));
|
||||
}
|
||||
|
||||
if (modelPart.pitch != 0.0F) {
|
||||
matrix.multiply(Vec3f.NEGATIVE_X.getRadialQuaternion(modelPart.pitch));
|
||||
matrix.multiply(RotationAxis.NEGATIVE_X.rotation(modelPart.pitch));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,8 +229,7 @@ public class SkeletonESP extends Module {
|
||||
if (percent < 0.5) {
|
||||
r = 255;
|
||||
g = (int) (255 * percent / 0.5);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
g = 255;
|
||||
r = 255 - (int) (255 * (percent - 0.5) / 0.5);
|
||||
}
|
||||
|
||||
@@ -48,10 +48,8 @@ public class SoundLocator extends Module {
|
||||
private void printSound(SoundInstance sound) {
|
||||
WeightedSoundSet soundSet = mc.getSoundManager().get(sound.getId());
|
||||
MutableText text;
|
||||
if (soundSet == null) {
|
||||
if (soundSet == null || soundSet.getSubtitle() == null) {
|
||||
text = Text.literal(sound.getId().toString());
|
||||
} else if (soundSet.getSubtitle() == null) {
|
||||
text = Text.literal(soundSet.getId().toString());
|
||||
} else {
|
||||
text = soundSet.getSubtitle().copy();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user