Fix 23w40a port issues ()

* 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
This commit is contained in:
apple502j 2023-10-12 00:21:23 +09:00 committed by GitHub
parent ae7e00873a
commit 72c64fc180
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions
fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/block
fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client
fabric-object-builder-api-v1/src/testmod/java/net/fabricmc/fabric/test/object/builder

View file

@ -24,10 +24,11 @@ import net.minecraft.util.hit.BlockHitResult;
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.
*
* <p>The hit result is guaranteed to be a {@link BlockHitResult} that did not miss.
*/

View file

@ -79,8 +79,8 @@ abstract class ClientPlayNetworkHandlerMixin {
}
}
// 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) {

View file

@ -94,7 +94,7 @@ public class BlockEntityTypeBuilderTest implements ModInitializer {
}
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);
}