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 6009ba8f44
commit ee9f0d513f
No known key found for this signature in database
GPG key ID: 401ADFC9891FAAFE
3 changed files with 32 additions and 6 deletions

View file

@ -21,10 +21,36 @@ index fe25754521d5cf7059130f14acaf61a6646c5360..ab94132590e3743e45ca345c3e30b811
return;
default:
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index e2e5c17c24c8f5e9807ca879b1025d13cb195226..17b7eddac4fadfd1cc3027fe6fbcd2bd5611fb84 100644
index e2e5c17c24c8f5e9807ca879b1025d13cb195226..ed3f3362b640746649455f8dd2255ac2da03df7c 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -253,10 +253,12 @@ public class PlayerInteractManager {
@@ -69,8 +69,8 @@ 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);
@@ -81,7 +81,13 @@ 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;
@@ -253,10 +259,12 @@ 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) {
this.e = false;

View file

@ -1325,10 +1325,10 @@ index 9171785ad54a26e95dea8b30509c1e49a5d9b22d..94b0c54d9d4d77b724087be55ffe6ce4
}
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index 17b7eddac4fadfd1cc3027fe6fbcd2bd5611fb84..ce66090b8dcd846db4507b99e3ef1a2d6104d19b 100644
index ed3f3362b640746649455f8dd2255ac2da03df7c..f11ef84df85c1e7ada9c62247b7882f19ae32089 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -266,6 +266,8 @@ public class PlayerInteractManager {
@@ -272,6 +272,8 @@ public class PlayerInteractManager {
}
}

View file

@ -53,10 +53,10 @@ index f692276617d9c24ded5e887090e00642b0d63eba..b25b3b48165e5fef4db99c2838de21d4
} else {
CommandBlockListenerAbstract commandblocklistenerabstract = packetplayinsetcommandminecart.a(this.player.world);
diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java
index ce66090b8dcd846db4507b99e3ef1a2d6104d19b..b1c05304cc4c97ea0df0ea11d8d59c095288ba96 100644
index f11ef84df85c1e7ada9c62247b7882f19ae32089..6df8434612d4afe411b2c435f4c847b9183570f8 100644
--- a/src/main/java/net/minecraft/server/PlayerInteractManager.java
+++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java
@@ -344,7 +344,7 @@ public class PlayerInteractManager {
@@ -350,7 +350,7 @@ public class PlayerInteractManager {
TileEntity tileentity = this.world.getTileEntity(blockposition);
Block block = iblockdata.getBlock();