Don't send digged block updates for unloaded chunks

This commit is contained in:
Shane Freeder 2018-07-12 15:19:33 +01:00
parent 7bb3f45ce1
commit 73b214a515
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
6 changed files with 27 additions and 26 deletions

View File

@ -1,21 +1,22 @@
From 7ce94963f680709a18d9affef31d8e3c643f479e Mon Sep 17 00:00:00 2001 From 6b0a93e2ddfdb13b7aff806e071e79173d20b13b Mon Sep 17 00:00:00 2001
From: Michael Himing <mhiming@gmail.com> From: Michael Himing <mhiming@gmail.com>
Date: Sun, 8 Jan 2017 18:50:35 +1100 Date: Sun, 8 Jan 2017 18:50:35 +1100
Subject: [PATCH] Fix block break desync Subject: [PATCH] Fix block break desync
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 4f8865d61..9abc9852f 100644 index 4f8865d61..802008b4e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -868,6 +868,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -868,6 +868,8 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
double d3 = d0 * d0 + d1 * d1 + d2 * d2; double d3 = d0 * d0 + d1 * d1 + d2 * d2;
if (d3 > 36.0D) { if (d3 > 36.0D) {
+ if (worldserver.isChunkLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4, true)) // Paper - Fix block break desync - Don't send for unloaded chunks
+ this.sendPacket(new PacketPlayOutBlockChange(worldserver, blockposition)); // Paper - Fix block break desync + this.sendPacket(new PacketPlayOutBlockChange(worldserver, blockposition)); // Paper - Fix block break desync
return; return;
} else if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight()) { } else if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight()) {
return; return;
-- --
2.18.0 2.17.1

View File

@ -1,4 +1,4 @@
From 7833d5e3b594f444405a15f6b3c54c9042e19776 Mon Sep 17 00:00:00 2001 From 0ceac86ec4bac512cd1adfa907020fe976e96fff Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com> From: Zach Brown <zach.brown@destroystokyo.com>
Date: Tue, 16 May 2017 21:29:08 -0500 Date: Tue, 16 May 2017 21:29:08 -0500
Subject: [PATCH] Add option to make parrots stay on shoulders despite movement Subject: [PATCH] Add option to make parrots stay on shoulders despite movement
@ -39,10 +39,10 @@ index 0f1d99636..9cda8a177 100644
} }
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 9abc9852f..3104fc0ea 100644 index 802008b4e..6d733e153 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1514,6 +1514,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -1515,6 +1515,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
switch (packetplayinentityaction.b()) { switch (packetplayinentityaction.b()) {
case START_SNEAKING: case START_SNEAKING:
this.player.setSneaking(true); this.player.setSneaking(true);
@ -57,5 +57,5 @@ index 9abc9852f..3104fc0ea 100644
case STOP_SNEAKING: case STOP_SNEAKING:
-- --
2.18.0 2.17.1

View File

@ -1,4 +1,4 @@
From 28771b827cc057e201d9284b910b544de9f914fe Mon Sep 17 00:00:00 2001 From cab4c50ff2db0b82c32afadb8075dc5e5b3b5bad Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com> From: Shane Freeder <theboyetronic@gmail.com>
Date: Thu, 5 Oct 2017 01:54:07 +0100 Date: Thu, 5 Oct 2017 01:54:07 +0100
Subject: [PATCH] handle PacketPlayInKeepAlive async Subject: [PATCH] handle PacketPlayInKeepAlive async
@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing
random disconnections for clients. random disconnections for clients.
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index aa57ff8ed..869a2b402 100644 index 08211a54c..72474a88e 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2230,14 +2230,20 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -2231,14 +2231,20 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
} }
public void a(PacketPlayInKeepAlive packetplayinkeepalive) { public void a(PacketPlayInKeepAlive packetplayinkeepalive) {
@ -42,5 +42,5 @@ index aa57ff8ed..869a2b402 100644
} }
-- --
2.18.0 2.17.1

View File

@ -1,4 +1,4 @@
From 35b3a28d37d46a353ca2999caced2d500ec06c80 Mon Sep 17 00:00:00 2001 From d6b423ce8aea858a4e606fd70e440b302706c6f5 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Sun, 26 Nov 2017 13:19:58 -0500 Date: Sun, 26 Nov 2017 13:19:58 -0500
Subject: [PATCH] AsyncTabCompleteEvent Subject: [PATCH] AsyncTabCompleteEvent
@ -14,10 +14,10 @@ completion, such as offline players.
Also adds isCommand and getLocation to the sync TabCompleteEvent Also adds isCommand and getLocation to the sync TabCompleteEvent
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index 284db9b9e..e6d0c6366 100644 index e01013efd..74a665142 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2276,24 +2276,51 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -2277,24 +2277,51 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
// CraftBukkit end // CraftBukkit end
} }
@ -139,5 +139,5 @@ index 1e3aae3b8..95d13c146 100644
Waitable<List<String>> waitable = new Waitable<List<String>>() { Waitable<List<String>> waitable = new Waitable<List<String>>() {
@Override @Override
-- --
2.18.0 2.17.1

View File

@ -1,14 +1,14 @@
From b8dcd729a086f1323e3237cfbe207146d18e53fd Mon Sep 17 00:00:00 2001 From a1cad034bac6f2931248130c5a65a134a0ccb6b0 Mon Sep 17 00:00:00 2001
From: 0x22 <0x22@futureclient.net> From: 0x22 <0x22@futureclient.net>
Date: Thu, 26 Apr 2018 04:41:11 -0400 Date: Thu, 26 Apr 2018 04:41:11 -0400
Subject: [PATCH] Fix exploit that allowed colored signs to be created Subject: [PATCH] Fix exploit that allowed colored signs to be created
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index e6d0c6366..a5faa6a0a 100644 index 74a665142..4f82d8aae 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -2220,7 +2220,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -2221,7 +2221,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
String[] lines = new String[4]; String[] lines = new String[4];
for (int i = 0; i < astring.length; ++i) { for (int i = 0; i < astring.length; ++i) {
@ -18,5 +18,5 @@ index e6d0c6366..a5faa6a0a 100644
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines);
this.server.getPluginManager().callEvent(event); this.server.getPluginManager().callEvent(event);
-- --
2.18.0 2.17.1

View File

@ -1,4 +1,4 @@
From 97fe14fc8b4203d2ab460461e091251a1c8ac39b Mon Sep 17 00:00:00 2001 From 524a2e194ee6786f5eb97bbe758c03816a2abe3f Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co> From: Aikar <aikar@aikar.co>
Date: Tue, 3 Jul 2018 21:56:23 -0400 Date: Tue, 3 Jul 2018 21:56:23 -0400
Subject: [PATCH] InventoryCloseEvent Reason API Subject: [PATCH] InventoryCloseEvent Reason API
@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not. to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index 87d0d426f..71d0db3f3 100644 index 8c96e7318..3e80825f7 100644
--- a/src/main/java/net/minecraft/server/Chunk.java --- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -873,7 +873,7 @@ public class Chunk { @@ -873,7 +873,7 @@ public class Chunk {
@ -110,10 +110,10 @@ index cce3f98da..4ff505cfa 100644
this.r(); this.r();
} }
diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
index a5faa6a0a..96d2dee65 100644 index 4f82d8aae..3f1454ec6 100644
--- a/src/main/java/net/minecraft/server/PlayerConnection.java --- a/src/main/java/net/minecraft/server/PlayerConnection.java
+++ b/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java
@@ -1758,7 +1758,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -1759,7 +1759,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x()); PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.x());
if (this.player.isFrozen()) return; // CraftBukkit if (this.player.isFrozen()) return; // CraftBukkit
@ -193,5 +193,5 @@ index 248873fb4..cce4acc0b 100644
human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity()); human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity());
} }
-- --
2.18.0 2.17.1