From 186cc2ef8ba322ac02e50c28320bb0cf33163926 Mon Sep 17 00:00:00 2001 From: modmuss Date: Tue, 7 May 2024 19:03:52 +0100 Subject: [PATCH] Don't enforce a RegistryByteBuf packet code for the extended screen handler type (#3743) (cherry picked from commit 8c7b71c2c5de9da16e5b9d08529700f3738b4698) --- .../api/screenhandler/v1/ExtendedScreenHandlerType.java | 6 +++--- .../net/fabricmc/fabric/impl/screenhandler/Networking.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/api/screenhandler/v1/ExtendedScreenHandlerType.java b/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/api/screenhandler/v1/ExtendedScreenHandlerType.java index f61be3e43..cb27f9859 100644 --- a/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/api/screenhandler/v1/ExtendedScreenHandlerType.java +++ b/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/api/screenhandler/v1/ExtendedScreenHandlerType.java @@ -74,14 +74,14 @@ import net.minecraft.screen.ScreenHandlerType; */ public class ExtendedScreenHandlerType extends ScreenHandlerType { private final ExtendedFactory factory; - private final PacketCodec packetCodec; + private final PacketCodec packetCodec; /** * Constructs an extended screen handler type. * * @param factory the screen handler factory used for {@link #create(int, PlayerInventory, Object)} */ - public ExtendedScreenHandlerType(ExtendedFactory factory, PacketCodec packetCodec) { + public ExtendedScreenHandlerType(ExtendedFactory factory, PacketCodec packetCodec) { super(null, FeatureFlags.VANILLA_FEATURES); this.factory = Objects.requireNonNull(factory, "screen handler factory cannot be null"); this.packetCodec = Objects.requireNonNull(packetCodec, "packet codec cannot be null"); @@ -112,7 +112,7 @@ public class ExtendedScreenHandlerType extends Scree /** * @return the packet codec for serializing the data of this screen handler */ - public PacketCodec getPacketCodec() { + public PacketCodec getPacketCodec() { return packetCodec; } diff --git a/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/impl/screenhandler/Networking.java b/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/impl/screenhandler/Networking.java index 44377f8a7..42bc91e59 100644 --- a/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/impl/screenhandler/Networking.java +++ b/fabric-screen-handler-api-v1/src/main/java/net/fabricmc/fabric/impl/screenhandler/Networking.java @@ -51,7 +51,7 @@ public final class Networking implements ModInitializer { // title: text // customData: buf public static final Identifier OPEN_ID = new Identifier("fabric-screen-handler-api-v1", "open_screen"); - public static final Map> CODEC_BY_ID = new HashMap<>(); + public static final Map> CODEC_BY_ID = new HashMap<>(); /** * Opens an extended screen handler by sending a custom packet to the client.