Skip to content

Commit

Permalink
Update to support 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
ConnorLinfoot committed Jul 8, 2024
1 parent 6da96a1 commit f29b5c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.5
yarn_mappings=1.20.5+build.1
loader_version=0.15.10
minecraft_version=1.21
yarn_mappings=1.21+build.1
loader_version=0.15.11

# Mod Properties
mod_version = 1.0+build.1
Expand All @@ -15,4 +15,4 @@ org.gradle.jvmargs=-Xmx1G

# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.97.8+1.20.6
fabric_version=0.100.1+1.21
5 changes: 3 additions & 2 deletions src/main/java/net/hypixel/modapi/fabric/FabricModAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;

public class FabricModAPI implements ClientModInitializer {
Expand Down Expand Up @@ -70,7 +71,7 @@ private static void registerPacketSender() {

private static void registerClientbound(String identifier) {
try {
CustomPayload.Id<ClientboundHypixelPayload> clientboundId = CustomPayload.id(identifier);
CustomPayload.Id<ClientboundHypixelPayload> clientboundId = new CustomPayload.Id<>(Identifier.of(identifier));
PacketCodec<PacketByteBuf, ClientboundHypixelPayload> codec = ClientboundHypixelPayload.buildCodec(clientboundId);
PayloadTypeRegistry.playS2C().register(clientboundId, codec);
PayloadTypeRegistry.configurationS2C().register(clientboundId, codec);
Expand Down Expand Up @@ -111,7 +112,7 @@ private static void handleIncomingPayload(String identifier, ClientboundHypixelP

private static void registerServerbound(String identifier) {
try {
CustomPayload.Id<ServerboundHypixelPayload> serverboundId = CustomPayload.id(identifier);
CustomPayload.Id<ServerboundHypixelPayload> serverboundId = new CustomPayload.Id<>(Identifier.of(identifier));
PacketCodec<PacketByteBuf, ServerboundHypixelPayload> codec = ServerboundHypixelPayload.buildCodec(serverboundId);
PayloadTypeRegistry.playC2S().register(serverboundId, codec);
PayloadTypeRegistry.configurationC2S().register(serverboundId, codec);
Expand Down

0 comments on commit f29b5c9

Please sign in to comment.