diff --git a/build.gradle.kts b/build.gradle.kts index e6045a5..2f31d2f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,12 +14,12 @@ loom { dependencies { //to change the versions see the gradle.properties file - minecraft("com.mojang:minecraft:1.20.5") + minecraft("com.mojang:minecraft:1.21") mappings(loom.officialMojangMappings()) - modImplementation("net.fabricmc:fabric-loader:0.15.10") + modImplementation("net.fabricmc:fabric-loader:0.15.11") // Fabric API. This is technically optional, but you probably want it anyway. - modImplementation("net.fabricmc.fabric-api:fabric-api:0.97.6+1.20.5") + modImplementation("net.fabricmc.fabric-api:fabric-api:0.100.1+1.21") // Base Floodgate implementation("org.geysermc.floodgate:core:2.2.3-20240508.151752-4") diff --git a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/FormPayload.java b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/FormPayload.java index 132e39b..6ab4add 100644 --- a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/FormPayload.java +++ b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/FormPayload.java @@ -3,11 +3,12 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; import org.checkerframework.checker.nullness.qual.NonNull; public record FormPayload(byte[] data) implements CustomPacketPayload { public static final StreamCodec STREAM_CODEC = CustomPacketPayload.codec(FormPayload::write, FormPayload::new); - public static final CustomPacketPayload.Type TYPE = CustomPacketPayload.createType("floodgate:form"); + public static final CustomPacketPayload.Type TYPE = new Type<>(ResourceLocation.parse("floodgate:form")); private FormPayload(FriendlyByteBuf friendlyByteBuf) { this(friendlyByteBuf.readByteArray()); @@ -17,11 +18,8 @@ private void write(FriendlyByteBuf friendlyByteBuf) { friendlyByteBuf.writeByteArray(this.data); } + @Override public CustomPacketPayload.@NonNull Type type() { return TYPE; } - - public byte[] data() { - return this.data; - } } \ No newline at end of file diff --git a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/PacketPayload.java b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/PacketPayload.java index 89276b5..08bc2c6 100644 --- a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/PacketPayload.java +++ b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/PacketPayload.java @@ -3,11 +3,12 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; import org.checkerframework.checker.nullness.qual.NonNull; public record PacketPayload(byte[] data) implements CustomPacketPayload { public static final StreamCodec STREAM_CODEC = CustomPacketPayload.codec(PacketPayload::write, PacketPayload::new); - public static final CustomPacketPayload.Type TYPE = CustomPacketPayload.createType("floodgate:packet"); + public static final CustomPacketPayload.Type TYPE = new Type<>(ResourceLocation.parse("floodgate:packet")); private PacketPayload(FriendlyByteBuf friendlyByteBuf) { this(friendlyByteBuf.readByteArray()); @@ -17,11 +18,8 @@ private void write(FriendlyByteBuf friendlyByteBuf) { friendlyByteBuf.writeByteArray(this.data); } + @Override public CustomPacketPayload.@NonNull Type type() { return TYPE; } - - public byte[] data() { - return this.data; - } } \ No newline at end of file diff --git a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/SkinPayload.java b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/SkinPayload.java index a2507e5..900f00c 100644 --- a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/SkinPayload.java +++ b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/SkinPayload.java @@ -3,11 +3,12 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; import org.checkerframework.checker.nullness.qual.NonNull; public record SkinPayload(byte[] data) implements CustomPacketPayload { public static final StreamCodec STREAM_CODEC = CustomPacketPayload.codec(SkinPayload::write, SkinPayload::new); - public static final CustomPacketPayload.Type TYPE = CustomPacketPayload.createType("floodgate:skin"); + public static final CustomPacketPayload.Type TYPE = new Type<>(ResourceLocation.parse("floodgate:skin")); private SkinPayload(FriendlyByteBuf friendlyByteBuf) { this(friendlyByteBuf.readByteArray()); @@ -17,11 +18,8 @@ private void write(FriendlyByteBuf friendlyByteBuf) { friendlyByteBuf.writeByteArray(this.data); } + @Override public CustomPacketPayload.@NonNull Type type() { return TYPE; } - - public byte[] data() { - return this.data; - } } \ No newline at end of file diff --git a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/TransferPayload.java b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/TransferPayload.java index b291b92..5c16b79 100644 --- a/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/TransferPayload.java +++ b/src/main/java/org/geysermc/floodgate/pluginmessage/payloads/TransferPayload.java @@ -3,11 +3,12 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.common.custom.CustomPacketPayload; +import net.minecraft.resources.ResourceLocation; import org.checkerframework.checker.nullness.qual.NonNull; public record TransferPayload(byte[] data) implements CustomPacketPayload { public static final StreamCodec STREAM_CODEC = CustomPacketPayload.codec(TransferPayload::write, TransferPayload::new); - public static final CustomPacketPayload.Type TYPE = CustomPacketPayload.createType("floodgate:transfer"); + public static final CustomPacketPayload.Type TYPE = new Type<>(ResourceLocation.parse("floodgate:transfer")); private TransferPayload(FriendlyByteBuf friendlyByteBuf) { this(friendlyByteBuf.readByteArray()); @@ -17,11 +18,8 @@ private void write(FriendlyByteBuf friendlyByteBuf) { friendlyByteBuf.writeByteArray(this.data); } + @Override public CustomPacketPayload.@NonNull Type type() { return TYPE; } - - public byte[] data() { - return this.data; - } } \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index bdca63a..24b3009 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -24,8 +24,8 @@ "floodgate.mixins.json" ], "depends": { - "fabricloader": ">=0.15.10", + "fabricloader": ">=0.15.11", "fabric": "*", - "minecraft": ">=1.20.5" + "minecraft": ">=1.21" } } \ No newline at end of file diff --git a/src/main/resources/floodgate.mixins.json b/src/main/resources/floodgate.mixins.json index ca2c72e..ded3017 100644 --- a/src/main/resources/floodgate.mixins.json +++ b/src/main/resources/floodgate.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "org.geysermc.floodgate.mixin", - "compatibilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_21", "mixins": [ "ChunkMapMixin", "ClientIntentionPacketMixin",