Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
c5fa3f0d4 Add Adventure message to PlayerAdvancementDoneEvent (#5030)
69c09cdb0 Updated Upstream (CraftBukkit) (#5607)
This commit is contained in:
BillyGalbreath
2021-05-10 21:12:32 -05:00
parent e883991580
commit cb42dec0da
7 changed files with 45 additions and 72 deletions

View File

@@ -12977,7 +12977,7 @@ index a323b76f68c273a73cb3f20167a668b2100f4944..86f156587a0939b28c5cf6f64907255c
if (chunk != null) {
playerchunkmap.callbackExecutor.execute(() -> {
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0d05d3383 100644
index 6835401bd7863bbd655502547a9fd4ae0f298da1..33429be7da4d4c2b2469b8140e46e66d9921652c 100644
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
@@ -103,6 +103,7 @@ import net.minecraft.world.level.storage.WorldDataServer;
@@ -13624,7 +13624,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
protected void c(ChunkCoordIntPair chunkcoordintpair) {
this.executor.a(SystemUtils.a(() -> {
this.chunkDistanceManager.b(TicketType.LIGHT, chunkcoordintpair, 33 + ChunkStatus.a(ChunkStatus.FEATURES), chunkcoordintpair);
@@ -1470,9 +1546,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1478,9 +1554,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
chunk.B();
return chunk;
});
@@ -13635,7 +13635,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
}
public int c() {
@@ -1553,39 +1627,27 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1561,39 +1635,27 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
public void setViewDistance(int i) { // Paper - public
@@ -13680,7 +13680,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
if (entityplayer.world == this.world) {
if (flag1 && !flag) {
PlayerChunk playerchunk = this.getVisibleChunk(chunkcoordintpair.pair());
@@ -1609,7 +1671,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1617,7 +1679,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}
public int d() {
@@ -13689,7 +13689,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
}
protected PlayerChunkMap.a e() {
@@ -1681,7 +1743,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1689,7 +1751,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
if (Thread.currentThread() != com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE) {
com.destroystokyo.paper.io.PaperFileIOThread.Holder.INSTANCE.scheduleSave(
this.world, chunkcoordintpair.x, chunkcoordintpair.z, null, nbttagcompound,
@@ -13698,7 +13698,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
return;
}
super.write(chunkcoordintpair, nbttagcompound);
@@ -1765,6 +1827,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1773,6 +1835,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
return chunkHolder == null ? null : chunkHolder.getAvailableChunkNow();
}
// Paper end
@@ -13710,7 +13710,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
// Paper start - async io
@@ -1974,6 +2041,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1982,6 +2049,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
}*/ // Paper end - replaced by distance map
this.updateMaps(entityplayer); // Paper - distance maps
@@ -13718,7 +13718,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
}
@@ -1982,7 +2050,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -1990,7 +2058,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
// Paper start - per player view distance
// there can be potential desync with player's last mapped section and the view distance map, so use the
// view distance map here.
@@ -13727,7 +13727,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
if (inRange == null) {
return Stream.empty();
@@ -1998,8 +2066,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -2006,8 +2074,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
continue;
}
EntityPlayer player = (EntityPlayer)temp;
@@ -13739,7 +13739,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
int distX = Math.abs(MCUtil.getCoordinateX(lastPosition) - chunkcoordintpair.x);
int distZ = Math.abs(MCUtil.getCoordinateZ(lastPosition) - chunkcoordintpair.z);
@@ -2014,6 +2083,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -2022,6 +2091,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
continue;
}
EntityPlayer player = (EntityPlayer)temp;
@@ -13747,7 +13747,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
players.add(player);
}
}
@@ -2092,22 +2162,25 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
@@ -2100,22 +2170,25 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
private final void processTrackQueue() {
this.world.timings.tracker1.startTiming();
try {
@@ -13786,7 +13786,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
}
}
// Paper end - optimised tracker
@@ -2229,6 +2302,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -2237,6 +2310,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
apacket[1] = new PacketPlayOutLightUpdate(chunk.getPos(), this.lightEngine, true);
// Paper start - Fix MC-162253
@@ -13794,7 +13794,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
final int lightMask = getLightMask(chunk);
int i = 1;
for (int x = -1; x <= 1; x++) {
@@ -2253,10 +2327,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -2261,10 +2335,12 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
apacket[i] = new PacketPlayOutLightUpdate(new ChunkCoordIntPair(chunk.getPos().x + x, chunk.getPos().z + z), lightEngine, updateLightMask, 0, true);
}
}
@@ -13809,7 +13809,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
int j = 1;
for (int x = -1; x <= 1; x++) {
@@ -2281,6 +2357,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -2289,6 +2365,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
entityplayer.playerConnection.sendPacket(packet);
}
}
@@ -13817,7 +13817,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
// Paper end - Fix MC-162253
entityplayer.a(chunk.getPos(), apacket[0], apacket[1]);
@@ -2356,7 +2433,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -2364,7 +2441,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
// Paper start
// Replace trackedPlayers Set with a Map. The value is true until the player receives
// their first update (which is forced to have absolute coordinates), false afterward.
@@ -13826,7 +13826,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
public Set<EntityPlayer> trackedPlayers = trackedPlayerMap.keySet();
public EntityTracker(Entity entity, int i, int j, boolean flag) {
@@ -2457,7 +2534,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -2465,7 +2542,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
double vec3d_dy = entityplayer.locY() - this.tracker.locY();
double vec3d_dz = entityplayer.locZ() - this.tracker.locZ();
// Paper end - remove allocation of Vec3D here
@@ -13835,7 +13835,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
boolean flag = vec3d_dx >= (double) (-i) && vec3d_dx <= (double) i && vec3d_dz >= (double) (-i) && vec3d_dz <= (double) i && this.tracker.a(entityplayer); // Paper - remove allocation of Vec3D here
if (flag) {
@@ -2467,7 +2544,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -2475,7 +2552,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair());
@@ -13844,7 +13844,7 @@ index 300884804bf9ac3fba7c30a04d8adf52e3dd2e3e..b28995ecfd7f45e6b6197be96c418aa0
flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance;
}
}
@@ -2507,7 +2584,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
@@ -2515,7 +2592,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
int j = entity.getEntityType().getChunkRange() * 16;
j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper