diff --git a/fabric-gametest-api-v1/src/main/java/net/fabricmc/fabric/mixin/gametest/server/MainMixin.java b/fabric-gametest-api-v1/src/main/java/net/fabricmc/fabric/mixin/gametest/server/MainMixin.java index d9498d8d49..42282b5166 100644 --- a/fabric-gametest-api-v1/src/main/java/net/fabricmc/fabric/mixin/gametest/server/MainMixin.java +++ b/fabric-gametest-api-v1/src/main/java/net/fabricmc/fabric/mixin/gametest/server/MainMixin.java @@ -47,8 +47,8 @@ private static boolean isEulaAgreedTo(EulaReader reader) { } // Inject after resourcePackManager is stored - @Inject(method = "main", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", shift = At.Shift.BY, by = 2, target = "Lnet/minecraft/resource/VanillaDataPackProvider;createManager(Ljava/nio/file/Path;)Lnet/minecraft/resource/ResourcePackManager;")) - private static void main(String[] args, CallbackInfo info, OptionParser optionParser, OptionSpec optionSpec, OptionSpec optionSpec2, OptionSpec optionSpec3, OptionSpec optionSpec4, OptionSpec optionSpec5, OptionSpec optionSpec6, OptionSpec optionSpec7, OptionSpec optionSpec8, OptionSpec optionSpec9, OptionSpec optionSpec10, OptionSpec optionSpec11, OptionSpec optionSpec12, OptionSpec optionSpec13, OptionSpec optionSpec14, OptionSpec optionSpec15, OptionSpec optionSpec16, OptionSet optionSet, Path path2, ServerPropertiesLoader serverPropertiesLoader, Path path3, EulaReader eulaReader, File file, ApiServices apiServices, String string, LevelStorage levelStorage, LevelStorage.Session session, LevelSummary levelSummary, boolean bl, ResourcePackManager resourcePackManager) { + @Inject(method = "main", cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", shift = At.Shift.BY, by = 2, target = "Lnet/minecraft/resource/VanillaDataPackProvider;createManager(Lnet/minecraft/world/level/storage/LevelStorage$Session;)Lnet/minecraft/resource/ResourcePackManager;")) + private static void main(String[] args, CallbackInfo info, OptionParser optionParser, OptionSpec optionSpec, OptionSpec optionSpec2, OptionSpec optionSpec3, OptionSpec optionSpec4, OptionSpec optionSpec5, OptionSpec optionSpec6, OptionSpec optionSpec7, OptionSpec optionSpec8, OptionSpec optionSpec9, OptionSpec optionSpec10, OptionSpec optionSpec11, OptionSpec optionSpec12, OptionSpec optionSpec13, OptionSpec optionSpec14, OptionSpec optionSpec15, OptionSet optionSet, Path path2, ServerPropertiesLoader serverPropertiesLoader, Path path3, EulaReader eulaReader, File file, ApiServices apiServices, String string, LevelStorage levelStorage, LevelStorage.Session session, LevelSummary levelSummary, boolean bl, ResourcePackManager resourcePackManager) { if (FabricGameTestHelper.ENABLED) { FabricGameTestHelper.runHeadlessServer(session, resourcePackManager); info.cancel(); // Do not progress in starting the normal dedicated server diff --git a/fabric-lifecycle-events-v1/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/PlayerManagerMixin.java b/fabric-lifecycle-events-v1/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/PlayerManagerMixin.java index d9bd77f952..6168affe6e 100644 --- a/fabric-lifecycle-events-v1/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/PlayerManagerMixin.java +++ b/fabric-lifecycle-events-v1/src/main/java/net/fabricmc/fabric/mixin/event/lifecycle/PlayerManagerMixin.java @@ -33,13 +33,13 @@ public class PlayerManagerMixin { method = "onPlayerConnect", at = @At(value = "INVOKE", target = "net/minecraft/network/packet/s2c/play/SynchronizeRecipesS2CPacket.(Ljava/util/Collection;)V") ) - private void hookOnPlayerConnect(ClientConnection connection, ServerPlayerEntity player, CallbackInfo ci) { + private void hookOnPlayerConnect(ClientConnection connection, ServerPlayerEntity player, int latency, CallbackInfo ci) { ServerLifecycleEvents.SYNC_DATA_PACK_CONTENTS.invoker().onSyncDataPackContents(player, true); } @Inject( method = "onDataPacksReloaded", - at = @At(value = "INVOKE", target = "net/minecraft/network/packet/s2c/play/SynchronizeTagsS2CPacket.(Ljava/util/Map;)V") + at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/s2c/common/SynchronizeTagsS2CPacket;(Ljava/util/Map;)V") ) private void hookOnDataPacksReloaded(CallbackInfo ci) { for (ServerPlayerEntity player : ((PlayerManager) (Object) this).getPlayerList()) { diff --git a/fabric-networking-api-v1/build.gradle b/fabric-networking-api-v1/build.gradle index ebd647d6c8..a66181f704 100644 --- a/fabric-networking-api-v1/build.gradle +++ b/fabric-networking-api-v1/build.gradle @@ -7,3 +7,7 @@ testDependencies(project, [ ':fabric-lifecycle-events-v1', ':fabric-key-binding-api-v1' ]) + +loom { + accessWidenerPath = file('src/main/resources/fabric-networking-api-v1.accesswidener') +} diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java index bb16ac2ce1..80bb1fb1fe 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientLoginNetworkAddon.java @@ -35,11 +35,10 @@ import net.fabricmc.fabric.api.client.networking.v1.ClientLoginConnectionEvents; import net.fabricmc.fabric.api.client.networking.v1.ClientLoginNetworking; import net.fabricmc.fabric.api.networking.v1.FutureListeners; -import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; import net.fabricmc.fabric.impl.networking.AbstractNetworkAddon; import net.fabricmc.fabric.impl.networking.GenericFutureListenerHolder; -import net.fabricmc.fabric.impl.networking.PacketByteBufLoginQueryRequestPayload; -import net.fabricmc.fabric.impl.networking.PacketByteBufLoginQueryResponse; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryRequestPayload; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryResponse; import net.fabricmc.fabric.mixin.networking.client.accessor.ClientLoginNetworkHandlerAccessor; public final class ClientLoginNetworkAddon extends AbstractNetworkAddon { @@ -61,7 +60,7 @@ public boolean handlePacket(LoginQueryRequestS2CPacket packet) { return handlePacket(packet.queryId(), packet.payload().id(), payload.data()); } - private boolean handlePacket(int queryId, Identifier channelName, PacketByteBuf originalBuf) { + private boolean handlePacket(int queryId, Identifier channelName, PacketByteBuf buf) { this.logger.debug("Handling inbound login response with id {} and channel with name {}", queryId, channelName); if (this.firstResponse) { @@ -80,7 +79,7 @@ private boolean handlePacket(int queryId, Identifier channelName, PacketByteBuf return false; } - PacketByteBuf buf = PacketByteBufs.slice(originalBuf); +// PacketByteBuf buf = PacketByteBufs.slice(originalBuf); List>> futureListeners = new ArrayList<>(); try { 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 d6c91e9d55..7c1ab95f34 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 @@ -42,7 +42,7 @@ import net.fabricmc.fabric.impl.networking.GlobalReceiverRegistry; import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions; import net.fabricmc.fabric.impl.networking.NetworkingImpl; -import net.fabricmc.fabric.impl.networking.PacketByteBufPayload; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; import net.fabricmc.fabric.mixin.networking.client.accessor.ClientLoginNetworkHandlerAccessor; import net.fabricmc.fabric.mixin.networking.client.accessor.ConnectScreenAccessor; import net.fabricmc.fabric.mixin.networking.client.accessor.MinecraftClientAccessor; diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientPlayNetworkAddon.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientPlayNetworkAddon.java index d12a54ffb7..55735a4451 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientPlayNetworkAddon.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/impl/networking/client/ClientPlayNetworkAddon.java @@ -35,7 +35,7 @@ import net.fabricmc.fabric.impl.networking.AbstractChanneledNetworkAddon; import net.fabricmc.fabric.impl.networking.ChannelInfoHolder; import net.fabricmc.fabric.impl.networking.NetworkingImpl; -import net.fabricmc.fabric.impl.networking.PacketByteBufPayload; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; public final class ClientPlayNetworkAddon extends AbstractChanneledNetworkAddon { private final ClientPlayNetworkHandler handler; diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientCommonNetworkHandlerMixin.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientCommonNetworkHandlerMixin.java index 88d25e3c1a..b0c5f86525 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientCommonNetworkHandlerMixin.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientCommonNetworkHandlerMixin.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package net.fabricmc.fabric.mixin.networking.client; import org.spongepowered.asm.mixin.Mixin; diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientLoginNetworkHandlerMixin.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientLoginNetworkHandlerMixin.java index fed93e0a79..0ee6d52107 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientLoginNetworkHandlerMixin.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientLoginNetworkHandlerMixin.java @@ -31,6 +31,7 @@ import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions; import net.fabricmc.fabric.impl.networking.client.ClientLoginNetworkAddon; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryRequestPayload; @Mixin(ClientLoginNetworkHandler.class) abstract class ClientLoginNetworkHandlerMixin implements NetworkHandlerExtensions { @@ -48,8 +49,12 @@ private void initAddon(CallbackInfo ci) { @Inject(method = "onQueryRequest", at = @At(value = "INVOKE", target = "Ljava/util/function/Consumer;accept(Ljava/lang/Object;)V", remap = false, shift = At.Shift.AFTER), cancellable = true) private void handleQueryRequest(LoginQueryRequestS2CPacket packet, CallbackInfo ci) { - if (this.addon.handlePacket(packet)) { - ci.cancel(); + if (packet.payload() instanceof PacketByteBufLoginQueryRequestPayload payload) { + if (this.addon.handlePacket(packet)) { + ci.cancel(); + } else { + payload.data().skipBytes(payload.data().readableBytes()); + } } } diff --git a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientPlayNetworkHandlerMixin.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientPlayNetworkHandlerMixin.java index 0c0dcb4a14..b724cb086e 100644 --- a/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientPlayNetworkHandlerMixin.java +++ b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/mixin/networking/client/ClientPlayNetworkHandlerMixin.java @@ -31,7 +31,7 @@ import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions; -import net.fabricmc.fabric.impl.networking.PacketByteBufPayload; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; import net.fabricmc.fabric.impl.networking.client.ClientNetworkingImpl; import net.fabricmc.fabric.impl.networking.client.ClientPlayNetworkAddon; @@ -60,8 +60,12 @@ private void handleServerPlayReady(GameJoinS2CPacket packet, CallbackInfo ci) { @Inject(method = "onCustomPayload", at = @At("HEAD"), cancellable = true) private void handleCustomPayload(CustomPayload payload, CallbackInfo ci) { - if (payload instanceof PacketByteBufPayload byteBufPayload && this.addon.handle(byteBufPayload)) { - ci.cancel(); + if (payload instanceof PacketByteBufPayload byteBufPayload) { + if (this.addon.handle(byteBufPayload)) { + ci.cancel(); + } else { + byteBufPayload.data().skipBytes(byteBufPayload.data().readableBytes()); + } } } diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/LoginQueryRequestS2CPacketFactory.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/LoginQueryRequestS2CPacketFactory.java new file mode 100644 index 0000000000..31a89bc384 --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/LoginQueryRequestS2CPacketFactory.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.impl.networking; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.s2c.login.LoginQueryRequestPayload; +import net.minecraft.network.packet.s2c.login.LoginQueryRequestS2CPacket; +import net.minecraft.util.Identifier; + +import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryRequestPayload; + +public class LoginQueryRequestS2CPacketFactory { + public static LoginQueryRequestS2CPacket create(PacketByteBuf buf) { + return new LoginQueryRequestS2CPacket(buf.readVarInt(), readPayload(buf.readIdentifier(), buf)); + } + + private static LoginQueryRequestPayload readPayload(Identifier id, PacketByteBuf buf) { + PacketByteBuf copy = PacketByteBufs.copy(buf); + buf.skipBytes(buf.readableBytes()); + return new PacketByteBufLoginQueryRequestPayload(id, copy); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufLoginQueryRequestPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufLoginQueryRequestPayload.java deleted file mode 100644 index c87e559d35..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufLoginQueryRequestPayload.java +++ /dev/null @@ -1,12 +0,0 @@ -package net.fabricmc.fabric.impl.networking; - -import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.s2c.login.LoginQueryRequestPayload; -import net.minecraft.util.Identifier; - -public record PacketByteBufLoginQueryRequestPayload(Identifier id, PacketByteBuf data) implements LoginQueryRequestPayload { - @Override - public void write(PacketByteBuf buf) { - buf.writeBytes(this.data()); - } -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufLoginQueryResponse.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufLoginQueryResponse.java deleted file mode 100644 index 2741677324..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufLoginQueryResponse.java +++ /dev/null @@ -1,11 +0,0 @@ -package net.fabricmc.fabric.impl.networking; - -import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.c2s.login.LoginQueryResponse; - -public record PacketByteBufLoginQueryResponse(PacketByteBuf data) implements LoginQueryResponse { - @Override - public void write(PacketByteBuf buf) { - buf.writeBytes(this.data()); - } -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufPayload.java deleted file mode 100644 index abdd4e8787..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/PacketByteBufPayload.java +++ /dev/null @@ -1,12 +0,0 @@ -package net.fabricmc.fabric.impl.networking; - -import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.CustomPayload; -import net.minecraft.util.Identifier; - -public record PacketByteBufPayload(Identifier id, PacketByteBuf data) implements CustomPayload { - @Override - public void write(PacketByteBuf buf) { - buf.writeBytes(this.data()); - } -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufLoginQueryRequestPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufLoginQueryRequestPayload.java new file mode 100644 index 0000000000..95fa6c3ea7 --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufLoginQueryRequestPayload.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.impl.networking.payload; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.s2c.login.LoginQueryRequestPayload; +import net.minecraft.util.Identifier; + +public record PacketByteBufLoginQueryRequestPayload(Identifier id, PacketByteBuf data) implements LoginQueryRequestPayload { + @Override + public void write(PacketByteBuf buf) { + buf.writeBytes(this.data()); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufLoginQueryResponse.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufLoginQueryResponse.java new file mode 100644 index 0000000000..c3fe21dbae --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufLoginQueryResponse.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.impl.networking.payload; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.c2s.login.LoginQueryResponse; + +public record PacketByteBufLoginQueryResponse(PacketByteBuf data) implements LoginQueryResponse { + @Override + public void write(PacketByteBuf buf) { + buf.writeBytes(this.data()); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufPayload.java new file mode 100644 index 0000000000..5a9890698b --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PacketByteBufPayload.java @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.impl.networking.payload; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.CustomPayload; +import net.minecraft.util.Identifier; + +public record PacketByteBufPayload(Identifier id, PacketByteBuf data) implements CustomPayload { + @Override + public void write(PacketByteBuf buf) { + buf.writeBytes(this.data()); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java index cba632dcf0..bfd3cba4c7 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerLoginNetworkAddon.java @@ -46,8 +46,8 @@ import net.fabricmc.fabric.api.networking.v1.ServerLoginNetworking; import net.fabricmc.fabric.impl.networking.AbstractNetworkAddon; import net.fabricmc.fabric.impl.networking.GenericFutureListenerHolder; -import net.fabricmc.fabric.impl.networking.PacketByteBufLoginQueryRequestPayload; -import net.fabricmc.fabric.impl.networking.PacketByteBufLoginQueryResponse; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryRequestPayload; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryResponse; import net.fabricmc.fabric.mixin.networking.accessor.ServerLoginNetworkHandlerAccessor; public final class ServerLoginNetworkAddon extends AbstractNetworkAddon implements PacketSender { @@ -129,7 +129,6 @@ private void sendCompressionPacket() { * @return true if the packet was handled */ public boolean handle(LoginQueryResponseC2SPacket packet) { - // TODO 1.20.2 likely an unsafe cast. PacketByteBufLoginQueryResponse response = (PacketByteBufLoginQueryResponse) packet.response(); return handle(packet.queryId(), response.data()); } 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 24fb1530c1..fe349659d7 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 @@ -28,7 +28,7 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.fabricmc.fabric.impl.networking.GlobalReceiverRegistry; import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions; -import net.fabricmc.fabric.impl.networking.PacketByteBufPayload; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; public final class ServerNetworkingImpl { public static final GlobalReceiverRegistry LOGIN = new GlobalReceiverRegistry<>(); diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java index 58d68a1b58..ceb6383bca 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/server/ServerPlayNetworkAddon.java @@ -32,7 +32,7 @@ import net.fabricmc.fabric.impl.networking.AbstractChanneledNetworkAddon; import net.fabricmc.fabric.impl.networking.ChannelInfoHolder; import net.fabricmc.fabric.impl.networking.NetworkingImpl; -import net.fabricmc.fabric.impl.networking.PacketByteBufPayload; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; import net.fabricmc.fabric.mixin.networking.accessor.ServerCommonNetworkHandlerAccessor; public final class ServerPlayNetworkAddon extends AbstractChanneledNetworkAddon { diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/CustomPayloadC2SPacketMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/CustomPayloadC2SPacketMixin.java new file mode 100644 index 0000000000..75d63ac809 --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/CustomPayloadC2SPacketMixin.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.mixin.networking; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.CustomPayload; +import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket; +import net.minecraft.util.Identifier; + +import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; + +@Mixin(CustomPayloadC2SPacket.class) +public class CustomPayloadC2SPacketMixin { + @Inject( + method = "readPayload", + at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/common/CustomPayloadC2SPacket;readUnknownPayload(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;)Lnet/minecraft/network/packet/UnknownCustomPayload;"), + cancellable = true + ) + private static void readPayload(Identifier id, PacketByteBuf buf, CallbackInfoReturnable cir) { + PacketByteBuf copy = PacketByteBufs.copy(buf); + buf.skipBytes(buf.readableBytes()); + cir.setReturnValue(new PacketByteBufPayload(id, copy)); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/CustomPayloadS2CPacketMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/CustomPayloadS2CPacketMixin.java new file mode 100644 index 0000000000..bafffb95b3 --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/CustomPayloadS2CPacketMixin.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.mixin.networking; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.CustomPayload; +import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket; +import net.minecraft.util.Identifier; + +import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; + +@Mixin(CustomPayloadS2CPacket.class) +public class CustomPayloadS2CPacketMixin { + @Inject( + method = "readPayload", + at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/s2c/common/CustomPayloadS2CPacket;readUnknownPayload(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;)Lnet/minecraft/network/packet/UnknownCustomPayload;"), + cancellable = true + ) + private static void readPayload(Identifier id, PacketByteBuf buf, CallbackInfoReturnable cir) { + PacketByteBuf copy = PacketByteBufs.copy(buf); + buf.skipBytes(buf.readableBytes()); + cir.setReturnValue(new PacketByteBufPayload(id, copy)); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/LoginQueryRequestS2CPacketMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/LoginQueryRequestS2CPacketMixin.java new file mode 100644 index 0000000000..08c39947af --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/LoginQueryRequestS2CPacketMixin.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.mixin.networking; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.s2c.login.LoginQueryRequestS2CPacket; +import net.minecraft.network.packet.s2c.login.UnknownLoginQueryRequestPayload; +import net.minecraft.util.Identifier; + +@Mixin(LoginQueryRequestS2CPacket.class) +public class LoginQueryRequestS2CPacketMixin { + @Inject(method = "readPayload", at = @At("HEAD")) + private static void readPayload(Identifier id, PacketByteBuf buf, CallbackInfoReturnable cir) { + throw new IllegalStateException("Must use LoginQueryRequestS2CPacketFactory"); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/LoginQueryResponseC2SPacketMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/LoginQueryResponseC2SPacketMixin.java new file mode 100644 index 0000000000..2c7896ab6d --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/LoginQueryResponseC2SPacketMixin.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.mixin.networking; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.c2s.login.LoginQueryResponse; +import net.minecraft.network.packet.c2s.login.LoginQueryResponseC2SPacket; + +import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryResponse; + +@Mixin(LoginQueryResponseC2SPacket.class) +public class LoginQueryResponseC2SPacketMixin { + @Inject(method = "readResponse", at = @At("HEAD"), cancellable = true) + private static void readResponse(int queryId, PacketByteBuf buf, CallbackInfoReturnable cir) { + PacketByteBuf copy = PacketByteBufs.copy(buf); + buf.skipBytes(buf.readableBytes()); + cir.setReturnValue(new PacketByteBufLoginQueryResponse(copy)); + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/NetworkStateInternalPacketHandlerMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/NetworkStateInternalPacketHandlerMixin.java new file mode 100644 index 0000000000..5cc5c3ca5d --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/NetworkStateInternalPacketHandlerMixin.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.mixin.networking; + +import java.util.function.Function; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import net.minecraft.network.NetworkState; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.listener.ClientLoginPacketListener; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.s2c.login.LoginQueryRequestS2CPacket; + +import net.fabricmc.fabric.impl.networking.LoginQueryRequestS2CPacketFactory; + +@Mixin(NetworkState.InternalPacketHandler.class) +public abstract class NetworkStateInternalPacketHandlerMixin { + @Unique + private static final Function LOGIN_QUERY_REQUEST_FACTORY = LoginQueryRequestS2CPacketFactory::create; + + @Shadow public abstract

> NetworkState.InternalPacketHandler register(Class

type, Function packetFactory); + + @Inject(method = "register", at = @At("HEAD"), cancellable = true) + private

> void register(Class

type, Function packetFactory, CallbackInfoReturnable> cir) { + if (type == LoginQueryRequestS2CPacket.class && packetFactory != LOGIN_QUERY_REQUEST_FACTORY) { + cir.setReturnValue(register(LoginQueryRequestS2CPacket.class, LOGIN_QUERY_REQUEST_FACTORY)); + } + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/PlayerManagerMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/PlayerManagerMixin.java index ec22a832ae..1b5f7debae 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/PlayerManagerMixin.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/PlayerManagerMixin.java @@ -29,8 +29,8 @@ @Mixin(PlayerManager.class) abstract class PlayerManagerMixin { - @Inject(method = "onPlayerConnect", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/s2c/play/CustomPayloadS2CPacket;(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;)V")) - private void handlePlayerConnection(ClientConnection connection, ServerPlayerEntity player, CallbackInfo ci) { + @Inject(method = "onPlayerConnect", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/s2c/play/PlayerAbilitiesS2CPacket;(Lnet/minecraft/entity/player/PlayerAbilities;)V")) + private void handlePlayerConnection(ClientConnection connection, ServerPlayerEntity player, int latency, CallbackInfo ci) { ServerNetworkingImpl.getAddon(player.networkHandler).onClientReady(); } } diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerCommonNetworkHandlerMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerCommonNetworkHandlerMixin.java new file mode 100644 index 0000000000..a536b7f3a1 --- /dev/null +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerCommonNetworkHandlerMixin.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.fabricmc.fabric.mixin.networking; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import net.minecraft.network.packet.c2s.common.CustomPayloadC2SPacket; +import net.minecraft.server.network.ServerCommonNetworkHandler; + +import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufPayload; +import net.fabricmc.fabric.impl.networking.server.ServerPlayNetworkAddon; + +@Mixin(ServerCommonNetworkHandler.class) +public abstract class ServerCommonNetworkHandlerMixin implements NetworkHandlerExtensions { + @Inject(method = "onCustomPayload", at = @At("HEAD"), cancellable = true) + private void handleCustomPayloadReceivedAsync(CustomPayloadC2SPacket packet, CallbackInfo ci) { + if (packet.payload() instanceof PacketByteBufPayload byteBufPayload) { + if (((ServerPlayNetworkAddon) getAddon()).handle(byteBufPayload)) { + ci.cancel(); + } else { + byteBufPayload.data().skipBytes(byteBufPayload.data().readableBytes()); + } + } + } +} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerLoginNetworkHandlerMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerLoginNetworkHandlerMixin.java index c81f3f5f64..14b5188c24 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerLoginNetworkHandlerMixin.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerLoginNetworkHandlerMixin.java @@ -37,6 +37,7 @@ import net.fabricmc.fabric.impl.networking.DisconnectPacketSource; import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions; import net.fabricmc.fabric.impl.networking.PacketCallbackListener; +import net.fabricmc.fabric.impl.networking.payload.PacketByteBufLoginQueryResponse; import net.fabricmc.fabric.impl.networking.server.ServerLoginNetworkAddon; @Mixin(ServerLoginNetworkHandler.class) @@ -66,9 +67,13 @@ private void handlePlayerJoin(ServerLoginNetworkHandler instance, GameProfile pr @Inject(method = "onQueryResponse", at = @At("HEAD"), cancellable = true) private void handleCustomPayloadReceivedAsync(LoginQueryResponseC2SPacket packet, CallbackInfo ci) { - // Handle queries - if (this.addon.handle(packet)) { - ci.cancel(); + if (packet.response() instanceof PacketByteBufLoginQueryResponse byteBufPayload) { + // Handle queries + if (this.addon.handle(packet)) { + ci.cancel(); + } else { + byteBufPayload.data().skipBytes(byteBufPayload.data().readableBytes()); + } } } diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java index db2b298d97..060546746f 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/mixin/networking/ServerPlayNetworkHandlerMixin.java @@ -51,14 +51,6 @@ private void initAddon(CallbackInfo ci) { this.addon.lateInit(); } - // TODO call from ServerCommonNetworkHandler but with the addon here? -// @Inject(method = "onCustomPayload", at = @At("HEAD"), cancellable = true) -// private void handleCustomPayloadReceivedAsync(CustomPayloadC2SPacket packet, CallbackInfo ci) { -// if (this.addon.handle(packet)) { -// ci.cancel(); -// } -// } - @Inject(method = "onDisconnected", at = @At("HEAD")) private void handleDisconnection(Text reason, CallbackInfo ci) { this.addon.handleDisconnect(); diff --git a/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.accesswidener b/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.accesswidener new file mode 100644 index 0000000000..0c67f5c9a1 --- /dev/null +++ b/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.accesswidener @@ -0,0 +1,3 @@ +accessWidener v2 named + +accessible class net/minecraft/network/NetworkState$InternalPacketHandler diff --git a/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.mixins.json b/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.mixins.json index 8445706fa4..d1974956fc 100644 --- a/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.mixins.json +++ b/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.mixins.json @@ -4,8 +4,14 @@ "compatibilityLevel": "JAVA_16", "mixins": [ "ClientConnectionMixin", + "CustomPayloadC2SPacketMixin", + "CustomPayloadS2CPacketMixin", "EntityTrackerEntryMixin", + "LoginQueryRequestS2CPacketMixin", + "LoginQueryResponseC2SPacketMixin", + "NetworkStateInternalPacketHandlerMixin", "PlayerManagerMixin", + "ServerCommonNetworkHandlerMixin", "ServerLoginNetworkHandlerMixin", "ServerPlayNetworkHandlerMixin", "accessor.EntityTrackerAccessor", diff --git a/fabric-networking-api-v1/src/main/resources/fabric.mod.json b/fabric-networking-api-v1/src/main/resources/fabric.mod.json index cd672bf788..aa88044648 100644 --- a/fabric-networking-api-v1/src/main/resources/fabric.mod.json +++ b/fabric-networking-api-v1/src/main/resources/fabric.mod.json @@ -23,6 +23,7 @@ "net.fabricmc.fabric.impl.networking.client.ClientNetworkingImpl::clientInit" ] }, + "accessWidener": "fabric-networking-api-v1.accesswidener", "depends": { "fabricloader": ">=0.4.0", "fabric-api-base": "*" diff --git a/fabric-renderer-api-v1/src/testmod/resources/fabric.mod.json b/fabric-renderer-api-v1/src/testmod/resources/fabric.mod.json index 1fd965e719..43ed23ee1c 100644 --- a/fabric-renderer-api-v1/src/testmod/resources/fabric.mod.json +++ b/fabric-renderer-api-v1/src/testmod/resources/fabric.mod.json @@ -6,7 +6,6 @@ "environment": "*", "license": "Apache-2.0", "depends": { - "fabric-renderer-api-v1":"*", "fabric-resource-loader-v0": "*" }, "entrypoints": { diff --git a/fabric-rendering-v1/src/testmod/resources/fabric.mod.json b/fabric-rendering-v1/src/testmod/resources/fabric.mod.json index d480966568..f51ecb36c6 100644 --- a/fabric-rendering-v1/src/testmod/resources/fabric.mod.json +++ b/fabric-rendering-v1/src/testmod/resources/fabric.mod.json @@ -5,9 +5,6 @@ "version": "1.0.0", "environment": "*", "license": "Apache-2.0", - "depends": { - "fabric-rendering-v1": "*" - }, "entrypoints": { "main": [ "net.fabricmc.fabric.test.rendering.TooltipComponentTestInit"