Skip to content

Commit 6caa886

Browse files
basic 1.21.10 and 1.21.11 support, for people who need it (#486)
Co-authored-by: Cloudburst <[email protected]>
1 parent 4563a7e commit 6caa886

File tree

141 files changed

+2324
-2169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+2324
-2169
lines changed

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
- uses: "marvinpinto/action-automatic-releases@latest"
3535
with:
3636
repo_token: "${{ secrets.GITHUB_TOKEN }}"
37-
automatic_release_tag: "latest-1.21.4"
37+
automatic_release_tag: "latest-1.21.11"
3838
prerelease: false
39-
title: "1.21.4 Build"
39+
title: "1.21.11 Build"
4040
files: |
4141
./build/libs/*.jar
4242

build.gradle

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
plugins {
2-
id 'fabric-loom' version '1.9-SNAPSHOT'
2+
id 'java'
3+
id 'fabric-loom' version '1.14-SNAPSHOT'
34
}
45

5-
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_21
6+
java {
7+
toolchain {
8+
languageVersion = JavaLanguageVersion.of(21)
9+
}
10+
}
611

7-
archivesBaseName = project.archives_base_name
12+
base {
13+
archivesName = project.archives_base_name
14+
}
815
version = project.mod_version
916
group = project.maven_group
1017

@@ -36,7 +43,7 @@ dependencies {
3643
extraLibs('dev.duti.acheong:cubiomes:1.22.3:windows64') { transitive = false }
3744
// To change the versions see the gradle.properties file
3845
minecraft "com.mojang:minecraft:${project.minecraft_version}"
39-
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
46+
mappings loom.officialMojangMappings()
4047
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
4148

4249
modImplementation("meteordevelopment:meteor-client:${project.minecraft_version}-SNAPSHOT")
@@ -71,13 +78,13 @@ processResources {
7178

7279
jar {
7380
from("LICENSE") {
74-
rename { "${it}_${project.archivesBaseName}" }
81+
rename { "${it}_${base.archivesName}" }
7582
}
7683
from {
7784
configurations.extraLibs.collect { it.isDirectory() ? it : zipTree(it) }
7885
}
7986
}
80-
tasks.withType(Jar) {
87+
tasks.withType(Jar).configureEach {
8188
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
8289
}
8390

gradle.properties

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
org.gradle.jvmargs=-Xmx2G
33

44
# Fabric Properties
5-
minecraft_version=1.21.4
6-
yarn_version=1.21.4+build.8
7-
loader_version=0.16.9
5+
minecraft_version=1.21.11
6+
yarn_version=1.21.11+build.3
7+
loader_version=0.17.3
88

99
# Mod Properties
1010
mod_version = 0.3
1111
maven_group = anticope.rejects
1212
archives_base_name = meteor-rejects-addon
1313

14-
baritone_version=1.21.4
14+
baritone_version=1.21.11

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/java/anticope/rejects/MeteorRejectsAddon.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
import meteordevelopment.meteorclient.systems.modules.Category;
1515
import meteordevelopment.meteorclient.systems.modules.Modules;
1616
import net.fabricmc.loader.api.FabricLoader;
17-
import net.minecraft.item.Items;
17+
import net.minecraft.world.item.Items;
1818
import org.slf4j.Logger;
1919
import org.slf4j.LoggerFactory;
2020

2121
public class MeteorRejectsAddon extends MeteorAddon {
2222
public static final Logger LOG = LoggerFactory.getLogger("Rejects");
23-
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultStack());
23+
public static final Category CATEGORY = new Category("Rejects", Items.BARRIER.getDefaultInstance());
2424
public static final HudGroup HUD_GROUP = new HudGroup("Rejects");
2525

2626
@Override

src/main/java/anticope/rejects/arguments/ClientPosArgumentType.java

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,65 +6,64 @@
66
import com.mojang.brigadier.exceptions.CommandSyntaxException;
77
import com.mojang.brigadier.suggestion.Suggestions;
88
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
9-
import net.minecraft.client.MinecraftClient;
10-
import net.minecraft.command.CommandSource;
11-
import net.minecraft.command.argument.CoordinateArgument;
12-
import net.minecraft.command.argument.Vec3ArgumentType;
13-
import net.minecraft.server.command.CommandManager;
14-
import net.minecraft.util.math.Vec3d;
15-
169
import java.util.Collection;
1710
import java.util.concurrent.CompletableFuture;
11+
import net.minecraft.client.Minecraft;
12+
import net.minecraft.commands.Commands;
13+
import net.minecraft.commands.SharedSuggestionProvider;
14+
import net.minecraft.commands.arguments.coordinates.Vec3Argument;
15+
import net.minecraft.commands.arguments.coordinates.WorldCoordinate;
16+
import net.minecraft.world.phys.Vec3;
1817

19-
public class ClientPosArgumentType implements ArgumentType<Vec3d> {
20-
private static final MinecraftClient mc = MinecraftClient.getInstance();
18+
public class ClientPosArgumentType implements ArgumentType<Vec3> {
19+
private static final Minecraft mc = Minecraft.getInstance();
2120

2221
public static ClientPosArgumentType pos() {
2322
return new ClientPosArgumentType();
2423
}
2524

2625
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
27-
if (!(context.getSource() instanceof CommandSource)) {
26+
if (!(context.getSource() instanceof SharedSuggestionProvider)) {
2827
return Suggestions.empty();
2928
} else {
3029
String string = builder.getRemaining();
31-
Collection<CommandSource.RelativePosition> collection2 = ((CommandSource)context.getSource()).getBlockPositionSuggestions();
30+
Collection<SharedSuggestionProvider.TextCoordinates> collection2 = ((SharedSuggestionProvider)context.getSource()).getRelevantCoordinates();
3231

33-
return CommandSource.suggestPositions(string, collection2, builder, CommandManager.getCommandValidator(this::parse));
32+
return SharedSuggestionProvider.suggestCoordinates(string, collection2, builder, Commands.createValidator(this::parse));
3433
}
3534
}
3635

37-
public static Vec3d getPos(final CommandContext<?> context, final String name) {
38-
return context.getArgument(name, Vec3d.class);
36+
public static Vec3 getPos(final CommandContext<?> context, final String name) {
37+
return context.getArgument(name, Vec3.class);
3938
}
4039

4140

42-
public Vec3d parse(StringReader reader) throws CommandSyntaxException {
41+
public Vec3 parse(StringReader reader) throws CommandSyntaxException {
4342
int i = reader.getCursor();
4443
double x,y,z;
45-
CoordinateArgument coordinateArgument = CoordinateArgument.parse(reader);
46-
CoordinateArgument coordinateArgument2;
47-
CoordinateArgument coordinateArgument3;
44+
WorldCoordinate coordinateArgument = WorldCoordinate.parseInt(reader);
45+
WorldCoordinate coordinateArgument2;
46+
WorldCoordinate coordinateArgument3;
4847
if (reader.canRead() && reader.peek() == ' ') {
4948
reader.skip();
50-
coordinateArgument2 = CoordinateArgument.parse(reader);
49+
coordinateArgument2 = WorldCoordinate.parseInt(reader);
5150
if (reader.canRead() && reader.peek() == ' ') {
5251
reader.skip();
53-
coordinateArgument3 = CoordinateArgument.parse(reader);
52+
coordinateArgument3 = WorldCoordinate.parseInt(reader);
5453
} else {
5554
reader.setCursor(i);
56-
throw Vec3ArgumentType.INCOMPLETE_EXCEPTION.createWithContext(reader);
55+
throw Vec3Argument.ERROR_NOT_COMPLETE.createWithContext(reader);
5756
}
5857
} else {
5958
reader.setCursor(i);
60-
throw Vec3ArgumentType.INCOMPLETE_EXCEPTION.createWithContext(reader);
59+
throw Vec3Argument.ERROR_NOT_COMPLETE.createWithContext(reader);
6160
}
6261

63-
x = coordinateArgument.toAbsoluteCoordinate(mc.player.getX());
64-
y = coordinateArgument2.toAbsoluteCoordinate(mc.player.getY());
65-
z = coordinateArgument3.toAbsoluteCoordinate(mc.player.getZ());
62+
x = coordinateArgument.get(mc.player.getX());
63+
y = coordinateArgument2.get(mc.player.getY());
64+
z = coordinateArgument3.get(mc.player.getZ());
6665

67-
return new Vec3d(x,y,z);
66+
return new Vec3(x,y,z);
6867
}
6968

7069
}

src/main/java/anticope/rejects/arguments/EnumArgumentType.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@
77
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
88
import com.mojang.brigadier.suggestion.Suggestions;
99
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
10-
import net.minecraft.command.CommandSource;
11-
import net.minecraft.text.Text;
12-
1310
import java.lang.reflect.InvocationTargetException;
1411
import java.util.Arrays;
1512
import java.util.concurrent.CompletableFuture;
13+
import net.minecraft.commands.SharedSuggestionProvider;
14+
import net.minecraft.network.chat.Component;
1615

1716
public class EnumArgumentType<T extends Enum<?>> implements ArgumentType<T> {
1817
private static final DynamicCommandExceptionType NO_SUCH_TYPE = new DynamicCommandExceptionType(o ->
19-
Text.literal(o + " is not a valid argument."));
18+
Component.literal(o + " is not a valid argument."));
2019

2120
private T[] values;
2221

@@ -52,6 +51,6 @@ public T parse(StringReader reader) throws CommandSyntaxException {
5251

5352
@Override
5453
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
55-
return CommandSource.suggestMatching(Arrays.stream(values).map(T::toString), builder);
54+
return SharedSuggestionProvider.suggest(Arrays.stream(values).map(T::toString), builder);
5655
}
5756
}

src/main/java/anticope/rejects/arguments/EnumStringArgumentType.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@
77
import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
88
import com.mojang.brigadier.suggestion.Suggestions;
99
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
10-
import net.minecraft.command.CommandSource;
11-
import net.minecraft.text.Text;
12-
1310
import java.util.Collection;
1411
import java.util.concurrent.CompletableFuture;
12+
import net.minecraft.commands.SharedSuggestionProvider;
13+
import net.minecraft.network.chat.Component;
1514

1615
public class EnumStringArgumentType implements ArgumentType<String> {
1716

1817
private Collection<String> EXAMPLES;
1918
private static final DynamicCommandExceptionType INVALID_OPTION = new DynamicCommandExceptionType(name ->
20-
Text.literal(name + " is not a valid option."));
19+
Component.literal(name + " is not a valid option."));
2120
public EnumStringArgumentType(Collection<String> examples) {
2221
this.EXAMPLES = examples;
2322
}
@@ -45,7 +44,7 @@ public String toString() {
4544

4645
@Override
4746
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) {
48-
return CommandSource.suggestMatching(EXAMPLES, builder);
47+
return SharedSuggestionProvider.suggest(EXAMPLES, builder);
4948
}
5049

5150
}

src/main/java/anticope/rejects/commands/CenterCommand.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,31 @@
22

33
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
44
import meteordevelopment.meteorclient.commands.Command;
5-
import net.minecraft.command.CommandSource;
6-
import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket;
7-
import net.minecraft.util.math.MathHelper;
5+
import net.minecraft.commands.SharedSuggestionProvider;
6+
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
7+
import net.minecraft.util.Mth;
88

99
public class CenterCommand extends Command {
1010
public CenterCommand() {
1111
super("center", "Centers the player on a block.");
1212
}
1313

1414
@Override
15-
public void build(LiteralArgumentBuilder<CommandSource> builder) {
15+
public void build(LiteralArgumentBuilder<SharedSuggestionProvider> builder) {
1616
builder.then(literal("middle").executes(context -> {
17-
double x = MathHelper.floor(mc.player.getX()) + 0.5;
18-
double z = MathHelper.floor(mc.player.getZ()) + 0.5;
19-
mc.player.setPosition(x, mc.player.getY(), z);
20-
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
17+
double x = Mth.floor(mc.player.getX()) + 0.5;
18+
double z = Mth.floor(mc.player.getZ()) + 0.5;
19+
mc.player.setPos(x, mc.player.getY(), z);
20+
mc.player.connection.send(new ServerboundMovePlayerPacket.Pos(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.onGround(), mc.player.horizontalCollision));
2121

2222
return SINGLE_SUCCESS;
2323
}));
2424

2525
builder.then(literal("center").executes(context -> {
26-
double x = MathHelper.floor(mc.player.getX());
27-
double z = MathHelper.floor(mc.player.getZ());
28-
mc.player.setPosition(x, mc.player.getY(), z);
29-
mc.player.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.isOnGround(), mc.player.horizontalCollision));
26+
double x = Mth.floor(mc.player.getX());
27+
double z = Mth.floor(mc.player.getZ());
28+
mc.player.setPos(x, mc.player.getY(), z);
29+
mc.player.connection.send(new ServerboundMovePlayerPacket.Pos(mc.player.getX(), mc.player.getY(), mc.player.getZ(), mc.player.onGround(), mc.player.horizontalCollision));
3030

3131
return SINGLE_SUCCESS;
3232
}));

src/main/java/anticope/rejects/commands/ClearChatCommand.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
44
import meteordevelopment.meteorclient.commands.Command;
5-
import net.minecraft.command.CommandSource;
5+
import net.minecraft.commands.SharedSuggestionProvider;
66

77
public class ClearChatCommand extends Command {
88
public ClearChatCommand() {
99
super("clear-chat", "Clears your chat.", "clear", "cls");
1010
}
1111

1212
@Override
13-
public void build(LiteralArgumentBuilder<CommandSource> builder) {
13+
public void build(LiteralArgumentBuilder<SharedSuggestionProvider> builder) {
1414
builder.executes(context -> {
15-
mc.inGameHud.getChatHud().clear(false);
15+
mc.gui.getChat().clearMessages(false);
1616
return SINGLE_SUCCESS;
1717
});
1818
}

0 commit comments

Comments
 (0)