Fix another case of breaking blocks causing sync chunk loads

This commit is contained in:
Aikar 2020-05-22 18:57:48 -04:00
parent 12ecaf1372
commit f3e13bf42c

View File

@ -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) {