From 5b7b86b1b35d4c11517633fbad3399c976295a8d Mon Sep 17 00:00:00 2001 From: Eli Orona Date: Wed, 24 Jan 2024 22:19:33 -0800 Subject: [PATCH] Sanity Check PR Diff --- .github/workflows/build.yml | 90 +++++++++---------- build.gradle | 7 +- fabric-block-view-api-v2/build.gradle | 2 +- .../mixin/blockview/BlockViewMixin.java | 3 +- .../src/main/resources/quilt.mod.json | 2 +- ...ed_fabric_block_view_api_v2.accesswidener} | 0 ...d_fabric_events_interaction_v0.mixins.json | 1 + fabric-networking-api-v1/build.gradle | 4 - .../networking/v1/ClientPlayNetworking.java | 10 +-- ...bricServerConfigurationNetworkHandler.java | 3 + .../api/networking/v1/PacketSender.java | 3 + .../networking/payload/PayloadHelper.java | 57 ------------ .../networking/payload/ResolvablePayload.java | 40 --------- .../networking/payload/ResolvedPayload.java | 20 ----- .../networking/payload/RetainedPayload.java | 54 ----------- .../impl/networking/payload/TypedPayload.java | 49 ---------- .../networking/payload/UntypedPayload.java | 54 ----------- .../fabric-networking-api-v1.accesswidener | 3 - fabric-object-builder-api-v1/build.gradle | 2 +- .../src/main/resources/quilt.mod.json | 2 +- ...abric_object_builder_api_v1.accesswidener} | 0 .../build.gradle | 13 ++- .../src/main/resources/quilt.mod.json | 2 +- ...ansitive_access_wideners_v1.accesswidener} | 0 24 files changed, 75 insertions(+), 346 deletions(-) rename fabric-block-view-api-v2/src/main/resources/{fabric-block-view-api-v2.accesswidener => quilted_fabric_block_view_api_v2.accesswidener} (100%) delete mode 100644 fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PayloadHelper.java delete mode 100644 fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvablePayload.java delete mode 100644 fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvedPayload.java delete mode 100644 fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/RetainedPayload.java delete mode 100644 fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/TypedPayload.java delete mode 100644 fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/UntypedPayload.java delete mode 100644 fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.accesswidener rename fabric-object-builder-api-v1/src/main/resources/{fabric-object-builder-api-v1.accesswidener => quilted_fabric_object_builder_api_v1.accesswidener} (100%) rename fabric-transitive-access-wideners-v1/src/main/resources/{fabric-transitive-access-wideners-v1.accesswidener => quilted_fabric_transitive_access_wideners_v1.accesswidener} (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 864196726b..45db5687c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,48 +48,48 @@ jobs: name: Maven Local path: /root/.m2/repository - client_test: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - distribution: 'microsoft' - java-version: '17' - - name: Run Auto test Client - uses: modmuss50/xvfb-action@v1 - with: - run: ./gradlew runProductionAutoTestClient --stacktrace --warning-mode=fail - - uses: actions/upload-artifact@v3 - if: always() - with: - name: Test Screenshots - path: run/screenshots - - server_test: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - distribution: 'microsoft' - java-version: '17' - - run: mkdir run && echo "eula=true" >> run/eula.txt - - run: ./gradlew runProductionAutoTestServer --stacktrace --warning-mode=fail - - check_resources: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-java@v3 - with: - distribution: 'microsoft' - java-version: '17' - - run: ./gradlew generateResources --stacktrace --warning-mode=fail - - run: if [ -n "$(git status --porcelain)" ]; then exit 1; fi +# client_test: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# - uses: actions/setup-java@v3 +# with: +# distribution: 'microsoft' +# java-version: '17' +# - name: Run Auto test Client +# uses: modmuss50/xvfb-action@v1 +# with: +# run: ./gradlew runProductionAutoTestClient --stacktrace --warning-mode=fail +# - uses: actions/upload-artifact@v3 +# if: always() +# with: +# name: Test Screenshots +# path: run/screenshots +# +# server_test: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# - uses: actions/setup-java@v3 +# with: +# distribution: 'microsoft' +# java-version: '17' +# - run: mkdir run && echo "eula=true" >> run/eula.txt +# - run: ./gradlew runProductionAutoTestServer --stacktrace --warning-mode=fail +# +# check_resources: +# runs-on: ubuntu-22.04 +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# - uses: actions/setup-java@v3 +# with: +# distribution: 'microsoft' +# java-version: '17' +# - run: ./gradlew generateResources --stacktrace --warning-mode=fail +# - run: if [ -n "$(git status --porcelain)" ]; then exit 1; fi diff --git a/build.gradle b/build.gradle index 6290584a32..47fbb00512 100644 --- a/build.gradle +++ b/build.gradle @@ -214,11 +214,6 @@ allprojects { } } - repositories { - maven { - url "https://maven.quiltmc.org/repository/snapshot" - } - } dependencies { minecraft "com.mojang:minecraft:$rootProject.minecraft_version" mappings "net.fabricmc:yarn:${rootProject.minecraft_version}${project.yarn_version}:v2" @@ -408,7 +403,7 @@ loom { } autoTestServer { inherit testmodServer - name "Auto Test Server" + name "Auto Test Server" vmArg "-Dfabric.autoTest" } autoTestClient { diff --git a/fabric-block-view-api-v2/build.gradle b/fabric-block-view-api-v2/build.gradle index 8e8dbe8252..2ebad60129 100644 --- a/fabric-block-view-api-v2/build.gradle +++ b/fabric-block-view-api-v2/build.gradle @@ -3,5 +3,5 @@ version = getSubprojectVersion(project) upstream_version = getSubprojectUpstreamVersion(project) loom { - accessWidenerPath = file("src/main/resources/fabric-block-view-api-v2.accesswidener") + accessWidenerPath = file("src/main/resources/quilted_fabric_block_view_api_v2.accesswidener") } diff --git a/fabric-block-view-api-v2/src/main/java/net/fabricmc/fabric/mixin/blockview/BlockViewMixin.java b/fabric-block-view-api-v2/src/main/java/net/fabricmc/fabric/mixin/blockview/BlockViewMixin.java index 4f318ca818..da9e2d8927 100644 --- a/fabric-block-view-api-v2/src/main/java/net/fabricmc/fabric/mixin/blockview/BlockViewMixin.java +++ b/fabric-block-view-api-v2/src/main/java/net/fabricmc/fabric/mixin/blockview/BlockViewMixin.java @@ -1,5 +1,6 @@ /* - * Copyright 2022 The Quilt Project + * Copyright 2016, 2017, 2018, 2019 FabricMC + * Copyright 2023 The Quilt Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/fabric-block-view-api-v2/src/main/resources/quilt.mod.json b/fabric-block-view-api-v2/src/main/resources/quilt.mod.json index 6c8d7a220b..5c457e7461 100644 --- a/fabric-block-view-api-v2/src/main/resources/quilt.mod.json +++ b/fabric-block-view-api-v2/src/main/resources/quilt.mod.json @@ -34,7 +34,7 @@ "quilted_fabric_block_view_api_v2.mixins.json", "quilted_fabric_block_view_api_v2.client.mixins.json" ], - "access_widener": "fabric-block-view-api-v2.accesswidener", + "access_widener": "quilted_fabric_block_view_api_v2.accesswidener", "fabric-api:module-lifecycle": "stable", "modmenu": { "badges": [ diff --git a/fabric-block-view-api-v2/src/main/resources/fabric-block-view-api-v2.accesswidener b/fabric-block-view-api-v2/src/main/resources/quilted_fabric_block_view_api_v2.accesswidener similarity index 100% rename from fabric-block-view-api-v2/src/main/resources/fabric-block-view-api-v2.accesswidener rename to fabric-block-view-api-v2/src/main/resources/quilted_fabric_block_view_api_v2.accesswidener diff --git a/fabric-events-interaction-v0/src/main/resources/quilted_fabric_events_interaction_v0.mixins.json b/fabric-events-interaction-v0/src/main/resources/quilted_fabric_events_interaction_v0.mixins.json index c4c1962772..719537c198 100644 --- a/fabric-events-interaction-v0/src/main/resources/quilted_fabric_events_interaction_v0.mixins.json +++ b/fabric-events-interaction-v0/src/main/resources/quilted_fabric_events_interaction_v0.mixins.json @@ -3,6 +3,7 @@ "package": "net.fabricmc.fabric.mixin.event.interaction", "compatibilityLevel": "JAVA_17", "mixins": [ + "BeehiveBlockMixin", "PlayerAdvancementTrackerMixin", "ServerPlayerEntityMixin", "ServerPlayerInteractionManagerMixin", diff --git a/fabric-networking-api-v1/build.gradle b/fabric-networking-api-v1/build.gradle index cf1e90dcb4..cbeeba630a 100644 --- a/fabric-networking-api-v1/build.gradle +++ b/fabric-networking-api-v1/build.gradle @@ -13,7 +13,3 @@ 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/api/client/networking/v1/ClientPlayNetworking.java b/fabric-networking-api-v1/src/client/java/net/fabricmc/fabric/api/client/networking/v1/ClientPlayNetworking.java index 1e07a59c7b..c4b14e24b2 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 @@ -183,7 +183,7 @@ public static boolean registerReceiver(Identifier channelName, PlayChannelHandle *

For example, if you only register a receiver using this method when a {@linkplain ClientLoginNetworking#registerGlobalReceiver(Identifier, ClientLoginNetworking.LoginQueryRequestHandler)} * login query has been received, you should use {@link ClientPlayConnectionEvents#INIT} to register the channel handler. * - * @param type the packet type + * @param type the packet type * @param handler the handler * @return {@code false} if a handler is already registered for the type * @throws IllegalStateException if the client is not connected to a server @@ -288,7 +288,7 @@ public static boolean canSend(PacketType type) { * Creates a packet which may be sent to the connected server. * * @param channelName the channel name - * @param buf the packet byte buf which represents the payload of the packet + * @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) { @@ -319,7 +319,7 @@ public static PacketSender getSender() throws IllegalStateException { * Sends a packet to the connected server. * * @param channelName the channel of the packet - * @param buf the payload of the packet + * @param buf the payload of the packet * @throws IllegalStateException if the client is not connected to a server */ public static void send(Identifier channelName, PacketByteBuf buf) throws IllegalStateException { @@ -428,8 +428,8 @@ public interface PlayPacketHandler { * *

The network handler can be accessed via {@link ClientPlayerEntity#networkHandler}. * - * @param packet the packet - * @param player the player that received the packet + * @param packet the packet + * @param player the player that received the packet * @param responseSender the packet sender * @see FabricPacket */ diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/FabricServerConfigurationNetworkHandler.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/FabricServerConfigurationNetworkHandler.java index 2a7f6da8b4..219e2c8625 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/FabricServerConfigurationNetworkHandler.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/FabricServerConfigurationNetworkHandler.java @@ -26,7 +26,10 @@ /** * Fabric-provided extensions for {@link ServerConfigurationNetworkHandler}. * This interface is automatically implemented via Mixin and interface injection. + * + * @deprecated See {@link ServerConfigurationTaskManager} */ +@Deprecated public interface FabricServerConfigurationNetworkHandler extends ServerConfigurationTaskManager { /** * Enqueues a {@link ServerPlayerConfigurationTask} task to be processed. diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java index 29f22c9f93..7b19df35bd 100644 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java +++ b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/api/networking/v1/PacketSender.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2016, 2017, 2018, 2019 FabricMC + * Copyright 2022 The Quilt Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +36,9 @@ /** * Represents something that supports sending packets to channels. * @see PacketByteBufs + * @deprecated Use Quilt Networking's {@link org.quiltmc.qsl.networking.api.PacketSender} instead. */ +@Deprecated @ApiStatus.NonExtendable public interface PacketSender { /** diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PayloadHelper.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PayloadHelper.java deleted file mode 100644 index 96077bbbd7..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/PayloadHelper.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.util.Identifier; - -import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; - -public class PayloadHelper { - public static void write(PacketByteBuf byteBuf, PacketByteBuf data) { - byteBuf.writeBytes(data.copy()); - } - - public static PacketByteBuf read(PacketByteBuf byteBuf, int maxSize) { - assertSize(byteBuf, maxSize); - - PacketByteBuf newBuf = PacketByteBufs.create(); - newBuf.writeBytes(byteBuf.copy()); - byteBuf.skipBytes(byteBuf.readableBytes()); - return newBuf; - } - - public static ResolvablePayload readCustom(Identifier id, PacketByteBuf buf, int maxSize, boolean retain) { - assertSize(buf, maxSize); - - if (retain) { - RetainedPayload payload = new RetainedPayload(id, PacketByteBufs.retainedSlice(buf)); - buf.skipBytes(buf.readableBytes()); - return payload; - } else { - return new UntypedPayload(id, read(buf, maxSize)); - } - } - - private static void assertSize(PacketByteBuf buf, int maxSize) { - int size = buf.readableBytes(); - - if (size < 0 || size > maxSize) { - throw new IllegalArgumentException("Payload may not be larger than " + maxSize + " bytes"); - } - } -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvablePayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvablePayload.java deleted file mode 100644 index 2f766ec355..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvablePayload.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 org.jetbrains.annotations.Nullable; - -import net.minecraft.network.packet.CustomPayload; - -import net.fabricmc.fabric.api.networking.v1.PacketType; - -public sealed interface ResolvablePayload extends CustomPayload permits ResolvedPayload, RetainedPayload { - /** - * Resolve the payload to one of the resolved types. - * - * @return {@link UntypedPayload} if type is {@code null}, {@link TypedPayload} if otherwise. - */ - ResolvedPayload resolve(@Nullable PacketType type); - - /** - * @param type the packet type, if it has any - * @param actual the public handler that exposed to API consumer - * @param internal the internal handler - */ - record Handler(@Nullable PacketType type, Object actual, H internal) { - } -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvedPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvedPayload.java deleted file mode 100644 index 04b5e7d33d..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/ResolvedPayload.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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; - -public sealed interface ResolvedPayload extends ResolvablePayload permits TypedPayload, UntypedPayload { -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/RetainedPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/RetainedPayload.java deleted file mode 100644 index 8e4f0113d2..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/RetainedPayload.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 org.jetbrains.annotations.Nullable; - -import net.minecraft.network.PacketByteBuf; -import net.minecraft.util.Identifier; - -import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; -import net.fabricmc.fabric.api.networking.v1.PacketType; - -public record RetainedPayload(Identifier id, PacketByteBuf buf) implements ResolvablePayload { - @Override - public ResolvedPayload resolve(@Nullable PacketType type) { - try { - if (type == null) { - PacketByteBuf copy = PacketByteBufs.create(); - copy.writeBytes(buf); - return new UntypedPayload(this.id, copy); - } else { - TypedPayload typed = new TypedPayload(type.read(buf)); - int dangling = buf.readableBytes(); - - if (dangling > 0) { - throw new IllegalStateException("Found " + dangling + " extra bytes when reading packet " + id); - } - - return typed; - } - } finally { - buf.release(); - } - } - - @Override - public void write(PacketByteBuf buf) { - throw new UnsupportedOperationException("RetainedPayload shouldn't be used to send"); - } -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/TypedPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/TypedPayload.java deleted file mode 100644 index 4240ee991c..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/TypedPayload.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 org.jetbrains.annotations.Nullable; - -import net.minecraft.network.PacketByteBuf; -import net.minecraft.util.Identifier; - -import net.fabricmc.fabric.api.networking.v1.FabricPacket; -import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; -import net.fabricmc.fabric.api.networking.v1.PacketType; - -public record TypedPayload(FabricPacket packet) implements ResolvedPayload { - @Override - public ResolvedPayload resolve(@Nullable PacketType type) { - if (type == null) { - PacketByteBuf buf = PacketByteBufs.create(); - write(buf); - return new UntypedPayload(packet.getType().getId(), buf); - } else { - return this; - } - } - - @Override - public void write(PacketByteBuf buf) { - packet.write(buf); - } - - @Override - public Identifier id() { - return packet.getType().getId(); - } -} diff --git a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/UntypedPayload.java b/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/UntypedPayload.java deleted file mode 100644 index 856b348e47..0000000000 --- a/fabric-networking-api-v1/src/main/java/net/fabricmc/fabric/impl/networking/payload/UntypedPayload.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 org.jetbrains.annotations.Nullable; - -import net.minecraft.network.PacketByteBuf; -import net.minecraft.util.Identifier; - -import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; -import net.fabricmc.fabric.api.networking.v1.PacketType; - -public record UntypedPayload(Identifier id, PacketByteBuf buffer) implements ResolvedPayload { - @Override - public ResolvedPayload resolve(@Nullable PacketType type) { - if (type == null) { - return this; - } else { - PacketByteBuf copy = PacketByteBufs.copy(buffer); - TypedPayload typed = new TypedPayload(type.read(copy)); - int dangling = copy.readableBytes(); - - if (dangling > 0) { - throw new IllegalStateException("Found " + dangling + " extra bytes when reading packet " + id); - } - - return typed; - } - } - - @Override - public void write(PacketByteBuf buf) { - buf.writeBytes(buffer.copy()); - } - - @Override - public PacketByteBuf buffer() { - return PacketByteBufs.copy(buffer); - } -} 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 deleted file mode 100644 index 0c67f5c9a1..0000000000 --- a/fabric-networking-api-v1/src/main/resources/fabric-networking-api-v1.accesswidener +++ /dev/null @@ -1,3 +0,0 @@ -accessWidener v2 named - -accessible class net/minecraft/network/NetworkState$InternalPacketHandler diff --git a/fabric-object-builder-api-v1/build.gradle b/fabric-object-builder-api-v1/build.gradle index 13ece2fa8b..19901c0891 100644 --- a/fabric-object-builder-api-v1/build.gradle +++ b/fabric-object-builder-api-v1/build.gradle @@ -21,7 +21,7 @@ testDependencies(project, [ ]) loom { - accessWidenerPath = file("src/main/resources/fabric-object-builder-api-v1.accesswidener") + accessWidenerPath = file("src/main/resources/quilted_fabric_object_builder_api_v1.accesswidener") } validateMixinNames { diff --git a/fabric-object-builder-api-v1/src/main/resources/quilt.mod.json b/fabric-object-builder-api-v1/src/main/resources/quilt.mod.json index 9af1caac8d..bc37043b7f 100644 --- a/fabric-object-builder-api-v1/src/main/resources/quilt.mod.json +++ b/fabric-object-builder-api-v1/src/main/resources/quilt.mod.json @@ -40,7 +40,7 @@ "quilted_fabric_object_builder_api_v1.mixins.json", "quilted_fabric_object_builder_api_v1.client.mixins.json" ], - "access_widener": "fabric-object-builder-api-v1.accesswidener", + "access_widener": "quilted_fabric_object_builder_api_v1.accesswidener", "fabric-api:module-lifecycle": "deprecated", "modmenu": { "badges": [ diff --git a/fabric-object-builder-api-v1/src/main/resources/fabric-object-builder-api-v1.accesswidener b/fabric-object-builder-api-v1/src/main/resources/quilted_fabric_object_builder_api_v1.accesswidener similarity index 100% rename from fabric-object-builder-api-v1/src/main/resources/fabric-object-builder-api-v1.accesswidener rename to fabric-object-builder-api-v1/src/main/resources/quilted_fabric_object_builder_api_v1.accesswidener diff --git a/fabric-transitive-access-wideners-v1/build.gradle b/fabric-transitive-access-wideners-v1/build.gradle index 98fa10e479..2046f202a9 100644 --- a/fabric-transitive-access-wideners-v1/build.gradle +++ b/fabric-transitive-access-wideners-v1/build.gradle @@ -3,7 +3,14 @@ version = getSubprojectVersion(project) upstream_version = getSubprojectUpstreamVersion(project) loom { - accessWidenerPath = file('src/main/resources/fabric-transitive-access-wideners-v1.accesswidener') + accessWidenerPath = file('src/main/resources/quilted_fabric_transitive_access_wideners_v1.accesswidener') +} + +dependencies { + modApi(getQslModule('block', 'block_entity')) + modApi(getQslModule('block', 'block_extensions')) + modApi(getQslModule('data', 'advancement')) + modApi(getQslModule('entity', 'entity_extensions')) } testDependencies(project, [ @@ -48,7 +55,7 @@ task generateAccessWidener { generateRenderPhaseFields(lines, fs) } - file('src/main/resources/fabric-transitive-access-wideners-v1.accesswidener').text = String.join('\n', lines) + '\n' + file('src/main/resources/quilted_fabric_transitive_access_wideners_v1.accesswidener').text = String.join('\n', lines) + '\n' validateAccessWidener(lines) } @@ -137,7 +144,7 @@ def validateAccessWidener(List lines) { } if (exceptions.size() > 0) { - throw new InvalidUserDataException("\"fabric-transitive-access-wideners-v1.accesswidener\" contains non-transitive access modifiers at lines: [" + String.join(", ", exceptions) + "]") + throw new InvalidUserDataException("\"quilted_fabric_transitive_access_wideners_v1.accesswidener\" contains non-transitive access modifiers at lines: [" + String.join(", ", exceptions) + "]") } } diff --git a/fabric-transitive-access-wideners-v1/src/main/resources/quilt.mod.json b/fabric-transitive-access-wideners-v1/src/main/resources/quilt.mod.json index d3a6175569..5a377bf130 100644 --- a/fabric-transitive-access-wideners-v1/src/main/resources/quilt.mod.json +++ b/fabric-transitive-access-wideners-v1/src/main/resources/quilt.mod.json @@ -34,7 +34,7 @@ } ] }, - "access_widener": "fabric-transitive-access-wideners-v1.accesswidener", + "access_widener": "quilted_fabric_transitive_access_wideners_v1.accesswidener", "fabric-api:module-lifecycle": "stable", "modmenu": { "badges": [ diff --git a/fabric-transitive-access-wideners-v1/src/main/resources/fabric-transitive-access-wideners-v1.accesswidener b/fabric-transitive-access-wideners-v1/src/main/resources/quilted_fabric_transitive_access_wideners_v1.accesswidener similarity index 100% rename from fabric-transitive-access-wideners-v1/src/main/resources/fabric-transitive-access-wideners-v1.accesswidener rename to fabric-transitive-access-wideners-v1/src/main/resources/quilted_fabric_transitive_access_wideners_v1.accesswidener