diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index cb282d5a09..c245bcda4b 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -1,4 +1,4 @@ -From 49bcf6b220a0a6ab0d6a7fbbc54953b15e81a467 Mon Sep 17 00:00:00 2001 +From cd1f391366035ee68c3eb7e2a1aa5ba19c2d7da2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:55:47 -0400 Subject: [PATCH] MC Utils @@ -6,7 +6,7 @@ Subject: [PATCH] MC Utils diff --git a/src/main/java/com/destroystokyo/paper/util/concurrent/WeakSeqLock.java b/src/main/java/com/destroystokyo/paper/util/concurrent/WeakSeqLock.java new file mode 100644 -index 0000000000..4029dc68cf +index 000000000..4029dc68c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/concurrent/WeakSeqLock.java @@ -0,0 +1,68 @@ @@ -80,7 +80,7 @@ index 0000000000..4029dc68cf +} diff --git a/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Int.java b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Int.java new file mode 100644 -index 0000000000..968c9ed328 +index 000000000..968c9ed32 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Int.java @@ -0,0 +1,156 @@ @@ -242,7 +242,7 @@ index 0000000000..968c9ed328 +} diff --git a/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java new file mode 100644 -index 0000000000..07685b6bd5 +index 000000000..07685b6bd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/map/QueuedChangesMapLong2Object.java @@ -0,0 +1,172 @@ @@ -420,7 +420,7 @@ index 0000000000..07685b6bd5 +} diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java new file mode 100644 -index 0000000000..4ec248adb6 +index 000000000..4ec248adb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/maplist/ChunkList.java @@ -0,0 +1,127 @@ @@ -553,7 +553,7 @@ index 0000000000..4ec248adb6 +} diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java new file mode 100644 -index 0000000000..f3cb346c9d +index 000000000..f3cb346c9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java @@ -0,0 +1,126 @@ @@ -685,7 +685,7 @@ index 0000000000..f3cb346c9d +} diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java new file mode 100644 -index 0000000000..c2f7e4ca0f +index 000000000..c2f7e4ca0 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java @@ -0,0 +1,126 @@ @@ -817,7 +817,7 @@ index 0000000000..c2f7e4ca0f +} diff --git a/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java new file mode 100644 -index 0000000000..5a44bc644b +index 000000000..5a44bc644 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/misc/AreaMap.java @@ -0,0 +1,389 @@ @@ -1212,7 +1212,7 @@ index 0000000000..5a44bc644b +} diff --git a/src/main/java/com/destroystokyo/paper/util/misc/PlayerAreaMap.java b/src/main/java/com/destroystokyo/paper/util/misc/PlayerAreaMap.java new file mode 100644 -index 0000000000..8a552a87ab +index 000000000..8a552a87a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/misc/PlayerAreaMap.java @@ -0,0 +1,27 @@ @@ -1245,7 +1245,7 @@ index 0000000000..8a552a87ab +} diff --git a/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java b/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java new file mode 100644 -index 0000000000..5f2d88797d +index 000000000..5f2d88797 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/misc/PooledLinkedHashSets.java @@ -0,0 +1,289 @@ @@ -1540,7 +1540,7 @@ index 0000000000..5f2d88797d +} diff --git a/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java new file mode 100644 -index 0000000000..4d74a7a908 +index 000000000..4d74a7a90 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/set/OptimizedSmallEnumSet.java @@ -0,0 +1,65 @@ @@ -1610,7 +1610,7 @@ index 0000000000..4d74a7a908 + } +} diff --git a/src/main/java/net/minecraft/server/BlockAccessAir.java b/src/main/java/net/minecraft/server/BlockAccessAir.java -index eff6ebcd30..30cbfc8eac 100644 +index eff6ebcd3..30cbfc8ea 100644 --- a/src/main/java/net/minecraft/server/BlockAccessAir.java +++ b/src/main/java/net/minecraft/server/BlockAccessAir.java @@ -14,6 +14,18 @@ public enum BlockAccessAir implements IBlockAccess { @@ -1633,7 +1633,7 @@ index eff6ebcd30..30cbfc8eac 100644 public IBlockData getType(BlockPosition blockposition) { return Blocks.AIR.getBlockData(); diff --git a/src/main/java/net/minecraft/server/BlockDataAbstract.java b/src/main/java/net/minecraft/server/BlockDataAbstract.java -index 1cf97cefc9..2040f18349 100644 +index 1cf97cefc..2040f1834 100644 --- a/src/main/java/net/minecraft/server/BlockDataAbstract.java +++ b/src/main/java/net/minecraft/server/BlockDataAbstract.java @@ -78,6 +78,7 @@ public abstract class BlockDataAbstract implements IBlockDataHolder { @@ -1645,7 +1645,7 @@ index 1cf97cefc9..2040f18349 100644 return this.d.containsKey(iblockstate); } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index c88a62f6b7..5dbd3e60fe 100644 +index c88a62f6b..5dbd3e60f 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -120,6 +120,7 @@ public class BlockPosition extends BaseBlockPosition implements MinecraftSeriali @@ -1700,7 +1700,7 @@ index c88a62f6b7..5dbd3e60fe 100644 this.d = i; } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 55373cae07..a263f60d49 100644 +index 55373cae0..a263f60d4 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -25,7 +25,7 @@ import org.apache.logging.log4j.Logger; @@ -1794,7 +1794,7 @@ index 55373cae07..a263f60d49 100644 org.bukkit.event.world.ChunkUnloadEvent unloadEvent = new org.bukkit.event.world.ChunkUnloadEvent(this.bukkitChunk, this.isNeedsSaving()); server.getPluginManager().callEvent(unloadEvent); diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java -index 11c4d23ba9..53c15c1c0b 100644 +index 11c4d23ba..53c15c1c0 100644 --- a/src/main/java/net/minecraft/server/ChunkCache.java +++ b/src/main/java/net/minecraft/server/ChunkCache.java @@ -8,7 +8,7 @@ public class ChunkCache implements IBlockAccess, ICollisionAccess { @@ -1828,7 +1828,7 @@ index 11c4d23ba9..53c15c1c0b 100644 @Override public TileEntity getTileEntity(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 260644bf0b..f2a19acd84 100644 +index 260644bf0..f2a19acd8 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java @@ -31,7 +31,9 @@ public class ChunkCoordIntPair { @@ -1843,7 +1843,7 @@ index 260644bf0b..f2a19acd84 100644 } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index e8b7cc06c2..d24c8070f4 100644 +index e8b7cc06c..4dd804e9c 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -23,7 +23,7 @@ public class ChunkProviderServer extends IChunkProvider { @@ -1944,7 +1944,7 @@ index e8b7cc06c2..d24c8070f4 100644 public ChunkProviderServer(WorldServer worldserver, File file, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, WorldLoadListener worldloadlistener, Supplier supplier) { this.world = worldserver; this.serverThreadQueue = new ChunkProviderServer.a(worldserver); -@@ -77,6 +159,51 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -77,6 +159,49 @@ public class ChunkProviderServer extends IChunkProvider { this.cacheChunk[0] = ichunkaccess; } @@ -1954,7 +1954,20 @@ index e8b7cc06c2..d24c8070f4 100644 + public Chunk getChunkAtIfCachedImmediately(int x, int z) { + long k = ChunkCoordIntPair.pair(x, z); + -+ // Paper start - Optimize getIfLoaded type calls ++ // Note: Bypass cache since we need to check ticket level, and to make this MT-Safe ++ ++ PlayerChunk playerChunk = this.getChunk(k); ++ if (playerChunk == null) { ++ return null; ++ } ++ ++ return playerChunk.getFullChunkIfCached(); ++ } ++ ++ @Nullable ++ public Chunk getChunkAtIfLoadedImmediately(int x, int z) { ++ long k = ChunkCoordIntPair.pair(x, z); ++ + if (Thread.currentThread() == this.serverThread) { + return this.getChunkAtIfLoadedMainThread(x, z); + } @@ -1975,21 +1988,6 @@ index e8b7cc06c2..d24c8070f4 100644 + } while (!this.loadedChunkMapSeqLock.tryReleaseRead(readlock)); + + return ret; -+ // Paper end -+ } -+ -+ @Nullable -+ public Chunk getChunkAtIfLoadedImmediately(int x, int z) { -+ long k = ChunkCoordIntPair.pair(x, z); -+ -+ // Note: Bypass cache since we need to check ticket level, and to make this MT-Safe -+ -+ PlayerChunk playerChunk = this.getChunk(k); -+ if (playerChunk == null) { -+ return null; -+ } -+ -+ return playerChunk.getFullChunk(); + } + // Paper end + @@ -1997,7 +1995,7 @@ index e8b7cc06c2..d24c8070f4 100644 @Override public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) { diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 7ca3a1d0c5..2edd9b8714 100644 +index 7ca3a1d0c..2edd9b871 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -83,6 +83,7 @@ public class DataBits { @@ -2009,7 +2007,7 @@ index 7ca3a1d0c5..2edd9b8714 100644 return this.a; } diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java -index 75ba698868..45403fbe30 100644 +index 75ba69886..45403fbe3 100644 --- a/src/main/java/net/minecraft/server/DataPalette.java +++ b/src/main/java/net/minecraft/server/DataPalette.java @@ -4,10 +4,12 @@ import javax.annotation.Nullable; @@ -2026,7 +2024,7 @@ index 75ba698868..45403fbe30 100644 T a(int i); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 774a8f5434..d5f5a51872 100644 +index 774a8f543..d5f5a5187 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -11,7 +11,7 @@ import java.util.stream.Collectors; @@ -2068,7 +2066,7 @@ index 774a8f5434..d5f5a51872 100644 this.a(); packetdataserializer.writeByte(this.i); diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index fe69161e5b..b40c8d2f83 100644 +index fe69161e5..b40c8d2f8 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -6,6 +6,8 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -2081,7 +2079,7 @@ index fe69161e5b..b40c8d2f83 100644 super(entitytypes, world); } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index e1398652a0..7ee5eb987a 100644 +index e1398652a..7ee5eb987 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -144,6 +144,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -2093,7 +2091,7 @@ index e1398652a0..7ee5eb987a 100644 // CraftBukkit start - fire event setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 3b1bcf3495..1f350e3352 100644 +index 3b1bcf349..1f350e335 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -129,6 +129,7 @@ public abstract class EntityLiving extends Entity { @@ -2105,7 +2103,7 @@ index 3b1bcf3495..1f350e3352 100644 @Override public float getBukkitYaw() { diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index 00c3b666d7..e5322fbae5 100644 +index 00c3b666d..e5322fbae 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -5,6 +5,7 @@ import java.util.function.Predicate; @@ -2117,7 +2115,7 @@ index 00c3b666d7..e5322fbae5 100644 super(entitytypes, world); this.f = 5; diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ce48210922..57ce9bde64 100644 +index ce4821092..57ce9bde6 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -87,6 +87,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -2139,7 +2137,7 @@ index ce48210922..57ce9bde64 100644 this.displayName = this.getName(); this.canPickUpLoot = true; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index f937b72945..cbf0c2f25d 100644 +index f937b7294..cbf0c2f25 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -4,6 +4,7 @@ import com.mojang.datafixers.DataFixUtils; @@ -2162,7 +2160,7 @@ index f937b72945..cbf0c2f25d 100644 } diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index 1890c760f9..7e5ece9d50 100644 +index 1890c760f..7e5ece9d5 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -68,6 +68,15 @@ public abstract class IAsyncTaskHandler implements Mailbox h = new CompletableFuture(); diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java -index ba315131e1..cbe2aa4c0a 100644 +index ba315131e..cbe2aa4c0 100644 --- a/src/main/java/net/minecraft/server/IWorldReader.java +++ b/src/main/java/net/minecraft/server/IWorldReader.java @@ -4,6 +4,7 @@ import javax.annotation.Nullable; @@ -2236,7 +2234,7 @@ index ba315131e1..cbe2aa4c0a 100644 IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 75308712d0..aa7501d366 100644 +index 75308712d..aa7501d36 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -37,10 +37,19 @@ import org.bukkit.event.world.StructureGrowEvent; @@ -2296,7 +2294,7 @@ index 75308712d0..aa7501d366 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 -index 0000000000..9fa88d79d8 +index 000000000..9fa88d79d --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +1,386 @@ @@ -2687,7 +2685,7 @@ index 0000000000..9fa88d79d8 + } +} diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index e85b24a327..75604dbc69 100644 +index e85b24a32..75604dbc6 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -60,7 +60,7 @@ public class NBTTagCompound implements NBTBase { @@ -2716,7 +2714,7 @@ index e85b24a327..75604dbc69 100644 return new UUID(this.getLong(s + "Most"), this.getLong(s + "Least")); } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 6700582e36..3ccf166366 100644 +index 6700582e3..3ccf16636 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -159,6 +159,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -2748,7 +2746,7 @@ index 6700582e36..3ccf166366 100644 public QueuedPacket(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { this.a = packet; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index 81b6f4581f..d9574a9ace 100644 +index 81b6f4581..d9574a9ac 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -33,6 +33,7 @@ public class PacketDataSerializer extends ByteBuf { @@ -2760,7 +2758,7 @@ index 81b6f4581f..d9574a9ace 100644 for (int j = 1; j < 5; ++j) { if ((i & -1 << j * 7) == 0) { diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index 90223deae3..63c4dbd327 100644 +index 90223deae..63c4dbd32 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java @@ -42,6 +42,7 @@ public class PacketEncoder extends MessageToByteEncoder> { @@ -2772,7 +2770,7 @@ index 90223deae3..63c4dbd327 100644 throw new SkipEncodeException(throwable); } else { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 677e3e5f68..3a1d0deb0d 100644 +index 677e3e5f6..3a1d0deb0 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -17,7 +17,7 @@ public class PacketPlayOutMapChunk implements Packet { @@ -2793,7 +2791,7 @@ index 677e3e5f68..3a1d0deb0d 100644 int j = 0; ChunkSection[] achunksection = chunk.getSections(); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 775359146f..3093154bb7 100644 +index 775359146..3093154bb 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -19,9 +19,9 @@ public class PlayerChunk { @@ -2965,7 +2963,7 @@ index 775359146f..3093154bb7 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index b5a3b10012..e248893717 100644 +index b5a3b1001..e24889371 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -99,6 +99,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -3014,7 +3012,7 @@ index b5a3b10012..e248893717 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ba02935128..b257e1c4e9 100644 +index ba0293512..b257e1c4e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -3031,7 +3029,7 @@ index ba02935128..b257e1c4e9 100644 private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java -index 08768a3c87..d103cfaace 100644 +index 08768a3c8..d103cfaac 100644 --- a/src/main/java/net/minecraft/server/PlayerInventory.java +++ b/src/main/java/net/minecraft/server/PlayerInventory.java @@ -17,7 +17,7 @@ public class PlayerInventory implements IInventory, INamableTileEntity { @@ -3044,7 +3042,7 @@ index 08768a3c87..d103cfaace 100644 public final EntityHuman player; private ItemStack carried; diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java -index b3824898da..bf4172be52 100644 +index b3824898d..bf4172be5 100644 --- a/src/main/java/net/minecraft/server/PotionUtil.java +++ b/src/main/java/net/minecraft/server/PotionUtil.java @@ -110,6 +110,7 @@ public class PotionUtil { @@ -3056,7 +3054,7 @@ index b3824898da..bf4172be52 100644 MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry); diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 6e65306a27..39339fa275 100644 +index 6e65306a2..39339fa27 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -80,6 +80,18 @@ public class ProtoChunk implements IChunkAccess { @@ -3079,7 +3077,7 @@ index 6e65306a27..39339fa275 100644 public IBlockData getType(BlockPosition blockposition) { int i = blockposition.getY(); diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 7b6e0e86b0..187c4e0f58 100644 +index 7b6e0e86b..187c4e0f5 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -88,6 +88,7 @@ public class RegionFile implements AutoCloseable { @@ -3091,7 +3089,7 @@ index 7b6e0e86b0..187c4e0f58 100644 public synchronized DataInputStream a(ChunkCoordIntPair chunkcoordintpair) throws IOException { int i = this.getOffset(chunkcoordintpair); diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java -index 8c123f265e..9d0e8c2d43 100644 +index 8c123f265..9d0e8c2d4 100644 --- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java @@ -108,6 +108,26 @@ public class RegionLimitedWorldAccess implements GeneratorAccess { @@ -3122,7 +3120,7 @@ index 8c123f265e..9d0e8c2d43 100644 public IBlockData getType(BlockPosition blockposition) { return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4).getType(blockposition); diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index 4efcb8b595..60948afa4e 100644 +index 4efcb8b59..60948afa4 100644 --- a/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java @@ -57,6 +57,7 @@ public class RegistryBlockID implements Registry { @@ -3134,7 +3132,7 @@ index 4efcb8b595..60948afa4e 100644 return this.b.size(); } diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 7b92ecfff9..7e224ebeff 100644 +index 7b92ecfff..7e224ebef 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java @@ -58,7 +58,7 @@ public class SystemUtils { @@ -3147,7 +3145,7 @@ index 7b92ecfff9..7e224ebeff 100644 public static long getTimeMillis() { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f0deeb3d28..304dfac061 100644 +index f0deeb3d2..304dfac06 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot @@ -3211,7 +3209,7 @@ index f0deeb3d28..304dfac061 100644 return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0)); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 32f8f2aed5..2aaf679df4 100644 +index 32f8f2aed..2aaf679df 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -973,6 +973,7 @@ public class WorldServer extends World { @@ -3231,7 +3229,7 @@ index 32f8f2aed5..2aaf679df4 100644 this.getScoreboard().a(entity); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index e181df6f4d..4a9132c701 100644 +index e181df6f4..4a9132c70 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -85,6 +85,7 @@ public final class CraftItemStack extends ItemStack { @@ -3243,7 +3241,7 @@ index e181df6f4d..4a9132c701 100644 /** * Mirror diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java -index d8358a0f03..d0b813008c 100644 +index d8358a0f0..d0b813008 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java @@ -196,4 +196,22 @@ public class DummyGeneratorAccess implements GeneratorAccess { @@ -3270,7 +3268,7 @@ index d8358a0f03..d0b813008c 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java -index 1aec70a1f1..f72c13beda 100644 +index 1aec70a1f..f72c13bed 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java +++ b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java @@ -17,7 +17,7 @@ import java.util.RandomAccess; @@ -3283,5 +3281,5 @@ index 1aec70a1f1..f72c13beda 100644 private int initialCapacity; -- -2.25.0 +2.25.0.windows.1 diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index 3a9a6708c9..c63baae79b 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -1,4 +1,4 @@ -From 58a9ac42261c7614a19aef2e5303912a59027b5d Mon Sep 17 00:00:00 2001 +From 90208679a7f12b67d2c5cab6d310144554d78d2e Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 3 Mar 2016 04:00:11 -0600 Subject: [PATCH] Timings v2 @@ -6,7 +6,7 @@ Subject: [PATCH] Timings v2 diff --git a/src/main/java/co/aikar/timings/MinecraftTimings.java b/src/main/java/co/aikar/timings/MinecraftTimings.java new file mode 100644 -index 0000000000..69e26a8267 +index 000000000..69e26a826 --- /dev/null +++ b/src/main/java/co/aikar/timings/MinecraftTimings.java @@ -0,0 +1,141 @@ @@ -153,7 +153,7 @@ index 0000000000..69e26a8267 +} diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java new file mode 100644 -index 0000000000..3a79cde595 +index 000000000..3a79cde59 --- /dev/null +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -0,0 +1,130 @@ @@ -288,7 +288,7 @@ index 0000000000..3a79cde595 + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index b6d470e594..f402a29b09 100644 +index b6d470e59..f402a29b0 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -14,11 +14,14 @@ import java.util.concurrent.TimeUnit; @@ -335,7 +335,7 @@ index b6d470e594..f402a29b09 100644 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index cd72a9c845..5de881371a 100644 +index cd72a9c84..5de881371 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -31,6 +31,15 @@ public class Block implements IMaterial { @@ -355,7 +355,7 @@ index cd72a9c845..5de881371a 100644 private final float frictionFactor; private final float f; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 4110b6fa39..2ebbcc6958 100644 +index 4110b6fa3..2ebbcc695 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -574,6 +574,7 @@ public class Chunk implements IChunkAccess { @@ -375,10 +375,10 @@ index 4110b6fa39..2ebbcc6958 100644 } } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index d24c8070f4..1ba34cfaa9 100644 +index 4dd804e9c..b09868e2d 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -229,11 +229,13 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -227,11 +227,13 @@ public class ChunkProviderServer extends IChunkProvider { } gameprofilerfiller.c("getChunkCacheMiss"); @@ -394,7 +394,7 @@ index d24c8070f4..1ba34cfaa9 100644 ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { return ichunkaccess1; }, (playerchunk_failure) -> { -@@ -426,7 +428,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -424,7 +426,9 @@ public class ChunkProviderServer extends IChunkProvider { public void save(boolean flag) { this.tickDistanceManager(); @@ -404,7 +404,7 @@ index d24c8070f4..1ba34cfaa9 100644 } @Override -@@ -463,7 +467,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -461,7 +465,9 @@ public class ChunkProviderServer extends IChunkProvider { this.tickDistanceManager(); this.world.timings.doChunkMap.stopTiming(); // Spigot this.world.getMethodProfiler().exitEnter("chunks"); @@ -414,7 +414,7 @@ index d24c8070f4..1ba34cfaa9 100644 this.world.timings.doChunkUnload.startTiming(); // Spigot this.world.getMethodProfiler().exitEnter("unload"); this.playerChunkMap.unloadChunks(booleansupplier); -@@ -488,10 +494,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -486,10 +492,12 @@ public class ChunkProviderServer extends IChunkProvider { boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit // PAIL: TODO monster ticks this.world.getMethodProfiler().enter("naturalSpawnCount"); @@ -427,7 +427,7 @@ index d24c8070f4..1ba34cfaa9 100644 this.world.getMethodProfiler().exit(); this.playerChunkMap.f().forEach((playerchunk) -> { Optional optional = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left(); -@@ -500,13 +508,27 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -498,13 +506,27 @@ public class ChunkProviderServer extends IChunkProvider { Chunk chunk = (Chunk) optional.get(); this.world.getMethodProfiler().enter("broadcast"); @@ -457,7 +457,7 @@ index d24c8070f4..1ba34cfaa9 100644 this.world.getMethodProfiler().enter("spawner"); this.world.timings.mobSpawn.startTiming(); // Spigot EnumCreatureType[] aenumcreaturetype1 = aenumcreaturetype; -@@ -550,24 +572,24 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -548,24 +570,24 @@ public class ChunkProviderServer extends IChunkProvider { this.world.getMethodProfiler().exit(); } @@ -487,7 +487,7 @@ index d24c8070f4..1ba34cfaa9 100644 @Override diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index e16d30f2ca..4af5a230ba 100644 +index e16d30f2c..4af5a230b 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -1,5 +1,6 @@ @@ -525,7 +525,7 @@ index e16d30f2ca..4af5a230ba 100644 } diff --git a/src/main/java/net/minecraft/server/CustomFunction.java b/src/main/java/net/minecraft/server/CustomFunction.java -index 8d7a6d2403..707bd2600d 100644 +index 8d7a6d240..707bd2600 100644 --- a/src/main/java/net/minecraft/server/CustomFunction.java +++ b/src/main/java/net/minecraft/server/CustomFunction.java @@ -13,12 +13,22 @@ public class CustomFunction { @@ -552,7 +552,7 @@ index 8d7a6d2403..707bd2600d 100644 return this.b; } diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java -index ba40d5fbb5..ee42e1dfa4 100644 +index ba40d5fbb..ee42e1dfa 100644 --- a/src/main/java/net/minecraft/server/CustomFunctionData.java +++ b/src/main/java/net/minecraft/server/CustomFunctionData.java @@ -103,7 +103,7 @@ public class CustomFunctionData implements IResourcePackListener { @@ -565,7 +565,7 @@ index ba40d5fbb5..ee42e1dfa4 100644 int k = 0; CustomFunction.c[] acustomfunction_c = customfunction.b(); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 9eed98e379..d6646d7e61 100644 +index 9eed98e37..d6646d7e6 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -20,6 +20,8 @@ import java.util.List; @@ -653,7 +653,7 @@ index 9eed98e379..d6646d7e61 100644 } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 306724e693..5635192f7c 100644 +index 306724e69..5635192f7 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender; @@ -692,7 +692,7 @@ index 306724e693..5635192f7c 100644 protected BlockPosition ag() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1f350e3352..35e3f1c78d 100644 +index 1f350e335..35e3f1c78 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -37,7 +37,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -768,7 +768,7 @@ index 1f350e3352..35e3f1c78d 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b4a0bd7951..4dc6917759 100644 +index b4a0bd795..4dc691775 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -63,7 +63,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -944,7 +944,7 @@ index b4a0bd7951..4dc6917759 100644 this.methodProfiler.exit(); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index e248893717..1f289047fa 100644 +index e24889371..1f289047f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1,7 +1,9 @@ @@ -1027,7 +1027,7 @@ index e248893717..1f289047fa 100644 protected void broadcast(Entity entity, Packet packet) { diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index b257e1c4e9..b7beb058d8 100644 +index b257e1c4e..b7beb058d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -58,6 +58,7 @@ import org.bukkit.inventory.CraftingInventory; @@ -1082,7 +1082,7 @@ index b257e1c4e9..b7beb058d8 100644 // this.minecraftServer.getCommandDispatcher().a(this.player.getCommandListener(), s); // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java -index 2c671629a4..eb3269e0ea 100644 +index 2c671629a..eb3269e0e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnectionUtils.java +++ b/src/main/java/net/minecraft/server/PlayerConnectionUtils.java @@ -2,6 +2,8 @@ package net.minecraft.server; @@ -1109,7 +1109,7 @@ index 2c671629a4..eb3269e0ea 100644 PlayerConnectionUtils.LOGGER.debug("Ignoring packet due to disconnection: " + packet); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0694f4563e..1652a57e25 100644 +index 0694f4563..1652a57e2 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1,5 +1,6 @@ @@ -1133,7 +1133,7 @@ index 0694f4563e..1652a57e25 100644 public WhiteList getWhitelist() { diff --git a/src/main/java/net/minecraft/server/TickListServer.java b/src/main/java/net/minecraft/server/TickListServer.java -index 00bbd34b6a..f533860bbe 100644 +index 00bbd34b6..f533860bb 100644 --- a/src/main/java/net/minecraft/server/TickListServer.java +++ b/src/main/java/net/minecraft/server/TickListServer.java @@ -28,13 +28,18 @@ public class TickListServer implements TickList { @@ -1183,7 +1183,7 @@ index 00bbd34b6a..f533860bbe 100644 this.g.clear(); } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 820180ab3f..fa6400dccd 100644 +index 820180ab3..fa6400dcc 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -9,11 +9,12 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer; @@ -1202,7 +1202,7 @@ index 820180ab3f..fa6400dccd 100644 private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public CraftPersistentDataContainer persistentDataContainer; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 304dfac061..da3eb20d45 100644 +index 304dfac06..da3eb20d4 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,5 +1,7 @@ @@ -1258,7 +1258,7 @@ index 304dfac061..da3eb20d45 100644 CrashReport crashreport = CrashReport.a(throwable, "Ticking entity"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being ticked"); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 2aaf679df4..ebc252a610 100644 +index 2aaf679df..ebc252a61 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -1,6 +1,8 @@ @@ -1383,7 +1383,7 @@ index 2aaf679df4..ebc252a610 100644 // CraftBukkit start - moved from MinecraftServer.saveChunks diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 57ad50403b..038928789b 100644 +index 57ad50403..038928789 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1935,12 +1935,31 @@ public final class CraftServer implements Server { @@ -1420,7 +1420,7 @@ index 57ad50403b..038928789b 100644 org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java b/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java deleted file mode 100644 -index 2bd22a3698..0000000000 +index 2bd22a369..000000000 --- a/src/main/java/org/bukkit/craftbukkit/SpigotTimings.java +++ /dev/null @@ -1,162 +0,0 @@ @@ -1587,7 +1587,7 @@ index 2bd22a3698..0000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9eba8449e4..1094190fd9 100644 +index 9eba8449e..1094190fd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1753,6 +1753,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1606,7 +1606,7 @@ index 9eba8449e4..1094190fd9 100644 public Player.Spigot spigot() diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index b90979c7ba..8823f94f7b 100644 +index b90979c7b..8823f94f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -1,5 +1,6 @@ @@ -1672,7 +1672,7 @@ index b90979c7ba..8823f94f7b 100644 private boolean isReady(final int currentTick) { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java -index 3f55381c15..0d9a466809 100644 +index 3f55381c1..0d9a46680 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftTask.java @@ -1,9 +1,11 @@ @@ -1757,7 +1757,7 @@ index 3f55381c15..0d9a466809 100644 - // Spigot end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java -index e52ef47b78..3d90b34268 100644 +index e52ef47b7..3d90b3426 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftIconCache.java @@ -5,6 +5,7 @@ import org.bukkit.util.CachedServerIcon; @@ -1769,7 +1769,7 @@ index e52ef47b78..3d90b34268 100644 this.value = value; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index afe4004ff2..1c719ec0e3 100644 +index afe4004ff..1c719ec0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -290,6 +290,13 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -1787,7 +1787,7 @@ index afe4004ff2..1c719ec0e3 100644 * This helper class represents the different NBT Tags. *

diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index ca7789b5e0..4423839697 100644 +index ca7789b5e..442383969 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -31,7 +31,7 @@ import net.minecraft.server.EntityWither; @@ -1848,5 +1848,5 @@ index ca7789b5e0..4423839697 100644 } } -- -2.25.0 +2.25.0.windows.1 diff --git a/Spigot-Server-Patches/0382-incremental-chunk-saving.patch b/Spigot-Server-Patches/0382-incremental-chunk-saving.patch index 487c226fa2..a315295e80 100644 --- a/Spigot-Server-Patches/0382-incremental-chunk-saving.patch +++ b/Spigot-Server-Patches/0382-incremental-chunk-saving.patch @@ -1,11 +1,11 @@ -From 42b7bda5cbafcb1c1ac04c305d09a038e5b9f435 Mon Sep 17 00:00:00 2001 +From 2184f971f556507ea8be9b037a40072e656de3e2 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 9 Jun 2019 03:53:22 +0100 Subject: [PATCH] incremental chunk saving diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 071e5e7f72..4867615215 100644 +index 071e5e7f7..486761521 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -487,4 +487,19 @@ public class PaperWorldConfig { @@ -29,7 +29,7 @@ index 071e5e7f72..4867615215 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index d9c53cdc4b..76e87c211b 100644 +index d9c53cdc4..76e87c211 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -42,7 +42,7 @@ public class Chunk implements IChunkAccess { @@ -42,10 +42,10 @@ index d9c53cdc4b..76e87c211b 100644 private long inhabitedTime; @Nullable diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 35153af515..191b2759a0 100644 +index da0f3ada2..13a08bbfb 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -436,6 +436,15 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -434,6 +434,15 @@ public class ChunkProviderServer extends IChunkProvider { } // Paper - Timings } @@ -62,7 +62,7 @@ index 35153af515..191b2759a0 100644 public void close() throws IOException { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index eaa26e1a50..6fa08c60bd 100644 +index eaa26e1a5..6fa08c60b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -168,6 +168,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 3a0f0314b2..c91312facf 100644 +index 3a0f0314b..c91312fac 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -40,6 +40,9 @@ public class PlayerChunk { @@ -175,7 +175,7 @@ index 3a0f0314b2..c91312facf 100644 public void a(ProtoChunkExtension protochunkextension) { for (int i = 0; i < this.statusFutures.length(); ++i) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 803fda511f..40d80f3810 100644 +index 803fda511..40d80f381 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -331,6 +331,64 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -261,7 +261,7 @@ index 803fda511f..40d80f3810 100644 return PlayerChunk.getChunkState(playerchunk.getTicketLevel()); }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 32da4eb4e0..fae30a1c1b 100644 +index 32da4eb4e..fae30a1c1 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -810,11 +810,44 @@ public class WorldServer extends World { diff --git a/Spigot-Server-Patches/0384-Fix-World-isChunkGenerated-calls.patch b/Spigot-Server-Patches/0384-Fix-World-isChunkGenerated-calls.patch index 24c5a015ad..dd86911172 100644 --- a/Spigot-Server-Patches/0384-Fix-World-isChunkGenerated-calls.patch +++ b/Spigot-Server-Patches/0384-Fix-World-isChunkGenerated-calls.patch @@ -1,4 +1,4 @@ -From 778b5824bbdcb4d38ddddc037e4687ba6ae2aebd Mon Sep 17 00:00:00 2001 +From f7e6bb30049e6b337faab23843840a9f5759dbac Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 15 Jun 2019 08:54:33 -0700 Subject: [PATCH] Fix World#isChunkGenerated calls @@ -8,7 +8,7 @@ This patch also adds a chunk status cache on region files (note that its only purpose is to cache the status on DISK) diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 191b2759a0..9e75647953 100644 +index 13a08bbfb..57463425a 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -28,7 +28,7 @@ public class ChunkProviderServer extends IChunkProvider { @@ -20,9 +20,9 @@ index 191b2759a0..9e75647953 100644 public final PlayerChunkMap playerChunkMap; private final WorldPersistentData worldPersistentData; private long lastTickTime; -@@ -205,6 +205,21 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -203,6 +203,21 @@ public class ChunkProviderServer extends IChunkProvider { - return playerChunk.getFullChunk(); + return ret; } + + @Nullable @@ -43,7 +43,7 @@ index 191b2759a0..9e75647953 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 6371f2f5b1..961228e9df 100644 +index 6371f2f5b..961228e9d 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -391,6 +391,17 @@ public class ChunkRegionLoader { @@ -65,7 +65,7 @@ index 6371f2f5b1..961228e9df 100644 if (nbttagcompound != null) { ChunkStatus chunkstatus = ChunkStatus.a(nbttagcompound.getCompound("Level").getString("Status")); diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index efdf611e66..134a4f0b7d 100644 +index efdf611e6..134a4f0b7 100644 --- a/src/main/java/net/minecraft/server/ChunkStatus.java +++ b/src/main/java/net/minecraft/server/ChunkStatus.java @@ -176,6 +176,7 @@ public class ChunkStatus { @@ -95,7 +95,7 @@ index efdf611e66..134a4f0b7d 100644 return (ChunkStatus) IRegistry.CHUNK_STATUS.get(MinecraftKey.a(s)); } diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java -index f0a052eec2..2f95174fcc 100644 +index f0a052eec..2f95174fc 100644 --- a/src/main/java/net/minecraft/server/IChunkLoader.java +++ b/src/main/java/net/minecraft/server/IChunkLoader.java @@ -8,7 +8,7 @@ import javax.annotation.Nullable; @@ -108,7 +108,7 @@ index f0a052eec2..2f95174fcc 100644 @Nullable private PersistentStructureLegacy c; diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index c91312facf..5108d3ee98 100644 +index c91312fac..5108d3ee9 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -114,6 +114,19 @@ public class PlayerChunk { @@ -132,7 +132,7 @@ index c91312facf..5108d3ee98 100644 public CompletableFuture> getStatusFutureUnchecked(ChunkStatus chunkstatus) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 40d80f3810..6c4804232a 100644 +index 40d80f381..6c4804232 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -967,12 +967,62 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -201,7 +201,7 @@ index 40d80f3810..6c4804232a 100644 // Spigot start return isOutsideOfRange(chunkcoordintpair, false); diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 6b543f89d4..d37abf2cf3 100644 +index 6b543f89d..d37abf2cf 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -36,6 +36,30 @@ public class RegionFile implements AutoCloseable { @@ -250,7 +250,7 @@ index 6b543f89d4..d37abf2cf3 100644 this.c(); } finally { diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index b3d1bb5fd8..e07ae98540 100644 +index b3d1bb5fd..e07ae9854 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -18,7 +18,14 @@ public final class RegionFileCache implements AutoCloseable { @@ -280,7 +280,7 @@ index b3d1bb5fd8..e07ae98540 100644 throwable = throwable1; throw throwable1; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9787d53326..f56ec3d341 100644 +index b742bb761..c3ee5411c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -18,6 +18,7 @@ import java.util.Objects; diff --git a/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch index b6074cb911..632ea717a1 100644 --- a/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/0395-Asynchronous-chunk-IO-and-loading.patch @@ -1,4 +1,4 @@ -From 198c099e09176e239533ad40e814da2ef02dcae1 Mon Sep 17 00:00:00 2001 +From 95c7fe3e2ccab2ab2cc0c503508a1c43c136e1e7 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 13 Jul 2019 09:23:10 -0700 Subject: [PATCH] Asynchronous chunk IO and loading @@ -121,7 +121,7 @@ tasks required to be executed by the chunk load task (i.e lighting and some poi tasks). diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 3a79cde595..8de6c4816c 100644 +index 3a79cde59..8de6c4816 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -63,6 +63,17 @@ public class WorldTimingsHandler { @@ -161,7 +161,7 @@ index 3a79cde595..8de6c4816c 100644 public static Timing getTickList(WorldServer worldserver, String timingsType) { diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 546a1cfe0a..1d7d1ffbf7 100644 +index 546a1cfe0..1d7d1ffbf 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -1,5 +1,6 @@ @@ -237,7 +237,7 @@ index 546a1cfe0a..1d7d1ffbf7 100644 + } } diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -index 23626bef3a..1edcecd2ee 100644 +index 23626bef3..1edcecd2e 100644 --- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java @@ -9,6 +9,7 @@ import java.util.concurrent.Executors; @@ -318,7 +318,7 @@ index 23626bef3a..1edcecd2ee 100644 diff --git a/src/main/java/com/destroystokyo/paper/io/IOUtil.java b/src/main/java/com/destroystokyo/paper/io/IOUtil.java new file mode 100644 -index 0000000000..5af0ac3d9e +index 000000000..5af0ac3d9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/IOUtil.java @@ -0,0 +1,62 @@ @@ -386,7 +386,7 @@ index 0000000000..5af0ac3d9e +} diff --git a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java new file mode 100644 -index 0000000000..4f10a8311e +index 000000000..4f10a8311 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java @@ -0,0 +1,661 @@ @@ -1053,7 +1053,7 @@ index 0000000000..4f10a8311e +} diff --git a/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java new file mode 100644 -index 0000000000..78bd238f4c +index 000000000..78bd238f4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/PrioritizedTaskQueue.java @@ -0,0 +1,276 @@ @@ -1335,7 +1335,7 @@ index 0000000000..78bd238f4c +} diff --git a/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java b/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java new file mode 100644 -index 0000000000..ee906b594b +index 000000000..ee906b594 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/QueueExecutorThread.java @@ -0,0 +1,241 @@ @@ -1582,7 +1582,7 @@ index 0000000000..ee906b594b +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java new file mode 100644 -index 0000000000..305da47868 +index 000000000..305da4786 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkLoadTask.java @@ -0,0 +1,149 @@ @@ -1737,7 +1737,7 @@ index 0000000000..305da47868 +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java new file mode 100644 -index 0000000000..60312b85f9 +index 000000000..60312b85f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkSaveTask.java @@ -0,0 +1,112 @@ @@ -1855,7 +1855,7 @@ index 0000000000..60312b85f9 +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java new file mode 100644 -index 0000000000..1dfa8abfd8 +index 000000000..1dfa8abfd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTask.java @@ -0,0 +1,40 @@ @@ -1901,7 +1901,7 @@ index 0000000000..1dfa8abfd8 +} diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java new file mode 100644 -index 0000000000..715a2dd8d2 +index 000000000..715a2dd8d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java @@ -0,0 +1,455 @@ @@ -2361,10 +2361,10 @@ index 0000000000..715a2dd8d2 + +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 9e75647953..e10035d461 100644 +index 57463425a..c6ece425d 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -220,11 +220,137 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -218,11 +218,137 @@ public class ChunkProviderServer extends IChunkProvider { return playerChunk.getAvailableChunkNow(); } @@ -2502,7 +2502,7 @@ index 9e75647953..e10035d461 100644 if (Thread.currentThread() != this.serverThread) { return (IChunkAccess) CompletableFuture.supplyAsync(() -> { return this.getChunkAt(i, j, chunkstatus, flag); -@@ -250,8 +376,13 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -248,8 +374,13 @@ public class ChunkProviderServer extends IChunkProvider { CompletableFuture> completablefuture = this.getChunkFutureMainThread(i, j, chunkstatus, flag); if (!completablefuture.isDone()) { // Paper @@ -2516,7 +2516,7 @@ index 9e75647953..e10035d461 100644 this.world.timings.chunkAwait.stopTiming(); // Paper } // Paper ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { -@@ -747,11 +878,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -745,11 +876,12 @@ public class ChunkProviderServer extends IChunkProvider { protected boolean executeNext() { // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task try { @@ -2531,7 +2531,7 @@ index 9e75647953..e10035d461 100644 } finally { playerChunkMap.callbackExecutor.run(); diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index a950ad801d..26f1a4b095 100644 +index a950ad801..26f1a4b09 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; @@ -2800,7 +2800,7 @@ index a950ad801d..26f1a4b095 100644 nbttagcompound1.set("PostProcessing", a(ichunkaccess.l())); diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index 134a4f0b7d..88f1674616 100644 +index 134a4f0b7..88f167461 100644 --- a/src/main/java/net/minecraft/server/ChunkStatus.java +++ b/src/main/java/net/minecraft/server/ChunkStatus.java @@ -153,6 +153,7 @@ public class ChunkStatus { @@ -2812,7 +2812,7 @@ index 134a4f0b7d..88f1674616 100644 return ChunkStatus.r.getInt(chunkstatus.c()); } diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index 7e5ece9d50..cfe43e882e 100644 +index 7e5ece9d5..cfe43e882 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -91,7 +91,7 @@ public abstract class IAsyncTaskHandler implements Mailbox { @@ -3844,7 +3844,7 @@ index 335b644351..481d954808 100644 public static TicketType a(String s, Comparator comparator) { return new TicketType<>(s, comparator, 0L); diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index c999f8c9bf..b59ef1a633 100644 +index c999f8c9b..b59ef1a63 100644 --- a/src/main/java/net/minecraft/server/VillagePlace.java +++ b/src/main/java/net/minecraft/server/VillagePlace.java @@ -24,8 +24,16 @@ public class VillagePlace extends RegionFileSection { @@ -3933,7 +3933,7 @@ index c999f8c9bf..b59ef1a633 100644 HAS_SPACE(VillagePlaceRecord::d), IS_OCCUPIED(VillagePlaceRecord::e), ANY((villageplacerecord) -> { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0f652e58e1..5eb52817f1 100644 +index 0f652e58e..5eb52817f 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -82,6 +82,79 @@ public class WorldServer extends World { @@ -4026,7 +4026,7 @@ index 0f652e58e1..5eb52817f1 100644 // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c3ee5411c3..9fe9098089 100644 +index c3ee5411c..9fe909808 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -555,22 +555,23 @@ public class CraftWorld implements World { @@ -4088,7 +4088,7 @@ index c3ee5411c3..9fe9098089 100644 @Override public int getViewDistance() { diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 07936eeba2..5bdcdcf9e8 100644 +index 07936eeba..5bdcdcf9e 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -6,6 +6,7 @@ import java.lang.management.ThreadInfo; @@ -4108,5 +4108,5 @@ index 07936eeba2..5bdcdcf9e8 100644 log.log( Level.SEVERE, "------------------------------" ); // -- -2.25.0 +2.25.0.windows.1 diff --git a/Spigot-Server-Patches/0397-Reduce-sync-loads.patch b/Spigot-Server-Patches/0397-Reduce-sync-loads.patch index 537889f0ca..bfa862d27d 100644 --- a/Spigot-Server-Patches/0397-Reduce-sync-loads.patch +++ b/Spigot-Server-Patches/0397-Reduce-sync-loads.patch @@ -1,4 +1,4 @@ -From 74e2a3bcae10c712efac79d61974edaa0dc5be7e Mon Sep 17 00:00:00 2001 +From c707259e8fb640d0bd12e96335b78eb621b09323 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Fri, 19 Jul 2019 03:29:14 -0700 Subject: [PATCH] Reduce sync loads @@ -11,7 +11,7 @@ it must be enabled by setting the startup flag -Dpaper.debug-sync-loads=true To get a debug log for sync loads, the command is /paper syncloadinfo diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 09efbf7250..132397b3f3 100644 +index 09efbf725..132397b3f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -1,9 +1,13 @@ @@ -91,7 +91,7 @@ index 09efbf7250..132397b3f3 100644 if (args.length < 2 || args[1].equals("*")) { diff --git a/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java new file mode 100644 -index 0000000000..59aec10329 +index 000000000..59aec1032 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/SyncLoadFinder.java @@ -0,0 +1,172 @@ @@ -268,10 +268,10 @@ index 0000000000..59aec10329 + } +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index e10035d461..92b22b9996 100644 +index c6ece425d..5b6b55cc0 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -380,6 +380,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -378,6 +378,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.asyncChunkTaskManager.raisePriority(x, z, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY); com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.world, x, z); // Paper end @@ -280,7 +280,7 @@ index e10035d461..92b22b9996 100644 this.serverThreadQueue.awaitTasks(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9f12d765bd..79175c637c 100644 +index bfbbfb1ba..a2f7c032d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1167,7 +1167,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -311,7 +311,7 @@ index 9f12d765bd..79175c637c 100644 if (chunk != null) { chunk.a(oclass, axisalignedbb, list, predicate); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 5eb52817f1..6d362316f7 100644 +index 5eb52817f..6d362316f 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -154,6 +154,12 @@ public class WorldServer extends World { @@ -328,5 +328,5 @@ index 5eb52817f1..6d362316f7 100644 // Add env and gen to constructor public WorldServer(MinecraftServer minecraftserver, Executor executor, WorldNBTStorage worldnbtstorage, WorldData worlddata, DimensionManager dimensionmanager, GameProfilerFiller gameprofilerfiller, WorldLoadListener worldloadlistener, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { -- -2.25.0 +2.25.0.windows.1 diff --git a/Spigot-Server-Patches/0401-implement-optional-per-player-mob-spawns.patch b/Spigot-Server-Patches/0401-implement-optional-per-player-mob-spawns.patch index 1bf15a1a1f..a013ad0ec2 100644 --- a/Spigot-Server-Patches/0401-implement-optional-per-player-mob-spawns.patch +++ b/Spigot-Server-Patches/0401-implement-optional-per-player-mob-spawns.patch @@ -1,11 +1,11 @@ -From 9106fe90feeffa795cf88d9c30295b11eaf7e889 Mon Sep 17 00:00:00 2001 +From e8bdd07c7eedbdc075d9e637f6206ae148e329bd Mon Sep 17 00:00:00 2001 From: kickash32 Date: Mon, 19 Aug 2019 01:27:58 +0500 Subject: [PATCH] implement optional per player mob spawns diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 8de6c4816c..e25544f116 100644 +index 8de6c4816..e25544f11 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -62,6 +62,7 @@ public class WorldTimingsHandler { @@ -25,7 +25,7 @@ index 8de6c4816c..e25544f116 100644 poiUnload = Timings.ofSafe(name + "Chunk unload - POI"); chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk"); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 9d9260ad07..fd3dbea628 100644 +index 9d9260ad0..fd3dbea62 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -613,4 +613,9 @@ public class PaperWorldConfig { @@ -40,7 +40,7 @@ index 9d9260ad07..fd3dbea628 100644 } diff --git a/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java b/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java new file mode 100644 -index 0000000000..9ebd7ecb7a +index 000000000..9ebd7ecb7 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/PlayerMobDistanceMap.java @@ -0,0 +1,253 @@ @@ -299,7 +299,7 @@ index 0000000000..9ebd7ecb7a +} diff --git a/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java b/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java new file mode 100644 -index 0000000000..4f13d3ff83 +index 000000000..4f13d3ff8 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/PooledHashSets.java @@ -0,0 +1,241 @@ @@ -545,10 +545,10 @@ index 0000000000..4f13d3ff83 + } +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 92b22b9996..72919e4c64 100644 +index 5b6b55cc0..7edbd0aac 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -656,7 +656,22 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -654,7 +654,22 @@ public class ChunkProviderServer extends IChunkProvider { this.world.timings.countNaturalMobs.startTiming(); // Paper - timings int l = this.chunkMapDistance.b(); EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values(); @@ -572,7 +572,7 @@ index 92b22b9996..72919e4c64 100644 this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings this.world.getMethodProfiler().exit(); -@@ -721,8 +736,23 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -719,8 +734,23 @@ public class ChunkProviderServer extends IChunkProvider { if (enumcreaturetype != EnumCreatureType.MISC && (!enumcreaturetype.c() || this.allowAnimals) && (enumcreaturetype.c() || this.allowMonsters) && (!enumcreaturetype.d() || flag2)) { int k1 = limit * l / ChunkProviderServer.b; // CraftBukkit - use per-world limits @@ -599,7 +599,7 @@ index 92b22b9996..72919e4c64 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 77ad4774ec..22606d894e 100644 +index 77ad4774e..22606d894 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -80,6 +80,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -631,7 +631,7 @@ index 77ad4774ec..22606d894e 100644 return this.cs; } diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 79f8549660..4100e367a4 100644 +index 79f854966..4100e367a 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -254,6 +254,7 @@ public class EntityTypes { @@ -643,7 +643,7 @@ index 79f8549660..4100e367a4 100644 return this.bb; } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 9fa6d2b526..36657465f2 100644 +index 9fa6d2b52..36657465f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -78,7 +78,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -682,7 +682,7 @@ index 9fa6d2b526..36657465f2 100644 private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index fdac5bb3a2..58bbf2f9d2 100644 +index fdac5bb3a..58bbf2f9d 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -3,6 +3,7 @@ package net.minecraft.server; @@ -755,7 +755,7 @@ index fdac5bb3a2..58bbf2f9d2 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 9055df2ca1..5ec0acc302 100644 +index 9055df2ca..5ec0acc30 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -1024,7 +1024,20 @@ public class WorldServer extends World { diff --git a/Spigot-Server-Patches/0436-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/Spigot-Server-Patches/0436-Optimise-getChunkAt-calls-for-loaded-chunks.patch index bd66f7e79c..afe8e967aa 100644 --- a/Spigot-Server-Patches/0436-Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/Spigot-Server-Patches/0436-Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -1,4 +1,4 @@ -From 8bc9117823abd132236349acd3e33318571b314b Mon Sep 17 00:00:00 2001 +From ac2f62038414f7fd389e4ef85e0f3479210caa9d Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 25 Jan 2020 17:04:35 -0800 Subject: [PATCH] Optimise getChunkAt calls for loaded chunks @@ -7,10 +7,10 @@ bypass the need to get a player chunk, then get the either, then unwrap it... diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 72919e4c64..42c559ad4f 100644 +index 7edbd0aac..0de82202e 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -356,6 +356,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -354,6 +354,12 @@ public class ChunkProviderServer extends IChunkProvider { return this.getChunkAt(i, j, chunkstatus, flag); }, this.serverThreadQueue).join(); } else { @@ -23,7 +23,7 @@ index 72919e4c64..42c559ad4f 100644 GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); gameprofilerfiller.c("getChunk"); -@@ -406,39 +412,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -404,39 +410,7 @@ public class ChunkProviderServer extends IChunkProvider { if (Thread.currentThread() != this.serverThread) { return null; } else { @@ -65,7 +65,7 @@ index 72919e4c64..42c559ad4f 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 44fb13f8db..03bd681172 100644 +index e97b3f103..913511388 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -255,6 +255,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -84,5 +84,5 @@ index 44fb13f8db..03bd681172 100644 } -- -2.25.0 +2.25.0.windows.1