From 59b0be8985ff072bc8eba1a0dbfe20e9e86fa1e5 Mon Sep 17 00:00:00 2001 From: Eclipse Date: Mon, 7 Apr 2025 14:49:17 +0000 Subject: [PATCH] Reintroduce player place null check in BlockPlaceMixin (#5465) --- .../geyser/platform/mod/mixin/server/BlockPlaceMixin.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/mixin/server/BlockPlaceMixin.java b/bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/mixin/server/BlockPlaceMixin.java index 77023af89..a2d76497e 100644 --- a/bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/mixin/server/BlockPlaceMixin.java +++ b/bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/mixin/server/BlockPlaceMixin.java @@ -49,6 +49,10 @@ public class BlockPlaceMixin { @Inject(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/Level;playSound(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/core/BlockPos;Lnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundSource;FF)V")) private void geyser$hijackPlaySound(BlockPlaceContext blockPlaceContext, CallbackInfoReturnable callbackInfoReturnable, @Local BlockPos pos, @Local Player player, @Local(ordinal = 1) BlockState placedState) { + if (player == null) { + return; + } + GeyserSession session = GeyserImpl.getInstance().connectionByUuid(player.getUUID()); if (session == null) { return;