diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index 51ac0e671..d9b98eb28 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -268,10 +268,10 @@ index 0000000000000000000000000000000000000000..41c79650b169b87fbc70cf502438a545 +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..273cdb598b3606b962dcc92564c84ad351b7a74f +index 0000000000000000000000000000000000000000..68d3cb02dbfdc9d6f9d3682a2659c9430b50c490 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -0,0 +1,184 @@ +@@ -0,0 +1,185 @@ +package com.destroystokyo.paper; + +import com.google.common.base.Throwables; @@ -291,6 +291,7 @@ index 0000000000000000000000000000000000000000..273cdb598b3606b962dcc92564c84ad3 +import net.minecraft.server.MinecraftServer; +import org.bukkit.Bukkit; +import org.bukkit.command.Command; ++import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.InvalidConfigurationException; +import org.bukkit.configuration.file.YamlConfiguration; + diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index c16fe13fe..762907459 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -279,6 +279,27 @@ index 8886cedfe8809fe4711b5f2451e3e6456d2a6513..b77a0f0c2ee30df44b113aa6c8d4fa92 return true; } } +diff --git a/src/main/java/net/minecraft/server/IBlockState.java b/src/main/java/net/minecraft/server/IBlockState.java +index 88f1f201240ef0479c4f0f93f4caca454bbe7e9e..d63a4e4916ed5f5d901be0f4dd2c13cf66239055 100644 +--- a/src/main/java/net/minecraft/server/IBlockState.java ++++ b/src/main/java/net/minecraft/server/IBlockState.java +@@ -16,12 +16,10 @@ public abstract class IBlockState> { + private final Codec> e; + + protected IBlockState(String s, Class oclass) { +- this.d = Codec.STRING.comapFlatMap((s1) -> { +- return (DataResult) this.b(s1).map(DataResult::success).orElseGet(() -> { +- return DataResult.error("Unable to read property: " + this + " with value: " + s1); +- }); +- }, this::a); +- this.e = this.d.xmap(this::b, IBlockState.a::b); ++ this.d = Codec.STRING.comapFlatMap((s1) -> this.b(s1).map(DataResult::success).orElseGet(() -> { // Paper - decompile error ++ return DataResult.error("Unable to read property: " + this + " with value: " + s1); ++ }), this::a); ++ this.e = this.d.xmap(this::b, (IBlockState.a param) -> param.b()); // Paper - decompile fix + this.a = oclass; + this.b = s; + } diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java index 2517b70ddeb985ae7d708c6a1708b42c6a67dd00..c469b5db81fb040fc27cd2e4f7cd61797f56a62d 100644 --- a/src/main/java/net/minecraft/server/IEntityAccess.java @@ -423,6 +444,22 @@ index 998101592723abb26c91d1f92e98be1cf24c954d..ee9069c744df63cbb7f21dd9d28d6d55 } } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index a5f26a51ba612bc62d406cbefa858af75bd062da..7ea0118d108dd71fa1b0336e471ac4cc36722ff8 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -1550,9 +1550,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrantmap(resourcepackrepository::a).filter(Objects::nonNull).map(ResourcePackLoader::d).collect(ImmutableList.toImmutableList()); // CraftBukkit - decompile error // Paper - decompile error + }, this).thenCompose((immutablelist) -> { +- return DataPackResources.a(immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); ++ return DataPackResources.a((List) immutablelist, this.j() ? CommandDispatcher.ServerType.DEDICATED : CommandDispatcher.ServerType.INTEGRATED, this.h(), this.executorService, this); // Paper - decompile error + }).thenAcceptAsync((datapackresources) -> { + this.dataPackResources.close(); + this.dataPackResources = datapackresources; diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java index 829a7ae0a2b77205fb8e8c5754d0d4333afa224d..8b9e47b4c7f5dc464fa617a59583df9e30a54045 100644 --- a/src/main/java/net/minecraft/server/NBTBase.java diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index b569c8356..5c52196e9 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -2318,6 +2318,18 @@ index eff6ebcd30b538cbaedaa031a46a59ea956253ba..30cbfc8eac20910aa55951e3dce63862 @Override public IBlockData getType(BlockPosition blockposition) { return Blocks.AIR.getBlockData(); +diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java +index 47324feca49786b49563d3d0e854e74ad27c190b..26d446077bb563ca3c5bb0339695b3364a3e41bf 100644 +--- a/src/main/java/net/minecraft/server/BlockBase.java ++++ b/src/main/java/net/minecraft/server/BlockBase.java +@@ -632,6 +632,7 @@ public abstract class BlockBase { + return this.a != null ? this.a.e : Block.a(this.getCollisionShape(iblockaccess, blockposition)); + } + ++ public IBlockData getBlockData() { return p(); } // Paper - OBFHELPER + protected abstract IBlockData p(); + + public boolean isAlwaysDestroyable() { diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..b61651fcd6605cd8638ce14f15e41b878add3f1c 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/Spigot-Server-Patches/0005-Paper-Metrics.patch b/Spigot-Server-Patches/0005-Paper-Metrics.patch index 0ac402ed6..999be8eb7 100644 --- a/Spigot-Server-Patches/0005-Paper-Metrics.patch +++ b/Spigot-Server-Patches/0005-Paper-Metrics.patch @@ -647,10 +647,10 @@ index 0000000000000000000000000000000000000000..e257d6b36e0e78dac5b8320017d92776 + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 273cdb598b3606b962dcc92564c84ad351b7a74f..b6d470e594ce196f560ac6c94ced904b0081b205 100644 +index 68d3cb02dbfdc9d6f9d3682a2659c9430b50c490..b367bb8ea184489f433f8acc798466c38816ae62 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -41,6 +41,7 @@ public class PaperConfig { +@@ -42,6 +42,7 @@ public class PaperConfig { private static boolean verbose; private static boolean fatalError; /*========================================================================*/ @@ -658,7 +658,7 @@ index 273cdb598b3606b962dcc92564c84ad351b7a74f..b6d470e594ce196f560ac6c94ced904b public static void init(File configFile) { CONFIG_FILE = configFile; -@@ -83,6 +84,11 @@ public class PaperConfig { +@@ -84,6 +85,11 @@ public class PaperConfig { for (Map.Entry entry : commands.entrySet()) { MinecraftServer.getServer().server.getCommandMap().register(entry.getKey(), "Paper", entry.getValue()); } diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 725775fd2..ddc0ee4dd 100644 --- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -117,7 +117,7 @@ index 3e679f66cd922cf0b47a84cdd1a83f311ddf6d0b..f51325612fa14c1428679d6955a6d923 private String entityKeyString; diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 3cae7ef750371cee741c2f27799c1bb5864a278a..f4d88de468e7843585eb5c722c9e94f5d2b47e6a 100644 +index 3cae7ef750371cee741c2f27799c1bb5864a278a..f8d859cda8186d706304b4e182bca34573f09433 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -51,6 +51,15 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -128,7 +128,7 @@ index 3cae7ef750371cee741c2f27799c1bb5864a278a..f4d88de468e7843585eb5c722c9e94f5 + private java.lang.ref.WeakReference currentChunk = null; + public Chunk getCurrentChunk() { + final Chunk chunk = currentChunk != null ? currentChunk.get() : null; -+ return chunk != null && chunk.isLoaded() ? chunk : null; ++ return chunk != null && chunk.loaded ? chunk : null; + } + public void setCurrentChunk(Chunk chunk) { + this.currentChunk = chunk != null ? new java.lang.ref.WeakReference<>(chunk) : null; diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index 2ae0e78da..27c2861da 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -544,7 +544,7 @@ index 0000000000000000000000000000000000000000..d4ebcf8f66197299256bd6b65710a148 +} 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 0000000000000000000000000000000000000000..fa1c920ea6092259149f9e7f9cd7cc1ed27bf338 +index 0000000000000000000000000000000000000000..03bb2102d6952df04753ba9986aad9b494568e2d --- /dev/null +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -0,0 +1,118 @@ @@ -608,7 +608,7 @@ index 0000000000000000000000000000000000000000..fa1c920ea6092259149f9e7f9cd7cc1e + public final Timing miscMobSpawning; + + public WorldTimingsHandler(World server) { -+ String name = server.worldData.getName() +" - "; ++ String name = server.getWorld().getName() +" - "; + + mobSpawn = Timings.ofSafe(name + "mobSpawn"); + doChunkUnload = Timings.ofSafe(name + "doChunkUnload"); @@ -663,14 +663,14 @@ index 0000000000000000000000000000000000000000..fa1c920ea6092259149f9e7f9cd7cc1e + } + + public static Timing getTickList(WorldServer worldserver, String timingsType) { -+ return Timings.ofSafe(worldserver.getWorldData().getName() + " - Scheduled " + timingsType); ++ return Timings.ofSafe(worldserver.getWorld().getName() + " - Scheduled " + timingsType); + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index b6d470e594ce196f560ac6c94ced904b0081b205..f402a29b0904a0094ffe6e42dbdc6fbc0912d9d9 100644 +index b367bb8ea184489f433f8acc798466c38816ae62..a62f4bbb973b9cb6d1ee53f56a0897d70ae176af 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; +@@ -14,12 +14,15 @@ import java.util.concurrent.TimeUnit; import java.util.logging.Level; import java.util.regex.Pattern; @@ -678,6 +678,7 @@ index b6d470e594ce196f560ac6c94ced904b0081b205..f402a29b0904a0094ffe6e42dbdc6fbc import net.minecraft.server.MinecraftServer; import org.bukkit.Bukkit; import org.bukkit.command.Command; + import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.YamlConfiguration; +import co.aikar.timings.Timings; @@ -685,7 +686,7 @@ index b6d470e594ce196f560ac6c94ced904b0081b205..f402a29b0904a0094ffe6e42dbdc6fbc public class PaperConfig { -@@ -187,4 +190,27 @@ public class PaperConfig { +@@ -188,4 +191,27 @@ public class PaperConfig { config.addDefault(path, def); return config.getString(path, config.getString(path)); } @@ -1116,7 +1117,7 @@ index dccb315440f7429fe881bd0d12af8f1ae8e35c3d..96a95413f74592ef0a8e9367fd3ed81f if (!this.world.isClientSide && this.dN() && this.aC()) { this.damageEntity(DamageSource.DROWN, 1.0F); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 67120e3e4a2cd77394fd7e77543223afa2d6a22e..a5284ca66043150c7132f6bee29a952fb6601007 100644 +index 10ba89eeb31adedadd34746b86843accd1869597..04d1af26aaa7005c9dcf84abfb796b848108bbf0 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -65,7 +65,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -1560,7 +1561,7 @@ index e8ff43662b8397229cb19ea26342b66c88807379..3b8f56c0f0507ebdd9ac20be70688b4c this.g.clear(); this.f.clear(); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index f4d88de468e7843585eb5c722c9e94f5d2b47e6a..03c6a1c95daaa25208917d6985594eb5f182e8e1 100644 +index f8d859cda8186d706304b4e182bca34573f09433..057d703fe73de9bb9ca6f0e263463d32abae4c13 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; @@ -1626,7 +1627,7 @@ index 42294c7c7de146be08d38eddafd8d099073b627a..8a7ce347c35e0527471b3b586a248d64 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 f45b5ddc66024e993ac94436ee25a03e085742b4..2b39fb903c1cf6ded8aa170f5bd25f4fadb1195a 100644 +index f45b5ddc66024e993ac94436ee25a03e085742b4..dd02f7b8c0c0055a506bceab68cec98faf4a7641 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -3,6 +3,8 @@ package net.minecraft.server; @@ -1687,7 +1688,7 @@ index f45b5ddc66024e993ac94436ee25a03e085742b4..2b39fb903c1cf6ded8aa170f5bd25f4f org.spigotmc.ActivationRange.activateEntities(this); // Spigot timings.entityTick.startTiming(); // Spigot -+ TimingHistory.entityTicks += this.globalEntityList.size(); // Paper ++ TimingHistory.entityTicks += this.entitiesById.size(); // Paper while (objectiterator.hasNext()) { Entry entry = (Entry) objectiterator.next(); Entity entity = (Entity) entry.getValue(); diff --git a/Spigot-Server-Patches/0025-Entity-Origin-API.patch b/Spigot-Server-Patches/0025-Entity-Origin-API.patch index 911ea345a..c3f4dc7b4 100644 --- a/Spigot-Server-Patches/0025-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0025-Entity-Origin-API.patch @@ -5,14 +5,14 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 80f1c4930d6dd602210b07a50b10c45e9f80ae8a..002678bc2bff9aa733650cea3b9bcb96e6fb3f9c 100644 +index 80f1c4930d6dd602210b07a50b10c45e9f80ae8a..12730f52fdb0774dcf8be81547c8f03ef9f184a4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -167,6 +167,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only public boolean forceExplosionKnockback; // SPIGOT-949 public Timing tickTimer = MinecraftTimings.getEntityTimings(this); // Paper -+ public Location origin; // Paper ++ public org.bukkit.Location origin; // Paper // Spigot start public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; @@ -35,7 +35,7 @@ index 80f1c4930d6dd602210b07a50b10c45e9f80ae8a..002678bc2bff9aa733650cea3b9bcb96 + // Paper start - Restore the entity's origin location + NBTTagList originTag = nbttagcompound.getList("Paper.Origin", 6); + if (!originTag.isEmpty()) { -+ origin = new Location(world.getWorld(), originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); ++ origin = new org.bukkit.Location(world.getWorld(), originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); + } + // Paper end + diff --git a/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch index 37c6e44a9..05b755623 100644 --- a/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch @@ -29,7 +29,7 @@ index d59b82b7bb1f6d1b231f4e394e0a67a3d154d7be..f7a0a33e49cadf9b2bd43f118c106937 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 002678bc2bff9aa733650cea3b9bcb96e6fb3f9c..2adde8312a8e5bed9bfc2bd60961f56c799ee6c6 100644 +index 12730f52fdb0774dcf8be81547c8f03ef9f184a4..be0ade74030c5f8584b5caa22d6d3084a0853afa 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -420,9 +420,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch index 4457ad57f..06fcc7f4c 100644 --- a/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch @@ -21,7 +21,7 @@ index 62e793b71b313146b86b466421e7a5f894bef9df..cd47a4ca069df26969de3051c2aac805 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 2adde8312a8e5bed9bfc2bd60961f56c799ee6c6..833234254a93b0aee421f7cdb91f85f269040b91 100644 +index be0ade74030c5f8584b5caa22d6d3084a0853afa..3bda9ab2a19740e3b06f24e2bcc82cc9ea57858e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2502,7 +2502,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch index 202a44a84..959dc3cfc 100644 --- a/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch @@ -25,7 +25,7 @@ index abbf59bb91021821876a8960e8f77fac24457ec4..04430aae52205ee167662004e45c145b + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 833234254a93b0aee421f7cdb91f85f269040b91..c2ea0e74b72976131976f875934042cf65ba8263 100644 +index 3bda9ab2a19740e3b06f24e2bcc82cc9ea57858e..b75c6aa78dd9c7478912b0b68de7a27289a480ba 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2195,6 +2195,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch b/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch index 4a9869fd1..45b97d4ef 100644 --- a/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch +++ b/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch @@ -16,10 +16,10 @@ modify that. Under the previous logic, plugins were unable (cleanly) override pe A config option has been added for those who depend on the previous behavior, but I don't expect that. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index f402a29b0904a0094ffe6e42dbdc6fbc0912d9d9..6ef5bb9f323da7cbf8cb24d094bf43c4735549b0 100644 +index a62f4bbb973b9cb6d1ee53f56a0897d70ae176af..f207abbe757ad403a29a7a012903aaa88d5b1685 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -213,4 +213,9 @@ public class PaperConfig { +@@ -214,4 +214,9 @@ public class PaperConfig { " - Length: " + timeSummary(Timings.getHistoryLength() / 20) + " - Server Name: " + timingsServerName); } diff --git a/Spigot-Server-Patches/0066-Add-World-Util-Methods.patch b/Spigot-Server-Patches/0066-Add-World-Util-Methods.patch index c50dd3fcd..6e941f70a 100644 --- a/Spigot-Server-Patches/0066-Add-World-Util-Methods.patch +++ b/Spigot-Server-Patches/0066-Add-World-Util-Methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f80b0b95ce650b01ecb10d3a2f7c66421ca29178..2a18a905aef50d23d9e5544f4240b2f719abd8f1 100644 +index f80b0b95ce650b01ecb10d3a2f7c66421ca29178..6e05a7deaae13f29c24fb6e364c62948a20d83a8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -283,6 +283,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -283,6 +283,22 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return chunk == null ? null : chunk.getFluid(blockposition); } @@ -17,8 +17,12 @@ index f80b0b95ce650b01ecb10d3a2f7c66421ca29178..2a18a905aef50d23d9e5544f4240b2f7 + public boolean isLoadedAndInBounds(BlockPosition blockposition) { + return getWorldBorder().isInBounds(blockposition) && getChunkIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4) != null; + } -+ public Chunk getChunkIfLoaded(BlockPosition blockposition) { -+ return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); ++ ++ public Chunk getChunkIfLoaded(int x, int z) { ++ return ((WorldServer) this).getChunkProvider().getChunkAtIfLoadedImmediately(x, z); ++ } ++ public final Chunk getChunkIfLoaded(BlockPosition blockposition) { ++ return ((WorldServer) this).getChunkProvider().getChunkAtIfLoadedImmediately(blockposition.getX() >> 4, blockposition.getZ() >> 4); + } + + // reduces need to do isLoaded before getType @@ -40,3 +44,16 @@ index d039e715624d33fc3ec9e87d5ad992415e7dc6b9..d5c0d394feaf8bb991245dbdcc6252cf public boolean a(BlockPosition blockposition) { return (double) (blockposition.getX() + 1) > this.e() && (double) blockposition.getX() < this.g() && (double) (blockposition.getZ() + 1) > this.f() && (double) blockposition.getZ() < this.h(); } +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 9eec2ec61777222c1290ad3112b003409001e51a..4548a38464fac65a88da26e95660542eeb482ccb 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -83,7 +83,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public final Convertable.ConversionSession convertable; + public final UUID uuid; + +- public Chunk getChunkIfLoaded(int x, int z) { ++ @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI + return this.chunkProvider.getChunkAt(x, z, false); + } + diff --git a/Spigot-Server-Patches/0070-Use-a-Shared-Random-for-Entities.patch b/Spigot-Server-Patches/0070-Use-a-Shared-Random-for-Entities.patch index 100be84da..68a1232e5 100644 --- a/Spigot-Server-Patches/0070-Use-a-Shared-Random-for-Entities.patch +++ b/Spigot-Server-Patches/0070-Use-a-Shared-Random-for-Entities.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use a Shared Random for Entities Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c2ea0e74b72976131976f875934042cf65ba8263..9e750c0ff42fa1189f20f10495e1ca1d74c6d51b 100644 +index b75c6aa78dd9c7478912b0b68de7a27289a480ba..0b0dca503a91bbd7991996bf6c395991c993604d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -58,6 +58,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0072-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0072-Optimize-isValidLocation-getType-and-getBlockData-fo.patch index 9723792c8..ff7be580c 100644 --- a/Spigot-Server-Patches/0072-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/0072-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -192,7 +192,7 @@ index c5d7a013e65c2c81b14ceb2476c1c6dfe3239f0d..ee8df274d43be753887fb77e4203e2ee @Override public Fluid getFluid(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2a18a905aef50d23d9e5544f4240b2f719abd8f1..9067fcbf6d35931d31830b91f42f027076426bad 100644 +index 6479a62d81daacde6e1e72cb57bd99f9c59b5ae7..042f10ba2c6a3283203fdc5e79f78f3dbf6ccc22 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -179,7 +179,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index cf5dd4463..6e99c30c0 100644 --- a/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/Spigot-Server-Patches/0073-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -32,7 +32,7 @@ index f87fc631255aa5948459f0726b188ebbbae13c5f..446a2ffcd95fd631750b74fd31b4c410 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 63c2953d6eb6f3c034be97e0cb2dd5e991c75fdd..777a553fe3abfdc5db3616352ac11de7969f737c 100644 +index 704d59e53f4cf6f94202d6db36b3f7dba3a29c59..5f89477c664662447c1aafbf734a15aee0084f17 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1175,6 +1175,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { return worldserver + " " + worldserver.getDimensionKey().a(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9067fcbf6d35931d31830b91f42f027076426bad..66a4e068f43fad6d8f3858e6665ad70eacbe4617 100644 +index 0611194eac072ce8dcd350dadffbc9da267d6cff..e236a3b3aa11bc5c3bab92959b90827447aa282c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -435,7 +435,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -439,7 +439,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // CraftBukkit start iblockdata1.b(this, blockposition, j); // Don't call an event for the old block to limit event spam CraftWorld world = ((WorldServer) this).getWorld(); @@ -56,7 +56,7 @@ index 9067fcbf6d35931d31830b91f42f027076426bad..66a4e068f43fad6d8f3858e6665ad70e BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); this.getServer().getPluginManager().callEvent(event); -@@ -537,7 +537,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -541,7 +541,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { try { // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); @@ -66,15 +66,14 @@ index 9067fcbf6d35931d31830b91f42f027076426bad..66a4e068f43fad6d8f3858e6665ad70e this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 9e8f22f41889c8592033925c180f46413cfaec14..cc96ce0cb2e75dd86b413da76e878d511cd4e039 100644 +index 20200408da6cae15576926f79de22b955781201d..0746d0cf0c517a28e8faf637ecc19fb07f6eac2b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -83,6 +83,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -82,6 +82,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + private int tickPosition; public final Convertable.ConversionSession convertable; public final UUID uuid; - + boolean hasPhysicsEvent = true; // Paper -+ - public Chunk getChunkIfLoaded(int x, int z) { + + @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI return this.chunkProvider.getChunkAt(x, z, false); - } diff --git a/Spigot-Server-Patches/0074-Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-Server-Patches/0074-Entity-AddTo-RemoveFrom-World-Events.patch index f1d7930af..1dac1c374 100644 --- a/Spigot-Server-Patches/0074-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-Server-Patches/0074-Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index cc96ce0cb2e75dd86b413da76e878d511cd4e039..f6940921dec04eedc393578ec9827e6f8516611c 100644 +index 0746d0cf0c517a28e8faf637ecc19fb07f6eac2b..a6747315cf3d9d5f22d95aade5b0d4df63bd18f8 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1057,7 +1057,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1056,7 +1056,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity instanceof EntityInsentient) { this.navigators.remove(((EntityInsentient) entity).getNavigation()); } @@ -17,7 +17,7 @@ index cc96ce0cb2e75dd86b413da76e878d511cd4e039..f6940921dec04eedc393578ec9827e6f entity.valid = false; // CraftBukkit } -@@ -1095,6 +1095,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1094,6 +1094,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { entity.origin = entity.getBukkitEntity().getLocation(); } // Paper end diff --git a/Spigot-Server-Patches/0077-Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/0077-Sanitise-RegionFileCache-and-make-configurable.patch index 113e0a0b5..40b7fe709 100644 --- a/Spigot-Server-Patches/0077-Sanitise-RegionFileCache-and-make-configurable.patch +++ b/Spigot-Server-Patches/0077-Sanitise-RegionFileCache-and-make-configurable.patch @@ -11,10 +11,10 @@ The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). The maximum size of the RegionFileCache is also made configurable. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 6ef5bb9f323da7cbf8cb24d094bf43c4735549b0..d500cd75a9229584a70bbdbda6de9bce67b836e8 100644 +index f207abbe757ad403a29a7a012903aaa88d5b1685..7d726757d1083011a09c9f2ca37c33a81360e964 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -218,4 +218,9 @@ public class PaperConfig { +@@ -219,4 +219,9 @@ public class PaperConfig { private static void loadPermsBeforePlugins() { loadPermsBeforePlugins = getBoolean("settings.load-permissions-yml-before-plugins", true); } diff --git a/Spigot-Server-Patches/0082-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/0082-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index f6f9834a3..f4e225d01 100644 --- a/Spigot-Server-Patches/0082-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/Spigot-Server-Patches/0082-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 66a4e068f43fad6d8f3858e6665ad70eacbe4617..b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3 100644 +index b6242cee9f5ab7c4fc9e32d682eb271f4604db41..45daedbba9829193bdc5e7a8f33b6e29c6fbbe10 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -495,6 +495,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -499,6 +499,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public void b(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {} public void applyPhysics(BlockPosition blockposition, Block block) { diff --git a/Spigot-Server-Patches/0086-Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/0086-Remove-unused-World-Tile-Entity-List.patch index df5acb06a..94c5479f1 100644 --- a/Spigot-Server-Patches/0086-Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/0086-Remove-unused-World-Tile-Entity-List.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3..be3e6b398f20467f843fea8296ad5ceea5efb18a 100644 +index d3d7b605d92d433cb6b6655487a779dd10e03b30..1962f6d9c8c86a4ea275e33750ba3c93512a4855 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -39,7 +39,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -18,7 +18,7 @@ index b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3..be3e6b398f20467f843fea8296ad5cee public final List tileEntityListTick = Lists.newArrayList(); protected final List tileEntityListPending = Lists.newArrayList(); protected final java.util.Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); -@@ -660,9 +660,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -664,9 +664,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { }, tileentity::getPosition}); } @@ -30,7 +30,7 @@ index b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3..be3e6b398f20467f843fea8296ad5cee this.tileEntityListTick.add(tileentity); } -@@ -698,7 +698,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -702,7 +702,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { this.tileEntityListTick.removeAll(this.tileEntityListUnload); @@ -39,7 +39,7 @@ index b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3..be3e6b398f20467f843fea8296ad5cee this.tileEntityListUnload.clear(); } -@@ -759,7 +759,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -763,7 +763,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); // Spigot end @@ -48,7 +48,7 @@ index b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3..be3e6b398f20467f843fea8296ad5cee if (this.isLoaded(tileentity.getPosition())) { this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition()); } -@@ -789,7 +789,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -793,7 +793,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); // CraftBukkit start // From above, don't screw this up - SPIGOT-1746 @@ -57,7 +57,7 @@ index b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3..be3e6b398f20467f843fea8296ad5cee this.a(tileentity1); } // CraftBukkit end -@@ -931,7 +931,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -935,7 +935,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } else { if (tileentity != null) { this.tileEntityListPending.remove(tileentity); @@ -67,10 +67,10 @@ index b9ddbcd0b409352a14c5b8dde14d7eac41e69dc3..be3e6b398f20467f843fea8296ad5cee } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f6940921dec04eedc393578ec9827e6f8516611c..e2dfe047e64257b861fa0b168d2790605f09291c 100644 +index a6747315cf3d9d5f22d95aade5b0d4df63bd18f8..db02025e02de1d99e34771380dbf7e71b298d290 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1543,7 +1543,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1542,7 +1542,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } bufferedwriter.write(String.format("entities: %d\n", this.entitiesById.size())); @@ -79,7 +79,7 @@ index f6940921dec04eedc393578ec9827e6f8516611c..e2dfe047e64257b861fa0b168d279060 bufferedwriter.write(String.format("block_ticks: %d\n", this.getBlockTickList().a())); bufferedwriter.write(String.format("fluid_ticks: %d\n", this.getFluidTickList().a())); bufferedwriter.write("distance_manager: " + playerchunkmap.e().c() + "\n"); -@@ -1682,7 +1682,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1681,7 +1681,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { private void a(Writer writer) throws IOException { CSVWriter csvwriter = CSVWriter.a().a("x").a("y").a("z").a("type").a(writer); diff --git a/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch index fe45ac3a0..b4645d220 100644 --- a/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable Player Collision diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index d500cd75a9229584a70bbdbda6de9bce67b836e8..e4f0db64c061af684c28f50f0a37fbca693af7be 100644 +index 7d726757d1083011a09c9f2ca37c33a81360e964..3d9a98936cfe933fd71fb82f07e1ba54d5d35800 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -223,4 +223,9 @@ public class PaperConfig { +@@ -224,4 +224,9 @@ public class PaperConfig { private static void regionFileCacheSize() { regionFileCacheSize = Math.max(getInt("settings.region-file-cache-size", 256), 4); } @@ -19,7 +19,7 @@ index d500cd75a9229584a70bbdbda6de9bce67b836e8..e4f0db64c061af684c28f50f0a37fbca + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 777a553fe3abfdc5db3616352ac11de7969f737c..02e5a4214e46f31ba38d1ab814eeacce850dfaa1 100644 +index 5f89477c664662447c1aafbf734a15aee0084f17..26a796513e66d1593d2d7e47062b26bfe07796e9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -436,6 +436,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> { - return DataResult.error("Unable to read property: " + this + " with value: " + s1); - }); - }, this::a); -- this.e = this.d.xmap(this::b, IBlockState.a::b); -+ this.e = this.d.xmap(this::b, (IBlockState.a param) -> { return param.b(); }); // Paper - decompile fix - this.a = oclass; - this.b = s; - } -@@ -61,23 +61,17 @@ public abstract class IBlockState> { +@@ -59,23 +59,17 @@ public abstract class IBlockState> { } public boolean equals(Object object) { diff --git a/Spigot-Server-Patches/0111-Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/0111-Configurable-packet-in-spam-threshold.patch index 55191777e..8000fd33f 100644 --- a/Spigot-Server-Patches/0111-Configurable-packet-in-spam-threshold.patch +++ b/Spigot-Server-Patches/0111-Configurable-packet-in-spam-threshold.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable packet in spam threshold diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 53f96a1576582fce83999a1f7e9a2624506ed51f..010b17d2e7a27ace6ff8b15edff577c4164d2e81 100644 +index 5827ef1e3eb35a11867ee4f92f301e1b0245c0fa..23c9e0f317073bb9c327ec49e0b0586d2123e4e9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -243,4 +243,13 @@ public class PaperConfig { +@@ -244,4 +244,13 @@ public class PaperConfig { public static boolean isProxyOnlineMode() { return Bukkit.getOnlineMode() || (SpigotConfig.bungee && bungeeOnlineMode); } diff --git a/Spigot-Server-Patches/0112-Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/0112-Configurable-flying-kick-messages.patch index 566c3f320..427d0ff71 100644 --- a/Spigot-Server-Patches/0112-Configurable-flying-kick-messages.patch +++ b/Spigot-Server-Patches/0112-Configurable-flying-kick-messages.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable flying kick messages diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 010b17d2e7a27ace6ff8b15edff577c4164d2e81..5a83fc21cb6801d597a01fb4a83d30488f30bdb6 100644 +index 23c9e0f317073bb9c327ec49e0b0586d2123e4e9..c4086de778cc2ccc958b1a94dd6e9cdb5065076c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -252,4 +252,11 @@ public class PaperConfig { +@@ -253,4 +253,11 @@ public class PaperConfig { } packetInSpamThreshold = getInt("settings.incoming-packet-spam-threshold", 300); } diff --git a/Spigot-Server-Patches/0113-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0113-Chunk-registration-fixes.patch index 4f58339a2..af8c0e347 100644 --- a/Spigot-Server-Patches/0113-Chunk-registration-fixes.patch +++ b/Spigot-Server-Patches/0113-Chunk-registration-fixes.patch @@ -8,10 +8,10 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr Keep them consistent diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 43b588709da17ae779e97d297955edd3425c2a68..6d5bb1c5183c0e7fc83e197f3a6840b2dcb1ad02 100644 +index 0ae5eb7da3c8baf6ff54cc3b83bba41127457134..022b05be76768cf0fb702ac5f9fa48c5e474391c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -729,7 +729,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -728,7 +728,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity.ck()) { this.getMethodProfiler().enter("chunkCheck"); int i = MathHelper.floor(entity.locX() / 16.0D); diff --git a/Spigot-Server-Patches/0123-Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/0123-Don-t-let-fishinghooks-use-portals.patch index 3f35c50ee..284219eb3 100644 --- a/Spigot-Server-Patches/0123-Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/0123-Don-t-let-fishinghooks-use-portals.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't let fishinghooks use portals diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 851d05096b9230c1eaaf2a910293697f358eec0a..3e6d3c2be5fc36db4ae5d022f80f5b0bbc349704 100644 +index 6d6ce3b5a012f49b2e0725d66ad4bcae4a7310f7..de126bf6c95e90dd9a81ee8d815806b8908709ec 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -162,7 +162,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0126-Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/0126-Optimize-World.isLoaded-BlockPosition-Z.patch index d06ad5610..da9b98b91 100644 --- a/Spigot-Server-Patches/0126-Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/Spigot-Server-Patches/0126-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3e6dc44ede30846b8c612b043c1bd625576980e8..cfd03f29e6c46c66bf3ad9253c88e27b30f313c1 100644 +index 8f7222639bcc5b4b1b8af4aa69a100a37766cb4e..2b5384d43a4bceb0113e88a2e75b3b201fc49393 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -285,6 +285,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0137-Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/0137-Don-t-allow-entities-to-ride-themselves-572.patch index 685fef6cc..b0e8a63ed 100644 --- a/Spigot-Server-Patches/0137-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/0137-Don-t-allow-entities-to-ride-themselves-572.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3e6d3c2be5fc36db4ae5d022f80f5b0bbc349704..e1c592c57e54c0c0882978b25286e06d6aaef570 100644 +index de126bf6c95e90dd9a81ee8d815806b8908709ec..e36855b969bdef5e85e6b29879f960b0675a7937 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1950,6 +1950,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0139-Cap-Entity-Collisions.patch b/Spigot-Server-Patches/0139-Cap-Entity-Collisions.patch index f71a66395..89ff13d7b 100644 --- a/Spigot-Server-Patches/0139-Cap-Entity-Collisions.patch +++ b/Spigot-Server-Patches/0139-Cap-Entity-Collisions.patch @@ -27,7 +27,7 @@ index f164844f339793860e773c499443ce160d0a6830..751551f173338217f6682532a9a5e1a2 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e1c592c57e54c0c0882978b25286e06d6aaef570..6c60cf4ff4e7d5716c0487767b7632a59607ce23 100644 +index e36855b969bdef5e85e6b29879f960b0675a7937..13b10732917ffb823688336e888a329c774cc251 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -188,6 +188,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0146-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/0146-Add-configuration-option-to-prevent-player-names-fro.patch index 4244195e7..799368360 100644 --- a/Spigot-Server-Patches/0146-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/0146-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 5a83fc21cb6801d597a01fb4a83d30488f30bdb6..295b8390cbc31fc1fcb225f80ec2ff8f0df44321 100644 +index c4086de778cc2ccc958b1a94dd6e9cdb5065076c..5fa63d7ca20b88a44d8800b3ebf74e4c0e376d0b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -259,4 +259,9 @@ public class PaperConfig { +@@ -260,4 +260,9 @@ public class PaperConfig { flyingKickPlayerMessage = getString("messages.kick.flying-player", flyingKickPlayerMessage); flyingKickVehicleMessage = getString("messages.kick.flying-vehicle", flyingKickVehicleMessage); } diff --git a/Spigot-Server-Patches/0157-Entity-fromMobSpawner.patch b/Spigot-Server-Patches/0157-Entity-fromMobSpawner.patch index dcddacb58..2d71b44b8 100644 --- a/Spigot-Server-Patches/0157-Entity-fromMobSpawner.patch +++ b/Spigot-Server-Patches/0157-Entity-fromMobSpawner.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6c60cf4ff4e7d5716c0487767b7632a59607ce23..357d9293b66eee667f49e566f6f7b5449666986e 100644 +index 13b10732917ffb823688336e888a329c774cc251..039a95a62e115f7095c38eb9a161dc0ff054a50a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -188,6 +188,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -29,7 +29,7 @@ index 6c60cf4ff4e7d5716c0487767b7632a59607ce23..357d9293b66eee667f49e566f6f7b544 } catch (Throwable throwable) { @@ -1704,6 +1709,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (!originTag.isEmpty()) { - origin = new Location(world.getWorld(), originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); + origin = new org.bukkit.Location(world.getWorld(), originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); } + + spawnedViaMobSpawner = nbttagcompound.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status diff --git a/Spigot-Server-Patches/0165-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/0165-Fix-MC-117075-TE-Unload-Lag-Spike.patch index 6d4d4e2c6..ff527489f 100644 --- a/Spigot-Server-Patches/0165-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/0165-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cfd03f29e6c46c66bf3ad9253c88e27b30f313c1..b1d4f955a59313d7274e39870c9a7300fe012d08 100644 +index 2b5384d43a4bceb0113e88a2e75b3b201fc49393..598a6907432ad8a7fe3b8c6389d3e5251efc913a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -703,7 +703,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -707,7 +707,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { gameprofilerfiller.enter("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { diff --git a/Spigot-Server-Patches/0166-Allow-specifying-a-custom-authentication-servers-dow.patch b/Spigot-Server-Patches/0166-Allow-specifying-a-custom-authentication-servers-dow.patch index cb8773c58..f58baf0ea 100644 --- a/Spigot-Server-Patches/0166-Allow-specifying-a-custom-authentication-servers-dow.patch +++ b/Spigot-Server-Patches/0166-Allow-specifying-a-custom-authentication-servers-dow.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow specifying a custom "authentication servers down" kick diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 295b8390cbc31fc1fcb225f80ec2ff8f0df44321..5884b04f7e84048a9710736bd14237140ebf2cf7 100644 +index 5fa63d7ca20b88a44d8800b3ebf74e4c0e376d0b..cee8740e644c492e3d71fd58791e7d52d57e856d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -1,5 +1,6 @@ @@ -16,7 +16,7 @@ index 295b8390cbc31fc1fcb225f80ec2ff8f0df44321..5884b04f7e84048a9710736bd1423714 import com.google.common.base.Throwables; import java.io.File; -@@ -264,4 +265,9 @@ public class PaperConfig { +@@ -265,4 +266,9 @@ public class PaperConfig { private static void suggestPlayersWhenNull() { suggestPlayersWhenNullTabCompletions = getBoolean("settings.suggest-player-names-when-null-tab-completions", suggestPlayersWhenNullTabCompletions); } diff --git a/Spigot-Server-Patches/0176-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/Spigot-Server-Patches/0176-Send-attack-SoundEffects-only-to-players-who-can-see.patch index 1935a953a..42a588cf8 100644 --- a/Spigot-Server-Patches/0176-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/Spigot-Server-Patches/0176-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -72,10 +72,10 @@ index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..eaed020982bd19dab72872849170fa62 entity.extinguish(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b1d4f955a59313d7274e39870c9a7300fe012d08..ad1841f16ea3ecfbd9c6047483a4b7bd061c1981 100644 +index 598a6907432ad8a7fe3b8c6389d3e5251efc913a..e095444d026c277c69a5d533c7b1f537ac84121e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -640,6 +640,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -644,6 +644,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.playSound(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1); } diff --git a/Spigot-Server-Patches/0180-use-CB-BlockState-implementations-for-captured-block.patch b/Spigot-Server-Patches/0180-use-CB-BlockState-implementations-for-captured-block.patch index bae6f78ae..746819fb8 100644 --- a/Spigot-Server-Patches/0180-use-CB-BlockState-implementations-for-captured-block.patch +++ b/Spigot-Server-Patches/0180-use-CB-BlockState-implementations-for-captured-block.patch @@ -18,7 +18,7 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ad1841f16ea3ecfbd9c6047483a4b7bd061c1981..6f91878fedd3bf8daedc16bcde7ac1fd042f704c 100644 +index e095444d026c277c69a5d533c7b1f537ac84121e..94219fe1e01c6e48123544f4cc14fad1ac6de834 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -71,7 +71,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -30,7 +30,7 @@ index ad1841f16ea3ecfbd9c6047483a4b7bd061c1981..6f91878fedd3bf8daedc16bcde7ac1fd public Map capturedTileEntities = new HashMap<>(); public List captureDrops; public long ticksPerAnimalSpawns; -@@ -323,7 +323,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -327,7 +327,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) { // CraftBukkit start - tree generation if (this.captureTreeGeneration) { @@ -39,7 +39,7 @@ index ad1841f16ea3ecfbd9c6047483a4b7bd061c1981..6f91878fedd3bf8daedc16bcde7ac1fd if (blockstate == null) { blockstate = CapturedBlockState.getTreeBlockState(this, blockposition, i); this.capturedBlockStates.put(blockposition.immutableCopy(), blockstate); -@@ -343,7 +343,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -347,7 +347,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // CraftBukkit start - capture blockstates boolean captured = false; if (this.captureBlockStates && !this.capturedBlockStates.containsKey(blockposition)) { @@ -48,7 +48,7 @@ index ad1841f16ea3ecfbd9c6047483a4b7bd061c1981..6f91878fedd3bf8daedc16bcde7ac1fd this.capturedBlockStates.put(blockposition.immutableCopy(), blockstate); captured = true; } -@@ -601,7 +601,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -605,7 +605,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public IBlockData getType(BlockPosition blockposition) { // CraftBukkit start - tree generation if (captureTreeGeneration) { diff --git a/Spigot-Server-Patches/0203-Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/0203-Player.setPlayerProfile-API.patch index 8525a40dc..fb09bf917 100644 --- a/Spigot-Server-Patches/0203-Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/0203-Player.setPlayerProfile-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 5326e7433dc0a4ff0e1d0ca30aad95b1ec718d6a..a781ac0cf8766e915c10ebd3823cbe5b0d1c5230 100644 +index 5326e7433dc0a4ff0e1d0ca30aad95b1ec718d6a..74950d74e6a11d5552369e830f9fdd63c4306221 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -65,7 +65,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -14,7 +14,7 @@ index 5326e7433dc0a4ff0e1d0ca30aad95b1ec718d6a..a781ac0cf8766e915c10ebd3823cbe5b protected final float bO = 0.02F; private int g; - private final GameProfile bQ; -+ private final GameProfile bQ; public final void setProfile(final GameProfile profile) { this.bQ = profile; } // Paper - OBFHELPER ++ private GameProfile bQ; public final void setProfile(final GameProfile profile) { this.bQ = profile; } // Paper - OBFHELPER private ItemStack bS; private final ItemCooldown bT; @Nullable @@ -48,7 +48,7 @@ index 80a21dbc05ed3007f2e827f7a320131244c3044b..e0f0a1e91a037f93b239e779aa8fd92b uniqueId = i.getId(); // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 734274db8f8c53d7e5310f2c16b1c64a42a6277c..4f0dabdb6683402d9fd0ea789381928fa06ee119 100644 +index 734274db8f8c53d7e5310f2c16b1c64a42a6277c..44850b387f84aa9a3d1ec47555026b6088fc167e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,6 +1,8 @@ @@ -60,7 +60,15 @@ index 734274db8f8c53d7e5310f2c16b1c64a42a6277c..4f0dabdb6683402d9fd0ea789381928f import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -1216,8 +1218,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -41,6 +43,7 @@ import net.minecraft.server.EnumColor; + import net.minecraft.server.EnumGamemode; + import net.minecraft.server.GenericAttributes; + import net.minecraft.server.IChatBaseComponent; ++import net.minecraft.server.MCUtil; + import net.minecraft.server.MapIcon; + import net.minecraft.server.MinecraftKey; + import net.minecraft.server.NBTTagCompound; +@@ -1216,8 +1219,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { hiddenPlayers.put(player.getUniqueId(), hidingPlugins); // Remove this player from the hidden player's EntityTrackerEntry @@ -75,7 +83,7 @@ index 734274db8f8c53d7e5310f2c16b1c64a42a6277c..4f0dabdb6683402d9fd0ea789381928f PlayerChunkMap.EntityTracker entry = tracker.trackedEntities.get(other.getId()); if (entry != null) { entry.clear(getHandle()); -@@ -1258,8 +1265,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1258,8 +1266,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } hiddenPlayers.remove(player.getUniqueId()); @@ -90,7 +98,7 @@ index 734274db8f8c53d7e5310f2c16b1c64a42a6277c..4f0dabdb6683402d9fd0ea789381928f getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other)); -@@ -1268,6 +1280,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1268,6 +1281,49 @@ public class CraftPlayer extends CraftHumanEntity implements Player { entry.updatePlayer(getHandle()); } } @@ -126,7 +134,7 @@ index 734274db8f8c53d7e5310f2c16b1c64a42a6277c..4f0dabdb6683402d9fd0ea789381928f + reregisterPlayer(handle); + + //Respawn the player then update their position and selected slot -+ connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(handle.dimension, net.minecraft.server.WorldData.c(handle.world.getWorldData().getSeed()), handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode())); ++ //connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(handle.dimension, net.minecraft.server.WorldData.c(handle.world.getWorldData().getSeed()), handle.world.getWorldData().getType(), handle.playerInteractManager.getGameMode())); // TODO: Fix this if you care to make it work + handle.updateAbilities(); + connection.sendPacket(new net.minecraft.server.PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet<>(), 0)); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().updateClient(handle); diff --git a/Spigot-Server-Patches/0206-Make-player-data-saving-configurable.patch b/Spigot-Server-Patches/0206-Make-player-data-saving-configurable.patch index a2139ce94..87ddc9131 100644 --- a/Spigot-Server-Patches/0206-Make-player-data-saving-configurable.patch +++ b/Spigot-Server-Patches/0206-Make-player-data-saving-configurable.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Make player data saving configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 5884b04f7e84048a9710736bd14237140ebf2cf7..ba341e0174cdc3b5b8bc83b7430270181ea92793 100644 +index cee8740e644c492e3d71fd58791e7d52d57e856d..f22bed69f690f6e4754b87dd61cebe9c6627b12d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -270,4 +270,13 @@ public class PaperConfig { +@@ -271,4 +271,13 @@ public class PaperConfig { private static void authenticationServersDownKickMessage() { authenticationServersDownKickMessage = Strings.emptyToNull(getString("messages.kick.authentication-servers-down", authenticationServersDownKickMessage)); } diff --git a/Spigot-Server-Patches/0209-Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/0209-Flag-to-disable-the-channel-limit.patch index edee7f024..1eea3b243 100644 --- a/Spigot-Server-Patches/0209-Flag-to-disable-the-channel-limit.patch +++ b/Spigot-Server-Patches/0209-Flag-to-disable-the-channel-limit.patch @@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4f0dabdb6683402d9fd0ea789381928fa06ee119..ec0cb22d53733bed33019b257ac06ca9dc80d19e 100644 +index 44850b387f84aa9a3d1ec47555026b6088fc167e..ac621e2a6e7a2eaba5acc1dabca5d0bef4c8b2b3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -141,6 +141,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -142,6 +142,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; @@ -20,7 +20,7 @@ index 4f0dabdb6683402d9fd0ea789381928fa06ee119..ec0cb22d53733bed33019b257ac06ca9 // Paper end public CraftPlayer(CraftServer server, EntityPlayer entity) { -@@ -1485,7 +1486,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1486,7 +1487,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/Spigot-Server-Patches/0216-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/0216-Expand-World.spawnParticle-API-and-add-Builder.patch index b5d2d74d2..39200dad2 100644 --- a/Spigot-Server-Patches/0216-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/0216-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,7 +10,7 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 6d5bb1c5183c0e7fc83e197f3a6840b2dcb1ad02..7a71e6dfea35addb7d3d33d8ce187cc2c6943de6 100644 +index 022b05be76768cf0fb702ac5f9fa48c5e474391c..0c677b8e1b1a103c7d727dba19fff1f74b7ed382 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -56,7 +56,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { @@ -22,7 +22,7 @@ index 6d5bb1c5183c0e7fc83e197f3a6840b2dcb1ad02..7a71e6dfea35addb7d3d33d8ce187cc2 public final ChunkProviderServer chunkProvider; // Paper - public boolean tickingEntities; private final MinecraftServer server; -@@ -1311,12 +1311,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1310,12 +1310,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { } public int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { diff --git a/Spigot-Server-Patches/0226-Configurable-Alternative-LootPool-Luck-Formula.patch b/Spigot-Server-Patches/0226-Configurable-Alternative-LootPool-Luck-Formula.patch index f9025282c..cfcfb0363 100644 --- a/Spigot-Server-Patches/0226-Configurable-Alternative-LootPool-Luck-Formula.patch +++ b/Spigot-Server-Patches/0226-Configurable-Alternative-LootPool-Luck-Formula.patch @@ -36,10 +36,10 @@ This change will result in some major changes to fishing formulas. I would love to see this change in Vanilla, so Mojang please pull :) diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index ba341e0174cdc3b5b8bc83b7430270181ea92793..26ab855dcf38446a3d8577108bd16fdbb76126b2 100644 +index f22bed69f690f6e4754b87dd61cebe9c6627b12d..c8a7d8092a2849b62a8d83d7970756fd76100025 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -279,4 +279,12 @@ public class PaperConfig { +@@ -280,4 +280,12 @@ public class PaperConfig { "such as inventories, experience points, advancements and the like will not be saved when they log out."); } } diff --git a/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch b/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch index 1932c4e2b..057f304cd 100644 --- a/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch +++ b/Spigot-Server-Patches/0232-Implement-EntityKnockbackByEntityEvent.patch @@ -5,11 +5,69 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent This event is called when an entity receives knockback by another entity. +diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java +index a1cfa610eb3cc368b9641feeab709a4f5985ffbe..d94874b02ddcb640c9d94c99d83e77b2e55dce73 100644 +--- a/src/main/java/net/minecraft/server/EntityHuman.java ++++ b/src/main/java/net/minecraft/server/EntityHuman.java +@@ -1085,7 +1085,9 @@ public abstract class EntityHuman extends EntityLiving { + if (flag5) { + if (i > 0) { + if (entity instanceof EntityLiving) { ++ ((EntityLiving) entity).knockingBackEntity = this; // Paper + ((EntityLiving) entity).a((float) i * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F))); ++ ((EntityLiving) entity).knockingBackEntity = null; // Paper + } else { + entity.h((double) (-MathHelper.sin(this.yaw * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 0.017453292F) * (float) i * 0.5F)); + } +@@ -1109,7 +1111,9 @@ public abstract class EntityHuman extends EntityLiving { + if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) { + // CraftBukkit start - Only apply knockback if the damage hits + if (entityliving.damageEntity(DamageSource.playerAttack(this).sweep(), f4)) { ++ ((EntityLiving) entity).knockingBackEntity = this; // Paper + entityliving.a(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F))); ++ ((EntityLiving) entity).knockingBackEntity = null; // Paper + } + // CraftBukkit end + } +diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java +index 3997dc6d979bf5a027861397b948aa4e8486fc58..57521337ea5ad4b944cf7303d2b3f9b34431116a 100644 +--- a/src/main/java/net/minecraft/server/EntityInsentient.java ++++ b/src/main/java/net/minecraft/server/EntityInsentient.java +@@ -1479,7 +1479,9 @@ public abstract class EntityInsentient extends EntityLiving { + + if (flag) { + if (f1 > 0.0F && entity instanceof EntityLiving) { ++ ((EntityLiving) entity).knockingBackEntity = this; // Paper + ((EntityLiving) entity).a(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F))); ++ ((EntityLiving) entity).knockingBackEntity = null; // Paper + this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D)); + } + diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 2ffc8eb4615abfaa6a9e99c45ea436cdf6a461c8..324a98bf245f410983840ef9970e7215e84f7465 100644 +index 2ffc8eb4615abfaa6a9e99c45ea436cdf6a461c8..d0a389e6dc73202a3fa7c82eace1c92dece2982e 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1531,6 +1531,16 @@ public abstract class EntityLiving extends Entity { +@@ -1239,7 +1239,9 @@ public abstract class EntityLiving extends Entity { + } + + this.aw = (float) (MathHelper.d(d1, d0) * 57.2957763671875D - (double) this.yaw); ++ this.knockingBackEntity = entity1 instanceof EntityLiving ? ((EntityLiving) entity1) : null; // Paper + this.a(0.4F, d0, d1); ++ this.knockingBackEntity = null; // Paper + } else { + this.aw = (float) ((int) (Math.random() * 2.0D) * 180); + } +@@ -1287,7 +1289,9 @@ public abstract class EntityLiving extends Entity { + } + + protected void f(EntityLiving entityliving) { ++ ((EntityLiving) entityliving).knockingBackEntity = this; // Paper + entityliving.a(0.5F, entityliving.locX() - this.locX(), entityliving.locZ() - this.locZ()); ++ ((EntityLiving) entityliving).knockingBackEntity = null; // Paper + } + + private boolean f(DamageSource damagesource) { +@@ -1531,8 +1535,19 @@ public abstract class EntityLiving extends Entity { Vec3D vec3d1 = (new Vec3D(d0, 0.0D, d1)).d().a((double) f); this.setMot(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + (double) f) : vec3d.y, vec3d.z / 2.0D - vec3d1.z); @@ -19,10 +77,13 @@ index 2ffc8eb4615abfaa6a9e99c45ea436cdf6a461c8..324a98bf245f410983840ef9970e7215 + org.bukkit.util.Vector delta = new org.bukkit.util.Vector(currentMot.x - vec3d.x, currentMot.y - vec3d.y, currentMot.z - vec3d.z); + // Restore old velocity to be able to access it in the event + this.setMot(vec3d); -+ if (entity == null || new com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent((LivingEntity) getBukkitEntity(), entity.getBukkitEntity(), f, delta).callEvent()) { ++ if (knockingBackEntity == null || new com.destroystokyo.paper.event.entity.EntityKnockbackByEntityEvent((LivingEntity) getBukkitEntity(), knockingBackEntity.getBukkitEntity(), f, delta).callEvent()) { + this.setMot(vec3d.x + delta.getX(), vec3d.y + delta.getY(), vec3d.z + delta.getZ()); + } + // Paper end } } ++ EntityLiving knockingBackEntity; // Paper + @Nullable + protected SoundEffect getSoundHurt(DamageSource damagesource) { diff --git a/Spigot-Server-Patches/0234-LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-Server-Patches/0234-LivingEntity-Hand-Raised-Item-Use-API.patch index 3ed7f9cd8..3a3ca0adf 100644 --- a/Spigot-Server-Patches/0234-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-Server-Patches/0234-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 324a98bf245f410983840ef9970e7215e84f7465..3edd63cbfc3d4bf058f7fb56a4ed4a04b80fe927 100644 +index d0a389e6dc73202a3fa7c82eace1c92dece2982e..b80068b184b32256f1944b9863454726852cd502 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -118,7 +118,7 @@ public abstract class EntityLiving extends Entity { @@ -18,7 +18,7 @@ index 324a98bf245f410983840ef9970e7215e84f7465..3edd63cbfc3d4bf058f7fb56a4ed4a04 protected int bk; protected int bl; private BlockPosition bE; -@@ -3149,10 +3149,12 @@ public abstract class EntityLiving extends Entity { +@@ -3154,10 +3154,12 @@ public abstract class EntityLiving extends Entity { return this.activeItem; } diff --git a/Spigot-Server-Patches/0236-Add-config-to-disable-ender-dragon-legacy-check.patch b/Spigot-Server-Patches/0236-Add-config-to-disable-ender-dragon-legacy-check.patch index 076008d16..474051f83 100644 --- a/Spigot-Server-Patches/0236-Add-config-to-disable-ender-dragon-legacy-check.patch +++ b/Spigot-Server-Patches/0236-Add-config-to-disable-ender-dragon-legacy-check.patch @@ -19,7 +19,7 @@ index 33ce9a500430a01650e69a3568c8b03db325a936..cea15d50ed89430ee8d8cff9de21e1fc + } } diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java -index 87ddabbbca4ac8444ad6ff69889d7fd0542045d4..785146bfb64fe1a467120d706aff7450cb9a8b96 100644 +index 87ddabbbca4ac8444ad6ff69889d7fd0542045d4..1f012667464779939cd43453dcf066a14f4fa278 100644 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java @@ -28,10 +28,10 @@ public class EnderDragonBattle { @@ -46,3 +46,21 @@ index 87ddabbbca4ac8444ad6ff69889d7fd0542045d4..785146bfb64fe1a467120d706aff7450 this.world = worldserver; if (nbttagcompound.hasKeyOfType("DragonKilled", 99)) { if (nbttagcompound.b("Dragon")) { +@@ -376,7 +380,7 @@ public class EnderDragonBattle { + + private void a(BlockPosition blockposition) { + this.world.triggerEffect(3000, blockposition, 0); +- WorldGenerator.END_GATEWAY.b((WorldGenFeatureConfiguration) WorldGenEndGatewayConfiguration.a()).a(this.world, this.world.getStructureManager(), this.world.getChunkProvider().getChunkGenerator(), new Random(), blockposition); ++ WorldGenerator.END_GATEWAY.b(WorldGenEndGatewayConfiguration.a()).a(this.world, this.world.getStructureManager(), this.world.getChunkProvider().getChunkGenerator(), new Random(), blockposition); // Paper - decompile error + } + + private void a(boolean flag) { +@@ -388,7 +392,7 @@ public class EnderDragonBattle { + } + } + +- worldgenendtrophy.b((WorldGenFeatureConfiguration) WorldGenFeatureConfiguration.k).a(this.world, this.world.getStructureManager(), this.world.getChunkProvider().getChunkGenerator(), new Random(), this.exitPortalLocation); ++ worldgenendtrophy.b(WorldGenFeatureConfiguration.k).a(this.world, this.world.getStructureManager(), this.world.getChunkProvider().getChunkGenerator(), new Random(), this.exitPortalLocation); // Paper - decompile error + } + + private EntityEnderDragon o() { diff --git a/Spigot-Server-Patches/0238-InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/0238-InventoryCloseEvent-Reason-API.patch index 90a0c9674..f22644abc 100644 --- a/Spigot-Server-Patches/0238-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/0238-InventoryCloseEvent-Reason-API.patch @@ -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. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 4893daca7ea64504731cfab455e09b0a11c65857..1f3e5c384a66bb0767cc18bdbe99b942f30faa55 100644 +index d94874b02ddcb640c9d94c99d83e77b2e55dce73..1249a7ae8fa8d6ea33cbc276717f1e4553f73b85 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -155,7 +155,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -114,10 +114,10 @@ index 70339603aa3e256470be241bf033f3471e2090ea..ef1ea58c252d063ce282d244236a5106 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 7a71e6dfea35addb7d3d33d8ce187cc2c6943de6..dbc7db5c52752c52b3e84b370bbf38772dc20766 100644 +index 0c677b8e1b1a103c7d727dba19fff1f74b7ed382..8a42f9ed3e1579b8b034de9321e5545505298d6b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -968,7 +968,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -967,7 +967,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { for (TileEntity tileentity : chunk.getTileEntities().values()) { if (tileentity instanceof IInventory) { for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((IInventory) tileentity).getViewers())) { @@ -126,7 +126,7 @@ index 7a71e6dfea35addb7d3d33d8ce187cc2c6943de6..dbc7db5c52752c52b3e84b370bbf3877 } } } -@@ -1026,7 +1026,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1025,7 +1025,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) { for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) { @@ -155,10 +155,10 @@ index 27b2ee740a705238995dd3bcea62b4bf74ec82dc..f6209e9c0b9e0ab99693025d23847bc6 @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ec0cb22d53733bed33019b257ac06ca9dc80d19e..5575c44d6f427661de1fec2c69932b446284c54d 100644 +index ac621e2a6e7a2eaba5acc1dabca5d0bef4c8b2b3..0ba5b2a444660f280b673dbd0db9ded38fa6a839 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -788,7 +788,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -789,7 +789,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Close any foreign inventory if (getHandle().activeContainer != getHandle().defaultContainer) { diff --git a/Spigot-Server-Patches/0243-Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/0243-Re-add-vanilla-entity-warnings-for-duplicates.patch index ce7537874..99513fb60 100644 --- a/Spigot-Server-Patches/0243-Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/0243-Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -8,10 +8,10 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index dbc7db5c52752c52b3e84b370bbf38772dc20766..781b84535c105987d4b65e744977c87049b2a1a4 100644 +index 8a42f9ed3e1579b8b034de9321e5545505298d6b..c37b69b1632a72e3c7df5fd2643c0b3ff517d06b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -958,7 +958,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -957,7 +957,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity1 == null) { return false; } else { diff --git a/Spigot-Server-Patches/0246-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0246-add-more-information-to-Entity.toString.patch index d82bdcfc2..a850ab78a 100644 --- a/Spigot-Server-Patches/0246-add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/0246-add-more-information-to-Entity.toString.patch @@ -6,7 +6,7 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 357d9293b66eee667f49e566f6f7b5449666986e..09567fe1628f9d2393e7902782e3cdc91531bb18 100644 +index 039a95a62e115f7095c38eb9a161dc0ff054a50a..2fcf43b7a2c5af2f7965a8556a3be9a086dc6420 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2429,7 +2429,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0247-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/0247-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index f4b8a2c0b..634e4ac66 100644 --- a/Spigot-Server-Patches/0247-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/0247-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 09567fe1628f9d2393e7902782e3cdc91531bb18..c84bf924c9d1c98b469f279302d8595cece71960 100644 +index 2fcf43b7a2c5af2f7965a8556a3be9a086dc6420..f735c8cc9f68451ec64c2024769c37955e2ea963 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -76,6 +76,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -40,7 +40,7 @@ index 4ae3e91677ecf9c2104a229b4e8b229d18b87aa4..458802dc4b1f923b159168efff0546bb protected void g() { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6f91878fedd3bf8daedc16bcde7ac1fd042f704c..8148ecad0e313d2e6c0307915aaa670e7ad5a317 100644 +index 8d9dcdce1f395025ce7f644ba25212a83a438be4..3f91ae81cf87b5455a79fa94111cecae77b9986c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -68,6 +68,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -52,20 +52,20 @@ index 6f91878fedd3bf8daedc16bcde7ac1fd042f704c..8148ecad0e313d2e6c0307915aaa670e public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 781b84535c105987d4b65e744977c87049b2a1a4..ac0bcde5ccc9ebb88922d8b82381b03675b87ae6 100644 +index c37b69b1632a72e3c7df5fd2643c0b3ff517d06b..9177f300e734afc5e4739655cdcb8b33866ff6cc 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -84,6 +84,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -83,6 +83,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public final Convertable.ConversionSession convertable; public final UUID uuid; - boolean hasPhysicsEvent = true; // Paper + private static Throwable getAddToWorldStackTrace(Entity entity) { + return new Throwable(entity + " Added to world at " + new java.util.Date()); + } - public Chunk getChunkIfLoaded(int x, int z) { + @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI return this.chunkProvider.getChunkAt(x, z, false); -@@ -920,8 +923,28 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -919,8 +922,28 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit start private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot @@ -95,7 +95,7 @@ index 781b84535c105987d4b65e744977c87049b2a1a4..ac0bcde5ccc9ebb88922d8b82381b036 // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit return false; } else if (this.isUUIDTaken(entity)) { -@@ -1081,7 +1104,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1080,7 +1103,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } diff --git a/Spigot-Server-Patches/0252-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0252-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 547cd3815..82bb93105 100644 --- a/Spigot-Server-Patches/0252-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0252-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -19,10 +19,10 @@ index 387e0dcb9f01ad947daaa19211331a96742ce004..eaaa51e4bf761f41fd516402ce1ad0f9 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8148ecad0e313d2e6c0307915aaa670e7ad5a317..66ce6afd46be67a131091d16b6a1221bbff333b5 100644 +index 2437b73f70594e6745a1a071e23ef1626aeddfef..ba725d77e49e4e60a951fd8bb65b8422a46d0b71 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -836,6 +836,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -840,6 +840,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // Paper end } } diff --git a/Spigot-Server-Patches/0253-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0253-Vanished-players-don-t-have-rights.patch index bf5699bc0..afd2d5c6f 100644 --- a/Spigot-Server-Patches/0253-Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0253-Vanished-players-don-t-have-rights.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 47324feca49786b49563d3d0e854e74ad27c190b..16a8ee36ba2b23207cb8630623d542ac5943b9df 100644 +index 26d446077bb563ca3c5bb0339695b3364a3e41bf..88a1db211286fc8a6164312d7eb0839c00969e0e 100644 --- a/src/main/java/net/minecraft/server/BlockBase.java +++ b/src/main/java/net/minecraft/server/BlockBase.java @@ -453,6 +453,7 @@ public abstract class BlockBase { @@ -17,7 +17,7 @@ index 47324feca49786b49563d3d0e854e74ad27c190b..16a8ee36ba2b23207cb8630623d542ac return this.getBlock().c(this.p(), iblockaccess, blockposition, voxelshapecollision); } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c84bf924c9d1c98b469f279302d8595cece71960..3b718673e250a1f9e12ce58481ed533151ad3754 100644 +index f735c8cc9f68451ec64c2024769c37955e2ea963..f35ebacaf7c3a583d48efe58db9583c12c9c31a1 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -98,7 +98,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -108,7 +108,7 @@ index 86f6f082fe2991ea9065b09c9680b76ca1cf7154..b6e2a3d8d0cf510f497c6f974356fafa if (operatorboolean.apply(false, false)) { throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException()); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 66ce6afd46be67a131091d16b6a1221bbff333b5..f6cb503b8eb329cb6bfaa960f812da3c99ce45a8 100644 +index ba725d77e49e4e60a951fd8bb65b8422a46d0b71..753b9f61a2f7a1851e18748500d745906e3adee8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -170,6 +170,46 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0255-Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/0255-Add-some-Debug-to-Chunk-Entity-slices.patch index 31cd188c1..e8239176a 100644 --- a/Spigot-Server-Patches/0255-Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/0255-Add-some-Debug-to-Chunk-Entity-slices.patch @@ -58,7 +58,7 @@ index a27f91e6c3d1f5dd0adf8a3b48a640cc63676114..3ba19f75d24a1539c94f4fed9b8f90ae return; } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3b718673e250a1f9e12ce58481ed533151ad3754..c9905e99e61ffd4f1f0a000bf18daa403a7ea7d1 100644 +index f35ebacaf7c3a583d48efe58db9583c12c9c31a1..e41c0a5891ef10ab7537f0f00ee6ab3e418d762c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -71,6 +71,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0258-Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/0258-Prevent-Saving-Bad-entities-to-chunks.patch index 3abc5efc8..5ad7dc6a8 100644 --- a/Spigot-Server-Patches/0258-Prevent-Saving-Bad-entities-to-chunks.patch +++ b/Spigot-Server-Patches/0258-Prevent-Saving-Bad-entities-to-chunks.patch @@ -80,10 +80,10 @@ index 28039aa8421207ce04840cc90e03d21bc8b7269f..17b8c4445af2bd2ed907d05ed3c396d4 public static ChunkStatus.Type a(@Nullable NBTTagCompound nbttagcompound) { if (nbttagcompound != null) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ac0bcde5ccc9ebb88922d8b82381b03675b87ae6..d81d6f7b984dc3587baadc96fc33f087b3594dcc 100644 +index 9177f300e734afc5e4739655cdcb8b33866ff6cc..972a2fc6febc43156b8aa0917b881c6c604ec2c1 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1001,6 +1001,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1000,6 +1000,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { List[] aentityslice = chunk.getEntitySlices(); // Spigot int i = aentityslice.length; @@ -91,7 +91,7 @@ index ac0bcde5ccc9ebb88922d8b82381b03675b87ae6..d81d6f7b984dc3587baadc96fc33f087 for (int j = 0; j < i; ++j) { List entityslice = aentityslice[j]; // Spigot Iterator iterator = entityslice.iterator(); -@@ -1013,11 +1014,25 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1012,11 +1013,25 @@ public class WorldServer extends World implements GeneratorAccessSeed { throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Removing entity while ticking!")); } diff --git a/Spigot-Server-Patches/0260-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0260-Ignore-Dead-Entities-in-entityList-iteration.patch index f019e41cd..b55cf6a49 100644 --- a/Spigot-Server-Patches/0260-Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/0260-Ignore-Dead-Entities-in-entityList-iteration.patch @@ -51,7 +51,7 @@ index 3ba19f75d24a1539c94f4fed9b8f90aecc918cdc..f7be161c8557ae3848227b1a61e27374 if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check list.add(t0); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c9905e99e61ffd4f1f0a000bf18daa403a7ea7d1..7ccaaa9f2fe2a663674d2cd8a2bd759faec3f603 100644 +index e41c0a5891ef10ab7537f0f00ee6ab3e418d762c..413dd5456d14842ab48143b6ee35e37dcb5ca3db 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -195,6 +195,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -63,10 +63,10 @@ index c9905e99e61ffd4f1f0a000bf18daa403a7ea7d1..7ccaaa9f2fe2a663674d2cd8a2bd759f public float getBukkitYaw() { return this.yaw; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d81d6f7b984dc3587baadc96fc33f087b3594dcc..ba0bb12dd5c5068d31c8a925e31804ddf2cec5da 100644 +index 972a2fc6febc43156b8aa0917b881c6c604ec2c1..afba8d654bd227ad60ec502de8834c45f239f479 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1153,6 +1153,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1152,6 +1152,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { entity.origin = entity.getBukkitEntity().getLocation(); } // Paper end @@ -74,7 +74,7 @@ index d81d6f7b984dc3587baadc96fc33f087b3594dcc..ba0bb12dd5c5068d31c8a925e31804dd new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } -@@ -1165,6 +1166,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1164,6 +1165,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.removeEntityFromChunk(entity); this.entitiesById.remove(entity.getId()); this.unregisterEntity(entity); diff --git a/Spigot-Server-Patches/0264-Break-up-and-make-tab-spam-limits-configurable.patch b/Spigot-Server-Patches/0264-Break-up-and-make-tab-spam-limits-configurable.patch index 3f1bf012f..1f0031f56 100644 --- a/Spigot-Server-Patches/0264-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/Spigot-Server-Patches/0264-Break-up-and-make-tab-spam-limits-configurable.patch @@ -22,10 +22,10 @@ to take the burden of this into their own hand without having to rely on plugins doing unsafe things. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 26ab855dcf38446a3d8577108bd16fdbb76126b2..adef07d4d521b4aaa6f3389b04aa27e29bec0229 100644 +index c8a7d8092a2849b62a8d83d7970756fd76100025..2e5c71d6b7d120a308076d95a3d5b73c5aca8bc9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -287,4 +287,18 @@ public class PaperConfig { +@@ -288,4 +288,18 @@ public class PaperConfig { Bukkit.getLogger().log(Level.INFO, "Using Aikar's Alternative Luck Formula to apply Luck attribute to all loot pool calculations. See https://luckformula.emc.gs"); } } diff --git a/Spigot-Server-Patches/0265-Add-hand-to-bucket-events.patch b/Spigot-Server-Patches/0265-Add-hand-to-bucket-events.patch index db1e261dd..0a95da626 100644 --- a/Spigot-Server-Patches/0265-Add-hand-to-bucket-events.patch +++ b/Spigot-Server-Patches/0265-Add-hand-to-bucket-events.patch @@ -64,7 +64,7 @@ index aada95b9d02d8ca0b870ec08875b5b719a543212..d68ee8d5dc5f8a75dc465f155acccb79 ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541 diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f6cb503b8eb329cb6bfaa960f812da3c99ce45a8..a47de606a82b840180bd203816955fb657cc7c6c 100644 +index aaa68008aacf2e528e6c2dc7e0307ee7dc35da12..7b7785f79ed176967d4c91c2d77c6f6ce73b30b8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -210,6 +210,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -86,10 +86,10 @@ index f6cb503b8eb329cb6bfaa960f812da3c99ce45a8..a47de606a82b840180bd203816955fb6 public boolean s_() { return this.isClientSide; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ba0bb12dd5c5068d31c8a925e31804ddf2cec5da..14ec04c6503cca58f64fc2a82a9fd715a06dcefb 100644 +index afba8d654bd227ad60ec502de8834c45f239f479..f6c459facde67500499365af6da9f43adcd80606 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1484,15 +1484,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1483,15 +1483,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition)); } diff --git a/Spigot-Server-Patches/0268-Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/0268-Add-Early-Warning-Feature-to-WatchDog.patch index 850f23006..ae4b0dfde 100644 --- a/Spigot-Server-Patches/0268-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/0268-Add-Early-Warning-Feature-to-WatchDog.patch @@ -9,10 +9,10 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index adef07d4d521b4aaa6f3389b04aa27e29bec0229..214b577b326bc794fa3721deb6171228dd4f25e6 100644 +index 2e5c71d6b7d120a308076d95a3d5b73c5aca8bc9..1b21911c3e4fd1d4a3305176bb8477c370256906 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -24,6 +24,7 @@ import org.bukkit.configuration.file.YamlConfiguration; +@@ -25,6 +25,7 @@ import org.bukkit.configuration.file.YamlConfiguration; import co.aikar.timings.Timings; import co.aikar.timings.TimingsManager; import org.spigotmc.SpigotConfig; @@ -20,7 +20,7 @@ index adef07d4d521b4aaa6f3389b04aa27e29bec0229..214b577b326bc794fa3721deb6171228 public class PaperConfig { -@@ -288,6 +289,14 @@ public class PaperConfig { +@@ -289,6 +290,14 @@ public class PaperConfig { } } @@ -36,7 +36,7 @@ index adef07d4d521b4aaa6f3389b04aa27e29bec0229..214b577b326bc794fa3721deb6171228 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 790d7df8691537a976086b5507db4f97054706de..a7be2875faa968d2e3939974f62c977ca03e9c5b 100644 +index d122fefe0d3b785a5aad6ceceba221279439fe7b..f33624e65a56bd7cf4432eecdd6834fa3f32cda5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -900,6 +900,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant +Date: Thu, 23 Aug 2018 11:45:32 -0400 +Subject: [PATCH] Optimize CraftBlockData Creation + +Avoids a hashmap lookup by cacheing a reference to the CraftBlockData +and cloning it when one is needed. + +diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java +index 88a1db211286fc8a6164312d7eb0839c00969e0e..aa4bfc9fe8e917c1c19838b0a7b045a11fc9300b 100644 +--- a/src/main/java/net/minecraft/server/BlockBase.java ++++ b/src/main/java/net/minecraft/server/BlockBase.java +@@ -323,6 +323,14 @@ public abstract class BlockBase { + this.o = blockbase_info.t; + this.p = blockbase_info.u; + } ++ // Paper start - impl cached craft block data, lazy load to fix issue with loading at the wrong time ++ private org.bukkit.craftbukkit.block.data.CraftBlockData cachedCraftBlockData; ++ ++ public org.bukkit.craftbukkit.block.data.CraftBlockData createCraftBlockData() { ++ if (cachedCraftBlockData == null) cachedCraftBlockData = org.bukkit.craftbukkit.block.data.CraftBlockData.createData(getBlockData()); ++ return (org.bukkit.craftbukkit.block.data.CraftBlockData) cachedCraftBlockData.clone(); ++ } ++ // Paper end + + public void a() { + if (!this.getBlock().o()) { +diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +index c7eed6b572cef2c735b1eb2f587c24876047cf94..bbded5671e986be34ebe3100e4c10ee0d5741764 100644 +--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java ++++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +@@ -553,7 +553,17 @@ public class CraftBlockData implements BlockData { + return craft; + } + ++ // Paper start - optimize creating BlockData to not need a map lookup ++ static { ++ // Initialize cached data for all IBlockData instances after registration ++ Block.REGISTRY_ID.iterator().forEachRemaining(IBlockData::createCraftBlockData); ++ } + public static CraftBlockData fromData(IBlockData data) { ++ return data.createCraftBlockData(); ++ } ++ ++ public static CraftBlockData createData(IBlockData data) { ++ // Paper end + return MAP.getOrDefault(data.getBlock().getClass(), CraftBlockData::new).apply(data); + } + } diff --git a/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch index 51df1d92f..eb583d413 100644 --- a/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 3edd63cbfc3d4bf058f7fb56a4ed4a04b80fe927..4f80c46e327006a3d9028ca25db8554fba7b57ea 100644 +index b80068b184b32256f1944b9863454726852cd502..12e7b1b5d15e94068c85f189c4ad1c5b5fab5e38 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3436,6 +3436,23 @@ public abstract class EntityLiving extends Entity { +@@ -3441,6 +3441,23 @@ public abstract class EntityLiving extends Entity { this.broadcastItemBreak(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND); } // Paper start diff --git a/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch index 11bffc82a..400cf1fe0 100644 --- a/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 1f3e5c384a66bb0767cc18bdbe99b942f30faa55..0fd29c42179c7ac0c89cfd35b257ab0ad3ae1612 100644 +index 1249a7ae8fa8d6ea33cbc276717f1e4553f73b85..af554396fdb25719c158a81ccab76e91f5df2ff5 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2006,14 +2006,17 @@ public abstract class EntityHuman extends EntityLiving { +@@ -2010,14 +2010,17 @@ public abstract class EntityHuman extends EntityLiving { this.datawatcher.set(EntityHuman.bs, nbttagcompound); } @@ -27,10 +27,10 @@ index 1f3e5c384a66bb0767cc18bdbe99b942f30faa55..0fd29c42179c7ac0c89cfd35b257ab0a this.aA = 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5575c44d6f427661de1fec2c69932b446284c54d..3ec69b90b5e49407fc986741f189b6ea108a2118 100644 +index 0ba5b2a444660f280b673dbd0db9ded38fa6a839..7b9b7b55c0b726648cfa4b9b87ad70c91fad2d75 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1944,6 +1944,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1945,6 +1945,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getInventory().setItemInMainHand(hand); } diff --git a/Spigot-Server-Patches/0286-Improve-death-events.patch b/Spigot-Server-Patches/0286-Improve-death-events.patch index f544dc1e6..44df65ab8 100644 --- a/Spigot-Server-Patches/0286-Improve-death-events.patch +++ b/Spigot-Server-Patches/0286-Improve-death-events.patch @@ -27,7 +27,7 @@ index 6281f7900afab3ef1c9ba3c034b91cbfa1900f50..3c2f8407906879c8dca07b538f59f4bb int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7ccaaa9f2fe2a663674d2cd8a2bd759faec3f603..4e3ea0a00b903b09e2f4d62a330f9faf5ff15f67 100644 +index 413dd5456d14842ab48143b6ee35e37dcb5ca3db..a704feb0c19b56964d017f9e0ea3f26bc3e975f8 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1460,6 +1460,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -47,10 +47,10 @@ index 7ccaaa9f2fe2a663674d2cd8a2bd759faec3f603..4e3ea0a00b903b09e2f4d62a330f9faf protected void k(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index d5c09152acc93b25d626284071599afdbd76b709..51e9f4a6e09474a7489d2872a800308ee3f02e46 100644 +index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..74c58c3f82a94a3ec5e53c7f92e54cee80dc9e8a 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -701,7 +701,8 @@ public class EntityArmorStand extends EntityLiving { +@@ -664,7 +664,8 @@ public class EntityArmorStand extends EntityLiving { @Override public void killEntity() { @@ -119,7 +119,7 @@ index c2a3bd8f25e91f79723074d93f6a646a8ce76d8c..4934e71225fe1242615660a379e797e2 public void saveData(NBTTagCompound nbttagcompound) { super.saveData(nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7e429d1b0 100644 +index 12e7b1b5d15e94068c85f189c4ad1c5b5fab5e38..c00031656bb6d2f986f555c68bb2fa9b9b0c0e6d 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -95,7 +95,7 @@ public abstract class EntityLiving extends Entity { @@ -139,7 +139,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 @Override public float getBukkitYaw() { -@@ -1248,13 +1249,17 @@ public abstract class EntityLiving extends Entity { +@@ -1250,13 +1251,17 @@ public abstract class EntityLiving extends Entity { if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback if (this.dk()) { if (!this.f(damagesource)) { @@ -161,7 +161,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 } } else if (flag1) { this.c(damagesource); -@@ -1392,6 +1397,7 @@ public abstract class EntityLiving extends Entity { +@@ -1396,6 +1401,7 @@ public abstract class EntityLiving extends Entity { Entity entity = damagesource.getEntity(); EntityLiving entityliving = this.getKillingEntity(); @@ -169,7 +169,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 if (this.aV >= 0 && entityliving != null) { entityliving.a(this, this.aV, damagesource); } -@@ -1403,16 +1409,36 @@ public abstract class EntityLiving extends Entity { +@@ -1407,16 +1413,36 @@ public abstract class EntityLiving extends Entity { if (this.isSleeping()) { this.entityWakeup(); } @@ -208,7 +208,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 } } -@@ -1420,7 +1446,7 @@ public abstract class EntityLiving extends Entity { +@@ -1424,7 +1450,7 @@ public abstract class EntityLiving extends Entity { if (!this.world.isClientSide) { boolean flag = false; @@ -217,7 +217,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { BlockPosition blockposition = this.getChunkCoordinates(); IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData(); -@@ -1441,7 +1467,8 @@ public abstract class EntityLiving extends Entity { +@@ -1445,7 +1471,8 @@ public abstract class EntityLiving extends Entity { } } @@ -227,7 +227,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 Entity entity = damagesource.getEntity(); int i; -@@ -1454,22 +1481,26 @@ public abstract class EntityLiving extends Entity { +@@ -1458,22 +1485,26 @@ public abstract class EntityLiving extends Entity { boolean flag = this.lastDamageByPlayerTime > 0; this.dropInventory(); // CraftBukkit - from below @@ -257,7 +257,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 // CraftBukkit start public int getExpReward() { -@@ -1549,6 +1580,7 @@ public abstract class EntityLiving extends Entity { +@@ -1554,6 +1585,7 @@ public abstract class EntityLiving extends Entity { return SoundEffects.ENTITY_GENERIC_HURT; } @@ -265,7 +265,7 @@ index 4f80c46e327006a3d9028ca25db8554fba7b57ea..7105192a5cd8666ac46dcd8a524709d7 @Nullable protected SoundEffect getSoundDeath() { return SoundEffects.ENTITY_GENERIC_DEATH; -@@ -2068,10 +2100,12 @@ public abstract class EntityLiving extends Entity { +@@ -2073,10 +2105,12 @@ public abstract class EntityLiving extends Entity { } @@ -357,10 +357,10 @@ index 7b565ddfffd0b9c78392ee115ef9c20ab89a3380..d78b9fd608da691220f1edeff506b36e this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3ec69b90b5e49407fc986741f189b6ea108a2118..e112a87792a76ccbc25caa1253c54db601de76aa 100644 +index 7b9b7b55c0b726648cfa4b9b87ad70c91fad2d75..51e7c6d82248b5c0938d37607c64a9c10cb4de4d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1738,7 +1738,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1739,7 +1739,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void sendHealthUpdate() { diff --git a/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch index b4461e819..9e95ad585 100644 --- a/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch +++ b/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch @@ -6,18 +6,18 @@ Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning Uses an EnumMap as well as a Set paired List for O(1) contains calls. diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index ae0ac8d383ca11a683465d8c83a8b8a66e567079..4c656f434f2637a6af4cdb9efe3414de81e4ea9b 100644 +index ae0ac8d383ca11a683465d8c83a8b8a66e567079..30aeb45d63394b7d91c2dd7b92cfc9cefa3c088c 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -69,7 +69,7 @@ public class BiomeBase { - protected final Map>> r; - protected final List> s = Lists.newArrayList(); - private final Map, StructureFeature> u; -- private final Map> v; -+ private final Map> v = Maps.newEnumMap(EnumCreatureType.class); // Paper - private final Map, BiomeBase.e> w = Maps.newHashMap(); - private final List x; - private final ThreadLocal y = ThreadLocal.withInitial(() -> { +@@ -119,7 +119,7 @@ public class BiomeBase { + this.r.put(worldgenstage_decoration, Lists.newArrayList()); + } + +- this.v = Maps.newHashMap(); ++ this.v = Maps.newEnumMap(EnumCreatureType.class); // Paper + EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values(); + + i = aenumcreaturetype.length; @@ -127,7 +127,7 @@ public class BiomeBase { for (j = 0; j < i; ++j) { EnumCreatureType enumcreaturetype = aenumcreaturetype[j]; @@ -27,6 +27,15 @@ index ae0ac8d383ca11a683465d8c83a8b8a66e567079..4c656f434f2637a6af4cdb9efe3414de } } else { +@@ -150,7 +150,7 @@ public class BiomeBase { + this.u = (Map) list.stream().collect(Collectors.toMap((structurefeature) -> { + return structurefeature.b; + }, Function.identity())); +- this.v = map2; ++ this.v = Maps.newEnumMap(EnumCreatureType.class); this.v.putAll(map2); // Paper + this.x = list1; + this.l = (String) optional.orElse(null); // Paper - decompile fix + Stream stream = map1.values().stream().flatMap(Collection::stream).filter((worldgenfeatureconfigured) -> { @@ -433,6 +433,38 @@ public class BiomeBase { return this.l; } diff --git a/Spigot-Server-Patches/0295-Optimize-Server-World-Map.patch b/Spigot-Server-Patches/0295-Optimize-Server-World-Map.patch deleted file mode 100644 index cdcdcc4d1..000000000 --- a/Spigot-Server-Patches/0295-Optimize-Server-World-Map.patch +++ /dev/null @@ -1,242 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 17 Sep 2018 23:37:31 -0400 -Subject: [PATCH] Optimize Server World Map - -Minecraft moved worlds to a hashmap in 1.13.1. -This creates inconsistent order for iteration of the map. - -This patch restores World management to be back as an Array. - -.values() will allow us to iterate as it was pre 1.13.1 by -ArrayList, giving consistent ordering and effecient iteration performance. - -KeySet and EntrySet iteration is proxied to the List iterator, -and should retain manipulation behavior but nothing should be doing that. - -Getting a World by dimension ID is now back a constant time operation. - -Hopefully no other plugins try to mess with this map, as we are only handling -known NMS used methods, but we can add more if naughty plugins are found later. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldMap.java b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java -new file mode 100644 -index 0000000000000000000000000000000000000000..0f0c5330c364909c85cc8cf58fb5c478ffdaeb25 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java -@@ -0,0 +1,193 @@ -+package com.destroystokyo.paper; -+ -+import net.minecraft.server.DimensionManager; -+import net.minecraft.server.ResourceKey; -+import net.minecraft.server.World; -+import net.minecraft.server.WorldServer; -+ -+import javax.annotation.Nonnull; -+import java.util.AbstractSet; -+import java.util.ArrayList; -+import java.util.Collection; -+import java.util.HashMap; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Map; -+import java.util.Set; -+ -+public class PaperWorldMap extends HashMap, WorldServer> { -+ private final List worlds = new ArrayList<>(); -+ private final List worldsIterable = new ArrayList() { -+ @Override -+ public Iterator iterator() { -+ Iterator iterator = super.iterator(); -+ return new Iterator() { -+ private WorldServer last; -+ -+ @Override -+ public boolean hasNext() { -+ return iterator.hasNext(); -+ } -+ -+ @Override -+ public WorldServer next() { -+ this.last = iterator.next(); -+ return last; -+ } -+ -+ @Override -+ public void remove() { -+ worlds.set(last.worldProvider.getDimensionManager().getDimensionID() + 1, null); -+ } -+ }; -+ } -+ }; -+ @Override -+ public int size() { -+ return worldsIterable.size(); -+ } -+ -+ @Override -+ public boolean isEmpty() { -+ return worldsIterable.isEmpty(); -+ } -+ -+ @Override -+ public WorldServer get(Object key) { -+ // Will hit the below method -+ return key instanceof ResourceKey ? get((ResourceKey) key) : null; -+ } -+ // TODO figure out what to do with dimension ids -+ public WorldServer get(ResourceKey key) { -+ int id = key.getDimensionID()+1; -+ return worlds.size() > id ? worlds.get(id) : null; -+ } -+ -+ @Override -+ public boolean containsKey(Object key) { -+ // will hit below method -+ return key instanceof DimensionManager && containsKey((DimensionManager) key); -+ } -+ public boolean containsKey(DimensionManager key) { -+ return get(key) != null; -+ } -+ -+ @Override -+ public WorldServer put(ResourceKey key, WorldServer value) { -+ while (worlds.size() <= key.getDimensionID()+1) { -+ worlds.add(null); -+ } -+ WorldServer old = worlds.set(key.getDimensionID()+1, value); -+ if (old != null) { -+ worldsIterable.remove(old); -+ } -+ worldsIterable.add(value); -+ return old; -+ } -+ -+ @Override -+ public void putAll(Map, ? extends WorldServer> m) { -+ for (Entry, ? extends WorldServer> e : m.entrySet()) { -+ put(e.getKey(), e.getValue()); -+ } -+ } -+ -+ @Override -+ public WorldServer remove(Object key) { -+ return key instanceof DimensionManager ? remove((DimensionManager) key) : null; -+ } -+ -+ public WorldServer remove(DimensionManager key) { -+ WorldServer old; -+ if (key.getDimensionID()+1 == worlds.size() - 1) { -+ old = worlds.remove(key.getDimensionID()+1); -+ } else { -+ old = worlds.set(key.getDimensionID() + 1, null); -+ } -+ if (old != null) { -+ worldsIterable.remove(old); -+ } -+ return old; -+ } -+ -+ @Override -+ public void clear() { -+ throw new RuntimeException("What the hell are you doing?"); -+ } -+ -+ @Override -+ public boolean containsValue(Object value) { -+ return value instanceof WorldServer && get(((WorldServer) value).getDimensionKey()) != null; -+ } -+ -+ @Nonnull -+ @Override -+ public Set> keySet() { -+ return new AbstractSet>() { -+ @Override -+ public Iterator> iterator() { -+ Iterator iterator = worldsIterable.iterator(); -+ return new Iterator>() { -+ -+ @Override -+ public boolean hasNext() { -+ return iterator.hasNext(); -+ } -+ -+ @Override -+ public ResourceKey next() { -+ return iterator.next().getDimensionKey(); -+ } -+ -+ @Override -+ public void remove() { -+ iterator.remove(); -+ } -+ }; -+ } -+ -+ @Override -+ public int size() { -+ return worlds.size(); -+ } -+ }; -+ } -+ -+ @Override -+ public Collection values() { -+ return worldsIterable; -+ } -+ -+ @Override -+ public Set, WorldServer>> entrySet() { -+ return new AbstractSet, WorldServer>>() { -+ @Override -+ public Iterator, WorldServer>> iterator() { -+ Iterator iterator = worldsIterable.iterator(); -+ return new Iterator, WorldServer>>() { -+ -+ @Override -+ public boolean hasNext() { -+ return iterator.hasNext(); -+ } -+ -+ @Override -+ public Entry, WorldServer> next() { -+ WorldServer entry = iterator.next(); -+ return new SimpleEntry<>(entry.getDimensionKey(), entry); -+ } -+ -+ @Override -+ public void remove() { -+ iterator.remove(); -+ } -+ }; -+ } -+ -+ @Override -+ public int size() { -+ return worldsIterable.size(); -+ } -+ }; -+ } -+} -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a7be2875faa968d2e3939974f62c977ca03e9c5b..1d4ec1412db104a6437b57afe192063188fabd10 100644 ---- a/src/main/java/net/minecraft/server/MinecraftServer.java -+++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -91,7 +91,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant, WorldServer> worldServer; -+ public final Map, WorldServer> worldServer = new com.destroystokyo.paper.PaperWorldMap(); // Paper; - private PlayerList playerList; - private volatile boolean isRunning; - private volatile boolean isRestarting = false; // Paper - flag to signify we're attempting to restart -@@ -441,7 +441,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant +Date: Wed, 10 Oct 2018 21:22:44 -0500 +Subject: [PATCH] Check Drowned for Villager Aggression Config + + +diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java +index 1f1f77776d840c6fa1156239a1da9bb97a328fb1..e6425bdf1a85e773f5555db1aebe7e159f7cd37c 100644 +--- a/src/main/java/net/minecraft/server/EntityDrowned.java ++++ b/src/main/java/net/minecraft/server/EntityDrowned.java +@@ -29,7 +29,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { + this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D)); + this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityDrowned.class})).a(EntityPigZombie.class)); + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::j)); +- this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); ++ if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); // Paper + this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); + this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bv)); + } diff --git a/Spigot-Server-Patches/0308-Here-s-Johnny.patch b/Spigot-Server-Patches/0308-Here-s-Johnny.patch new file mode 100644 index 000000000..ce187e9c8 --- /dev/null +++ b/Spigot-Server-Patches/0308-Here-s-Johnny.patch @@ -0,0 +1,38 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Fri, 12 Oct 2018 01:37:22 -0500 +Subject: [PATCH] Here's Johnny! + + +diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java +index 9c152b79164710d3d4175d0acbc9548d61390097..58315906b641ba46ce73b6fefc43ea333bb0a088 100644 +--- a/src/main/java/net/minecraft/server/EntityVindicator.java ++++ b/src/main/java/net/minecraft/server/EntityVindicator.java +@@ -11,7 +11,7 @@ public class EntityVindicator extends EntityIllagerAbstract { + private static final Predicate b = (enumdifficulty) -> { + return enumdifficulty == EnumDifficulty.NORMAL || enumdifficulty == EnumDifficulty.HARD; + }; +- private boolean bv; ++ private boolean bv; public boolean isJohnny() { return bv; } public void setJohnny(boolean johnny) { bv = johnny; } // Paper - OBFHELPER + + public EntityVindicator(EntityTypes entitytypes, World world) { + super(entitytypes, world); +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java +index 951d47929893fce38183b81cf4ec6a7d4204acd1..5ff957ced7a86f4fa3a0751b4eed5a6fdc525da4 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java +@@ -25,4 +25,14 @@ public class CraftVindicator extends CraftIllager implements Vindicator { + public EntityType getType() { + return EntityType.VINDICATOR; + } ++ ++ // Paper start ++ public boolean isJohnny() { ++ return getHandle().isJohnny(); ++ } ++ ++ public void setJohnny(boolean johnny) { ++ getHandle().setJohnny(johnny); ++ } ++ // Paper end + } diff --git a/Spigot-Server-Patches/0308-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 96% rename from Spigot-Server-Patches/0308-Add-option-to-prevent-players-from-moving-into-unloa.patch rename to Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch index 189701cc3..c826b39ad 100644 --- a/Spigot-Server-Patches/0308-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 487b0d5cd608e84a793eba5fdbd50a9f3d95c79b..b49a1a6f5017c9e183a7d08b16e89899c25a9717 100644 +index 3c28dc61f97a65a0440c122ac5777cb9e24cdb3a..6f660388aa0d56577ad1c3f463c96d925c964821 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -405,4 +405,9 @@ public class PaperWorldConfig { +@@ -399,4 +399,9 @@ public class PaperWorldConfig { waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5); log("Water over lava flow speed: " + waterOverLavaFlowSpeed); } diff --git a/Spigot-Server-Patches/0309-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch similarity index 93% rename from Spigot-Server-Patches/0309-Reset-players-airTicks-on-respawn.patch rename to Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch index 92ecb5f73..695aa03bb 100644 --- a/Spigot-Server-Patches/0309-Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4e3ea0a00b903b09e2f4d62a330f9faf5ff15f67..58ecc49ba91cdb9c100ce3319434f2110b9a5892 100644 +index a704feb0c19b56964d017f9e0ea3f26bc3e975f8..41c14d367e0b51e109001167d3c7b40676f364b8 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2256,6 +2256,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0310-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/Spigot-Server-Patches/0311-Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 100% rename from Spigot-Server-Patches/0310-Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to Spigot-Server-Patches/0311-Don-t-sleep-after-profile-lookups-if-not-needed.patch diff --git a/Spigot-Server-Patches/0311-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 97% rename from Spigot-Server-Patches/0311-Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index dd6bcdf54..d4913bb16 100644 --- a/Spigot-Server-Patches/0311-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -12,7 +12,7 @@ server threads Allow usage of a single thread executor by not using ForkJoin so single core CPU's. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1d4ec1412db104a6437b57afe192063188fabd10..e4f033d5ad66da5a38e5bfee861e9ea3399f30fe 100644 +index a7be2875faa968d2e3939974f62c977ca03e9c5b..29f7e78fc21ccca1a080055fe616996d1ede666f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -176,6 +176,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { +@@ -1,5 +1,6 @@ + package net.minecraft.server; + ++import io.netty.channel.ChannelFuture; // Paper + import java.io.IOException; + + public interface Packet { +@@ -11,6 +12,20 @@ public interface Packet { void a(T t0); // Paper start @@ -323,7 +330,7 @@ index 2d8e6a2f4a0c3c5d74a647d7164b0028781d3bf5..c5edf8c4b01cc7ddac06797133e6fd13 + * @param player Null if not at PLAY stage yet + * @param future Can be null if packet was cancelled + */ -+ default void onPacketDispatchFinish(@javax.annotation.Nullable EntityPlayer player, @javax.annotation.Nullable io.netty.channel.ChannelFuture future) {} ++ default void onPacketDispatchFinish(@javax.annotation.Nullable EntityPlayer player, @javax.annotation.Nullable ChannelFuture future) {} + default boolean hasFinishListener() { return false; } + default boolean isReady() { return true; } + default java.util.List getExtraPackets() { return null; } diff --git a/Spigot-Server-Patches/0336-Handle-Oversized-Tile-Entities-in-chunks.patch b/Spigot-Server-Patches/0337-Handle-Oversized-Tile-Entities-in-chunks.patch similarity index 100% rename from Spigot-Server-Patches/0336-Handle-Oversized-Tile-Entities-in-chunks.patch rename to Spigot-Server-Patches/0337-Handle-Oversized-Tile-Entities-in-chunks.patch diff --git a/Spigot-Server-Patches/0337-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch b/Spigot-Server-Patches/0338-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch similarity index 100% rename from Spigot-Server-Patches/0337-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch rename to Spigot-Server-Patches/0338-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch diff --git a/Spigot-Server-Patches/0338-Set-Zombie-last-tick-at-start-of-drowning-process.patch b/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch similarity index 100% rename from Spigot-Server-Patches/0338-Set-Zombie-last-tick-at-start-of-drowning-process.patch rename to Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch diff --git a/Spigot-Server-Patches/0339-Allow-Saving-of-Oversized-Chunks.patch b/Spigot-Server-Patches/0340-Allow-Saving-of-Oversized-Chunks.patch similarity index 100% rename from Spigot-Server-Patches/0339-Allow-Saving-of-Oversized-Chunks.patch rename to Spigot-Server-Patches/0340-Allow-Saving-of-Oversized-Chunks.patch diff --git a/Spigot-Server-Patches/0340-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/Spigot-Server-Patches/0341-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 100% rename from Spigot-Server-Patches/0340-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to Spigot-Server-Patches/0341-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch diff --git a/Spigot-Server-Patches/0341-Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch similarity index 96% rename from Spigot-Server-Patches/0341-Add-LivingEntity-getTargetEntity.patch rename to Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch index 0260bb0eb..f653f441e 100644 --- a/Spigot-Server-Patches/0341-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch @@ -46,7 +46,7 @@ index 02c09f39848399a86d46bd17569b4f01a7b5ab1f..ed9b2f9adfecdc6d1b9925579ec51065 double[] adouble = new double[]{1.0D}; double d0 = vec3d1.x - vec3d.x; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6d06a5c258981db3bc645087b37a5a8339bc06eb..a76a618ecec1c9ed4afe39b942d44dad15d23fbc 100644 +index 505ba8e298a825ce69cc60c76cb040edeb0acdbd..e87fa15250a57c9b7ed4f4b530289b7b28bb7c9c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1426,6 +1426,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -66,10 +66,10 @@ index 6d06a5c258981db3bc645087b37a5a8339bc06eb..a76a618ecec1c9ed4afe39b942d44dad return 0.0F; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1481cbafa1b4e48822d9e0fa2735b9829440fca3..79cf31d6fcd0e82ee146c489448a93a6e55e4190 100644 +index 0b4e39d93f28ec5c7835bace2ea969a6e99ac2a3..4c011f93c600d87951fe1dc8bf6b84fac7a532cb 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3489,6 +3489,37 @@ public abstract class EntityLiving extends Entity { +@@ -3494,6 +3494,37 @@ public abstract class EntityLiving extends Entity { return world.rayTrace(raytrace); } diff --git a/Spigot-Server-Patches/0342-Use-proper-max-length-when-serialising-BungeeCord-te.patch b/Spigot-Server-Patches/0343-Use-proper-max-length-when-serialising-BungeeCord-te.patch similarity index 100% rename from Spigot-Server-Patches/0342-Use-proper-max-length-when-serialising-BungeeCord-te.patch rename to Spigot-Server-Patches/0343-Use-proper-max-length-when-serialising-BungeeCord-te.patch diff --git a/Spigot-Server-Patches/0343-Entity-getEntitySpawnReason.patch b/Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch similarity index 95% rename from Spigot-Server-Patches/0343-Entity-getEntitySpawnReason.patch rename to Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch index a542d274e..6fec15969 100644 --- a/Spigot-Server-Patches/0343-Entity-getEntitySpawnReason.patch +++ b/Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch @@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a76a618ecec1c9ed4afe39b942d44dad15d23fbc..70e520d7fe8150aa67e81b4983a165f00fe8a554 100644 +index e87fa15250a57c9b7ed4f4b530289b7b28bb7c9c..83dda2bb95d38ff248d635420c0bf12e7b7e95ab 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -72,6 +72,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -72,10 +72,10 @@ index e4651eb2a94080bfa431b0b775ae8019fc922538..4b8dd6c1a9c796ded5ee0a63ccecebca }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 14ec04c6503cca58f64fc2a82a9fd715a06dcefb..a72f16cbcbc226854043bfec07e1e57dbe33c62c 100644 +index f6c459facde67500499365af6da9f43adcd80606..1b0c99de1cfe7de1096a3af043dccf0ba3f0ccfe 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -923,6 +923,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -922,6 +922,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit start private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot diff --git a/Spigot-Server-Patches/0344-Update-entity-Metadata-for-all-tracked-players.patch b/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch similarity index 100% rename from Spigot-Server-Patches/0344-Update-entity-Metadata-for-all-tracked-players.patch rename to Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch diff --git a/Spigot-Server-Patches/0345-Implement-PlayerPostRespawnEvent.patch b/Spigot-Server-Patches/0346-Implement-PlayerPostRespawnEvent.patch similarity index 100% rename from Spigot-Server-Patches/0345-Implement-PlayerPostRespawnEvent.patch rename to Spigot-Server-Patches/0346-Implement-PlayerPostRespawnEvent.patch diff --git a/Spigot-Server-Patches/0346-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/Spigot-Server-Patches/0347-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch similarity index 100% rename from Spigot-Server-Patches/0346-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch rename to Spigot-Server-Patches/0347-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch diff --git a/Spigot-Server-Patches/0347-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/0348-Implement-getters-and-setters-for-EntityItem-owner-a.patch similarity index 100% rename from Spigot-Server-Patches/0347-Implement-getters-and-setters-for-EntityItem-owner-a.patch rename to Spigot-Server-Patches/0348-Implement-getters-and-setters-for-EntityItem-owner-a.patch diff --git a/Spigot-Server-Patches/0348-Server-Tick-Events.patch b/Spigot-Server-Patches/0349-Server-Tick-Events.patch similarity index 93% rename from Spigot-Server-Patches/0348-Server-Tick-Events.patch rename to Spigot-Server-Patches/0349-Server-Tick-Events.patch index 0217e2a92..8c10f3925 100644 --- a/Spigot-Server-Patches/0348-Server-Tick-Events.patch +++ b/Spigot-Server-Patches/0349-Server-Tick-Events.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4c610db03f4d8bae0e310d6a0680cefb7bc74872..b6e103bf140d04e9f3bda4112252da5d5fedcf6d 100644 +index b336cd541b8e3a9ebe3d89a487160d18a294dade..544bc9660b1104e7782bd9e06252d0bd9b2e700d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1120,6 +1120,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant, PlayerChunk.Failure>> completablefuture = this.a(chunkcoordintpair, 1, (i) -> { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index c14d51f1ec37d7b40172ce8cc1c66a7a4f4a3bd5..4e926d5f483ad0d0fae5ceddf0b279128c030a5e 100644 +index 18305112c8fcf1de1a21d9afea1a987859615dc7..638d7303f55e99293703bca80c43f8f00a43c550 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -5,6 +5,8 @@ import com.google.common.collect.ImmutableList; @@ -209,7 +209,7 @@ index c14d51f1ec37d7b40172ce8cc1c66a7a4f4a3bd5..4e926d5f483ad0d0fae5ceddf0b27912 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Queues; -@@ -989,8 +991,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -988,8 +990,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity1 == null) { return false; } else { diff --git a/Spigot-Server-Patches/0359-improve-CraftWorld-isChunkLoaded.patch b/Spigot-Server-Patches/0360-improve-CraftWorld-isChunkLoaded.patch similarity index 100% rename from Spigot-Server-Patches/0359-improve-CraftWorld-isChunkLoaded.patch rename to Spigot-Server-Patches/0360-improve-CraftWorld-isChunkLoaded.patch diff --git a/Spigot-Server-Patches/0360-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0361-Configurable-Keep-Spawn-Loaded-range-per-world.patch similarity index 96% rename from Spigot-Server-Patches/0360-Configurable-Keep-Spawn-Loaded-range-per-world.patch rename to Spigot-Server-Patches/0361-Configurable-Keep-Spawn-Loaded-range-per-world.patch index cfe67f23c..6cbe5687f 100644 --- a/Spigot-Server-Patches/0360-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/0361-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world This lets you disable it for some worlds and lower it for others. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 2debafdc1bb539a49c3f0723b696ea56e9b3eb16..91c9a027dd7aef8253f3d707c95e4ed917d32580 100644 +index 36df7068075e3ead6c7669a448fb885ad94c9fa3..8c61c0f0e60c32743c438fcdce76b236cc2a56c4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -449,4 +449,10 @@ public class PaperWorldConfig { +@@ -443,4 +443,10 @@ public class PaperWorldConfig { break; } } @@ -21,7 +21,7 @@ index 2debafdc1bb539a49c3f0723b696ea56e9b3eb16..91c9a027dd7aef8253f3d707c95e4ed9 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 09d2b5d07c16c186534fdf02ae9242bfee7655d5..adfcc92a0f059e724e51a17468939a87938797ab 100644 +index 21d014f1cae27c769471caad7f9e28f727213e07..e197bbca9891659998488c08c981619311055fc5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -608,6 +608,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0) { -+ try { -+ world.saveIncrementally(serverAutoSave); -+ } catch (ExceptionWorldConflict exceptionWorldConflict) { -+ MinecraftServer.LOGGER.warn(exceptionWorldConflict.getMessage()); -+ } ++ world.saveIncrementally(serverAutoSave); + } + } + // Paper end @@ -261,10 +257,10 @@ index 6dda11ffc022aa9bc7481506811a710a184f5e78..39d89d6209123ae2146ae292009cad44 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 58c6f9194dbd767650117594eee3ae0ba3a00dce..c2fffa60b3d020e4c70a2cabcf61ec36fb9edc65 100644 +index aeb787c68121e8aeca868def9c39010a527d0f70..13d0d358ced5f1617fc17f6706d359d0cf6c796d 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -769,11 +769,43 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -768,11 +768,43 @@ public class WorldServer extends World implements GeneratorAccessSeed { return !this.server.a(this, blockposition, entityhuman) && this.getWorldBorder().a(blockposition); } @@ -309,7 +305,7 @@ index 58c6f9194dbd767650117594eee3ae0ba3a00dce..c2fffa60b3d020e4c70a2cabcf61ec36 try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper if (iprogressupdate != null) { iprogressupdate.a(new ChatMessage("menu.savingLevel")); -@@ -799,6 +831,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -798,6 +830,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit end } diff --git a/Spigot-Server-Patches/0370-Anti-Xray.patch b/Spigot-Server-Patches/0371-Anti-Xray.patch similarity index 99% rename from Spigot-Server-Patches/0370-Anti-Xray.patch rename to Spigot-Server-Patches/0371-Anti-Xray.patch index fc10c0f70..a6cf99e56 100644 --- a/Spigot-Server-Patches/0370-Anti-Xray.patch +++ b/Spigot-Server-Patches/0371-Anti-Xray.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Anti-Xray diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b947b31fc3b135f116af97907d5301619cc33070..43925ed1e5c210399ba9fedb7bf890a6bd617e4a 100644 +index c52fa7bfa82bcd03203f9a2311f09c9b7e5d9911..b3d080aa109d0ed77a3318d07474ec7e46aaa054 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -1,7 +1,9 @@ @@ -18,7 +18,7 @@ index b947b31fc3b135f116af97907d5301619cc33070..43925ed1e5c210399ba9fedb7bf890a6 import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -470,4 +472,31 @@ public class PaperWorldConfig { +@@ -464,4 +466,31 @@ public class PaperWorldConfig { private void maxAutoSaveChunksPerTick() { maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); } @@ -98,7 +98,7 @@ index 0000000000000000000000000000000000000000..df7e4183d8842f5be8ae9d0698f8fa90 +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java new file mode 100644 -index 0000000000000000000000000000000000000000..4ecd180fa84376319ef78bf9b21bf669b22ff817 +index 0000000000000000000000000000000000000000..c0d7767adb996edf9f645be591e4eee1d1dddf97 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java @@ -0,0 +1,620 @@ @@ -197,7 +197,7 @@ index 0000000000000000000000000000000000000000..4ecd180fa84376319ef78bf9b21bf669 + IBlockData blockData = ChunkSection.GLOBAL_PALETTE.getObject(i); + + if (blockData != null) { -+ solidGlobal[i] = blockData.getBlock().isOccluding(blockData, emptyChunk, zeroPos) ++ solidGlobal[i] = blockData.isOccluding(emptyChunk, zeroPos) + && blockData.getBlock() != Blocks.SPAWNER && blockData.getBlock() != Blocks.BARRIER && blockData.getBlock() != Blocks.SHULKER_BOX; + // shulker box checks TE. + } @@ -1382,7 +1382,7 @@ index ee8df274d43be753887fb77e4203e2ee30ea02b3..9f91c02b444874e690eacb0cfa0c8101 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8773b521db869f26525af7b4342955ade835b8ef..1434a6e2830aa455bb6ccfd2ce8c034b8d300414 100644 +index c40d7ef4682c686282094330a0954bd09596c9d5..350178efcbacea6261df98d694c49dde8fa57d97 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -2,6 +2,8 @@ package net.minecraft.server; @@ -1414,7 +1414,7 @@ index 8773b521db869f26525af7b4342955ade835b8ef..1434a6e2830aa455bb6ccfd2ce8c034b this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit -@@ -402,6 +406,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -406,6 +410,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // CraftBukkit end IBlockData iblockdata1 = chunk.setType(blockposition, iblockdata, (i & 64) != 0, (i & 1024) == 0); // CraftBukkit custom NO_PLACE flag @@ -1423,10 +1423,10 @@ index 8773b521db869f26525af7b4342955ade835b8ef..1434a6e2830aa455bb6ccfd2ce8c034b if (iblockdata1 == null) { // CraftBukkit start - remove blockstate if failed (or the same) diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index c2fffa60b3d020e4c70a2cabcf61ec36fb9edc65..789fd7d3d7679408d11a20cca6db96ecb86a067d 100644 +index 13d0d358ced5f1617fc17f6706d359d0cf6c796d..abda45b1e833ef9d795f11670cf650ed2479673c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -96,7 +96,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -95,7 +95,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Add env and gen to constructor, WorldData -> WorldDataServer public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { diff --git a/Spigot-Server-Patches/0371-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/Spigot-Server-Patches/0372-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch similarity index 94% rename from Spigot-Server-Patches/0371-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch rename to Spigot-Server-Patches/0372-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch index 134323c6d..fde8ce6bd 100644 --- a/Spigot-Server-Patches/0371-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch +++ b/Spigot-Server-Patches/0372-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch @@ -17,10 +17,10 @@ This should fully solve all of the issues around it so that only natural influences natural spawns. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 43925ed1e5c210399ba9fedb7bf890a6bd617e4a..16727e92f591725c8f8cefb250b7ab8c64a19472 100644 +index b3d080aa109d0ed77a3318d07474ec7e46aaa054..1b60c649310f44fdf4533dfde50703b544c8d946 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -473,6 +473,16 @@ public class PaperWorldConfig { +@@ -467,6 +467,16 @@ public class PaperWorldConfig { maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); } diff --git a/Spigot-Server-Patches/0372-Configurable-projectile-relative-velocity.patch b/Spigot-Server-Patches/0373-Configurable-projectile-relative-velocity.patch similarity index 95% rename from Spigot-Server-Patches/0372-Configurable-projectile-relative-velocity.patch rename to Spigot-Server-Patches/0373-Configurable-projectile-relative-velocity.patch index 5f2519a43..8129975d2 100644 --- a/Spigot-Server-Patches/0372-Configurable-projectile-relative-velocity.patch +++ b/Spigot-Server-Patches/0373-Configurable-projectile-relative-velocity.patch @@ -25,10 +25,10 @@ P3) Solutions for 1) and especially 2) might not be future-proof, while this server-internal fix makes this change future-proof. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 16727e92f591725c8f8cefb250b7ab8c64a19472..a6e68b2ab8890d9d2a842ca0a6b565a1831fed6b 100644 +index 1b60c649310f44fdf4533dfde50703b544c8d946..1bbea57d94dfe493741a4b32d5a7b71e6cb77305 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -509,4 +509,9 @@ public class PaperWorldConfig { +@@ -503,4 +503,9 @@ public class PaperWorldConfig { } log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks / Update Radius: " + updateRadius); } diff --git a/Spigot-Server-Patches/0373-Mark-entities-as-being-ticked-when-notifying-navigat.patch b/Spigot-Server-Patches/0374-Mark-entities-as-being-ticked-when-notifying-navigat.patch similarity index 81% rename from Spigot-Server-Patches/0373-Mark-entities-as-being-ticked-when-notifying-navigat.patch rename to Spigot-Server-Patches/0374-Mark-entities-as-being-ticked-when-notifying-navigat.patch index cee98a020..12552ee96 100644 --- a/Spigot-Server-Patches/0373-Mark-entities-as-being-ticked-when-notifying-navigat.patch +++ b/Spigot-Server-Patches/0374-Mark-entities-as-being-ticked-when-notifying-navigat.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Mark entities as being ticked when notifying navigation diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 789fd7d3d7679408d11a20cca6db96ecb86a067d..2738d61709a956e83ab7b4e05063a99bcbb7e01b 100644 +index abda45b1e833ef9d795f11670cf650ed2479673c..ed5b69682fc80d8ff9a0e068d45456a75cbe3891 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1320,6 +1320,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1319,6 +1319,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { VoxelShape voxelshape1 = iblockdata1.getCollisionShape(this, blockposition); if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) { @@ -16,7 +16,7 @@ index 789fd7d3d7679408d11a20cca6db96ecb86a067d..2738d61709a956e83ab7b4e05063a99b Iterator iterator = this.navigators.iterator(); while (iterator.hasNext()) { -@@ -1330,6 +1331,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1329,6 +1330,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } diff --git a/Spigot-Server-Patches/0374-offset-item-frame-ticking.patch b/Spigot-Server-Patches/0375-offset-item-frame-ticking.patch similarity index 100% rename from Spigot-Server-Patches/0374-offset-item-frame-ticking.patch rename to Spigot-Server-Patches/0375-offset-item-frame-ticking.patch diff --git a/Spigot-Server-Patches/0375-Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/0376-Avoid-hopper-searches-if-there-are-no-items.patch similarity index 100% rename from Spigot-Server-Patches/0375-Avoid-hopper-searches-if-there-are-no-items.patch rename to Spigot-Server-Patches/0376-Avoid-hopper-searches-if-there-are-no-items.patch diff --git a/Spigot-Server-Patches/0376-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch similarity index 99% rename from Spigot-Server-Patches/0376-Asynchronous-chunk-IO-and-loading.patch rename to Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch index 31aeb6500..5d19c0d71 100644 --- a/Spigot-Server-Patches/0376-Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch @@ -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 fa1c920ea6092259149f9e7f9cd7cc1ed27bf338..98acbfa44dd9042b26fdf719d7748f92d201c928 100644 +index 03bb2102d6952df04753ba9986aad9b494568e2d..2956a831af9b8cbc87c8761838db5b36389a7ad2 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -57,6 +57,17 @@ public class WorldTimingsHandler { @@ -140,7 +140,7 @@ index fa1c920ea6092259149f9e7f9cd7cc1ed27bf338..98acbfa44dd9042b26fdf719d7748f92 + public final Timing chunkUnloadDataSave; + public WorldTimingsHandler(World server) { - String name = server.worldData.getName() +" - "; + String name = server.getWorld().getName() +" - "; @@ -110,6 +121,17 @@ public class WorldTimingsHandler { @@ -199,7 +199,7 @@ index af810987846efcd2bffbd23c31481b2d31c168dd..331493a172f58e71b464d635efdba461 doChunkInfo(sender, args); break; diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 1aa7d0cfaf5697daeeb98e237387f27e76bca16f..8c2202fbc1c38e6cd19005d010e365ae14233f51 100644 +index f9b1b198299166759fe0bd0a36d8d88c626e06a4..bf86444c479f346e7d56f10a7c0ebefd62f08f59 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -1,5 +1,6 @@ @@ -209,7 +209,7 @@ index 1aa7d0cfaf5697daeeb98e237387f27e76bca16f..8c2202fbc1c38e6cd19005d010e365ae import com.google.common.base.Strings; import com.google.common.base.Throwables; -@@ -346,4 +347,54 @@ public class PaperConfig { +@@ -347,4 +348,54 @@ public class PaperConfig { maxBookPageSize = getInt("settings.book-size.page-max", maxBookPageSize); maxBookTotalSizeMultiplier = getDouble("settings.book-size.total-multiplier", maxBookTotalSizeMultiplier); } @@ -334,14 +334,13 @@ index 0000000000000000000000000000000000000000..5af0ac3d9e87c06053e65433060f1577 +} 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 0000000000000000000000000000000000000000..a6434b4e28a73ecab4350862c5747b7494761ba0 +index 0000000000000000000000000000000000000000..1917d7be7dfddc93c95b9fd864cf13f9a24c8f96 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java -@@ -0,0 +1,607 @@ +@@ -0,0 +1,606 @@ +package com.destroystokyo.paper.io; + +import net.minecraft.server.ChunkCoordIntPair; -+import net.minecraft.server.ExceptionWorldConflict; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.NBTTagCompound; +import net.minecraft.server.RegionFile; @@ -882,15 +881,15 @@ index 0000000000000000000000000000000000000000..a6434b4e28a73ecab4350862c5747b74 + } + + // check if another process is writing -+ try { -+ this.world.checkSession(); -+ } catch (final ExceptionWorldConflict ex) { ++ /*try { TODO: Can we restore this? ++ ((WorldServer)this.world).checkSession(); ++ } catch (final Exception ex) { + LOGGER.fatal("Couldn't save chunk; already in use by another instance of Minecraft?", ex); + // we don't need to set the write counter to -1 as we know at this stage there's no point in re-scheduling + // writes since they'll fail anyways. + return; + } -+ ++*/ + for (;;) { + final long writeCounter; + final NBTTagCompound data; @@ -2916,7 +2915,7 @@ index fa03834dacacf7ae6a326c88007256a261153c27..c0d2df8ef3b4d0224ede2b7a4ef4e3f9 } } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 5658b2a3c4601d07545b08b0a7179c8f3b051bd4..b2e8ddc9ff1bf5f519d971455d48a2faad3638f2 100644 +index 99801463d958540b5148e55c1e44f90a1078c371..9615c4d324e42f7f91a7e60b6151c16d20e9c739 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -696,4 +696,9 @@ public final class MCUtil { @@ -2942,7 +2941,7 @@ index ca45b10b5dd7003314ff4c3294f13d2c53d9e678..32a4d1d036ed01e556348361407b7ea2 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataConverterRegistry.a(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c6e96ebe3d3372e1c0868de46dd3b099dbd66bf3..aa9b16e75123dfff4c2ea9501a9ae2e584f85803 100644 +index 1c28fdb8fb98cecb3c473fa0ea31edce7bbf002b..3a9e872922de10b597cc898ba76f3fbfd46e41bb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -808,7 +808,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 2738d61709a956e83ab7b4e05063a99bcbb7e01b..88a7217101070222c3c9a07ce6a6d7d75573144d 100644 +index ed5b69682fc80d8ff9a0e068d45456a75cbe3891..6e9a5b77ef7e67534b64781ee9db6b6d3e33e879 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -94,6 +94,79 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -93,6 +93,79 @@ public class WorldServer extends World implements GeneratorAccessSeed { return this.chunkProvider.getChunkAt(x, z, false); } @@ -3976,7 +3975,7 @@ index 2738d61709a956e83ab7b4e05063a99bcbb7e01b..88a7217101070222c3c9a07ce6a6d7d7 // Add env and gen to constructor, WorldData -> WorldDataServer public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor -@@ -141,6 +214,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -140,6 +213,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.dragonBattle = null; } this.getServer().addWorld(this.getWorld()); // CraftBukkit @@ -3985,7 +3984,7 @@ index 2738d61709a956e83ab7b4e05063a99bcbb7e01b..88a7217101070222c3c9a07ce6a6d7d7 } // CraftBukkit start -@@ -1570,7 +1645,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1569,7 +1644,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { } MCUtil.getSpiralOutChunks(spawn, radiusInBlocks >> 4).forEach(pair -> { diff --git a/Spigot-Server-Patches/0377-Use-getChunkIfLoadedImmediately-in-places.patch b/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch similarity index 91% rename from Spigot-Server-Patches/0377-Use-getChunkIfLoadedImmediately-in-places.patch rename to Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch index 684a858e9..78b6285e2 100644 --- a/Spigot-Server-Patches/0377-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch @@ -21,7 +21,7 @@ index 795b24c8d102417ae7e730254ecddefc06dbe0df..e382315c91540ac24821e432ee31a824 return; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1434a6e2830aa455bb6ccfd2ce8c034b8d300414..4564c6ebb3aaed1ca63ff26524bba2edda551f85 100644 +index 350178efcbacea6261df98d694c49dde8fa57d97..37a06b96b9d5c98b23e5da7352f549f4a959abbd 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -103,6 +103,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -38,7 +38,7 @@ index 1434a6e2830aa455bb6ccfd2ce8c034b8d300414..4564c6ebb3aaed1ca63ff26524bba2ed protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper -@@ -1033,14 +1040,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1037,14 +1044,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } public boolean p(BlockPosition blockposition) { @@ -55,7 +55,7 @@ index 1434a6e2830aa455bb6ccfd2ce8c034b8d300414..4564c6ebb3aaed1ca63ff26524bba2ed return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a((IBlockAccess) this, blockposition, entity, enumdirection); } -@@ -1161,7 +1168,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1165,7 +1172,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { @@ -65,13 +65,13 @@ index 1434a6e2830aa455bb6ccfd2ce8c034b8d300414..4564c6ebb3aaed1ca63ff26524bba2ed 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 88a7217101070222c3c9a07ce6a6d7d75573144d..3e42d52d2256c85b7dcbbd0e363fa1e1c789b1bf 100644 +index 6e9a5b77ef7e67534b64781ee9db6b6d3e33e879..85a025bd20cbcf5547b0c9e0f8d4a62f5bcfc358 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -91,7 +91,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -90,7 +90,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } - public Chunk getChunkIfLoaded(int x, int z) { + @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI - return this.chunkProvider.getChunkAt(x, z, false); + return this.chunkProvider.getChunkAtIfLoadedImmediately(x, z); // Paper } diff --git a/Spigot-Server-Patches/0378-Reduce-sync-loads.patch b/Spigot-Server-Patches/0379-Reduce-sync-loads.patch similarity index 97% rename from Spigot-Server-Patches/0378-Reduce-sync-loads.patch rename to Spigot-Server-Patches/0379-Reduce-sync-loads.patch index 7d7d74706..3e6485f9a 100644 --- a/Spigot-Server-Patches/0378-Reduce-sync-loads.patch +++ b/Spigot-Server-Patches/0379-Reduce-sync-loads.patch @@ -298,10 +298,10 @@ index edd901bb53385fa3d189a0057d57f98bf8b7115c..707db4febac59a4d09d6420ea2add469 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 4564c6ebb3aaed1ca63ff26524bba2edda551f85..ddd66c2519d67585df06d68612a0c8a8830669ac 100644 +index 37a06b96b9d5c98b23e5da7352f549f4a959abbd..b2852df57368294c8965fbc50a496a8f465304ae 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1101,7 +1101,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1105,7 +1105,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 <= j; ++i1) { for (int j1 = k; j1 <= l; ++j1) { @@ -310,7 +310,7 @@ index 4564c6ebb3aaed1ca63ff26524bba2edda551f85..ddd66c2519d67585df06d68612a0c8a8 if (chunk != null) { chunk.a(entity, axisalignedbb, list, predicate); -@@ -1122,7 +1122,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1126,7 +1126,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { @@ -319,7 +319,7 @@ index 4564c6ebb3aaed1ca63ff26524bba2edda551f85..ddd66c2519d67585df06d68612a0c8a8 if (chunk != null) { chunk.a(entitytypes, axisalignedbb, list, predicate); -@@ -1145,7 +1145,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1149,7 +1149,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { @@ -329,10 +329,10 @@ index 4564c6ebb3aaed1ca63ff26524bba2edda551f85..ddd66c2519d67585df06d68612a0c8a8 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 3e42d52d2256c85b7dcbbd0e363fa1e1c789b1bf..0dd249f94905c30b5320109a3f0b17cac70def8d 100644 +index 85a025bd20cbcf5547b0c9e0f8d4a62f5bcfc358..7e01a4953c7fcff3a1199c7ca4c7731748418d69 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -166,6 +166,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -165,6 +165,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { }; public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager; // Paper end diff --git a/Spigot-Server-Patches/0379-Implement-alternative-item-despawn-rate.patch b/Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch similarity index 97% rename from Spigot-Server-Patches/0379-Implement-alternative-item-despawn-rate.patch rename to Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch index 47adb6a10..f12dba254 100644 --- a/Spigot-Server-Patches/0379-Implement-alternative-item-despawn-rate.patch +++ b/Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement alternative item-despawn-rate diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a6e68b2ab8890d9d2a842ca0a6b565a1831fed6b..cf9d980e61be199a34cff98f805e511f9410dd51 100644 +index 1bbea57d94dfe493741a4b32d5a7b71e6cb77305..f7a52481fa00a45fdebe6715dfde85c0f91fb8c0 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -1,10 +1,15 @@ @@ -24,7 +24,7 @@ index a6e68b2ab8890d9d2a842ca0a6b565a1831fed6b..cf9d980e61be199a34cff98f805e511f import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -514,4 +519,52 @@ public class PaperWorldConfig { +@@ -508,4 +513,52 @@ public class PaperWorldConfig { private void disableRelativeProjectileVelocity() { disableRelativeProjectileVelocity = getBoolean("game-mechanics.disable-relative-projectile-velocity", false); } diff --git a/Spigot-Server-Patches/0380-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch b/Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch similarity index 96% rename from Spigot-Server-Patches/0380-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch rename to Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch index 4091fbc5f..ef4223df2 100644 --- a/Spigot-Server-Patches/0380-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch +++ b/Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch @@ -7,7 +7,7 @@ If the Bukkit generator already has a spawn, use it immediately instead of spending time generating one that we won't use diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index aa9b16e75123dfff4c2ea9501a9ae2e584f85803..bdb98d308df3e3481697d03f882e048d6df46946 100644 +index 824e9df675edd664ceb11c8cdb39f035df237ce3..13edd764d79a5974ec58392e70d049172c1090f4 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -513,11 +513,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 0; // Paper @@ -85,7 +85,7 @@ index bdb98d308df3e3481697d03f882e048d6df46946..82d0492fd208ca7991d07cdc62966352 this.methodProfiler.a(() -> { return worldserver + " " + worldserver.getDimensionKey().a(); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 54285237ed5a096b2e46cabd78f7dcd5128133a8..543bbd1610fb2e6df4e8ad7fbf9f2cf9b4c6cbe6 100644 +index 2b06c95b4fac97513e706ef073fdd7418e1f092c..67fda8bd5a0ad6fea2df0066c61e006c8a49980c 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -62,6 +62,7 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -481,10 +481,10 @@ index 5ebba482a65cfe6079484a99f016f968c59df8ee..d017904561d093bf8f0061f646a75aa5 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ddd66c2519d67585df06d68612a0c8a8830669ac..9b751727d137316290f363e39993f75293fd0887 100644 +index b2852df57368294c8965fbc50a496a8f465304ae..41302dc5a2f30987dab448d2715f9eeea8174dfc 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1133,8 +1133,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1137,8 +1137,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return list; } diff --git a/Spigot-Server-Patches/0399-PlayerDeathEvent-shouldDropExperience.patch b/Spigot-Server-Patches/0400-PlayerDeathEvent-shouldDropExperience.patch similarity index 100% rename from Spigot-Server-Patches/0399-PlayerDeathEvent-shouldDropExperience.patch rename to Spigot-Server-Patches/0400-PlayerDeathEvent-shouldDropExperience.patch diff --git a/Spigot-Server-Patches/0400-Prevent-bees-loading-chunks-checking-hive-position.patch b/Spigot-Server-Patches/0401-Prevent-bees-loading-chunks-checking-hive-position.patch similarity index 100% rename from Spigot-Server-Patches/0400-Prevent-bees-loading-chunks-checking-hive-position.patch rename to Spigot-Server-Patches/0401-Prevent-bees-loading-chunks-checking-hive-position.patch diff --git a/Spigot-Server-Patches/0401-Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/Spigot-Server-Patches/0402-Don-t-load-Chunks-from-Hoppers-and-other-things.patch similarity index 100% rename from Spigot-Server-Patches/0401-Don-t-load-Chunks-from-Hoppers-and-other-things.patch rename to Spigot-Server-Patches/0402-Don-t-load-Chunks-from-Hoppers-and-other-things.patch diff --git a/Spigot-Server-Patches/0402-Guard-against-serializing-mismatching-chunk-coordina.patch b/Spigot-Server-Patches/0403-Guard-against-serializing-mismatching-chunk-coordina.patch similarity index 100% rename from Spigot-Server-Patches/0402-Guard-against-serializing-mismatching-chunk-coordina.patch rename to Spigot-Server-Patches/0403-Guard-against-serializing-mismatching-chunk-coordina.patch diff --git a/Spigot-Server-Patches/0403-Optimise-IEntityAccess-getPlayerByUUID.patch b/Spigot-Server-Patches/0404-Optimise-IEntityAccess-getPlayerByUUID.patch similarity index 93% rename from Spigot-Server-Patches/0403-Optimise-IEntityAccess-getPlayerByUUID.patch rename to Spigot-Server-Patches/0404-Optimise-IEntityAccess-getPlayerByUUID.patch index 8087a97ce..596ba2a61 100644 --- a/Spigot-Server-Patches/0403-Optimise-IEntityAccess-getPlayerByUUID.patch +++ b/Spigot-Server-Patches/0404-Optimise-IEntityAccess-getPlayerByUUID.patch @@ -23,10 +23,10 @@ index 48e8b005bd9589135eff03a110ecce8776ab208a..74d4c28246e7db850e6d993e07a84b2a EntityHuman entityhuman = (EntityHuman) this.getPlayers().get(i); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0dd249f94905c30b5320109a3f0b17cac70def8d..1d4e34b2ece861e7e4f2fe0f15f6fbf8ab47f86c 100644 +index 7e01a4953c7fcff3a1199c7ca4c7731748418d69..cdb558edd9aa176a7750403afd6634e29ada616f 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -173,6 +173,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -172,6 +172,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Paper end diff --git a/Spigot-Server-Patches/0404-Fix-items-not-falling-correctly.patch b/Spigot-Server-Patches/0405-Fix-items-not-falling-correctly.patch similarity index 100% rename from Spigot-Server-Patches/0404-Fix-items-not-falling-correctly.patch rename to Spigot-Server-Patches/0405-Fix-items-not-falling-correctly.patch diff --git a/Spigot-Server-Patches/0405-Lag-compensate-eating.patch b/Spigot-Server-Patches/0406-Lag-compensate-eating.patch similarity index 89% rename from Spigot-Server-Patches/0405-Lag-compensate-eating.patch rename to Spigot-Server-Patches/0406-Lag-compensate-eating.patch index 97c8f1a7b..838167719 100644 --- a/Spigot-Server-Patches/0405-Lag-compensate-eating.patch +++ b/Spigot-Server-Patches/0406-Lag-compensate-eating.patch @@ -7,7 +7,7 @@ When the server is lagging, players will wait longer when eating. Change to also use a time check instead if it passes. diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 17491b9f9b4c8fb931a249580810681cb618ee45..3d30dcfdf124ff634afff3db17375bad06a19ad8 100644 +index 8dc2e28b2386a3b9512dfcc382f9deb534381392..ce586a89b3d812e5c6ff371c2abcb15df8de99d9 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -119,7 +119,7 @@ public abstract class EntityLiving extends Entity { @@ -19,7 +19,7 @@ index 17491b9f9b4c8fb931a249580810681cb618ee45..3d30dcfdf124ff634afff3db17375bad protected int bl; private BlockPosition bE; private Optional bF; -@@ -3012,6 +3012,11 @@ public abstract class EntityLiving extends Entity { +@@ -3017,6 +3017,11 @@ public abstract class EntityLiving extends Entity { return ((Byte) this.datawatcher.get(EntityLiving.an) & 2) > 0 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND; } @@ -31,7 +31,7 @@ index 17491b9f9b4c8fb931a249580810681cb618ee45..3d30dcfdf124ff634afff3db17375bad private void u() { if (this.isHandRaised()) { if (ItemStack.d(this.b(this.getRaisedHand()), this.activeItem)) { -@@ -3021,7 +3026,13 @@ public abstract class EntityLiving extends Entity { +@@ -3026,7 +3031,13 @@ public abstract class EntityLiving extends Entity { this.b(this.activeItem, 5); } @@ -46,7 +46,7 @@ index 17491b9f9b4c8fb931a249580810681cb618ee45..3d30dcfdf124ff634afff3db17375bad this.s(); } } else { -@@ -3071,7 +3082,10 @@ public abstract class EntityLiving extends Entity { +@@ -3076,7 +3087,10 @@ public abstract class EntityLiving extends Entity { if (!itemstack.isEmpty() && !this.isHandRaised() || forceUpdate) { // Paper use override flag this.activeItem = itemstack; @@ -58,7 +58,7 @@ index 17491b9f9b4c8fb931a249580810681cb618ee45..3d30dcfdf124ff634afff3db17375bad if (!this.world.isClientSide) { this.c(1, true); this.c(2, enumhand == EnumHand.OFF_HAND); -@@ -3095,7 +3109,10 @@ public abstract class EntityLiving extends Entity { +@@ -3100,7 +3114,10 @@ public abstract class EntityLiving extends Entity { } } else if (!this.isHandRaised() && !this.activeItem.isEmpty()) { this.activeItem = ItemStack.b; @@ -70,7 +70,7 @@ index 17491b9f9b4c8fb931a249580810681cb618ee45..3d30dcfdf124ff634afff3db17375bad } } -@@ -3217,7 +3234,10 @@ public abstract class EntityLiving extends Entity { +@@ -3222,7 +3239,10 @@ public abstract class EntityLiving extends Entity { } this.activeItem = ItemStack.b; diff --git a/Spigot-Server-Patches/0406-Optimize-call-to-getFluid-for-explosions.patch b/Spigot-Server-Patches/0407-Optimize-call-to-getFluid-for-explosions.patch similarity index 100% rename from Spigot-Server-Patches/0406-Optimize-call-to-getFluid-for-explosions.patch rename to Spigot-Server-Patches/0407-Optimize-call-to-getFluid-for-explosions.patch diff --git a/Spigot-Server-Patches/0407-Fix-last-firework-in-stack-not-having-effects-when-d.patch b/Spigot-Server-Patches/0408-Fix-last-firework-in-stack-not-having-effects-when-d.patch similarity index 100% rename from Spigot-Server-Patches/0407-Fix-last-firework-in-stack-not-having-effects-when-d.patch rename to Spigot-Server-Patches/0408-Fix-last-firework-in-stack-not-having-effects-when-d.patch diff --git a/Spigot-Server-Patches/0408-Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch similarity index 96% rename from Spigot-Server-Patches/0408-Entity-Activation-Range-2.0.patch rename to Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch index 1f4cded06..cecf2bb12 100644 --- a/Spigot-Server-Patches/0408-Entity-Activation-Range-2.0.patch +++ b/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch @@ -13,20 +13,8 @@ Adds water Mobs to activation range config and nerfs fish Adds flying monsters to control ghast and phantoms Adds villagers as separate config -diff --git a/src/main/java/net/minecraft/server/BehaviorController.java b/src/main/java/net/minecraft/server/BehaviorController.java -index ae2905b403a63396d9cdc61444586ea5548f2974..5ba4f96eec81dc6552aa195eaf544fe400441458 100644 ---- a/src/main/java/net/minecraft/server/BehaviorController.java -+++ b/src/main/java/net/minecraft/server/BehaviorController.java -@@ -379,6 +379,7 @@ public class BehaviorController { - - } - -+ public boolean hasActivity(Activity activity) { return c(activity); } // Paper - OBFHELPER - public boolean c(Activity activity) { - return this.j.contains(activity); - } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4fbe3d2547de278b537c12940a8351c8d1521d1b..1eb5c6085fece782db0533ff8b7c5629b284c083 100644 +index ef492fe260ef1d00f83b2f298a4fab4fd71ea4b5..2935c23d3cac78a8b5fbd33024d9bbf0de565ac2 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -192,6 +192,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -80,7 +68,7 @@ index c94197a50269622e8995685119bac984c45e6833..11d384729326af693a9a679195acbd59 protected EntityCreature(EntityTypes entitytypes, World world) { super(entitytypes, world); diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 081baca9a101d188e4810d04f69811d52de7a107..9f6f2caf25825bb135037c6205cb578dd375b9f8 100644 +index dbd7850df45fb9ee550ce33f97bdfe9cf5bfcd34..61323f9b15350b1d227b2f3de67c40846ba7c2f9 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -47,7 +47,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -111,7 +99,7 @@ index 081baca9a101d188e4810d04f69811d52de7a107..9f6f2caf25825bb135037c6205cb578d if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) { EntityInsentient entityinsentient = (EntityInsentient) this.getVehicle(); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 3d30dcfdf124ff634afff3db17375bad06a19ad8..27b92664cee1c685b5b6b9b385150bb5fdb9fa7a 100644 +index ce586a89b3d812e5c6ff371c2abcb15df8de99d9..3662752ce3a300b1d35b5214a8cf602ab6399edb 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -97,7 +97,7 @@ public abstract class EntityLiving extends Entity { @@ -330,7 +318,7 @@ index 50487dbf0ac162d7608b67b4fb50fa7f8bfba69d..04b28555b1bb68536e40bb6526136787 return this.c; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9b751727d137316290f363e39993f75293fd0887..7d13f7a8b7272ad2ac86e706c1b8c7649cccb01c 100644 +index 41302dc5a2f30987dab448d2715f9eeea8174dfc..6d3b851f65858f6d768aa64c0bef71e18c45f0a2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -81,6 +81,12 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -347,7 +335,7 @@ index 9b751727d137316290f363e39993f75293fd0887..7d13f7a8b7272ad2ac86e706c1b8c764 public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..97af8f8e3c48694c390036bb1455e6d22fcd1c49 100644 +index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..5dcc1ba547db7cc53a08426a7ad119ae88690136 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -2,24 +2,34 @@ package org.spigotmc; @@ -636,14 +624,14 @@ index b73af0a5fb2d08c2f3a52c699ef0d8ed34c83f77..97af8f8e3c48694c390036bb1455e6d2 + + if (config.villagersActiveForPanic) { + for (Activity activity : VILLAGER_PANIC_IMMUNITIES) { -+ if (behaviorController.hasActivity(activity)) { ++ if (behaviorController.c(activity)) { + return 20*5; + } + } + } + + if (config.villagersWorkImmunityAfter > 0 && inactiveFor >= config.villagersWorkImmunityAfter) { -+ if (behaviorController.hasActivity(Activity.WORK)) { ++ if (behaviorController.c(Activity.WORK)) { + return config.villagersWorkImmunityFor; + } + } diff --git a/Spigot-Server-Patches/0409-Add-effect-to-block-break-naturally.patch b/Spigot-Server-Patches/0410-Add-effect-to-block-break-naturally.patch similarity index 100% rename from Spigot-Server-Patches/0409-Add-effect-to-block-break-naturally.patch rename to Spigot-Server-Patches/0410-Add-effect-to-block-break-naturally.patch diff --git a/Spigot-Server-Patches/0410-Tracking-Range-Improvements.patch b/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch similarity index 100% rename from Spigot-Server-Patches/0410-Tracking-Range-Improvements.patch rename to Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch diff --git a/Spigot-Server-Patches/0411-Fix-items-vanishing-through-end-portal.patch b/Spigot-Server-Patches/0412-Fix-items-vanishing-through-end-portal.patch similarity index 94% rename from Spigot-Server-Patches/0411-Fix-items-vanishing-through-end-portal.patch rename to Spigot-Server-Patches/0412-Fix-items-vanishing-through-end-portal.patch index a9befce1d..3cc0b86e7 100644 --- a/Spigot-Server-Patches/0411-Fix-items-vanishing-through-end-portal.patch +++ b/Spigot-Server-Patches/0412-Fix-items-vanishing-through-end-portal.patch @@ -13,7 +13,7 @@ Quickly loading the exact world spawn chunk before searching the heightmap resolves the issue without having to load all spawn chunks. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 1eb5c6085fece782db0533ff8b7c5629b284c083..097bab174bd05ee42c172e8926f5c66000bed239 100644 +index 2935c23d3cac78a8b5fbd33024d9bbf0de565ac2..9cf05a78871fba00c2453dc103d822271a8fec0b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2531,6 +2531,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0412-Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch similarity index 100% rename from Spigot-Server-Patches/0412-Bees-get-gravity-in-void.-Fixes-MC-167279.patch rename to Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch diff --git a/Spigot-Server-Patches/0413-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch similarity index 97% rename from Spigot-Server-Patches/0413-Optimise-getChunkAt-calls-for-loaded-chunks.patch rename to Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch index 0ca1c3c83..c49febe09 100644 --- a/Spigot-Server-Patches/0413-Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -65,7 +65,7 @@ index 1597b7a882769109f467d81ecbadc45ff6779b7e..67d6facd37462beef49dac311019b197 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7d13f7a8b7272ad2ac86e706c1b8c7649cccb01c..50848896588e16bf2a498ba28ab30919a081afd5 100644 +index 91f8927892a7c8f4456163d9de5e307f0e15cf54..276c805b60630952bcc1e467bb501926f214ed10 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -319,6 +319,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0414-Allow-overriding-the-java-version-check.patch b/Spigot-Server-Patches/0415-Allow-overriding-the-java-version-check.patch similarity index 100% rename from Spigot-Server-Patches/0414-Allow-overriding-the-java-version-check.patch rename to Spigot-Server-Patches/0415-Allow-overriding-the-java-version-check.patch diff --git a/Spigot-Server-Patches/0415-Add-ThrownEggHatchEvent.patch b/Spigot-Server-Patches/0416-Add-ThrownEggHatchEvent.patch similarity index 100% rename from Spigot-Server-Patches/0415-Add-ThrownEggHatchEvent.patch rename to Spigot-Server-Patches/0416-Add-ThrownEggHatchEvent.patch diff --git a/Spigot-Server-Patches/0416-Optimise-random-block-ticking.patch b/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch similarity index 97% rename from Spigot-Server-Patches/0416-Optimise-random-block-ticking.patch rename to Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch index be5febc5c..94fadc2a2 100644 --- a/Spigot-Server-Patches/0416-Optimise-random-block-ticking.patch +++ b/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch @@ -230,7 +230,7 @@ index 900b551f6f76862443b09c1e76ad596eda5655f4..1cb45f97b644347d16b66b46113b1e44 public interface a { diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 5862e2026b685df80de45c529f1367382a2a60b0..a5cd127c0f133b0ef136f4efad9d71eab2edf8e4 100644 +index 00827c335e9413e986d7f07d0adbcef0d106a553..c66a8011dde4932e03ea91194ea92a7263e48428 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -29,7 +29,7 @@ public class EntityTurtle extends EntityAnimal { @@ -243,10 +243,10 @@ index 5862e2026b685df80de45c529f1367382a2a60b0..a5cd127c0f133b0ef136f4efad9d71ea // TODO Paper: Obf helpers here can prolly be removed? check that no newer patches use them public final BlockPosition getHome() { return this.getHomePos(); } // Paper - OBFHELPER diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 50848896588e16bf2a498ba28ab30919a081afd5..d2b3e06dda10fc321768301c35f319767796d7d5 100644 +index ce55c4729024ce9e226d9dd14f7c3ea4bde7ca34..e52ec352fb98cd030d7c13362d0bf950c60c6372 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1460,10 +1460,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1464,10 +1464,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public abstract TagRegistry p(); public BlockPosition a(int i, int j, int k, int l) { @@ -267,10 +267,10 @@ index 50848896588e16bf2a498ba28ab30919a081afd5..d2b3e06dda10fc321768301c35f31976 public boolean isSavingDisabled() { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 1d4e34b2ece861e7e4f2fe0f15f6fbf8ab47f86c..3266ecf2ad975613942a9cd127440dd898b12ff5 100644 +index cdb558edd9aa176a7750403afd6634e29ada616f..ce1f2b1dda28d706744aece90b96518495e288a4 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -558,7 +558,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -557,7 +557,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { }); } @@ -284,7 +284,7 @@ index 1d4e34b2ece861e7e4f2fe0f15f6fbf8ab47f86c..3266ecf2ad975613942a9cd127440dd8 ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); boolean flag = this.isRaining(); int j = chunkcoordintpair.d(); -@@ -566,10 +571,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -565,10 +570,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); gameprofilerfiller.enter("thunder"); @@ -297,7 +297,7 @@ index 1d4e34b2ece861e7e4f2fe0f15f6fbf8ab47f86c..3266ecf2ad975613942a9cd127440dd8 if (this.isRainingAt(blockposition)) { DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper -@@ -592,59 +597,77 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -591,59 +596,77 @@ public class WorldServer extends World implements GeneratorAccessSeed { } gameprofilerfiller.exitEnter("iceandsnow"); diff --git a/Spigot-Server-Patches/0417-Entity-Jump-API.patch b/Spigot-Server-Patches/0418-Entity-Jump-API.patch similarity index 94% rename from Spigot-Server-Patches/0417-Entity-Jump-API.patch rename to Spigot-Server-Patches/0418-Entity-Jump-API.patch index 63f5a0bfa..50977959f 100644 --- a/Spigot-Server-Patches/0417-Entity-Jump-API.patch +++ b/Spigot-Server-Patches/0418-Entity-Jump-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity Jump API diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 27b92664cee1c685b5b6b9b385150bb5fdb9fa7a..e4c7f4c100e1b8d4470da954a3b72f9e0ec5b494 100644 +index 3662752ce3a300b1d35b5214a8cf602ab6399edb..be102d9fed4596f2e53cca102c5a779ded2bf26f 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2748,8 +2748,10 @@ public abstract class EntityLiving extends Entity { +@@ -2753,8 +2753,10 @@ public abstract class EntityLiving extends Entity { } else if (this.aN() && (!this.onGround || d7 > d8)) { this.c((Tag) TagsFluid.LAVA); } else if ((this.onGround || flag && d7 <= d8) && this.jumpTicks == 0) { diff --git a/Spigot-Server-Patches/0418-Add-option-to-nerf-pigmen-from-nether-portals.patch b/Spigot-Server-Patches/0419-Add-option-to-nerf-pigmen-from-nether-portals.patch similarity index 93% rename from Spigot-Server-Patches/0418-Add-option-to-nerf-pigmen-from-nether-portals.patch rename to Spigot-Server-Patches/0419-Add-option-to-nerf-pigmen-from-nether-portals.patch index f635e4ca9..c59b4d906 100644 --- a/Spigot-Server-Patches/0418-Add-option-to-nerf-pigmen-from-nether-portals.patch +++ b/Spigot-Server-Patches/0419-Add-option-to-nerf-pigmen-from-nether-portals.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4bfe2fb948ee204f8c5a8c316141904a8a6a8b16..3496f615aa9857aa704767f460b1b166295ccf39 100644 +index 1757cf8e0883e8908b97e0a7beb1e6ecec10d8e6..4c12e1b65a0e7e1a7aa1bbaf433f4881cef314f2 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -596,4 +596,9 @@ public class PaperWorldConfig { +@@ -590,4 +590,9 @@ public class PaperWorldConfig { disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents); log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled")); } @@ -32,7 +32,7 @@ index e5b8d45ed9f62c28b0429859593d881546ccead2..77f8d5e6662fa75e622f07b3e6efae04 } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 097bab174bd05ee42c172e8926f5c66000bed239..45df15c6c96dcda115fff827f2443ac8b07b1ad7 100644 +index 9cf05a78871fba00c2453dc103d822271a8fec0b..f55ae42b1445ed0fe8e29f5d47c9b3464011c023 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -194,6 +194,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0419-Make-the-GUI-graph-fancier.patch b/Spigot-Server-Patches/0420-Make-the-GUI-graph-fancier.patch similarity index 99% rename from Spigot-Server-Patches/0419-Make-the-GUI-graph-fancier.patch rename to Spigot-Server-Patches/0420-Make-the-GUI-graph-fancier.patch index 9497aa062..57daa6a3a 100644 --- a/Spigot-Server-Patches/0419-Make-the-GUI-graph-fancier.patch +++ b/Spigot-Server-Patches/0420-Make-the-GUI-graph-fancier.patch @@ -398,7 +398,7 @@ index d4d5bc19e167a5271f8eb8d010f8a52b23b942df..859e31c63f94bdc7729c6d475990750b }); private final int[] b = new int[256]; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 82d0492fd208ca7991d07cdc6296635290d5af3b..52f4d5bff6a50a0f220a25045ec73a10f58bb006 100644 +index 7ca38adcaa619a95c183bed13be566105442afd5..bd39bdcfeec7fb275a8ec80d467bad413e5356ce 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -106,7 +106,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant WorldDataServer public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor -@@ -189,12 +198,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -188,12 +197,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { convertable = convertable_conversionsession; uuid = WorldUUID.getUUID(convertable_conversionsession.folder.toFile()); // CraftBukkit end diff --git a/Spigot-Server-Patches/0427-Pillager-patrol-spawn-settings-and-per-player-option.patch b/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch similarity index 97% rename from Spigot-Server-Patches/0427-Pillager-patrol-spawn-settings-and-per-player-option.patch rename to Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch index 29e962965..15f3e8747 100644 --- a/Spigot-Server-Patches/0427-Pillager-patrol-spawn-settings-and-per-player-option.patch +++ b/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch @@ -10,10 +10,10 @@ When not per player it will use the Vanilla mechanic of one delay per world and the world age for the start day. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 9e8485679bd36481c2bd2f0c7cfa49892f0e4baf..2688b3018eaab4e7ba95754164f83065a98e53fc 100644 +index 92a15842ac189049b2afef2f0ecf8ac964949bed..4281c125661c7a717e5a787510f593a16f6ad730 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -584,10 +584,21 @@ public class PaperWorldConfig { +@@ -578,10 +578,21 @@ public class PaperWorldConfig { } public boolean disablePillagerPatrols = false; diff --git a/Spigot-Server-Patches/0428-Ensure-Entity-is-never-double-registered.patch b/Spigot-Server-Patches/0429-Ensure-Entity-is-never-double-registered.patch similarity index 89% rename from Spigot-Server-Patches/0428-Ensure-Entity-is-never-double-registered.patch rename to Spigot-Server-Patches/0429-Ensure-Entity-is-never-double-registered.patch index 501c1f82c..a02c5160f 100644 --- a/Spigot-Server-Patches/0428-Ensure-Entity-is-never-double-registered.patch +++ b/Spigot-Server-Patches/0429-Ensure-Entity-is-never-double-registered.patch @@ -11,7 +11,7 @@ Vs behavior of non ticking of just overwriting state. We will now simply log a warning when this happens instead of crashing the server. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 45df15c6c96dcda115fff827f2443ac8b07b1ad7..0f775f417d5c8418ea895329b50313cc3350ea58 100644 +index f55ae42b1445ed0fe8e29f5d47c9b3464011c023..d4bb4e73ce8867ce56dce0ea84dea2dff91846d4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -59,6 +59,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -23,10 +23,10 @@ index 45df15c6c96dcda115fff827f2443ac8b07b1ad7..0f775f417d5c8418ea895329b50313cc private boolean locked = false; @Override diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b8e635e351773663f62bd07193c6b0aceef0a3f3..17f9e9119723561a4b01efbb91d651fbc9c8726e 100644 +index 61e988dc83d6f2c2e9f583aa3b88c26732cd6736..fca8194f27d5a8707296600bca7027a80c13877c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -532,6 +532,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -531,6 +531,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { Entity entity2; while ((entity2 = (Entity) this.entitiesToAdd.poll()) != null) { @@ -34,7 +34,7 @@ index b8e635e351773663f62bd07193c6b0aceef0a3f3..17f9e9119723561a4b01efbb91d651fb this.registerEntity(entity2); } -@@ -1228,6 +1229,19 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1227,6 +1228,19 @@ public class WorldServer extends World implements GeneratorAccessSeed { public void unregisterEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot @@ -54,7 +54,7 @@ index b8e635e351773663f62bd07193c6b0aceef0a3f3..17f9e9119723561a4b01efbb91d651fb // Spigot start if ( entity instanceof EntityHuman ) { -@@ -1294,9 +1308,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1293,9 +1307,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { private void registerEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot diff --git a/Spigot-Server-Patches/0429-Fix-unregistering-entities-from-unloading-chunks.patch b/Spigot-Server-Patches/0430-Fix-unregistering-entities-from-unloading-chunks.patch similarity index 90% rename from Spigot-Server-Patches/0429-Fix-unregistering-entities-from-unloading-chunks.patch rename to Spigot-Server-Patches/0430-Fix-unregistering-entities-from-unloading-chunks.patch index 8baef3ad5..06161dd93 100644 --- a/Spigot-Server-Patches/0429-Fix-unregistering-entities-from-unloading-chunks.patch +++ b/Spigot-Server-Patches/0430-Fix-unregistering-entities-from-unloading-chunks.patch @@ -15,10 +15,10 @@ Combine that with a buggy detail of the previous implementation of the Dupe UUID patch, then this was the likely source of the "Ghost entities" diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 17f9e9119723561a4b01efbb91d651fbc9c8726e..f792ff541793855d9ed0b60f5990b6fdfa303995 100644 +index fca8194f27d5a8707296600bca7027a80c13877c..59afafecabd59ede1398c124769262f7568426ed 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1387,9 +1387,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1386,9 +1386,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { } private void removeEntityFromChunk(Entity entity) { diff --git a/Spigot-Server-Patches/0430-Remote-Connections-shouldn-t-hold-up-shutdown.patch b/Spigot-Server-Patches/0431-Remote-Connections-shouldn-t-hold-up-shutdown.patch similarity index 100% rename from Spigot-Server-Patches/0430-Remote-Connections-shouldn-t-hold-up-shutdown.patch rename to Spigot-Server-Patches/0431-Remote-Connections-shouldn-t-hold-up-shutdown.patch diff --git a/Spigot-Server-Patches/0431-Do-not-allow-bees-to-load-chunks-for-beehives.patch b/Spigot-Server-Patches/0432-Do-not-allow-bees-to-load-chunks-for-beehives.patch similarity index 100% rename from Spigot-Server-Patches/0431-Do-not-allow-bees-to-load-chunks-for-beehives.patch rename to Spigot-Server-Patches/0432-Do-not-allow-bees-to-load-chunks-for-beehives.patch diff --git a/Spigot-Server-Patches/0432-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch similarity index 92% rename from Spigot-Server-Patches/0432-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch rename to Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch index ff50f90ba..19dd50072 100644 --- a/Spigot-Server-Patches/0432-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch +++ b/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch @@ -26,10 +26,10 @@ index fe3aab87de4e1eb60b19352499790fd9b571e169..c9be4ae99458863bf91687c3667d67bc EntityTypes entitytypes = entity.getEntityType(); int i = entitytypes.getChunkRange() * 16; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f792ff541793855d9ed0b60f5990b6fdfa303995..2609ae63556053adccdce19677d2e52aaab4ebf6 100644 +index 59afafecabd59ede1398c124769262f7568426ed..4f2c8a9fbfa4596f5414dd742affc4cc45deab5a 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1353,7 +1353,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1352,7 +1352,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } @@ -38,7 +38,7 @@ index f792ff541793855d9ed0b60f5990b6fdfa303995..2609ae63556053adccdce19677d2e52a // CraftBukkit start - SPIGOT-5278 if (entity instanceof EntityDrowned) { this.navigators.add(((EntityDrowned) entity).navigationWater); -@@ -1364,6 +1364,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1363,6 +1363,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.navigators.add(((EntityInsentient) entity).getNavigation()); } entity.valid = true; // CraftBukkit diff --git a/Spigot-Server-Patches/0433-Optimize-Collision-to-not-load-chunks.patch b/Spigot-Server-Patches/0434-Optimize-Collision-to-not-load-chunks.patch similarity index 98% rename from Spigot-Server-Patches/0433-Optimize-Collision-to-not-load-chunks.patch rename to Spigot-Server-Patches/0434-Optimize-Collision-to-not-load-chunks.patch index 7d9181fa4..1df4dcaad 100644 --- a/Spigot-Server-Patches/0433-Optimize-Collision-to-not-load-chunks.patch +++ b/Spigot-Server-Patches/0434-Optimize-Collision-to-not-load-chunks.patch @@ -14,7 +14,7 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 0f775f417d5c8418ea895329b50313cc3350ea58..a64e21964ed6131d2fc62345e04a30885e1d9a74 100644 +index d4bb4e73ce8867ce56dce0ea84dea2dff91846d4..8f1e8728502d1dcae1fb538875f72460fc926d7c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -80,6 +80,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke diff --git a/Spigot-Server-Patches/0434-Don-t-tick-dead-players.patch b/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch similarity index 100% rename from Spigot-Server-Patches/0434-Don-t-tick-dead-players.patch rename to Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch diff --git a/Spigot-Server-Patches/0435-Dead-Player-s-shouldn-t-be-able-to-move.patch b/Spigot-Server-Patches/0436-Dead-Player-s-shouldn-t-be-able-to-move.patch similarity index 100% rename from Spigot-Server-Patches/0435-Dead-Player-s-shouldn-t-be-able-to-move.patch rename to Spigot-Server-Patches/0436-Dead-Player-s-shouldn-t-be-able-to-move.patch diff --git a/Spigot-Server-Patches/0436-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch similarity index 100% rename from Spigot-Server-Patches/0436-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch rename to Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch diff --git a/Spigot-Server-Patches/0437-Increase-Light-Queue-Size.patch b/Spigot-Server-Patches/0438-Increase-Light-Queue-Size.patch similarity index 88% rename from Spigot-Server-Patches/0437-Increase-Light-Queue-Size.patch rename to Spigot-Server-Patches/0438-Increase-Light-Queue-Size.patch index 36ff7c0f7..a9aa089fe 100644 --- a/Spigot-Server-Patches/0437-Increase-Light-Queue-Size.patch +++ b/Spigot-Server-Patches/0438-Increase-Light-Queue-Size.patch @@ -14,10 +14,10 @@ light engine on shutdown... The queue size only puts a cap on max loss, doesn't solve that problem. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 2688b3018eaab4e7ba95754164f83065a98e53fc..e4821d4c23689aaf51b60c66fc1e6bc7a0b02fd5 100644 +index 4281c125661c7a717e5a787510f593a16f6ad730..a11d356733901521ee0523629f0cffc1d94391bc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -622,4 +622,9 @@ public class PaperWorldConfig { +@@ -616,4 +616,9 @@ public class PaperWorldConfig { private void zombieVillagerInfectionChance() { zombieVillagerInfectionChance = getDouble("zombie-villager-infection-chance", zombieVillagerInfectionChance); } @@ -28,7 +28,7 @@ index 2688b3018eaab4e7ba95754164f83065a98e53fc..e4821d4c23689aaf51b60c66fc1e6bc7 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 52f4d5bff6a50a0f220a25045ec73a10f58bb006..2bfda68d2bdf54a6fedb237086a2182ac37d1627 100644 +index bd39bdcfeec7fb275a8ec80d467bad413e5356ce..16c9ed590a20279dd21512b29f8f5f64a4be1eff 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -663,7 +663,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant(); commands.put("paper", new PaperCommand("paper")); @@ -87,7 +87,7 @@ index 5814c0da1fe82ccf9a74c6418bee021543749d86..c31a97c6ae0dd1493039158e67c5f3ba version = getInt("config-version", 20); set("config-version", 20); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5c45a88a6659873ec0cc1a62ebe7b5d700c079bd..852dc6a5edcf88adcf8d04f1109d7eaff1bea8f9 100644 +index 9e68d293ab8d67e9450a6633beccfba881d2287a..f61a2f30e43120beecfa6056c0c14985411d9b7d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -107,6 +107,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant list = this.tracker.getPassengers(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e4e946c0b3c6b73f02567fffaaabf06312cbea91..45715f50deb7c3c31a1d2f9795ad026e4938dc47 100644 +index 3e42cd6ec6ecfc04a6e2e9c96459e1a88e504e39..084f36bb29a3fa28dbac1fa6f50849e5722ab9fe 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1531,6 +1531,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant (max 5) to automatically fix all light data in the chunks. diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 182b440ba4802d199b8e44f7779b3401ace495d5..10b72083322b7f8e3e14525b3e834f5374ec369d 100644 +index 182b440ba4802d199b8e44f7779b3401ace495d5..cc3fc5200f75f80a60b4cbc260e3a0bc4bb3a869 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -20,6 +20,7 @@ import org.bukkit.command.Command; @@ -45,7 +45,7 @@ index 182b440ba4802d199b8e44f7779b3401ace495d5..10b72083322b7f8e3e14525b3e834f53 case "ver": case "version": Command ver = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version"); -@@ -160,6 +164,75 @@ public class PaperCommand extends Command { +@@ -160,6 +164,77 @@ public class PaperCommand extends Command { return true; } @@ -94,10 +94,12 @@ index 182b440ba4802d199b8e44f7779b3401ace495d5..10b72083322b7f8e3e14525b3e834f53 + } + lightengine.a(world.paperConfig.lightQueueSize + 16 * 256); // ensure full chunk can fit into queue + sender.sendMessage("Updating Light " + coord); ++ int cx = chunk.getPos().x << 4; ++ int cz = chunk.getPos().z << 4; + for (int y = 0; y < world.getHeight(); y++) { + for (int x = 0; x < 16; x++) { + for (int z = 0; z < 16; z++) { -+ BlockPosition pos = new BlockPosition(chunk.getPos().getBlockX() + x, y, chunk.getPos().getBlockZ() + z); ++ BlockPosition pos = new BlockPosition(cx + x, y, cz + z); + lightengine.a(pos); + } + } @@ -107,7 +109,7 @@ index 182b440ba4802d199b8e44f7779b3401ace495d5..10b72083322b7f8e3e14525b3e834f53 + if (visibleChunk != null) { + world.getChunkProvider().playerChunkMap.addLightTask(visibleChunk, () -> { + MinecraftServer.getServer().processQueue.add(() -> { -+ visibleChunk.sendPacketToTrackedPlayers(new PacketPlayOutLightUpdate(chunk.getPos(), lightengine), false); ++ visibleChunk.sendPacketToTrackedPlayers(new PacketPlayOutLightUpdate(chunk.getPos(), lightengine, true), false); + updateLight(sender, world, lightengine, queue); + }); + }); diff --git a/Spigot-Server-Patches/0483-Fix-PotionEffect-ignores-icon-flag.patch b/Spigot-Server-Patches/0484-Fix-PotionEffect-ignores-icon-flag.patch similarity index 100% rename from Spigot-Server-Patches/0483-Fix-PotionEffect-ignores-icon-flag.patch rename to Spigot-Server-Patches/0484-Fix-PotionEffect-ignores-icon-flag.patch diff --git a/Spigot-Server-Patches/0484-Optimize-brigadier-child-sorting-performance.patch b/Spigot-Server-Patches/0485-Optimize-brigadier-child-sorting-performance.patch similarity index 100% rename from Spigot-Server-Patches/0484-Optimize-brigadier-child-sorting-performance.patch rename to Spigot-Server-Patches/0485-Optimize-brigadier-child-sorting-performance.patch diff --git a/Spigot-Server-Patches/0485-Don-t-toString-block-unless-actually-showing-the-mes.patch b/Spigot-Server-Patches/0486-Don-t-toString-block-unless-actually-showing-the-mes.patch similarity index 100% rename from Spigot-Server-Patches/0485-Don-t-toString-block-unless-actually-showing-the-mes.patch rename to Spigot-Server-Patches/0486-Don-t-toString-block-unless-actually-showing-the-mes.patch diff --git a/Spigot-Server-Patches/0486-Potential-bed-API.patch b/Spigot-Server-Patches/0487-Potential-bed-API.patch similarity index 100% rename from Spigot-Server-Patches/0486-Potential-bed-API.patch rename to Spigot-Server-Patches/0487-Potential-bed-API.patch diff --git a/Spigot-Server-Patches/0487-Wait-for-Async-Tasks-during-shutdown.patch b/Spigot-Server-Patches/0488-Wait-for-Async-Tasks-during-shutdown.patch similarity index 96% rename from Spigot-Server-Patches/0487-Wait-for-Async-Tasks-during-shutdown.patch rename to Spigot-Server-Patches/0488-Wait-for-Async-Tasks-during-shutdown.patch index c04562f74..5da518c14 100644 --- a/Spigot-Server-Patches/0487-Wait-for-Async-Tasks-during-shutdown.patch +++ b/Spigot-Server-Patches/0488-Wait-for-Async-Tasks-during-shutdown.patch @@ -10,7 +10,7 @@ Adds a 5 second grace period for any async tasks to finish and warns if any are still running after that delay just as reload does. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 45715f50deb7c3c31a1d2f9795ad026e4938dc47..10e6572afa5b5cf65673b65541ef2fafb0b2aaae 100644 +index 9745f0812b65d9137458741ca5803324670deeef..96e617049ab7c69a0d8ffbade894f187566c21b1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -773,6 +773,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { +@@ -1,6 +1,8 @@ + package net.minecraft.server; + + import com.google.common.collect.Lists; ++import io.netty.channel.ChannelFuture; // Paper ++ + import java.io.IOException; + import java.util.Iterator; + import java.util.List; +@@ -17,14 +19,43 @@ public class PacketPlayOutLightUpdate implements Packet { private List h; private boolean i; @@ -265,7 +274,7 @@ index 6b70df646c6a690ab9437ead96c5ff097e4e12d2..1015a1d80530451be0cbee51e135526d + } + + @Override -+ public void onPacketDispatchFinish(EntityPlayer player, io.netty.channel.ChannelFuture future) { ++ public void onPacketDispatchFinish(EntityPlayer player, ChannelFuture future) { + if (remainingSends.decrementAndGet() <= 0) { + // incase of any race conditions, schedule this delayed + MCUtil.scheduleTask(5, () -> { @@ -296,7 +305,7 @@ index 6b70df646c6a690ab9437ead96c5ff097e4e12d2..1015a1d80530451be0cbee51e135526d for (int i = 0; i < 18; ++i) { NibbleArray nibblearray = lightengine.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, -1 + i)); -@@ -35,7 +64,7 @@ public class PacketPlayOutLightUpdate implements Packet { +@@ -35,7 +66,7 @@ public class PacketPlayOutLightUpdate implements Packet { this.e |= 1 << i; } else { this.c |= 1 << i; @@ -305,7 +314,7 @@ index 6b70df646c6a690ab9437ead96c5ff097e4e12d2..1015a1d80530451be0cbee51e135526d } } -@@ -44,7 +73,7 @@ public class PacketPlayOutLightUpdate implements Packet { +@@ -44,7 +75,7 @@ public class PacketPlayOutLightUpdate implements Packet { this.f |= 1 << i; } else { this.d |= 1 << i; @@ -314,7 +323,7 @@ index 6b70df646c6a690ab9437ead96c5ff097e4e12d2..1015a1d80530451be0cbee51e135526d } } } -@@ -57,8 +86,8 @@ public class PacketPlayOutLightUpdate implements Packet { +@@ -57,8 +88,8 @@ public class PacketPlayOutLightUpdate implements Packet { this.i = flag; this.c = i; this.d = j; @@ -325,7 +334,7 @@ index 6b70df646c6a690ab9437ead96c5ff097e4e12d2..1015a1d80530451be0cbee51e135526d for (int k = 0; k < 18; ++k) { NibbleArray nibblearray; -@@ -66,7 +95,7 @@ public class PacketPlayOutLightUpdate implements Packet { +@@ -66,7 +97,7 @@ public class PacketPlayOutLightUpdate implements Packet { if ((this.c & 1 << k) != 0) { nibblearray = lightengine.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, -1 + k)); if (nibblearray != null && !nibblearray.c()) { @@ -334,7 +343,7 @@ index 6b70df646c6a690ab9437ead96c5ff097e4e12d2..1015a1d80530451be0cbee51e135526d } else { this.c &= ~(1 << k); if (nibblearray != null) { -@@ -78,7 +107,7 @@ public class PacketPlayOutLightUpdate implements Packet { +@@ -78,7 +109,7 @@ public class PacketPlayOutLightUpdate implements Packet { if ((this.d & 1 << k) != 0) { nibblearray = lightengine.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, -1 + k)); if (nibblearray != null && !nibblearray.c()) { diff --git a/Spigot-Server-Patches/0491-Reduce-MutableInt-allocations-from-light-engine.patch b/Spigot-Server-Patches/0492-Reduce-MutableInt-allocations-from-light-engine.patch similarity index 100% rename from Spigot-Server-Patches/0491-Reduce-MutableInt-allocations-from-light-engine.patch rename to Spigot-Server-Patches/0492-Reduce-MutableInt-allocations-from-light-engine.patch diff --git a/Spigot-Server-Patches/0492-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/Spigot-Server-Patches/0493-Reduce-allocation-of-Vec3D-by-entity-tracker.patch similarity index 100% rename from Spigot-Server-Patches/0492-Reduce-allocation-of-Vec3D-by-entity-tracker.patch rename to Spigot-Server-Patches/0493-Reduce-allocation-of-Vec3D-by-entity-tracker.patch diff --git a/Spigot-Server-Patches/0493-Ensure-safe-gateway-teleport.patch b/Spigot-Server-Patches/0494-Ensure-safe-gateway-teleport.patch similarity index 100% rename from Spigot-Server-Patches/0493-Ensure-safe-gateway-teleport.patch rename to Spigot-Server-Patches/0494-Ensure-safe-gateway-teleport.patch diff --git a/Spigot-Server-Patches/0494-Add-option-for-console-having-all-permissions.patch b/Spigot-Server-Patches/0495-Add-option-for-console-having-all-permissions.patch similarity index 95% rename from Spigot-Server-Patches/0494-Add-option-for-console-having-all-permissions.patch rename to Spigot-Server-Patches/0495-Add-option-for-console-having-all-permissions.patch index bbfc2ca38..42c9b660a 100644 --- a/Spigot-Server-Patches/0494-Add-option-for-console-having-all-permissions.patch +++ b/Spigot-Server-Patches/0495-Add-option-for-console-having-all-permissions.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add option for console having all permissions diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index e1c9e559b25792296b6b8f6dd1070035d10d82f2..08f744ee5e83d317f872f9c48e2037a24327d76f 100644 +index 44f431bee68275d48aad75367aaec40a7ca59bea..06adb1fa670e7d755560abae67d46447d63370f0 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -416,4 +416,9 @@ public class PaperConfig { +@@ -417,4 +417,9 @@ public class PaperConfig { allowBlockPermanentBreakingExploits = getBoolean("allow-perm-block-break-exploits", allowBlockPermanentBreakingExploits); } diff --git a/Spigot-Server-Patches/0495-Workaround-for-Client-Lag-Spikes-MC-162253.patch b/Spigot-Server-Patches/0496-Workaround-for-Client-Lag-Spikes-MC-162253.patch similarity index 100% rename from Spigot-Server-Patches/0495-Workaround-for-Client-Lag-Spikes-MC-162253.patch rename to Spigot-Server-Patches/0496-Workaround-for-Client-Lag-Spikes-MC-162253.patch diff --git a/Spigot-Server-Patches/0496-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch similarity index 99% rename from Spigot-Server-Patches/0496-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch rename to Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index 32810a519..bba3a8063 100644 --- a/Spigot-Server-Patches/0496-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -617,7 +617,7 @@ index 0e3ceb60e503c74fc65b1d08371645ffbb26ef5c..d5740a25bb487fc186333e908968c6a2 for (int i = 0; i < this.inventory.getSize(); ++i) { ItemStack itemstack = this.inventory.getItem(i); diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 2f9c014454cf5fe771c6da84ad4af7e7790fdc7d..2e58e58548f0fc7af98b0c6294bf855f54705f9b 100644 +index a68e4fc411ae84f12b1ca7443fa66f6325712af8..ce17f5114e997b48073bb078336dc43bdae190a7 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -654,6 +654,7 @@ public final class MCUtil { @@ -1231,10 +1231,10 @@ index 745633509d3f948d46529d5439ec14cd01a05563..5ae74d0856f7fb4a7ee35e5d778d78fe net.minecraft.server.Chunk chunk = (net.minecraft.server.Chunk) either.left().orElse(null); return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b28e5abea5d2585d9beff574dd82651e7d20275b..663f9136c4101bb48944ed5ea952f6375e8b2781 100644 +index 6032a67b3f242580d8de5e77554e3ec317d3019d..b602fc8e7747b839a853310c5d5592d3ac4c0855 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -741,6 +741,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -742,6 +742,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { throw new UnsupportedOperationException("Cannot set rotation of players. Consider teleporting instead."); } diff --git a/Spigot-Server-Patches/0497-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch b/Spigot-Server-Patches/0498-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch similarity index 100% rename from Spigot-Server-Patches/0497-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch rename to Spigot-Server-Patches/0498-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch diff --git a/Spigot-Server-Patches/0498-Optimize-sending-packets-to-nearby-locations-sounds-.patch b/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch similarity index 100% rename from Spigot-Server-Patches/0498-Optimize-sending-packets-to-nearby-locations-sounds-.patch rename to Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch diff --git a/Spigot-Server-Patches/0499-Improve-Chunk-Status-Transition-Speed.patch b/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch similarity index 100% rename from Spigot-Server-Patches/0499-Improve-Chunk-Status-Transition-Speed.patch rename to Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch diff --git a/Spigot-Server-Patches/0500-Fix-villager-trading-demand-MC-163962.patch b/Spigot-Server-Patches/0501-Fix-villager-trading-demand-MC-163962.patch similarity index 100% rename from Spigot-Server-Patches/0500-Fix-villager-trading-demand-MC-163962.patch rename to Spigot-Server-Patches/0501-Fix-villager-trading-demand-MC-163962.patch diff --git a/Spigot-Server-Patches/0501-Maps-shouldn-t-load-chunks.patch b/Spigot-Server-Patches/0502-Maps-shouldn-t-load-chunks.patch similarity index 100% rename from Spigot-Server-Patches/0501-Maps-shouldn-t-load-chunks.patch rename to Spigot-Server-Patches/0502-Maps-shouldn-t-load-chunks.patch diff --git a/Spigot-Server-Patches/0502-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch b/Spigot-Server-Patches/0503-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch similarity index 91% rename from Spigot-Server-Patches/0502-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch rename to Spigot-Server-Patches/0503-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch index 96bcd2c18..4bcf7fe0c 100644 --- a/Spigot-Server-Patches/0502-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch +++ b/Spigot-Server-Patches/0503-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch @@ -19,10 +19,10 @@ index 90be8c6091dc590a020721f45c7ff7b137cc806d..faa556d4358bc9890ae80c18ee10c38a } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d0493919e71159ac6b38a64b2411fea722b53306..b79302b83921111d5fa32794babf1fa57b7bbcb1 100644 +index 00df3260d4f208052515fcd2613be1d6f92e7b1f..4a4508f45b76379dfa567036696d3bf1f4a5c4f4 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -303,8 +303,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -302,8 +302,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.worldDataServer.setThundering(flag1); } diff --git a/Spigot-Server-Patches/0503-Optimize-Bit-Operations-by-inlining.patch b/Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch similarity index 100% rename from Spigot-Server-Patches/0503-Optimize-Bit-Operations-by-inlining.patch rename to Spigot-Server-Patches/0504-Optimize-Bit-Operations-by-inlining.patch diff --git a/Spigot-Server-Patches/0504-Optimize-Light-Engine.patch b/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch similarity index 99% rename from Spigot-Server-Patches/0504-Optimize-Light-Engine.patch rename to Spigot-Server-Patches/0505-Optimize-Light-Engine.patch index 3c31180a4..04e66be87 100644 --- a/Spigot-Server-Patches/0504-Optimize-Light-Engine.patch +++ b/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch @@ -1307,10 +1307,10 @@ index 35f4d2d9591e625ab0bbeab7b606761e74965eec..698d82dd736529a8cbfad5c6bed70ab9 this.a.a(t0); this.f(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b79302b83921111d5fa32794babf1fa57b7bbcb1..bed2cbabc0ac921bfdc4c6e4a04973a5411ebaa0 100644 +index 4a4508f45b76379dfa567036696d3bf1f4a5c4f4..f24c4def3799d2787b1bc14b2dea532e6a93d6ee 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -709,6 +709,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -708,6 +708,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } gameprofilerfiller.exit(); timings.chunkTicksBlocks.stopTiming(); // Paper diff --git a/Spigot-Server-Patches/0505-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/Spigot-Server-Patches/0506-Delay-Chunk-Unloads-based-on-Player-Movement.patch similarity index 97% rename from Spigot-Server-Patches/0505-Delay-Chunk-Unloads-based-on-Player-Movement.patch rename to Spigot-Server-Patches/0506-Delay-Chunk-Unloads-based-on-Player-Movement.patch index 4738b38c7..a2cfef729 100644 --- a/Spigot-Server-Patches/0505-Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/Spigot-Server-Patches/0506-Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -17,10 +17,10 @@ This allows servers with smaller worlds who do less long distance exploring to s wasting cpu cycles on saving/unloading/reloading chunks repeatedly. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0746932a3191669052f15270f5c94efbce0bd0c2..0f4fca90fd6c3788a5762c96c344899cb1665466 100644 +index 65f9ec884c7e36b7d1340dcfdf186ee0669178e4..b04fe735839de47e4101dade366a668c9237f6b6 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -639,4 +639,13 @@ public class PaperWorldConfig { +@@ -633,4 +633,13 @@ public class PaperWorldConfig { private void viewDistance() { this.noTickViewDistance = this.getInt("viewdistances.no-tick-view-distance", -1); } diff --git a/Spigot-Server-Patches/0506-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/Spigot-Server-Patches/0507-Add-Plugin-Tickets-to-API-Chunk-Methods.patch similarity index 100% rename from Spigot-Server-Patches/0506-Add-Plugin-Tickets-to-API-Chunk-Methods.patch rename to Spigot-Server-Patches/0507-Add-Plugin-Tickets-to-API-Chunk-Methods.patch diff --git a/Spigot-Server-Patches/0507-Fix-missing-chunks-due-to-integer-overflow.patch b/Spigot-Server-Patches/0508-Fix-missing-chunks-due-to-integer-overflow.patch similarity index 100% rename from Spigot-Server-Patches/0507-Fix-missing-chunks-due-to-integer-overflow.patch rename to Spigot-Server-Patches/0508-Fix-missing-chunks-due-to-integer-overflow.patch diff --git a/Spigot-Server-Patches/0508-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/Spigot-Server-Patches/0509-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch similarity index 100% rename from Spigot-Server-Patches/0508-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch rename to Spigot-Server-Patches/0509-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch diff --git a/Spigot-Server-Patches/0509-Fix-piston-physics-inconsistency-MC-188840.patch b/Spigot-Server-Patches/0510-Fix-piston-physics-inconsistency-MC-188840.patch similarity index 97% rename from Spigot-Server-Patches/0509-Fix-piston-physics-inconsistency-MC-188840.patch rename to Spigot-Server-Patches/0510-Fix-piston-physics-inconsistency-MC-188840.patch index 8e81d5690..ab41639c1 100644 --- a/Spigot-Server-Patches/0509-Fix-piston-physics-inconsistency-MC-188840.patch +++ b/Spigot-Server-Patches/0510-Fix-piston-physics-inconsistency-MC-188840.patch @@ -32,10 +32,10 @@ This patch fixes https://bugs.mojang.com/browse/MC-188840 This patch also fixes rail duping and carpet duping. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 08f744ee5e83d317f872f9c48e2037a24327d76f..f9831b1ac15c9fa08c7201a43fe9f1824ddc03c3 100644 +index 06adb1fa670e7d755560abae67d46447d63370f0..3b0f3127bcee8e9290b4640bcd4ec0d17fb43f43 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java -@@ -421,4 +421,9 @@ public class PaperConfig { +@@ -422,4 +422,9 @@ public class PaperConfig { consoleHasAllPermissions = getBoolean("settings.console-has-all-permissions", consoleHasAllPermissions); } diff --git a/Spigot-Server-Patches/0510-Fix-sand-duping.patch b/Spigot-Server-Patches/0511-Fix-sand-duping.patch similarity index 100% rename from Spigot-Server-Patches/0510-Fix-sand-duping.patch rename to Spigot-Server-Patches/0511-Fix-sand-duping.patch diff --git a/Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch b/Spigot-Server-Patches/0512-Prevent-position-desync-in-playerconnection-causing-.patch similarity index 100% rename from Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch rename to Spigot-Server-Patches/0512-Prevent-position-desync-in-playerconnection-causing-.patch diff --git a/Spigot-Server-Patches/0512-Fix-enderdragon-exp-dupe.patch b/Spigot-Server-Patches/0513-Fix-enderdragon-exp-dupe.patch similarity index 100% rename from Spigot-Server-Patches/0512-Fix-enderdragon-exp-dupe.patch rename to Spigot-Server-Patches/0513-Fix-enderdragon-exp-dupe.patch diff --git a/Spigot-Server-Patches/0513-Inventory-getHolder-method-without-block-snapshot.patch b/Spigot-Server-Patches/0514-Inventory-getHolder-method-without-block-snapshot.patch similarity index 100% rename from Spigot-Server-Patches/0513-Inventory-getHolder-method-without-block-snapshot.patch rename to Spigot-Server-Patches/0514-Inventory-getHolder-method-without-block-snapshot.patch diff --git a/Spigot-Server-Patches/0514-Expose-Arrow-getItemStack.patch b/Spigot-Server-Patches/0515-Expose-Arrow-getItemStack.patch similarity index 100% rename from Spigot-Server-Patches/0514-Expose-Arrow-getItemStack.patch rename to Spigot-Server-Patches/0515-Expose-Arrow-getItemStack.patch diff --git a/Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch b/Spigot-Server-Patches/0516-Add-and-implement-PlayerRecipeBookClickEvent.patch similarity index 100% rename from Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch rename to Spigot-Server-Patches/0516-Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/Spigot-Server-Patches/0516-Add-PrepareGrindstoneEvent.patch b/Spigot-Server-Patches/0517-Add-PrepareGrindstoneEvent.patch similarity index 100% rename from Spigot-Server-Patches/0516-Add-PrepareGrindstoneEvent.patch rename to Spigot-Server-Patches/0517-Add-PrepareGrindstoneEvent.patch diff --git a/Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch b/removed/1.16/0274-Allow-disabling-armour-stand-ticking.patch similarity index 53% rename from Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch rename to removed/1.16/0274-Allow-disabling-armour-stand-ticking.patch index b792c77db..dca49d795 100644 --- a/Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch +++ b/removed/1.16/0274-Allow-disabling-armour-stand-ticking.patch @@ -20,7 +20,7 @@ index eaaa51e4bf761f41fd516402ce1ad0f903c6ab71..bc3df01aab3e79be9c2836820e0eacc6 + } } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afdbd76b709 100644 +index 61d7d507aaac3e7e5a885387ae89c67dfb1c9844..42b9a339e9c35db596ec78881c32c801c2d739f4 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -44,6 +44,12 @@ public class EntityArmorStand extends EntityLiving { @@ -37,11 +37,11 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd public EntityArmorStand(EntityTypes entitytypes, World world) { super(entitytypes, world); @@ -55,6 +61,7 @@ public class EntityArmorStand extends EntityLiving { - this.rightArmPose = EntityArmorStand.bt; - this.leftLegPose = EntityArmorStand.bu; - this.rightLegPose = EntityArmorStand.bv; + this.rightArmPose = EntityArmorStand.bu; + this.leftLegPose = EntityArmorStand.bv; + this.rightLegPose = EntityArmorStand.bw; + if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking - this.G = 0.0F; + this.H = 0.0F; } @@ -135,6 +142,7 @@ public class EntityArmorStand extends EntityLiving { @@ -136,11 +136,125 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd public void setRightLegPose(Vector3f vector3f) { this.rightLegPose = vector3f; - this.datawatcher.set(EntityArmorStand.bo, vector3f); + this.datawatcher.set(EntityArmorStand.bp, vector3f); + this.noTickPoseDirty = true; // Paper - Allow updates when not ticking } public Vector3f r() { +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index a4051c1f0cdcf179e7afe60d301982412da7ed64..990aea604d02db723193722ed692c3a3725f987d 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -2329,52 +2329,7 @@ public abstract class EntityLiving extends Entity { + } + } + +- EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); +- int k = aenumitemslot.length; +- +- for (int l = 0; l < k; ++l) { +- EnumItemSlot enumitemslot = aenumitemslot[l]; +- ItemStack itemstack; +- +- switch (enumitemslot.a()) { +- case HAND: +- itemstack = (ItemStack) this.bu.get(enumitemslot.b()); +- break; +- case ARMOR: +- itemstack = (ItemStack) this.bv.get(enumitemslot.b()); +- break; +- default: +- continue; +- } +- +- ItemStack itemstack1 = this.getEquipment(enumitemslot); +- +- if (!ItemStack.matches(itemstack1, itemstack)) { +- // Paper start - PlayerArmorChangeEvent +- if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) { +- final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); +- final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); +- new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); +- } +- // Paper end +- ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)); +- if (!itemstack.isEmpty()) { +- this.getAttributeMap().a(itemstack.a(enumitemslot)); +- } +- +- if (!itemstack1.isEmpty()) { +- this.getAttributeMap().b(itemstack1.a(enumitemslot)); +- } +- +- switch (enumitemslot.a()) { +- case HAND: +- this.bu.set(enumitemslot.b(), itemstack1.cloneItemStack()); +- break; +- case ARMOR: +- this.bv.set(enumitemslot.b(), itemstack1.cloneItemStack()); +- } +- } +- } ++ updateEntityEquipment(); // Paper - split into own method + + if (this.ticksLived % 20 == 0) { + this.getCombatTracker().g(); +@@ -2475,6 +2430,55 @@ public abstract class EntityLiving extends Entity { + } + } + ++ // Paper start - split into own method from above ++ public void updateEntityEquipment() { ++ EnumItemSlot[] aenumitemslot = EnumItemSlot.values(); ++ int k = aenumitemslot.length; ++ for (int l = 0; l < k; ++l) { ++ EnumItemSlot enumitemslot = aenumitemslot[l]; ++ ItemStack itemstack; ++ ++ switch (enumitemslot.a()) { ++ case HAND: ++ itemstack = (ItemStack) this.bu.get(enumitemslot.b()); ++ break; ++ case ARMOR: ++ itemstack = (ItemStack) this.bv.get(enumitemslot.b()); ++ break; ++ default: ++ continue; ++ } ++ ++ ItemStack itemstack1 = this.getEquipment(enumitemslot); ++ ++ if (!ItemStack.matches(itemstack1, itemstack)) { ++ // Paper start - PlayerArmorChangeEvent ++ if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) { ++ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); ++ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); ++ new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); ++ } ++ // Paper end ++ ((WorldServer) this.world).getChunkProvider().broadcast(this, new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1)); ++ if (!itemstack.isEmpty()) { ++ this.getAttributeMap().a(itemstack.a(enumitemslot)); ++ } ++ ++ if (!itemstack1.isEmpty()) { ++ this.getAttributeMap().b(itemstack1.a(enumitemslot)); ++ } ++ ++ switch (enumitemslot.a()) { ++ case HAND: ++ this.bu.set(enumitemslot.b(), itemstack1.cloneItemStack()); ++ break; ++ case ARMOR: ++ this.bv.set(enumitemslot.b(), itemstack1.cloneItemStack()); ++ } ++ } ++ } ++ } ++ + protected float f(float f, float f1) { + float f2 = MathHelper.g(f - this.aI); + diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java index d1d689e5d78c569313c4059c4652724605dc07d2..ac105270d5c7e2070f52782fc7dbdcd381db33a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java