From 72c64fc180052c23de4e2a1b5e87d7388f606e4f Mon Sep 17 00:00:00 2001 From: apple502j <33279053+apple502j@users.noreply.github.com> Date: Thu, 12 Oct 2023 00:21:23 +0900 Subject: [PATCH] Fix 23w40a port issues (#3374) * Fix testmod calling Text#translatable with non-primitive arg * Fix javadoc in BlockPickInteractionAware There is no immediate need to change the param type, as the world can be obtained from `player.getWorld()`. * Fix unload events not running during reconfiguration --- .../fabricmc/fabric/api/block/BlockPickInteractionAware.java | 3 ++- .../event/lifecycle/client/ClientPlayNetworkHandlerMixin.java | 4 ++-- .../test/object/builder/BlockEntityTypeBuilderTest.java | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java b/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java index 6ba0c1fd92..88cec7a672 100644 --- a/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java +++ b/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/block/BlockPickInteractionAware.java @@ -24,10 +24,11 @@ import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; import net.minecraft.world.BlockView; +import net.minecraft.world.WorldView; /** * Convenience interface for blocks that want more stack picking context than what - * {@link Block#getPickStack(BlockView, BlockPos, BlockState)} provides. + * {@link Block#getPickStack(WorldView, BlockPos, BlockState)} provides. * *
The hit result is guaranteed to be a {@link BlockHitResult} that did not miss. */ diff --git a/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java b/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java index d6ac064379..026d923c9e 100644 --- a/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java +++ b/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java @@ -79,8 +79,8 @@ private void onGameJoin(GameJoinS2CPacket packet, CallbackInfo ci) { } } - // Called when the client disconnects from a server. - @Inject(method = "clearWorld", at = @At("HEAD")) + // Called when the client disconnects from a server or enters reconfiguration. + @Inject(method = "method_54134", at = @At("HEAD")) private void onClearWorld(CallbackInfo ci) { // If a world already exists, we need to unload all (block)entities in the world. if (this.world != null) { diff --git a/fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/BlockEntityTypeBuilderTest.java b/fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/BlockEntityTypeBuilderTest.java index fb43e8ee9f..e068332149 100644 --- a/fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/BlockEntityTypeBuilderTest.java +++ b/fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder/BlockEntityTypeBuilderTest.java @@ -94,7 +94,7 @@ public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEnt } Text posText = Text.translatable("chat.coordinates", pos.getX(), pos.getY(), pos.getZ()); - Text message = Text.translatable("text.fabric-object-builder-api-v1-testmod.block_entity_type_success", posText, BLOCK_ENTITY_TYPE_ID); + Text message = Text.method_54159("text.fabric-object-builder-api-v1-testmod.block_entity_type_success", posText, BLOCK_ENTITY_TYPE_ID); player.sendMessage(message, false); }