diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 04caf0a8..81b798ea 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -34,9 +34,9 @@ jobs: - uses: "marvinpinto/action-automatic-releases@latest" with: repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest-1.20.6" + automatic_release_tag: "latest-1.21" prerelease: false - title: "1.20.6 Build" + title: "1.21 Build" files: | ./build/libs/*.jar diff --git a/build.gradle b/build.gradle index 20411612..30d2476d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.6-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' } sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21 diff --git a/gradle.properties b/gradle.properties index 46b26e2c..60b3865d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,8 +2,8 @@ org.gradle.jvmargs=-Xmx2G # Fabric Properties -minecraft_version=1.20.6 -yarn_version=1.20.6+build.1 +minecraft_version=1.21 +yarn_version=1.21+build.2 loader_version=0.15.11 # Mod Properties @@ -11,5 +11,5 @@ mod_version = 0.3 maven_group = anticope.rejects archives_base_name = meteor-rejects-addon -meteor_version=0.5.7 -baritone_version=1.20.4 +meteor_version=0.5.8 +baritone_version=1.20.6 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 48c0a02c..0d184210 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/anticope/rejects/arguments/ClientPosArgumentType.java b/src/main/java/anticope/rejects/arguments/ClientPosArgumentType.java index 12a79e60..5ae460a2 100644 --- a/src/main/java/anticope/rejects/arguments/ClientPosArgumentType.java +++ b/src/main/java/anticope/rejects/arguments/ClientPosArgumentType.java @@ -13,7 +13,6 @@ import net.minecraft.server.command.CommandManager; import net.minecraft.util.math.Vec3d; -import java.util.Arrays; import java.util.Collection; import java.util.concurrent.CompletableFuture; diff --git a/src/main/java/anticope/rejects/commands/CenterCommand.java b/src/main/java/anticope/rejects/commands/CenterCommand.java index 5ddf84f1..bf11c56e 100644 --- a/src/main/java/anticope/rejects/commands/CenterCommand.java +++ b/src/main/java/anticope/rejects/commands/CenterCommand.java @@ -6,9 +6,6 @@ import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; import net.minecraft.util.math.MathHelper; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class CenterCommand extends Command { public CenterCommand() { super("center", "Centers the player on a block."); diff --git a/src/main/java/anticope/rejects/commands/ClearChatCommand.java b/src/main/java/anticope/rejects/commands/ClearChatCommand.java index 94be30c6..a8d15b3e 100644 --- a/src/main/java/anticope/rejects/commands/ClearChatCommand.java +++ b/src/main/java/anticope/rejects/commands/ClearChatCommand.java @@ -4,9 +4,6 @@ import meteordevelopment.meteorclient.commands.Command; import net.minecraft.command.CommandSource; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class ClearChatCommand extends Command { public ClearChatCommand() { super("clear-chat", "Clears your chat.", "clear", "cls"); diff --git a/src/main/java/anticope/rejects/commands/GhostCommand.java b/src/main/java/anticope/rejects/commands/GhostCommand.java index 6b033d1a..b37b58f2 100644 --- a/src/main/java/anticope/rejects/commands/GhostCommand.java +++ b/src/main/java/anticope/rejects/commands/GhostCommand.java @@ -9,9 +9,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class GhostCommand extends Command { public GhostCommand() { super("ghost", "Remove ghost blocks & bypass AntiXray", "aax", "anti-anti-xray"); diff --git a/src/main/java/anticope/rejects/commands/HeadsCommand.java b/src/main/java/anticope/rejects/commands/HeadsCommand.java index 2101860c..7cc3f375 100644 --- a/src/main/java/anticope/rejects/commands/HeadsCommand.java +++ b/src/main/java/anticope/rejects/commands/HeadsCommand.java @@ -7,8 +7,6 @@ import meteordevelopment.meteorclient.utils.Utils; import net.minecraft.command.CommandSource; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; - public class HeadsCommand extends Command { public HeadsCommand() { diff --git a/src/main/java/anticope/rejects/commands/KickCommand.java b/src/main/java/anticope/rejects/commands/KickCommand.java index 3ee57d21..19a54d0e 100644 --- a/src/main/java/anticope/rejects/commands/KickCommand.java +++ b/src/main/java/anticope/rejects/commands/KickCommand.java @@ -11,9 +11,6 @@ import net.minecraft.text.Text; import org.apache.commons.lang3.SystemUtils; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class KickCommand extends Command { public KickCommand() { diff --git a/src/main/java/anticope/rejects/commands/LocateCommand.java b/src/main/java/anticope/rejects/commands/LocateCommand.java index 0fb3e0e3..0b1c1290 100644 --- a/src/main/java/anticope/rejects/commands/LocateCommand.java +++ b/src/main/java/anticope/rejects/commands/LocateCommand.java @@ -19,9 +19,6 @@ import cubitect.Cubiomes; import cubitect.Cubiomes.Pos; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class LocateCommand extends Command { private final static DynamicCommandExceptionType NOT_FOUND = new DynamicCommandExceptionType(o -> { diff --git a/src/main/java/anticope/rejects/commands/PanicCommand.java b/src/main/java/anticope/rejects/commands/PanicCommand.java index a8025055..c2967505 100644 --- a/src/main/java/anticope/rejects/commands/PanicCommand.java +++ b/src/main/java/anticope/rejects/commands/PanicCommand.java @@ -8,8 +8,6 @@ import java.util.ArrayList; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; - public class PanicCommand extends Command { public PanicCommand() { super("panic", "Disables all modules.", "disable-all"); diff --git a/src/main/java/anticope/rejects/commands/ReconnectCommand.java b/src/main/java/anticope/rejects/commands/ReconnectCommand.java index 855fa680..30fa33d0 100644 --- a/src/main/java/anticope/rejects/commands/ReconnectCommand.java +++ b/src/main/java/anticope/rejects/commands/ReconnectCommand.java @@ -9,9 +9,6 @@ import net.minecraft.client.network.ServerInfo; import net.minecraft.command.CommandSource; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class ReconnectCommand extends Command { public ReconnectCommand() { super("reconnect", "Reconnects server."); diff --git a/src/main/java/anticope/rejects/commands/SaveSkinCommand.java b/src/main/java/anticope/rejects/commands/SaveSkinCommand.java index b220a5c6..b0ce77a0 100644 --- a/src/main/java/anticope/rejects/commands/SaveSkinCommand.java +++ b/src/main/java/anticope/rejects/commands/SaveSkinCommand.java @@ -23,8 +23,6 @@ import java.nio.charset.StandardCharsets; import java.util.UUID; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; - public class SaveSkinCommand extends Command { private final static SimpleCommandExceptionType IO_EXCEPTION = new SimpleCommandExceptionType(Text.literal("An exception occurred")); diff --git a/src/main/java/anticope/rejects/commands/SeedCommand.java b/src/main/java/anticope/rejects/commands/SeedCommand.java index 1e66390f..995b5b96 100644 --- a/src/main/java/anticope/rejects/commands/SeedCommand.java +++ b/src/main/java/anticope/rejects/commands/SeedCommand.java @@ -13,8 +13,6 @@ import net.minecraft.text.MutableText; import net.minecraft.text.Text; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; - public class SeedCommand extends Command { private final static SimpleCommandExceptionType NO_SEED = new SimpleCommandExceptionType(Text.literal("No seed for current world saved.")); diff --git a/src/main/java/anticope/rejects/commands/ServerCommand.java b/src/main/java/anticope/rejects/commands/ServerCommand.java index 67f51aa8..f783a7fd 100644 --- a/src/main/java/anticope/rejects/commands/ServerCommand.java +++ b/src/main/java/anticope/rejects/commands/ServerCommand.java @@ -20,9 +20,6 @@ import java.net.UnknownHostException; import java.util.*; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - /* Ported from Cornos https://github.com/cornos/Cornos/blob/master/src/main/java/me/zeroX150/cornos/features/command/impl/Scan.java diff --git a/src/main/java/anticope/rejects/commands/SetBlockCommand.java b/src/main/java/anticope/rejects/commands/SetBlockCommand.java index 48aeb81e..b835a9cf 100644 --- a/src/main/java/anticope/rejects/commands/SetBlockCommand.java +++ b/src/main/java/anticope/rejects/commands/SetBlockCommand.java @@ -10,9 +10,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class SetBlockCommand extends Command { public SetBlockCommand() { super("setblock", "Sets client side blocks", "sblk"); diff --git a/src/main/java/anticope/rejects/commands/SetVelocityCommand.java b/src/main/java/anticope/rejects/commands/SetVelocityCommand.java index d96779cd..71b6d3b7 100644 --- a/src/main/java/anticope/rejects/commands/SetVelocityCommand.java +++ b/src/main/java/anticope/rejects/commands/SetVelocityCommand.java @@ -5,9 +5,6 @@ import meteordevelopment.meteorclient.commands.Command; import net.minecraft.command.CommandSource; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class SetVelocityCommand extends Command { public SetVelocityCommand() { super("set-velocity", "Sets player velocity", "velocity", "vel"); diff --git a/src/main/java/anticope/rejects/commands/TeleportCommand.java b/src/main/java/anticope/rejects/commands/TeleportCommand.java index d45f9c1e..3dbcd9fe 100644 --- a/src/main/java/anticope/rejects/commands/TeleportCommand.java +++ b/src/main/java/anticope/rejects/commands/TeleportCommand.java @@ -7,9 +7,6 @@ import net.minecraft.command.CommandSource; import net.minecraft.util.math.Vec3d; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class TeleportCommand extends Command { diff --git a/src/main/java/anticope/rejects/commands/TerrainExport.java b/src/main/java/anticope/rejects/commands/TerrainExport.java index 3debfd83..2fdbf0a2 100644 --- a/src/main/java/anticope/rejects/commands/TerrainExport.java +++ b/src/main/java/anticope/rejects/commands/TerrainExport.java @@ -16,9 +16,6 @@ import java.io.IOException; import java.nio.ByteBuffer; -import static com.mojang.brigadier.Command.SINGLE_SUCCESS; -import static meteordevelopment.meteorclient.MeteorClient.mc; - public class TerrainExport extends Command { private final static SimpleCommandExceptionType IO_EXCEPTION = new SimpleCommandExceptionType(Text.literal("An IOException occurred")); diff --git a/src/main/java/anticope/rejects/gui/screens/InteractionScreen.java b/src/main/java/anticope/rejects/gui/screens/InteractionScreen.java index f70d3b13..6f50f03e 100644 --- a/src/main/java/anticope/rejects/gui/screens/InteractionScreen.java +++ b/src/main/java/anticope/rejects/gui/screens/InteractionScreen.java @@ -62,7 +62,7 @@ public class InteractionScreen extends Screen { private final Map> functions; private final Map msgs; - private final Identifier GUI_ICONS_TEXTURE = new Identifier("textures/gui/icons.png"); + private final Identifier GUI_ICONS_TEXTURE = Identifier.of("textures/gui/icons.png"); private final StaticListener shiftListener = new StaticListener(); diff --git a/src/main/java/anticope/rejects/mixin/ClientCommonNetwokHandlerMixin.java b/src/main/java/anticope/rejects/mixin/ClientCommonNetwokHandlerMixin.java index c8905537..8bb97073 100644 --- a/src/main/java/anticope/rejects/mixin/ClientCommonNetwokHandlerMixin.java +++ b/src/main/java/anticope/rejects/mixin/ClientCommonNetwokHandlerMixin.java @@ -4,6 +4,7 @@ import meteordevelopment.meteorclient.systems.modules.Modules; import meteordevelopment.meteorclient.utils.player.ChatUtils; import net.minecraft.client.network.ClientCommonNetworkHandler; +import net.minecraft.network.DisconnectionInfo; import net.minecraft.text.Text; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -15,11 +16,11 @@ @Mixin(ClientCommonNetworkHandler.class) public class ClientCommonNetwokHandlerMixin { @Inject(method = "onDisconnected", at = @At("HEAD"), cancellable = true) - private void onDisconnected(Text reason, CallbackInfo info) { + private void onDisconnected(DisconnectionInfo info, CallbackInfo ci) { if (Modules.get().isActive(SilentDisconnect.class) && mc.world != null && mc.player != null) { ChatUtils.info(Text.translatable("disconnect.lost").getString() + ":"); - ChatUtils.sendMsg(reason); - info.cancel(); + ChatUtils.sendMsg(info.reason()); + ci.cancel(); } } } diff --git a/src/main/java/anticope/rejects/mixin/CommandSuggestorMixin.java b/src/main/java/anticope/rejects/mixin/CommandSuggestorMixin.java index c9aee4ed..934e62d1 100644 --- a/src/main/java/anticope/rejects/mixin/CommandSuggestorMixin.java +++ b/src/main/java/anticope/rejects/mixin/CommandSuggestorMixin.java @@ -5,7 +5,6 @@ import meteordevelopment.meteorclient.systems.modules.render.NoRender; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.ChatInputSuggestor; -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; diff --git a/src/main/java/anticope/rejects/mixin/GameRendererMixin.java b/src/main/java/anticope/rejects/mixin/GameRendererMixin.java index 97cb76e4..f1f18231 100644 --- a/src/main/java/anticope/rejects/mixin/GameRendererMixin.java +++ b/src/main/java/anticope/rejects/mixin/GameRendererMixin.java @@ -4,6 +4,7 @@ import meteordevelopment.meteorclient.systems.modules.Modules; import net.minecraft.client.gl.PostEffectProcessor; +import net.minecraft.client.render.RenderTickCounter; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -19,14 +20,14 @@ public class GameRendererMixin { @Shadow @Final MinecraftClient client; @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/WorldRenderer;drawEntityOutlinesFramebuffer()V", ordinal = 0)) - private void renderShader(float tickDelta, long startTime, boolean tick, CallbackInfo ci) { + private void renderShader(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) { Rendering renderingModule = Modules.get().get(Rendering.class); if (renderingModule == null) return; PostEffectProcessor shader = renderingModule.getShaderEffect(); if (shader != null) { shader.setupDimensions(client.getWindow().getFramebufferWidth(), client.getWindow().getFramebufferHeight()); - shader.render(tickDelta); + shader.render(tickCounter.getTickDelta(tick)); } } } diff --git a/src/main/java/anticope/rejects/modules/AutoCraft.java b/src/main/java/anticope/rejects/modules/AutoCraft.java index 5551e830..f87e5823 100644 --- a/src/main/java/anticope/rejects/modules/AutoCraft.java +++ b/src/main/java/anticope/rejects/modules/AutoCraft.java @@ -10,7 +10,6 @@ import meteordevelopment.orbit.EventHandler; import net.minecraft.client.gui.screen.recipebook.RecipeResultCollection; import net.minecraft.item.Item; -import net.minecraft.recipe.Recipe; import net.minecraft.recipe.RecipeEntry; import net.minecraft.screen.CraftingScreenHandler; import net.minecraft.screen.slot.SlotActionType; diff --git a/src/main/java/anticope/rejects/modules/AutoExtinguish.java b/src/main/java/anticope/rejects/modules/AutoExtinguish.java index bb858b36..d4c0f9da 100644 --- a/src/main/java/anticope/rejects/modules/AutoExtinguish.java +++ b/src/main/java/anticope/rejects/modules/AutoExtinguish.java @@ -83,7 +83,7 @@ public class AutoExtinguish extends Module { private BlockPos blockPos = null; private boolean doesWaterBucketWork = true; - private static final StatusEffect FIRE_RESISTANCE = Registries.STATUS_EFFECT.get(new Identifier("fire_resistance")); + private static final StatusEffect FIRE_RESISTANCE = Registries.STATUS_EFFECT.get(Identifier.of("fire_resistance")); public AutoExtinguish() { super(MeteorRejectsAddon.CATEGORY, "auto-extinguish", "Automatically extinguishes fire around you"); diff --git a/src/main/java/anticope/rejects/modules/AutoGrind.java b/src/main/java/anticope/rejects/modules/AutoGrind.java index 34859996..2075f0e0 100644 --- a/src/main/java/anticope/rejects/modules/AutoGrind.java +++ b/src/main/java/anticope/rejects/modules/AutoGrind.java @@ -13,10 +13,13 @@ import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.registry.RegistryKey; import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.registry.tag.EnchantmentTags; import net.minecraft.screen.GrindstoneScreenHandler; import java.util.List; +import java.util.Set; public class AutoGrind extends Module { private final SettingGroup sgGeneral = settings.getDefaultGroup(); @@ -38,7 +41,7 @@ public class AutoGrind extends Module { .build() ); - private final Setting> enchantmentBlacklist = sgGeneral.add(new EnchantmentListSetting.Builder() + private final Setting>> enchantmentBlacklist = sgGeneral.add(new EnchantmentListSetting.Builder() .name("enchantment-blacklist") .description("Enchantments that should be ignored.") .defaultValue() @@ -80,7 +83,7 @@ private boolean canGrind(ItemStack stack) { for (RegistryEntry enchantment : enchantments.getEnchantments()) { availEnchs++; - if (enchantment.value().isCursed()) + if (EnchantmentHelper.hasAnyEnchantmentsIn(stack, EnchantmentTags.CURSE)) availEnchs--; if (enchantmentBlacklist.get().contains(enchantment.value())) return false; diff --git a/src/main/java/anticope/rejects/modules/AutoSoup.java b/src/main/java/anticope/rejects/modules/AutoSoup.java index 3e5fc8f4..b33db9e4 100644 --- a/src/main/java/anticope/rejects/modules/AutoSoup.java +++ b/src/main/java/anticope/rejects/modules/AutoSoup.java @@ -14,15 +14,17 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.passive.TameableEntity; import net.minecraft.entity.passive.VillagerEntity; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.item.StewItem; import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.EntityHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; +import java.util.List; + public class AutoSoup extends Module { private static final String desc = "Automatically eats soup when your health is low on some servers."; @@ -108,10 +110,12 @@ private void onTick(TickEvent.Post event) { } private int findSoup(int startSlot, int endSlot) { + List stews = List.of(Items.RABBIT_STEW, Items.MUSHROOM_STEW, Items.BEETROOT_SOUP); + for (int i = startSlot; i < endSlot; i++) { ItemStack stack = mc.player.getInventory().getStack(i); - if (stack != null && stack.getItem() instanceof StewItem) + if (stack != null && stews.contains(stack.getItem())) return i; } diff --git a/src/main/java/anticope/rejects/modules/BungeeCordSpoof.java b/src/main/java/anticope/rejects/modules/BungeeCordSpoof.java index d79eac88..4a6b0f7d 100644 --- a/src/main/java/anticope/rejects/modules/BungeeCordSpoof.java +++ b/src/main/java/anticope/rejects/modules/BungeeCordSpoof.java @@ -9,7 +9,6 @@ import meteordevelopment.meteorclient.systems.modules.Module; import meteordevelopment.meteorclient.utils.Utils; import meteordevelopment.orbit.EventHandler; -import net.minecraft.network.NetworkState; import net.minecraft.network.packet.c2s.handshake.ConnectionIntent; import net.minecraft.network.packet.c2s.handshake.HandshakeC2SPacket; diff --git a/src/main/java/anticope/rejects/modules/NoJumpDelay.java b/src/main/java/anticope/rejects/modules/NoJumpDelay.java index 6776ac1e..4f381416 100644 --- a/src/main/java/anticope/rejects/modules/NoJumpDelay.java +++ b/src/main/java/anticope/rejects/modules/NoJumpDelay.java @@ -4,13 +4,8 @@ import meteordevelopment.meteorclient.events.world.TickEvent; import meteordevelopment.meteorclient.mixin.LivingEntityAccessor; import meteordevelopment.orbit.EventHandler; -import meteordevelopment.meteorclient.systems.modules.Categories; import meteordevelopment.meteorclient.systems.modules.Module; -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - public class NoJumpDelay extends Module { public NoJumpDelay() { diff --git a/src/main/java/anticope/rejects/modules/Rendering.java b/src/main/java/anticope/rejects/modules/Rendering.java index a6186fd0..960ad3f3 100644 --- a/src/main/java/anticope/rejects/modules/Rendering.java +++ b/src/main/java/anticope/rejects/modules/Rendering.java @@ -106,7 +106,7 @@ public void onChanged(Shader s) { if (s == Shader.Vibrant) name = "color_convolve"; else if (s == Shader.Scanline) name = "scan_pincushion"; else name = s.toString().toLowerCase(); - Identifier shaderID = new Identifier(String.format("shaders/post/%s.json", name)); + Identifier shaderID = Identifier.of(String.format("shaders/post/%s.json", name)); try { PostEffectProcessor shader = new PostEffectProcessor(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), shaderID); this.shader = shader; diff --git a/src/main/java/anticope/rejects/modules/SkeletonESP.java b/src/main/java/anticope/rejects/modules/SkeletonESP.java index 22731eb8..c56ad1dc 100644 --- a/src/main/java/anticope/rejects/modules/SkeletonESP.java +++ b/src/main/java/anticope/rejects/modules/SkeletonESP.java @@ -115,26 +115,26 @@ private void onRender(Render3DEvent event) { matrixStack.multiply(new Quaternionf().setAngleAxis((90 + m) * Math.PI / 180F, -1, 0, 0)); if (swimming) matrixStack.translate(0, -0.95f, 0); - BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer(); - bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); + Tessellator tessellator = Tessellator.getInstance(); + BufferBuilder bufferBuilder = tessellator.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION_COLOR); Matrix4f matrix4f = matrixStack.peek().getPositionMatrix(); - bufferBuilder.vertex(matrix4f, 0, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); - bufferBuilder.vertex(matrix4f, 0, sneaking ? 1.05f : 1.4f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//spine + bufferBuilder.vertex(matrix4f, 0, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); + bufferBuilder.vertex(matrix4f, 0, sneaking ? 1.05f : 1.4f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);//spine - bufferBuilder.vertex(matrix4f, -0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//shoulders - bufferBuilder.vertex(matrix4f, 0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); + bufferBuilder.vertex(matrix4f, -0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);//shoulders + bufferBuilder.vertex(matrix4f, 0.37f, sneaking ? 1.05f : 1.35f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); - bufferBuilder.vertex(matrix4f, -0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next();//pelvis - bufferBuilder.vertex(matrix4f, 0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); + bufferBuilder.vertex(matrix4f, -0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a);//pelvis + bufferBuilder.vertex(matrix4f, 0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); // Head matrixStack.push(); matrixStack.translate(0, sneaking ? 1.05f : 1.4f, 0); rotate(matrixStack, head); matrix4f = matrixStack.peek().getPositionMatrix(); - bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); - bufferBuilder.vertex(matrix4f, 0, 0.15f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); + bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); + bufferBuilder.vertex(matrix4f, 0, 0.15f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); matrixStack.pop(); // Right Leg @@ -142,8 +142,8 @@ private void onRender(Render3DEvent event) { matrixStack.translate(0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0); rotate(matrixStack, rightLeg); matrix4f = matrixStack.peek().getPositionMatrix(); - bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); - bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); + bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); + bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); matrixStack.pop(); // Left Leg @@ -151,8 +151,8 @@ private void onRender(Render3DEvent event) { matrixStack.translate(-0.15f, sneaking ? 0.6f : 0.7f, sneaking ? 0.23f : 0); rotate(matrixStack, leftLeg); matrix4f = matrixStack.peek().getPositionMatrix(); - bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); - bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); + bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); + bufferBuilder.vertex(matrix4f, 0, -0.6f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); matrixStack.pop(); // Right Arm @@ -160,8 +160,8 @@ private void onRender(Render3DEvent event) { matrixStack.translate(0.37f, sneaking ? 1.05f : 1.35f, 0); rotate(matrixStack, rightArm); matrix4f = matrixStack.peek().getPositionMatrix(); - bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); - bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); + bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); + bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); matrixStack.pop(); // Left Arm @@ -169,11 +169,11 @@ private void onRender(Render3DEvent event) { matrixStack.translate(-0.37f, sneaking ? 1.05f : 1.35f, 0); rotate(matrixStack, leftArm); matrix4f = matrixStack.peek().getPositionMatrix(); - bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); - bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a).next(); + bufferBuilder.vertex(matrix4f, 0, 0, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); + bufferBuilder.vertex(matrix4f, 0, -0.55f, 0).color(skeletonColor.r, skeletonColor.g, skeletonColor.b, skeletonColor.a); matrixStack.pop(); - bufferBuilder.clear(); + tessellator.clear(); BufferRenderer.drawWithGlobalProgram(bufferBuilder.end()); if (swimming) matrixStack.translate(0, 0.95f, 0); diff --git a/src/main/java/anticope/rejects/utils/GiveUtils.java b/src/main/java/anticope/rejects/utils/GiveUtils.java index 03cde95e..b49742c3 100644 --- a/src/main/java/anticope/rejects/utils/GiveUtils.java +++ b/src/main/java/anticope/rejects/utils/GiveUtils.java @@ -5,6 +5,7 @@ import net.minecraft.component.ComponentChanges; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.*; +import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantments; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; @@ -15,6 +16,8 @@ import net.minecraft.nbt.NbtList; import net.minecraft.nbt.StringNbtReader; import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -38,13 +41,13 @@ public class GiveUtils { private final static SimpleCommandExceptionType NO_SPACE = new SimpleCommandExceptionType(Text.literal("No space in hotbar.")); private static final List HIDDEN_ENTITIES = Arrays.asList( - new Identifier("giant"), - new Identifier("ender_dragon"), - new Identifier("wither"), - new Identifier("iron_golem"), - new Identifier("ender_dragon"), - new Identifier("tnt_minecart"), - new Identifier("lightning_bolt")); + Identifier.of("giant"), + Identifier.of("ender_dragon"), + Identifier.of("wither"), + Identifier.of("iron_golem"), + Identifier.of("ender_dragon"), + Identifier.of("tnt_minecart"), + 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 private static final List> ENTITY_PRESETS = Arrays.asList( @@ -65,6 +68,7 @@ public class GiveUtils { ); private static final Random random = new Random(); + private static Registry enchantmentRegistry; public static void giveItem(ItemStack item) throws CommandSyntaxException { if (!mc.player.getAbilities().creativeMode) throw NOT_IN_CREATIVE.create(); @@ -134,19 +138,21 @@ public static void giveItem(ItemStack item) throws CommandSyntaxException { }); PRESETS.put("32k", (preview) -> { - if (preview) return Items.DIAMOND_SWORD.getDefaultStack(); + enchantmentRegistry = mc.world.getRegistryManager().get(RegistryKeys.ENCHANTMENT); + + if (preview || enchantmentRegistry == null) return Items.DIAMOND_SWORD.getDefaultStack(); ItemStack stack = Items.DIAMOND_SWORD.getDefaultStack(); stack.apply(DataComponentTypes.ENCHANTMENTS, ItemEnchantmentsComponent.DEFAULT, component -> { ItemEnchantmentsComponent.Builder builder = new ItemEnchantmentsComponent.Builder(component); - builder.add(Enchantments.SHARPNESS, 255); - builder.add(Enchantments.KNOCKBACK, 255); - builder.add(Enchantments.FIRE_ASPECT, 255); - builder.add(Enchantments.LOOTING, 10); - builder.add(Enchantments.SWEEPING_EDGE, 3); - builder.add(Enchantments.UNBREAKING, 255); - builder.add(Enchantments.MENDING, 1); - builder.add(Enchantments.VANISHING_CURSE, 1); + builder.add(enchantmentRegistry.entryOf(Enchantments.SHARPNESS), 255); + builder.add(enchantmentRegistry.entryOf(Enchantments.KNOCKBACK), 255); + builder.add(enchantmentRegistry.entryOf(Enchantments.FIRE_ASPECT), 255); + builder.add(enchantmentRegistry.entryOf(Enchantments.LOOTING), 10); + builder.add(enchantmentRegistry.entryOf(Enchantments.SWEEPING_EDGE), 3); + builder.add(enchantmentRegistry.entryOf(Enchantments.UNBREAKING), 255); + builder.add(enchantmentRegistry.entryOf(Enchantments.MENDING), 1); + builder.add(enchantmentRegistry.entryOf(Enchantments.VANISHING_CURSE), 1); return builder.build(); }); diff --git a/src/main/java/anticope/rejects/utils/WorldGenUtils.java b/src/main/java/anticope/rejects/utils/WorldGenUtils.java index 26fee359..947830df 100644 --- a/src/main/java/anticope/rejects/utils/WorldGenUtils.java +++ b/src/main/java/anticope/rejects/utils/WorldGenUtils.java @@ -19,10 +19,8 @@ import net.minecraft.block.Block; import net.minecraft.block.Blocks; -import net.minecraft.component.DataComponentType; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.MapDecorationsComponent; -import net.minecraft.component.type.MapIdComponent; import net.minecraft.entity.Entity; import net.minecraft.entity.mob.*; import net.minecraft.entity.passive.IronGolemEntity; @@ -30,7 +28,6 @@ import net.minecraft.entity.vehicle.ChestMinecartEntity; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.nbt.*; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/anticope/rejects/utils/accounts/CustomYggdrasilLogin.java b/src/main/java/anticope/rejects/utils/accounts/CustomYggdrasilLogin.java index 7ae52b0d..c505df3a 100644 --- a/src/main/java/anticope/rejects/utils/accounts/CustomYggdrasilLogin.java +++ b/src/main/java/anticope/rejects/utils/accounts/CustomYggdrasilLogin.java @@ -2,17 +2,13 @@ package anticope.rejects.utils.accounts; -import com.google.common.collect.Iterables; import com.google.gson.*; import com.mojang.authlib.Environment; -import com.mojang.authlib.GameProfile; import com.mojang.authlib.SignatureState; import com.mojang.authlib.exceptions.AuthenticationException; -import com.mojang.authlib.minecraft.InsecurePublicKeyException; import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftProfileTextures; import com.mojang.authlib.properties.Property; -import com.mojang.authlib.yggdrasil.TextureUrlChecker; import com.mojang.authlib.yggdrasil.ServicesKeyInfo; import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService; import com.mojang.authlib.yggdrasil.YggdrasilMinecraftSessionService; @@ -26,11 +22,6 @@ import java.net.Proxy; import java.nio.charset.StandardCharsets; -import java.security.KeyFactory; -import java.security.NoSuchAlgorithmException; -import java.security.PublicKey; -import java.security.spec.InvalidKeySpecException; -import java.security.spec.X509EncodedKeySpec; import java.util.*; import static meteordevelopment.meteorclient.MeteorClient.mc; diff --git a/src/main/java/anticope/rejects/utils/server/ServerListPinger.java b/src/main/java/anticope/rejects/utils/server/ServerListPinger.java index ae5e0c4b..b0eeb2f7 100644 --- a/src/main/java/anticope/rejects/utils/server/ServerListPinger.java +++ b/src/main/java/anticope/rejects/utils/server/ServerListPinger.java @@ -1,6 +1,5 @@ package anticope.rejects.utils.server; -import com.google.common.base.Splitter; import com.google.common.collect.Lists; import io.netty.bootstrap.Bootstrap; import io.netty.channel.*; @@ -9,6 +8,7 @@ import net.minecraft.client.network.LegacyServerPinger; import net.minecraft.client.network.ServerAddress; import net.minecraft.network.ClientConnection; +import net.minecraft.network.DisconnectionInfo; import net.minecraft.network.listener.ClientQueryPacketListener; import net.minecraft.network.packet.c2s.query.QueryPingC2SPacket; import net.minecraft.network.packet.c2s.query.QueryRequestC2SPacket; @@ -123,6 +123,11 @@ public void onDisconnected(Text reason) { notifyDisconnectListeners(); } + @Override + public void onDisconnected(DisconnectionInfo info) { + + } + public boolean isConnectionOpen() { return clientConnection.isOpen(); }