@@ -4,7 +4,6 @@ import anticope.rejects.commands.*;
|
|||||||
import anticope.rejects.gui.hud.*;
|
import anticope.rejects.gui.hud.*;
|
||||||
import anticope.rejects.gui.themes.rounded.MeteorRoundedGuiTheme;
|
import anticope.rejects.gui.themes.rounded.MeteorRoundedGuiTheme;
|
||||||
import anticope.rejects.modules.*;
|
import anticope.rejects.modules.*;
|
||||||
import anticope.rejects.modules.modifier.NoRenderModifier;
|
|
||||||
import meteordevelopment.meteorclient.addons.GithubRepo;
|
import meteordevelopment.meteorclient.addons.GithubRepo;
|
||||||
import meteordevelopment.meteorclient.addons.MeteorAddon;
|
import meteordevelopment.meteorclient.addons.MeteorAddon;
|
||||||
import meteordevelopment.meteorclient.gui.GuiThemes;
|
import meteordevelopment.meteorclient.gui.GuiThemes;
|
||||||
@@ -81,9 +80,6 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
|||||||
modules.add(new SoundLocator());
|
modules.add(new SoundLocator());
|
||||||
modules.add(new TreeAura());
|
modules.add(new TreeAura());
|
||||||
|
|
||||||
// Module modifications
|
|
||||||
NoRenderModifier.init();
|
|
||||||
|
|
||||||
// Commands
|
// Commands
|
||||||
Commands commands = Commands.get();
|
Commands commands = Commands.get();
|
||||||
commands.add(new CenterCommand());
|
commands.add(new CenterCommand());
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
package anticope.rejects.events;
|
|
||||||
|
|
||||||
import meteordevelopment.meteorclient.utils.misc.Pool;
|
|
||||||
|
|
||||||
public class ChunkPosDataEvent {
|
|
||||||
private static final Pool<ChunkPosDataEvent> INSTANCE = new Pool<>(ChunkPosDataEvent::new);
|
|
||||||
|
|
||||||
public int chunkX;
|
|
||||||
public int chunkZ;
|
|
||||||
|
|
||||||
public static ChunkPosDataEvent get(int x, int z) {
|
|
||||||
ChunkPosDataEvent event = INSTANCE.get();
|
|
||||||
event.chunkX = x;
|
|
||||||
event.chunkZ = z;
|
|
||||||
return event;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void returnChunkDataEvent(ChunkPosDataEvent event) {
|
|
||||||
INSTANCE.free(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package anticope.rejects.events;
|
|
||||||
|
|
||||||
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
|
||||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
|
||||||
|
|
||||||
public class CustomPayloadEvent extends PacketEvent {
|
|
||||||
public CustomPayloadS2CPacket packet;
|
|
||||||
|
|
||||||
private static final CustomPayloadEvent INSTANCE = new CustomPayloadEvent();
|
|
||||||
|
|
||||||
public static CustomPayloadEvent get(CustomPayloadS2CPacket packet) {
|
|
||||||
INSTANCE.setCancelled(false);
|
|
||||||
INSTANCE.packet = packet;
|
|
||||||
return INSTANCE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,7 +19,7 @@ public class StatsScreen extends WindowScreen {
|
|||||||
public final Entity entity;
|
public final Entity entity;
|
||||||
private boolean effectListExpanded = true;
|
private boolean effectListExpanded = true;
|
||||||
private boolean attribListExpanded = true;
|
private boolean attribListExpanded = true;
|
||||||
private boolean dimensionExpanded = false;
|
private boolean dimensionExpanded = true;
|
||||||
public StatsScreen(Entity e) {
|
public StatsScreen(Entity e) {
|
||||||
super(GuiThemes.get(),e.getName().getString());
|
super(GuiThemes.get(),e.getName().getString());
|
||||||
this.entity = e;
|
this.entity = e;
|
||||||
@@ -40,15 +40,12 @@ public class StatsScreen extends WindowScreen {
|
|||||||
add(theme.label(String.format("Type: %s", lang.get(entity.getType().getTranslationKey()))));
|
add(theme.label(String.format("Type: %s", lang.get(entity.getType().getTranslationKey()))));
|
||||||
add(theme.label(String.format("Age: %d", entity.age)));
|
add(theme.label(String.format("Age: %d", entity.age)));
|
||||||
add(theme.label(String.format("UUID: %s", entity.getUuidAsString())));
|
add(theme.label(String.format("UUID: %s", entity.getUuidAsString())));
|
||||||
if (entity instanceof LivingEntity) {
|
if (entity instanceof LivingEntity liv) {
|
||||||
LivingEntity liv = (LivingEntity) entity;
|
|
||||||
add(theme.label(String.format("Health: %.2f/%.2f", liv.getHealth(), liv.getMaxHealth())));
|
add(theme.label(String.format("Health: %.2f/%.2f", liv.getHealth(), liv.getMaxHealth())));
|
||||||
add(theme.label(String.format("Armor: %d/20", liv.getArmor())));
|
add(theme.label(String.format("Armor: %d/20", liv.getArmor())));
|
||||||
|
|
||||||
WSection effectList = add(theme.section("Status Effects", effectListExpanded)).expandX().widget();
|
WSection effectList = add(theme.section("Status Effects", effectListExpanded)).expandX().widget();
|
||||||
effectList.action = () -> {
|
effectList.action = () -> effectListExpanded = effectList.isExpanded();
|
||||||
effectListExpanded = effectList.isExpanded();
|
|
||||||
};
|
|
||||||
liv.getActiveStatusEffects().forEach((effect, instance) -> {
|
liv.getActiveStatusEffects().forEach((effect, instance) -> {
|
||||||
String status = lang.get(effect.getTranslationKey());
|
String status = lang.get(effect.getTranslationKey());
|
||||||
if (instance.getAmplifier() != 0) {
|
if (instance.getAmplifier() != 0) {
|
||||||
@@ -63,20 +60,14 @@ public class StatsScreen extends WindowScreen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WSection attribList = add(theme.section("Attributes", attribListExpanded)).expandX().widget();
|
WSection attribList = add(theme.section("Attributes", attribListExpanded)).expandX().widget();
|
||||||
attribList.action = () -> {
|
attribList.action = () -> attribListExpanded = attribList.isExpanded();
|
||||||
attribListExpanded = attribList.isExpanded();
|
liv.getAttributes().getTracked().forEach((attrib) -> attribList.add(theme.label(String.format("%s: %.2f",
|
||||||
};
|
|
||||||
liv.getAttributes().getTracked().forEach((attrib) -> {
|
|
||||||
attribList.add(theme.label(String.format("%s: %.2f",
|
|
||||||
lang.get(attrib.getAttribute().getTranslationKey()),
|
lang.get(attrib.getAttribute().getTranslationKey()),
|
||||||
attrib.getValue()
|
attrib.getValue()
|
||||||
))).expandX();
|
))).expandX());
|
||||||
});
|
|
||||||
}
|
}
|
||||||
WSection dimension = add(theme.section("Dimensions", dimensionExpanded)).expandX().widget();
|
WSection dimension = add(theme.section("Dimensions", dimensionExpanded)).expandX().widget();
|
||||||
dimension.action = () -> {
|
dimension.action = () -> dimensionExpanded = dimension.isExpanded();
|
||||||
dimensionExpanded = dimension.isExpanded();
|
|
||||||
};
|
|
||||||
dimension.add(theme.label(String.format("Position: %.2f, %.2f, %.2f", entity.getX(), entity.getY(), entity.getZ()))).expandX();
|
dimension.add(theme.label(String.format("Position: %.2f, %.2f, %.2f", entity.getX(), entity.getY(), entity.getZ()))).expandX();
|
||||||
dimension.add(theme.label(String.format("Yaw: %.2f, Pitch: %.2f", entity.getYaw(), entity.getPitch()))).expandX();
|
dimension.add(theme.label(String.format("Yaw: %.2f, Pitch: %.2f", entity.getYaw(), entity.getPitch()))).expandX();
|
||||||
Box box = entity.getBoundingBox();
|
Box box = entity.getBoundingBox();
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
package anticope.rejects.mixin;
|
package anticope.rejects.mixin;
|
||||||
|
|
||||||
import anticope.rejects.events.ChunkPosDataEvent;
|
|
||||||
import anticope.rejects.events.PlayerRespawnEvent;
|
import anticope.rejects.events.PlayerRespawnEvent;
|
||||||
import anticope.rejects.modules.SilentDisconnect;
|
import anticope.rejects.modules.SilentDisconnect;
|
||||||
import meteordevelopment.meteorclient.MeteorClient;
|
import meteordevelopment.meteorclient.MeteorClient;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
||||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||||
import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
|
|
||||||
import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket;
|
import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@@ -20,12 +18,6 @@ import static meteordevelopment.meteorclient.MeteorClient.mc;
|
|||||||
@Mixin(ClientPlayNetworkHandler.class)
|
@Mixin(ClientPlayNetworkHandler.class)
|
||||||
public class ClientPlayNetworkHandlerMixin {
|
public class ClientPlayNetworkHandlerMixin {
|
||||||
|
|
||||||
//the normal onChunkDataEvent should just provide coords aswell
|
|
||||||
@Inject(method = "onChunkData", at = @At("TAIL"))
|
|
||||||
public void onChunkData(ChunkDataS2CPacket packet, CallbackInfo ci) {
|
|
||||||
MeteorClient.EVENT_BUS.post(ChunkPosDataEvent.get(packet.getX(), packet.getZ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
//called on dimension change too
|
//called on dimension change too
|
||||||
@Inject(method = "onPlayerRespawn", at = @At("TAIL"))
|
@Inject(method = "onPlayerRespawn", at = @At("TAIL"))
|
||||||
public void onPlayerRespawn(PlayerRespawnS2CPacket packet, CallbackInfo ci) {
|
public void onPlayerRespawn(PlayerRespawnS2CPacket packet, CallbackInfo ci) {
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package anticope.rejects.mixin;
|
package anticope.rejects.mixin;
|
||||||
|
|
||||||
import anticope.rejects.modules.modifier.NoRenderModifier;
|
import anticope.rejects.mixininterface.INoRender;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
|
||||||
import net.minecraft.client.gui.screen.ChatInputSuggestor;
|
import net.minecraft.client.gui.screen.ChatInputSuggestor;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
@@ -12,6 +14,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
public class CommandSuggestorMixin {
|
public class CommandSuggestorMixin {
|
||||||
@Inject(method = "render", at = @At(value = "HEAD"), cancellable = true)
|
@Inject(method = "render", at = @At(value = "HEAD"), cancellable = true)
|
||||||
public void onRenderCommandSuggestion(MatrixStack matrices, int mouseX, int mouseY, CallbackInfo info) {
|
public void onRenderCommandSuggestion(MatrixStack matrices, int mouseX, int mouseY, CallbackInfo info) {
|
||||||
if (NoRenderModifier.noCommandSuggestions()) info.cancel();
|
if (((INoRender) Modules.get().get(NoRender.class)).noCommandSuggestions()) info.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
package anticope.rejects.mixin;
|
|
||||||
|
|
||||||
import anticope.rejects.events.CustomPayloadEvent;
|
|
||||||
import meteordevelopment.meteorclient.MeteorClient;
|
|
||||||
import net.minecraft.network.listener.ClientPlayPacketListener;
|
|
||||||
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
|
||||||
import net.minecraft.util.Identifier;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.Shadow;
|
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|
||||||
|
|
||||||
@Mixin(CustomPayloadS2CPacket.class)
|
|
||||||
public class CustomPayloadS2CPacketMixin {
|
|
||||||
@Shadow
|
|
||||||
private Identifier channel;
|
|
||||||
|
|
||||||
@Inject(method = "apply(Lnet/minecraft/network/listener/ClientPlayPacketListener;)V",
|
|
||||||
at = @At(value = "HEAD"), cancellable = true)
|
|
||||||
private void onApply(ClientPlayPacketListener clientPlayPacketListener, CallbackInfo info) {
|
|
||||||
CustomPayloadS2CPacket packet = (CustomPayloadS2CPacket) (Object) this;
|
|
||||||
CustomPayloadEvent event = MeteorClient.EVENT_BUS.post(CustomPayloadEvent.get(packet));
|
|
||||||
if (event.isCancelled()) {
|
|
||||||
info.cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -16,7 +16,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||||||
|
|
||||||
@Mixin(StructureVoidBlock.class)
|
@Mixin(StructureVoidBlock.class)
|
||||||
public abstract class StructureVoidBlockMixin extends Block {
|
public abstract class StructureVoidBlockMixin extends Block {
|
||||||
|
|
||||||
public StructureVoidBlockMixin(Settings settings) {
|
public StructureVoidBlockMixin(Settings settings) {
|
||||||
super(settings);
|
super(settings);
|
||||||
}
|
}
|
||||||
@@ -31,5 +30,4 @@ public abstract class StructureVoidBlockMixin extends Block {
|
|||||||
Rendering renderingModule = Modules.get().get(Rendering.class);
|
Rendering renderingModule = Modules.get().get(Rendering.class);
|
||||||
return !(renderingModule != null && renderingModule.renderStructureVoid());
|
return !(renderingModule != null && renderingModule.renderStructureVoid());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
package anticope.rejects.mixin;
|
package anticope.rejects.mixin;
|
||||||
|
|
||||||
import anticope.rejects.modules.modifier.NoRenderModifier;
|
import anticope.rejects.mixininterface.INoRender;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.Modules;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
|
||||||
|
import net.minecraft.client.toast.Toast;
|
||||||
|
import net.minecraft.client.toast.ToastManager;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
import org.spongepowered.asm.mixin.injection.Inject;
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import net.minecraft.client.toast.Toast;
|
|
||||||
import net.minecraft.client.toast.ToastManager;
|
|
||||||
|
|
||||||
@Mixin(ToastManager.class)
|
@Mixin(ToastManager.class)
|
||||||
public class ToastManagerMixin {
|
public class ToastManagerMixin {
|
||||||
@Inject(method="add", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "add", at = @At("HEAD"), cancellable = true)
|
||||||
public void preventAdd(Toast toast, CallbackInfo ci) {
|
public void preventAdd(Toast toast, CallbackInfo ci) {
|
||||||
if (NoRenderModifier.disableToasts()) ci.cancel();
|
if (((INoRender) Modules.get().get(NoRender.class)).disableToasts()) ci.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
package anticope.rejects.mixin.meteor.modules;
|
|
||||||
|
|
||||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
|
||||||
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
|
||||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
||||||
|
|
||||||
@Mixin(NoRender.class)
|
|
||||||
public interface NoRenderAccessor {
|
|
||||||
@Accessor(value = "sgOverlay", remap = false)
|
|
||||||
SettingGroup getSgOverlay();
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package anticope.rejects.mixin.meteor.modules;
|
||||||
|
|
||||||
|
import anticope.rejects.mixininterface.INoRender;
|
||||||
|
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||||
|
import meteordevelopment.meteorclient.settings.Setting;
|
||||||
|
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.Category;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||||
|
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(value = NoRender.class,remap = false)
|
||||||
|
public class NoRenderMixin extends Module implements INoRender {
|
||||||
|
@Shadow @Final private SettingGroup sgOverlay;
|
||||||
|
|
||||||
|
private Setting<Boolean> noCommandSuggestions;
|
||||||
|
private Setting<Boolean> disableToasts;
|
||||||
|
|
||||||
|
public NoRenderMixin(Category category, String name, String description) {
|
||||||
|
super(category, name, description);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Inject(method = "<init>", at = @At("TAIL"))
|
||||||
|
private void onInit(CallbackInfo ci) {
|
||||||
|
noCommandSuggestions = sgOverlay.add(new BoolSetting.Builder()
|
||||||
|
.name("command-suggestions")
|
||||||
|
.description("Disables command suggestions in chat.")
|
||||||
|
.defaultValue(false)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
disableToasts = sgOverlay.add(new BoolSetting.Builder()
|
||||||
|
.name("disable-toasts")
|
||||||
|
.description("Disable toasts (e.g. advancements)")
|
||||||
|
.defaultValue(false)
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean noCommandSuggestions() {
|
||||||
|
return isActive() && noCommandSuggestions.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean disableToasts() {
|
||||||
|
return isActive() && disableToasts.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package anticope.rejects.mixininterface;
|
||||||
|
|
||||||
|
public interface INoRender {
|
||||||
|
boolean noCommandSuggestions();
|
||||||
|
|
||||||
|
boolean disableToasts();
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
package anticope.rejects.modules;
|
package anticope.rejects.modules;
|
||||||
|
|
||||||
import anticope.rejects.MeteorRejectsAddon;
|
import anticope.rejects.MeteorRejectsAddon;
|
||||||
import anticope.rejects.events.CustomPayloadEvent;
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import meteordevelopment.meteorclient.events.packets.PacketEvent;
|
||||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
import meteordevelopment.meteorclient.settings.BoolSetting;
|
||||||
import meteordevelopment.meteorclient.settings.Setting;
|
import meteordevelopment.meteorclient.settings.Setting;
|
||||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
import meteordevelopment.meteorclient.settings.SettingGroup;
|
||||||
@@ -13,6 +13,7 @@ import meteordevelopment.meteorclient.systems.modules.Module;
|
|||||||
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
import meteordevelopment.meteorclient.utils.player.ChatUtils;
|
||||||
import meteordevelopment.orbit.EventHandler;
|
import meteordevelopment.orbit.EventHandler;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
|
||||||
import net.minecraft.text.HoverEvent;
|
import net.minecraft.text.HoverEvent;
|
||||||
import net.minecraft.text.MutableText;
|
import net.minecraft.text.MutableText;
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
@@ -24,7 +25,8 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class CustomPackets extends Module {
|
public class CustomPackets extends Module {
|
||||||
private static final Gson GSON_NON_PRETTY = new GsonBuilder().enableComplexMapKeySerialization().disableHtmlEscaping().create();
|
private static final Gson GSON_NON_PRETTY = new GsonBuilder().enableComplexMapKeySerialization().disableHtmlEscaping().create();
|
||||||
private static final Type BADLION_MODS_TYPE = new TypeToken<Map<String, BadlionMod>>() {}.getType();
|
private static final Type BADLION_MODS_TYPE = new TypeToken<Map<String, BadlionMod>>() {
|
||||||
|
}.getType();
|
||||||
|
|
||||||
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
private final SettingGroup sgGeneral = settings.getDefaultGroup();
|
||||||
private final SettingGroup sgBadlion = settings.createGroup("Bad Lion");
|
private final SettingGroup sgBadlion = settings.createGroup("Bad Lion");
|
||||||
@@ -49,30 +51,32 @@ public class CustomPackets extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
private void onCustomPayloadPacket(CustomPayloadEvent event) {
|
private void onCustomPayloadPacket(PacketEvent.Receive event) {
|
||||||
switch (event.packet.getChannel().toString()) {
|
if (event.packet instanceof CustomPayloadS2CPacket packet) {
|
||||||
case "badlion:mods" -> onBadlionModsPacket(event);
|
switch (packet.getChannel().toString()) {
|
||||||
default -> onUnknownPacket(event);
|
case "badlion:mods" -> event.setCancelled(onBadlionModsPacket(packet));
|
||||||
|
default -> onUnknownPacket(packet);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onUnknownPacket(CustomPayloadEvent event) {
|
private void onUnknownPacket(CustomPayloadS2CPacket packet) {
|
||||||
if (!unknownPackets.get()) return;
|
if (!unknownPackets.get()) return;
|
||||||
MutableText text = Text.literal(event.packet.getChannel().toString());
|
MutableText text = Text.literal(packet.getChannel().toString());
|
||||||
text.setStyle(text.getStyle()
|
text.setStyle(text.getStyle()
|
||||||
.withHoverEvent(new HoverEvent(
|
.withHoverEvent(new HoverEvent(
|
||||||
HoverEvent.Action.SHOW_TEXT,
|
HoverEvent.Action.SHOW_TEXT,
|
||||||
Text.literal(readString(event.packet.getData()))
|
Text.literal(readString(packet.getData()))
|
||||||
)));
|
)));
|
||||||
info(text);
|
info(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onBadlionModsPacket(CustomPayloadEvent event) {
|
private boolean onBadlionModsPacket(CustomPayloadS2CPacket packet) {
|
||||||
if (!mods.get()) return;
|
if (!mods.get()) return false;
|
||||||
String json = readString(event.packet.getData());
|
String json = readString(packet.getData());
|
||||||
Map<String, BadlionMod> mods = GSON_NON_PRETTY.fromJson(json, BADLION_MODS_TYPE);
|
Map<String, BadlionMod> mods = GSON_NON_PRETTY.fromJson(json, BADLION_MODS_TYPE);
|
||||||
ChatUtils.sendMsg("Badlion", format("Mods", formatMods(mods)));
|
ChatUtils.sendMsg("Badlion", format("Mods", formatMods(mods)));
|
||||||
event.cancel();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MutableText format(String type, MutableText message) {
|
private MutableText format(String type, MutableText message) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package anticope.rejects.modules;
|
package anticope.rejects.modules;
|
||||||
|
|
||||||
import anticope.rejects.MeteorRejectsAddon;
|
import anticope.rejects.MeteorRejectsAddon;
|
||||||
import anticope.rejects.events.ChunkPosDataEvent;
|
|
||||||
import anticope.rejects.events.PlayerRespawnEvent;
|
import anticope.rejects.events.PlayerRespawnEvent;
|
||||||
import anticope.rejects.events.SeedChangedEvent;
|
import anticope.rejects.events.SeedChangedEvent;
|
||||||
import anticope.rejects.utils.Ore;
|
import anticope.rejects.utils.Ore;
|
||||||
@@ -10,6 +9,7 @@ import anticope.rejects.utils.seeds.Seeds;
|
|||||||
import baritone.api.BaritoneAPI;
|
import baritone.api.BaritoneAPI;
|
||||||
import com.seedfinding.mccore.version.MCVersion;
|
import com.seedfinding.mccore.version.MCVersion;
|
||||||
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
import meteordevelopment.meteorclient.events.render.Render3DEvent;
|
||||||
|
import meteordevelopment.meteorclient.events.world.ChunkDataEvent;
|
||||||
import meteordevelopment.meteorclient.events.world.TickEvent;
|
import meteordevelopment.meteorclient.events.world.TickEvent;
|
||||||
import meteordevelopment.meteorclient.settings.*;
|
import meteordevelopment.meteorclient.settings.*;
|
||||||
import meteordevelopment.meteorclient.systems.modules.Module;
|
import meteordevelopment.meteorclient.systems.modules.Module;
|
||||||
@@ -106,7 +106,7 @@ public class OreSim extends Module {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (Vec3d pos : chunkRenderers.get(chunkKey).get(ore)) {
|
for (Vec3d pos : chunkRenderers.get(chunkKey).get(ore)) {
|
||||||
event.renderer.boxLines(pos.x,pos.y,pos.z,pos.x+1,pos.y+1,pos.z+1, ore.color,0);
|
event.renderer.boxLines(pos.x, pos.y, pos.z, pos.x + 1, pos.y + 1, pos.z + 1, ore.color, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,11 +151,11 @@ public class OreSim extends Module {
|
|||||||
oreGoals.clear();
|
oreGoals.clear();
|
||||||
var chunkPos = mc.player.getChunkPos();
|
var chunkPos = mc.player.getChunkPos();
|
||||||
int rangeVal = 4;
|
int rangeVal = 4;
|
||||||
for(int range = 0; range <= rangeVal; ++range) {
|
for (int range = 0; range <= rangeVal; ++range) {
|
||||||
for(int x = -range + chunkPos.x; x <= range + chunkPos.x; ++x) {
|
for (int x = -range + chunkPos.x; x <= range + chunkPos.x; ++x) {
|
||||||
oreGoals.addAll(addToBaritone(x, chunkPos.z + range - rangeVal));
|
oreGoals.addAll(addToBaritone(x, chunkPos.z + range - rangeVal));
|
||||||
}
|
}
|
||||||
for(int x = -range + 1 + chunkPos.x; x < range + chunkPos.x; ++x) {
|
for (int x = -range + 1 + chunkPos.x; x < range + chunkPos.x; ++x) {
|
||||||
oreGoals.addAll(this.addToBaritone(x, chunkPos.z - range + rangeVal + 1));
|
oreGoals.addAll(this.addToBaritone(x, chunkPos.z - range + rangeVal + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -164,20 +164,16 @@ public class OreSim extends Module {
|
|||||||
|
|
||||||
private ArrayList<BlockPos> addToBaritone(int chunkX, int chunkZ) {
|
private ArrayList<BlockPos> addToBaritone(int chunkX, int chunkZ) {
|
||||||
ArrayList<BlockPos> baritoneGoals = new ArrayList<>();
|
ArrayList<BlockPos> baritoneGoals = new ArrayList<>();
|
||||||
long chunkKey = (long)chunkX + ((long)chunkZ << 32);
|
long chunkKey = (long) chunkX + ((long) chunkZ << 32);
|
||||||
if (!this.chunkRenderers.containsKey(chunkKey)) {
|
if (!this.chunkRenderers.containsKey(chunkKey)) {
|
||||||
return baritoneGoals;
|
return baritoneGoals;
|
||||||
} else {
|
} else {
|
||||||
this.oreConfig.stream().filter((config) -> {
|
this.oreConfig.stream().filter((config) -> config.enabled.get()).forEach((ore) -> chunkRenderers
|
||||||
return (Boolean)config.enabled.get();
|
|
||||||
}).forEach((ore) -> {
|
|
||||||
chunkRenderers
|
|
||||||
.get(chunkKey)
|
.get(chunkKey)
|
||||||
.getOrDefault(ore, new HashSet<>())
|
.getOrDefault(ore, new HashSet<>())
|
||||||
.stream()
|
.stream()
|
||||||
.map(BlockPos::ofFloored)
|
.map(BlockPos::ofFloored)
|
||||||
.forEach(baritoneGoals::add);
|
.forEach(baritoneGoals::add));
|
||||||
});
|
|
||||||
return baritoneGoals;
|
return baritoneGoals;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -235,8 +231,8 @@ public class OreSim extends Module {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onChunkData(ChunkPosDataEvent event) {
|
public void onChunkData(ChunkDataEvent event) {
|
||||||
doMathOnChunk(event.chunkX, event.chunkZ);
|
doMathOnChunk(event.chunk.getPos().x, event.chunk.getPos().z);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doMathOnChunk(int chunkX, int chunkZ) {
|
private void doMathOnChunk(int chunkX, int chunkZ) {
|
||||||
@@ -317,7 +313,8 @@ public class OreSim extends Module {
|
|||||||
y += ore.minY;
|
y += ore.minY;
|
||||||
|
|
||||||
switch (ore.generator) {
|
switch (ore.generator) {
|
||||||
case DEFAULT -> ores.addAll(generateNormal(world, random, new BlockPos(x, y, z), ore.size, ore.discardOnAir));
|
case DEFAULT ->
|
||||||
|
ores.addAll(generateNormal(world, random, new BlockPos(x, y, z), ore.size, ore.discardOnAir));
|
||||||
case EMERALD -> {
|
case EMERALD -> {
|
||||||
if (airCheck.get() == AirCheck.OFF || world.getBlockState(new BlockPos(x, y, z)).isOpaque()) {
|
if (airCheck.get() == AirCheck.OFF || world.getBlockState(new BlockPos(x, y, z)).isOpaque()) {
|
||||||
ores.add(new Vec3d(x, y, z));
|
ores.add(new Vec3d(x, y, z));
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
package anticope.rejects.modules.modifier;
|
|
||||||
|
|
||||||
import anticope.rejects.mixin.meteor.modules.NoRenderAccessor;
|
|
||||||
import meteordevelopment.meteorclient.settings.BoolSetting;
|
|
||||||
import meteordevelopment.meteorclient.settings.Setting;
|
|
||||||
import meteordevelopment.meteorclient.settings.SettingGroup;
|
|
||||||
import meteordevelopment.meteorclient.systems.modules.Modules;
|
|
||||||
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
|
|
||||||
|
|
||||||
public class NoRenderModifier {
|
|
||||||
static SettingGroup sgOverlay;
|
|
||||||
|
|
||||||
public static Setting<Boolean> noCommandSuggestions;
|
|
||||||
public static Setting<Boolean> disableToasts;
|
|
||||||
|
|
||||||
public static boolean noCommandSuggestions() {
|
|
||||||
if (noCommandSuggestions == null || Modules.get() == null || Modules.get().get(NoRender.class) == null) return false;
|
|
||||||
return Modules.get().get(NoRender.class).isActive() && noCommandSuggestions.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean disableToasts() {
|
|
||||||
if (disableToasts == null || Modules.get() == null || Modules.get().get(NoRender.class) == null) return false;
|
|
||||||
return Modules.get().get(NoRender.class).isActive() && disableToasts.get();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
sgOverlay = ((NoRenderAccessor) Modules.get().get(NoRender.class)).getSgOverlay();
|
|
||||||
noCommandSuggestions = sgOverlay.add(new BoolSetting.Builder()
|
|
||||||
.name("command-suggestions")
|
|
||||||
.description("Disables command suggestions in chat.")
|
|
||||||
.defaultValue(false)
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
disableToasts = sgOverlay.add(new BoolSetting.Builder()
|
|
||||||
.name("disable-toasts")
|
|
||||||
.description("Disable toasts (e.g. advancements)")
|
|
||||||
.defaultValue(false)
|
|
||||||
.build()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -19,6 +19,6 @@
|
|||||||
"modules.FlightMixin",
|
"modules.FlightMixin",
|
||||||
"modules.InventoryTweaksMixin",
|
"modules.InventoryTweaksMixin",
|
||||||
"modules.KillAuraMixin",
|
"modules.KillAuraMixin",
|
||||||
"modules.NoRenderAccessor"
|
"modules.NoRenderMixin"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
"ClientPlayerInteractionManagerMixin",
|
"ClientPlayerInteractionManagerMixin",
|
||||||
"ClientPlayNetworkHandlerMixin",
|
"ClientPlayNetworkHandlerMixin",
|
||||||
"CommandSuggestorMixin",
|
"CommandSuggestorMixin",
|
||||||
"CustomPayloadS2CPacketMixin",
|
|
||||||
"Deadmau5FeatureRendererMixin",
|
"Deadmau5FeatureRendererMixin",
|
||||||
"EntityAccessor",
|
"EntityAccessor",
|
||||||
"GameRendererMixin",
|
"GameRendererMixin",
|
||||||
|
|||||||
Reference in New Issue
Block a user