1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Reintroduce player place null check in BlockPlaceMixin (#5465)

This commit is contained in:
Eclipse
2025-04-07 14:49:17 +00:00
committed by GitHub
parent 7a9c6b3ac3
commit 59b0be8985

View File

@@ -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")) @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<InteractionResult> callbackInfoReturnable, private void geyser$hijackPlaySound(BlockPlaceContext blockPlaceContext, CallbackInfoReturnable<InteractionResult> callbackInfoReturnable,
@Local BlockPos pos, @Local Player player, @Local(ordinal = 1) BlockState placedState) { @Local BlockPos pos, @Local Player player, @Local(ordinal = 1) BlockState placedState) {
if (player == null) {
return;
}
GeyserSession session = GeyserImpl.getInstance().connectionByUuid(player.getUUID()); GeyserSession session = GeyserImpl.getInstance().connectionByUuid(player.getUUID());
if (session == null) { if (session == null) {
return; return;