Update to Meteor-Rejects to 1.21.10
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

This commit is contained in:
2025-11-01 23:32:30 -03:00
parent 4563a7e7ef
commit 4a822e773c
61 changed files with 483 additions and 328 deletions

View File

@@ -1,5 +1,5 @@
plugins { plugins {
id 'fabric-loom' version '1.9-SNAPSHOT' id 'fabric-loom' version '1.11-SNAPSHOT'
} }
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21 sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
@@ -9,90 +9,94 @@ version = project.mod_version
group = project.maven_group group = project.maven_group
repositories { repositories {
mavenCentral() mavenCentral()
mavenLocal() mavenLocal()
maven { url "https://maven.meteordev.org/releases"} maven { url "https://maven.meteordev.org/releases"}
maven { url "https://maven.meteordev.org/snapshots" } maven { url "https://maven.meteordev.org/snapshots" }
maven { url "https://maven.seedfinding.com/" } maven { url "https://maven.seedfinding.com/" }
maven { url "https://maven-snapshots.seedfinding.com/" } maven { url "https://maven-snapshots.seedfinding.com/" }
maven { url 'https://jitpack.io' } maven { url 'https://jitpack.io' }
maven { url 'https://maven.duti.dev/releases' } maven { url 'https://maven.duti.dev/releases' }
} }
loom { loom {
accessWidenerPath = file("src/main/resources/meteor-rejects.accesswidener") accessWidenerPath = file("src/main/resources/meteor-rejects.accesswidener")
} }
configurations { configurations {
// configuration that holds jars to include in the jar // configuration that holds jars to include in the jar
extraLibs extraLibs
} }
dependencies { dependencies {
// This will make it work on most platforms. It automatically chooses the right dependencies at runtime. // This will make it work on most platforms. It automatically chooses the right dependencies at runtime.
extraLibs('dev.duti.acheong:cubiomes:1.22.3') { transitive = false } extraLibs('dev.duti.acheong:cubiomes:1.22.3') { transitive = false }
extraLibs('dev.duti.acheong:cubiomes:1.22.3:linux64') { transitive = false } extraLibs('dev.duti.acheong:cubiomes:1.22.3:linux64') { transitive = false }
extraLibs('dev.duti.acheong:cubiomes:1.22.3:osx') { transitive = false } extraLibs('dev.duti.acheong:cubiomes:1.22.3:osx') { transitive = false }
extraLibs('dev.duti.acheong:cubiomes:1.22.3:windows64') { transitive = false } extraLibs('dev.duti.acheong:cubiomes:1.22.3:windows64') { transitive = false }
// To change the versions see the gradle.properties file // To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}" minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_version}:v2" mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation("meteordevelopment:meteor-client:${project.minecraft_version}-SNAPSHOT") modImplementation("meteordevelopment:meteor-client:${project.minecraft_version}-SNAPSHOT")
modCompileOnly "meteordevelopment:baritone:${project.baritone_version}-SNAPSHOT" modCompileOnly "meteordevelopment:baritone:${project.baritone_version}-SNAPSHOT"
// seed .locate and ore sim // Apache Commons Text for WordUtils
extraLibs('com.seedfinding:mc_math:ffd2edcfcc0d18147549c88cc7d8ec6cf21b5b91') { transitive = false } implementation 'org.apache.commons:commons-text:1.10.0'
extraLibs('com.seedfinding:mc_seed:1ead6fcefe7e8de4b3d60cd6c4e993f1e8f33409') { transitive = false } include 'org.apache.commons:commons-text:1.10.0'
extraLibs('com.seedfinding:mc_core:1.210.0') { transitive = false }
extraLibs('com.seedfinding:mc_noise:7e3ba65e181796c4a2a1c8881d840b2254b92962') { transitive = false }
extraLibs('com.seedfinding:mc_biome:41a42cb9019a552598f12089059538853e18ec78') { transitive = false }
extraLibs('com.seedfinding:mc_terrain:b4246cbd5880c4f8745ccb90e1b102bde3448126') { transitive = false }
extraLibs('com.seedfinding:mc_feature:919b7e513cc1e87e029a9cd703fc4e2dc8686229') { transitive = false }
// seedcracker api // seed .locate and ore sim
implementation (include('com.github.19MisterX98.SeedcrackerX:seedcrackerx-api:2.10.1')) {transitive = false} extraLibs('com.seedfinding:mc_math:ffd2edcfcc0d18147549c88cc7d8ec6cf21b5b91') { transitive = false }
// implementation (include('com.github.19MisterX98.SeedcrackerX:seedcrackerx-api:master-SNAPSHOT')) {transitive = false} extraLibs('com.seedfinding:mc_seed:1ead6fcefe7e8de4b3d60cd6c4e993f1e8f33409') { transitive = false }
extraLibs('com.seedfinding:mc_core:1.210.0') { transitive = false }
extraLibs('com.seedfinding:mc_noise:7e3ba65e181796c4a2a1c8881d840b2254b92962') { transitive = false }
extraLibs('com.seedfinding:mc_biome:41a42cb9019a552598f12089059538853e18ec78') { transitive = false }
extraLibs('com.seedfinding:mc_terrain:b4246cbd5880c4f8745ccb90e1b102bde3448126') { transitive = false }
extraLibs('com.seedfinding:mc_feature:919b7e513cc1e87e029a9cd703fc4e2dc8686229') { transitive = false }
configurations.implementation.extendsFrom(configurations.extraLibs) // seedcracker api
implementation (include('com.github.19MisterX98.SeedcrackerX:seedcrackerx-api:2.10.1')) {transitive = false}
// implementation (include('com.github.19MisterX98.SeedcrackerX:seedcrackerx-api:master-SNAPSHOT')) {transitive = false}
configurations.implementation.extendsFrom(configurations.extraLibs)
} }
processResources { processResources {
inputs.property "version", project.version inputs.property "version", project.version
filesMatching("fabric.mod.json") { filesMatching("fabric.mod.json") {
expand "version": project.version, expand "version": project.version,
"mc_version": project.minecraft_version, "mc_version": project.minecraft_version,
"gh_hash": (System.getenv("GITHUB_SHA") ?: "") "gh_hash": (System.getenv("GITHUB_SHA") ?: "")
} }
} }
jar { jar {
from("LICENSE") { from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" } rename { "${it}_${project.archivesBaseName}" }
} }
from { from {
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) } configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
} }
} }
tasks.withType(Jar) { tasks.withType(Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE duplicatesStrategy = DuplicatesStrategy.EXCLUDE
} }
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is // ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly // this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
// If Javadoc is generated, this must be specified in that task too. // If Javadoc is generated, this must be specified in that task too.
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
// The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too
// JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used.
// We'll use that if it's available, but otherwise we'll use the older option. // We'll use that if it's available, but otherwise we'll use the older option.
def targetVersion = 21 def targetVersion = 21
if (JavaVersion.current().isJava9Compatible()) { if (JavaVersion.current().isJava9Compatible()) {
it.options.release = targetVersion it.options.release = targetVersion
} }
} }

View File

@@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx2G org.gradle.jvmargs=-Xmx2G
# Fabric Properties # Fabric Properties
minecraft_version=1.21.4 minecraft_version=1.21.10
yarn_version=1.21.4+build.8 yarn_version=1.21.10+build.2
loader_version=0.16.9 loader_version=0.17.2
# Mod Properties # Mod Properties
mod_version = 0.3 mod_version = 0.3
maven_group = anticope.rejects maven_group = anticope.rejects
archives_base_name = meteor-rejects-addon archives_base_name = meteor-rejects-addon
baritone_version=1.21.4 baritone_version=1.21.10

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@@ -50,7 +50,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new BoatPhase()); modules.add(new BoatPhase());
modules.add(new Boost()); modules.add(new Boost());
modules.add(new BungeeCordSpoof()); modules.add(new BungeeCordSpoof());
modules.add(new ChatBot()); // modules.add(new ChatBot()); // DESABILITADO: Starscript API removida
modules.add(new ChestAura()); modules.add(new ChestAura());
modules.add(new ChorusExploit()); modules.add(new ChorusExploit());
modules.add(new ColorSigns()); modules.add(new ColorSigns());
@@ -63,7 +63,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new GhostMode()); modules.add(new GhostMode());
modules.add(new Glide()); modules.add(new Glide());
modules.add(new ItemGenerator()); modules.add(new ItemGenerator());
modules.add(new InteractionMenu()); // modules.add(new InteractionMenu()); // DESABILITADO: Starscript API removida
modules.add(new Jetpack()); modules.add(new Jetpack());
modules.add(new KnockbackPlus()); modules.add(new KnockbackPlus());
modules.add(new LawnBot()); modules.add(new LawnBot());
@@ -73,13 +73,13 @@ public class MeteorRejectsAddon extends MeteorAddon {
modules.add(new NoJumpDelay()); modules.add(new NoJumpDelay());
modules.add(new ObsidianFarm()); modules.add(new ObsidianFarm());
modules.add(new OreSim()); modules.add(new OreSim());
modules.add(new PacketFly()); // modules.add(new PacketFly()); // DESABILITADO: PlayerPosition API mudou completamente
modules.add(new Painter()); modules.add(new Painter());
modules.add(new Rendering()); modules.add(new Rendering());
modules.add(new RoboWalk()); modules.add(new RoboWalk());
modules.add(new ShieldBypass()); modules.add(new ShieldBypass());
modules.add(new SilentDisconnect()); modules.add(new SilentDisconnect());
modules.add(new SkeletonESP()); // modules.add(new SkeletonESP()); // DESABILITADO: Rendering API mudou completamente
modules.add(new SoundLocator()); modules.add(new SoundLocator());
modules.add(new TreeAura()); modules.add(new TreeAura());
modules.add(new VehicleOneHit()); modules.add(new VehicleOneHit());

View File

@@ -44,8 +44,9 @@ public class GiveCommand extends Command {
if (inHand.getItem() instanceof BlockItem) { if (inHand.getItem() instanceof BlockItem) {
ct.putInt("Time", 1); ct.putInt("Time", 1);
ct.putString("id", "minecraft:falling_block"); ct.putString("id", "minecraft:falling_block");
ct.put("BlockState", new NbtCompound()); NbtCompound blockState = new NbtCompound();
ct.getCompound("BlockState").putString("Name", Registries.ITEM.getId(inHand.getItem()).toString()); blockState.putString("Name", Registries.ITEM.getId(inHand.getItem()).toString());
ct.put("BlockState", blockState);
} else { } else {
ct.putString("id", "minecraft:item"); ct.putString("id", "minecraft:item");
@@ -88,7 +89,7 @@ public class GiveCommand extends Command {
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(message)) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(message))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag)) .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag))
.build(); .build();
stack.applyChanges(changes); stack.applyChanges(changes);
@@ -108,7 +109,7 @@ public class GiveCommand extends Command {
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(message)) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(message))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(tag)) .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(tag))
.build(); .build();
stack.applyChanges(changes); stack.applyChanges(changes);
@@ -121,8 +122,10 @@ public class GiveCommand extends Command {
String playerName = ctx.getArgument("owner", String.class); String playerName = ctx.getArgument("owner", String.class);
ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD); ItemStack itemStack = new ItemStack(Items.PLAYER_HEAD);
// For now, skip the profile component as it's causing issues
// TODO: Fix ProfileComponent usage for player heads
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.PROFILE, new ProfileComponent(new GameProfile(getUUID(playerName), playerName))) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(playerName + "'s Head"))
.build(); .build();
itemStack.applyChanges(changes); itemStack.applyChanges(changes);

View File

@@ -8,6 +8,8 @@ import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.network.ServerAddress; import net.minecraft.client.network.ServerAddress;
import net.minecraft.client.network.ServerInfo; import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket;
import net.minecraft.text.Text;
public class ReconnectCommand extends Command { public class ReconnectCommand extends Command {
public ReconnectCommand() { public ReconnectCommand() {
@@ -19,7 +21,7 @@ public class ReconnectCommand extends Command {
builder.executes(context -> { builder.executes(context -> {
ServerInfo info = mc.isInSingleplayer() ? null : mc.getCurrentServerEntry(); ServerInfo info = mc.isInSingleplayer() ? null : mc.getCurrentServerEntry();
if (info != null) { if (info != null) {
mc.world.disconnect(); mc.player.networkHandler.onDisconnect(new DisconnectS2CPacket(Text.literal("Reconnecting...")));
ConnectScreen.connect(new MultiplayerScreen(new TitleScreen()), mc, ConnectScreen.connect(new MultiplayerScreen(new TitleScreen()), mc,
ServerAddress.parse(info.address), info, false, null); ServerAddress.parse(info.address), info, false, null);
} }

View File

@@ -44,7 +44,7 @@ public class SaveSkinCommand extends Command {
@Override @Override
public void build(LiteralArgumentBuilder<CommandSource> builder) { public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.then(argument("player", PlayerListEntryArgumentType.create()).executes(ctx -> { builder.then(argument("player", PlayerListEntryArgumentType.create()).executes(ctx -> {
UUID id = PlayerListEntryArgumentType.get(ctx).getProfile().getId(); UUID id = PlayerListEntryArgumentType.get(ctx).getProfile().id();
String path = TinyFileDialogs.tinyfd_saveFileDialog("Save image", null, filters, null); String path = TinyFileDialogs.tinyfd_saveFileDialog("Save image", null, filters, null);
if (path == null) IO_EXCEPTION.create(); if (path == null) IO_EXCEPTION.create();
if (path != null) { if (path != null) {

View File

@@ -10,12 +10,13 @@ import meteordevelopment.meteorclient.commands.Command;
import net.minecraft.client.network.ServerInfo; import net.minecraft.client.network.ServerInfo;
import net.minecraft.command.CommandSource; import net.minecraft.command.CommandSource;
import net.minecraft.text.ClickEvent; import net.minecraft.text.ClickEvent;
import net.minecraft.text.ClickEvent.Action;
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;
import net.minecraft.util.Formatting; import net.minecraft.util.Formatting;
import java.net.URI;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.*; import java.util.*;
@@ -116,46 +117,38 @@ public class ServerCommand extends Command {
text.append(ports.get(port)); text.append(ports.get(port));
if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) { if (ports.get(port).startsWith("HTTP") || ports.get(port).startsWith("FTP")) {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.OpenUrl(
Action.OPEN_URL, URI.create(String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port))
String.format("%s://%s:%d", ports.get(port).toLowerCase(), address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser") Text.literal("Open in browser")
)) ))
); );
} else if (Objects.equals(ports.get(port), "DynMap")) { } else if (Objects.equals(ports.get(port), "DynMap")) {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.OpenUrl(
ClickEvent.Action.OPEN_URL, URI.create(String.format("http://%s:%d", address.getHostAddress(), port))
String.format("http://%s:%d", address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Open in browser") Text.literal("Open in browser")
)) ))
); );
} else { } else {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.CopyToClipboard(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port) String.format("%s:%d", address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy") Text.literal("Copy")
)) ))
); );
} }
} else { } else {
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.CopyToClipboard(
ClickEvent.Action.COPY_TO_CLIPBOARD,
String.format("%s:%d", address.getHostAddress(), port) String.format("%s:%d", address.getHostAddress(), port)
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy") Text.literal("Copy")
)) ))
); );

View File

@@ -98,7 +98,7 @@ public class HeadScreen extends WindowScreen {
WButton equip = t.add(theme.button("Equip")).widget(); WButton equip = t.add(theme.button("Equip")).widget();
equip.tooltip = "Equip client-side."; equip.tooltip = "Equip client-side.";
equip.action = () -> { equip.action = () -> {
mc.player.getInventory().armor.set(3, head); mc.player.getInventory().setStack(39, head);
}; };
t.row(); t.row();
} }
@@ -111,7 +111,7 @@ public class HeadScreen extends WindowScreen {
ItemStack head = Items.PLAYER_HEAD.getDefaultStack(); ItemStack head = Items.PLAYER_HEAD.getDefaultStack();
NbtCompound tag = new NbtCompound(); NbtCompound tag = new NbtCompound();
NbtCompound skullOwner = new NbtCompound(); NbtCompound skullOwner = new NbtCompound();
skullOwner.putUuid("Id", UUID.fromString(uuid)); skullOwner.putString("Id", uuid);
NbtCompound properties = new NbtCompound(); NbtCompound properties = new NbtCompound();
NbtList textures = new NbtList(); NbtList textures = new NbtList();
NbtCompound Value = new NbtCompound(); NbtCompound Value = new NbtCompound();

View File

@@ -102,7 +102,7 @@ public class CleanUpScreen extends WindowScreen {
} }
private boolean isSameProtocol(ServerInfo server) { private boolean isSameProtocol(ServerInfo server) {
return server.protocolVersion == SharedConstants.getGameVersion().getProtocolVersion(); return server.protocolVersion == SharedConstants.getProtocolVersion();
} }
private boolean isFailedPing(ServerInfo server) { private boolean isFailedPing(ServerInfo server) {

View File

@@ -221,6 +221,16 @@ public class MeteorRoundedGuiTheme extends GuiTheme {
return w(new WMeteorMinus()); return w(new WMeteorMinus());
} }
@Override
public WConfirmedMinus confirmedMinus() {
return w(new WMeteorConfirmedMinus());
}
@Override
public WConfirmedButton confirmedButton(String text, String message, GuiTexture texture) {
return w(new WMeteorConfirmedButton(text, message, texture));
}
@Override @Override
public WPlus plus() { public WPlus plus() {
return w(new WMeteorPlus()); return w(new WMeteorPlus());

View File

@@ -0,0 +1,29 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client/).
* Copyright (c) 2021 Meteor Development.
*/
package anticope.rejects.gui.themes.rounded.widgets.pressable;
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
import meteordevelopment.meteorclient.gui.renderer.packer.GuiTexture;
import anticope.rejects.gui.themes.rounded.MeteorWidget;
import meteordevelopment.meteorclient.gui.widgets.pressable.WConfirmedButton;
public class WMeteorConfirmedButton extends WConfirmedButton implements MeteorWidget {
public WMeteorConfirmedButton(String text, String message, GuiTexture texture) {
super(text, message, texture);
}
@Override
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
renderBackground(renderer, this, pressed, mouseOver);
if (texture != null) {
double ts = theme().textHeight();
renderer.quad(x + width / 2 - ts / 2, y + pad(), ts, ts, texture, theme().textColor.get());
} else {
renderer.text(text, x + width / 2 - theme().textRenderer().getWidth(text) / 2, y + pad(), theme().textColor.get(), false);
}
}
}

View File

@@ -0,0 +1,21 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client/).
* Copyright (c) 2021 Meteor Development.
*/
package anticope.rejects.gui.themes.rounded.widgets.pressable;
import meteordevelopment.meteorclient.gui.renderer.GuiRenderer;
import anticope.rejects.gui.themes.rounded.MeteorWidget;
import meteordevelopment.meteorclient.gui.widgets.pressable.WConfirmedMinus;
public class WMeteorConfirmedMinus extends WConfirmedMinus implements MeteorWidget {
@Override
protected void onRender(GuiRenderer renderer, double mouseX, double mouseY, double delta) {
double pad = pad();
double s = theme.scale(3);
renderBackground(renderer, this, pressed, mouseOver);
renderer.quad(x + pad, y + height / 2 - s / 2, width - pad * 2, s, theme().minusColor.get());
}
}

View File

@@ -0,0 +1,13 @@
package anticope.rejects.mixin;
import net.minecraft.client.network.ClientPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(ClientPlayerEntity.class)
public interface ClientPlayerEntityAccessor {
@Mutable
@Accessor("ticksSinceLastPositionPacketSent")
void setTicksSinceLastPositionPacketSent(int ticks);
}

View File

@@ -13,6 +13,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public class ClientPlayerInteractionManagerMixin { public class ClientPlayerInteractionManagerMixin {
@Inject(method = "stopUsingItem", at = @At("HEAD")) @Inject(method = "stopUsingItem", at = @At("HEAD"))
public void onStopUsingItem(PlayerEntity player, CallbackInfo ci) { public void onStopUsingItem(PlayerEntity player, CallbackInfo ci) {
MeteorClient.EVENT_BUS.post(StopUsingItemEvent.get(player.getInventory().getMainHandStack())); MeteorClient.EVENT_BUS.post(StopUsingItemEvent.get(player.getMainHandStack()));
} }
} }

View File

@@ -1,19 +0,0 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.render.entity.feature.Deadmau5FeatureRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Deadmau5FeatureRenderer.class)
public class Deadmau5FeatureRendererMixin {
@Redirect(method = "render", at = @At(value = "INVOKE", target = "Ljava/lang/String;equals(Ljava/lang/Object;)Z"))
private boolean redirectAllow(String s, Object name){
Rendering renderingModule = Modules.get().get(Rendering.class);
if (renderingModule != null && renderingModule.deadmau5EarsEnabled()) return true;
return name.equals(s);
}
}

View File

@@ -0,0 +1,27 @@
package anticope.rejects.mixin;
import anticope.rejects.modules.Rendering;
import meteordevelopment.meteorclient.systems.modules.Modules;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.feature.Deadmau5FeatureRenderer;
import net.minecraft.client.util.math.MatrixStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(Deadmau5FeatureRenderer.class)
public class Deadmau5FeatureRendererMixin {
@Inject(method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/network/AbstractClientPlayerEntity;FFFFFF)V", at = @At("HEAD"), cancellable = true)
private void onRender(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, AbstractClientPlayerEntity player, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch, CallbackInfo ci) {
Rendering renderingModule = Modules.get().get(Rendering.class);
if (renderingModule != null && !renderingModule.deadmau5EarsEnabled()) {
// If the feature is disabled and player is not deadmau5, cancel rendering
if (!player.getName().getString().equals("deadmau5")) {
ci.cancel();
}
}
// If the feature is enabled, allow rendering for everyone (don't cancel)
}
}

View File

@@ -0,0 +1,14 @@
package anticope.rejects.mixin;
import net.minecraft.entity.player.PlayerInventory;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(PlayerInventory.class)
public interface PlayerInventoryAccessor {
@Accessor("selectedSlot")
int getSelectedSlot();
@Accessor("selectedSlot")
void setSelectedSlot(int slot);
}

View File

@@ -14,4 +14,11 @@ public interface PlayerMoveC2SPacketAccessor {
@Mutable @Mutable
@Accessor("z") @Accessor("z")
void setZ(double z); void setZ(double z);
}
@Mutable
@Accessor("y")
void setY(double y);
@Accessor("y")
double getY();
}

View File

@@ -9,11 +9,17 @@ import org.spongepowered.asm.mixin.injection.ModifyVariable;
@Mixin(TexturedRenderLayers.class) @Mixin(TexturedRenderLayers.class)
public class TexturedRenderLayersMixin { public class TexturedRenderLayersMixin {
@ModifyVariable(method = "getChestTextureId(Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/block/enums/ChestType;Z)Lnet/minecraft/client/util/SpriteIdentifier;", at = @At("LOAD"), ordinal = 0) @ModifyVariable(
private static boolean chrsitmas(boolean christmas) { method = "getChestTextureId",
at = @At("HEAD"),
ordinal = 0,
argsOnly = true
)
private static boolean christmas(boolean christmas) {
Rendering rendering = Modules.get().get(Rendering.class); Rendering rendering = Modules.get().get(Rendering.class);
if (rendering != null && rendering.chistmas()) if (rendering != null && rendering.chistmas()) {
return true; return true;
}
return christmas; return christmas;
} }
} }

View File

@@ -1,6 +1,6 @@
package anticope.rejects.mixin.meteor.modules; package anticope.rejects.mixin.meteor.modules;
import anticope.rejects.modules.ShieldBypass; // import anticope.rejects.modules.ShieldBypass;
import anticope.rejects.utils.RejectsUtils; import anticope.rejects.utils.RejectsUtils;
import meteordevelopment.meteorclient.events.Cancellable; import meteordevelopment.meteorclient.events.Cancellable;
import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.events.world.TickEvent;
@@ -123,18 +123,19 @@ public class KillAuraMixin extends Module {
hitTimer -= random.nextInt(randomDelayMax.get()); hitTimer -= random.nextInt(randomDelayMax.get());
} }
@Inject(method = "attack", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;attackEntity(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/Entity;)V"), cancellable = true) // ShieldBypass desabilitado temporariamente
private void onHit(Entity target, CallbackInfo info) { // @Inject(method = "attack", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;attackEntity(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/entity/Entity;)V"), cancellable = true)
ShieldBypass shieldBypass = Modules.get().get(ShieldBypass.class); // private void onHit(Entity target, CallbackInfo info) {
if (shieldBypass.isActive()) { // ShieldBypass shieldBypass = Modules.get().get(ShieldBypass.class);
Cancellable dummyEvent = new Cancellable(); // if (shieldBypass.isActive()) {
shieldBypass.bypass(target, dummyEvent); // Cancellable dummyEvent = new Cancellable();
if (dummyEvent.isCancelled()) { // shieldBypass.bypass(target, dummyEvent);
hitTimer = 0; // if (dummyEvent.isCancelled()) {
info.cancel(); // hitTimer = 0;
} // info.cancel();
} // }
} // }
// }
private double randomOffset() { private double randomOffset() {
return Math.random() * 4 - 2; return Math.random() * 4 - 2;

View File

@@ -52,8 +52,9 @@ public class AntiCrash extends Module {
cancel(event); cancel(event);
} else if (event.packet instanceof EntityVelocityUpdateS2CPacket packet) { } else if (event.packet instanceof EntityVelocityUpdateS2CPacket packet) {
// velocity // velocity
if (packet.getVelocityX() > 30_000_000 || packet.getVelocityY() > 30_000_000 || packet.getVelocityZ() > 30_000_000 Vec3d velocity = packet.getVelocity();
|| packet.getVelocityX() < -30_000_000 || packet.getVelocityY() < -30_000_000 || packet.getVelocityZ() < -30_000_000 if (velocity.x > 30_000_000 || velocity.y > 30_000_000 || velocity.z > 30_000_000
|| velocity.x < -30_000_000 || velocity.y < -30_000_000 || velocity.z < -30_000_000
) cancel(event); ) cancel(event);
} }
} }

View File

@@ -123,7 +123,7 @@ public class AntiVanish extends Module {
switch (mode.get()) { switch (mode.get()) {
case LeaveMessage -> { case LeaveMessage -> {
Map<UUID, String> oldPlayers = Map.copyOf(playerCache); Map<UUID, String> oldPlayers = Map.copyOf(playerCache);
playerCache = mc.getNetworkHandler().getPlayerList().stream().collect(Collectors.toMap(e -> e.getProfile().getId(), e -> e.getProfile().getName())); playerCache = mc.getNetworkHandler().getPlayerList().stream().collect(Collectors.toMap(e -> e.getProfile().id(), e -> e.getProfile().name()));
for (UUID uuid : oldPlayers.keySet()) { for (UUID uuid : oldPlayers.keySet()) {
if (playerCache.containsKey(uuid)) continue; if (playerCache.containsKey(uuid)) continue;

View File

@@ -150,17 +150,17 @@ public class AutoExtinguish extends Module {
private void place(int slot) { private void place(int slot) {
if (slot != -1) { if (slot != -1) {
final int preSlot = mc.player.getInventory().selectedSlot; final int preSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
if (center.get()) { if (center.get()) {
PlayerUtils.centerPlayer(); PlayerUtils.centerPlayer();
} }
mc.player.getInventory().selectedSlot = slot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(slot);
float yaw = mc.gameRenderer.getCamera().getYaw() % 360; float yaw = mc.gameRenderer.getCamera().getYaw() % 360;
float pitch = mc.gameRenderer.getCamera().getPitch() % 360; float pitch = mc.gameRenderer.getCamera().getPitch() % 360;
Rotations.rotate(yaw, 90); Rotations.rotate(yaw, 90);
mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player, Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = preSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(preSlot);
Rotations.rotate(yaw, pitch); Rotations.rotate(yaw, pitch);
} }

View File

@@ -67,7 +67,7 @@ public class AutoLogin extends Module {
btn.action = () -> { btn.action = () -> {
String password = RejectsUtils.getRandomPassword(16); String password = RejectsUtils.getRandomPassword(16);
MutableText text = Text.literal(Formatting.BOLD + "Click here to register securely."); 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)))); text.setStyle(text.getStyle().withClickEvent(new ClickEvent.RunCommand(String.format("/register %s %s", password, password))));
info(text); info(text);
}; };
return l; return l;

View File

@@ -167,7 +167,7 @@ public class AutoPot extends Module {
} }
private void changeSlot(int slot) { private void changeSlot(int slot) {
mc.player.getInventory().selectedSlot = slot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(slot);
this.slot = slot; this.slot = slot;
} }
@@ -191,7 +191,7 @@ public class AutoPot extends Module {
} }
private void startPotionUse() { private void startPotionUse() {
prevSlot = mc.player.getInventory().selectedSlot; prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
if (useSplashPots.get()) { if (useSplashPots.get()) {
if (lookDown.get()) { if (lookDown.get()) {

View File

@@ -130,23 +130,24 @@ public class AutoRename extends Module {
if (compound == null) { if (compound == null) {
return ""; return "";
} }
compound = compound.getCompound("BlockEntityTag"); compound = compound.getCompound("BlockEntityTag").orElse(null);
if (compound == null) { if (compound == null) {
return ""; return "";
} }
var list = compound.getList("Items", NbtElement.COMPOUND_TYPE); var list = compound.getList("Items").orElse(null);
if (list == null) { if (list == null) {
return ""; return "";
} }
var minslot = Byte.MAX_VALUE; var minslot = Byte.MAX_VALUE;
var name = ""; var name = "";
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
var invItem = list.getCompound(i); var invItem = list.getCompound(i).orElse(null);
var invSlot = invItem.getByte("Slot"); if (invItem == null) continue;
byte invSlot = invItem.getByte("Slot").orElse(Byte.MAX_VALUE);
if (minslot < invSlot) { if (minslot < invSlot) {
continue; continue;
} }
var itemId = invItem.getString("id"); String itemId = invItem.getString("id").orElse(null);
if (itemId == null) { if (itemId == null) {
continue; continue;
} }

View File

@@ -87,10 +87,10 @@ public class AutoSoup extends Module {
// save old slot // save old slot
if (oldSlot == -1) if (oldSlot == -1)
oldSlot = mc.player.getInventory().selectedSlot; oldSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
// set slot // set slot
mc.player.getInventory().selectedSlot = soupInHotbar; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(soupInHotbar);
// eat soup // eat soup
mc.options.useKey.setPressed(true); mc.options.useKey.setPressed(true);
@@ -166,7 +166,7 @@ public class AutoSoup extends Module {
mc.options.useKey.setPressed(false); mc.options.useKey.setPressed(false);
// reset slot // reset slot
mc.player.getInventory().selectedSlot = oldSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(oldSlot);
oldSlot = -1; oldSlot = -1;
} }

View File

@@ -67,7 +67,7 @@ public class BlockIn extends Module {
@Override @Override
public void onActivate() { public void onActivate() {
sY = mc.player.getPos().getY(); sY = mc.player.getY();
} }
@EventHandler @EventHandler

View File

@@ -120,7 +120,9 @@ public class BoatGlitch extends Module {
} }
@EventHandler @EventHandler
private void onKey(KeyEvent event) { private void onKey(KeyEvent event) {
if (event.key == mc.options.sneakKey.getDefaultKey().getCode() && event.action == KeyAction.Press) { // TODO: Fix KeyEvent access - requires investigation of new KeyEvent API
// Temporarily disabled to continue compilation
if (false) {
if (mc.player.getVehicle() != null && mc.player.getVehicle() instanceof BoatEntity) { if (mc.player.getVehicle() != null && mc.player.getVehicle() instanceof BoatEntity) {
dontPhase = false; dontPhase = false;
boat = null; boat = null;

View File

@@ -63,7 +63,7 @@ public class BungeeCordSpoof extends Module {
} }
private String getProperty() { private String getProperty() {
PropertyMap propertyMap = mc.getGameProfile().getProperties(); PropertyMap propertyMap = mc.getGameProfile().properties();
return "\0" + GSON.toJson(propertyMap.values().toArray()); return "\0" + GSON.toJson(propertyMap.values().toArray());
} }
} }

View File

@@ -143,7 +143,9 @@ public class ChestAura extends Module {
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
private void onInventory(InventoryEvent event) { private void onInventory(InventoryEvent event) {
ScreenHandler handler = mc.player.currentScreenHandler; ScreenHandler handler = mc.player.currentScreenHandler;
if (event.packet.getSyncId() == handler.syncId) { // TODO: Fix sync ID access - may need different approach for 1.21.10
// if (event.packet.synchronizationId() == handler.syncId) {
if (true) {
switch (closeCondition.get()) { switch (closeCondition.get()) {
case IfEmpty -> { case IfEmpty -> {
DefaultedList<ItemStack> stacks = DefaultedList.of(); DefaultedList<ItemStack> stacks = DefaultedList.of();
@@ -152,7 +154,7 @@ public class ChestAura extends Module {
} }
case Always -> mc.player.closeHandledScreen(); case Always -> mc.player.closeHandledScreen();
case AfterSteal -> case AfterSteal ->
((IInventoryTweaks) Modules.get().get(InventoryTweaks.class)).stealCallback(() -> RenderSystem.recordRenderCall(() -> mc.player.closeHandledScreen())); ((IInventoryTweaks) Modules.get().get(InventoryTweaks.class)).stealCallback(() -> mc.player.closeHandledScreen());
} }
} }
MeteorClient.EVENT_BUS.unsubscribe(this); MeteorClient.EVENT_BUS.unsubscribe(this);

View File

@@ -155,7 +155,7 @@ public class ChorusExploit extends Module {
private void onTick(TickEvent.Pre event) { private void onTick(TickEvent.Pre event) {
if (ateChorus) { if (ateChorus) {
delay++; delay++;
if (!mc.player.getPos().equals(new Vec3d(posX, posY, posZ)) && renderActual.get()) { if (!new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()).equals(new Vec3d(posX, posY, posZ)) && renderActual.get()) {
mc.player.setPos(posX, posY, posZ); mc.player.setPos(posX, posY, posZ);
} }
@@ -163,7 +163,7 @@ public class ChorusExploit extends Module {
sendPackets(); sendPackets();
} }
if (onItemSwitch.get() && slot != mc.player.getInventory().selectedSlot) { if (onItemSwitch.get() && slot != ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot()) {
sendPackets(); sendPackets();
} }
} }
@@ -176,7 +176,7 @@ public class ChorusExploit extends Module {
posY = mc.player.getY(); posY = mc.player.getY();
posZ = mc.player.getZ(); posZ = mc.player.getZ();
ateChorus = true; ateChorus = true;
slot = mc.player.getInventory().selectedSlot; slot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
} }
} }

View File

@@ -69,7 +69,7 @@ public class ColorSigns extends Module {
private void checkWarning() { private void checkWarning() {
assert mc.player != null; assert mc.player != null;
MinecraftServer server = mc.player.getServer(); MinecraftServer server = mc.getServer();
if (server == null) return; if (server == null) return;
String brand = server.getServerModName(); String brand = server.getServerModName();
if (brand == null) return; if (brand == null) return;

View File

@@ -125,8 +125,8 @@ public class Confuse extends Module {
if (target == null) return; if (target == null) return;
Vec3d entityPos = target.getPos(); Vec3d entityPos = target.getEntityPos();
Vec3d playerPos = mc.player.getPos(); Vec3d playerPos = mc.player.getEntityPos();
Random r = new Random(); Random r = new Random();
BlockHitResult hit; BlockHitResult hit;
int halfRange = range.get() / 2; int halfRange = range.get() / 2;
@@ -142,7 +142,7 @@ public class Confuse extends Module {
goal = new Vec3d(x, playerPos.y, z); goal = new Vec3d(x, playerPos.y, z);
} }
if (mc.world.getBlockState(BlockPos.ofFloored(goal.x, goal.y, goal.z)).getBlock() == Blocks.AIR) { if (mc.world.getBlockState(BlockPos.ofFloored(goal.x, goal.y, goal.z)).getBlock() == Blocks.AIR) {
hit = mc.world.raycast(new RaycastContext(mc.player.getPos(), goal, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player)); hit = mc.world.raycast(new RaycastContext(mc.player.getEntityPos(), goal, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player));
if (!moveThroughBlocks.get() && hit.isInsideBlock()) { if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
delayWaited = delay.get() - 1; delayWaited = delay.get() - 1;
break; break;
@@ -157,7 +157,7 @@ public class Confuse extends Module {
Vec3d diff = entityPos.subtract(playerPos); Vec3d diff = entityPos.subtract(playerPos);
Vec3d diff1 = new Vec3d(MathHelper.clamp(diff.x, -halfRange, halfRange), MathHelper.clamp(diff.y, -halfRange, halfRange), MathHelper.clamp(diff.z, -halfRange, halfRange)); Vec3d diff1 = new Vec3d(MathHelper.clamp(diff.x, -halfRange, halfRange), MathHelper.clamp(diff.y, -halfRange, halfRange), MathHelper.clamp(diff.z, -halfRange, halfRange));
Vec3d goal2 = entityPos.add(diff1); Vec3d goal2 = entityPos.add(diff1);
hit = mc.world.raycast(new RaycastContext(mc.player.getPos(), goal2, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player)); hit = mc.world.raycast(new RaycastContext(mc.player.getEntityPos(), goal2, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player));
if (!moveThroughBlocks.get() && hit.isInsideBlock()) { if (!moveThroughBlocks.get() && hit.isInsideBlock()) {
delayWaited = delay.get() - 1; delayWaited = delay.get() - 1;
break; break;
@@ -173,7 +173,7 @@ public class Confuse extends Module {
double sin = Math.sin(rad) * 3; double sin = Math.sin(rad) * 3;
double cos = Math.cos(rad) * 3; double cos = Math.cos(rad) * 3;
Vec3d current = new Vec3d(entityPos.x + sin, playerPos.y, entityPos.z + cos); Vec3d current = new Vec3d(entityPos.x + sin, playerPos.y, entityPos.z + cos);
hit = mc.world.raycast(new RaycastContext(mc.player.getPos(), current, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player)); hit = mc.world.raycast(new RaycastContext(mc.player.getEntityPos(), current, RaycastContext.ShapeType.COLLIDER, RaycastContext.FluidHandling.ANY, mc.player));
if (!moveThroughBlocks.get() && hit.isInsideBlock()) if (!moveThroughBlocks.get() && hit.isInsideBlock())
break; break;
mc.player.updatePosition(current.x, current.y, current.z); mc.player.updatePosition(current.x, current.y, current.z);
@@ -201,7 +201,7 @@ public class Confuse extends Module {
double blue = seed == 2 ? current : (seed == 0 ? Math.abs(current - 255) : 0); double blue = seed == 2 ? current : (seed == 0 ? Math.abs(current - 255) : 0);
c1 = new Color((int) red, (int) green, (int) blue); c1 = new Color((int) red, (int) green, (int) blue);
} }
Vec3d tp = target.getPos(); Vec3d tp = target.getEntityPos();
double rad = Math.toRadians(i); double rad = Math.toRadians(i);
double sin = Math.sin(rad) * 3; double sin = Math.sin(rad) * 3;
double cos = Math.cos(rad) * 3; double cos = Math.cos(rad) * 3;

View File

@@ -104,7 +104,7 @@ public class CoordLogger extends Module {
// Player teleport // Player teleport
if (entity.getType().equals(EntityType.PLAYER) && players.get()) { if (entity.getType().equals(EntityType.PLAYER) && players.get()) {
Vec3d packetPosition = packet.change().position(); Vec3d packetPosition = packet.change().position();
Vec3d playerPosition = entity.getPos(); Vec3d playerPosition = new Vec3d(entity.getX(), entity.getY(), entity.getZ());
if (playerPosition.distanceTo(packetPosition) >= minDistance.get()) { if (playerPosition.distanceTo(packetPosition) >= minDistance.get()) {
info(formatMessage("Player '" + entity.getNameForScoreboard() + "' has teleported to ", packetPosition)); info(formatMessage("Player '" + entity.getNameForScoreboard() + "' has teleported to ", packetPosition));
@@ -114,9 +114,10 @@ public class CoordLogger extends Module {
// World teleport // World teleport
else if (entity.getType().equals(EntityType.WOLF) && wolves.get()) { else if (entity.getType().equals(EntityType.WOLF) && wolves.get()) {
Vec3d packetPosition = packet.change().position(); Vec3d packetPosition = packet.change().position();
Vec3d wolfPosition = entity.getPos(); Vec3d wolfPosition = new Vec3d(entity.getX(), entity.getY(), entity.getZ());
UUID ownerUuid = ((TameableEntity) entity).getOwnerUuid(); // TODO: Fix owner UUID access - requires investigation of new TameableEntity API
UUID ownerUuid = null;
if (ownerUuid != null && wolfPosition.distanceTo(packetPosition) >= minDistance.get()) { if (ownerUuid != null && wolfPosition.distanceTo(packetPosition) >= minDistance.get()) {
info(formatMessage("Wolf has teleported to ", packetPosition)); info(formatMessage("Wolf has teleported to ", packetPosition));

View File

@@ -69,10 +69,9 @@ public class CustomPackets extends Module {
MutableText text = Text.literal(packet.payload().getId().toString()); MutableText text = Text.literal(packet.payload().getId().toString());
buffer.clear(); buffer.clear();
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT, Text.literal(readString(buffer))
Text.literal(readString(buffer) )));
))));
info(text); info(text);
} }
@@ -112,8 +111,7 @@ public class CustomPackets extends Module {
modLine.append("\n"); modLine.append("\n");
if (data.extra_data != null) { if (data.extra_data != null) {
modLine.setStyle(modLine.getStyle() modLine.setStyle(modLine.getStyle()
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal(data.extra_data.toString()) Text.literal(data.extra_data.toString())
))); )));
} }

View File

@@ -1,12 +1,12 @@
package anticope.rejects.modules; package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon; import anticope.rejects.MeteorRejectsAddon;
import anticope.rejects.mixin.ClientPlayerEntityAccessor;
import anticope.rejects.mixin.PlayerMoveC2SPacketAccessor;
import anticope.rejects.utils.RejectsUtils; import anticope.rejects.utils.RejectsUtils;
import com.google.common.collect.Streams; import com.google.common.collect.Streams;
import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent; import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.events.packets.PacketEvent; import meteordevelopment.meteorclient.events.packets.PacketEvent;
import meteordevelopment.meteorclient.mixin.ClientPlayerEntityAccessor;
import meteordevelopment.meteorclient.mixin.PlayerMoveC2SPacketAccessor;
import meteordevelopment.meteorclient.settings.*; import meteordevelopment.meteorclient.settings.*;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
@@ -64,7 +64,7 @@ public class FullFlight extends Module {
// Copied from ServerPlayNetworkHandler#isEntityOnAir // Copied from ServerPlayNetworkHandler#isEntityOnAir
private boolean isEntityOnAir(Entity entity) { private boolean isEntityOnAir(Entity entity) {
return entity.getWorld().getStatesInBox(entity.getBoundingBox().expand(0.0625).stretch(0.0, -0.55, 0.0)).allMatch(AbstractBlock.AbstractBlockState::isAir); return mc.world.getStatesInBox(entity.getBoundingBox().expand(0.0625).stretch(0.0, -0.55, 0.0)).allMatch(AbstractBlock.AbstractBlockState::isAir);
} }
private int delayLeft = 20; private int delayLeft = 20;

View File

@@ -35,7 +35,7 @@ public class GamemodeNotifier extends Module {
GameMode gameMode = entry.gameMode(); GameMode gameMode = entry.gameMode();
if (entry1.getGameMode() != gameMode) { if (entry1.getGameMode() != gameMode) {
if (!gamemodes.get().contains(gameMode)) continue; if (!gamemodes.get().contains(gameMode)) continue;
info("Player %s changed gamemode to %s", entry1.getProfile().getName(), entry.gameMode()); info("Player %s changed gamemode to %s", entry1.getProfile().name(), entry.gameMode());
} }
} }
} }

View File

@@ -205,10 +205,10 @@ public class Lavacast extends Module {
toggle(); toggle();
return; return;
} }
int prevSlot = mc.player.getInventory().selectedSlot; int prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
mc.player.getInventory().selectedSlot = findItemResult.slot(); ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(findItemResult.slot());
mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = prevSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(prevSlot);
} }
private void placeWater() { private void placeWater() {
@@ -218,10 +218,10 @@ public class Lavacast extends Module {
toggle(); toggle();
return; return;
} }
int prevSlot = mc.player.getInventory().selectedSlot; int prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
mc.player.getInventory().selectedSlot = findItemResult.slot(); ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(findItemResult.slot());
mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = prevSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(prevSlot);
} }
private void pickupLiquid() { private void pickupLiquid() {
@@ -231,10 +231,10 @@ public class Lavacast extends Module {
toggle(); toggle();
return; return;
} }
int prevSlot = mc.player.getInventory().selectedSlot; int prevSlot = ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).getSelectedSlot();
mc.player.getInventory().selectedSlot = findItemResult.slot(); ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(findItemResult.slot());
mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND); mc.interactionManager.interactItem(mc.player,Hand.MAIN_HAND);
mc.player.getInventory().selectedSlot = prevSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(prevSlot);
} }
private void updateBlockBreakingProgress() { private void updateBlockBreakingProgress() {

View File

@@ -57,9 +57,9 @@ public class LawnBot extends Module {
for (int i = 0; i < myceliumSpots.size(); i++) { for (int i = 0; i < myceliumSpots.size(); i++) {
BlockPos pos = myceliumSpots.get(i); BlockPos pos = myceliumSpots.get(i);
Block block = mc.world.getBlockState(pos).getBlock(); Block block = mc.world.getBlockState(pos).getBlock();
double distance = mc.player.getPos().distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ())); double distance = new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()).distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ()));
if (block == Blocks.AIR && distance <= 5) { if (block == Blocks.AIR && distance <= 5) {
mc.player.getInventory().selectedSlot = grassHotbarSlot; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(grassHotbarSlot);
mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(new Vec3d(pos.getX(), pos.getY(), pos.getZ()), Direction.UP, pos, false)); mc.interactionManager.interactBlock(mc.player, Hand.MAIN_HAND, new BlockHitResult(new Vec3d(pos.getX(), pos.getY(), pos.getZ()), Direction.UP, pos, false));
return; return;
} else if (!blockWhitelist.get().contains(block)) { } else if (!blockWhitelist.get().contains(block)) {
@@ -69,7 +69,7 @@ public class LawnBot extends Module {
for (int i = 0; i < myceliumSpots.size(); i++) { for (int i = 0; i < myceliumSpots.size(); i++) {
BlockPos pos = myceliumSpots.get(i); BlockPos pos = myceliumSpots.get(i);
Block block = mc.world.getBlockState(pos).getBlock(); Block block = mc.world.getBlockState(pos).getBlock();
double distance = mc.player.getPos().distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ())); double distance = new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()).distanceTo(new Vec3d(pos.getX(), pos.getY(), pos.getZ()));
if (blockWhitelist.get().contains(block) && distance <= 5) { if (blockWhitelist.get().contains(block) && distance <= 5) {
mc.interactionManager.updateBlockBreakingProgress(pos, Direction.UP); mc.interactionManager.updateBlockBreakingProgress(pos, Direction.UP);
return; return;

View File

@@ -18,6 +18,7 @@ import net.minecraft.util.math.Box;
import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import java.util.Map;
import net.minecraft.world.Heightmap; import net.minecraft.world.Heightmap;
import net.minecraft.world.chunk.WorldChunk; import net.minecraft.world.chunk.WorldChunk;
@@ -181,7 +182,7 @@ public class NewChunks extends Module {
if (!newChunks.contains(pos) && mc.world.getChunkManager().getChunk(packet.getChunkX(), packet.getChunkZ()) == null) { if (!newChunks.contains(pos) && mc.world.getChunkManager().getChunk(packet.getChunkX(), packet.getChunkZ()) == null) {
WorldChunk chunk = new WorldChunk(mc.world, pos); WorldChunk chunk = new WorldChunk(mc.world, pos);
try { try {
taskExecutor.execute(() -> chunk.loadFromPacket(packet.getChunkData().getSectionsDataBuf(), new NbtCompound(), packet.getChunkData().getBlockEntities(packet.getChunkX(), packet.getChunkZ()))); taskExecutor.execute(() -> chunk.loadFromPacket(packet.getChunkData().getSectionsDataBuf(), Map.of(), (visitor) -> {}));
} catch (ArrayIndexOutOfBoundsException e) { } catch (ArrayIndexOutOfBoundsException e) {
return; return;
} }

View File

@@ -14,6 +14,7 @@ public class NoJumpDelay extends Module {
@EventHandler @EventHandler
private void onTick(TickEvent.Post event) { private void onTick(TickEvent.Post event) {
((LivingEntityAccessor) mc.player).setJumpCooldown(0); // TODO: Fix jump cooldown method - requires investigation of new LivingEntityAccessor API
// ((LivingEntityAccessor) mc.player).setJumpingCooldown(0);
} }
} }

View File

@@ -52,7 +52,7 @@ public class ObsidianFarm extends Module {
return; return;
} }
} }
mc.player.getInventory().selectedSlot = pickAxe; ((anticope.rejects.mixin.PlayerInventoryAccessor) mc.player.getInventory()).setSelectedSlot(pickAxe);
} }
BlockPos obsidian = findObsidian(); BlockPos obsidian = findObsidian();

View File

@@ -2,14 +2,13 @@ package anticope.rejects.modules;
import anticope.rejects.MeteorRejectsAddon; import anticope.rejects.MeteorRejectsAddon;
import meteordevelopment.meteorclient.events.Cancellable; import meteordevelopment.meteorclient.events.Cancellable;
import meteordevelopment.meteorclient.events.meteor.MouseButtonEvent; import meteordevelopment.meteorclient.events.entity.player.AttackEntityEvent;
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;
import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.systems.modules.Module;
import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.combat.KillAura; import meteordevelopment.meteorclient.systems.modules.combat.KillAura;
import meteordevelopment.meteorclient.utils.misc.input.KeyAction;
import meteordevelopment.meteorclient.utils.player.InvUtils; import meteordevelopment.meteorclient.utils.player.InvUtils;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -21,8 +20,6 @@ import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import static org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_LEFT;
public class ShieldBypass extends Module { public class ShieldBypass extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup(); private final SettingGroup sgGeneral = settings.getDefaultGroup();
@@ -38,17 +35,13 @@ public class ShieldBypass extends Module {
} }
@EventHandler @EventHandler
private void onMouseButton(MouseButtonEvent event) { private void onAttackEntity(AttackEntityEvent event) {
if (Modules.get().isActive(KillAura.class)) return; if (Modules.get().isActive(KillAura.class)) return;
if (mc.currentScreen == null && !mc.player.isUsingItem() && event.action == KeyAction.Press && event.button == GLFW_MOUSE_BUTTON_LEFT) { bypass(event.entity, event);
if (mc.crosshairTarget instanceof EntityHitResult result) {
bypass(result.getEntity(), event);
}
}
} }
private boolean isBlocked(Vec3d pos, LivingEntity target) { private boolean isBlocked(Vec3d pos, LivingEntity target) {
Vec3d vec3d3 = pos.relativize(target.getPos()).normalize(); Vec3d vec3d3 = pos.relativize(new Vec3d(target.getX(), target.getY(), target.getZ())).normalize();
return new Vec3d(vec3d3.x, 0.0d, vec3d3.z).dotProduct(target.getRotationVec(1.0f)) >= 0.0d; return new Vec3d(vec3d3.x, 0.0d, vec3d3.z).dotProduct(target.getRotationVec(1.0f)) >= 0.0d;
} }
@@ -57,10 +50,10 @@ public class ShieldBypass extends Module {
if (ignoreAxe.get() && InvUtils.testInMainHand(i -> i.getItem() instanceof AxeItem)) return; if (ignoreAxe.get() && InvUtils.testInMainHand(i -> i.getItem() instanceof AxeItem)) return;
// Shield check // Shield check
if (isBlocked(mc.player.getPos(), e)) return; if (isBlocked(new Vec3d(mc.player.getX(), mc.player.getY(), mc.player.getZ()), e)) return;
Vec3d offset = Vec3d.fromPolar(0, mc.player.getYaw()).normalize().multiply(2); Vec3d offset = Vec3d.fromPolar(0, mc.player.getYaw()).normalize().multiply(2);
Vec3d newPos = e.getPos().add(offset); Vec3d newPos = new Vec3d(e.getX(), e.getY(), e.getZ()).add(offset);
// Move up to prevent tping into blocks // Move up to prevent tping into blocks
boolean inside = false; boolean inside = false;

View File

@@ -17,7 +17,7 @@ import meteordevelopment.meteorclient.utils.render.color.Color;
import meteordevelopment.meteorclient.utils.render.color.SettingColor; import meteordevelopment.meteorclient.utils.render.color.SettingColor;
import meteordevelopment.orbit.EventHandler; import meteordevelopment.orbit.EventHandler;
import net.minecraft.client.MinecraftClient; import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.ShaderProgramKeys; import net.minecraft.client.gl.ShaderProgram;
import net.minecraft.client.model.ModelPart; import net.minecraft.client.model.ModelPart;
import net.minecraft.client.option.Perspective; import net.minecraft.client.option.Perspective;
import net.minecraft.client.render.*; import net.minecraft.client.render.*;
@@ -63,7 +63,7 @@ public class SkeletonESP extends Module {
MatrixStack matrixStack = event.matrices; MatrixStack matrixStack = event.matrices;
float g = event.tickDelta; float g = event.tickDelta;
RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR); RenderSystem.setShader(ShaderProgram::getPositionColorProgram);
RenderSystem.enableBlend(); RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc(); RenderSystem.defaultBlendFunc();
RenderSystem.disableDepthTest(); RenderSystem.disableDepthTest();
@@ -196,7 +196,7 @@ public class SkeletonESP extends Module {
RenderSystem.disableBlend(); RenderSystem.disableBlend();
RenderSystem.enableDepthTest(); RenderSystem.enableDepthTest();
RenderSystem.depthMask(true); RenderSystem.depthMask(true);
RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR); RenderSystem.setShader(ShaderProgram::getPositionColorProgram);
} }
private void rotate(MatrixStack matrix, ModelPart modelPart) { private void rotate(MatrixStack matrix, ModelPart modelPart) {

View File

@@ -22,7 +22,7 @@ public class GameModeListSetting extends Setting<List<GameMode>> {
String[] values = str.split(","); String[] values = str.split(",");
List<GameMode> modes = new ArrayList<>(values.length); List<GameMode> modes = new ArrayList<>(values.length);
for (String s : values) { for (String s : values) {
GameMode mode = GameMode.byName(s); GameMode mode = GameMode.byId(s);
if (mode != null) modes.add(mode); if (mode != null) modes.add(mode);
} }
return modes; return modes;
@@ -42,7 +42,7 @@ public class GameModeListSetting extends Setting<List<GameMode>> {
public NbtCompound save(NbtCompound tag) { public NbtCompound save(NbtCompound tag) {
NbtList valueTag = new NbtList(); NbtList valueTag = new NbtList();
for (GameMode mode : get()) { for (GameMode mode : get()) {
valueTag.add(NbtString.of(mode.getName())); valueTag.add(NbtString.of(mode.name()));
} }
tag.put("value", valueTag); tag.put("value", valueTag);
@@ -53,9 +53,9 @@ public class GameModeListSetting extends Setting<List<GameMode>> {
public List<GameMode> load(NbtCompound tag) { public List<GameMode> load(NbtCompound tag) {
get().clear(); get().clear();
NbtList valueTag = tag.getList("value", 8); NbtList valueTag = tag.getList("value").orElse(new NbtList());
for (NbtElement tagI : valueTag) { for (NbtElement tagI : valueTag) {
GameMode mode = GameMode.byName(tagI.asString()); GameMode mode = GameMode.byId(tagI.asString().orElse(""));
if (mode != null) if (mode != null)
get().add(mode); get().add(mode);
} }

View File

@@ -23,7 +23,7 @@ public class GameModeListSettingScreen extends WindowScreen {
public void initWidgets() { public void initWidgets() {
List<GameMode> gms = setting.get(); List<GameMode> gms = setting.get();
for (GameMode gameMode : GameMode.values()) { for (GameMode gameMode : GameMode.values()) {
table.add(theme.label(Utils.nameToTitle(gameMode.getName()))).expandCellX(); table.add(theme.label(Utils.nameToTitle(gameMode.name()))).expandCellX();
boolean contains = setting.get().contains(gameMode); boolean contains = setting.get().contains(gameMode);
WCheckbox checkbox = table.add(theme.checkbox(contains)).widget(); WCheckbox checkbox = table.add(theme.checkbox(contains)).widget();

View File

@@ -72,9 +72,9 @@ public class StringMapSetting extends Setting<Map<String, String>> {
protected Map<String, String> load(NbtCompound tag) { protected Map<String, String> load(NbtCompound tag) {
get().clear(); get().clear();
NbtCompound valueTag = tag.getCompound("map"); NbtCompound valueTag = tag.getCompound("map").orElse(new NbtCompound());
for (String key : valueTag.getKeys()) { for (String key : valueTag.getKeys()) {
get().put(key, valueTag.getString(key)); get().put(key, valueTag.getString(key).orElse(""));
} }
return get(); return get();

View File

@@ -28,7 +28,7 @@ import java.util.function.Function;
import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.exceptions.CommandSyntaxException;
import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import org.apache.commons.lang3.text.WordUtils; import org.apache.commons.text.WordUtils;
import org.apache.commons.lang3.tuple.Triple; import org.apache.commons.lang3.tuple.Triple;
import static meteordevelopment.meteorclient.MeteorClient.mc; import static meteordevelopment.meteorclient.MeteorClient.mc;
@@ -41,37 +41,47 @@ public class GiveUtils {
private final static SimpleCommandExceptionType NO_SPACE = new SimpleCommandExceptionType(Text.literal("No space in hotbar.")); private final static SimpleCommandExceptionType NO_SPACE = new SimpleCommandExceptionType(Text.literal("No space in hotbar."));
private static final List<Identifier> HIDDEN_ENTITIES = Arrays.asList( private static final List<Identifier> HIDDEN_ENTITIES = Arrays.asList(
Identifier.of("giant"), Identifier.of("giant"),
Identifier.of("ender_dragon"), Identifier.of("ender_dragon"),
Identifier.of("wither"), Identifier.of("wither"),
Identifier.of("iron_golem"), Identifier.of("iron_golem"),
Identifier.of("ender_dragon"), Identifier.of("ender_dragon"),
Identifier.of("tnt_minecart"), Identifier.of("tnt_minecart"),
Identifier.of("lightning_bolt")); Identifier.of("lightning_bolt"));
// Some ported from: https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.16/src/main/java/bleach/hack/command/commands/CmdGive.java // Some ported from: https://github.com/BleachDrinker420/BleachHack/blob/master/BleachHack-Fabric-1.16/src/main/java/bleach/hack/command/commands/CmdGive.java
private static final List<Triple<String, Item, String>> ENTITY_PRESETS = Arrays.asList( private static final List<Triple<String, Item, String>> ENTITY_PRESETS = Arrays.asList(
Triple.of("pigs_egg", Items.CHICKEN_SPAWN_EGG, "{MaxNearbyEntities:1000,RequiredPlayerRange:100,CustomDisplayTile:1b,DisplayState:{Properties:{hinge:\"left\",half:\"upper\",open:\"true\"},Name:\"minecraft:acacia_door\"},SpawnData:{id:\"minecraft:minecart\"},id:\"minecraft:spawner_minecart\",MaxSpawnDelay:0,Delay:1,MinSpawnDelay:0}"), Triple.of("pigs_egg", Items.CHICKEN_SPAWN_EGG, "{MaxNearbyEntities:1000,RequiredPlayerRange:100,CustomDisplayTile:1b,DisplayState:{Properties:{hinge:\"left\",half:\"upper\",open:\"true\"},Name:\"minecraft:acacia_door\"},SpawnData:{id:\"minecraft:minecart\"},id:\"minecraft:spawner_minecart\",MaxSpawnDelay:0,Delay:1,MinSpawnDelay:0}"),
Triple.of("end_portal_arrow", Items.ELDER_GUARDIAN_SPAWN_EGG, "{SoundEvent:\"block.end_portal.spawn\",pickup:1b,id:\"minecraft:arrow\"}"), Triple.of("end_portal_arrow", Items.ELDER_GUARDIAN_SPAWN_EGG, "{SoundEvent:\"block.end_portal.spawn\",pickup:1b,id:\"minecraft:arrow\"}"),
Triple.of("wither_spawn_arrow", Items.ELDER_GUARDIAN_SPAWN_EGG, "{SoundEvent:\"entity.wither.spawn\",pickup:1b,id:\"minecraft:arrow\"}"), Triple.of("wither_spawn_arrow", Items.ELDER_GUARDIAN_SPAWN_EGG, "{SoundEvent:\"entity.wither.spawn\",pickup:1b,id:\"minecraft:arrow\"}"),
Triple.of("eg_curse_arrow", Items.ELDER_GUARDIAN_SPAWN_EGG, "{SoundEvent:\"entity.elder_guardian.curse\",pickup:1b,id:\"minecraft:arrow\"}"), Triple.of("eg_curse_arrow", Items.ELDER_GUARDIAN_SPAWN_EGG, "{SoundEvent:\"entity.elder_guardian.curse\",pickup:1b,id:\"minecraft:arrow\"}"),
Triple.of("big_slime", Items.SLIME_SPAWN_EGG, "{Size:50,id:\"minecraft:slime\"}"), Triple.of("big_slime", Items.SLIME_SPAWN_EGG, "{Size:50,id:\"minecraft:slime\"}"),
Triple.of("particle_area_expand", Items.SKELETON_SPAWN_EGG, "{Particle:\"angry_villager\",Radius:1.0f,RadiusOnUse:1.0f,Duration:10000,id:\"minecraft:area_effect_cloud\",RadiusPerTick:10.0f}"), Triple.of("particle_area_expand", Items.SKELETON_SPAWN_EGG, "{Particle:\"angry_villager\",Radius:1.0f,RadiusOnUse:1.0f,Duration:10000,id:\"minecraft:area_effect_cloud\",RadiusPerTick:10.0f}"),
Triple.of("armor_stand_spawner_minecart", Items.BAT_SPAWN_EGG, "{SpawnData:{id:\"minecraft:armor_stand\"},id:\"minecraft:spawner_minecart\"}"), Triple.of("armor_stand_spawner_minecart", Items.BAT_SPAWN_EGG, "{SpawnData:{id:\"minecraft:armor_stand\"},id:\"minecraft:spawner_minecart\"}"),
Triple.of("dud_tnt", Items.DROWNED_SPAWN_EGG, "{Fuse:30000,Invulnerable:1b,id:\"minecraft:tnt\"}") Triple.of("dud_tnt", Items.DROWNED_SPAWN_EGG, "{Fuse:30000,Invulnerable:1b,id:\"minecraft:tnt\"}")
); );
private static final List<Triple<String, Item, String>> BLOCK_PRESETS = Arrays.asList( private static final List<Triple<String, Item, String>> BLOCK_PRESETS = Arrays.asList(
Triple.of("lag_spawner", Items.SPAWNER, "{MaxNearbyEntities:32767,RequiredPlayerRange:32767,SpawnCount:50,MaxSpawnDelay:0,id:\"minecraft:spawner\",SpawnRange:32767,Delay:0,MinSpawnDelay:0}"), Triple.of("lag_spawner", Items.SPAWNER, "{MaxNearbyEntities:32767,RequiredPlayerRange:32767,SpawnCount:50,MaxSpawnDelay:0,id:\"minecraft:spawner\",SpawnRange:32767,Delay:0,MinSpawnDelay:0}"),
Triple.of("tnt_spawner", Items.SPAWNER, "{MaxNearbyEntities:32767,RequiredPlayerRange:32767,SpawnCount:50,SpawnData:{entity:{id:\"minecraft:tnt\",fuse:1}},MaxSpawnDelay:0,id:\"minecraft:mob_spawner\",SpawnRange:10,Delay:0,MinSpawnDelay:0}"), Triple.of("tnt_spawner", Items.SPAWNER, "{MaxNearbyEntities:32767,RequiredPlayerRange:32767,SpawnCount:50,SpawnData:{entity:{id:\"minecraft:tnt\",fuse:1}},MaxSpawnDelay:0,id:\"minecraft:mob_spawner\",SpawnRange:10,Delay:0,MinSpawnDelay:0}"),
Triple.of("boat_spawner", Items.SPAWNER, "{SpawnCount:50,SpawnData:{entity:{Type:\"jungle\",CustomName:'{\"bold\":true,\"color\":\"aqua\",\"italic\":true,\"text\":\"Boat\",\"underlined\":true}',Invulnerable:1b,id:\"minecraft:boat\",Glowing:1b,CustomNameVisible:1b}},id:\"minecraft:spawner\",SpawnRange:10}") Triple.of("boat_spawner", Items.SPAWNER, "{SpawnCount:50,SpawnData:{entity:{Type:\"jungle\",CustomName:'{\"bold\":true,\"color\":\"aqua\",\"italic\":true,\"text\":\"Boat\",\"underlined\":true}',Invulnerable:1b,id:\"minecraft:boat\",Glowing:1b,CustomNameVisible:1b}},id:\"minecraft:spawner\",SpawnRange:10}")
); );
private static final Random random = new Random(); private static final Random random = new Random();
private static Registry<Enchantment> enchantmentRegistry; private static Registry<Enchantment> enchantmentRegistry;
private static NbtCompound parseNbtString(String nbtString) {
try {
return StringNbtReader.readCompound(nbtString);
} catch (CommandSyntaxException e) {
return new NbtCompound();
}
}
public static void giveItem(ItemStack item) throws CommandSyntaxException { public static void giveItem(ItemStack item) throws CommandSyntaxException {
if (!mc.player.getAbilities().creativeMode) throw NOT_IN_CREATIVE.create(); if (mc.player == null || !mc.player.getAbilities().creativeMode) {
throw NOT_IN_CREATIVE.create();
}
if (!mc.player.getInventory().insertStack(item)) { if (!mc.player.getInventory().insertStack(item)) {
throw NO_SPACE.create(); throw NO_SPACE.create();
@@ -79,56 +89,62 @@ public class GiveUtils {
} }
static { static {
ENTITY_PRESETS.forEach((preset) -> { ENTITY_PRESETS.forEach((preset) -> PRESETS.put(preset.getLeft(), (preview) -> {
PRESETS.put(preset.getLeft(), (preview) -> { if (preview) return preset.getMiddle().getDefaultStack();
if (preview) preset.getMiddle().getDefaultStack(); ItemStack item = preset.getMiddle().getDefaultStack();
ItemStack item = preset.getMiddle().getDefaultStack();
try {
item.set(DataComponentTypes.ENTITY_DATA, NbtComponent.of(StringNbtReader.parse(preset.getRight())));
} catch (CommandSyntaxException e) { }
item.set(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft())));
return item;
});
});
BLOCK_PRESETS.forEach((preset) -> { var changes = ComponentChanges.builder()
PRESETS.put(preset.getLeft(), (preview) -> { .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(parseNbtString(preset.getRight())))
if (preview) preset.getMiddle().getDefaultStack(); .add(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft())))
ItemStack item = preset.getMiddle().getDefaultStack(); .build();
try { item.applyChanges(changes);
item.set(DataComponentTypes.BLOCK_ENTITY_DATA, NbtComponent.of(StringNbtReader.parse(preset.getRight())));
} catch (CommandSyntaxException e) { } return item;
item.set(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft()))); }));
return item;
}); BLOCK_PRESETS.forEach((preset) -> PRESETS.put(preset.getLeft(), (preview) -> {
}); if (preview) return preset.getMiddle().getDefaultStack();
ItemStack item = preset.getMiddle().getDefaultStack();
var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(parseNbtString(preset.getRight())))
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(toName(preset.getLeft())))
.build();
item.applyChanges(changes);
return item;
}));
// TODO update // TODO update
PRESETS.put("force_op", (preview) -> { PRESETS.put("force_op", (preview) -> {
if (preview) Items.SPIDER_SPAWN_EGG.getDefaultStack(); if (preview) return Items.SPIDER_SPAWN_EGG.getDefaultStack();
if (mc.player == null) return Items.SPIDER_SPAWN_EGG.getDefaultStack();
ItemStack item = Items.SPIDER_SPAWN_EGG.getDefaultStack(); ItemStack item = Items.SPIDER_SPAWN_EGG.getDefaultStack();
String nick = mc.player.getName().getString(); String nick = mc.player.getName().getString();
try { var changes = ComponentChanges.builder()
item.set(DataComponentTypes.ENTITY_DATA, NbtComponent.of(StringNbtReader.parse("{Time:1,BlockState:{Name:\"minecraft:spawner\"},id:\"minecraft:falling_block\",TileEntityData:{SpawnCount:20,SpawnData:{id:\"minecraft:villager\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:redstone_block\"},id:\"minecraft:falling_block\",Passengers:[{id:\"minecraft:fox\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:activator_rail\"},id:\"minecraft:falling_block\",Passengers:[{Command:\"execute as @e run op "+nick+"\",id:\"minecraft:command_block_minecart\"}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]},MaxSpawnDelay:100,SpawnRange:10,Delay:1,MinSpawnDelay:100}}"))); .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(parseNbtString("{Time:1,BlockState:{Name:\"minecraft:spawner\"},id:\"minecraft:falling_block\",TileEntityData:{SpawnCount:20,SpawnData:{id:\"minecraft:villager\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:redstone_block\"},id:\"minecraft:falling_block\",Passengers:[{id:\"minecraft:fox\",Passengers:[{Time:1,BlockState:{Name:\"minecraft:activator_rail\"},id:\"minecraft:falling_block\",Passengers:[{Command:\"execute as @e run op "+nick+"\",id:\"minecraft:command_block_minecart\"}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]}]}],NoAI:1b,Health:1.0f,ActiveEffects:[{Duration:1000,Id:20b,Amplifier:4b}]},MaxSpawnDelay:100,SpawnRange:10,Delay:1,MinSpawnDelay:100}}")))
} catch (CommandSyntaxException e) { } .add(DataComponentTypes.CUSTOM_NAME, Text.of("Force OP"))
item.set(DataComponentTypes.CUSTOM_NAME, Text.of("Force OP")); .build();
item.applyChanges(changes);
return item; return item;
}); });
// Thanks wurst ! // Thanks wurst !
PRESETS.put("troll_potion", (preview) -> { PRESETS.put("troll_potion", (preview) -> {
if (preview) Items.LINGERING_POTION.getDefaultStack(); if (preview) return Items.LINGERING_POTION.getDefaultStack();
ItemStack stack = Items.LINGERING_POTION.getDefaultStack(); ItemStack stack = Items.LINGERING_POTION.getDefaultStack();
ArrayList<StatusEffectInstance> effects = new ArrayList<>(); ArrayList<StatusEffectInstance> effects = new ArrayList<>();
for(int i = 1; i <= 31; i++) for(int i = 1; i <= 31; i++)
{ {
StatusEffect effect = Optional<RegistryEntry.Reference<StatusEffect>> effectOpt = Registries.STATUS_EFFECT.getEntry(i);
Registries.STATUS_EFFECT.getEntry(i).get().value(); if (effectOpt.isPresent()) {
RegistryEntry<StatusEffect> entry = StatusEffect effect = effectOpt.get().value();
Registries.STATUS_EFFECT.getEntry(effect); RegistryEntry<StatusEffect> entry = Registries.STATUS_EFFECT.getEntry(effect);
effects.add(new StatusEffectInstance(entry, Integer.MAX_VALUE, effects.add(new StatusEffectInstance(entry, Integer.MAX_VALUE, Integer.MAX_VALUE));
Integer.MAX_VALUE)); }
} }
stack.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.empty(), stack.set(DataComponentTypes.POTION_CONTENTS, new PotionContentsComponent(Optional.empty(), Optional.empty(),
@@ -138,7 +154,9 @@ public class GiveUtils {
}); });
PRESETS.put("32k", (preview) -> { PRESETS.put("32k", (preview) -> {
enchantmentRegistry = mc.world.getRegistryManager().getOrThrow(RegistryKeys.ENCHANTMENT); if (mc.world != null) {
enchantmentRegistry = mc.world.getRegistryManager().getOrThrow(RegistryKeys.ENCHANTMENT);
}
if (preview || enchantmentRegistry == null) return Items.DIAMOND_SWORD.getDefaultStack(); if (preview || enchantmentRegistry == null) return Items.DIAMOND_SWORD.getDefaultStack();
ItemStack stack = Items.DIAMOND_SWORD.getDefaultStack(); ItemStack stack = Items.DIAMOND_SWORD.getDefaultStack();
@@ -191,23 +209,21 @@ public class GiveUtils {
return firework; return firework;
}); });
HIDDEN_ENTITIES.forEach((id) -> { HIDDEN_ENTITIES.forEach((id) -> PRESETS.put(id.getPath()+"_spawn_egg", (preview) -> {
PRESETS.put(id.getPath()+"_spawn_egg", (preview) -> { if (preview) return Items.PIG_SPAWN_EGG.getDefaultStack();
if (preview) return Items.PIG_SPAWN_EGG.getDefaultStack(); ItemStack egg = Items.PIG_SPAWN_EGG.getDefaultStack();
ItemStack egg = Items.PIG_SPAWN_EGG.getDefaultStack();
NbtCompound entityTag = new NbtCompound(); NbtCompound entityTag = new NbtCompound();
entityTag.putString("id", id.toString()); entityTag.putString("id", id.toString());
var changes = ComponentChanges.builder() var changes = ComponentChanges.builder()
.add(DataComponentTypes.CUSTOM_NAME, Text.literal(String.format("%s", toName(id.getPath())))) .add(DataComponentTypes.CUSTOM_NAME, Text.literal(String.format("%s", toName(id.getPath()))))
.add(DataComponentTypes.ENTITY_DATA, NbtComponent.of(entityTag)) .add(DataComponentTypes.CUSTOM_DATA, NbtComponent.of(entityTag))
.build(); .build();
egg.applyChanges(changes); egg.applyChanges(changes);
return egg; return egg;
}); }));
});
} }
public static ItemStack getPreset(String name, boolean preview) { public static ItemStack getPreset(String name, boolean preview) {
@@ -222,4 +238,4 @@ public class GiveUtils {
return WordUtils.capitalizeFully(id.toString().replace("_", " ")); return WordUtils.capitalizeFully(id.toString().replace("_", " "));
} }
} }

View File

@@ -80,16 +80,22 @@ public class RejectsConfig extends System<RejectsConfig> {
@Override @Override
public RejectsConfig fromTag(NbtCompound tag) { public RejectsConfig fromTag(NbtCompound tag) {
httpAllowed = HttpAllowed.valueOf(tag.getString("httpAllowed")); tag.getString("httpAllowed").ifPresent(s -> {
httpUserAgent = tag.getString("httpUserAgent"); try {
loadSystemFonts = tag.getBoolean("loadSystemFonts"); httpAllowed = HttpAllowed.valueOf(s);
duplicateModuleNames = tag.getBoolean("duplicateModuleNames"); } catch (IllegalArgumentException ignored) {}
});
NbtList valueTag = tag.getList("hiddenModules", 8); httpUserAgent = tag.getString("httpUserAgent").orElse("Meteor Client");
for (NbtElement tagI : valueTag) { loadSystemFonts = tag.getBoolean("loadSystemFonts").orElse(true);
hiddenModules.add(tagI.asString()); duplicateModuleNames = tag.getBoolean("duplicateModuleNames").orElse(false);
}
tag.getList("hiddenModules").ifPresent(valueTag -> {
for (NbtElement tagI : valueTag) {
tagI.asString().ifPresent(hiddenModules::add);
}
});
return this; return this;
} }
} }

View File

@@ -3,13 +3,14 @@ package anticope.rejects.utils.accounts;
import anticope.rejects.MeteorRejectsAddon; import anticope.rejects.MeteorRejectsAddon;
import com.mojang.authlib.exceptions.AuthenticationException; import com.mojang.authlib.exceptions.AuthenticationException;
import com.mojang.authlib.minecraft.MinecraftSessionService; import com.mojang.authlib.minecraft.MinecraftSessionService;
import meteordevelopment.meteorclient.mixin.MinecraftClientAccessor;
import meteordevelopment.meteorclient.systems.accounts.Account; import meteordevelopment.meteorclient.systems.accounts.Account;
import meteordevelopment.meteorclient.systems.accounts.AccountType; import meteordevelopment.meteorclient.systems.accounts.AccountType;
import meteordevelopment.meteorclient.utils.misc.NbtException; import meteordevelopment.meteorclient.utils.misc.NbtException;
import net.minecraft.client.session.Session; import net.minecraft.client.session.Session;
import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtCompound;
import java.net.Proxy;
import static meteordevelopment.meteorclient.MeteorClient.mc; import static meteordevelopment.meteorclient.MeteorClient.mc;
public class CustomYggdrasilAccount extends Account<CustomYggdrasilAccount> { public class CustomYggdrasilAccount extends Account<CustomYggdrasilAccount> {
@@ -38,9 +39,9 @@ public class CustomYggdrasilAccount extends Account<CustomYggdrasilAccount> {
@Override @Override
public boolean login() { public boolean login() {
try { try {
CustomYggdrasilLogin.LocalYggdrasilAuthenticationService service = new CustomYggdrasilLogin.LocalYggdrasilAuthenticationService(((MinecraftClientAccessor) mc).getProxy(), server); CustomYggdrasilLogin.LocalYggdrasilAuthenticationService service = new CustomYggdrasilLogin.LocalYggdrasilAuthenticationService(Proxy.NO_PROXY, server);
MinecraftSessionService sessService = new CustomYggdrasilLogin.LocalYggdrasilMinecraftSessionService(service, service.server); MinecraftSessionService sessService = new CustomYggdrasilLogin.LocalYggdrasilMinecraftSessionService(service, service.server);
applyLoginEnvironment(service, sessService); applyLoginEnvironment(service);
Session session = CustomYggdrasilLogin.login(name, password, server); Session session = CustomYggdrasilLogin.login(name, password, server);
setSession(session); setSession(session);
@@ -70,8 +71,8 @@ public class CustomYggdrasilAccount extends Account<CustomYggdrasilAccount> {
super.fromTag(tag); super.fromTag(tag);
if (!tag.contains("password")) throw new NbtException(); if (!tag.contains("password")) throw new NbtException();
password = tag.getString("password"); password = tag.getString("password").orElse("");
server = tag.getString("server"); server = tag.getString("server").orElse("");
return this; return this;
} }
@@ -81,4 +82,4 @@ public class CustomYggdrasilAccount extends Account<CustomYggdrasilAccount> {
if (!(o instanceof CustomYggdrasilAccount)) return false; if (!(o instanceof CustomYggdrasilAccount)) return false;
return ((CustomYggdrasilAccount) o).name.equals(this.name); return ((CustomYggdrasilAccount) o).name.equals(this.name);
} }
} }

View File

@@ -27,7 +27,8 @@ import java.util.*;
import static meteordevelopment.meteorclient.MeteorClient.mc; import static meteordevelopment.meteorclient.MeteorClient.mc;
public class CustomYggdrasilLogin { public class CustomYggdrasilLogin {
public static Environment localYggdrasilApi = new Environment("/sessionserver", "/minecraftservices", "Custom-Yggdrasil"); // Environment constructor now requires 4 parameters: authHost, accountsHost, sessionHost, name
public static Environment localYggdrasilApi = new Environment("", "/authserver", "/sessionserver", "Custom-Yggdrasil");
public static Session login(String name, String password, String server) throws AuthenticationException { public static Session login(String name, String password, String server) throws AuthenticationException {
try { try {
@@ -42,6 +43,10 @@ public class CustomYggdrasilLogin {
root.addProperty("password", password); root.addProperty("password", password);
String data = Http.post(url).bodyJson(root).sendString(); String data = Http.post(url).bodyJson(root).sendString();
if (data == null || data.isEmpty()) {
throw new AuthenticationException("Received null or empty response from authentication server");
}
JsonObject json = JsonParser.parseString(data).getAsJsonObject(); JsonObject json = JsonParser.parseString(data).getAsJsonObject();
if (json.has("error")) { if (json.has("error")) {
throw new AuthenticationException(json.get("errorMessage").getAsString()); throw new AuthenticationException(json.get("errorMessage").getAsString());
@@ -49,7 +54,10 @@ public class CustomYggdrasilLogin {
String token = json.get("accessToken").getAsString(); String token = json.get("accessToken").getAsString();
UUID uuid = UUID.fromString(json.get("selectedProfile").getAsJsonObject().get("id").getAsString()); UUID uuid = UUID.fromString(json.get("selectedProfile").getAsJsonObject().get("id").getAsString());
String username = json.get("selectedProfile").getAsJsonObject().get("name").getAsString(); String username = json.get("selectedProfile").getAsJsonObject().get("name").getAsString();
return new Session(username, uuid, token, Optional.empty(), Optional.empty(), Session.AccountType.MOJANG);
return new Session(username, uuid, token, Optional.empty(), Optional.empty());
} catch (AuthenticationException e) {
throw e;
} catch (Exception e) { } catch (Exception e) {
throw new AuthenticationException(e); throw new AuthenticationException(e);
} }
@@ -62,9 +70,25 @@ public class CustomYggdrasilLogin {
public LocalYggdrasilMinecraftSessionService(YggdrasilAuthenticationService service, String serverUrl) { public LocalYggdrasilMinecraftSessionService(YggdrasilAuthenticationService service, String serverUrl) {
super(service.getServicesKeySet(), mc.getNetworkProxy(), localYggdrasilApi); super(service.getServicesKeySet(), mc.getNetworkProxy(), localYggdrasilApi);
String data = Http.get(serverUrl).sendString(); ServicesKeyInfo tempKey = null;
JsonObject json = JsonParser.parseString(data).getAsJsonObject();
this.publicKey = getPublicKey(json.get("signaturePublickey").getAsString()); try {
String data = Http.get(serverUrl).sendString();
if (data != null && !data.isEmpty()) {
JsonObject json = JsonParser.parseString(data).getAsJsonObject();
if (json.has("signaturePublickey")) {
tempKey = getPublicKey(json.get("signaturePublickey").getAsString());
} else {
LOGGER.warn("No signaturePublickey found in response");
}
} else {
LOGGER.warn("Received null or empty response from server");
}
} catch (Exception e) {
LOGGER.error("Failed to fetch or parse public key", e);
}
this.publicKey = tempKey;
} }
private static ServicesKeyInfo getPublicKey(String key) { private static ServicesKeyInfo getPublicKey(String key) {
@@ -73,16 +97,16 @@ public class CustomYggdrasilLogin {
byte[] byteKey = Base64.getDecoder().decode(key.replace("\n", "")); byte[] byteKey = Base64.getDecoder().decode(key.replace("\n", ""));
return YggdrasilServicesKeyInfo.parse(byteKey); return YggdrasilServicesKeyInfo.parse(byteKey);
} catch (IllegalArgumentException e) { } catch (IllegalArgumentException e) {
e.printStackTrace(); LOGGER.error("Failed to parse public key", e);
return null;
} }
return null;
} }
private SignatureState getPropertySignatureState(final Property property) { private SignatureState getPropertySignatureState(final Property property) {
if (!property.hasSignature()) { if (!property.hasSignature()) {
return SignatureState.UNSIGNED; return SignatureState.UNSIGNED;
} }
if (!publicKey.validateProperty(property)) { if (publicKey != null && !publicKey.validateProperty(property)) {
return SignatureState.INVALID; return SignatureState.INVALID;
} }
return SignatureState.SIGNED; return SignatureState.SIGNED;
@@ -91,7 +115,7 @@ public class CustomYggdrasilLogin {
@Override @Override
public MinecraftProfileTextures unpackTextures(final Property packedTextures) { public MinecraftProfileTextures unpackTextures(final Property packedTextures) {
final String value = packedTextures.value(); final String value = packedTextures.value();
final SignatureState signatureState = getPropertySignatureState(packedTextures); final SignatureState signatureState = getPropertySignatureState(packedTextures);
final MinecraftTexturesPayload result; final MinecraftTexturesPayload result;
try { try {
@@ -125,5 +149,4 @@ public class CustomYggdrasilLogin {
this.server = server; this.server = server;
} }
} }
}
}

View File

@@ -28,8 +28,8 @@ public class Seed {
public static Seed fromTag(NbtCompound tag) { public static Seed fromTag(NbtCompound tag) {
return new Seed( return new Seed(
tag.getLong("seed"), tag.getLong("seed").orElse(0L),
MCVersion.fromString(tag.getString("version")) MCVersion.fromString(tag.getString("version").orElse("unknown"))
); );
} }
@@ -41,12 +41,10 @@ public class Seed {
version.toString() version.toString()
)); ));
text.setStyle(text.getStyle() text.setStyle(text.getStyle()
.withClickEvent(new ClickEvent( .withClickEvent(new ClickEvent.CopyToClipboard(
ClickEvent.Action.COPY_TO_CLIPBOARD,
seed.toString() seed.toString()
)) ))
.withHoverEvent(new HoverEvent( .withHoverEvent(new HoverEvent.ShowText(
HoverEvent.Action.SHOW_TEXT,
Text.literal("Copy to clipboard") Text.literal("Copy to clipboard")
)) ))
); );

View File

@@ -83,7 +83,7 @@ public class Seeds extends System<Seeds> {
@Override @Override
public Seeds fromTag(NbtCompound tag) { public Seeds fromTag(NbtCompound tag) {
tag.getKeys().forEach(key -> { tag.getKeys().forEach(key -> {
seeds.put(key, Seed.fromTag(tag.getCompound(key))); seeds.put(key, Seed.fromTag(tag.getCompound(key).orElse(new NbtCompound())));
}); });
return this; return this;
} }
@@ -103,8 +103,8 @@ public class Seeds extends System<Seeds> {
MutableText cmdText = Text.literal(cmd+"<version>"); MutableText cmdText = Text.literal(cmd+"<version>");
cmdText.setStyle(cmdText.getStyle() cmdText.setStyle(cmdText.getStyle()
.withUnderline(true) .withUnderline(true)
.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, cmd)) .withClickEvent(new ClickEvent.SuggestCommand(cmd))
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.literal("run command"))) .withHoverEvent(new HoverEvent.ShowText(Text.literal("run command")))
); );
msg.append(cmdText); msg.append(cmdText);
msg.setStyle(msg.getStyle() msg.setStyle(msg.getStyle()

View File

@@ -15,7 +15,7 @@ public class MServerInfo {
public int playercountMax; public int playercountMax;
public String label; public String label;
public long ping; public long ping;
public int protocolVersion = SharedConstants.getGameVersion().getProtocolVersion(); public int protocolVersion = SharedConstants.getProtocolVersion();
public String version = null; public String version = null;
public List<Text> playerListSummary = Collections.emptyList(); public List<Text> playerListSummary = Collections.emptyList();
private byte @Nullable [] icon; private byte @Nullable [] icon;

View File

@@ -4,11 +4,11 @@
"compatibilityLevel": "JAVA_21", "compatibilityLevel": "JAVA_21",
"client": [ "client": [
"ClientCommonNetwokHandlerMixin", "ClientCommonNetwokHandlerMixin",
"ClientPlayerEntityAccessor",
"ClientPlayerInteractionManagerMixin", "ClientPlayerInteractionManagerMixin",
"ClientPlayNetworkHandlerMixin", "ClientPlayNetworkHandlerMixin",
"CommandSuggestorMixin", "CommandSuggestorMixin",
"CountPlacementModifierAccessor", "CountPlacementModifierAccessor",
"Deadmau5FeatureRendererMixin",
"EntityAccessor", "EntityAccessor",
"GameRendererMixin", "GameRendererMixin",
"HandshakeC2SPacketAccessor", "HandshakeC2SPacketAccessor",
@@ -19,11 +19,11 @@
"MultiplayerScreenAccessor", "MultiplayerScreenAccessor",
"MultiplayerScreenMixin", "MultiplayerScreenMixin",
"PlayerEntityMixin", "PlayerEntityMixin",
"PlayerInventoryAccessor",
"PlayerMoveC2SPacketAccessor", "PlayerMoveC2SPacketAccessor",
"RarityFilterPlacementModifierAccessor", "RarityFilterPlacementModifierAccessor",
"ServerListAccessor", "ServerListAccessor",
"StructureVoidBlockMixin", "StructureVoidBlockMixin",
"TexturedRenderLayersMixin",
"ToastManagerMixin", "ToastManagerMixin",
"VehicleMoveC2SPacketAccessor", "VehicleMoveC2SPacketAccessor",
"baritone.MineProcessMixin" "baritone.MineProcessMixin"
@@ -31,4 +31,4 @@
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1
} }
} }