diff --git a/Spigot-Server-Patches/Don-t-allow-digging-into-unloaded-chunks.patch b/Spigot-Server-Patches/Don-t-allow-digging-into-unloaded-chunks.patch index e696203ed..5fcfdc3d9 100644 --- a/Spigot-Server-Patches/Don-t-allow-digging-into-unloaded-chunks.patch +++ b/Spigot-Server-Patches/Don-t-allow-digging-into-unloaded-chunks.patch @@ -24,6 +24,32 @@ diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java +@@ -0,0 +0,0 @@ public class PlayerInteractManager { + IBlockData iblockdata; + + if (this.i) { +- iblockdata = this.world.getType(this.j); +- if (iblockdata.isAir()) { ++ iblockdata = this.world.getTypeIfLoaded(this.j); // Paper ++ if (iblockdata == null || iblockdata.isAir()) { // Paper + this.i = false; + } else { + float f = this.a(iblockdata, this.j, this.k); +@@ -0,0 +0,0 @@ public class PlayerInteractManager { + } + } + } else if (this.e) { +- iblockdata = this.world.getType(this.g); ++ // Paper start - don't want to do same logic as above, return instead ++ iblockdata = this.world.getTypeIfLoaded(this.g); ++ if (iblockdata == null) { ++ this.e = false; ++ return; ++ } ++ // Paper end + if (iblockdata.isAir()) { + this.world.a(this.player.getId(), this.g, -1); + this.l = -1; @@ -0,0 +0,0 @@ public class PlayerInteractManager { this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(blockposition, this.world.getType(blockposition), packetplayinblockdig_enumplayerdigtype, true, "stopped destroying")); } else if (packetplayinblockdig_enumplayerdigtype == PacketPlayInBlockDig.EnumPlayerDigType.ABORT_DESTROY_BLOCK) {