Skip to content

Commit

Permalink
update to 1.21 (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
granny authored Jun 17, 2024
1 parent 9618ece commit b52a609
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Maven
<dependency>
<groupId>maven.modrinth</groupId>
<artifactId>pl3xmap</artifactId>
<version>1.20.6-493</version>
<version>1.21-500</version>
<scope>provided</scope>
</dependency>
```
Expand All @@ -101,7 +101,7 @@ repositories {
}
dependencies {
compileOnly 'maven.modrinth:pl3xmap:1.20.6-493'
compileOnly 'maven.modrinth:pl3xmap:1.21-500'
}
```

Expand Down
2 changes: 1 addition & 1 deletion bukkit/src/main/java/net/pl3x/map/bukkit/Pl3xMapImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public int getColorForPower(byte power) {
@Override
public net.pl3x.map.core.world.@Nullable Block getFlower(@NotNull World world, net.pl3x.map.core.world.@NotNull Biome biome, int blockX, int blockY, int blockZ) {
// https://github.com/Draradech/FlowerMap (CC0-1.0 license)
Biome nms = world.<ServerLevel>getLevel().registryAccess().registryOrThrow(Registries.BIOME).get(new ResourceLocation(biome.getKey()));
Biome nms = world.<ServerLevel>getLevel().registryAccess().registryOrThrow(Registries.BIOME).get(ResourceLocation.parse(biome.getKey()));
if (nms == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public record ClientboundMapPayload(int protocol, int response, int mapId, byte scale, int centerX, int centerZ, String worldName) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ClientboundMapPayload> STREAM_CODEC = CustomPacketPayload.codec(ClientboundMapPayload::write, ClientboundMapPayload::new);
public static final Type<ClientboundMapPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "client_map_data"));
public static final Type<ClientboundMapPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "client_map_data"));

public ClientboundMapPayload(int protocol, int response, int mapId) {
this(protocol, response, mapId, (byte) 0, 0, 0, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public record ClientboundServerPayload(int protocol, int response, String webAddress) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ClientboundServerPayload> STREAM_CODEC = CustomPacketPayload.codec(ClientboundServerPayload::write, ClientboundServerPayload::new);
public static final Type<ClientboundServerPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "client_server_data"));
public static final Type<ClientboundServerPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "client_server_data"));

public ClientboundServerPayload(int protocol, int response) {
this(protocol, response, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public record ServerboundMapPayload(int protocol, int mapId) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ServerboundMapPayload> STREAM_CODEC = CustomPacketPayload.codec(ServerboundMapPayload::write, ServerboundMapPayload::new);
public static final Type<ServerboundMapPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "server_map_data"));
public static final Type<ServerboundMapPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "server_map_data"));

public ServerboundMapPayload(int mapId) {
this(Constants.PROTOCOL, mapId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public record ServerboundServerPayload(int protocol) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ServerboundServerPayload> STREAM_CODEC = CustomPacketPayload.codec(ServerboundServerPayload::write, ServerboundServerPayload::new);
public static final Type<ServerboundServerPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "server_server_data"));
public static final Type<ServerboundServerPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "server_server_data"));

public ServerboundServerPayload(FriendlyByteBuf friendlyByteBuf) {
this(friendlyByteBuf.readInt());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import org.jetbrains.annotations.NotNull;

public class NetworkManager {
private final ResourceLocation channel = new ResourceLocation(Constants.MODID, Constants.MODID);
private final ResourceLocation channel = ResourceLocation.fromNamespaceAndPath(Constants.MODID, Constants.MODID);
private final Pl3xMapFabricClient mod;

public NetworkManager(@NotNull Pl3xMapFabricClient mod) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public record ClientboundMapPayload(int protocol, int response, int mapId, byte scale, int centerX, int centerZ, String worldName) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ClientboundMapPayload> STREAM_CODEC = CustomPacketPayload.codec(ClientboundMapPayload::write, ClientboundMapPayload::new);
public static final Type<ClientboundMapPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "client_map_data"));
public static final Type<ClientboundMapPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "client_map_data"));

public ClientboundMapPayload(int protocol, int response, int mapId) {
this(protocol, response, mapId, (byte) 0, 0, 0, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public record ClientboundServerPayload(int protocol, int response, String webAddress) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ClientboundServerPayload> STREAM_CODEC = CustomPacketPayload.codec(ClientboundServerPayload::write, ClientboundServerPayload::new);
public static final Type<ClientboundServerPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "client_server_data"));
public static final Type<ClientboundServerPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "client_server_data"));

public ClientboundServerPayload(int protocol, int response) {
this(protocol, response, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public record ServerboundMapPayload(int protocol, int mapId) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ServerboundMapPayload> STREAM_CODEC = CustomPacketPayload.codec(ServerboundMapPayload::write, ServerboundMapPayload::new);
public static final Type<ServerboundMapPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "server_map_data"));
public static final Type<ServerboundMapPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "server_map_data"));

public ServerboundMapPayload(int mapId) {
this(Constants.PROTOCOL, mapId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public record ServerboundServerPayload(int protocol) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ServerboundServerPayload> STREAM_CODEC = CustomPacketPayload.codec(ServerboundServerPayload::write, ServerboundServerPayload::new);
public static final Type<ServerboundServerPayload> TYPE = new Type<>(new ResourceLocation(Constants.MODID, "server_server_data"));
public static final Type<ServerboundServerPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath(Constants.MODID, "server_server_data"));

public ServerboundServerPayload(FriendlyByteBuf friendlyByteBuf) {
this(friendlyByteBuf.readInt());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public int getColorForPower(byte power) {
@Override
public net.pl3x.map.core.world.@Nullable Block getFlower(@NotNull World world, net.pl3x.map.core.world.@NotNull Biome biome, int blockX, int blockY, int blockZ) {
// https://github.com/Draradech/FlowerMap (CC0-1.0 license)
Biome nms = world.<ServerLevel>getLevel().registryAccess().registryOrThrow(Registries.BIOME).get(new ResourceLocation(biome.getKey()));
Biome nms = world.<ServerLevel>getLevel().registryAccess().registryOrThrow(Registries.BIOME).get(ResourceLocation.parse(biome.getKey()));
if (nms == null) {
return null;
}
Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[versions]
bukkit="1.20.6-R0.1-SNAPSHOT"
bukkit="1.21-R0.1-SNAPSHOT"

fabricApi="0.97.8+1.20.6"
fabricLoader="0.15.10"
fabricApi="0.100.1+1.21"
fabricLoader="0.15.11"
fabricLoom="1.6-SNAPSHOT"

forge="1.20.2-48.0.6"
forgeGradle="[6.0,6.2)"
forgeLoader="[48,)"

minecraft="1.20.6"
minecraft="1.21"
minotaur="2.+"
paperweight="1.7.1"
indra-git="2.1.1"
shadowJar="8.1.7"

adventure="4.17.0-SNAPSHOT"
adventure="4.18.0-SNAPSHOT"
adventureBukkit="4.3.3-SNAPSHOT"
adventureFabric="5.13.1-SNAPSHOT"
adventureFabric="5.14.0-SNAPSHOT"

caffeine="3.1.8"
cloud="2.0.0-SNAPSHOT"
Expand Down

0 comments on commit b52a609

Please sign in to comment.