diff --git a/Spigot-API-Patches/0202-Add-Mob-Goal-API.patch b/Spigot-API-Patches/0202-Add-Mob-Goal-API.patch index e3475cd01..07f5fd15f 100644 --- a/Spigot-API-Patches/0202-Add-Mob-Goal-API.patch +++ b/Spigot-API-Patches/0202-Add-Mob-Goal-API.patch @@ -223,10 +223,10 @@ index 0000000000000000000000000000000000000000..e21f7574763dd4f13794f91bbef192ef +} diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java new file mode 100644 -index 0000000000000000000000000000000000000000..d23ad96ee436ae57231bbf88eed19487dec06780 +index 0000000000000000000000000000000000000000..d7f1b2c84aebe8ed04084b9249ed08d5e52a6ecd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java -@@ -0,0 +1,198 @@ +@@ -0,0 +1,208 @@ +package com.destroystokyo.paper.entity.ai; + +import com.destroystokyo.paper.entity.RangedEntity; @@ -315,7 +315,15 @@ index 0000000000000000000000000000000000000000..d23ad96ee436ae57231bbf88eed19487 + GoalKey PHANTOM_ATTACK_STRATEGY = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_attack_strategy")); + GoalKey PHANTOM_CIRCLE_AROUND_ANCHOR = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_circle_around_anchor")); + GoalKey PHANTOM_SWEEP_ATTACK = GoalKey.of(Phantom.class, NamespacedKey.minecraft("phantom_sweep_attack")); ++ /** ++ * @deprecated removed in 1.16 ++ */ ++ @Deprecated + GoalKey ANGER = GoalKey.of(PigZombie.class, NamespacedKey.minecraft("anger")); ++ /** ++ * @deprecated removed in 1.16 ++ */ ++ @Deprecated + GoalKey ANGER_OTHER = GoalKey.of(PigZombie.class, NamespacedKey.minecraft("anger_other")); + GoalKey POLARBEAR_ATTACK_PLAYERS = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_attack_players")); + GoalKey POLARBEAR_HURT_BY = GoalKey.of(PolarBear.class, NamespacedKey.minecraft("polarbear_hurt_by")); @@ -424,6 +432,8 @@ index 0000000000000000000000000000000000000000..d23ad96ee436ae57231bbf88eed19487 + GoalKey WATER = GoalKey.of(Creature.class, NamespacedKey.minecraft("water")); + GoalKey WATER_JUMP = GoalKey.of(Dolphin.class, NamespacedKey.minecraft("water_jump")); + GoalKey ZOMBIE_ATTACK = GoalKey.of(Zombie.class, NamespacedKey.minecraft("zombie_attack")); ++ GoalKey STROLL_VILLAGE_GOLEM = GoalKey.of(Creature.class, NamespacedKey.minecraft("stroll_village_golem")); ++ GoalKey UNIVERSAL_ANGER_RESET = GoalKey.of(Mob.class, NamespacedKey.minecraft("universal_anger_reset")); +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 95ad0122605b40e28352fa6205528eeb5c453a50..a9c10228eeeaac89361c695a5ab90161b6358ca1 100644 diff --git a/Spigot-API-Patches/0206-Potential-bed-API.patch b/Spigot-API-Patches/0206-Potential-bed-API.patch index dd2041922..4c287e622 100644 --- a/Spigot-API-Patches/0206-Potential-bed-API.patch +++ b/Spigot-API-Patches/0206-Potential-bed-API.patch @@ -8,21 +8,13 @@ Adds a new method to fetch the location of a player's bed without generating any getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 1f94cbee36b6a952b2ecca8efbeaf7deee640a81..c0d38f5a39610cbc523d210b76f17fa17c0d7e62 100644 +index 1f94cbee36b6a952b2ecca8efbeaf7deee640a81..e6cdd4bc2d934ab932651e17f144d7004835bdc3 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -239,6 +239,43 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -239,6 +239,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getSleepTicks(); -+ /** -+ * Gets the Location where the player will spawn at their bed, null if -+ * they have not slept in one or their current bed spawn is invalid. -+ * -+ * @return Bed Spawn Location if bed exists, otherwise null. -+ */ -+ @Nullable -+ public Location getBedSpawnLocation(); + + // Paper start - Potential bed api + /** @@ -35,22 +27,6 @@ index 1f94cbee36b6a952b2ecca8efbeaf7deee640a81..c0d38f5a39610cbc523d210b76f17fa1 + @Nullable + public Location getPotentialBedLocation(); + // Paper end -+ -+ /** -+ * Sets the Location where the player will spawn at their bed. -+ * -+ * @param location where to set the respawn location -+ */ -+ public void setBedSpawnLocation(@Nullable Location location); -+ -+ /** -+ * Sets the Location where the player will spawn at their bed. -+ * -+ * @param location where to set the respawn location -+ * @param force whether to forcefully set the respawn location even if a -+ * valid bed is not present -+ */ -+ public void setBedSpawnLocation(@Nullable Location location, boolean force); + /** * Attempts to make the entity sleep at the given location. diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index d9b98eb28..ce7387973 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -555,7 +555,7 @@ index 062a82c37723b7f032103ba2904877ae79b1ae01..5585b5646b5f3650aa3b795be06f9206 } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 27e6872c675647d7e61040b76183dac4e347a40c..1964130ae411ff7d5e1b456a23629804d294a5d0 100644 +index 27e6872c675647d7e61040b76183dac4e347a40c..aa68eb71b131c1d529ded6c651621cfab071b3c4 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -148,6 +148,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -564,7 +564,7 @@ index 27e6872c675647d7e61040b76183dac4e347a40c..1964130ae411ff7d5e1b456a23629804 // Spigot end + // Paper start + try { -+ com.destroystokyo.paper.PaperConfig.init((File) options.valueOf("paper-settings")); ++ com.destroystokyo.paper.PaperConfig.init((java.io.File) options.valueOf("paper-settings")); + } catch (Exception e) { + DedicatedServer.LOGGER.error("Unable to load server configuration", e); + return false; diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index 762907459..b5c928627 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -193,6 +193,19 @@ index 6c2ed9c1b8567abcdb11bdc3dbaeed217a2f61e7..ae0ac8d383ca11a683465d8c83a8b8a6 return this.getTemperature() - (f + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F; } else { +diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java +index 0aa66addb2cb472b2ab90000d3f0e0f967353e0f..eaa527f4fe289a9492b12591154a60e5aa045252 100644 +--- a/src/main/java/net/minecraft/server/Biomes.java ++++ b/src/main/java/net/minecraft/server/Biomes.java +@@ -88,7 +88,7 @@ public abstract class Biomes { + private static BiomeBase a(int i, String s, BiomeBase biomebase) { + IRegistry.a(IRegistry.BIOME, i, s, biomebase); + if (biomebase.b()) { +- BiomeBase.d.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l)))); ++ BiomeBase.reg.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l)))); + } + + return biomebase; diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java index 771841e08591955e61c7bcc5b09c8457652c1b9c..8162c11d14b8e88c2b572f9ddf6b7a15977047f8 100644 --- a/src/main/java/net/minecraft/server/BlockStateEnum.java @@ -403,6 +416,19 @@ index 8b1f9116afd92b13426eb0e97066297705d202fb..a9dc8466278f9ec2becbcb643e6e1c97 this.b(); this.g.set(false); })); +diff --git a/src/main/java/net/minecraft/server/LootEntryAbstract.java b/src/main/java/net/minecraft/server/LootEntryAbstract.java +index 8cc8c60d3297a4ed98f3950a3971d83499ad1dfa..788078c209b8bcbd551cf0a52eb6172928d7b5f9 100644 +--- a/src/main/java/net/minecraft/server/LootEntryAbstract.java ++++ b/src/main/java/net/minecraft/server/LootEntryAbstract.java +@@ -36,7 +36,7 @@ public abstract class LootEntryAbstract implements LootEntryChildren { + + // CraftBukkit start + @Override +- public final void a(JsonObject jsonobject, T t0, JsonSerializationContext jsonserializationcontext) { ++ public void a(JsonObject jsonobject, T t0, JsonSerializationContext jsonserializationcontext) { // Paper - remove final + if (!org.apache.commons.lang3.ArrayUtils.isEmpty(t0.d)) { + jsonobject.add("conditions", jsonserializationcontext.serialize(t0.d)); + } diff --git a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java index 3aa5cc4281cdba8738890e9ffd5c7a129e60c310..32a98e758b9df48005ddc5283eacdc5123a32c39 100644 --- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java @@ -473,6 +499,27 @@ index 829a7ae0a2b77205fb8e8c5754d0d4333afa224d..8b9e47b4c7f5dc464fa617a59583df9e default String asString() { return this.toString(); +diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..c9be8c7f40917056091f63d36311a10d6302acbb 100644 +--- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java ++++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +@@ -11,6 +11,7 @@ import java.io.InputStream; + import java.io.OutputStream; + import java.util.zip.GZIPInputStream; + import java.util.zip.GZIPOutputStream; ++import io.netty.buffer.ByteBufInputStream; // Paper + + public class NBTCompressedStreamTools { + +@@ -75,7 +76,7 @@ public class NBTCompressedStreamTools { + + public static NBTTagCompound a(DataInput datainput, NBTReadLimiter nbtreadlimiter) throws IOException { + // Spigot start +- if ( datainput instanceof io.netty.buffer.ByteBufInputStream ) ++ if ( datainput instanceof ByteBufInputStream) // Paper + { + datainput = new DataInputStream(new org.spigotmc.LimitStream((InputStream) datainput, nbtreadlimiter)); + } diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java index b8bb5027ecccfc9b664145a1bfe3755f1a8af3eb..ad8a506bb430b26fe147a657a2f826daf9bf4d45 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java @@ -549,6 +596,19 @@ index 2dc20b5c930c6845af41b35d69cdb03db639d63e..6cdd4d46d987132c3c241800b5d59cee this.e = 0; this.f = 0; +diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java +index 68510457b527e61bf60bf1e7dfd664578172c00a..eefad79a01de61eff5e0bd3f709bfda030ebe20d 100644 +--- a/src/main/java/net/minecraft/server/StructureGenerator.java ++++ b/src/main/java/net/minecraft/server/StructureGenerator.java +@@ -42,7 +42,7 @@ public abstract class StructureGenerator + private static > F a(String s, F f0, WorldGenStage.Decoration worldgenstage_decoration) { + StructureGenerator.a.put(s.toLowerCase(Locale.ROOT), f0); + StructureGenerator.u.put(f0, worldgenstage_decoration); +- return (StructureGenerator) IRegistry.a(IRegistry.STRUCTURE_FEATURE, s.toLowerCase(Locale.ROOT), (Object) f0); ++ return (F) IRegistry.>a(IRegistry.STRUCTURE_FEATURE, s.toLowerCase(Locale.ROOT), f0); // Paper - decomp fix + } + + public StructureGenerator(Codec codec) { diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d1b3314a9 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index 27c2861da..0585ff032 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -544,13 +544,14 @@ 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..03bb2102d6952df04753ba9986aad9b494568e2d +index 0000000000000000000000000000000000000000..944fd203e9f39d6c6fc9e270940c76c98067273a --- /dev/null +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -@@ -0,0 +1,118 @@ +@@ -0,0 +1,119 @@ +package co.aikar.timings; + +import net.minecraft.server.World; ++import net.minecraft.server.WorldDataServer; +import net.minecraft.server.WorldServer; + +/** @@ -608,7 +609,7 @@ index 0000000000000000000000000000000000000000..03bb2102d6952df04753ba9986aad9b4 + public final Timing miscMobSpawning; + + public WorldTimingsHandler(World server) { -+ String name = server.getWorld().getName() +" - "; ++ String name = ((WorldDataServer) server.getWorldData()).getName() + " - "; + + mobSpawn = Timings.ofSafe(name + "mobSpawn"); + doChunkUnload = Timings.ofSafe(name + "doChunkUnload"); @@ -663,7 +664,7 @@ index 0000000000000000000000000000000000000000..03bb2102d6952df04753ba9986aad9b4 + } + + public static Timing getTickList(WorldServer worldserver, String timingsType) { -+ return Timings.ofSafe(worldserver.getWorld().getName() + " - Scheduled " + timingsType); ++ return Timings.ofSafe(((WorldDataServer) worldserver.getWorldData()).getName() + " - Scheduled " + timingsType); + } +} diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -923,7 +924,7 @@ index 903cbd10fba18e61a4dc3ced71e22a665b78f177..423e4d12aba9197b936e69dfd4146cee int k = 0; CustomFunction.c[] acustomfunction_c = customfunction.b(); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 1964130ae411ff7d5e1b456a23629804d294a5d0..4cf4ef11ce295aec3b7d0bf07b64a1ecdca3c39a 100644 +index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e00ed83c9 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -28,7 +28,7 @@ import org.apache.logging.log4j.Level; diff --git a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch index 976618f7f..131e4e0ff 100644 --- a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch +++ b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch @@ -4,8 +4,45 @@ Date: Sun, 8 Mar 2015 22:55:25 -0600 Subject: [PATCH] Optimize TileEntity Ticking +diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java +index d4ebcf8f66197299256bd6b65710a1488c90ea41..c9164dfdb27ddf3709129c8aec54903a1df121ff 100644 +--- a/src/main/java/co/aikar/timings/TimingsExport.java ++++ b/src/main/java/co/aikar/timings/TimingsExport.java +@@ -109,7 +109,7 @@ public class TimingsExport extends Thread { + pair("end", System.currentTimeMillis() / 1000), + pair("online-mode", Bukkit.getServer().getOnlineMode()), + pair("sampletime", (System.currentTimeMillis() - TimingsManager.timingStart) / 1000), +- pair("datapacks", toArrayMapper(MinecraftServer.getServer().getResourcePackRepository().d(), pack -> { ++ pair("datapacks", toArrayMapper(MinecraftServer.getServer().getResourcePackRepository().e(), pack -> { + // Don't feel like obf helper'ing these, non fatal if its temp missed. + return ChatColor.stripColor(CraftChatMessage.fromComponent(pack.a(true))); + })) +@@ -148,8 +148,8 @@ public class TimingsExport extends Thread { + ); + + parent.put("worlds", toObjectMapper(MinecraftServer.getServer().getWorlds(), world -> { +- if (world.getWorldData().getName().equals("worldeditregentempworld")) return null; +- return pair(world.getWorldData().getName(), createObject( ++ if (world.getWorld().getName().equals("worldeditregentempworld")) return null; ++ return pair(world.getWorld().getName(), createObject( + pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> { + return pair(rule, world.getWorld().getGameRuleValue(rule)); + })), +diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java +index 1441d096d44ea653539ba20ccda94eb62ffc32df..b9d0d2d42850c3a5d093429cd0d02ac47848f04b 100644 +--- a/src/main/java/net/minecraft/server/BlockChest.java ++++ b/src/main/java/net/minecraft/server/BlockChest.java +@@ -11,7 +11,7 @@ public class BlockChest extends BlockChestAbstract implements I + + public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING; + public static final BlockStateEnum c = BlockProperties.aF; +- public static final BlockStateBoolean d = BlockProperties.C; ++ public static final BlockStateBoolean d = BlockProperties.C; public static final BlockStateBoolean waterlogged() { return d; } // Paper OBFHELPER + protected static final VoxelShape e = Block.a(1.0D, 0.0D, 0.0D, 15.0D, 14.0D, 15.0D); + protected static final VoxelShape f = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 16.0D); + protected static final VoxelShape g = Block.a(0.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D); diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..cc15686573f3a54ff0145b3486679b772157d191 100644 +index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..832fe1d41d69f44e4de1a6f4d037d3e104cac7af 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; @@ -70,7 +107,7 @@ index 58b1fd7415fdc67be7dc33e7f55c59df83bc996a..cc15686573f3a54ff0145b3486679b77 } private void a(SoundEffect soundeffect) { -+ if (!this.getBlock().hasProperty(BlockChest.c)) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074 ++ if (!this.getBlock().get(BlockChest.waterlogged())) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074 BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.c); if (blockpropertychesttype != BlockPropertyChestType.LEFT) { diff --git a/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch index b4645d220..341daae8d 100644 --- a/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/0088-Configurable-Player-Collision.patch @@ -57,7 +57,7 @@ index d1581c9d9838797eb425020d21bd0fba432e5652..99dc43159f240135957aee35f6129f19 packetdataserializer.a(this.c); packetdataserializer.a(this.d); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c4597985b7b3 100644 +index 42e7394326237fcb466ac9727b5ac732518cf1b9..5ed9122da69b8253c71744700ee9892a6326c8d9 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -75,6 +75,7 @@ public abstract class PlayerList { @@ -73,7 +73,7 @@ index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c459 entityplayer.syncInventory(); + // Paper start - Add to collideRule team if needed -+ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); ++ final Scoreboard scoreboard = this.getServer().getWorldServer(World.OVERWORLD).getScoreboard(); + final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName); + if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getScoreboardTeam() == null) { + scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam); @@ -88,7 +88,7 @@ index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c459 + // Paper start - Remove from collideRule team if needed + if (this.collideRuleTeamName != null) { -+ final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); ++ final Scoreboard scoreBoard = this.server.getWorldServer(World.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); + if (entityplayer.getScoreboardTeam() == team && team != null) { + scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); @@ -105,7 +105,7 @@ index 42e7394326237fcb466ac9727b5ac732518cf1b9..32be0e35918398f2fd5f62c2cb87c459 + // Paper start - Remove collideRule team if it exists + if (this.collideRuleTeamName != null) { -+ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); ++ final Scoreboard scoreboard = this.getServer().getWorldServer(World.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreboard.getTeam(this.collideRuleTeamName); + if (team != null) scoreboard.removeTeam(team); + } diff --git a/Spigot-Server-Patches/0114-Remove-FishingHook-reference-on-Craft-Entity-removal.patch b/Spigot-Server-Patches/0114-Remove-FishingHook-reference-on-Craft-Entity-removal.patch index ae755561c..1c1a2e5f4 100644 --- a/Spigot-Server-Patches/0114-Remove-FishingHook-reference-on-Craft-Entity-removal.patch +++ b/Spigot-Server-Patches/0114-Remove-FishingHook-reference-on-Craft-Entity-removal.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove FishingHook reference on Craft Entity removal diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java -index 591650712199f904af2c66b0d7e36ce31d87e1a3..f7b5320fc6c8a9dec40c69907c020d96fd3bfa00 100644 +index 591650712199f904af2c66b0d7e36ce31d87e1a3..b3c293a55e199d862526d35b6e85afc760f2b6fb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFishHook.java @@ -48,4 +48,15 @@ public class CraftFishHook extends CraftProjectile implements FishHook { @@ -17,10 +17,10 @@ index 591650712199f904af2c66b0d7e36ce31d87e1a3..f7b5320fc6c8a9dec40c69907c020d96 + @Override + public void remove() { + super.remove(); -+ if (getHandle().owner != null) { -+ getHandle().owner.hookedFish = null; ++ if (getHandle().getOwner() != null) { ++ getHandle().getOwner().hookedFish = null; + } + } + // Paper end -+ ++ } diff --git a/Spigot-Server-Patches/0132-String-based-Action-Bar-API.patch b/Spigot-Server-Patches/0132-String-based-Action-Bar-API.patch index 062d9f580..5d436e4b0 100644 --- a/Spigot-Server-Patches/0132-String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/0132-String-based-Action-Bar-API.patch @@ -4,8 +4,21 @@ Date: Tue, 27 Dec 2016 15:02:42 -0500 Subject: [PATCH] String based Action Bar API +diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java +index 275c1d2d1eb2649de9a9b5aece6e88c21362efba..d72ba7f76c42fd525a5b59a999a0c08e35d0ef78 100644 +--- a/src/main/java/net/minecraft/server/SystemUtils.java ++++ b/src/main/java/net/minecraft/server/SystemUtils.java +@@ -48,7 +48,7 @@ public class SystemUtils { + private static final ExecutorService e = a("Main"); + private static final ExecutorService f = n(); + public static LongSupplier a = System::nanoTime; +- public static final UUID b = new UUID(0L, 0L); ++ public static final UUID b = new UUID(0L, 0L); public static final UUID getNullUUID() {return b;} // Paper OBFHELPER + private static final Logger LOGGER = LogManager.getLogger(); + + public static Collector, ?, Map> a() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 20cb63419a049ce9dcaf2f0c99274501ebf9aa8c..527c116c23a505eead00e73a39ce9f932eb4ad8d 100644 +index 20cb63419a049ce9dcaf2f0c99274501ebf9aa8c..2118f7a8ea87191fd6fb5324c3c29f8beb43f3f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -219,6 +219,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -15,7 +28,7 @@ index 20cb63419a049ce9dcaf2f0c99274501ebf9aa8c..527c116c23a505eead00e73a39ce9f93 + @Override + public void sendActionBar(String message) { + if (getHandle().playerConnection == null || message == null || message.isEmpty()) return; -+ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new net.minecraft.server.ChatComponentText(message), net.minecraft.server.ChatMessageType.GAME_INFO)); ++ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new net.minecraft.server.ChatComponentText(message), net.minecraft.server.ChatMessageType.GAME_INFO, SystemUtils.getNullUUID())); + } + + @Override diff --git a/Spigot-Server-Patches/0235-RangedEntity-API.patch b/Spigot-Server-Patches/0235-RangedEntity-API.patch index 4d28a1104..3996603c6 100644 --- a/Spigot-Server-Patches/0235-RangedEntity-API.patch +++ b/Spigot-Server-Patches/0235-RangedEntity-API.patch @@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..696660b089ba355f865e5051237eefd0 + } +} diff --git a/src/main/java/net/minecraft/server/IRangedEntity.java b/src/main/java/net/minecraft/server/IRangedEntity.java -index b4178ce1e86ad40b64a229e066f058a8e848324d..9b79ac77db880930fcb86744924bf0baa92bef31 100644 +index b4178ce1e86ad40b64a229e066f058a8e848324d..fbfed5140539384bdd31e0f2777a3f92690d2576 100644 --- a/src/main/java/net/minecraft/server/IRangedEntity.java +++ b/src/main/java/net/minecraft/server/IRangedEntity.java @@ -2,5 +2,8 @@ package net.minecraft.server; @@ -43,7 +43,7 @@ index b4178ce1e86ad40b64a229e066f058a8e848324d..9b79ac77db880930fcb86744924bf0ba + void a(EntityLiving entityliving, float f); default void rangedAttack(EntityLiving entityliving, float f) { a(entityliving, f); } // Paper - OBFHELPER + + // - see EntitySkeletonAbstract melee goal -+ void q(boolean flag); default void setChargingAttack(boolean charging) { q(charging); }; // Paper ++ void setAggressive(boolean flag); default void setChargingAttack(boolean charging) { setAggressive(charging); }; // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftDrowned.java index 6e41dfd92344e3de71642879993cf25a5dd8b30a..390183fffd952e583a7d7df9ae618458fb48d278 100644 diff --git a/Spigot-Server-Patches/0263-Add-TNTPrimeEvent.patch b/Spigot-Server-Patches/0263-Add-TNTPrimeEvent.patch index 307b17b5b..2d395c995 100644 --- a/Spigot-Server-Patches/0263-Add-TNTPrimeEvent.patch +++ b/Spigot-Server-Patches/0263-Add-TNTPrimeEvent.patch @@ -115,7 +115,7 @@ index c6fe9c1f7ef06c4524533130b493ca5e72bd1693..7b601955f3fd36f06c838b896b455a60 world.a(blockposition, false); } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..279807dc5045e765fe7496315494b2cb231d08f9 100644 +index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..3cb8ce58c4675564fb239338d6c40ea511a9a97c 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -11,6 +11,7 @@ import org.bukkit.craftbukkit.block.CraftBlock; @@ -131,7 +131,7 @@ index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..279807dc5045e765fe7496315494b2cb craftBlock.getNMS().dropNaturally(world, blockposition, ItemStack.b); } + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.x, blockposition.y, blockposition.z); ++ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.EXPLOSION, explosionSource.getSource().getBukkitEntity()).callEvent()) + continue; + // Paper end diff --git a/Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch b/Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch new file mode 100644 index 000000000..5e88bdb17 --- /dev/null +++ b/Spigot-Server-Patches/0273-Allow-disabling-armour-stand-ticking.patch @@ -0,0 +1,176 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: kashike +Date: Wed, 15 Aug 2018 01:26:09 -0700 +Subject: [PATCH] Allow disabling armour stand ticking + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index eaaa51e4bf761f41fd516402ce1ad0f903c6ab71..bc3df01aab3e79be9c2836820e0eacc69ea6c1f4 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -393,4 +393,10 @@ public class PaperWorldConfig { + private void armorStandEntityLookups() { + armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true); + } ++ ++ public boolean armorStandTick = true; ++ private void armorStandTick() { ++ this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick); ++ log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default"); ++ } + } +diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java +index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afdbd76b709 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 { + public Vector3f leftLegPose; + public Vector3f rightLegPose; + public boolean canMove = true; // Paper ++ // Paper start - Allow ArmorStands not to tick ++ public boolean canTick = true; ++ public boolean canTickSetByAPI = false; ++ private boolean noTickPoseDirty = false; ++ private boolean noTickEquipmentDirty = false; ++ // Paper end + + 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; ++ if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking + this.G = 0.0F; + } + +@@ -135,6 +142,7 @@ public class EntityArmorStand extends EntityLiving { + this.armorItems.set(enumitemslot.b(), itemstack); + } + ++ this.noTickEquipmentDirty = true; // Paper - Allow equipment to be updated even when tick disabled + } + + @Override +@@ -215,6 +223,7 @@ public class EntityArmorStand extends EntityLiving { + } + + nbttagcompound.set("Pose", this.B()); ++ if (this.canTickSetByAPI) nbttagcompound.setBoolean("Paper.CanTickOverride", this.canTick); // Paper - persist no tick setting + } + + @Override +@@ -246,6 +255,12 @@ public class EntityArmorStand extends EntityLiving { + this.setBasePlate(nbttagcompound.getBoolean("NoBasePlate")); + this.setMarker(nbttagcompound.getBoolean("Marker")); + this.noclip = !this.A(); ++ // Paper start - persist no tick ++ if (nbttagcompound.hasKey("Paper.CanTickOverride")) { ++ this.canTick = nbttagcompound.getBoolean("Paper.CanTickOverride"); ++ this.canTickSetByAPI = true; ++ } ++ // Paper end + NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Pose"); + + this.g(nbttagcompound1); +@@ -600,7 +615,29 @@ public class EntityArmorStand extends EntityLiving { + + @Override + public void tick() { ++ // Paper start ++ if (!this.canTick) { ++ if (this.noTickPoseDirty) { ++ this.noTickPoseDirty = false; ++ this.updatePose(); ++ } ++ ++ if (this.noTickEquipmentDirty) { ++ this.noTickEquipmentDirty = false; ++ this.updateEntityEquipment(); ++ } ++ ++ return; ++ } ++ // Paper end ++ + super.tick(); ++ // Paper start - Split into separate method ++ updatePose(); ++ } ++ ++ public void updatePose() { ++ // Paper end + Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.c); + + if (!this.headPose.equals(vector3f)) { +@@ -723,31 +760,37 @@ public class EntityArmorStand extends EntityLiving { + public void setHeadPose(Vector3f vector3f) { + this.headPose = vector3f; + this.datawatcher.set(EntityArmorStand.c, vector3f); ++ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking + } + + public void setBodyPose(Vector3f vector3f) { + this.bodyPose = vector3f; + this.datawatcher.set(EntityArmorStand.d, vector3f); ++ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking + } + + public void setLeftArmPose(Vector3f vector3f) { + this.leftArmPose = vector3f; + this.datawatcher.set(EntityArmorStand.e, vector3f); ++ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking + } + + public void setRightArmPose(Vector3f vector3f) { + this.rightArmPose = vector3f; + this.datawatcher.set(EntityArmorStand.f, vector3f); ++ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking + } + + public void setLeftLegPose(Vector3f vector3f) { + this.leftLegPose = vector3f; + this.datawatcher.set(EntityArmorStand.g, vector3f); ++ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking + } + + public void setRightLegPose(Vector3f vector3f) { + this.rightLegPose = vector3f; + this.datawatcher.set(EntityArmorStand.bo, 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 b80068b184b32256f1944b9863454726852cd502..f65a0b943843ea365384825c5a848305f303d8f9 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -2503,6 +2503,7 @@ public abstract class EntityLiving extends Entity { + } + } + ++ public void updateEntityEquipment() { q(); }; // Paper + private void q() { + Map map = this.r(); + +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 ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +@@ -297,5 +297,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { + public boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot) { + return getHandle().isSlotDisabled(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot)); + } ++ ++ @Override ++ public boolean canTick() { ++ return this.getHandle().canTick; ++ } ++ ++ @Override ++ public void setCanTick(final boolean tick) { ++ this.getHandle().canTick = tick; ++ this.getHandle().canTickSetByAPI = true; ++ } + // Paper end + } diff --git a/Spigot-Server-Patches/0273-Optimize-BlockPosition-helper-methods.patch b/Spigot-Server-Patches/0274-Optimize-BlockPosition-helper-methods.patch similarity index 100% rename from Spigot-Server-Patches/0273-Optimize-BlockPosition-helper-methods.patch rename to Spigot-Server-Patches/0274-Optimize-BlockPosition-helper-methods.patch diff --git a/Spigot-Server-Patches/0274-Restore-vanlla-default-mob-spawn-range.patch b/Spigot-Server-Patches/0275-Restore-vanlla-default-mob-spawn-range.patch similarity index 100% rename from Spigot-Server-Patches/0274-Restore-vanlla-default-mob-spawn-range.patch rename to Spigot-Server-Patches/0275-Restore-vanlla-default-mob-spawn-range.patch diff --git a/Spigot-Server-Patches/0275-Fix-MC-124320.patch b/Spigot-Server-Patches/0276-Fix-MC-124320.patch similarity index 100% rename from Spigot-Server-Patches/0275-Fix-MC-124320.patch rename to Spigot-Server-Patches/0276-Fix-MC-124320.patch diff --git a/Spigot-Server-Patches/0276-Slime-Pathfinder-Events.patch b/Spigot-Server-Patches/0277-Slime-Pathfinder-Events.patch similarity index 100% rename from Spigot-Server-Patches/0276-Slime-Pathfinder-Events.patch rename to Spigot-Server-Patches/0277-Slime-Pathfinder-Events.patch diff --git a/Spigot-Server-Patches/0277-Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/0278-Configurable-speed-for-water-flowing-over-lava.patch similarity index 90% rename from Spigot-Server-Patches/0277-Configurable-speed-for-water-flowing-over-lava.patch rename to Spigot-Server-Patches/0278-Configurable-speed-for-water-flowing-over-lava.patch index adaf8e057..32045df15 100644 --- a/Spigot-Server-Patches/0277-Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/0278-Configurable-speed-for-water-flowing-over-lava.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Configurable speed for water flowing over lava diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index eaaa51e4bf761f41fd516402ce1ad0f903c6ab71..3c28dc61f97a65a0440c122ac5777cb9e24cdb3a 100644 +index bc3df01aab3e79be9c2836820e0eacc69ea6c1f4..487b0d5cd608e84a793eba5fdbd50a9f3d95c79b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -393,4 +393,10 @@ public class PaperWorldConfig { - private void armorStandEntityLookups() { - armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true); +@@ -399,4 +399,10 @@ public class PaperWorldConfig { + this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick); + log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default"); } + + public int waterOverLavaFlowSpeed; diff --git a/Spigot-Server-Patches/0278-Optimize-CraftBlockData-Creation.patch b/Spigot-Server-Patches/0279-Optimize-CraftBlockData-Creation.patch similarity index 100% rename from Spigot-Server-Patches/0278-Optimize-CraftBlockData-Creation.patch rename to Spigot-Server-Patches/0279-Optimize-CraftBlockData-Creation.patch diff --git a/Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch b/Spigot-Server-Patches/0280-Optimize-RegistryMaterials.patch similarity index 74% rename from Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch rename to Spigot-Server-Patches/0280-Optimize-RegistryMaterials.patch index 4b245994f..3a6e2f060 100644 --- a/Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch +++ b/Spigot-Server-Patches/0280-Optimize-RegistryMaterials.patch @@ -8,7 +8,7 @@ Use larger initial sizes to increase bucket capacity on the BiMap BiMap.get was seen to be using a good bit of CPU time. diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java -index c60140a283df47edf23fe4f54a2c1d2fca7593f8..7189204ee57343b3381e8c83eb5a5281a0e0962f 100644 +index c60140a283df47edf23fe4f54a2c1d2fca7593f8..79817e3ffcac372e00b92c5b6bcb44653fcb73db 100644 --- a/src/main/java/net/minecraft/server/RegistryMaterials.java +++ b/src/main/java/net/minecraft/server/RegistryMaterials.java @@ -25,9 +25,9 @@ import org.apache.logging.log4j.Logger; @@ -42,3 +42,12 @@ index c60140a283df47edf23fe4f54a2c1d2fca7593f8..7189204ee57343b3381e8c83eb5a5281 builder.add(Pair.of(registrymaterials.c(t0).get(), t0)); } +@@ -191,7 +191,7 @@ public class RegistryMaterials extends IRegistryWritable { + + registrymaterials.bb.entrySet().stream().filter((entry) -> { + return registrymaterials.c((ResourceKey) entry.getKey()); +- }).forEach(com_google_common_collect_immutablemap_builder::put); ++ }).forEach(entry1 -> com_google_common_collect_immutablemap_builder.put((java.util.Map.Entry,? extends T>) entry1)); // Paper - compiler fix (expand method reference + add cast) + return com_google_common_collect_immutablemap_builder.build(); + }); + } diff --git a/Spigot-Server-Patches/0280-Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/0281-Add-PhantomPreSpawnEvent.patch similarity index 100% rename from Spigot-Server-Patches/0280-Add-PhantomPreSpawnEvent.patch rename to Spigot-Server-Patches/0281-Add-PhantomPreSpawnEvent.patch diff --git a/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch b/Spigot-Server-Patches/0282-Add-More-Creeper-API.patch similarity index 100% rename from Spigot-Server-Patches/0281-Add-More-Creeper-API.patch rename to Spigot-Server-Patches/0282-Add-More-Creeper-API.patch diff --git a/Spigot-Server-Patches/0282-Inventory-removeItemAnySlot.patch b/Spigot-Server-Patches/0283-Inventory-removeItemAnySlot.patch similarity index 100% rename from Spigot-Server-Patches/0282-Inventory-removeItemAnySlot.patch rename to Spigot-Server-Patches/0283-Inventory-removeItemAnySlot.patch diff --git a/Spigot-Server-Patches/0283-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/0284-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch similarity index 100% rename from Spigot-Server-Patches/0283-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch rename to Spigot-Server-Patches/0284-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch diff --git a/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-Server-Patches/0285-Add-ray-tracing-methods-to-LivingEntity.patch similarity index 96% rename from Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch rename to Spigot-Server-Patches/0285-Add-ray-tracing-methods-to-LivingEntity.patch index eb583d413..30b898d44 100644 --- a/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-Server-Patches/0285-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 b80068b184b32256f1944b9863454726852cd502..12e7b1b5d15e94068c85f189c4ad1c5b5fab5e38 100644 +index f65a0b943843ea365384825c5a848305f303d8f9..c3f3a392f2b15a806c706b1e518282225b45bbc3 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3441,6 +3441,23 @@ public abstract class EntityLiving extends Entity { +@@ -3442,6 +3442,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/0286-Expose-attack-cooldown-methods-for-Player.patch similarity index 95% rename from Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch rename to Spigot-Server-Patches/0286-Expose-attack-cooldown-methods-for-Player.patch index 400cf1fe0..1d92e8adc 100644 --- a/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/0286-Expose-attack-cooldown-methods-for-Player.patch @@ -27,7 +27,7 @@ index 1249a7ae8fa8d6ea33cbc276717f1e4553f73b85..af554396fdb25719c158a81ccab76e91 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 0ba5b2a444660f280b673dbd0db9ded38fa6a839..7b9b7b55c0b726648cfa4b9b87ad70c91fad2d75 100644 +index 071a95a6ce704a8d3828cfb01ab7dc666a4622a0..8a6cda5df562baefb2bc245192e9ab539e1b6022 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1945,6 +1945,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0286-Improve-death-events.patch b/Spigot-Server-Patches/0287-Improve-death-events.patch similarity index 98% rename from Spigot-Server-Patches/0286-Improve-death-events.patch rename to Spigot-Server-Patches/0287-Improve-death-events.patch index 44df65ab8..ce9249bb6 100644 --- a/Spigot-Server-Patches/0286-Improve-death-events.patch +++ b/Spigot-Server-Patches/0287-Improve-death-events.patch @@ -47,10 +47,10 @@ index 413dd5456d14842ab48143b6ee35e37dcb5ca3db..a704feb0c19b56964d017f9e0ea3f26b 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 a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..74c58c3f82a94a3ec5e53c7f92e54cee80dc9e8a 100644 +index d5c09152acc93b25d626284071599afdbd76b709..51e9f4a6e09474a7489d2872a800308ee3f02e46 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -664,7 +664,8 @@ public class EntityArmorStand extends EntityLiving { +@@ -701,7 +701,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 12e7b1b5d15e94068c85f189c4ad1c5b5fab5e38..c00031656bb6d2f986f555c68bb2fa9b9b0c0e6d 100644 +index c3f3a392f2b15a806c706b1e518282225b45bbc3..f5f043f0a5bafb7e432a541f9ef6db0956a52f31 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 { @@ -357,7 +357,7 @@ 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 7b9b7b55c0b726648cfa4b9b87ad70c91fad2d75..51e7c6d82248b5c0938d37607c64a9c10cb4de4d 100644 +index 8a6cda5df562baefb2bc245192e9ab539e1b6022..0e1f5c75b6ab37ce3cfbeaecdc3dd64e8c05e18e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1739,7 +1739,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch b/Spigot-Server-Patches/0288-Allow-chests-to-be-placed-with-NBT-data.patch similarity index 100% rename from Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch rename to Spigot-Server-Patches/0288-Allow-chests-to-be-placed-with-NBT-data.patch diff --git a/Spigot-Server-Patches/0288-Mob-Pathfinding-API.patch b/Spigot-Server-Patches/0289-Mob-Pathfinding-API.patch similarity index 100% rename from Spigot-Server-Patches/0288-Mob-Pathfinding-API.patch rename to Spigot-Server-Patches/0289-Mob-Pathfinding-API.patch diff --git a/Spigot-Server-Patches/0289-Prevent-chunk-loading-from-Fluid-Flowing.patch b/Spigot-Server-Patches/0290-Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 100% rename from Spigot-Server-Patches/0289-Prevent-chunk-loading-from-Fluid-Flowing.patch rename to Spigot-Server-Patches/0290-Prevent-chunk-loading-from-Fluid-Flowing.patch diff --git a/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/0291-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch similarity index 100% rename from Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch rename to Spigot-Server-Patches/0291-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch diff --git a/Spigot-Server-Patches/0291-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/Spigot-Server-Patches/0292-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch similarity index 100% rename from Spigot-Server-Patches/0291-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch rename to Spigot-Server-Patches/0292-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch diff --git a/Spigot-Server-Patches/0292-Prevent-mob-spawning-from-loading-generating-chunks.patch b/Spigot-Server-Patches/0293-Prevent-mob-spawning-from-loading-generating-chunks.patch similarity index 100% rename from Spigot-Server-Patches/0292-Prevent-mob-spawning-from-loading-generating-chunks.patch rename to Spigot-Server-Patches/0293-Prevent-mob-spawning-from-loading-generating-chunks.patch diff --git a/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/Spigot-Server-Patches/0294-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch similarity index 100% rename from Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch rename to Spigot-Server-Patches/0294-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch diff --git a/Spigot-Server-Patches/0294-Implement-furnace-cook-speed-multiplier-API.patch b/Spigot-Server-Patches/0295-Implement-furnace-cook-speed-multiplier-API.patch similarity index 100% rename from Spigot-Server-Patches/0294-Implement-furnace-cook-speed-multiplier-API.patch rename to Spigot-Server-Patches/0295-Implement-furnace-cook-speed-multiplier-API.patch diff --git a/Spigot-Server-Patches/0295-PreSpawnerSpawnEvent.patch b/Spigot-Server-Patches/0296-PreSpawnerSpawnEvent.patch similarity index 100% rename from Spigot-Server-Patches/0295-PreSpawnerSpawnEvent.patch rename to Spigot-Server-Patches/0296-PreSpawnerSpawnEvent.patch diff --git a/Spigot-Server-Patches/0296-Catch-JsonParseException-in-Entity-and-TE-names.patch b/Spigot-Server-Patches/0297-Catch-JsonParseException-in-Entity-and-TE-names.patch similarity index 100% rename from Spigot-Server-Patches/0296-Catch-JsonParseException-in-Entity-and-TE-names.patch rename to Spigot-Server-Patches/0297-Catch-JsonParseException-in-Entity-and-TE-names.patch diff --git a/Spigot-Server-Patches/0297-Honor-EntityAgeable.ageLock.patch b/Spigot-Server-Patches/0298-Honor-EntityAgeable.ageLock.patch similarity index 100% rename from Spigot-Server-Patches/0297-Honor-EntityAgeable.ageLock.patch rename to Spigot-Server-Patches/0298-Honor-EntityAgeable.ageLock.patch diff --git a/Spigot-Server-Patches/0298-Configurable-connection-throttle-kick-message.patch b/Spigot-Server-Patches/0299-Configurable-connection-throttle-kick-message.patch similarity index 100% rename from Spigot-Server-Patches/0298-Configurable-connection-throttle-kick-message.patch rename to Spigot-Server-Patches/0299-Configurable-connection-throttle-kick-message.patch diff --git a/Spigot-Server-Patches/0299-Hook-into-CB-plugin-rewrites.patch b/Spigot-Server-Patches/0300-Hook-into-CB-plugin-rewrites.patch similarity index 100% rename from Spigot-Server-Patches/0299-Hook-into-CB-plugin-rewrites.patch rename to Spigot-Server-Patches/0300-Hook-into-CB-plugin-rewrites.patch diff --git a/Spigot-Server-Patches/0300-Allow-setting-the-vex-s-summoner.patch b/Spigot-Server-Patches/0301-Allow-setting-the-vex-s-summoner.patch similarity index 100% rename from Spigot-Server-Patches/0300-Allow-setting-the-vex-s-summoner.patch rename to Spigot-Server-Patches/0301-Allow-setting-the-vex-s-summoner.patch diff --git a/Spigot-Server-Patches/0301-Add-sun-related-API.patch b/Spigot-Server-Patches/0302-Add-sun-related-API.patch similarity index 100% rename from Spigot-Server-Patches/0301-Add-sun-related-API.patch rename to Spigot-Server-Patches/0302-Add-sun-related-API.patch diff --git a/Spigot-Server-Patches/0302-Turtle-API.patch b/Spigot-Server-Patches/0303-Turtle-API.patch similarity index 100% rename from Spigot-Server-Patches/0302-Turtle-API.patch rename to Spigot-Server-Patches/0303-Turtle-API.patch diff --git a/Spigot-Server-Patches/0303-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/Spigot-Server-Patches/0304-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch similarity index 100% rename from Spigot-Server-Patches/0303-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch rename to Spigot-Server-Patches/0304-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch diff --git a/Spigot-Server-Patches/0304-Call-player-spectator-target-events-and-improve-impl.patch b/Spigot-Server-Patches/0305-Call-player-spectator-target-events-and-improve-impl.patch similarity index 100% rename from Spigot-Server-Patches/0304-Call-player-spectator-target-events-and-improve-impl.patch rename to Spigot-Server-Patches/0305-Call-player-spectator-target-events-and-improve-impl.patch diff --git a/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/0306-Add-Velocity-IP-Forwarding-Support.patch similarity index 95% rename from Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch rename to Spigot-Server-Patches/0306-Add-Velocity-IP-Forwarding-Support.patch index 662903f8f..033456ab1 100644 --- a/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/0306-Add-Velocity-IP-Forwarding-Support.patch @@ -130,10 +130,18 @@ index 0000000000000000000000000000000000000000..fdd8708f974700c7cde6e436c2f189d9 + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88131ddd8e 100644 +index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..7d65ce89622b00a121ce0353f697b07d9e99d0ce 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -41,6 +41,7 @@ public class LoginListener implements PacketLoginInListener { +@@ -25,6 +25,7 @@ import org.bukkit.craftbukkit.util.Waitable; + import org.bukkit.event.player.AsyncPlayerPreLoginEvent; + import org.bukkit.event.player.PlayerPreLoginEvent; + // CraftBukkit end ++import io.netty.buffer.Unpooled; // Paper + + public class LoginListener implements PacketLoginInListener { + +@@ -41,6 +42,7 @@ public class LoginListener implements PacketLoginInListener { private SecretKey loginKey; private EntityPlayer l; public String hostname = ""; // CraftBukkit - add field @@ -141,14 +149,14 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88 public LoginListener(MinecraftServer minecraftserver, NetworkManager networkmanager) { this.g = LoginListener.EnumProtocolState.HELLO; -@@ -192,6 +193,14 @@ public class LoginListener implements PacketLoginInListener { +@@ -192,6 +194,14 @@ public class LoginListener implements PacketLoginInListener { this.g = LoginListener.EnumProtocolState.KEY; this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.getKeyPair().getPublic(), this.e)); } else { + // Paper start - Velocity support + if (com.destroystokyo.paper.PaperConfig.velocitySupport) { + this.velocityLoginMessageId = java.util.concurrent.ThreadLocalRandom.current().nextInt(); -+ PacketLoginOutCustomPayload packet = new PacketLoginOutCustomPayload(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new PacketDataSerializer(io.netty.buffer.Unpooled.EMPTY_BUFFER)); ++ PacketLoginOutCustomPayload packet = new PacketLoginOutCustomPayload(this.velocityLoginMessageId, com.destroystokyo.paper.proxy.VelocityProxy.PLAYER_INFO_CHANNEL, new PacketDataSerializer(Unpooled.EMPTY_BUFFER)); + this.networkManager.sendPacket(packet); + return; + } @@ -156,7 +164,7 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88 // Spigot start // Paper start - Cache authenticator threads authenticatorPool.execute(new Runnable() { -@@ -284,6 +293,12 @@ public class LoginListener implements PacketLoginInListener { +@@ -284,6 +294,12 @@ public class LoginListener implements PacketLoginInListener { public class LoginHandler { public void fireEvents() throws Exception { @@ -169,7 +177,7 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..57520943befea80b334ccf2385057b88 String playerName = i.getName(); java.net.InetAddress address = ((java.net.InetSocketAddress) networkManager.getSocketAddress()).getAddress(); java.util.UUID uniqueId = i.getId(); -@@ -331,6 +346,35 @@ public class LoginListener implements PacketLoginInListener { +@@ -331,6 +347,35 @@ public class LoginListener implements PacketLoginInListener { // Spigot end public void a(PacketLoginInCustomPayload packetloginincustompayload) { diff --git a/Spigot-Server-Patches/0306-Add-more-Witch-API.patch b/Spigot-Server-Patches/0307-Add-more-Witch-API.patch similarity index 100% rename from Spigot-Server-Patches/0306-Add-more-Witch-API.patch rename to Spigot-Server-Patches/0307-Add-more-Witch-API.patch diff --git a/Spigot-Server-Patches/0307-Check-Drowned-for-Villager-Aggression-Config.patch b/Spigot-Server-Patches/0308-Check-Drowned-for-Villager-Aggression-Config.patch similarity index 100% rename from Spigot-Server-Patches/0307-Check-Drowned-for-Villager-Aggression-Config.patch rename to Spigot-Server-Patches/0308-Check-Drowned-for-Villager-Aggression-Config.patch diff --git a/Spigot-Server-Patches/0308-Here-s-Johnny.patch b/Spigot-Server-Patches/0309-Here-s-Johnny.patch similarity index 100% rename from Spigot-Server-Patches/0308-Here-s-Johnny.patch rename to Spigot-Server-Patches/0309-Here-s-Johnny.patch diff --git a/Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0310-Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 96% rename from Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch rename to Spigot-Server-Patches/0310-Add-option-to-prevent-players-from-moving-into-unloa.patch index c826b39ad..189701cc3 100644 --- a/Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/Spigot-Server-Patches/0310-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 3c28dc61f97a65a0440c122ac5777cb9e24cdb3a..6f660388aa0d56577ad1c3f463c96d925c964821 100644 +index 487b0d5cd608e84a793eba5fdbd50a9f3d95c79b..b49a1a6f5017c9e183a7d08b16e89899c25a9717 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -399,4 +399,9 @@ public class PaperWorldConfig { +@@ -405,4 +405,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/0310-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0311-Reset-players-airTicks-on-respawn.patch similarity index 100% rename from Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch rename to Spigot-Server-Patches/0311-Reset-players-airTicks-on-respawn.patch diff --git a/Spigot-Server-Patches/0311-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/Spigot-Server-Patches/0312-Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 100% rename from Spigot-Server-Patches/0311-Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to Spigot-Server-Patches/0312-Don-t-sleep-after-profile-lookups-if-not-needed.patch diff --git a/Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/Spigot-Server-Patches/0313-Improve-Server-Thread-Pool-and-Thread-Priorities.patch similarity index 95% rename from Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch rename to Spigot-Server-Patches/0313-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index d4913bb16..7866e4593 100644 --- a/Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/Spigot-Server-Patches/0313-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 a7be2875faa968d2e3939974f62c977ca03e9c5b..29f7e78fc21ccca1a080055fe616996d1ede666f 100644 +index f33624e65a56bd7cf4432eecdd6834fa3f32cda5..4d6b4c26029ea72d92934fff35211ef562c17a4b 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> { +@@ -12,6 +12,7 @@ import io.netty.channel.epoll.EpollEventLoopGroup; + import io.netty.channel.local.LocalChannel; + import io.netty.channel.local.LocalServerChannel; + import io.netty.channel.nio.NioEventLoopGroup; ++import io.netty.handler.codec.EncoderException; // Paper + import io.netty.handler.timeout.TimeoutException; + import io.netty.util.AttributeKey; + import io.netty.util.concurrent.Future; +@@ -97,6 +98,15 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } public void exceptionCaught(ChannelHandlerContext channelhandlercontext, Throwable throwable) { + // Paper start -+ if (throwable instanceof io.netty.handler.codec.EncoderException && throwable.getCause() instanceof PacketEncoder.PacketTooLargeException) { ++ if (throwable instanceof EncoderException && throwable.getCause() instanceof PacketEncoder.PacketTooLargeException) { + if (((PacketEncoder.PacketTooLargeException) throwable.getCause()).getPacket().packetTooLarge(this)) { + return; + } else { diff --git a/Spigot-Server-Patches/0322-force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/0323-force-entity-dismount-during-teleportation.patch similarity index 97% rename from Spigot-Server-Patches/0322-force-entity-dismount-during-teleportation.patch rename to Spigot-Server-Patches/0323-force-entity-dismount-during-teleportation.patch index a61ae61a2..740c3bde4 100644 --- a/Spigot-Server-Patches/0322-force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/0323-force-entity-dismount-during-teleportation.patch @@ -91,10 +91,10 @@ index af554396fdb25719c158a81ccab76e91f5df2ff5..5ef91da9733fd9276e7bd819a11a0548 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index c00031656bb6d2f986f555c68bb2fa9b9b0c0e6d..0b4e39d93f28ec5c7835bace2ea969a6e99ac2a3 100644 +index f5f043f0a5bafb7e432a541f9ef6db0956a52f31..ed001440151078e20a449ba073d71e873ff0ad9a 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2891,11 +2891,13 @@ public abstract class EntityLiving extends Entity { +@@ -2892,11 +2892,13 @@ public abstract class EntityLiving extends Entity { return ((Byte) this.datawatcher.get(EntityLiving.an) & 4) != 0; } diff --git a/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch b/Spigot-Server-Patches/0324-Add-more-Zombie-API.patch similarity index 98% rename from Spigot-Server-Patches/0323-Add-more-Zombie-API.patch rename to Spigot-Server-Patches/0324-Add-more-Zombie-API.patch index 80105a9fa..56e5ab616 100644 --- a/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/0324-Add-more-Zombie-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index df98f2244a161c0e66e80f92c91760409734dc69..081baca9a101d188e4810d04f69811d52de7a107 100644 +index 7c9b437d950623a978ca3d45c8ca57b39a897179..dbd7850df45fb9ee550ce33f97bdfe9cf5bfcd34 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -1423,6 +1423,8 @@ public abstract class EntityInsentient extends EntityLiving { diff --git a/Spigot-Server-Patches/0324-Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/0325-Add-PlayerConnectionCloseEvent.patch similarity index 93% rename from Spigot-Server-Patches/0324-Add-PlayerConnectionCloseEvent.patch rename to Spigot-Server-Patches/0325-Add-PlayerConnectionCloseEvent.patch index 56d5df397..c87e62b8a 100644 --- a/Spigot-Server-Patches/0324-Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-Server-Patches/0325-Add-PlayerConnectionCloseEvent.patch @@ -34,10 +34,10 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent is undefined. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 57520943befea80b334ccf2385057b88131ddd8e..8c5c57ecd98a286a4992a36effae95596b37fc8a 100644 +index 7d65ce89622b00a121ce0353f697b07d9e99d0ce..50163f7291474062bde81631c9220e8a9f5bb718 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -34,9 +34,9 @@ public class LoginListener implements PacketLoginInListener { +@@ -35,9 +35,9 @@ public class LoginListener implements PacketLoginInListener { private final byte[] e = new byte[4]; private final MinecraftServer server; public final NetworkManager networkManager; @@ -50,10 +50,10 @@ index 57520943befea80b334ccf2385057b88131ddd8e..8c5c57ecd98a286a4992a36effae9559 private SecretKey loginKey; private EntityPlayer l; diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index cd97b6a24010165d9435a5c62b6f896278674418..64d61eca4bbb4a9e18d78c8d2a55114134f56b6f 100644 +index e7b4c7f2d7b0eed4c145f6476f35b637d861551e..c84ee96cbed69cca311dd546e562a5322a03fd20 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -335,6 +335,26 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -336,6 +336,26 @@ public class NetworkManager extends SimpleChannelInboundHandler> { this.i().a(new ChatMessage("multiplayer.disconnect.generic")); } this.packetQueue.clear(); // Free up packet queue. diff --git a/Spigot-Server-Patches/0325-Prevent-Enderman-from-loading-chunks.patch b/Spigot-Server-Patches/0326-Prevent-Enderman-from-loading-chunks.patch similarity index 100% rename from Spigot-Server-Patches/0325-Prevent-Enderman-from-loading-chunks.patch rename to Spigot-Server-Patches/0326-Prevent-Enderman-from-loading-chunks.patch diff --git a/Spigot-Server-Patches/0326-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-Server-Patches/0327-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 97% rename from Spigot-Server-Patches/0326-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to Spigot-Server-Patches/0327-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 6a9ea81f6..b93257f14 100644 --- a/Spigot-Server-Patches/0326-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-Server-Patches/0327-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -28,7 +28,7 @@ index 80a9faf3b02c51efc1f55beebce173309628b9ab..ccf1a64d33038a73360f68a814bd4602 public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 8c1d836538c678feca56076753e8781eadcd6d1d..a6606eff5ac89c54bdcbee0d3bf124d737d9735b 100644 +index e9e6e89145cc3d6b2b497132030c47515bfee5ab..a6f0b39717164d6b3ab15843b13ef52a24dde5d6 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -97,6 +97,7 @@ public abstract class PlayerList { @@ -106,7 +106,7 @@ index 00333548b470435aa89fb0f4b29047eb1461e992..5770d4183c1b9ab6119a25930283c023 public Location getBedSpawnLocation() { NBTTagCompound data = getData(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 51e7c6d82248b5c0938d37607c64a9c10cb4de4d..d61a255abede0ae19519d83117a877d1a04307bf 100644 +index 0e1f5c75b6ab37ce3cfbeaecdc3dd64e8c05e18e..13636096a166150e1e3c0d88a31badf202f702d7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -143,6 +143,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0327-Fix-PlayerEditBookEvent.patch b/Spigot-Server-Patches/0328-Fix-PlayerEditBookEvent.patch similarity index 100% rename from Spigot-Server-Patches/0327-Fix-PlayerEditBookEvent.patch rename to Spigot-Server-Patches/0328-Fix-PlayerEditBookEvent.patch diff --git a/Spigot-Server-Patches/0328-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/Spigot-Server-Patches/0329-Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 100% rename from Spigot-Server-Patches/0328-Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to Spigot-Server-Patches/0329-Workaround-for-vehicle-tracking-issue-on-disconnect.patch diff --git a/Spigot-Server-Patches/0329-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch b/Spigot-Server-Patches/0330-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch similarity index 100% rename from Spigot-Server-Patches/0329-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch rename to Spigot-Server-Patches/0330-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch diff --git a/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/0331-Block-Entity-remove-from-being-called-on-Players.patch similarity index 93% rename from Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch rename to Spigot-Server-Patches/0331-Block-Entity-remove-from-being-called-on-Players.patch index 785bf4323..6bde405c3 100644 --- a/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch +++ b/Spigot-Server-Patches/0331-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,7 +12,7 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d61a255abede0ae19519d83117a877d1a04307bf..b9dcd216dd9e4eeee824b252446afdac3ca44d24 100644 +index 13636096a166150e1e3c0d88a31badf202f702d7..64c48af6dcdb6e8121d55a015fdeed63ef3f5ec3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1990,6 +1990,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0331-BlockDestroyEvent.patch b/Spigot-Server-Patches/0332-BlockDestroyEvent.patch similarity index 95% rename from Spigot-Server-Patches/0331-BlockDestroyEvent.patch rename to Spigot-Server-Patches/0332-BlockDestroyEvent.patch index 3c0fe7d7e..d88b83399 100644 --- a/Spigot-Server-Patches/0331-BlockDestroyEvent.patch +++ b/Spigot-Server-Patches/0332-BlockDestroyEvent.patch @@ -11,7 +11,7 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f0b3de717d5e425fb08c5afdfb3571fb6b8ab556..5e253b3609de30ac6a0a8f156c6f6d07a5bb99ce 100644 +index 7b7785f79ed176967d4c91c2d77c6f6ce73b30b8..d683ec109b23ae4c14efaa23bfe923cf2c453f87 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -533,8 +533,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0332-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch b/Spigot-Server-Patches/0333-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch similarity index 100% rename from Spigot-Server-Patches/0332-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch rename to Spigot-Server-Patches/0333-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch diff --git a/Spigot-Server-Patches/0333-Fix-sign-edit-memory-leak.patch b/Spigot-Server-Patches/0334-Fix-sign-edit-memory-leak.patch similarity index 100% rename from Spigot-Server-Patches/0333-Fix-sign-edit-memory-leak.patch rename to Spigot-Server-Patches/0334-Fix-sign-edit-memory-leak.patch diff --git a/Spigot-Server-Patches/0334-Limit-Client-Sign-length-more.patch b/Spigot-Server-Patches/0335-Limit-Client-Sign-length-more.patch similarity index 100% rename from Spigot-Server-Patches/0334-Limit-Client-Sign-length-more.patch rename to Spigot-Server-Patches/0335-Limit-Client-Sign-length-more.patch diff --git a/Spigot-Server-Patches/0335-Don-t-check-ConvertSigns-boolean-every-sign-save.patch b/Spigot-Server-Patches/0336-Don-t-check-ConvertSigns-boolean-every-sign-save.patch similarity index 100% rename from Spigot-Server-Patches/0335-Don-t-check-ConvertSigns-boolean-every-sign-save.patch rename to Spigot-Server-Patches/0336-Don-t-check-ConvertSigns-boolean-every-sign-save.patch diff --git a/Spigot-Server-Patches/0336-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/Spigot-Server-Patches/0337-Optimize-Network-Manager-and-add-advanced-packet-sup.patch similarity index 93% rename from Spigot-Server-Patches/0336-Optimize-Network-Manager-and-add-advanced-packet-sup.patch rename to Spigot-Server-Patches/0337-Optimize-Network-Manager-and-add-advanced-packet-sup.patch index 398c7ed46..8e265a904 100644 --- a/Spigot-Server-Patches/0336-Optimize-Network-Manager-and-add-advanced-packet-sup.patch +++ b/Spigot-Server-Patches/0337-Optimize-Network-Manager-and-add-advanced-packet-sup.patch @@ -28,10 +28,10 @@ and then catch exceptions and close if they fire. Part of this commit was authored by: Spottedleaf diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40e4902f29 100644 +index c84ee96cbed69cca311dd546e562a5322a03fd20..e27c96a1f53f6a2929b8daed9844320da6c57234 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -64,6 +64,10 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -65,6 +65,10 @@ public class NetworkManager extends SimpleChannelInboundHandler> { public int protocolVersion; public java.net.InetSocketAddress virtualHost; private static boolean enableExplicitFlush = Boolean.getBoolean("paper.explicit-flush"); @@ -42,7 +42,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40 // Paper end public NetworkManager(EnumProtocolDirection enumprotocoldirection) { -@@ -87,6 +91,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -88,6 +92,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } public void setProtocol(EnumProtocol enumprotocol) { @@ -50,7 +50,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40 this.channel.attr(NetworkManager.c).set(enumprotocol); this.channel.config().setAutoRead(true); NetworkManager.LOGGER.debug("Enabled auto read"); -@@ -157,19 +162,82 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -158,19 +163,82 @@ public class NetworkManager extends SimpleChannelInboundHandler> { Validate.notNull(packetlistener, "packetListener", new Object[0]); this.packetListener = packetlistener; } @@ -138,7 +138,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40 } private void dispatchPacket(Packet packet, @Nullable GenericFutureListener> genericFutureListener) { this.b(packet, genericFutureListener); } // Paper - OBFHELPER -@@ -183,51 +251,116 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -184,51 +252,116 @@ public class NetworkManager extends SimpleChannelInboundHandler> { this.channel.config().setAutoRead(false); } @@ -265,7 +265,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40 public void a() { this.o(); -@@ -256,9 +389,21 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -257,9 +390,21 @@ public class NetworkManager extends SimpleChannelInboundHandler> { return this.socketAddress; } @@ -287,7 +287,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40 // Spigot End if (this.channel.isOpen()) { this.channel.close(); // We can't wait as this may be called from an event loop. -@@ -326,7 +471,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -327,7 +472,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { public void handleDisconnection() { if (this.channel != null && !this.channel.isOpen()) { if (this.o) { @@ -296,7 +296,7 @@ index 64d61eca4bbb4a9e18d78c8d2a55114134f56b6f..020dce1a42e8e083c21fdcb7b954bc40 } else { this.o = true; if (this.j() != null) { -@@ -334,7 +479,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { +@@ -335,7 +480,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { } else if (this.i() != null) { this.i().a(new ChatMessage("multiplayer.disconnect.generic")); } @@ -338,7 +338,7 @@ index 2d8e6a2f4a0c3c5d74a647d7164b0028781d3bf5..545dbe6ddcce1d172f465b4a7ab85654 return false; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index a6606eff5ac89c54bdcbee0d3bf124d737d9735b..7b3ac5620d5556a55838f1d57b3cbc11955a5712 100644 +index a6f0b39717164d6b3ab15843b13ef52a24dde5d6..3a5641f9187fc21f367f7a3cd12cec8e4c80dd97 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -166,6 +166,7 @@ public abstract class PlayerList { @@ -358,10 +358,18 @@ index a6606eff5ac89c54bdcbee0d3bf124d737d9735b..7b3ac5620d5556a55838f1d57b3cbc11 entityplayer.getStatisticManager().c(); entityplayer.B().a(entityplayer); diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..8055a8aab682cfd81fc45f587d3578e25a2128f0 100644 +index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..0438126662e7c635d9a4f7b8c54fe7c50403ffe8 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -40,10 +40,12 @@ public class ServerConnection { +@@ -15,6 +15,7 @@ import io.netty.channel.epoll.EpollServerSocketChannel; + import io.netty.channel.nio.NioEventLoopGroup; + import io.netty.channel.socket.ServerSocketChannel; + import io.netty.channel.socket.nio.NioServerSocketChannel; ++import io.netty.handler.flush.FlushConsolidationHandler; // Paper + import io.netty.handler.timeout.ReadTimeoutHandler; + import java.io.IOException; + import java.net.InetAddress; +@@ -40,10 +41,12 @@ public class ServerConnection { private final List connectedChannels = Collections.synchronizedList(Lists.newArrayList()); // Paper start - prevent blocking on adding a new network manager while the server is ticking private final java.util.Queue pending = new java.util.concurrent.ConcurrentLinkedQueue<>(); @@ -374,11 +382,11 @@ index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..8055a8aab682cfd81fc45f587d3578e2 } } // Paper end -@@ -78,6 +80,7 @@ public class ServerConnection { +@@ -78,6 +81,7 @@ public class ServerConnection { ; } -+ if (!disableFlushConsolidation) channel.pipeline().addFirst(new io.netty.handler.flush.FlushConsolidationHandler()); // Paper ++ if (!disableFlushConsolidation) channel.pipeline().addFirst(new FlushConsolidationHandler()); // Paper channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND)); NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND); diff --git a/Spigot-Server-Patches/0337-Handle-Oversized-Tile-Entities-in-chunks.patch b/Spigot-Server-Patches/0338-Handle-Oversized-Tile-Entities-in-chunks.patch similarity index 100% rename from Spigot-Server-Patches/0337-Handle-Oversized-Tile-Entities-in-chunks.patch rename to Spigot-Server-Patches/0338-Handle-Oversized-Tile-Entities-in-chunks.patch diff --git a/Spigot-Server-Patches/0338-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch b/Spigot-Server-Patches/0339-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch similarity index 94% rename from Spigot-Server-Patches/0338-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch rename to Spigot-Server-Patches/0339-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch index 135948b87..9926dbd00 100644 --- a/Spigot-Server-Patches/0338-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch +++ b/Spigot-Server-Patches/0339-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch @@ -11,7 +11,7 @@ everything to the Whitelist object. https://github.com/PaperMC/Paper/issues/1880 diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7b3ac5620d5556a55838f1d57b3cbc11955a5712..ce2cf5f9432c9e20d351914646a78974d1f17b03 100644 +index 3a5641f9187fc21f367f7a3cd12cec8e4c80dd97..5c6ea9df899a0649abde8c54e6f844eaf53d27dd 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -931,9 +931,9 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch b/Spigot-Server-Patches/0340-Set-Zombie-last-tick-at-start-of-drowning-process.patch similarity index 100% rename from Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch rename to Spigot-Server-Patches/0340-Set-Zombie-last-tick-at-start-of-drowning-process.patch diff --git a/Spigot-Server-Patches/0340-Allow-Saving-of-Oversized-Chunks.patch b/Spigot-Server-Patches/0341-Allow-Saving-of-Oversized-Chunks.patch similarity index 98% rename from Spigot-Server-Patches/0340-Allow-Saving-of-Oversized-Chunks.patch rename to Spigot-Server-Patches/0341-Allow-Saving-of-Oversized-Chunks.patch index 4eef91158..b0975133d 100644 --- a/Spigot-Server-Patches/0340-Allow-Saving-of-Oversized-Chunks.patch +++ b/Spigot-Server-Patches/0341-Allow-Saving-of-Oversized-Chunks.patch @@ -31,10 +31,10 @@ this fix, as the data will remain in the oversized file. Once the server returns to a jar with this fix, the data will be restored. diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..2322c0c8c5aacebb6317eab8ce4245554f6d9d55 100644 +index c9be8c7f40917056091f63d36311a10d6302acbb..f48b62af436de47484eb1cf496e97a29168586b0 100644 --- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -@@ -69,6 +69,7 @@ public class NBTCompressedStreamTools { +@@ -70,6 +70,7 @@ public class NBTCompressedStreamTools { } @@ -42,7 +42,7 @@ index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..2322c0c8c5aacebb6317eab8ce424555 public static NBTTagCompound a(DataInputStream datainputstream) throws IOException { return a((DataInput) datainputstream, NBTReadLimiter.a); } -@@ -89,6 +90,7 @@ public class NBTCompressedStreamTools { +@@ -90,6 +91,7 @@ public class NBTCompressedStreamTools { } } diff --git a/Spigot-Server-Patches/0341-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/Spigot-Server-Patches/0342-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 88% rename from Spigot-Server-Patches/0341-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to Spigot-Server-Patches/0342-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index a94c7e1b1..44c6785da 100644 --- a/Spigot-Server-Patches/0341-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/Spigot-Server-Patches/0342-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index ce2cf5f9432c9e20d351914646a78974d1f17b03..e4651eb2a94080bfa431b0b775ae8019fc922538 100644 +index 5c6ea9df899a0649abde8c54e6f844eaf53d27dd..d4048812723bed08e5bb2aadc651a92570d4bb2a 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1049,6 +1049,7 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/0343-Add-LivingEntity-getTargetEntity.patch similarity index 98% rename from Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch rename to Spigot-Server-Patches/0343-Add-LivingEntity-getTargetEntity.patch index f653f441e..82e2cdcb0 100644 --- a/Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-Server-Patches/0343-Add-LivingEntity-getTargetEntity.patch @@ -66,10 +66,10 @@ index 505ba8e298a825ce69cc60c76cb040edeb0acdbd..e87fa15250a57c9b7ed4f4b530289b7b return 0.0F; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 0b4e39d93f28ec5c7835bace2ea969a6e99ac2a3..4c011f93c600d87951fe1dc8bf6b84fac7a532cb 100644 +index ed001440151078e20a449ba073d71e873ff0ad9a..f74e9ffda092ef4a2e30c316e682af154921b5df 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3494,6 +3494,37 @@ public abstract class EntityLiving extends Entity { +@@ -3495,6 +3495,37 @@ public abstract class EntityLiving extends Entity { return world.rayTrace(raytrace); } diff --git a/Spigot-Server-Patches/0343-Use-proper-max-length-when-serialising-BungeeCord-te.patch b/Spigot-Server-Patches/0344-Use-proper-max-length-when-serialising-BungeeCord-te.patch similarity index 100% rename from Spigot-Server-Patches/0343-Use-proper-max-length-when-serialising-BungeeCord-te.patch rename to Spigot-Server-Patches/0344-Use-proper-max-length-when-serialising-BungeeCord-te.patch diff --git a/Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch b/Spigot-Server-Patches/0345-Entity-getEntitySpawnReason.patch similarity index 98% rename from Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch rename to Spigot-Server-Patches/0345-Entity-getEntitySpawnReason.patch index 6fec15969..d14abfca1 100644 --- a/Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch +++ b/Spigot-Server-Patches/0345-Entity-getEntitySpawnReason.patch @@ -59,7 +59,7 @@ index e87fa15250a57c9b7ed4f4b530289b7b28bb7c9c..83dda2bb95d38ff248d635420c0bf12e } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index e4651eb2a94080bfa431b0b775ae8019fc922538..4b8dd6c1a9c796ded5ee0a63ccecebca9ac2b8ca 100644 +index d4048812723bed08e5bb2aadc651a92570d4bb2a..5f520d8a7ad4753bc106ebf9567fbbb8a36ac1d1 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -263,7 +263,7 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch b/Spigot-Server-Patches/0346-Update-entity-Metadata-for-all-tracked-players.patch similarity index 100% rename from Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch rename to Spigot-Server-Patches/0346-Update-entity-Metadata-for-all-tracked-players.patch diff --git a/Spigot-Server-Patches/0346-Implement-PlayerPostRespawnEvent.patch b/Spigot-Server-Patches/0347-Implement-PlayerPostRespawnEvent.patch similarity index 95% rename from Spigot-Server-Patches/0346-Implement-PlayerPostRespawnEvent.patch rename to Spigot-Server-Patches/0347-Implement-PlayerPostRespawnEvent.patch index 085f34bbd..ef396b306 100644 --- a/Spigot-Server-Patches/0346-Implement-PlayerPostRespawnEvent.patch +++ b/Spigot-Server-Patches/0347-Implement-PlayerPostRespawnEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 4b8dd6c1a9c796ded5ee0a63ccecebca9ac2b8ca..8d067082ad52397d11822277438f00a43d7f3e09 100644 +index 5f520d8a7ad4753bc106ebf9567fbbb8a36ac1d1..5b3d2bd35ca3f98b8c04ea841023d68b24b91718 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -665,9 +665,14 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0347-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/Spigot-Server-Patches/0348-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch similarity index 100% rename from Spigot-Server-Patches/0347-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch rename to Spigot-Server-Patches/0348-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch diff --git a/Spigot-Server-Patches/0348-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/0349-Implement-getters-and-setters-for-EntityItem-owner-a.patch similarity index 100% rename from Spigot-Server-Patches/0348-Implement-getters-and-setters-for-EntityItem-owner-a.patch rename to Spigot-Server-Patches/0349-Implement-getters-and-setters-for-EntityItem-owner-a.patch diff --git a/Spigot-Server-Patches/0349-Server-Tick-Events.patch b/Spigot-Server-Patches/0350-Server-Tick-Events.patch similarity index 93% rename from Spigot-Server-Patches/0349-Server-Tick-Events.patch rename to Spigot-Server-Patches/0350-Server-Tick-Events.patch index 8c10f3925..27fb4a978 100644 --- a/Spigot-Server-Patches/0349-Server-Tick-Events.patch +++ b/Spigot-Server-Patches/0350-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 b336cd541b8e3a9ebe3d89a487160d18a294dade..544bc9660b1104e7782bd9e06252d0bd9b2e700d 100644 +index 6b288bc8d4153e12b35f422f171e15a2ef7d0851..060d64c207dc353d6103080f6756ac9501a4ed04 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(this.queue, (long)0.10e6); //0.1ms -+ this.workers[i].setName("Async chunk loader thread #" + i + " for world: " + world.getWorldData().getName()); ++ this.workers[i].setName("Async chunk loader thread #" + i + " for world: " + world.getWorld().getName()); + this.workers[i].setPriority(Thread.NORM_PRIORITY - 1); + this.workers[i].setUncaughtExceptionHandler((final Thread thread, final Throwable throwable) -> { + PaperFileIOThread.LOGGER.fatal("Thread '" + thread.getName() + "' threw an uncaught exception!", throwable); diff --git a/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch b/Spigot-Server-Patches/0379-Use-getChunkIfLoadedImmediately-in-places.patch similarity index 100% rename from Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch rename to Spigot-Server-Patches/0379-Use-getChunkIfLoadedImmediately-in-places.patch diff --git a/Spigot-Server-Patches/0379-Reduce-sync-loads.patch b/Spigot-Server-Patches/0380-Reduce-sync-loads.patch similarity index 100% rename from Spigot-Server-Patches/0379-Reduce-sync-loads.patch rename to Spigot-Server-Patches/0380-Reduce-sync-loads.patch diff --git a/Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch b/Spigot-Server-Patches/0381-Implement-alternative-item-despawn-rate.patch similarity index 97% rename from Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch rename to Spigot-Server-Patches/0381-Implement-alternative-item-despawn-rate.patch index f12dba254..47adb6a10 100644 --- a/Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch +++ b/Spigot-Server-Patches/0381-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 1bbea57d94dfe493741a4b32d5a7b71e6cb77305..f7a52481fa00a45fdebe6715dfde85c0f91fb8c0 100644 +index a6e68b2ab8890d9d2a842ca0a6b565a1831fed6b..cf9d980e61be199a34cff98f805e511f9410dd51 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 1bbea57d94dfe493741a4b32d5a7b71e6cb77305..f7a52481fa00a45fdebe6715dfde85c0 import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -508,4 +513,52 @@ public class PaperWorldConfig { +@@ -514,4 +519,52 @@ public class PaperWorldConfig { private void disableRelativeProjectileVelocity() { disableRelativeProjectileVelocity = getBoolean("game-mechanics.disable-relative-projectile-velocity", false); } diff --git a/Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch b/Spigot-Server-Patches/0382-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch similarity index 96% rename from Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch rename to Spigot-Server-Patches/0382-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch index ef4223df2..0069c641d 100644 --- a/Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch +++ b/Spigot-Server-Patches/0382-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 824e9df675edd664ceb11c8cdb39f035df237ce3..13edd764d79a5974ec58392e70d049172c1090f4 100644 +index 3a9e872922de10b597cc898ba76f3fbfd46e41bb..8b7dcb88e04fbad29538e8d2945020fca02b4143 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 bF; -@@ -3017,6 +3017,11 @@ public abstract class EntityLiving extends Entity { +@@ -3018,6 +3018,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 8dc2e28b2386a3b9512dfcc382f9deb534381392..ce586a89b3d812e5c6ff371c2abcb15d private void u() { if (this.isHandRaised()) { if (ItemStack.d(this.b(this.getRaisedHand()), this.activeItem)) { -@@ -3026,7 +3031,13 @@ public abstract class EntityLiving extends Entity { +@@ -3027,7 +3032,13 @@ public abstract class EntityLiving extends Entity { this.b(this.activeItem, 5); } @@ -46,7 +46,7 @@ index 8dc2e28b2386a3b9512dfcc382f9deb534381392..ce586a89b3d812e5c6ff371c2abcb15d this.s(); } } else { -@@ -3076,7 +3087,10 @@ public abstract class EntityLiving extends Entity { +@@ -3077,7 +3088,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 8dc2e28b2386a3b9512dfcc382f9deb534381392..ce586a89b3d812e5c6ff371c2abcb15d if (!this.world.isClientSide) { this.c(1, true); this.c(2, enumhand == EnumHand.OFF_HAND); -@@ -3100,7 +3114,10 @@ public abstract class EntityLiving extends Entity { +@@ -3101,7 +3115,10 @@ public abstract class EntityLiving extends Entity { } } else if (!this.isHandRaised() && !this.activeItem.isEmpty()) { this.activeItem = ItemStack.b; @@ -70,7 +70,7 @@ index 8dc2e28b2386a3b9512dfcc382f9deb534381392..ce586a89b3d812e5c6ff371c2abcb15d } } -@@ -3222,7 +3239,10 @@ public abstract class EntityLiving extends Entity { +@@ -3223,7 +3240,10 @@ public abstract class EntityLiving extends Entity { } this.activeItem = ItemStack.b; diff --git a/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch index cecf2bb12..18d6ec6a2 100644 --- a/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch +++ b/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch @@ -99,7 +99,7 @@ index dbd7850df45fb9ee550ce33f97bdfe9cf5bfcd34..61323f9b15350b1d227b2f3de67c4084 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 ce586a89b3d812e5c6ff371c2abcb15df8de99d9..3662752ce3a300b1d35b5214a8cf602ab6399edb 100644 +index 415cec5f0435967dccd8df258d116b490a84276f..b1cfd633eb5a3911fbfcfb937b5f7ecc346c6122 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 { diff --git a/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch b/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch index f5237e2f2..04e1d9966 100644 --- a/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch +++ b/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch @@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code Also ignores Enderdragon, defaulting it to Mojang's setting diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index f7e57fd1ce5881c056c104d5a6a9a74e34e3ffc3..fe3aab87de4e1eb60b19352499790fd9b571e169 100644 +index cdb72b225226083ca45ade798f54989422e5281c..0e9de6f12b56db5eb8759798a686ba6c68172323 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1735,6 +1735,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1716,6 +1716,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); int j = entity.getEntityType().getChunkRange() * 16; diff --git a/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch index c49febe09..36d290d29 100644 --- a/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -7,7 +7,7 @@ bypass the need to get a player chunk, then get the either, then unwrap it... diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 1597b7a882769109f467d81ecbadc45ff6779b7e..67d6facd37462beef49dac311019b1977150d73f 100644 +index 707db4febac59a4d09d6420ea2add469cf54c2ec..a5325aef96117d569e95ff4a15650d6a1ab8ac49 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -447,6 +447,12 @@ public class ChunkProviderServer extends IChunkProvider { @@ -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 91f8927892a7c8f4456163d9de5e307f0e15cf54..276c805b60630952bcc1e467bb501926f214ed10 100644 +index 6d3b851f65858f6d768aa64c0bef71e18c45f0a2..ce55c4729024ce9e226d9dd14f7c3ea4bde7ca34 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/0418-Entity-Jump-API.patch b/Spigot-Server-Patches/0418-Entity-Jump-API.patch index 50977959f..4384d36a0 100644 --- a/Spigot-Server-Patches/0418-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 3662752ce3a300b1d35b5214a8cf602ab6399edb..be102d9fed4596f2e53cca102c5a779ded2bf26f 100644 +index b1cfd633eb5a3911fbfcfb937b5f7ecc346c6122..58e14a10f5424fefd7c2e1ce644e1712e49eea62 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2753,8 +2753,10 @@ public abstract class EntityLiving extends Entity { +@@ -2754,8 +2754,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/0419-Add-option-to-nerf-pigmen-from-nether-portals.patch b/Spigot-Server-Patches/0419-Add-option-to-nerf-pigmen-from-nether-portals.patch index c59b4d906..d4f46389d 100644 --- a/Spigot-Server-Patches/0419-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 1757cf8e0883e8908b97e0a7beb1e6ecec10d8e6..4c12e1b65a0e7e1a7aa1bbaf433f4881cef314f2 100644 +index 3a63ed18c38030b7c0f1e681b9066283879592a1..c1f7d7f0db97e1667917a00febabb043cd66dfc8 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -590,4 +590,9 @@ public class PaperWorldConfig { +@@ -591,4 +591,9 @@ public class PaperWorldConfig { disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents); log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled")); } diff --git a/Spigot-Server-Patches/0420-Make-the-GUI-graph-fancier.patch b/Spigot-Server-Patches/0420-Make-the-GUI-graph-fancier.patch index 57daa6a3a..2fc424066 100644 --- a/Spigot-Server-Patches/0420-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 7ca38adcaa619a95c183bed13be566105442afd5..bd39bdcfeec7fb275a8ec80d467bad413e5356ce 100644 +index 620ee43ada7543e21f6c10afec424cff6017f2cd..3681bc9657b2ecbd27bb45153b4e608d077f36dc 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 c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate predicate); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0b6bb4b2a679c6a3589ce30becbf2af498804aff..ea287e9c21ee1b4cf692d8c7b3df530766f2d26a 100644 +index 2f96bf6af8ad4e13bfd9b8b6e00867eb89123a78..870b5352528384b0bb612cd5379683ee142fb99f 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -723,6 +723,7 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch b/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch index 5e3107254..1592f8534 100644 --- a/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch +++ b/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch @@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else. This is safe because Spectators are skipped in unloaded chunks too in vanilla. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 59f5ef6e14b738a408dc8462ba99605ec1ae82e9..52b5c47452a46cd6e61e1dd7c135620e36472c73 100644 +index f39a10a1fee5baf92d661b63c4487140eff244d2..418f8351f603acf1ceffa38d6010fc692b8f66e7 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -472,7 +472,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -466,7 +466,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void playerTick() { try { diff --git a/Spigot-Server-Patches/0436-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 index d15104577..c449e4aa8 100644 --- a/Spigot-Server-Patches/0436-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 @@ -7,7 +7,7 @@ This fixes a lot of game state issues where packets were delayed for processing due to 1.15's new queue but processed while dead. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 8af8676888e4deff66094053d14203c2f5b20ab1..0bf9de73e800cbbe0553bf491cb1546bb1677b63 100644 +index 5ef91da9733fd9276e7bd819a11a0548e01b17f0..2db0cfd6c32c58beadc71d4be487776500c1b8a6 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -952,7 +952,7 @@ public abstract class EntityHuman extends EntityLiving { diff --git a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch index 6241b79ad..c741550e3 100644 --- a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch +++ b/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch @@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..f6ff4d8132a95895680f5bc81f8f873e + } +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index ba9f75bd8f6fe1990d485548f4481bd1762d93af..e14e8bcf235339c1537a1e0a7702a364ee784c93 100644 +index db4ac5658844bcdb5a6a68ed74f862d055a5567d..76084e6dd282da8332bdafbf9a96bcc64827e705 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -756,7 +756,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -741,7 +741,7 @@ public class ChunkProviderServer extends IChunkProvider { entityPlayer.playerNaturallySpawnedEvent.callEvent(); }; // Paper end @@ -70,7 +70,7 @@ index ba9f75bd8f6fe1990d485548f4481bd1762d93af..e14e8bcf235339c1537a1e0a7702a364 if (optional.isPresent()) { diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index b2e8ddc9ff1bf5f519d971455d48a2faad3638f2..2f9c014454cf5fe771c6da84ad4af7e7790fdc7d 100644 +index 9615c4d324e42f7f91a7e60b6151c16d20e9c739..a68e4fc411ae84f12b1ca7443fa66f6325712af8 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -598,7 +598,7 @@ public final class MCUtil { @@ -83,7 +83,7 @@ index b2e8ddc9ff1bf5f519d971455d48a2faad3638f2..2f9c014454cf5fe771c6da84ad4af7e7 List allChunks = new ArrayList<>(visibleChunks.values()); List players = world.players; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index c9be4ae99458863bf91687c3667d67bc6b37b0f0..9d4c5f32036118bf7c5081c55bea71efd606b8f6 100644 +index 00de0d10842006f4fe9f64e136d03fd06fef6d1b..ad4a07283a67ed4db770c59bb5884b9fa3f92b21 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -56,8 +56,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -122,7 +122,7 @@ index c9be4ae99458863bf91687c3667d67bc6b37b0f0..9d4c5f32036118bf7c5081c55bea71ef private final Long2ObjectLinkedOpenHashMap pendingUnload; final LongSet loadedChunks; // Paper - private -> package public final WorldServer world; -@@ -130,7 +155,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -129,7 +154,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier supplier, int i, boolean flag) { super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag); @@ -131,7 +131,7 @@ index c9be4ae99458863bf91687c3667d67bc6b37b0f0..9d4c5f32036118bf7c5081c55bea71ef this.pendingUnload = new Long2ObjectLinkedOpenHashMap(); this.loadedChunks = new LongOpenHashSet(); this.unloadQueue = new LongOpenHashSet(); -@@ -222,9 +247,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -203,9 +228,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return (PlayerChunk) this.updatingChunks.get(i); } @@ -185,7 +185,7 @@ index c9be4ae99458863bf91687c3667d67bc6b37b0f0..9d4c5f32036118bf7c5081c55bea71ef } protected IntSupplier c(long i) { -@@ -412,8 +480,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -393,8 +461,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper end protected void save(boolean flag) { @@ -196,7 +196,7 @@ index c9be4ae99458863bf91687c3667d67bc6b37b0f0..9d4c5f32036118bf7c5081c55bea71ef MutableBoolean mutableboolean = new MutableBoolean(); do { -@@ -441,7 +510,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -422,7 +491,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // this.i(); // Paper - nuke IOWorker PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName()); } else { @@ -205,7 +205,7 @@ index c9be4ae99458863bf91687c3667d67bc6b37b0f0..9d4c5f32036118bf7c5081c55bea71ef IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) { -@@ -612,7 +681,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -593,7 +662,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (!this.updatingChunksModified) { return false; } else { @@ -227,7 +227,7 @@ index c9be4ae99458863bf91687c3667d67bc6b37b0f0..9d4c5f32036118bf7c5081c55bea71ef this.updatingChunksModified = false; return true; } -@@ -1080,12 +1162,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1061,12 +1143,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } protected Iterable f() { diff --git a/Spigot-Server-Patches/0438-Increase-Light-Queue-Size.patch b/Spigot-Server-Patches/0438-Increase-Light-Queue-Size.patch index a9aa089fe..a88ccf7cd 100644 --- a/Spigot-Server-Patches/0438-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 4281c125661c7a717e5a787510f593a16f6ad730..a11d356733901521ee0523629f0cffc1d94391bc 100644 +index 69b3faf28d019fca90734c4d0944ead8fd97ab87..21940f2034744ea417a43fcebc92b21298753d2d 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -616,4 +616,9 @@ public class PaperWorldConfig { +@@ -617,4 +617,9 @@ public class PaperWorldConfig { private void zombieVillagerInfectionChance() { zombieVillagerInfectionChance = getDouble("zombie-villager-infection-chance", zombieVillagerInfectionChance); } @@ -28,7 +28,7 @@ index 4281c125661c7a717e5a787510f593a16f6ad730..a11d356733901521ee0523629f0cffc1 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bd39bdcfeec7fb275a8ec80d467bad413e5356ce..16c9ed590a20279dd21512b29f8f5f64a4be1eff 100644 +index 3681bc9657b2ecbd27bb45153b4e608d077f36dc..962061aa4de1cad05acac4fe09ecedbb81c55d9b 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 optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left(); if (optional.isPresent()) { -@@ -780,6 +782,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -765,6 +767,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.timings.chunkTicks.startTiming(); // Spigot // Paper this.world.a(chunk, k); this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper @@ -92,7 +92,7 @@ index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78 } } } -@@ -936,6 +939,41 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -921,6 +924,41 @@ public class ChunkProviderServer extends IChunkProvider { super.executeTask(runnable); } diff --git a/Spigot-Server-Patches/0440-Don-t-move-existing-players-to-world-spawn.patch b/Spigot-Server-Patches/0440-Don-t-move-existing-players-to-world-spawn.patch index eead6cc50..950ea7f1e 100644 --- a/Spigot-Server-Patches/0440-Don-t-move-existing-players-to-world-spawn.patch +++ b/Spigot-Server-Patches/0440-Don-t-move-existing-players-to-world-spawn.patch @@ -10,10 +10,10 @@ larger than the keep loaded range. By skipping this, we avoid potential for a large spike on server start. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 52b5c47452a46cd6e61e1dd7c135620e36472c73..62f6e507586560355269b54a6c3921296106a3bc 100644 +index 418f8351f603acf1ceffa38d6010fc692b8f66e7..b2a933ff60163527bd19449f8650a86fa144863d 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -118,7 +118,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -113,7 +113,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.serverStatisticManager = minecraftserver.getPlayerList().getStatisticManager(this); this.advancementDataPlayer = minecraftserver.getPlayerList().f(this); this.G = 1.0F; @@ -22,7 +22,7 @@ index 52b5c47452a46cd6e61e1dd7c135620e36472c73..62f6e507586560355269b54a6c392129 this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper -@@ -171,6 +171,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -165,6 +165,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit end @@ -30,7 +30,7 @@ index 52b5c47452a46cd6e61e1dd7c135620e36472c73..62f6e507586560355269b54a6c392129 private void b(WorldServer worldserver) { BlockPosition blockposition = worldserver.getSpawn(); -@@ -346,7 +347,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -340,7 +341,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { position = Vec3D.a(((WorldServer) world).getSpawn()); } this.world = world; @@ -40,7 +40,7 @@ index 52b5c47452a46cd6e61e1dd7c135620e36472c73..62f6e507586560355269b54a6c392129 this.playerInteractManager.a((WorldServer) world); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index ea287e9c21ee1b4cf692d8c7b3df530766f2d26a..7a65b4f2cc6f3430bdad9df95b035ff29c8a2700 100644 +index 870b5352528384b0bb612cd5379683ee142fb99f..0524370c393dff4794abc0dfb28630c533a39ce1 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -134,6 +134,8 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0443-Add-Raw-Byte-ItemStack-Serialization.patch b/Spigot-Server-Patches/0443-Add-Raw-Byte-ItemStack-Serialization.patch index de3da1907..d989df9a5 100644 --- a/Spigot-Server-Patches/0443-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/Spigot-Server-Patches/0443-Add-Raw-Byte-ItemStack-Serialization.patch @@ -30,10 +30,10 @@ index 64150130fa0081786190eada4cd2d1312a51572d..00725529793d6c2fe26ecacf900355b4 try { return new ItemStack(nbttagcompound); diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -index 2322c0c8c5aacebb6317eab8ce4245554f6d9d55..3e6f878cdbbf5ebfa7fb390745ead135c1c4dee8 100644 +index f48b62af436de47484eb1cf496e97a29168586b0..c948e590eeff0aea53573532f8c507d638cc0bdf 100644 --- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -@@ -14,6 +14,7 @@ import java.util.zip.GZIPOutputStream; +@@ -15,6 +15,7 @@ import io.netty.buffer.ByteBufInputStream; // Paper public class NBTCompressedStreamTools { @@ -41,7 +41,7 @@ index 2322c0c8c5aacebb6317eab8ce4245554f6d9d55..3e6f878cdbbf5ebfa7fb390745ead135 public static NBTTagCompound a(InputStream inputstream) throws IOException { DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(inputstream))); Throwable throwable = null; -@@ -43,6 +44,7 @@ public class NBTCompressedStreamTools { +@@ -44,6 +45,7 @@ public class NBTCompressedStreamTools { return nbttagcompound; } diff --git a/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch b/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch index db289a8e7..54af482e2 100644 --- a/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch +++ b/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch @@ -67,7 +67,7 @@ index 95e6a6de7ccfc4445d0ac19c5f874c0d533b1712..cc6e6f245ee5e73bd570cf42381bf55e throwable = throwable.getCause(); } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 4fa8d40d84884f17b4bbcc357a6bb902f8f668cd..22ee001a8d5a3c93303d036daa7ee12a6ec802bb 100644 +index 87753a94792af94454f76a2beb1ab9f1027f514f..4c561181a977fd0244325880bb6a8cd6a54dcacc 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -242,7 +242,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -261,10 +261,10 @@ index f61a2f30e43120beecfa6056c0c14985411d9b7d..3e42cd6ec6ecfc04a6e2e9c96459e1a8 } // Spigot End diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 9d4c5f32036118bf7c5081c55bea71efd606b8f6..ba100e5c96d5279ab5f30c6e10f3cbd7b6b4443e 100644 +index ad4a07283a67ed4db770c59bb5884b9fa3f92b21..295c8e7eeb4fc634aaa2ca788e6540a647755f88 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -486,6 +486,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -467,6 +467,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { MutableBoolean mutableboolean = new MutableBoolean(); do { @@ -273,7 +273,7 @@ index 9d4c5f32036118bf7c5081c55bea71efd606b8f6..ba100e5c96d5279ab5f30c6e10f3cbd7 list.stream().map((playerchunk) -> { CompletableFuture completablefuture; diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7a65b4f2cc6f3430bdad9df95b035ff29c8a2700..a212c3bb7c80948cc329f21c3916f52ec02e06bf 100644 +index 0524370c393dff4794abc0dfb28630c533a39ce1..57f408b7b7a50f057f53c9cbea93adbeba97123c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -430,7 +430,7 @@ public abstract class PlayerList { @@ -286,7 +286,7 @@ index 7a65b4f2cc6f3430bdad9df95b035ff29c8a2700..a212c3bb7c80948cc329f21c3916f52e // Paper start - Remove from collideRule team if needed diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 3299ac0b0115cb1166c1ee449bd49292e553b7af..dc7a4eabf83d5b74ccde170764dcd1e99f958ee0 100644 +index 5579044782f155f587de1e2ea5115bde6053f722..e8075ad6b5395c7dce12741fe85dafd13f72cf41 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java @@ -119,6 +119,7 @@ public class SystemUtils { diff --git a/Spigot-Server-Patches/0452-Prevent-opening-inventories-when-frozen.patch b/Spigot-Server-Patches/0452-Prevent-opening-inventories-when-frozen.patch index eb861c8fa..8dfd1e0e0 100644 --- a/Spigot-Server-Patches/0452-Prevent-opening-inventories-when-frozen.patch +++ b/Spigot-Server-Patches/0452-Prevent-opening-inventories-when-frozen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent opening inventories when frozen diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 62f6e507586560355269b54a6c3921296106a3bc..bfce9d46816cb80272b1825d322231a941b11b58 100644 +index b2a933ff60163527bd19449f8650a86fa144863d..0ecc967e149ef988f0451b2202cd01b85debf74c 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -423,7 +423,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -417,7 +417,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { containerUpdateDelay = world.paperConfig.containerUpdateTickRate; } // Paper end @@ -17,7 +17,7 @@ index 62f6e507586560355269b54a6c3921296106a3bc..bfce9d46816cb80272b1825d322231a9 this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper this.activeContainer = this.defaultContainer; } -@@ -1278,7 +1278,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1272,7 +1272,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } else { // CraftBukkit start this.activeContainer = container; @@ -26,7 +26,7 @@ index 62f6e507586560355269b54a6c3921296106a3bc..bfce9d46816cb80272b1825d322231a9 // CraftBukkit end container.addSlotListener(this); return OptionalInt.of(this.containerCounter); -@@ -2073,7 +2073,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -2066,7 +2066,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } @Override diff --git a/Spigot-Server-Patches/0454-Don-t-run-entity-collision-code-if-not-needed.patch b/Spigot-Server-Patches/0454-Don-t-run-entity-collision-code-if-not-needed.patch index 4d6eff6ae..b40bc1eb3 100644 --- a/Spigot-Server-Patches/0454-Don-t-run-entity-collision-code-if-not-needed.patch +++ b/Spigot-Server-Patches/0454-Don-t-run-entity-collision-code-if-not-needed.patch @@ -7,10 +7,10 @@ Will not run if max entity craming is disabled and the max collisions per entity is less than or equal to 0 diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index be102d9fed4596f2e53cca102c5a779ded2bf26f..9e877999abd8ba4b548dd6e06b04f5f0a99f92dd 100644 +index 58e14a10f5424fefd7c2e1ce644e1712e49eea62..22b033b85f34673928f47a65962d2bb6d34e6976 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2819,10 +2819,16 @@ public abstract class EntityLiving extends Entity { +@@ -2820,10 +2820,16 @@ public abstract class EntityLiving extends Entity { protected void doTick() {} protected void collideNearby() { diff --git a/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch b/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch index c98e68010..97b1e036f 100644 --- a/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch +++ b/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch @@ -133,7 +133,7 @@ index 8f1e8728502d1dcae1fb538875f72460fc926d7c..c879e5d9acd400db5b7fdb770e5f8cc4 this.id = Entity.entityCount.incrementAndGet(); this.passengers = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index ac12d782539a5f502e8996eb39eb2ddbab46f756..43e3755f0fa75b5f72ec620f3f6647ef6bce38c5 100644 +index 96f898acdeae1917a4aaf99ec4a48bccf3904488..73e9859e675902d9fc5942547966b52426a496a2 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -844,6 +844,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { @@ -190,7 +190,7 @@ index 74d4c28246e7db850e6d993e07a84b2a6ca24ce2..24705eef5514bfb078bea6f87e5457e7 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 0c00b0f6e2729467d21272142660319b50adcbf2..cd5d8f892516a8c3746ab315fa3f00eccd165deb 100644 +index d2e7eb96d09fae86c3702a4e1d7905eb5eb96cb8..61206ea84e924bb9a5cb7dde924f70d345c4dfa6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1109,6 +1109,32 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0456-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch b/Spigot-Server-Patches/0456-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch index 368e1ea8c..394cbaf79 100644 --- a/Spigot-Server-Patches/0456-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch +++ b/Spigot-Server-Patches/0456-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch @@ -9,7 +9,7 @@ so inline where possible, and avoid the abstraction of the Either class. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index d1f832db33f21f8ba910d2c0c163af78718d298f..91755cd7313d87bae85584dff140acbc6467428f 100644 +index 638a874a275677ede28953badb387b770c0600d6..e24f3711017aa5194ef7bf4e8d90f150cfb083ff 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -618,21 +618,29 @@ public class ChunkProviderServer extends IChunkProvider { diff --git a/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch b/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch index e95a98c46..c5ffe3b92 100644 --- a/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch +++ b/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch @@ -98,7 +98,7 @@ index 2db0cfd6c32c58beadc71d4be487776500c1b8a6..3fa9e7b52b24629c96436fdd46d4e8c2 protected static final DataWatcherObject br = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); protected static final DataWatcherObject bs = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index bfce9d46816cb80272b1825d322231a941b11b58..ef35e07fd8b27a66710140c1422f88ad512e774f 100644 +index 0ecc967e149ef988f0451b2202cd01b85debf74c..41ec990baa4a2ca149cd6edd16943a9ac27cde91 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -118,7 +118,7 @@ index bfce9d46816cb80272b1825d322231a941b11b58..ef35e07fd8b27a66710140c1422f88ad private long ch = SystemUtils.getMonotonicMillis(); private Entity spectatedEntity; public boolean worldChangeInvuln; -@@ -1682,6 +1683,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1676,6 +1677,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public String locale = null; // CraftBukkit - lowercase // Paper - default to null public void a(PacketPlayInSettings packetplayinsettings) { @@ -158,7 +158,7 @@ index dbc3552d50c4129e1844c8a379ab5ba396645f52..be97a0b01b3272e01ece90172f283e3f return this.e; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 021345ddef4d382021ab8cbba91f4b58851aeabd..6032a67b3f242580d8de5e77554e3ec317d3019d 100644 +index da57b00affb56766ebe25774323d49fed3374af0..0321b54f3defc983f1ebe47bf2888cbba39d102c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,8 @@ diff --git a/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch b/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch index f7dc818e0..24ea52cc2 100644 --- a/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch +++ b/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch @@ -25,10 +25,10 @@ This successfully fixed a reoccurring and highly reproduceable crash for heightmaps. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 91755cd7313d87bae85584dff140acbc6467428f..0080a0cbe58d1a81c434ef97659428c8bf1ec290 100644 +index e24f3711017aa5194ef7bf4e8d90f150cfb083ff..7af4c3e2aaf0775640d51f88b3cf821ba38a950b 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -994,6 +994,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -979,6 +979,7 @@ public class ChunkProviderServer extends IChunkProvider { return super.executeNext() || execChunkTask; // Paper } } finally { @@ -37,10 +37,10 @@ index 91755cd7313d87bae85584dff140acbc6467428f..0080a0cbe58d1a81c434ef97659428c8 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index ba100e5c96d5279ab5f30c6e10f3cbd7b6b4443e..a44702e805c24fba63ef17534032fc29fb4a2c3f 100644 +index 295c8e7eeb4fc634aaa2ca788e6540a647755f88..26230476a107e3f9c12b9ede628173e900d28f18 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -133,6 +133,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -132,6 +132,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }; // CraftBukkit end @@ -49,7 +49,7 @@ index ba100e5c96d5279ab5f30c6e10f3cbd7b6b4443e..a44702e805c24fba63ef17534032fc29 // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); -@@ -995,7 +997,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -976,7 +978,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return Either.left(chunk); }); }, (runnable) -> { diff --git a/Spigot-Server-Patches/0461-Broadcast-join-message-to-console.patch b/Spigot-Server-Patches/0461-Broadcast-join-message-to-console.patch index a1cd06dfc..ee9cb483a 100644 --- a/Spigot-Server-Patches/0461-Broadcast-join-message-to-console.patch +++ b/Spigot-Server-Patches/0461-Broadcast-join-message-to-console.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Broadcast join message to console diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index a212c3bb7c80948cc329f21c3916f52ec02e06bf..769f8c147c8104ab21a33abb1471f76f3729f2b2 100644 +index 57f408b7b7a50f057f53c9cbea93adbeba97123c..607408c48b0afc9944dc384cd2a441d4d8286d8c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -212,9 +212,9 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch index 0b03e2d32..1de373fe3 100644 --- a/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch +++ b/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch @@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick delays anymore. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ef35e07fd8b27a66710140c1422f88ad512e774f..56cf64709ae520287f6687fe7c2f55040cc769a1 100644 +index 41ec990baa4a2ca149cd6edd16943a9ac27cde91..6f26d468bcb68328a3e0ee7f627dc8f21c04cfa8 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -104,6 +104,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -99,6 +99,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public double maxHealthCache; public boolean joining = true; public boolean sentListPacket = false; @@ -40,10 +40,10 @@ index ef35e07fd8b27a66710140c1422f88ad512e774f..56cf64709ae520287f6687fe7c2f5504 // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index a44702e805c24fba63ef17534032fc29fb4a2c3f..ee38ab87ba477e8bf5b739759371439b299f21f3 100644 +index 26230476a107e3f9c12b9ede628173e900d28f18..d0a5335b6315f3c8f8b431f53ad69a53caf9fd63 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1534,6 +1534,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1515,6 +1515,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { .printStackTrace(); return; } @@ -52,7 +52,7 @@ index a44702e805c24fba63ef17534032fc29fb4a2c3f..ee38ab87ba477e8bf5b739759371439b if (!(entity instanceof EntityComplexPart)) { EntityTypes entitytypes = entity.getEntityType(); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 769f8c147c8104ab21a33abb1471f76f3729f2b2..f8c12055330794039347336fe2ab9ab52f413323 100644 +index 607408c48b0afc9944dc384cd2a441d4d8286d8c..8e46faf22b1df8166520bee1c1cf4233ad093822 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -201,6 +201,12 @@ public abstract class PlayerList { @@ -95,8 +95,8 @@ index 769f8c147c8104ab21a33abb1471f76f3729f2b2..f8c12055330794039347336fe2ab9ab5 + // Paper start + } -+ public void onPlayerJoinFinish(EntityPlayer entityplayer, WorldServer worldserver, String s1) { ++ public void onPlayerJoinFinish(EntityPlayer entityplayer, WorldServer worldserver1, String s1) { + // Paper end entityplayer.syncInventory(); // Paper start - Add to collideRule team if needed - final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final Scoreboard scoreboard = this.getServer().getWorldServer(World.OVERWORLD).getScoreboard(); diff --git a/Spigot-Server-Patches/0463-Load-Chunks-for-Login-Asynchronously.patch b/Spigot-Server-Patches/0463-Load-Chunks-for-Login-Asynchronously.patch index d578d77d2..07e65166d 100644 --- a/Spigot-Server-Patches/0463-Load-Chunks-for-Login-Asynchronously.patch +++ b/Spigot-Server-Patches/0463-Load-Chunks-for-Login-Asynchronously.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Load Chunks for Login Asynchronously diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0080a0cbe58d1a81c434ef97659428c8bf1ec290..eebd4c50a7324250d3ebe7060739a71af4243f72 100644 +index 7af4c3e2aaf0775640d51f88b3cf821ba38a950b..4c6b056cb1a2040251acc09ef2eb6bfd893a0300 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -604,7 +604,7 @@ public class ChunkProviderServer extends IChunkProvider { @@ -31,7 +31,7 @@ index c879e5d9acd400db5b7fdb770e5f8cc419e3bb23..228666eccfb924d2844c911e734eef4b public void c(Vec3D vec3d) { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 56cf64709ae520287f6687fe7c2f55040cc769a1..0a5f784e851414f84e5a94b53f5616531f533109 100644 +index 6f26d468bcb68328a3e0ee7f627dc8f21c04cfa8..f816af5c421c21e183435b3d3907883a0480f6fb 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -43,6 +43,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -42,7 +42,7 @@ index 56cf64709ae520287f6687fe7c2f55040cc769a1..0a5f784e851414f84e5a94b53f561653 public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; public final Deque removeQueue = new ArrayDeque<>(); // Paper -@@ -105,6 +106,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -100,6 +101,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean joining = true; public boolean sentListPacket = false; public boolean supressTrackerForLogin = false; // Paper @@ -51,10 +51,10 @@ index 56cf64709ae520287f6687fe7c2f55040cc769a1..0a5f784e851414f84e5a94b53f561653 // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 8c5c57ecd98a286a4992a36effae95596b37fc8a..28a3040ac9cf705d05ec459a29cd7147770389be 100644 +index 50163f7291474062bde81631c9220e8a9f5bb718..ebab6961b752ca0b1c1b28f85abb33c7b4d70e3c 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java -@@ -65,7 +65,7 @@ public class LoginListener implements PacketLoginInListener { +@@ -66,7 +66,7 @@ public class LoginListener implements PacketLoginInListener { } // Paper end } else if (this.g == LoginListener.EnumProtocolState.DELAY_ACCEPT) { @@ -63,7 +63,7 @@ index 8c5c57ecd98a286a4992a36effae95596b37fc8a..28a3040ac9cf705d05ec459a29cd7147 if (entityplayer == null) { this.g = LoginListener.EnumProtocolState.READY_TO_ACCEPT; -@@ -164,7 +164,7 @@ public class LoginListener implements PacketLoginInListener { +@@ -165,7 +165,7 @@ public class LoginListener implements PacketLoginInListener { } this.networkManager.sendPacket(new PacketLoginOutSuccess(this.i)); @@ -110,7 +110,7 @@ index 651ecb50c2b06ca81cb9a2286d77fd41a17b5140..1099a46aa05f12572100994ea251f0d5 this.minecraftServer.getMethodProfiler().enter("keepAlive"); // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index f8c12055330794039347336fe2ab9ab52f413323..e0a95fde93d4a2339831cb8ea0918174e9914e34 100644 +index 8e46faf22b1df8166520bee1c1cf4233ad093822..c263ad3f9f127d798a6c0cdcb3d004171100027e 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -18,6 +18,7 @@ import java.util.Map; diff --git a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch b/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch index 616e67881..884e0323b 100644 --- a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 9e877999abd8ba4b548dd6e06b04f5f0a99f92dd..19e4d9ae15ca77fbcee3b6d6436ba69c80c3b79f 100644 +index 22b033b85f34673928f47a65962d2bb6d34e6976..14606a12c472e0e58f76023a53a4129536ac5cc4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1825,7 +1825,16 @@ public abstract class EntityLiving extends Entity { diff --git a/Spigot-Server-Patches/0466-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch b/Spigot-Server-Patches/0466-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch index a30bd0be7..bd14db1cc 100644 --- a/Spigot-Server-Patches/0466-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch +++ b/Spigot-Server-Patches/0466-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch @@ -14,10 +14,10 @@ Use an ArrayDeque to store this Queue We make sure to also implement a pattern that is recursion safe too. diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index ee38ab87ba477e8bf5b739759371439b299f21f3..b55c94788014b8085b45082162866f0210191622 100644 +index d0a5335b6315f3c8f8b431f53ad69a53caf9fd63..3355e2110d98c7ca514a1abf9461f1bb13ab7a30 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -112,24 +112,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -111,24 +111,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final CallbackExecutor callbackExecutor = new CallbackExecutor(); public static final class CallbackExecutor implements java.util.concurrent.Executor, Runnable { diff --git a/Spigot-Server-Patches/0468-Add-phantom-creative-and-insomniac-controls.patch b/Spigot-Server-Patches/0468-Add-phantom-creative-and-insomniac-controls.patch index 48bc1c6ed..d8a2b711e 100644 --- a/Spigot-Server-Patches/0468-Add-phantom-creative-and-insomniac-controls.patch +++ b/Spigot-Server-Patches/0468-Add-phantom-creative-and-insomniac-controls.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add phantom creative and insomniac controls diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a11d356733901521ee0523629f0cffc1d94391bc..b5535da444b2a3aac783dd12baed88ee80f527e5 100644 +index 21940f2034744ea417a43fcebc92b21298753d2d..dfe4baf1973c38e4a443a2b1d6b1eb19140137e1 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -621,4 +621,11 @@ public class PaperWorldConfig { +@@ -622,4 +622,11 @@ public class PaperWorldConfig { private void lightQueueSize() { lightQueueSize = getInt("light-queue-size", lightQueueSize); } diff --git a/Spigot-Server-Patches/0469-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/Spigot-Server-Patches/0469-Fix-numerous-item-duplication-issues-and-teleport-is.patch index ea4c6ea2e..1282804bf 100644 --- a/Spigot-Server-Patches/0469-Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/Spigot-Server-Patches/0469-Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -66,10 +66,10 @@ index 465abc3d4fe2386aa57565e4441fac7f55e26924..3ff93f1498896ec1c92eb8273fb1e656 public float a(Explosion explosion, IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, float f) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 74c58c3f82a94a3ec5e53c7f92e54cee80dc9e8a..f1893ad3a7bcb1996a0ae590ea33573fe03bcd17 100644 +index 51e9f4a6e09474a7489d2872a800308ee3f02e46..250bccee4a27801b41c50d59e93396c696ab6974 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -542,7 +542,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -557,7 +557,7 @@ public class EntityArmorStand extends EntityLiving { for (i = 0; i < this.handItems.size(); ++i) { itemstack = (ItemStack) this.handItems.get(i); if (!itemstack.isEmpty()) { @@ -78,7 +78,7 @@ index 74c58c3f82a94a3ec5e53c7f92e54cee80dc9e8a..f1893ad3a7bcb1996a0ae590ea33573f this.handItems.set(i, ItemStack.b); } } -@@ -550,7 +550,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -565,7 +565,7 @@ public class EntityArmorStand extends EntityLiving { for (i = 0; i < this.armorItems.size(); ++i) { itemstack = (ItemStack) this.armorItems.get(i); if (!itemstack.isEmpty()) { diff --git a/Spigot-Server-Patches/0470-Implement-Brigadier-Mojang-API.patch b/Spigot-Server-Patches/0470-Implement-Brigadier-Mojang-API.patch index 6320ed5d7..bb6670862 100644 --- a/Spigot-Server-Patches/0470-Implement-Brigadier-Mojang-API.patch +++ b/Spigot-Server-Patches/0470-Implement-Brigadier-Mojang-API.patch @@ -69,7 +69,7 @@ index 4b6f45501106f49f118a93e5027734cdb7ff2727..fa0f247e51c20ea0e3cbaccbc8dbb2a1 public boolean hasPermission(int i) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1099a46aa05f12572100994ea251f0d55c66ef80..37defd033c3377b1166b8e97bbbf9ef1be25a565 100644 +index 1099a46aa05f12572100994ea251f0d55c66ef80..ea314328bbb4512054eb9243453cfce88984fd2b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -584,8 +584,12 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -82,7 +82,7 @@ index 1099a46aa05f12572100994ea251f0d55c66ef80..37defd033c3377b1166b8e97bbbf9ef1 + com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getPlayer(), suggestions, buffer); + suggestEvent.setCancelled(suggestions.isEmpty()); + if (!suggestEvent.callEvent()) return; -+ this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (Suggestions) suggestEvent.getSuggestions())); // CraftBukkit - decompile error // Paper ++ this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (com.mojang.brigadier.suggestion.Suggestions) suggestEvent.getSuggestions())); // CraftBukkit - decompile error // Paper + // Paper end }); }); @@ -92,7 +92,7 @@ index 1099a46aa05f12572100994ea251f0d55c66ef80..37defd033c3377b1166b8e97bbbf9ef1 builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1); completions.forEach(builder::suggest); - player.playerConnection.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), builder.buildFuture().join())); -+ Suggestions suggestions = builder.buildFuture().join(); ++ com.mojang.brigadier.suggestion.Suggestions suggestions = builder.buildFuture().join(); + com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent suggestEvent = new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendSuggestionsEvent(this.getPlayer(), suggestions, buffer); + suggestEvent.setCancelled(suggestions.isEmpty()); + if (!suggestEvent.callEvent()) return; diff --git a/Spigot-Server-Patches/0471-Villager-Restocks-API.patch b/Spigot-Server-Patches/0471-Villager-Restocks-API.patch index e53dcfff6..6353e61e2 100644 --- a/Spigot-Server-Patches/0471-Villager-Restocks-API.patch +++ b/Spigot-Server-Patches/0471-Villager-Restocks-API.patch @@ -5,23 +5,18 @@ Subject: [PATCH] Villager Restocks API diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 8d3811ead268635c4b728f5c9b8dd6c9b8ec6124..86b75e31ea1ed9deecae9756c6f838c302dd8df6 100644 +index 8d3811ead268635c4b728f5c9b8dd6c9b8ec6124..9f28c7e4bd70abc280a8cf3cbf5ccc84246aff12 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -992,4 +992,13 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - - return optional.isPresent() ? i - (Long) optional.get() < 24000L : false; - } -+ -+ // Paper start -+ public int getRestocksToday(){ -+ return this.bL; -+ } -+ public void setRestocksToday(int restocksToday){ -+ this.bL = restocksToday; -+ } -+ // Paper end - } +@@ -44,7 +44,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + private long bH; + private int bI; + private long bJ; +- private int bK; ++ private int bK; public int getRestocksToday(){ return this.bK; } public void setRestocksToday(int restocksToday){ this.bK = restocksToday; } // Paper OBFHELPER + private long bL; + private boolean bM; + private static final ImmutableList> bN = ImmutableList.of(MemoryModuleType.HOME, MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, MemoryModuleType.MEETING_POINT, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.VISIBLE_VILLAGER_BABIES, MemoryModuleType.NEAREST_PLAYERS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.WALK_TARGET, new MemoryModuleType[]{MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.BREED_TARGET, MemoryModuleType.PATH, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.NEAREST_BED, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.NEAREST_HOSTILE, MemoryModuleType.SECONDARY_JOB_SITE, MemoryModuleType.HIDING_PLACE, MemoryModuleType.HEARD_BELL_TIME, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.LAST_SLEPT, MemoryModuleType.LAST_WOKEN, MemoryModuleType.LAST_WORKED_AT_POI, MemoryModuleType.GOLEM_LAST_SEEN_TIME}); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java index fe726e7884c9f091d73c8f5d2cb58a87a16649f8..a8384081c03884c86578dca677914d77441c1863 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java diff --git a/Spigot-Server-Patches/0472-Validate-PickItem-Packet-and-kick-for-invalid.patch b/Spigot-Server-Patches/0472-Validate-PickItem-Packet-and-kick-for-invalid.patch index da017c88e..771e5cd27 100644 --- a/Spigot-Server-Patches/0472-Validate-PickItem-Packet-and-kick-for-invalid.patch +++ b/Spigot-Server-Patches/0472-Validate-PickItem-Packet-and-kick-for-invalid.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 37defd033c3377b1166b8e97bbbf9ef1be25a565..64a948510265b881b2aefdfbdb54ec0d413d2766 100644 +index ea314328bbb4512054eb9243453cfce88984fd2b..2ab3f2ffb7266bc6a566620b4f3db31a98b9208e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -697,7 +697,14 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0474-Sync-position-on-teleportation.patch b/Spigot-Server-Patches/0474-Sync-position-on-teleportation.patch index 8fb536336..deb6decef 100644 --- a/Spigot-Server-Patches/0474-Sync-position-on-teleportation.patch +++ b/Spigot-Server-Patches/0474-Sync-position-on-teleportation.patch @@ -13,7 +13,7 @@ it is triggering a massive movement velocity. This will ensure that the servers position is synchronized anytime player is teleported. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 64a948510265b881b2aefdfbdb54ec0d413d2766..383a9bdec4d476bbde5a7c63a9915d2ed4c136a4 100644 +index 2ab3f2ffb7266bc6a566620b4f3db31a98b9208e..553c7313e2b699be88ea01460fd299421c42b176 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -501,6 +501,7 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0477-Implement-Mob-Goal-API.patch b/Spigot-Server-Patches/0477-Implement-Mob-Goal-API.patch index b64bdc934..66878ad0d 100644 --- a/Spigot-Server-Patches/0477-Implement-Mob-Goal-API.patch +++ b/Spigot-Server-Patches/0477-Implement-Mob-Goal-API.patch @@ -24,10 +24,10 @@ index f578acae6fbe1ad7a0c05b96ba489482687ec1df..2b24688310f14b6a9e3fe04fe8b41cd1 diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java new file mode 100644 -index 0000000000000000000000000000000000000000..9ee1a8d5f494680ac9d4c45d7b1255e28a77c566 +index 0000000000000000000000000000000000000000..4ec476669d98ab2f03859e763cfe55904563238f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -@@ -0,0 +1,345 @@ +@@ -0,0 +1,349 @@ +package com.destroystokyo.paper.entity.ai; + +import com.google.common.collect.BiMap; @@ -251,6 +251,10 @@ index 0000000000000000000000000000000000000000..9ee1a8d5f494680ac9d4c45d7b1255e2 + bukkitMap.put(EntityZombie.class, Zombie.class); + bukkitMap.put(EntityZombieHusk.class, Husk.class); + bukkitMap.put(EntityZombieVillager.class, ZombieVillager.class); ++ bukkitMap.put(EntityHoglin.class, Hoglin.class); ++ bukkitMap.put(EntityPiglin.class, Piglin.class); ++ bukkitMap.put(EntityStrider.class, Strider.class); ++ bukkitMap.put(EntityZoglin.class, Zoglin.class); + } + + public static String getUsableName(Class clazz) { @@ -851,16 +855,12 @@ index 715186249545ab2af5284ef71ab59e5ebccad8e1..7c3a66e5e6c4dece0807cc349a69d79f } diff --git a/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java b/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java new file mode 100644 -index 0000000000000000000000000000000000000000..bca3fa43562d21fc16f0c987b8f3a4abe56278a3 +index 0000000000000000000000000000000000000000..232c382b586b0812c9f7161565c0d382177adf7d --- /dev/null +++ b/src/test/java/com/destroystokyo/paper/entity/ai/VanillaMobGoalTest.java -@@ -0,0 +1,96 @@ +@@ -0,0 +1,103 @@ +package com.destroystokyo.paper.entity.ai; + -+import com.destroystokyo.paper.entity.ai.GoalKey; -+import com.destroystokyo.paper.entity.ai.MobGoalHelper; -+import com.destroystokyo.paper.entity.ai.VanillaGoal; -+ +import net.minecraft.server.EntityInsentient; +import net.minecraft.server.PathfinderGoal; + @@ -882,11 +882,17 @@ index 0000000000000000000000000000000000000000..bca3fa43562d21fc16f0c987b8f3a4ab + + @Test + public void testKeys() { ++ List> deprecated = new ArrayList<>(); + List> keys = new ArrayList<>(); + for (Field field : VanillaGoal.class.getFields()) { + if (field.getType().equals(GoalKey.class)) { + try { -+ keys.add((GoalKey) field.get(null)); ++ GoalKey goalKey = (GoalKey) field.get(null); ++ if (field.getAnnotation(Deprecated.class) != null) { ++ deprecated.add(goalKey); ++ } else { ++ keys.add(goalKey); ++ } + } catch (IllegalAccessException e) { + System.out.println("Skipping " + field.getName() + ": " + e.getMessage()); + } @@ -925,6 +931,11 @@ index 0000000000000000000000000000000000000000..bca3fa43562d21fc16f0c987b8f3a4ab + shouldFail = true; + } + ++ if (deprecated.size() != 0) { ++ System.out.println("Deprecated (might want to remove them at some point): "); ++ deprecated.forEach(System.out::println); ++ } ++ + if (shouldFail) Assert.fail("See above"); + } + @@ -939,12 +950,12 @@ index 0000000000000000000000000000000000000000..bca3fa43562d21fc16f0c987b8f3a4ab + classes = scanResult.getSubclasses("net.minecraft.server.EntityInsentient").loadClasses(); + } + -+ boolean shouldFail =false; ++ boolean shouldFail = false; + for (Class nmsClass : classes) { + Class bukkitClass = MobGoalHelper.toBukkitClass((Class) nmsClass); -+ if(bukkitClass == null) { ++ if (bukkitClass == null) { + shouldFail = true; -+ System.out.println("Missing bukkitMap.put(" + nmsClass.getSimpleName() + ".class, "+nmsClass.getSimpleName().replace("Entity","")+".class);"); ++ System.out.println("Missing bukkitMap.put(" + nmsClass.getSimpleName() + ".class, " + nmsClass.getSimpleName().replace("Entity", "") + ".class);"); + } + } + diff --git a/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch b/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch index 50eee8647..942ac7f30 100644 --- a/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch +++ b/Spigot-Server-Patches/0478-Use-distance-map-to-optimise-entity-tracker.patch @@ -56,10 +56,10 @@ index 3e42cd6ec6ecfc04a6e2e9c96459e1a88e504e39..084f36bb29a3fa28dbac1fa6f50849e5 return i; } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831451f34ee 100644 +index 3355e2110d98c7ca514a1abf9461f1bb13ab7a30..d0459c862f16cdd942148ffd888aeccd2367073c 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -145,21 +145,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -144,21 +144,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); @@ -116,10 +116,10 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 } // Paper end -@@ -196,6 +230,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -194,6 +228,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + this.l = supplier; this.m = new VillagePlace(new File(this.w, "poi"), datafixer, flag, this.world); // Paper this.setViewDistance(i); - this.playerMobDistanceMap = this.world.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper + // Paper start - use distance map to optimise entity tracker + this.playerEntityTrackerTrackMaps = new com.destroystokyo.paper.util.misc.PlayerAreaMap[TRACKING_RANGE_TYPES.length]; + this.entityTrackerTrackRanges = new int[TRACKING_RANGE_TYPES.length]; @@ -161,8 +161,8 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 + // Paper end - use distance map to optimise entity tracker } - public void updatePlayerMobTypeMap(Entity entity) { -@@ -1431,17 +1504,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { +@@ -1412,17 +1485,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } public void movePlayer(EntityPlayer entityplayer) { @@ -181,7 +181,7 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 int i = MathHelper.floor(entityplayer.locX()) >> 4; int j = MathHelper.floor(entityplayer.locZ()) >> 4; -@@ -1557,7 +1620,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1538,7 +1601,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker); @@ -190,7 +190,7 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 if (entity instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer) entity; -@@ -1600,7 +1663,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1581,7 +1644,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { entity.tracker = null; // Paper - We're no longer tracked } @@ -228,7 +228,7 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 List list = Lists.newArrayList(); List list1 = this.world.getPlayers(); -@@ -1668,23 +1761,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1649,23 +1742,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { PacketDebug.a(this.world, chunk.getPos()); List list = Lists.newArrayList(); List list1 = Lists.newArrayList(); @@ -272,7 +272,7 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 Iterator iterator; Entity entity1; -@@ -1722,7 +1823,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1703,7 +1804,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public class EntityTracker { @@ -281,7 +281,7 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 private final Entity tracker; private final int trackingDistance; private SectionPosition e; -@@ -1739,6 +1840,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1720,6 +1821,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.e = SectionPosition.a(entity); } @@ -324,7 +324,7 @@ index b55c94788014b8085b45082162866f0210191622..38d7cfdbf96679fb2a56c3b36f374831 public boolean equals(Object object) { return object instanceof PlayerChunkMap.EntityTracker ? ((PlayerChunkMap.EntityTracker) object).tracker.getId() == this.tracker.getId() : false; } -@@ -1839,7 +1976,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1820,7 +1957,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { int j = entity.getEntityType().getChunkRange() * 16; j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper diff --git a/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch b/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch index 39ef2d3f6..ebbeb73be 100644 --- a/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch +++ b/Spigot-Server-Patches/0479-Optimize-isOutsideRange-to-use-distance-maps.patch @@ -77,7 +77,7 @@ index 32d3887e2542c4ebba4a7498167fbe4b497a71ce..7e57a53ec614a2f7d2672edff9d7c0e0 public String c() { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index eebd4c50a7324250d3ebe7060739a71af4243f72..a6363b73522f9d27534b6e80f4b3789e84316c49 100644 +index 4c6b056cb1a2040251acc09ef2eb6bfd893a0300..c265631a2a581a913ab460f816fc70394eb7323f 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -728,6 +728,36 @@ public class ChunkProviderServer extends IChunkProvider { @@ -117,7 +117,7 @@ index eebd4c50a7324250d3ebe7060739a71af4243f72..a6363b73522f9d27534b6e80f4b3789e this.world.getMethodProfiler().enter("pollingChunks"); int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit -@@ -757,15 +787,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -742,15 +772,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.getMethodProfiler().exit(); //List list = Lists.newArrayList(this.playerChunkMap.f()); // Paper //Collections.shuffle(list); // Paper @@ -134,7 +134,7 @@ index eebd4c50a7324250d3ebe7060739a71af4243f72..a6363b73522f9d27534b6e80f4b3789e final int[] chunksTicked = {0}; this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping Optional optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left(); -@@ -781,9 +803,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -766,9 +788,9 @@ public class ChunkProviderServer extends IChunkProvider { Chunk chunk = (Chunk) optional1.get(); ChunkCoordIntPair chunkcoordintpair = playerchunk.i(); @@ -147,10 +147,10 @@ index eebd4c50a7324250d3ebe7060739a71af4243f72..a6363b73522f9d27534b6e80f4b3789e } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0a5f784e851414f84e5a94b53f5616531f533109..fb2b64628b974758cace770ce6debe5e88318ae8 100644 +index f816af5c421c21e183435b3d3907883a0480f6fb..8177781a9cbba57097c5873fd917ff5d9954ccf8 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -113,6 +113,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -108,6 +108,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet cachedSingleHashSet; // Paper @@ -191,10 +191,10 @@ index 9cb2ff09da0b8832e58eed4d70741853a25c9011..7f660d3c528f5fb4150e4ee8b2991343 // Paper start diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d933bbc4170 100644 +index d0459c862f16cdd942148ffd888aeccd2367073c..74f3ce59cd1e00b5aa330a8f0240626f382d0bc9 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -159,6 +159,17 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -158,6 +158,17 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return MinecraftServer.getServer().applyTrackingRangeScale(vanilla); } // Paper end - use distance map to optimise tracker @@ -212,7 +212,7 @@ index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d93 void addPlayerToDistanceMaps(EntityPlayer player) { int chunkX = MCUtil.getChunkCoordinate(player.locX()); -@@ -172,6 +183,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -171,6 +182,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { trackMap.add(player, chunkX, chunkZ, Math.min(trackRange, this.getEffectiveViewDistance())); } // Paper end - use distance map to optimise entity tracker @@ -222,7 +222,7 @@ index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d93 } void removePlayerFromDistanceMaps(EntityPlayer player) { -@@ -180,6 +194,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -179,6 +193,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerEntityTrackerTrackMaps[i].remove(player); } // Paper end - use distance map to optimise tracker @@ -233,7 +233,7 @@ index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d93 } void updateMaps(EntityPlayer player) { -@@ -194,6 +212,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -193,6 +211,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { trackMap.update(player, chunkX, chunkZ, Math.min(trackRange, this.getEffectiveViewDistance())); } // Paper end - use distance map to optimise entity tracker @@ -243,7 +243,7 @@ index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d93 } // Paper end -@@ -225,7 +246,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -224,7 +245,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.mailboxWorldGen = this.p.a(threadedmailbox, false); this.mailboxMain = this.p.a(mailbox, false); this.lightEngine = new LightEngineThreaded(ilightaccess, this, this.world.getDimensionManager().hasSkyLight(), threadedmailbox1, this.p.a(threadedmailbox1, false)); @@ -252,7 +252,7 @@ index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d93 this.l = supplier; this.m = new VillagePlace(new File(this.w, "poi"), datafixer, flag, this.world); // Paper this.setViewDistance(i); -@@ -269,6 +290,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -267,8 +288,41 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerEntityTrackerTrackMaps[ordinal] = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets); } // Paper end - use distance map to optimise entity tracker @@ -290,16 +290,11 @@ index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d93 + // Paper end - optimise PlayerChunkMap#isOutsideRange } - public void updatePlayerMobTypeMap(Entity entity) { -@@ -288,6 +341,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - return entityPlayer.mobCounts[enumCreatureType.ordinal()]; - } - + private static double getDistanceSquaredFromChunk(ChunkCoordIntPair chunkPos, Entity entity) { return a(chunkPos, entity); } // Paper - OBFHELPER private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { double d0 = (double) (chunkcoordintpair.x * 16 + 8); double d1 = (double) (chunkcoordintpair.z * 16 + 8); -@@ -466,6 +520,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -447,6 +501,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } else { if (playerchunk != null) { playerchunk.a(j); @@ -307,7 +302,7 @@ index 38d7cfdbf96679fb2a56c3b36f374831451f34ee..b55e8f94ef45b526c55bc5ba2a991d93 } if (playerchunk != null) { -@@ -1433,30 +1488,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1414,30 +1469,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return isOutsideOfRange(chunkcoordintpair, false); } diff --git a/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch index 3bb1b60f3..6ad897a5c 100644 --- a/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch +++ b/Spigot-Server-Patches/0481-No-Tick-view-distance-implementation.patch @@ -9,7 +9,7 @@ Per-Player is absent due to difficulty of maintaining the diff required to make it happen. diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java -index d4ebcf8f66197299256bd6b65710a1488c90ea41..a3b41ce5fc70948d4804659a472cb622bb9bbc07 100644 +index c9164dfdb27ddf3709129c8aec54903a1df121ff..e33e889c291d37a821a4fbd40d9aac7bb079de0d 100644 --- a/src/main/java/co/aikar/timings/TimingsExport.java +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -153,7 +153,8 @@ public class TimingsExport extends Thread { @@ -23,10 +23,10 @@ index d4ebcf8f66197299256bd6b65710a1488c90ea41..a3b41ce5fc70948d4804659a472cb622 })); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b5535da444b2a3aac783dd12baed88ee80f527e5..65f9ec884c7e36b7d1340dcfdf186ee0669178e4 100644 +index dfe4baf1973c38e4a443a2b1d6b1eb19140137e1..6b1b4780a8553dfd7da32c3e9e76b142122f6a74 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -628,4 +628,9 @@ public class PaperWorldConfig { +@@ -629,4 +629,9 @@ public class PaperWorldConfig { phantomIgnoreCreative = getBoolean("phantoms-do-not-spawn-on-creative-players", phantomIgnoreCreative); phantomOnlyAttackInsomniacs = getBoolean("phantoms-only-attack-insomniacs", phantomOnlyAttackInsomniacs); } @@ -115,10 +115,10 @@ index 7e57a53ec614a2f7d2672edff9d7c0e0dca42377..c072f61e8c88eac8335acd660d8ff0e2 if (flag1) { ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index fb2b64628b974758cace770ce6debe5e88318ae8..0e3ceb60e503c74fc65b1d08371645ffbb26ef5c 100644 +index 8177781a9cbba57097c5873fd917ff5d9954ccf8..9f2eb5ea511f7b854ff06e321015a464771c86bc 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -115,6 +115,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -110,6 +110,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks @@ -221,7 +221,7 @@ index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698 public CompletableFuture> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e7b0d4947 100644 +index 74f3ce59cd1e00b5aa330a8f0240626f382d0bc9..82ea333f1889d683cf8d5228f18d1d275cc71da3 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -95,7 +95,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -233,7 +233,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e public final WorldLoadListener worldLoadListener; public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER private final AtomicInteger u; -@@ -170,6 +170,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -169,6 +169,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerChunkTickRangeMap; // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -256,7 +256,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e void addPlayerToDistanceMaps(EntityPlayer player) { int chunkX = MCUtil.getChunkCoordinate(player.locX()); -@@ -186,6 +202,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -185,6 +201,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - optimise PlayerChunkMap#isOutsideRange this.playerChunkTickRangeMap.add(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -276,7 +276,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e } void removePlayerFromDistanceMaps(EntityPlayer player) { -@@ -198,6 +227,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -197,6 +226,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerMobSpawnMap.remove(player); this.playerChunkTickRangeMap.remove(player); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -288,7 +288,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e } void updateMaps(EntityPlayer player) { -@@ -215,6 +249,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -214,6 +248,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - optimise PlayerChunkMap#isOutsideRange this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -308,7 +308,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e } // Paper end -@@ -322,6 +369,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -320,6 +367,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } }); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -353,8 +353,8 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e + // Paper end - no-tick view distance } - public void updatePlayerMobTypeMap(Entity entity) { -@@ -1139,15 +1225,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + private static double getDistanceSquaredFromChunk(ChunkCoordIntPair chunkPos, Entity entity) { return a(chunkPos, entity); } // Paper - OBFHELPER +@@ -1120,15 +1206,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { completablefuture1.thenAcceptAsync((either) -> { either.mapLeft((chunk) -> { this.u.getAndIncrement(); @@ -372,11 +372,13 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e }); return completablefuture1; } -@@ -1243,31 +1325,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1223,32 +1305,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + } } - protected void setViewDistance(int i) { +- protected void setViewDistance(int i) { - int j = MathHelper.clamp(i + 1, 3, 33); ++ public void setViewDistance(int i) { // Paper - public + int j = MathHelper.clamp(i + 1, 3, 33); // Paper - diff on change, these make the lower view distance limit 2 and the upper 32 if (j != this.viewDistance) { @@ -424,7 +426,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e protected void sendChunk(EntityPlayer entityplayer, ChunkCoordIntPair chunkcoordintpair, Packet[] apacket, boolean flag, boolean flag1) { if (entityplayer.world == this.world) { -@@ -1275,7 +1363,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1256,7 +1344,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { PlayerChunk playerchunk = this.getVisibleChunk(chunkcoordintpair.pair()); if (playerchunk != null) { @@ -433,7 +435,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e if (chunk != null) { this.a(entityplayer, apacket, chunk); -@@ -1536,6 +1624,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1517,6 +1605,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Paper end - optimise isOutsideOfRange @@ -441,7 +443,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e private boolean b(EntityPlayer entityplayer) { return entityplayer.isSpectator() && !this.world.getGameRules().getBoolean(GameRules.SPECTATORS_GENERATE_CHUNKS); } -@@ -1563,13 +1652,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1544,13 +1633,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps } @@ -456,7 +458,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e } -@@ -1577,7 +1660,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1558,7 +1641,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { SectionPosition sectionposition = SectionPosition.a((Entity) entityplayer); entityplayer.a(sectionposition); @@ -465,7 +467,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e return sectionposition; } -@@ -1622,6 +1705,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1603,6 +1686,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { int k1; int l1; @@ -473,7 +475,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e if (Math.abs(i1 - i) <= this.viewDistance * 2 && Math.abs(j1 - j) <= this.viewDistance * 2) { k1 = Math.min(i, i1) - this.viewDistance; l1 = Math.min(j, j1) - this.viewDistance; -@@ -1659,7 +1743,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1640,7 +1724,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.sendChunk(entityplayer, chunkcoordintpair1, new Packet[2], false, true); } } @@ -482,7 +484,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e this.updateMaps(entityplayer); // Paper - distance maps -@@ -1667,11 +1751,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1648,11 +1732,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Override public Stream a(ChunkCoordIntPair chunkcoordintpair, boolean flag) { @@ -533,7 +535,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e } protected void addEntity(Entity entity) { -@@ -1829,6 +1948,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1810,6 +1929,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } @@ -541,7 +543,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e private void a(EntityPlayer entityplayer, Packet[] apacket, Chunk chunk) { if (apacket[0] == null) { apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, true); -@@ -2014,7 +2134,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1995,7 +2115,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ); PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair()); @@ -551,7 +553,7 @@ index b55e8f94ef45b526c55bc5ba2a991d933bbc4170..6cde6d684f6a3ced1eb2aa554559672e } } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index e0a95fde93d4a2339831cb8ea0918174e9914e34..bdee3540b675f8036c5c6a59d6f53057bbdd6a85 100644 +index c263ad3f9f127d798a6c0cdcb3d004171100027e..1514d24ae0da9fd9622333ff8702a0da140bd691 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -176,7 +176,7 @@ public abstract class PlayerList { @@ -582,7 +584,7 @@ index e0a95fde93d4a2339831cb8ea0918174e9914e34..bdee3540b675f8036c5c6a59d6f53057 while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cd5d8f892516a8c3746ab315fa3f00eccd165deb..7fcf3d8b7decfa2e1df2f28fbecef9de8887c724 100644 +index 61206ea84e924bb9a5cb7dde924f70d345c4dfa6..6b74ba5241c9eaf7d9531dbcae4bbc4796979fa2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -506,8 +506,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -646,7 +648,7 @@ index e044534d3cb47cf1228c5e5fa8920df8264fd0b5..745633509d3f948d46529d5439ec14cd private final Spigot spigot = new Spigot() { diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index 97af8f8e3c48694c390036bb1455e6d22fcd1c49..901aac23ae2878f4b05e986e8a363b95371ca6c3 100644 +index 5dcc1ba547db7cc53a08426a7ad119ae88690136..f78e44e05f7a97a7da190aa4b5aa6fb8340728ea 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -201,7 +201,7 @@ public class ActivationRange diff --git a/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch b/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch index ada8c81cd..1709aec59 100644 --- a/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch +++ b/Spigot-Server-Patches/0482-Add-villager-reputation-API.patch @@ -20,7 +20,7 @@ index 0000000000000000000000000000000000000000..0f10c333d88f2e1c56a6c7f22d421084 + } +} diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 86b75e31ea1ed9deecae9756c6f838c302dd8df6..91c19ee2926957c530b3ebc7680eeea451464e24 100644 +index 9f28c7e4bd70abc280a8cf3cbf5ccc84246aff12..bf019043a9338aca8d91da809f1d5520531386e7 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -959,6 +959,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation diff --git a/Spigot-Server-Patches/0483-Fix-Light-Command.patch b/Spigot-Server-Patches/0483-Fix-Light-Command.patch index 83aced771..aa628605d 100644 --- a/Spigot-Server-Patches/0483-Fix-Light-Command.patch +++ b/Spigot-Server-Patches/0483-Fix-Light-Command.patch @@ -136,7 +136,7 @@ index 40347212ad1bcf857d5b8ddb0ee6a698e2568201..e5751adde516544722b95016f64b2a46 // Paper start - per player view distance // there can be potential desync with player's last mapped section and the view distance map, so use the diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 6cde6d684f6a3ced1eb2aa554559672e7b0d4947..31f122aeef8df2eae5e8aab12f0b3316a67daa3b 100644 +index ecc5992beebbc7088b3c398ec7c2e85e9fdf2ed9..044f7a101a8154759f7469b8a864ea09a7919853 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -96,6 +96,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -152,7 +152,7 @@ index 6cde6d684f6a3ced1eb2aa554559672e7b0d4947..31f122aeef8df2eae5e8aab12f0b3316 public final WorldLoadListener worldLoadListener; public final PlayerChunkMap.a chunkDistanceManager; public final PlayerChunkMap.a getChunkMapDistanceManager() { return this.chunkDistanceManager; } // Paper - OBFHELPER private final AtomicInteger u; -@@ -287,11 +293,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -286,11 +292,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { Mailbox mailbox = Mailbox.a("main", iasynctaskhandler::a); this.worldLoadListener = worldloadlistener; diff --git a/Spigot-Server-Patches/0488-Wait-for-Async-Tasks-during-shutdown.patch b/Spigot-Server-Patches/0488-Wait-for-Async-Tasks-during-shutdown.patch index 5da518c14..76948ca42 100644 --- a/Spigot-Server-Patches/0488-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 9745f0812b65d9137458741ca5803324670deeef..96e617049ab7c69a0d8ffbade894f187566c21b1 100644 +index 084f36bb29a3fa28dbac1fa6f50849e5722ab9fe..e1d8a0e885cc9d7270c973cf947b4ab09f9e200b 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 newState) -> { -@@ -1955,12 +1955,112 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1936,12 +1936,112 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } diff --git a/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index bba3a8063..1b441a47c 100644 --- a/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/Spigot-Server-Patches/0497-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -23,7 +23,7 @@ Chunks in front of the player have higher priority, to help with fast traveling players keep up with their movement. diff --git a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java -index b5c2e1f4a2b5fdcaa6bb01f4b3b6847cd5b73ae8..6209b33d8497ec56bbde507e523db0649c66f590 100644 +index 49a594e5f345096cb3b9913b8ee2760795c5f012..bcb7ce2692c5bc1a6214c3a384949666107864fb 100644 --- a/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java +++ b/src/main/java/com/destroystokyo/paper/io/chunk/ChunkTaskManager.java @@ -4,7 +4,10 @@ import com.destroystokyo.paper.io.PaperFileIOThread; @@ -484,7 +484,7 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..4c4108705e9d25912e57a7b3c28b4f1a protected int c(long i) { return this.a.get(i); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index a6363b73522f9d27534b6e80f4b3789e84316c49..604e7004b659daed2844ba1a76bf09288ec549e5 100644 +index c265631a2a581a913ab460f816fc70394eb7323f..a165b863003fddef179f95b2d987ac7873ede1e8 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -443,6 +443,26 @@ public class ChunkProviderServer extends IChunkProvider { @@ -570,7 +570,7 @@ index a6363b73522f9d27534b6e80f4b3789e84316c49..604e7004b659daed2844ba1a76bf0928 boolean flag1 = this.playerChunkMap.b(); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0e3ceb60e503c74fc65b1d08371645ffbb26ef5c..d5740a25bb487fc186333e908968c6a23a9b5005 100644 +index 9f2eb5ea511f7b854ff06e321015a464771c86bc..c4295e4f2753111764ef0ca8f079aec145d4e87c 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -55,6 +55,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -586,9 +586,9 @@ index 0e3ceb60e503c74fc65b1d08371645ffbb26ef5c..d5740a25bb487fc186333e908968c6a2 private float lastHealthSent = -1.0E8F; private int lastFoodSent = -99999999; private boolean lastSentSaturationZero = true; -@@ -136,6 +142,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -130,6 +136,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + this.canPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); - this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper } + // Paper start + public BlockPosition getPointInFront(double inFront) { @@ -608,7 +608,7 @@ index 0e3ceb60e503c74fc65b1d08371645ffbb26ef5c..d5740a25bb487fc186333e908968c6a2 // Yes, this doesn't match Vanilla, but it's the best we can do for now. // If this is an issue, PRs are welcome -@@ -484,6 +505,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -478,6 +499,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (valid && !this.isSpectator() || this.world.isLoaded(this.getChunkCoordinates())) { // Paper - don't tick dead players that are not in the world currently (pending respawn) super.tick(); } @@ -882,7 +882,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb60426067b2ba89 100644 +index 7cba79ce0b3718b73fd7fd839732d1a7ef85941e..9419cb575fde265718eafe20bbe8a592e862f6d5 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -51,6 +51,7 @@ import org.apache.commons.lang3.mutable.MutableBoolean; @@ -901,7 +901,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 public final ChunkGenerator chunkGenerator; private final Supplier l; public final Supplier getWorldPersistentDataSupplier() { return this.l; } // Paper - OBFHELPER private final VillagePlace m; -@@ -125,6 +127,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -124,6 +126,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Override public void execute(Runnable runnable) { @@ -909,7 +909,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 if (queued == null) { queued = new java.util.ArrayDeque<>(); } -@@ -133,6 +136,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -132,6 +135,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Override public void run() { @@ -917,7 +917,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 if (queued == null) { return; } -@@ -287,6 +291,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -286,6 +290,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.world = worldserver; this.chunkGenerator = chunkgenerator; this.executor = iasynctaskhandler; @@ -933,7 +933,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 ThreadedMailbox threadedmailbox = ThreadedMailbox.a(executor, "worldgen"); iasynctaskhandler.getClass(); -@@ -381,6 +394,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -379,6 +392,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerViewDistanceTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet newState) -> { @@ -941,7 +941,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 if (newState.size() != 1) { return; } -@@ -399,7 +413,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -397,7 +411,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(rangeX, rangeZ); PlayerChunkMap.this.world.getChunkProvider().removeTicketAtLevel(TicketType.PLAYER, chunkPos, 31, chunkPos); // entity ticking level, TODO check on update @@ -954,7 +954,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 this.playerViewDistanceNoTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets); this.playerViewDistanceBroadcastMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -@@ -416,6 +434,116 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -414,6 +432,116 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }); // Paper end - no-tick view distance } @@ -1069,9 +1069,9 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 + } + // Paper end - public void updatePlayerMobTypeMap(Entity entity) { - if (!this.world.paperConfig.perPlayerMobSpawns) { -@@ -545,6 +673,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + private static double getDistanceSquaredFromChunk(ChunkCoordIntPair chunkPos, Entity entity) { return a(chunkPos, entity); } // Paper - OBFHELPER + private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { +@@ -526,6 +654,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { List>> list = Lists.newArrayList(); int j = chunkcoordintpair.x; int k = chunkcoordintpair.z; @@ -1079,7 +1079,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 for (int l = -i; l <= i; ++l) { for (int i1 = -i; i1 <= i; ++i1) { -@@ -563,6 +692,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -544,6 +673,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ChunkStatus chunkstatus = (ChunkStatus) intfunction.apply(j1); CompletableFuture> completablefuture = playerchunk.a(chunkstatus, this); @@ -1094,7 +1094,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 list.add(completablefuture); } -@@ -1027,14 +1164,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1008,14 +1145,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }; CompletableFuture chunkSaveFuture = this.world.asyncChunkTaskManager.getChunkSaveFuture(chunkcoordintpair.x, chunkcoordintpair.z); @@ -1122,7 +1122,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 return ret; // Paper end } -@@ -1171,7 +1316,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1152,7 +1297,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { long i = playerchunk.i().pair(); playerchunk.getClass(); @@ -1132,7 +1132,7 @@ index 45e89468d72adba2cf7c079a12b8f3848f56e807..1eb138f003730f9d1048683beb604260 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 383a9bdec4d476bbde5a7c63a9915d2ed4c136a4..e34290011bb5d7bcfb677b70fdec1a525a082e0e 100644 +index 553c7313e2b699be88ea01460fd299421c42b176..66dd1b3bfeebab8dd0f4e823dd0daea903343413 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1301,6 +1301,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -1144,7 +1144,7 @@ index 383a9bdec4d476bbde5a7c63a9915d2ed4c136a4..e34290011bb5d7bcfb677b70fdec1a52 } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index bdee3540b675f8036c5c6a59d6f53057bbdd6a85..34e218f054eee7d3e2ea064e0758d93f140f270b 100644 +index 1514d24ae0da9fd9622333ff8702a0da140bd691..84707b373bcd9c4eb302b149f242435edfc91f2e 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -199,8 +199,8 @@ public abstract class PlayerList { @@ -1231,7 +1231,7 @@ 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 6032a67b3f242580d8de5e77554e3ec317d3019d..b602fc8e7747b839a853310c5d5592d3ac4c0855 100644 +index 0321b54f3defc983f1ebe47bf2888cbba39d102c..1b84d4f26da310c94510fa4c0da9a68ec8c6b71c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -742,6 +742,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch b/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch index d4b5d55f7..2050876f0 100644 --- a/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch +++ b/Spigot-Server-Patches/0499-Optimize-sending-packets-to-nearby-locations-sounds-.patch @@ -11,7 +11,7 @@ This will drastically cut down on packet sending cost for worlds with lots of players in them. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 34e218f054eee7d3e2ea064e0758d93f140f270b..54d5bb4309600ed87a6f7dfc64415fb8854c0f75 100644 +index 84707b373bcd9c4eb302b149f242435edfc91f2e..9f4d9ee0100bca5f62f6a3778257e4da97ca2d28 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1062,16 +1062,40 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch b/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch index bbd4ac1ce..58a948c24 100644 --- a/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch +++ b/Spigot-Server-Patches/0500-Improve-Chunk-Status-Transition-Speed.patch @@ -54,10 +54,10 @@ index 04dea2c9fd9337631a6289c7242338e166d6bc1e..446c401b3139f8c6c0e70d883340f014 // Paper start - no-tick view distance public final Chunk getSendingChunk() { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 1eb138f003730f9d1048683beb60426067b2ba89..e9703cee3b175b220917b83d80e9904b1af17abe 100644 +index 9419cb575fde265718eafe20bbe8a592e862f6d5..bf60b43bf3cb75b7545193958e5508415fa55986 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -740,7 +740,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -721,7 +721,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return either.mapLeft((list) -> { return (Chunk) list.get(list.size() / 2); }); @@ -66,7 +66,7 @@ index 1eb138f003730f9d1048683beb60426067b2ba89..e9703cee3b175b220917b83d80e9904b } @Nullable -@@ -1090,7 +1090,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1071,7 +1071,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { IChunkAccess ichunkaccess = (IChunkAccess) optional.get(); if (ichunkaccess.getChunkStatus().b(chunkstatus)) { @@ -75,7 +75,7 @@ index 1eb138f003730f9d1048683beb60426067b2ba89..e9703cee3b175b220917b83d80e9904b if (chunkstatus == ChunkStatus.LIGHT) { completablefuture1 = this.b(playerchunk, chunkstatus); -@@ -1106,7 +1106,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1087,7 +1087,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return this.b(playerchunk, chunkstatus); } } @@ -84,7 +84,7 @@ index 1eb138f003730f9d1048683beb60426067b2ba89..e9703cee3b175b220917b83d80e9904b } } -@@ -1224,6 +1224,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1205,6 +1205,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); }); }, (runnable) -> { diff --git a/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch b/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch index 04e66be87..3f222f605 100644 --- a/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch +++ b/Spigot-Server-Patches/0505-Optimize-Light-Engine.patch @@ -25,10 +25,10 @@ Massive update to light to improve performance and chunk loading/generation. 8) Fix NPE risk that crashes server in getting nibble data diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 604e7004b659daed2844ba1a76bf09288ec549e5..ef980f9859d1d7d0d5e13d0d70e998055f92135e 100644 +index a165b863003fddef179f95b2d987ac7873ede1e8..70fdce2946b94fad32cd7d31f990c4d7916a6e53 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -1044,7 +1044,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -1029,7 +1029,7 @@ public class ChunkProviderServer extends IChunkProvider { if (ChunkProviderServer.this.tickDistanceManager()) { return true; } else { @@ -1281,10 +1281,10 @@ index 446c401b3139f8c6c0e70d883340f0140d94b752..a3bce8f13bf278af2d6870891daa9bf6 if (getCurrentPriority() != priority) { this.v.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index e9703cee3b175b220917b83d80e9904b1af17abe..3b2c3d55ef7bd31d8562623fe40d76c9d4eee7c8 100644 +index bf60b43bf3cb75b7545193958e5508415fa55986..46f8fe23cf4442334d344365baba77b2a6394e1b 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -653,6 +653,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -634,6 +634,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper end } diff --git a/Spigot-Server-Patches/0506-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/Spigot-Server-Patches/0506-Delay-Chunk-Unloads-based-on-Player-Movement.patch index a2cfef729..6c2d7d593 100644 --- a/Spigot-Server-Patches/0506-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 65f9ec884c7e36b7d1340dcfdf186ee0669178e4..b04fe735839de47e4101dade366a668c9237f6b6 100644 +index 6b1b4780a8553dfd7da32c3e9e76b142122f6a74..c1e36576d572b779500d2cb2566076be894ca8a2 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -633,4 +633,13 @@ public class PaperWorldConfig { +@@ -634,4 +634,13 @@ public class PaperWorldConfig { private void viewDistance() { this.noTickViewDistance = this.getInt("viewdistances.no-tick-view-distance", -1); } diff --git a/Spigot-Server-Patches/0512-Prevent-position-desync-in-playerconnection-causing-.patch b/Spigot-Server-Patches/0512-Prevent-position-desync-in-playerconnection-causing-.patch index faf47ee8f..3521403e1 100644 --- a/Spigot-Server-Patches/0512-Prevent-position-desync-in-playerconnection-causing-.patch +++ b/Spigot-Server-Patches/0512-Prevent-position-desync-in-playerconnection-causing-.patch @@ -14,7 +14,7 @@ behaviour, we need to move all of this dangerous logic outside of the move call and into an appropriate place in the tick method. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e34290011bb5d7bcfb677b70fdec1a525a082e0e..bcb0ea6704b185a41f92d6cab24e4cf4ff91ebbc 100644 +index 66dd1b3bfeebab8dd0f4e823dd0daea903343413..0cb2efb10694c81786a95301f3da86121ea27b17 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1097,6 +1097,11 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0513-Fix-enderdragon-exp-dupe.patch b/Spigot-Server-Patches/0513-Fix-enderdragon-exp-dupe.patch index 9fcd5db58..654d69e3c 100644 --- a/Spigot-Server-Patches/0513-Fix-enderdragon-exp-dupe.patch +++ b/Spigot-Server-Patches/0513-Fix-enderdragon-exp-dupe.patch @@ -7,7 +7,7 @@ Properly track death stage when unloading/loading in the dragon diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 43e3755f0fa75b5f72ec620f3f6647ef6bce38c5..3a37e481729abc890cb2f9884b8501f630c3cf32 100644 +index 73e9859e675902d9fc5942547966b52426a496a2..63a759cc18b5b765bc9d34f71dd775fd35dee280 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -830,6 +830,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { diff --git a/Spigot-Server-Patches/0516-Add-and-implement-PlayerRecipeBookClickEvent.patch b/Spigot-Server-Patches/0516-Add-and-implement-PlayerRecipeBookClickEvent.patch index d7f11254f..a36bc5878 100644 --- a/Spigot-Server-Patches/0516-Add-and-implement-PlayerRecipeBookClickEvent.patch +++ b/Spigot-Server-Patches/0516-Add-and-implement-PlayerRecipeBookClickEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index bcb0ea6704b185a41f92d6cab24e4cf4ff91ebbc..92802301e420da4eb64b0d942f914ee30c9b784b 100644 +index 0cb2efb10694c81786a95301f3da86121ea27b17..eeb870107031b38e25b5fb85ea731a7db1d6c2d1 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2515,9 +2515,15 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0383-implement-optional-per-player-mob-spawns.patch b/removed/1.16/0384-implement-optional-per-player-mob-spawns.patch similarity index 99% rename from Spigot-Server-Patches/0383-implement-optional-per-player-mob-spawns.patch rename to removed/1.16/0384-implement-optional-per-player-mob-spawns.patch index 8a0e0c71d..8fa2daabd 100644 --- a/Spigot-Server-Patches/0383-implement-optional-per-player-mob-spawns.patch +++ b/removed/1.16/0384-implement-optional-per-player-mob-spawns.patch @@ -5,10 +5,10 @@ Subject: [PATCH] implement optional per player mob spawns diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -index 98acbfa44dd9042b26fdf719d7748f92d201c928..a94ebf7c76f167d3b66f7d243910c13d4bfaaba3 100644 +index a27dc38d1a29ed1d63d2f44b7984c2b65be487d9..96aaaab5b7685c874463505f9d25e8a0a01a6e7c 100644 --- a/src/main/java/co/aikar/timings/WorldTimingsHandler.java +++ b/src/main/java/co/aikar/timings/WorldTimingsHandler.java -@@ -56,6 +56,7 @@ public class WorldTimingsHandler { +@@ -57,6 +57,7 @@ public class WorldTimingsHandler { public final Timing miscMobSpawning; @@ -16,7 +16,7 @@ index 98acbfa44dd9042b26fdf719d7748f92d201c928..a94ebf7c76f167d3b66f7d243910c13d public final Timing poiUnload; public final Timing chunkUnload; -@@ -121,6 +122,7 @@ public class WorldTimingsHandler { +@@ -122,6 +123,7 @@ public class WorldTimingsHandler { miscMobSpawning = Timings.ofSafe(name + "Mob spawning - Misc"); @@ -25,10 +25,10 @@ index 98acbfa44dd9042b26fdf719d7748f92d201c928..a94ebf7c76f167d3b66f7d243910c13d poiUnload = Timings.ofSafe(name + "Chunk unload - POI"); chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk"); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index f7a52481fa00a45fdebe6715dfde85c0f91fb8c0..884549b7a0f3c8084bdf9da98611e8abc942cf45 100644 +index cf9d980e61be199a34cff98f805e511f9410dd51..3d9a48e56194225cf39e31d13d26ec17afedadaf 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -561,4 +561,9 @@ public class PaperWorldConfig { +@@ -567,4 +567,9 @@ public class PaperWorldConfig { } } }