even even even more work
This commit is contained in:
@@ -27,42 +27,42 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||
IBlockData iblockdata;
|
||||
|
||||
if (this.i) {
|
||||
- iblockdata = this.world.getType(this.j);
|
||||
if (this.j) {
|
||||
- iblockdata = this.world.getType(this.k);
|
||||
- if (iblockdata.isAir()) {
|
||||
+ iblockdata = this.world.getTypeIfLoaded(this.j); // Paper
|
||||
+ iblockdata = this.world.getTypeIfLoaded(this.k); // Paper
|
||||
+ if (iblockdata == null || iblockdata.isAir()) { // Paper
|
||||
this.i = false;
|
||||
this.j = false;
|
||||
} else {
|
||||
float f = this.a(iblockdata, this.j, this.k);
|
||||
float f = this.a(iblockdata, this.k, this.l);
|
||||
@@ -0,0 +0,0 @@ public class PlayerInteractManager {
|
||||
}
|
||||
}
|
||||
} else if (this.e) {
|
||||
- iblockdata = this.world.getType(this.g);
|
||||
} else if (this.f) {
|
||||
- iblockdata = this.world.getType(this.h);
|
||||
+ // Paper start - don't want to do same logic as above, return instead
|
||||
+ iblockdata = this.world.getTypeIfLoaded(this.g);
|
||||
+ iblockdata = this.world.getTypeIfLoaded(this.h);
|
||||
+ if (iblockdata == null) {
|
||||
+ this.e = false;
|
||||
+ this.f = false;
|
||||
+ return;
|
||||
+ }
|
||||
+ // Paper end
|
||||
if (iblockdata.isAir()) {
|
||||
this.world.a(this.player.getId(), this.g, -1);
|
||||
this.l = -1;
|
||||
this.world.a(this.player.getId(), this.h, -1);
|
||||
this.m = -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) {
|
||||
this.e = false;
|
||||
- if (!Objects.equals(this.g, blockposition)) {
|
||||
+ if (!Objects.equals(this.g, blockposition) && !BlockPosition.ZERO.equals(this.g)) { // Paper
|
||||
PlayerInteractManager.LOGGER.debug("Mismatch in destroy block pos: " + this.g + " " + blockposition); // CraftBukkit - SPIGOT-5457 sent by client when interact event cancelled
|
||||
- this.world.a(this.player.getId(), this.g, -1);
|
||||
- this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.g, this.world.getType(this.g), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying"));
|
||||
+ IBlockData type = this.world.getTypeIfLoaded(this.g); // Paper - don't load unloaded chunks for stale records here
|
||||
+ if (type != null) this.world.a(this.player.getId(), this.g, -1); // Paper
|
||||
+ if (type != null) this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.g, type, packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying")); // Paper
|
||||
+ this.g = BlockPosition.ZERO; // Paper
|
||||
this.f = false;
|
||||
- if (!Objects.equals(this.h, blockposition)) {
|
||||
+ if (!Objects.equals(this.h, blockposition) && !BlockPosition.ZERO.equals(this.h)) {
|
||||
PlayerInteractManager.LOGGER.debug("Mismatch in destroy block pos: " + this.h + " " + blockposition); // CraftBukkit - SPIGOT-5457 sent by client when interact event cancelled
|
||||
- this.world.a(this.player.getId(), this.h, -1);
|
||||
- this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, this.world.getType(this.h), packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying"));
|
||||
+ IBlockData type = this.world.getTypeIfLoaded(this.h); // Paper - don't load unloaded chunks for stale records here
|
||||
+ if (type != null) this.world.a(this.player.getId(), this.h, -1); // Paper
|
||||
+ if (type != null) this.player.playerConnection.sendPacket(new PacketPlayOutBlockBreak(this.h, type, packetplayinblockdig_enumplayerdigtype, true, "aborted mismatched destroying")); // Paper
|
||||
+ this.h = BlockPosition.ZERO; // Paper
|
||||
}
|
||||
|
||||
this.world.a(this.player.getId(), blockposition, -1);
|
||||
|
||||
Reference in New Issue
Block a user