diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/api/client/networking/v1/ClientPlayNetworking.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/api/client/networking/v1/ClientPlayNetworking.java index deb09efba..9a7e9547e 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/api/client/networking/v1/ClientPlayNetworking.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/api/client/networking/v1/ClientPlayNetworking.java @@ -25,6 +25,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.network.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.listener.ServerPlayPacketListener; import net.minecraft.util.Identifier; import net.fabricmc.api.EnvType; @@ -189,7 +190,7 @@ public final class ClientPlayNetworking { * @param buf the packet byte buf which represents the payload of the packet * @return a new packet */ - public static Packet createC2SPacket(Identifier channelName, PacketByteBuf buf) { + public static Packet createC2SPacket(Identifier channelName, PacketByteBuf buf) { Objects.requireNonNull(channelName, "Channel name cannot be null"); Objects.requireNonNull(buf, "Buf cannot be null"); diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientNetworkingImpl.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientNetworkingImpl.java index 8749f1931..4a5ce2ee1 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientNetworkingImpl.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientNetworkingImpl.java @@ -30,6 +30,7 @@ import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.network.ClientConnection; import net.minecraft.network.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.listener.ServerPlayPacketListener; import net.minecraft.network.packet.c2s.play.CustomPayloadC2SPacket; import net.minecraft.util.Identifier; @@ -60,7 +61,7 @@ public final class ClientNetworkingImpl { return (ClientLoginNetworkAddon) ((NetworkHandlerExtensions) handler).getAddon(); } - public static Packet createPlayC2SPacket(Identifier channelName, PacketByteBuf buf) { + public static Packet createPlayC2SPacket(Identifier channelName, PacketByteBuf buf) { return new CustomPayloadC2SPacket(channelName, buf); } diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/ServerPlayNetworking.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/ServerPlayNetworking.java index d4ddb3a73..67589b313 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/ServerPlayNetworking.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/ServerPlayNetworking.java @@ -23,6 +23,7 @@ import org.jetbrains.annotations.Nullable; import net.minecraft.network.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; @@ -203,7 +204,7 @@ public final class ServerPlayNetworking { * @param buf the packet byte buf which represents the payload of the packet * @return a new packet */ - public static Packet createS2CPacket(Identifier channelName, PacketByteBuf buf) { + public static Packet createS2CPacket(Identifier channelName, PacketByteBuf buf) { Objects.requireNonNull(channelName, "Channel cannot be null"); Objects.requireNonNull(buf, "Buf cannot be null"); diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerNetworkingImpl.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerNetworkingImpl.java index c78096a77..d059066f5 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerNetworkingImpl.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerNetworkingImpl.java @@ -18,6 +18,7 @@ package net.fabricmc.fabric.impl.networking.server; import net.minecraft.network.Packet; import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.listener.ClientPlayPacketListener; import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket; import net.minecraft.server.network.ServerLoginNetworkHandler; import net.minecraft.server.network.ServerPlayNetworkHandler; @@ -40,7 +41,7 @@ public final class ServerNetworkingImpl { return (ServerLoginNetworkAddon) ((NetworkHandlerExtensions) handler).getAddon(); } - public static Packet createPlayC2SPacket(Identifier channel, PacketByteBuf buf) { + public static Packet createPlayC2SPacket(Identifier channel, PacketByteBuf buf) { return new CustomPayloadS2CPacket(channel, buf); } }