Skip to content

Commit fe23dbf

Browse files
authored
Build against 1.21.3 (#67)
This makes the RegistryEntryParser break on older versions on NeoForge Should still work on fabric due to intermediary
1 parent 5173250 commit fe23dbf

3 files changed

Lines changed: 15 additions & 10 deletions

File tree

cloud-fabric/src/testmod/java/org/incendo/cloud/fabric/testmod/FabricExample.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import net.minecraft.ChatFormatting;
4242
import net.minecraft.commands.CommandSourceStack;
4343
import net.minecraft.commands.arguments.item.ItemInput;
44+
import net.minecraft.core.BlockPos;
4445
import net.minecraft.core.registries.Registries;
4546
import net.minecraft.network.chat.ClickEvent;
4647
import net.minecraft.network.chat.Component;
@@ -49,6 +50,7 @@
4950
import net.minecraft.network.chat.MutableComponent;
5051
import net.minecraft.network.chat.TextColor;
5152
import net.minecraft.server.level.ServerPlayer;
53+
import net.minecraft.util.Mth;
5254
import net.minecraft.world.level.ChunkPos;
5355
import net.minecraft.world.level.biome.Biome;
5456
import net.minecraft.world.phys.Vec3;
@@ -121,7 +123,7 @@ public void onInitialize() {
121123
ctx.sender().sendSuccess(() -> Component.literal("Yes, the biome ")
122124
.append(Component.literal(
123125
ctx.sender().registryAccess()
124-
.registryOrThrow(Registries.BIOME)
126+
.lookupOrThrow(Registries.BIOME)
125127
.getKey(ctx.get("biome")).toString())
126128
.withStyle(ChatFormatting.DARK_PURPLE, ChatFormatting.BOLD))
127129
.append(Component.literal(" is pretty cool"))
@@ -269,8 +271,10 @@ public void onInitialize() {
269271
.handler(ctx -> {
270272
final MultipleEntitySelector selector = ctx.get("targets");
271273
final Vec3 location = ctx.<Coordinates>get("location").position();
272-
selector.values().forEach(target ->
273-
target.teleportToWithTicket(location.x(), location.y(), location.z()));
274+
selector.values().forEach(target -> {
275+
target.placePortalTicket(new BlockPos(Mth.floor(location.x()), Mth.floor(location.y()), Mth.floor(location.z())));
276+
target.teleportTo(location.x(), location.y(), location.z());
277+
});
274278
}));
275279

276280
manager.command(base.literal("signed")
@@ -309,7 +313,8 @@ public void onInitialize() {
309313
}
310314
final Vec3 vec = ctx.<ColumnCoordinates>get("chunk_position").position();
311315
final ChunkPos pos = new ChunkPos((int) vec.x(), (int) vec.z());
312-
player.teleportToWithTicket(pos.getMinBlockX(), 128, pos.getMinBlockZ());
316+
player.placePortalTicket(new BlockPos(pos.getMinBlockX(), 128, pos.getMinBlockZ()));
317+
player.teleportTo(pos.getMinBlockX(), 128, pos.getMinBlockZ());
313318
}));
314319
}
315320
}

cloud-minecraft-modded-common/src/main/java/org/incendo/cloud/minecraft/modded/parser/RegistryEntryParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public RegistryEntryParser(
136136
return ArgumentParseResult.failure(new IllegalArgumentException("Unknown registry " + this.registryIdent));
137137
}
138138

139-
final V entry = registry.get(key);
139+
final V entry = registry.getValue(key);
140140
if (entry == null) {
141141
return ArgumentParseResult.failure(new UnknownEntryException(commandContext, key, this.registryIdent));
142142
}
@@ -146,7 +146,7 @@ public RegistryEntryParser(
146146

147147
private Registry<V> resolveRegistry(final CommandContext<C> ctx) {
148148
final SharedSuggestionProvider reverseMapped = ctx.get(ModdedCommandContextKeys.SHARED_SUGGESTION_PROVIDER);
149-
return reverseMapped.registryAccess().registry(this.registryIdent).orElse(null);
149+
return reverseMapped.registryAccess().lookup(this.registryIdent).orElse(null);
150150
}
151151

152152
@Override

gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ cloudMinecraft = "2.0.0-beta.10"
1010

1111
immutables = "2.10.1"
1212

13-
minecraft = "1.20.6"
13+
minecraft = "1.21.3"
1414
fabricLoader = "0.16.9"
15-
fabricApi = "0.100.8+1.20.6"
16-
fabricPermissionsApi = "0.3.1"
15+
fabricApi = "0.110.0+1.21.3"
16+
fabricPermissionsApi = "0.3.3"
1717

1818
[libraries]
1919
cloud-build-logic = { module = "org.incendo:cloud-build-logic", version.ref = "cloud-build-logic" }
@@ -39,7 +39,7 @@ fabricApi-networking-api-v1 = { module = "net.fabricmc.fabric-api:fabric-network
3939
fabricApi-lifecycle-events-v1 = { module = "net.fabricmc.fabric-api:fabric-lifecycle-events-v1" }
4040
fabricPermissionsApi = { group = "me.lucko", name = "fabric-permissions-api", version.ref = "fabricPermissionsApi" }
4141

42-
neoForge = "net.neoforged:neoforge:20.6.121"
42+
neoForge = "net.neoforged:neoforge:21.3.56"
4343

4444
[plugins]
4545
cloud-buildLogic-spotless = { id = "org.incendo.cloud-build-logic.spotless", version.ref = "cloud-build-logic" }

0 commit comments

Comments
 (0)