From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Luna Date: Mon, 11 Jul 2022 17:29:12 -0300 Subject: [PATCH] Validate block entity tag query positions diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java index 682f3940659b48fd04e5ec65d5557a679eb8b267..08e3e3a2085f23f890890adac5d6b575b9b2364f 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1374,7 +1374,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic @Override public void handleBlockEntityTagQuery(ServerboundBlockEntityTagQuery packet) { PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); - if (this.player.hasPermissions(2)) { + if (this.player.hasPermissions(2) && this.player.level().isLoadedAndInBounds(packet.getPos())) { // Scissors - Validate block entity tag query positions BlockEntity tileentity = this.player.level().getBlockEntity(packet.getPos()); CompoundTag nbttagcompound = tileentity != null ? tileentity.saveWithoutMetadata() : null;