diff --git a/build-data/paper.at b/build-data/paper.at index 1417e2a6c..2790d4094 100644 --- a/build-data/paper.at +++ b/build-data/paper.at @@ -259,3 +259,6 @@ public net.minecraft.world.level.block.state.BlockBehaviour hasCollision # add per world spawn limits public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES + +# Optimize isValidLocation +public net.minecraft.world.level.chunk.LevelChunkSection states diff --git a/patches/unapplied/api/0009-Add-getTPS-method.patch b/patches/api/0009-Add-getTPS-method.patch similarity index 100% rename from patches/unapplied/api/0009-Add-getTPS-method.patch rename to patches/api/0009-Add-getTPS-method.patch diff --git a/patches/api/0009-Version-Command-2.0.patch b/patches/api/0010-Version-Command-2.0.patch similarity index 100% rename from patches/api/0009-Version-Command-2.0.patch rename to patches/api/0010-Version-Command-2.0.patch diff --git a/patches/unapplied/api/0010-Entity-Origin-API.patch b/patches/api/0011-Entity-Origin-API.patch similarity index 96% rename from patches/unapplied/api/0010-Entity-Origin-API.patch rename to patches/api/0011-Entity-Origin-API.patch index 3feb6b236..0613d66e9 100644 --- a/patches/unapplied/api/0010-Entity-Origin-API.patch +++ b/patches/api/0011-Entity-Origin-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 03d8ac1b41659540d7eb3d7e218cdfaa4acb683b..7e0ec58ea1d23501f0273882ebae8e45513b02cf 100644 +index 10cb6088c4618f228c757f4e592b44edab81c2dc..65088203d29798efe211612dfadb356f457ed466 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -663,5 +663,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/patches/unapplied/api/0012-Add-PlayerLocaleChangeEvent.patch b/patches/api/0012-Add-PlayerLocaleChangeEvent.patch similarity index 100% rename from patches/unapplied/api/0012-Add-PlayerLocaleChangeEvent.patch rename to patches/api/0012-Add-PlayerLocaleChangeEvent.patch diff --git a/patches/unapplied/api/0013-Add-view-distance-API.patch b/patches/api/0013-Add-view-distance-API.patch similarity index 97% rename from patches/unapplied/api/0013-Add-view-distance-API.patch rename to patches/api/0013-Add-view-distance-API.patch index 7e5aec02a..950a31e27 100644 --- a/patches/unapplied/api/0013-Add-view-distance-API.patch +++ b/patches/api/0013-Add-view-distance-API.patch @@ -65,7 +65,7 @@ index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d public class Spigot { diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 3fa8a69376cf6d5cc5987fea5cbbce228b1408d1..e0254ef7412b4935edd0c4b9801d8eccca7d4a0c 100644 +index 6ec4b1408dbbe31f0f06e72d81f142e57b1d5cee..08979f50d125a62d05389da86f08f5ac77e48b11 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -1489,6 +1489,62 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/patches/unapplied/api/0014-Add-BeaconEffectEvent.patch b/patches/api/0014-Add-BeaconEffectEvent.patch similarity index 100% rename from patches/unapplied/api/0014-Add-BeaconEffectEvent.patch rename to patches/api/0014-Add-BeaconEffectEvent.patch diff --git a/patches/unapplied/api/0015-Add-PlayerInitialSpawnEvent.patch b/patches/api/0015-Add-PlayerInitialSpawnEvent.patch similarity index 100% rename from patches/unapplied/api/0015-Add-PlayerInitialSpawnEvent.patch rename to patches/api/0015-Add-PlayerInitialSpawnEvent.patch diff --git a/patches/unapplied/api/0016-Automatically-disable-plugins-that-fail-to-load.patch b/patches/api/0016-Automatically-disable-plugins-that-fail-to-load.patch similarity index 100% rename from patches/unapplied/api/0016-Automatically-disable-plugins-that-fail-to-load.patch rename to patches/api/0016-Automatically-disable-plugins-that-fail-to-load.patch diff --git a/patches/unapplied/api/0017-Expose-server-CommandMap.patch b/patches/api/0017-Expose-server-CommandMap.patch similarity index 100% rename from patches/unapplied/api/0017-Expose-server-CommandMap.patch rename to patches/api/0017-Expose-server-CommandMap.patch diff --git a/patches/unapplied/api/0018-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch b/patches/api/0018-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch similarity index 94% rename from patches/unapplied/api/0018-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch rename to patches/api/0018-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch index c692f183a..fae395839 100644 --- a/patches/unapplied/api/0018-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch +++ b/patches/api/0018-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses Change Javadoc to be accurate diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 574ecfe2e4f576f80b519f04e740fa00530a7cfa..9fca4fb1cbf5a098e023eeba947f7cf4a3151a0d 100644 +index 7da8180e4408a233af334a13661ebbc6781318ec..0b6299a586e25f97eb734e650728e50d19ad16ce 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -319,6 +319,30 @@ public final class Bukkit { @@ -41,7 +41,7 @@ index 574ecfe2e4f576f80b519f04e740fa00530a7cfa..9fca4fb1cbf5a098e023eeba947f7cf4 * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 759237106df6cc2798330be22f7bdb8d18e8f427..e654e00c145fb6f0ce2238d88de9be5d31fbfa51 100644 +index ad16ce2f62d6519efe8ec6da94aa2ae255521480..797ff4d2b16fba1a423c8dc247fde0ad9199b5c1 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -262,6 +262,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -76,7 +76,7 @@ index 759237106df6cc2798330be22f7bdb8d18e8f427..e654e00c145fb6f0ce2238d88de9be5d * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index e0254ef7412b4935edd0c4b9801d8eccca7d4a0c..19b9a14b855a5e15c9a6fc9544873265bdbaf203 100644 +index 08979f50d125a62d05389da86f08f5ac77e48b11..64557d549dd7d72ec78ecfac324b788657e6a0b4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -707,6 +707,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/patches/unapplied/api/0019-Add-exception-reporting-event.patch b/patches/api/0019-Add-exception-reporting-event.patch similarity index 100% rename from patches/unapplied/api/0019-Add-exception-reporting-event.patch rename to patches/api/0019-Add-exception-reporting-event.patch diff --git a/patches/unapplied/api/0022-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/patches/api/0020-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch similarity index 96% rename from patches/unapplied/api/0022-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch rename to patches/api/0020-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch index 39b5170da..abb4bce8e 100644 --- a/patches/unapplied/api/0022-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch +++ b/patches/api/0020-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java -index 7c9a0c85c0e23d6a569c3583e87b005938923d95..39ce012fcf2b22471a2ace9218f4f696ec93f466 100644 +index f98d46fa45bb7c842d791b09f082a0968ae537fb..e330a0d2be7a73ff84ec18499de6aecbceb5166c 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java @@ -1,6 +1,9 @@ diff --git a/patches/unapplied/api/0021-Fix-ServerListPingEvent-flagging-as-Async.patch b/patches/api/0021-Fix-ServerListPingEvent-flagging-as-Async.patch similarity index 100% rename from patches/unapplied/api/0021-Fix-ServerListPingEvent-flagging-as-Async.patch rename to patches/api/0021-Fix-ServerListPingEvent-flagging-as-Async.patch diff --git a/patches/unapplied/api/0020-Player-Tab-List-and-Title-APIs.patch b/patches/api/0022-Player-Tab-List-and-Title-APIs.patch similarity index 99% rename from patches/unapplied/api/0020-Player-Tab-List-and-Title-APIs.patch rename to patches/api/0022-Player-Tab-List-and-Title-APIs.patch index 22fe4c35e..d237498ab 100644 --- a/patches/unapplied/api/0020-Player-Tab-List-and-Title-APIs.patch +++ b/patches/api/0022-Player-Tab-List-and-Title-APIs.patch @@ -432,7 +432,7 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90 + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 19b9a14b855a5e15c9a6fc9544873265bdbaf203..9468b955e035e3aa733b62f17417d8e99f37ac9f 100644 +index 64557d549dd7d72ec78ecfac324b788657e6a0b4..12acaa06a00a2a2d0c03e52920bb041af29bc01e 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -2,6 +2,7 @@ package org.bukkit.entity; diff --git a/patches/unapplied/api/0023-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/api/0023-Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 100% rename from patches/unapplied/api/0023-Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/api/0023-Add-methods-for-working-with-arrows-stuck-in-living-.patch diff --git a/patches/unapplied/api/0024-Complete-resource-pack-API.patch b/patches/api/0024-Complete-resource-pack-API.patch similarity index 100% rename from patches/unapplied/api/0024-Complete-resource-pack-API.patch rename to patches/api/0024-Complete-resource-pack-API.patch diff --git a/patches/unapplied/api/0025-Use-ASM-for-event-executors.patch b/patches/api/0025-Use-ASM-for-event-executors.patch similarity index 98% rename from patches/unapplied/api/0025-Use-ASM-for-event-executors.patch rename to patches/api/0025-Use-ASM-for-event-executors.patch index f5bd29806..c74174175 100644 --- a/patches/unapplied/api/0025-Use-ASM-for-event-executors.patch +++ b/patches/api/0025-Use-ASM-for-event-executors.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors. Uses method handles for private or static methods. diff --git a/build.gradle.kts b/build.gradle.kts -index 6ebea1d9fafb08ede7e37dfe1b145a676c7aaaf9..533600dfb2e73736857cc2a10525db7dc2452433 100644 +index 50cee5c955b1a57e18f202897efa807f78b15635..283e2aefa17fe38ab10073761db2b77ba0ae8b46 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,6 +38,9 @@ dependencies { @@ -362,7 +362,7 @@ index a850f0780de05463fc0d3f9e15ff7f19d88b2aed..9026e108ccd3a88aee1267ee275137be + // Paper end } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 2e306c7b984a02e12a74fac14589bf29ab6488bf..79ac529017aac059d13fe342f279e9c8faeba599 100644 +index a3bc4155536f612ee2ae38ec7f16b974bdd24ab2..b7cd98f20de3421cd3b8a95cfa2155fa77afa8b1 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -291,21 +291,7 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/patches/unapplied/api/0026-Add-a-call-helper-to-Event.patch b/patches/api/0026-Add-a-call-helper-to-Event.patch similarity index 100% rename from patches/unapplied/api/0026-Add-a-call-helper-to-Event.patch rename to patches/api/0026-Add-a-call-helper-to-Event.patch diff --git a/patches/unapplied/api/0027-Add-sender-name-to-commands.yml-replacement.patch b/patches/api/0027-Add-sender-name-to-commands.yml-replacement.patch similarity index 100% rename from patches/unapplied/api/0027-Add-sender-name-to-commands.yml-replacement.patch rename to patches/api/0027-Add-sender-name-to-commands.yml-replacement.patch diff --git a/patches/unapplied/api/0028-Add-command-to-reload-permissions.yml-and-require-co.patch b/patches/api/0028-Add-command-to-reload-permissions.yml-and-require-co.patch similarity index 100% rename from patches/unapplied/api/0028-Add-command-to-reload-permissions.yml-and-require-co.patch rename to patches/api/0028-Add-command-to-reload-permissions.yml-and-require-co.patch diff --git a/patches/unapplied/api/0029-Custom-replacement-for-eaten-items.patch b/patches/api/0029-Custom-replacement-for-eaten-items.patch similarity index 100% rename from patches/unapplied/api/0029-Custom-replacement-for-eaten-items.patch rename to patches/api/0029-Custom-replacement-for-eaten-items.patch diff --git a/patches/unapplied/api/0030-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/api/0030-Entity-AddTo-RemoveFrom-World-Events.patch similarity index 100% rename from patches/unapplied/api/0030-Entity-AddTo-RemoveFrom-World-Events.patch rename to patches/api/0030-Entity-AddTo-RemoveFrom-World-Events.patch diff --git a/patches/unapplied/api/0031-EntityPathfindEvent.patch b/patches/api/0031-EntityPathfindEvent.patch similarity index 100% rename from patches/unapplied/api/0031-EntityPathfindEvent.patch rename to patches/api/0031-EntityPathfindEvent.patch diff --git a/patches/unapplied/api/0032-Reduce-thread-synchronization-in-MetadataStoreBase.patch b/patches/api/0032-Reduce-thread-synchronization-in-MetadataStoreBase.patch similarity index 100% rename from patches/unapplied/api/0032-Reduce-thread-synchronization-in-MetadataStoreBase.patch rename to patches/api/0032-Reduce-thread-synchronization-in-MetadataStoreBase.patch diff --git a/patches/unapplied/api/0033-Add-MetadataStoreBase.removeAll-Plugin.patch b/patches/api/0033-Add-MetadataStoreBase.removeAll-Plugin.patch similarity index 100% rename from patches/unapplied/api/0033-Add-MetadataStoreBase.removeAll-Plugin.patch rename to patches/api/0033-Add-MetadataStoreBase.removeAll-Plugin.patch diff --git a/patches/unapplied/server/0024-Further-improve-server-tick-loop.patch b/patches/server/0024-Further-improve-server-tick-loop.patch similarity index 94% rename from patches/unapplied/server/0024-Further-improve-server-tick-loop.patch rename to patches/server/0024-Further-improve-server-tick-loop.patch index 0be837a75..75d63be52 100644 --- a/patches/unapplied/server/0024-Further-improve-server-tick-loop.patch +++ b/patches/server/0024-Further-improve-server-tick-loop.patch @@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e6be4991f07a9cd59946d501c002fd9113b46af0..25a0038179ae71511638ecb5cd3f47bd9b81e4b1 100644 +index 15163398f96b4eda94d99b4b48ab2b06622bd2af..608b6218f5c59ecb3e7137121b8c4c2188479297 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -283,7 +283,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; public Commands vanillaCommandDispatcher; -@@ -292,7 +292,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop +Date: Mon, 6 May 2019 01:29:25 -0400 +Subject: [PATCH] Per-Player View Distance API placeholders + +I hope to look at this more in-depth soon. It appears doable. +However this should not block the update. + +diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java +index 352bfe795aea26307de9c998d67a43af3e4845f0..4689d52cd314a607d17be3657099157e95f34d47 100644 +--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java ++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java +@@ -167,6 +167,8 @@ import org.bukkit.inventory.MainHand; + + public class ServerPlayer extends Player { + ++ public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder ++ + private static final Logger LOGGER = LogManager.getLogger(); + private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; + private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 277b946bec2cfd8cfb4054504133f6ab9059ba8c..a465ef627169e62132287cded07efb5b05e1ed36 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -1750,6 +1750,31 @@ public class CraftWorld extends CraftRegionAccessor implements World { + public int getSimulationDistance() { + return world.spigotConfig.simulationDistance; + } ++ ++ @Override ++ public void setViewDistance(int viewDistance) { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public int getNoTickViewDistance() { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public void setNoTickViewDistance(int viewDistance) { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public int getSendViewDistance() { ++ throw new UnsupportedOperationException(); //TODO ++ } ++ ++ @Override ++ public void setSendViewDistance(int viewDistance) { ++ throw new UnsupportedOperationException(); //TODO ++ } + // Spigot end + + // Spigot start +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index 60807ed83e4240cdf1e05654d24c55313aba813f..4fc2310287c2f0d366ac9ad23607125541a3c8bb 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -377,6 +377,36 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message); + } + } ++ ++ @Override ++ public int getViewDistance() { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public void setViewDistance(int viewDistance) { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public int getNoTickViewDistance() { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public void setNoTickViewDistance(int viewDistance) { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public int getSendViewDistance() { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } ++ ++ @Override ++ public void setSendViewDistance(int viewDistance) { ++ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO ++ } + // Paper end + + @Override diff --git a/patches/unapplied/server/0039-Add-BeaconEffectEvent.patch b/patches/server/0040-Add-BeaconEffectEvent.patch similarity index 91% rename from patches/unapplied/server/0039-Add-BeaconEffectEvent.patch rename to patches/server/0040-Add-BeaconEffectEvent.patch index 16a674c5b..42616cffc 100644 --- a/patches/unapplied/server/0039-Add-BeaconEffectEvent.patch +++ b/patches/server/0040-Add-BeaconEffectEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add BeaconEffectEvent diff --git a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -index 5406ca495dd3dcb23929605d5b27bb4370a63d4d..0fa01b98f4a2ce2a7d34437a71d8c1cc7e718fb1 100644 +index f51c5c07f8f877f778535ee2d0ecc9dff01cca0c..76a401bcfdacded2137142ed38d739ed65d9fae6 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BeaconBlockEntity.java -@@ -43,6 +43,10 @@ import net.minecraft.world.phys.AABB; +@@ -42,6 +42,10 @@ import net.minecraft.world.phys.AABB; import org.bukkit.craftbukkit.potion.CraftPotionUtil; import org.bukkit.potion.PotionEffect; // CraftBukkit end @@ -19,7 +19,7 @@ index 5406ca495dd3dcb23929605d5b27bb4370a63d4d..0fa01b98f4a2ce2a7d34437a71d8c1cc public class BeaconBlockEntity extends BlockEntity implements MenuProvider { -@@ -274,15 +278,23 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { +@@ -273,15 +277,23 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { } } @@ -47,7 +47,7 @@ index 5406ca495dd3dcb23929605d5b27bb4370a63d4d..0fa01b98f4a2ce2a7d34437a71d8c1cc } } } -@@ -305,10 +317,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { +@@ -304,10 +316,10 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider { int j = BeaconBlockEntity.getLevel(beaconLevel); List list = BeaconBlockEntity.getHumansInRange(world, pos, beaconLevel); diff --git a/patches/unapplied/server/0040-Configurable-container-update-tick-rate.patch b/patches/server/0041-Configurable-container-update-tick-rate.patch similarity index 89% rename from patches/unapplied/server/0040-Configurable-container-update-tick-rate.patch rename to patches/server/0041-Configurable-container-update-tick-rate.patch index 1a8fbd08e..fe966f4f7 100644 --- a/patches/unapplied/server/0040-Configurable-container-update-tick-rate.patch +++ b/patches/server/0041-Configurable-container-update-tick-rate.patch @@ -19,10 +19,10 @@ index cff814a123e02aea96197c1be092c210c2fcf781..0f93c6ba2bc1b6207f8a5c3f9a39cb08 + } } diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index d263d9ce353312fe6954cdd2ef1a2c4c0260f168..3f3404d7d890864fcdcde7d65f726d288ddec688 100644 +index 4689d52cd314a607d17be3657099157e95f34d47..3a97690a1e65db9a1c184fa4df5899cfda3d44bc 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -217,6 +217,7 @@ public class ServerPlayer extends Player { +@@ -220,6 +220,7 @@ public class ServerPlayer extends Player { private int containerCounter; public int latency; public boolean wonGame; @@ -30,7 +30,7 @@ index d263d9ce353312fe6954cdd2ef1a2c4c0260f168..3f3404d7d890864fcdcde7d65f726d28 // CraftBukkit start public String displayName; -@@ -587,7 +588,12 @@ public class ServerPlayer extends Player { +@@ -591,7 +592,12 @@ public class ServerPlayer extends Player { --this.invulnerableTime; } diff --git a/patches/unapplied/server/0041-Use-UserCache-for-player-heads.patch b/patches/server/0042-Use-UserCache-for-player-heads.patch similarity index 100% rename from patches/unapplied/server/0041-Use-UserCache-for-player-heads.patch rename to patches/server/0042-Use-UserCache-for-player-heads.patch diff --git a/patches/unapplied/server/0042-Disable-spigot-tick-limiters.patch b/patches/server/0043-Disable-spigot-tick-limiters.patch similarity index 88% rename from patches/unapplied/server/0042-Disable-spigot-tick-limiters.patch rename to patches/server/0043-Disable-spigot-tick-limiters.patch index 11a27b0b3..1020594c4 100644 --- a/patches/unapplied/server/0042-Disable-spigot-tick-limiters.patch +++ b/patches/server/0043-Disable-spigot-tick-limiters.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index dd2dd8c12a8dfe252ab90ba5defd98a15dea14eb..5f047982b559087ae6eaffbc89ea83d289609de5 100644 +index d8da1dfdc58726eda01e1bfb059c144e98ce7fe8..8e06ce1d838b9eaa71a699a999e91dcd5d596a7b 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -702,9 +702,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -703,9 +703,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Spigot start // Iterator iterator = this.blockEntityTickers.iterator(); int tilesThisCycle = 0; diff --git a/patches/unapplied/server/0043-Add-PlayerInitialSpawnEvent.patch b/patches/server/0044-Add-PlayerInitialSpawnEvent.patch similarity index 87% rename from patches/unapplied/server/0043-Add-PlayerInitialSpawnEvent.patch rename to patches/server/0044-Add-PlayerInitialSpawnEvent.patch index f93891e85..df343f7d9 100644 --- a/patches/unapplied/server/0043-Add-PlayerInitialSpawnEvent.patch +++ b/patches/server/0044-Add-PlayerInitialSpawnEvent.patch @@ -9,10 +9,10 @@ This is a duplicate API from spigot, so use our duplicate subclass and improve setPosition to use raw diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 14cf49b910bd789f1dd61d303b88d53a93c3abd6..0ea5574ab43141a69e6aa5e05aeb548660f126e1 100644 +index 1cfeaeeddbc97e28f51c79ab3082a5d387daaead..db52eb4df917c9ad3ba807e40f1d44ea9c52aae8 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java -@@ -216,7 +216,7 @@ public abstract class PlayerList { +@@ -217,7 +217,7 @@ public abstract class PlayerList { // Spigot start - spawn location event Player spawnPlayer = player.getBukkitEntity(); @@ -21,9 +21,9 @@ index 14cf49b910bd789f1dd61d303b88d53a93c3abd6..0ea5574ab43141a69e6aa5e05aeb5486 this.cserver.getPluginManager().callEvent(ev); Location loc = ev.getSpawnLocation(); -@@ -224,7 +224,10 @@ public abstract class PlayerList { +@@ -225,7 +225,10 @@ public abstract class PlayerList { - player.setLevel(worldserver1); + player.spawnIn(worldserver1); player.gameMode.setLevel((ServerLevel) player.level); - player.absMoveTo(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch()); + // Paper start - set raw so we aren't fully joined to the world (not added to chunk or world) diff --git a/patches/unapplied/server/0044-Configurable-Disabling-Cat-Chest-Detection.patch b/patches/server/0045-Configurable-Disabling-Cat-Chest-Detection.patch similarity index 95% rename from patches/unapplied/server/0044-Configurable-Disabling-Cat-Chest-Detection.patch rename to patches/server/0045-Configurable-Disabling-Cat-Chest-Detection.patch index 0f8878ac2..6f9072c4d 100644 --- a/patches/unapplied/server/0044-Configurable-Disabling-Cat-Chest-Detection.patch +++ b/patches/server/0045-Configurable-Disabling-Cat-Chest-Detection.patch @@ -20,7 +20,7 @@ index 0f93c6ba2bc1b6207f8a5c3f9a39cb086797e800..0ccb86aed122ecd54a460db426163d0d + } } diff --git a/src/main/java/net/minecraft/world/level/block/ChestBlock.java b/src/main/java/net/minecraft/world/level/block/ChestBlock.java -index 1c1998c15849a56241b397bd2dfa8b00d39f610b..1891cfb8f7ebae5a95a55f706bb04f8206121d32 100644 +index 306fd5b1893d8a68af2073978bab7e590e936ef5..db726697b00afdee6078849fd224263483349912 100644 --- a/src/main/java/net/minecraft/world/level/block/ChestBlock.java +++ b/src/main/java/net/minecraft/world/level/block/ChestBlock.java @@ -362,6 +362,11 @@ public class ChestBlock extends AbstractChestBlock implements diff --git a/patches/unapplied/server/0045-Ensure-commands-are-not-ran-async.patch b/patches/server/0046-Ensure-commands-are-not-ran-async.patch similarity index 95% rename from patches/unapplied/server/0045-Ensure-commands-are-not-ran-async.patch rename to patches/server/0046-Ensure-commands-are-not-ran-async.patch index df0329240..4c80e567f 100644 --- a/patches/unapplied/server/0045-Ensure-commands-are-not-ran-async.patch +++ b/patches/server/0046-Ensure-commands-are-not-ran-async.patch @@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren that it is happening so that plugin authors can fix their code to stop executing commands async. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index da9f4b3337b49597c17b50964656457cd629a0b7..22c2c121bbcc7b0e15d73d20c9cc83d5fb085e5f 100644 +index 11687dc95f606750e9042b043f333e3b00eb171c..38909ef14fcfd4b93d83512f4cacbe2c3fe431a1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1846,6 +1846,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1852,6 +1852,29 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser } if (!async && s.startsWith("/")) { @@ -48,10 +48,10 @@ index da9f4b3337b49597c17b50964656457cd629a0b7..22c2c121bbcc7b0e15d73d20c9cc83d5 } else if (this.player.getChatVisibility() == ChatVisiblity.SYSTEM) { // Do nothing, this is coming from a plugin diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 47b212ca59b1c30b7224cac6a96f527fdfe659f8..52a20a67ac25018c04d037c54b014d15ee2c1e95 100644 +index c365a1cd02dbb8a248ba6247d3feb9553a22dfe6..7292cc72e9d8227b4354f1d91246d27d639c5abb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -787,6 +787,28 @@ public final class CraftServer implements Server { +@@ -796,6 +796,28 @@ public final class CraftServer implements Server { Validate.notNull(commandLine, "CommandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot diff --git a/patches/unapplied/server/0046-All-chunks-are-slime-spawn-chunks-toggle.patch b/patches/server/0047-All-chunks-are-slime-spawn-chunks-toggle.patch similarity index 95% rename from patches/unapplied/server/0046-All-chunks-are-slime-spawn-chunks-toggle.patch rename to patches/server/0047-All-chunks-are-slime-spawn-chunks-toggle.patch index f8bfb49ce..fae302567 100644 --- a/patches/unapplied/server/0046-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/patches/server/0047-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -19,7 +19,7 @@ index 0ccb86aed122ecd54a460db426163d0d2639c609..84df54523eada327033bb8821a7009df + } } diff --git a/src/main/java/net/minecraft/world/entity/monster/Slime.java b/src/main/java/net/minecraft/world/entity/monster/Slime.java -index b42fa1aa311cab14580906c1f77d02c418ce2285..239f3a17ab8cff4e6c97044e4f8e6755abac193d 100644 +index 19a2702d9053037203c192d7f26f3c9afbe6f782..11aefbf65b0e63777d6ed5bfdb18c7f7df30fc0e 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Slime.java +++ b/src/main/java/net/minecraft/world/entity/monster/Slime.java @@ -323,7 +323,7 @@ public class Slime extends Mob implements Enemy { diff --git a/patches/unapplied/server/0047-Expose-server-CommandMap.patch b/patches/server/0048-Expose-server-CommandMap.patch similarity index 78% rename from patches/unapplied/server/0047-Expose-server-CommandMap.patch rename to patches/server/0048-Expose-server-CommandMap.patch index 0483e1b87..a50f05585 100644 --- a/patches/unapplied/server/0047-Expose-server-CommandMap.patch +++ b/patches/server/0048-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 52a20a67ac25018c04d037c54b014d15ee2c1e95..8f24d4e8eb26b02f8aa2160d69a7a61807a9580a 100644 +index 7292cc72e9d8227b4354f1d91246d27d639c5abb..c66577e495b59acd9bc666e1291c6417cfa9e477 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1923,6 +1923,7 @@ public final class CraftServer implements Server { +@@ -1934,6 +1934,7 @@ public final class CraftServer implements Server { return this.helpMap; } diff --git a/patches/unapplied/server/0048-Be-a-bit-more-informative-in-maxHealth-exception.patch b/patches/server/0049-Be-a-bit-more-informative-in-maxHealth-exception.patch similarity index 93% rename from patches/unapplied/server/0048-Be-a-bit-more-informative-in-maxHealth-exception.patch rename to patches/server/0049-Be-a-bit-more-informative-in-maxHealth-exception.patch index 9a40eefbe..edd16859a 100644 --- a/patches/unapplied/server/0048-Be-a-bit-more-informative-in-maxHealth-exception.patch +++ b/patches/server/0049-Be-a-bit-more-informative-in-maxHealth-exception.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 6c4cb5a8878f2738048d9dc8386cbb985843cf50..8e97b3985056caa2aa692ec6250022e095d0b3a6 100644 +index a6192a7edd94e63c568ca8196e0ed9fa993da6bb..1d3cd79634366718cd354cd2f55c6fc974ad3525 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -99,7 +99,10 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0050-Ensure-inv-drag-is-in-bounds.patch b/patches/server/0050-Ensure-inv-drag-is-in-bounds.patch similarity index 92% rename from patches/unapplied/server/0050-Ensure-inv-drag-is-in-bounds.patch rename to patches/server/0050-Ensure-inv-drag-is-in-bounds.patch index feb38782e..0a81ac65b 100644 --- a/patches/unapplied/server/0050-Ensure-inv-drag-is-in-bounds.patch +++ b/patches/server/0050-Ensure-inv-drag-is-in-bounds.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ensure inv drag is in bounds diff --git a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java -index 13e5dbc79dc8b70d158717ad48f64240a2643714..60a67f75b4f772654e064e2b19f68a907ca4c93b 100644 +index ccb6ff0cf31e619ce555d404a6454750f0958f12..36834f30ccefd229df4da2dbc7b22edcb83429c3 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractContainerMenu.java @@ -406,7 +406,7 @@ public abstract class AbstractContainerMenu { diff --git a/patches/unapplied/server/0049-Player-Tab-List-and-Title-APIs.patch b/patches/server/0051-Player-Tab-List-and-Title-APIs.patch similarity index 96% rename from patches/unapplied/server/0049-Player-Tab-List-and-Title-APIs.patch rename to patches/server/0051-Player-Tab-List-and-Title-APIs.patch index 53d80b297..d1f1c2112 100644 --- a/patches/unapplied/server/0049-Player-Tab-List-and-Title-APIs.patch +++ b/patches/server/0051-Player-Tab-List-and-Title-APIs.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -index 22bc8fa039375a3205bdfdf05b6c73c856fb1b16..b10cf0c5800397520f57c0bbc88a52e52db6a4c8 100644 +index 0053474ab7c25de6d86c16e3079feb21f75d1c11..303b877bc467de7c046cc221d061fac841c1d9f3 100644 --- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java +++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java -@@ -357,6 +357,11 @@ public class FriendlyByteBuf extends ByteBuf { +@@ -356,6 +356,11 @@ public class FriendlyByteBuf extends ByteBuf { public FriendlyByteBuf writeComponent(final net.kyori.adventure.text.Component component) { return this.writeUtf(PaperAdventure.asJsonString(component, this.adventure$locale), 262144); } @@ -63,7 +63,7 @@ index bd808eb312ade7122973a47f4b96505829511da5..bf0f9cab7c66c089f35b851e799ba4a4 // Paper end buf.writeComponent(this.text); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6572528a3a664f10d8c3a0d0808c411fcd031f71..ca8987d38f1fcbc094f0f5f13f12dfbf7dd2718a 100644 +index 4fc2310287c2f0d366ac9ad23607125541a3c8bb..b7dae85766f3077f92ab014562cf0143bff7c9d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ @@ -73,7 +73,7 @@ index 6572528a3a664f10d8c3a0d0808c411fcd031f71..ca8987d38f1fcbc094f0f5f13f12dfbf import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableSet; import com.google.common.io.BaseEncoding; -@@ -242,6 +243,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -248,6 +249,100 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } } diff --git a/patches/unapplied/server/0051-Add-configurable-portal-search-radius.patch b/patches/server/0052-Add-configurable-portal-search-radius.patch similarity index 73% rename from patches/unapplied/server/0051-Add-configurable-portal-search-radius.patch rename to patches/server/0052-Add-configurable-portal-search-radius.patch index a7c37fd43..90616b2a9 100644 --- a/patches/unapplied/server/0051-Add-configurable-portal-search-radius.patch +++ b/patches/server/0052-Add-configurable-portal-search-radius.patch @@ -23,12 +23,12 @@ index 84df54523eada327033bb8821a7009df62dc7bca..304883dc18bab3bf4740006a5e6d7c58 + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3acb00b025d5e45c7244cb62b59c5466d16a88dc..3456dcbac4984d4485c85b432f33ab33e76d1361 100644 +index 6bc8c8e15e66cd54cbb6ebc6d09a6fe8652b5d18..8161cbd3cfed89bee74209c718d0ceff2b401890 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2906,7 +2906,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n - double d4 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType()); - BlockPos blockposition = new BlockPos(Mth.clamp(this.getX() * d4, d0, d2), this.getY(), Mth.clamp(this.getZ() * d4, d1, d3)); +@@ -2939,7 +2939,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i + double d0 = DimensionType.getTeleportationScale(this.level.dimensionType(), destination.dimensionType()); + BlockPos blockposition = worldborder.clampToBounds(this.getX() * d0, this.getY(), this.getZ() * d0); // CraftBukkit start - CraftPortalEvent event = this.callPortalEvent(this, destination, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); + // Paper start @@ -42,15 +42,15 @@ index 3acb00b025d5e45c7244cb62b59c5466d16a88dc..3456dcbac4984d4485c85b432f33ab33 return null; } diff --git a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -index 4d186a7d6ccf09092c5e1577e4b49e0975787980..d5ba2e679ed1858ea18e18feffce50544ae036c2 100644 +index 194465751c351a921100e621a0ef1616c7e5f3fb..80811386c1006d56824ff4d43830f2a140aaee30 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalForcer.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalForcer.java -@@ -44,7 +44,7 @@ public class PortalForcer { +@@ -43,7 +43,7 @@ public class PortalForcer { - public Optional findPortalAround(BlockPos destPos, boolean destIsNether) { + public Optional findPortalAround(BlockPos blockposition, boolean destIsNether, WorldBorder worldborder) { // CraftBukkit start -- return this.findPortal(destPos, destIsNether ? 16 : 128); // Search Radius -+ return this.findPortal(destPos, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius +- return this.findPortalAround(blockposition, worldborder, destIsNether ? 16 : 128); // Search Radius ++ return this.findPortalAround(blockposition, worldborder, destIsNether ? level.paperConfig.portalCreateRadius : level.paperConfig.portalSearchRadius); // Search Radius // Paper - search Radius } - public Optional findPortal(BlockPos blockposition, int i) { + public Optional findPortalAround(BlockPos blockposition, WorldBorder worldborder, int i) { diff --git a/patches/unapplied/server/0052-Add-velocity-warnings.patch b/patches/server/0053-Add-velocity-warnings.patch similarity index 94% rename from patches/unapplied/server/0052-Add-velocity-warnings.patch rename to patches/server/0053-Add-velocity-warnings.patch index 394dc3b2d..368e0fd58 100644 --- a/patches/unapplied/server/0052-Add-velocity-warnings.patch +++ b/patches/server/0053-Add-velocity-warnings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 8f24d4e8eb26b02f8aa2160d69a7a61807a9580a..cde74a4785e4197f4b39ee28663801726a9e4dca 100644 +index c66577e495b59acd9bc666e1291c6417cfa9e477..e62ee04cbe0f3281783aff8ef74d7165447b34ba 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -285,6 +285,7 @@ public final class CraftServer implements Server { +@@ -289,6 +289,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List playerView; public int reloadCount; @@ -17,7 +17,7 @@ index 8f24d4e8eb26b02f8aa2160d69a7a61807a9580a..cde74a4785e4197f4b39ee2866380172 static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 5d5c6d1cfaa25f3a05976ee496d14fb32b052785..2c638d95b396044841ab0dea8d8ce829077992fe 100644 +index 506bc08a7aadf5246f57e6935dbaa81ca482fb9a..78b3be2ea6351cb6375b77340218615aa75b87f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -436,10 +436,40 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/unapplied/server/0053-Configurable-inter-world-teleportation-safety.patch b/patches/server/0054-Configurable-inter-world-teleportation-safety.patch similarity index 85% rename from patches/unapplied/server/0053-Configurable-inter-world-teleportation-safety.patch rename to patches/server/0054-Configurable-inter-world-teleportation-safety.patch index 055cf61f7..6d8b202a6 100644 --- a/patches/unapplied/server/0053-Configurable-inter-world-teleportation-safety.patch +++ b/patches/server/0054-Configurable-inter-world-teleportation-safety.patch @@ -30,15 +30,15 @@ index 304883dc18bab3bf4740006a5e6d7c58bab12348..6d1473a5267ecd3617d76fee23527bde + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 5a90d36915ab14aea6bf6431a1894031a5c9ee96..8eac81867ff299d45427fd71d9b085439deb95d8 100644 +index b7dae85766f3077f92ab014562cf0143bff7c9d3..3c7ae0966f2e8d0ab0924047653792ac7ac75f10 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -898,7 +898,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -905,7 +905,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.connection.teleport(to); } else { -- server.getHandle().moveToWorld(entity, toWorld, true, to, true); -+ server.getHandle().moveToWorld(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper +- server.getHandle().respawn(entity, toWorld, true, to, true); ++ server.getHandle().respawn(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper } return true; } diff --git a/patches/unapplied/server/0054-Add-exception-reporting-event.patch b/patches/server/0055-Add-exception-reporting-event.patch similarity index 91% rename from patches/unapplied/server/0054-Add-exception-reporting-event.patch rename to patches/server/0055-Add-exception-reporting-event.patch index 3af36c42b..0638cd9e5 100644 --- a/patches/unapplied/server/0054-Add-exception-reporting-event.patch +++ b/patches/server/0055-Add-exception-reporting-event.patch @@ -49,10 +49,10 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8 + } +} diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index d3213114aaaaef575efb79f0c66d5c23baf8614d..fb3b0693abb6f2f044d39508b727fb3a2ad16823 100644 +index cab03a81a97d851db61e517cfe3a43fa8afd32b2..9dd0279f9d33fabd1dc4ff029f0ad76a9cc8cb21 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java -@@ -875,6 +875,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider +@@ -924,6 +924,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider return true; } catch (Exception exception) { ChunkMap.LOGGER.error("Failed to save chunk {},{}", chunkcoordintpair.x, chunkcoordintpair.z, exception); @@ -61,7 +61,7 @@ index d3213114aaaaef575efb79f0c66d5c23baf8614d..fb3b0693abb6f2f044d39508b727fb3a } } diff --git a/src/main/java/net/minecraft/server/players/OldUsersConverter.java b/src/main/java/net/minecraft/server/players/OldUsersConverter.java -index b0ed7d12bee6b247762fff3d5a24f0cc9411e3dc..f6cb864c45f960811acc02829d1f7883b916de29 100644 +index 38403f62a9539382d5330f9231fe9ef618b87c21..876658b685ea09adb4c01d436da56daadb7eedaa 100644 --- a/src/main/java/net/minecraft/server/players/OldUsersConverter.java +++ b/src/main/java/net/minecraft/server/players/OldUsersConverter.java @@ -1,5 +1,6 @@ @@ -88,7 +88,7 @@ index b0ed7d12bee6b247762fff3d5a24f0cc9411e3dc..f6cb864c45f960811acc02829d1f7883 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java -index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962deee180ef3 100644 +index 4cde8d630a0951f297622af4ef781f5b3fabf9af..7044d8c71e85551e11bf2d96b767e08811bdb9fe 100644 --- a/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java +++ b/src/main/java/net/minecraft/world/entity/ai/village/VillageSiege.java @@ -1,5 +1,7 @@ @@ -99,7 +99,7 @@ index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962de import java.util.Iterator; import javax.annotation.Nullable; import net.minecraft.core.BlockPos; -@@ -119,6 +121,7 @@ public class VillageSiege implements CustomSpawner { +@@ -118,6 +120,7 @@ public class VillageSiege implements CustomSpawner { entityzombie.finalizeSpawn(world, world.getCurrentDifficultyAt(entityzombie.blockPosition()), MobSpawnType.EVENT, (SpawnGroupData) null, (CompoundTag) null); } catch (Exception exception) { VillageSiege.LOGGER.warn("Failed to create zombie for village siege at {}", vec3d, exception); @@ -108,7 +108,7 @@ index 08c5f6fd1a307c89cf8365f56314a0c6d3e89e4b..26e0f03f2e736ed6ba86e2510a7962de } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 5f047982b559087ae6eaffbc89ea83d289609de5..dccf23a64bad4fbfcef56eace434884e35919add 100644 +index 8e06ce1d838b9eaa71a699a999e91dcd5d596a7b..79764895307139b34f2b018f3be86d6610503b64 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1,5 +1,10 @@ @@ -122,7 +122,7 @@ index 5f047982b559087ae6eaffbc89ea83d289609de5..dccf23a64bad4fbfcef56eace434884e import com.google.common.collect.Lists; import com.mojang.serialization.Codec; import java.io.IOException; -@@ -738,6 +743,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -739,6 +744,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // Paper start - Prevent tile entity and entity crashes final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level.getWorld().getName(), entity.getX(), entity.getY(), entity.getZ()); MinecraftServer.LOGGER.error(msg, throwable); @@ -131,10 +131,10 @@ index 5f047982b559087ae6eaffbc89ea83d289609de5..dccf23a64bad4fbfcef56eace434884e // Paper end } diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -index ac815b900f58f67a2c656fc1dbf8f53ffc15b96e..0432ad7ab00c336e7c566f24c3ec92b399cb6e9d 100644 +index 81b61b6cc1e99328d4d339ca32895d1268c88ca7..28a7c53d98450cc79bee953411a18f50cfed26c2 100644 --- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java +++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java -@@ -313,6 +313,7 @@ public final class NaturalSpawner { +@@ -316,6 +316,7 @@ public final class NaturalSpawner { } } catch (Exception exception) { NaturalSpawner.LOGGER.warn("Failed to create mob", exception); @@ -142,8 +142,8 @@ index ac815b900f58f67a2c656fc1dbf8f53ffc15b96e..0432ad7ab00c336e7c566f24c3ec92b3 return null; } } -@@ -415,6 +416,7 @@ public final class NaturalSpawner { - entity = biomesettingsmobs_c.type.create((Level) world.getLevel()); +@@ -422,6 +423,7 @@ public final class NaturalSpawner { + entity = biomesettingsmobs_c.type.create(world.getLevel()); } catch (Exception exception) { NaturalSpawner.LOGGER.warn("Failed to create mob", exception); + com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(exception); // Paper @@ -151,7 +151,7 @@ index ac815b900f58f67a2c656fc1dbf8f53ffc15b96e..0432ad7ab00c336e7c566f24c3ec92b3 } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da92742b5f519 100644 +index cadcafec7dc8af1e938b20d07bd9a24acd350ab1..ac17877ea6e210acfb54961a2818ca1ae7f6c738 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java @@ -1,6 +1,7 @@ @@ -160,9 +160,9 @@ index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da927 import com.google.common.collect.ImmutableList; +import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.collect.Maps; - import com.google.common.collect.Sets; import com.google.common.collect.UnmodifiableIterator; -@@ -615,10 +616,15 @@ public class LevelChunk implements ChunkAccess { + import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +@@ -547,10 +548,15 @@ public class LevelChunk extends ChunkAccess { this.removeBlockEntity(blockEntity.getBlockPos()); // Paper end } else { @@ -182,7 +182,7 @@ index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da927 // CraftBukkit end } } -@@ -1250,6 +1256,7 @@ public class LevelChunk implements ChunkAccess { +@@ -1032,6 +1038,7 @@ public class LevelChunk extends ChunkAccess { // Paper start - Prevent tile entity and entity crashes final String msg = String.format("BlockEntity threw exception at %s:%s,%s,%s", LevelChunk.this.getLevel().getWorld().getName(), this.getPos().getX(), this.getPos().getY(), this.getPos().getZ()); net.minecraft.server.MinecraftServer.LOGGER.error(msg, throwable); @@ -191,10 +191,10 @@ index ea894662b41cddfc5702a7d6305978be71da79b4..aa6db78339d6b0661ac3be12c82da927 // Paper end // Spigot start diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index 1441888430687b9de2a67f21ed426f16d5b30538..f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9 100644 +index c87faa811ec3eafa206d74c89927259d382fb492..9f3223947d2fcc1aaf259effe6afce7a47888858 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -@@ -277,6 +277,7 @@ public class RegionFile implements AutoCloseable { +@@ -274,6 +274,7 @@ public class RegionFile implements AutoCloseable { return true; } } catch (IOException ioexception) { @@ -202,7 +202,7 @@ index 1441888430687b9de2a67f21ed426f16d5b30538..f514c29e64a9c7a66ff4edd5ba8c2a3d return false; } } -@@ -358,6 +359,7 @@ public class RegionFile implements AutoCloseable { +@@ -355,6 +356,7 @@ public class RegionFile implements AutoCloseable { ((java.nio.Buffer) bytebuffer).position(5); // CraftBukkit - decompile error filechannel.write(bytebuffer); } catch (Throwable throwable) { diff --git a/patches/unapplied/server/0055-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch b/patches/server/0056-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch similarity index 100% rename from patches/unapplied/server/0055-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch rename to patches/server/0056-Don-t-nest-if-we-don-t-need-to-when-cerealising-text.patch diff --git a/patches/unapplied/server/0056-Disable-Scoreboards-for-non-players-by-default.patch b/patches/server/0057-Disable-Scoreboards-for-non-players-by-default.patch similarity index 87% rename from patches/unapplied/server/0056-Disable-Scoreboards-for-non-players-by-default.patch rename to patches/server/0057-Disable-Scoreboards-for-non-players-by-default.patch index eb9b07c40..8f8035c6e 100644 --- a/patches/unapplied/server/0056-Disable-Scoreboards-for-non-players-by-default.patch +++ b/patches/server/0057-Disable-Scoreboards-for-non-players-by-default.patch @@ -25,10 +25,10 @@ index 6d1473a5267ecd3617d76fee23527bde58283bb1..1ab2ede5e9d8939f69fb430084437fda + } } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3456dcbac4984d4485c85b432f33ab33e76d1361..bd64589488506c018dde86ff3a47836168dd7025 100644 +index 8161cbd3cfed89bee74209c718d0ceff2b401890..a957a168450ee5c34a58ed993f281ca774fccfc1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2555,6 +2555,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -2588,6 +2588,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i @Nullable public Team getTeam() { @@ -37,10 +37,10 @@ index 3456dcbac4984d4485c85b432f33ab33e76d1361..bd64589488506c018dde86ff3a478361 } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index c5fb30aec04bd46ab4ad376382889f99015f63b9..0f27ee2ed35f54e30e2169941706eb0fc11275d5 100644 +index deef28110441cd2965c6b531bc255ee2aa994ace..60356e889f2da17b313ee5cf223ee0c5066182c4 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -803,6 +803,7 @@ public abstract class LivingEntity extends Entity { +@@ -798,6 +798,7 @@ public abstract class LivingEntity extends Entity { if (nbt.contains("Team", 8)) { String s = nbt.getString("Team"); PlayerTeam scoreboardteam = this.level.getScoreboard().getPlayerTeam(s); diff --git a/patches/unapplied/server/0057-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/patches/server/0058-Add-methods-for-working-with-arrows-stuck-in-living-.patch similarity index 91% rename from patches/unapplied/server/0057-Add-methods-for-working-with-arrows-stuck-in-living-.patch rename to patches/server/0058-Add-methods-for-working-with-arrows-stuck-in-living-.patch index b74b44968..b73f1a823 100644 --- a/patches/unapplied/server/0057-Add-methods-for-working-with-arrows-stuck-in-living-.patch +++ b/patches/server/0058-Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add methods for working with arrows stuck in living entities diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 72ddddde1dafad3be501d0aba73e04515d218d18..5d5ad28d01ff66a8b9f608f82b5213d112243e4d 100644 +index 1d3cd79634366718cd354cd2f55c6fc974ad3525..b65d44780c7e6e1e2e8724df838d1aa54edcc30a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -717,4 +717,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/patches/unapplied/server/0059-Chunk-Save-Reattempt.patch b/patches/server/0059-Chunk-Save-Reattempt.patch similarity index 71% rename from patches/unapplied/server/0059-Chunk-Save-Reattempt.patch rename to patches/server/0059-Chunk-Save-Reattempt.patch index 60ea3d5f3..c611a992c 100644 --- a/patches/unapplied/server/0059-Chunk-Save-Reattempt.patch +++ b/patches/server/0059-Chunk-Save-Reattempt.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Chunk Save Reattempt We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks. diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -index f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9..84327c8fe1dc62c7b99950261a344042b4456616 100644 +index 9f3223947d2fcc1aaf259effe6afce7a47888858..7b69007609ed421ee72ddc3d6f2a7b64888babf1 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java -@@ -277,7 +277,7 @@ public class RegionFile implements AutoCloseable { +@@ -274,7 +274,7 @@ public class RegionFile implements AutoCloseable { return true; } } catch (IOException ioexception) { @@ -19,26 +19,18 @@ index f514c29e64a9c7a66ff4edd5ba8c2a3dfbba2ad9..84327c8fe1dc62c7b99950261a344042 } } diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -index 344d281f0abc93488e41565efac130108745f861..a0516f72671522a6d7d9ea649506760f120b88bd 100644 +index 8ba1c073387fa21a20bd42a873ec3cc314eae64e..eaf22cec54b512e0f57606f50627d5fe9b39bd5c 100644 --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java -@@ -11,6 +11,7 @@ import java.io.IOException; - import javax.annotation.Nullable; - import net.minecraft.nbt.CompoundTag; - import net.minecraft.nbt.NbtIo; -+import net.minecraft.server.MinecraftServer; - import net.minecraft.util.ExceptionCollector; - import net.minecraft.world.level.ChunkPos; - -@@ -101,6 +102,7 @@ public class RegionFileStorage implements AutoCloseable { +@@ -131,6 +131,7 @@ public class RegionFileStorage implements AutoCloseable { protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { - RegionFile regionfile = this.getFile(pos, false); // CraftBukkit + RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit + int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper if (nbt == null) { regionfile.clear(pos); -@@ -126,6 +128,18 @@ public class RegionFileStorage implements AutoCloseable { +@@ -156,6 +157,18 @@ public class RegionFileStorage implements AutoCloseable { } } @@ -51,7 +43,7 @@ index 344d281f0abc93488e41565efac130108745f861..a0516f72671522a6d7d9ea649506760f + + if (laste != null) { + com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); -+ MinecraftServer.LOGGER.error("Failed to save chunk", laste); ++ net.minecraft.server.MinecraftServer.LOGGER.error("Failed to save chunk", laste); + } + // Paper end } diff --git a/patches/unapplied/server/0058-Complete-resource-pack-API.patch b/patches/server/0060-Complete-resource-pack-API.patch similarity index 90% rename from patches/unapplied/server/0058-Complete-resource-pack-API.patch rename to patches/server/0060-Complete-resource-pack-API.patch index e43190654..a9272509c 100644 --- a/patches/unapplied/server/0058-Complete-resource-pack-API.patch +++ b/patches/server/0060-Complete-resource-pack-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index d217c3b7a72127e6421b2bfa224536e86e27e260..b4bcceeaec778103e07d69f9565f21a9d7e50ff2 100644 +index 38909ef14fcfd4b93d83512f4cacbe2c3fe431a1..76e34fb4bb6b3d194e155bec30d36887350f3ee3 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -1628,8 +1628,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser +@@ -1634,8 +1634,11 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Ser ServerGamePacketListenerImpl.LOGGER.info("Disconnecting {} due to resource pack rejection", this.player.getName()); this.disconnect(new TranslatableComponent("multiplayer.requiredTexturePrompt.disconnect")); } @@ -23,10 +23,10 @@ index d217c3b7a72127e6421b2bfa224536e86e27e260..b4bcceeaec778103e07d69f9565f21a9 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8eac81867ff299d45427fd71d9b085439deb95d8..1a790c9913e8d83276ca3c3158562b2a03e2c82e 100644 +index 3c7ae0966f2e8d0ab0924047653792ac7ac75f10..97a21ecae2b2b17c9041cd7e5148c68472929d6a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -126,6 +126,7 @@ import org.bukkit.metadata.MetadataValue; +@@ -132,6 +132,7 @@ import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.messaging.StandardMessenger; import org.bukkit.scoreboard.Scoreboard; @@ -34,7 +34,7 @@ index 8eac81867ff299d45427fd71d9b085439deb95d8..1a790c9913e8d83276ca3c3158562b2a import net.md_5.bungee.api.chat.BaseComponent; // Spigot -@@ -142,6 +143,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -148,6 +149,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private double health = 20; private boolean scaledHealth = false; private double healthScale = 20; @@ -45,7 +45,7 @@ index 8eac81867ff299d45427fd71d9b085439deb95d8..1a790c9913e8d83276ca3c3158562b2a public CraftPlayer(CraftServer server, ServerPlayer entity) { super(server, entity); -@@ -1909,6 +1914,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1918,6 +1923,45 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean getAffectsSpawning() { return this.getHandle().affectsSpawning; } diff --git a/patches/unapplied/server/0060-Default-loading-permissions.yml-before-plugins.patch b/patches/server/0061-Default-loading-permissions.yml-before-plugins.patch similarity index 92% rename from patches/unapplied/server/0060-Default-loading-permissions.yml-before-plugins.patch rename to patches/server/0061-Default-loading-permissions.yml-before-plugins.patch index eef7b4323..a247056a3 100644 --- a/patches/unapplied/server/0060-Default-loading-permissions.yml-before-plugins.patch +++ b/patches/server/0061-Default-loading-permissions.yml-before-plugins.patch @@ -30,10 +30,10 @@ index 701a2ffd04df48d437b2cb963dd150af99725b6e..817d4572c9991992b720b3ba163188ac + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index cde74a4785e4197f4b39ee28663801726a9e4dca..a929d46ad3a079d68c46246d9321de08f0d6dcaa 100644 +index e62ee04cbe0f3281783aff8ef74d7165447b34ba..49725d304ade26d537552788952f18291c64f927 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -424,6 +424,7 @@ public final class CraftServer implements Server { +@@ -428,6 +428,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { this.helpMap.clear(); this.helpMap.initializeGeneralTopics(); @@ -41,7 +41,7 @@ index cde74a4785e4197f4b39ee28663801726a9e4dca..a929d46ad3a079d68c46246d9321de08 } Plugin[] plugins = this.pluginManager.getPlugins(); -@@ -443,7 +444,7 @@ public final class CraftServer implements Server { +@@ -447,7 +448,7 @@ public final class CraftServer implements Server { this.commandMap.registerServerAliases(); DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); diff --git a/patches/unapplied/server/0061-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0062-Allow-Reloading-of-Custom-Permissions.patch similarity index 90% rename from patches/unapplied/server/0061-Allow-Reloading-of-Custom-Permissions.patch rename to patches/server/0062-Allow-Reloading-of-Custom-Permissions.patch index 4b3c5f66c..112d2c420 100644 --- a/patches/unapplied/server/0061-Allow-Reloading-of-Custom-Permissions.patch +++ b/patches/server/0062-Allow-Reloading-of-Custom-Permissions.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a929d46ad3a079d68c46246d9321de08f0d6dcaa..36de0faea986ecbbdc5cab7351d3b51049f9b633 100644 +index 49725d304ade26d537552788952f18291c64f927..657c810f86c73cdbb2c044c742803c835e6d4c50 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2434,5 +2434,23 @@ public final class CraftServer implements Server { +@@ -2446,5 +2446,23 @@ public final class CraftServer implements Server { } return this.adventure$audiences; } diff --git a/patches/unapplied/server/0062-Remove-Metadata-on-reload.patch b/patches/server/0063-Remove-Metadata-on-reload.patch similarity index 88% rename from patches/unapplied/server/0062-Remove-Metadata-on-reload.patch rename to patches/server/0063-Remove-Metadata-on-reload.patch index f3ec63468..810488cce 100644 --- a/patches/unapplied/server/0062-Remove-Metadata-on-reload.patch +++ b/patches/server/0063-Remove-Metadata-on-reload.patch @@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 36de0faea986ecbbdc5cab7351d3b51049f9b633..9db5f614512d05eb99b4811c71fbc914e50c712e 100644 +index 657c810f86c73cdbb2c044c742803c835e6d4c50..bf18ed30b1e66cb94f346b1e63a67ec5f4030b0b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -904,8 +904,16 @@ public final class CraftServer implements Server { +@@ -913,8 +913,16 @@ public final class CraftServer implements Server { world.paperConfig.init(); // Paper } diff --git a/patches/unapplied/server/0063-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0064-Handle-Item-Meta-Inconsistencies.patch similarity index 93% rename from patches/unapplied/server/0063-Handle-Item-Meta-Inconsistencies.patch rename to patches/server/0064-Handle-Item-Meta-Inconsistencies.patch index 0bb14e995..f02a4ad35 100644 --- a/patches/unapplied/server/0063-Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/0064-Handle-Item-Meta-Inconsistencies.patch @@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the ItemMeta API equivalents, and should deprecate the old API's. diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564254932b5 100644 +index df787c12053f799b111c539d866ff8c751e21611..4019a8cd594f8c093cf790600a92f0725250e82b 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -13,6 +13,8 @@ import java.text.DecimalFormatSymbols; @@ -29,7 +29,7 @@ index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564 +import java.util.Comparator; import java.util.Locale; import java.util.Map.Entry; - import java.util.Objects; + import java.util.Optional; @@ -151,6 +153,23 @@ public final class ItemStack { return this.getItem().getTooltipImage(this); } @@ -54,23 +54,19 @@ index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564 public ItemStack(ItemLike item) { this(item, 1); } -@@ -194,6 +213,7 @@ public final class ItemStack { +@@ -194,9 +213,11 @@ public final class ItemStack { // CraftBukkit start - make defensive copy as this data may be coming from the save thread - this.tag = (CompoundTag) nbttagcompound.getCompound("tag").copy(); + this.tag = nbttagcompound.getCompound("tag").copy(); // CraftBukkit end + this.processEnchantOrder(this.tag); // Paper this.getItem().verifyTagAfterLoad(this.tag); } -@@ -747,6 +767,7 @@ public final class ItemStack { - // Paper end - public void setTag(@Nullable CompoundTag tag) { - this.tag = tag; + processEnchantOrder(this.tag); // Paper if (this.getItem().canBeDepleted()) { this.setDamageValue(this.getDamageValue()); } -@@ -1054,6 +1075,7 @@ public final class ItemStack { +@@ -1055,6 +1076,7 @@ public final class ItemStack { ListTag nbttaglist = this.tag.getList("Enchantments", 10); nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level)); @@ -79,7 +75,7 @@ index ab9cb0bf0321e4130b5bbf2b24b7655e9327d363..c6880228982ef12a37cfa867acb5e564 public boolean isEnchanted() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index d6467a42d54954dffe919482294cb9355f217f21..84f11780a22b3369519fc8f80d6c274360045df7 100644 +index e88df908377450964ae5b6ff97ee97bd2f09c05f..ba70ac49222c517a38e20e86cee1fd38aecb6318 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -6,7 +6,6 @@ import java.util.Map; @@ -203,7 +199,7 @@ index d6467a42d54954dffe919482294cb9355f217f21..84f11780a22b3369519fc8f80d6c2743 static Map getEnchantments(net.minecraft.world.item.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571baab297799 100644 +index af2d0bfab14cf7133eeaff484895cba6b37391e8..0baca5f3c3f73323b6f5b283fc00be39477ccf59 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -214,15 +210,15 @@ index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571ba import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.collect.SetMultimap; -@@ -22,6 +23,7 @@ import java.lang.reflect.InvocationTargetException; - import java.util.ArrayList; +@@ -23,6 +24,7 @@ import java.util.ArrayList; import java.util.Arrays; + import java.util.Base64; import java.util.Collection; +import java.util.Comparator; // Paper import java.util.EnumSet; import java.util.HashMap; import java.util.Iterator; -@@ -32,6 +34,7 @@ import java.util.Map; +@@ -33,6 +35,7 @@ import java.util.Map; import java.util.NoSuchElementException; import java.util.Objects; import java.util.Set; @@ -243,8 +239,8 @@ index 86163b56d10689aa512953c8df869aa45ebac735..05d54f0eff89b721f01e90e79d2571ba private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private CompoundTag internalTag; -- private final Map unhandledTags = new HashMap(); -+ private final Map unhandledTags = new TreeMap<>(); // Paper +- final Map unhandledTags = new HashMap(); // Visible for testing only ++ final Map unhandledTags = new TreeMap(); // Visible for testing only // Paper private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only diff --git a/patches/unapplied/server/0064-Configurable-Non-Player-Arrow-Despawn-Rate.patch b/patches/server/0065-Configurable-Non-Player-Arrow-Despawn-Rate.patch similarity index 96% rename from patches/unapplied/server/0064-Configurable-Non-Player-Arrow-Despawn-Rate.patch rename to patches/server/0065-Configurable-Non-Player-Arrow-Despawn-Rate.patch index ff43f5c3e..e3e175fc3 100644 --- a/patches/unapplied/server/0064-Configurable-Non-Player-Arrow-Despawn-Rate.patch +++ b/patches/server/0065-Configurable-Non-Player-Arrow-Despawn-Rate.patch @@ -30,7 +30,7 @@ index 1ab2ede5e9d8939f69fb430084437fda63879fb7..e5d5f4c692e80c616ccde58ab1360477 + } } diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java -index 860c4ca60adfbf265299c0db41eadc0384f68779..97a4d3b3709028d322617efdfe9a5aabe2197d82 100644 +index 04bd882525235e6712082d6b710f33abe555884c..68b15e3061e1e8637a34ee5e0f0953dd23645f49 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java +++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java @@ -310,7 +310,7 @@ public abstract class AbstractArrow extends Projectile { diff --git a/patches/unapplied/server/0065-Add-World-Util-Methods.patch b/patches/server/0066-Add-World-Util-Methods.patch similarity index 88% rename from patches/unapplied/server/0065-Add-World-Util-Methods.patch rename to patches/server/0066-Add-World-Util-Methods.patch index 546038f58..e7f968e35 100644 --- a/patches/unapplied/server/0065-Add-World-Util-Methods.patch +++ b/patches/server/0066-Add-World-Util-Methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c9ee1a12b6fe92db6896cd4abd7e7833b094c9da..41dab560595a6d052c82b4474d824a584756371a 100644 +index 032e1e08413f2d0f601cdc32fe12145e2c1fec5f..19c97a14cbf23130db2de80e3f7f6e0c4ff27662 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -199,7 +199,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -206,7 +206,7 @@ public class ServerLevel extends Level implements WorldGenLevel { public final LevelStorageSource.LevelStorageAccess convertable; public final UUID uuid; @@ -19,10 +19,10 @@ index c9ee1a12b6fe92db6896cd4abd7e7833b094c9da..41dab560595a6d052c82b4474d824a58 } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index dccf23a64bad4fbfcef56eace434884e35919add..123a34b97fe76bd694214ded6174ecb26b970438 100644 +index 79764895307139b34f2b018f3be86d6610503b64..507d38a8e7b643712fe235c73f440c0a52b6d8b2 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -312,11 +312,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -313,11 +313,27 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } @Override diff --git a/patches/unapplied/server/0066-Custom-replacement-for-eaten-items.patch b/patches/server/0067-Custom-replacement-for-eaten-items.patch similarity index 88% rename from patches/unapplied/server/0066-Custom-replacement-for-eaten-items.patch rename to patches/server/0067-Custom-replacement-for-eaten-items.patch index 0f4d9466b..71ba9205f 100644 --- a/patches/unapplied/server/0066-Custom-replacement-for-eaten-items.patch +++ b/patches/server/0067-Custom-replacement-for-eaten-items.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 5335312b9a8c8166590df69a78311652b4b36d7e..4b41ad3d9feeaf7f75c8459fb8acdab9ac1fce61 100644 +index 60356e889f2da17b313ee5cf223ee0c5066182c4..c8e60153986e9be21a1e372d5c1cb25c762ab81b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -3564,9 +3564,10 @@ public abstract class LivingEntity extends Entity { +@@ -3563,9 +3563,10 @@ public abstract class LivingEntity extends Entity { this.triggerItemUseEffects(this.useItem, 16); // CraftBukkit start - fire PlayerItemConsumeEvent ItemStack itemstack; @@ -20,7 +20,7 @@ index 5335312b9a8c8166590df69a78311652b4b36d7e..4b41ad3d9feeaf7f75c8459fb8acdab9 level.getCraftServer().getPluginManager().callEvent(event); if (event.isCancelled()) { -@@ -3580,6 +3581,13 @@ public abstract class LivingEntity extends Entity { +@@ -3579,6 +3580,13 @@ public abstract class LivingEntity extends Entity { } else { itemstack = this.useItem.finishUsingItem(this.level, this); } @@ -34,7 +34,7 @@ index 5335312b9a8c8166590df69a78311652b4b36d7e..4b41ad3d9feeaf7f75c8459fb8acdab9 // CraftBukkit end if (itemstack != this.useItem) { -@@ -3587,6 +3595,11 @@ public abstract class LivingEntity extends Entity { +@@ -3586,6 +3594,11 @@ public abstract class LivingEntity extends Entity { } this.stopUsingItem(); diff --git a/patches/unapplied/server/0067-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/patches/server/0068-handle-NaN-health-absorb-values-and-repair-bad-data.patch similarity index 83% rename from patches/unapplied/server/0067-handle-NaN-health-absorb-values-and-repair-bad-data.patch rename to patches/server/0068-handle-NaN-health-absorb-values-and-repair-bad-data.patch index d78558fcc..59ac6ec42 100644 --- a/patches/unapplied/server/0067-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/patches/server/0068-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -5,10 +5,10 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169beac275b 100644 +index c8e60153986e9be21a1e372d5c1cb25c762ab81b..e5a0f6edbb1d43f8c918b9cee9a291db630663b4 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -764,7 +764,13 @@ public abstract class LivingEntity extends Entity { +@@ -759,7 +759,13 @@ public abstract class LivingEntity extends Entity { @Override public void readAdditionalSaveData(CompoundTag nbt) { @@ -23,7 +23,7 @@ index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169 if (nbt.contains("Attributes", 9) && this.level != null && !this.level.isClientSide) { this.getAttributes().load(nbt.getList("Attributes", 10)); } -@@ -1251,6 +1257,10 @@ public abstract class LivingEntity extends Entity { +@@ -1246,6 +1252,10 @@ public abstract class LivingEntity extends Entity { } public void setHealth(float health) { @@ -34,7 +34,7 @@ index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169 // CraftBukkit start - Handle scaled health if (this instanceof ServerPlayer) { org.bukkit.craftbukkit.entity.CraftPlayer player = ((ServerPlayer) this).getBukkitEntity(); -@@ -3399,7 +3409,7 @@ public abstract class LivingEntity extends Entity { +@@ -3398,7 +3408,7 @@ public abstract class LivingEntity extends Entity { } public void setAbsorptionAmount(float amount) { @@ -44,10 +44,10 @@ index 2ded905b151e7d01859641fdeebcfb2027d60349..7baedf1fb800f2f1bc526377eb32b169 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1a790c9913e8d83276ca3c3158562b2a03e2c82e..f65140c04efd036019c7f91643ecd9644cd498df 100644 +index 97a21ecae2b2b17c9041cd7e5148c68472929d6a..e41df687f7d681574bc16f5d3b1572a3ea9902f0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1716,6 +1716,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1723,6 +1723,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/patches/unapplied/server/0068-Use-a-Shared-Random-for-Entities.patch b/patches/server/0069-Use-a-Shared-Random-for-Entities.patch similarity index 85% rename from patches/unapplied/server/0068-Use-a-Shared-Random-for-Entities.patch rename to patches/server/0069-Use-a-Shared-Random-for-Entities.patch index 771b86a79..f85b5478b 100644 --- a/patches/unapplied/server/0068-Use-a-Shared-Random-for-Entities.patch +++ b/patches/server/0069-Use-a-Shared-Random-for-Entities.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use a Shared Random for Entities Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9fbe3ed59416d773dc5c19d5ea73f95ddd9b5143..287ee89418e28366866e70bd104cd11b5ae0aad6 100644 +index a957a168450ee5c34a58ed993f281ca774fccfc1..30d30c2fd66b312a45d3bf706d41b38724d52a7b 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -153,6 +153,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -153,6 +153,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } @@ -31,7 +31,7 @@ index 9fbe3ed59416d773dc5c19d5ea73f95ddd9b5143..287ee89418e28366866e70bd104cd11b private CraftEntity bukkitEntity; public CraftEntity getBukkitEntity() { -@@ -330,7 +345,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n +@@ -334,7 +349,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, i this.bb = Entity.INITIAL_AABB; this.stuckSpeedMultiplier = Vec3.ZERO; this.nextStep = 1.0F; @@ -41,10 +41,10 @@ index 9fbe3ed59416d773dc5c19d5ea73f95ddd9b5143..287ee89418e28366866e70bd104cd11b this.fluidHeight = new Object2DoubleArrayMap(2); this.firstTick = true; diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java -index 552f758b046e750e1020f309a21d0e475befee10..3ffc1ee8a9ae63c8678c12736fab5d6ba0a21a5b 100644 +index 09ec4d66aaa5b9e4ef09750a76cebc389a4306fd..370513fbc39f178f903ce140ced1a97029dd39db 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java -@@ -50,7 +50,7 @@ public class Squid extends WaterAnimal { +@@ -47,7 +47,7 @@ public class Squid extends WaterAnimal { public Squid(EntityType type, Level world) { super(type, world); diff --git a/patches/unapplied/server/0069-Configurable-spawn-chances-for-skeleton-horses.patch b/patches/server/0070-Configurable-spawn-chances-for-skeleton-horses.patch similarity index 91% rename from patches/unapplied/server/0069-Configurable-spawn-chances-for-skeleton-horses.patch rename to patches/server/0070-Configurable-spawn-chances-for-skeleton-horses.patch index 17dfc2d74..cd2175613 100644 --- a/patches/unapplied/server/0069-Configurable-spawn-chances-for-skeleton-horses.patch +++ b/patches/server/0070-Configurable-spawn-chances-for-skeleton-horses.patch @@ -22,10 +22,10 @@ index e5d5f4c692e80c616ccde58ab13604777eb71101..7addb5c66c88da73a4d80da1e898d629 + } } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e47fffb3a8e2ce12dedce764fbd7ff52a0616426..53713875d95af656abbb30bc7b8c4ba251677615 100644 +index 19c97a14cbf23130db2de80e3f7f6e0c4ff27662..9f7bbd602c19f317d05cd8b72453c2e37d8acff5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -648,7 +648,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -560,7 +560,7 @@ public class ServerLevel extends Level implements WorldGenLevel { blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15)); if (this.isRainingAt(blockposition)) { DifficultyInstance difficultydamagescaler = this.getCurrentDifficultyAt(blockposition); @@ -33,4 +33,4 @@ index e47fffb3a8e2ce12dedce764fbd7ff52a0616426..53713875d95af656abbb30bc7b8c4ba2 + boolean flag1 = this.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.getEffectiveDifficulty() * paperConfig.skeleHorseSpawnChance && !this.getBlockState(blockposition.below()).is(Blocks.LIGHTNING_ROD); // Paper if (flag1) { - SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create((Level) this); + SkeletonHorse entityhorseskeleton = (SkeletonHorse) EntityType.SKELETON_HORSE.create(this); diff --git a/patches/unapplied/server/0070-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/patches/server/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch similarity index 64% rename from patches/unapplied/server/0070-Optimize-isValidLocation-getType-and-getBlockData-fo.patch rename to patches/server/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch index ec49f1657..69075c212 100644 --- a/patches/unapplied/server/0070-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/patches/server/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -13,12 +13,12 @@ Replace all calls to the new place to the unnecessary forward. Optimize getType and getBlockData to manually inline and optimize the calls diff --git a/src/main/java/net/minecraft/core/Vec3i.java b/src/main/java/net/minecraft/core/Vec3i.java -index f484cf19e1ed6f4e14a6c324c59511e822335ba7..f924f2b20800dfde93eeafea3614203661d35389 100644 +index 543d5a67e76a3114f6eac29a053ff04ceecb6256..c33bac27edfdab4c3ee618c9ed39c629b1513f09 100644 --- a/src/main/java/net/minecraft/core/Vec3i.java +++ b/src/main/java/net/minecraft/core/Vec3i.java -@@ -21,6 +21,15 @@ public class Vec3i implements Comparable { - private int y; - private int z; +@@ -33,6 +33,15 @@ public class Vec3i implements Comparable { + return CODEC.flatXmap(checkOffsetAxes(maxAbsValue), checkOffsetAxes(maxAbsValue)); + } + // Paper start + public boolean isValidLocation(net.minecraft.world.level.LevelHeightAccessor levelHeightAccessor) { @@ -33,10 +33,10 @@ index f484cf19e1ed6f4e14a6c324c59511e822335ba7..f924f2b20800dfde93eeafea36142036 this.x = x; this.y = y; diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 123a34b97fe76bd694214ded6174ecb26b970438..1f1601f0e7f30bb44c57c771b93e7aa8be3e9725 100644 +index 507d38a8e7b643712fe235c73f440c0a52b6d8b2..b6f2be487720e31a548a3cee4cd73319f402f6ff 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -262,7 +262,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -263,7 +263,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { } public boolean isInWorldBounds(BlockPos pos) { @@ -46,23 +46,23 @@ index 123a34b97fe76bd694214ded6174ecb26b970438..1f1601f0e7f30bb44c57c771b93e7aa8 public static boolean isInSpawnableBounds(BlockPos pos) { diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java -index 6a3f98edbc2b4056c5baf00277caee327e444a77..974ab04b08bbd3c27a394b37c1af112be5f28f43 100644 +index 2e5619a581d18008df31f4b2a279e7418264aa4f..7bec92f343d5c79fdff43b36272c0e979c6879d4 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java +++ b/src/main/java/net/minecraft/world/level/chunk/ChunkAccess.java -@@ -29,6 +29,7 @@ public interface ChunkAccess extends BlockGetter, FeatureAccess { +@@ -113,6 +113,7 @@ public abstract class ChunkAccess implements BlockGetter, BiomeManager.NoiseBiom return GameEventDispatcher.NOOP; } -+ BlockState getType(final int x, final int y, final int z); // Paper ++ public abstract BlockState getType(final int x, final int y, final int z); // Paper @Nullable - BlockState setBlockState(BlockPos pos, BlockState state, boolean moved); + public abstract BlockState setBlockState(BlockPos pos, BlockState state, boolean moved); diff --git a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java -index 84ebfdfc4350fb57ca2959e000b33b8d5efa6e0b..69c2454533e6f21c70792b555ec02c6bc6d169b3 100644 +index 31d01f8df394e718f1f2a268ddccee77b6706eb9..25e9cc39d748dfd99d38f504c14f40f9ec7bdd2d 100644 --- a/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/EmptyLevelChunk.java -@@ -19,6 +19,11 @@ public class EmptyLevelChunk extends LevelChunk { - super(world, pos, new EmptyLevelChunk.EmptyChunkBiomeContainer(world)); +@@ -18,6 +18,11 @@ public class EmptyLevelChunk extends LevelChunk { + super(world, pos); } + // Paper start @@ -74,10 +74,10 @@ index 84ebfdfc4350fb57ca2959e000b33b8d5efa6e0b..69c2454533e6f21c70792b555ec02c6b public BlockState getBlockState(BlockPos pos) { return Blocks.VOID_AIR.defaultBlockState(); diff --git a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java -index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1140e1c62 100644 +index 65967fd834d8aadf9a6af3ee26164819488dc680..de235aadb3aebcd173fea7ea4783c1e8aa8f4c6a 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ImposterProtoChunk.java -@@ -40,6 +40,11 @@ public class ImposterProtoChunk extends ProtoChunk { +@@ -46,6 +46,11 @@ public class ImposterProtoChunk extends ProtoChunk { public BlockState getBlockState(BlockPos pos) { return this.wrapped.getBlockState(pos); } @@ -90,11 +90,11 @@ index c1beb6d5fc3cabfeacf0ffbf563e53ff7984c5d3..452b513e8b89d865a396066adaf4feb1 @Override public FluidState getFluidState(BlockPos pos) { diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index aa6db78339d6b0661ac3be12c82da92742b5f519..29fda19d7e1a8b6675598de22967e2aec81091fa 100644 +index ac17877ea6e210acfb54961a2818ca1ae7f6c738..6e998ca50d07e1ecb0cd0639b81cc07e8be71cb8 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -337,12 +337,28 @@ public class LevelChunk implements ChunkAccess { - return this.sections; +@@ -287,12 +287,28 @@ public class LevelChunk extends ChunkAccess { + }); } + // Paper start - Optimize getBlockData to reduce instructions @@ -126,49 +126,23 @@ index aa6db78339d6b0661ac3be12c82da92742b5f519..29fda19d7e1a8b6675598de22967e2ae BlockState iblockdata = null; diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java -index 03fd5684aec8fa0d87963f2adcd8244e92840917..5fd66020a937b641e2a060cf38df731a43f3bf55 100644 +index 10848c41b7f2f83717df650bd1fac7149c3a32af..92a42aea3f54c49e2055e8000645d91da9471e09 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java -@@ -15,10 +15,10 @@ public class LevelChunkSection { +@@ -20,7 +20,7 @@ public class LevelChunkSection { public static final int SECTION_SIZE = 4096; - public static final Palette GLOBAL_BLOCKSTATE_PALETTE = new GlobalPalette<>(Block.BLOCK_STATE_REGISTRY, Blocks.AIR.defaultBlockState()); + public static final int BIOME_CONTAINER_BITS = 2; private final int bottomBlockY; - private short nonEmptyBlockCount; + short nonEmptyBlockCount; // Paper - package-private private short tickingBlockCount; private short tickingFluidCount; -- private final PalettedContainer states; -+ final PalettedContainer states; // Paper - package-private - - public LevelChunkSection(int yOffset) { - this(yOffset, (short)0, (short)0, (short)0); -@@ -37,7 +37,7 @@ public class LevelChunkSection { - } - - public BlockState getBlockState(int x, int y, int z) { -- return this.states.get(x, y, z); -+ return this.states.get(y << 8 | z << 4 | x); // Paper - inline - } - - public FluidState getFluidState(int x, int y, int z) { -diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -index 527238373b944a1e4a6e3a408534c72dd4c84035..bb8fd88aebb550edec8c679622a02a595cbc6694 100644 ---- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java -@@ -135,7 +135,7 @@ public class PalettedContainer implements PaletteResize { - } - - public T get(int x, int y, int z) { -- return this.get(getIndex(x, y, z)); -+ return this.get(y << 8 | z << 4 | x); // Paper - inline - } - - protected T get(int index) { + public final PalettedContainer states; diff --git a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java -index 39fe8f64528ad08594aaaa88e5c989c82e4e29d3..873fea54aecca411b6dee1ed3566f93c4fb9670f 100644 +index b7dbdcb0ce7948c6f98ec67d0cf2033a8e348085..568dc3c9cbf009a3892766cacdd00667556e27c5 100644 --- a/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/ProtoChunk.java -@@ -104,14 +104,18 @@ public class ProtoChunk implements ChunkAccess { +@@ -87,14 +87,18 @@ public class ProtoChunk extends ChunkAccess { @Override public BlockState getBlockState(BlockPos pos) { @@ -181,10 +155,10 @@ index 39fe8f64528ad08594aaaa88e5c989c82e4e29d3..873fea54aecca411b6dee1ed3566f93c + if (this.isOutsideBuildHeight(y)) { return Blocks.VOID_AIR.defaultBlockState(); } else { -- LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(i)]; -- return LevelChunkSection.isEmpty(levelChunkSection) ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15); -+ LevelChunkSection chunksection = this.getSections()[this.getSectionIndex(y)]; -+ return chunksection == LevelChunk.EMPTY_SECTION || chunksection.isEmpty() ? Blocks.AIR.defaultBlockState() : chunksection.getBlockState(x & 15, y & 15, z & 15); +- LevelChunkSection levelChunkSection = this.getSection(this.getSectionIndex(i)); +- return levelChunkSection.hasOnlyAir() ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(pos.getX() & 15, i & 15, pos.getZ() & 15); ++ LevelChunkSection levelChunkSection = this.getSections()[this.getSectionIndex(y)]; ++ return levelChunkSection.hasOnlyAir() ? Blocks.AIR.defaultBlockState() : levelChunkSection.getBlockState(x & 15, y & 15, z & 15); } } + // Paper end diff --git a/patches/unapplied/server/0071-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch similarity index 89% rename from patches/unapplied/server/0071-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch rename to patches/server/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 8703fd5a5..f2fdc316c 100644 --- a/patches/unapplied/server/0071-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/patches/server/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener Saves on some object allocation and processing when no plugin listens to this diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2450bb69e08190804212172a298c1f12cd5345d7..d6195f7b0bac1bd1ababe8c4eec07654c323c014 100644 +index 5cf85636e089a4bf2422d76b8df52c1166d3f148..697f2e6c10a74cb60191ed8c1cb563360089c8ea 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1384,6 +1384,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 75fa3f2392936d86d29fee73079507c642660b30..525cf19c9ecc5886720d0505f0554b667ef3267f 100644 +index 9f7bbd602c19f317d05cd8b72453c2e37d8acff5..bd53d00db453767fb43ba0e50c0dc0a7730d55a4 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -198,6 +198,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -205,6 +205,7 @@ public class ServerLevel extends Level implements WorldGenLevel { private int tickPosition; public final LevelStorageSource.LevelStorageAccess convertable; public final UUID uuid; @@ -30,10 +30,10 @@ index 75fa3f2392936d86d29fee73079507c642660b30..525cf19c9ecc5886720d0505f0554b66 @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI return this.chunkSource.getChunk(x, z, false); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 1f1601f0e7f30bb44c57c771b93e7aa8be3e9725..322edb169e9b482aac71292b992d4a3c2622b2d8 100644 +index b6f2be487720e31a548a3cee4cd73319f402f6ff..bb6083b40e211964730f88057df509f6d860bc11 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java -@@ -473,7 +473,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -474,7 +474,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { // CraftBukkit start iblockdata1.updateIndirectNeighbourShapes(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam CraftWorld world = ((ServerLevel) this).getWorld(); @@ -42,7 +42,7 @@ index 1f1601f0e7f30bb44c57c771b93e7aa8be3e9725..322edb169e9b482aac71292b992d4a3c BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); this.getCraftServer().getPluginManager().callEvent(event); -@@ -586,7 +586,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { +@@ -587,7 +587,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { try { // CraftBukkit start CraftWorld world = ((ServerLevel) this).getWorld(); @@ -73,7 +73,7 @@ index 24227939493f852a88477c84160bda1605291eb0..1f8cf302d2309aec2955832ffafd87f1 } } diff --git a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java -index 9edf1b87e59d589b053e5b4fee15faa221718c2f..65a163d93a293e1e0a12a300d6335a700099cac2 100644 +index bad85ac1f369d1044fa2e68b6e49cebc3c253c5b..e12b76238cb52a1007f2102473b7f892f8521b62 100644 --- a/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java +++ b/src/main/java/net/minecraft/world/level/block/DoublePlantBlock.java @@ -4,6 +4,7 @@ import javax.annotation.Nullable; diff --git a/patches/unapplied/server/0072-Entity-AddTo-RemoveFrom-World-Events.patch b/patches/server/0073-Entity-AddTo-RemoveFrom-World-Events.patch similarity index 82% rename from patches/unapplied/server/0072-Entity-AddTo-RemoveFrom-World-Events.patch rename to patches/server/0073-Entity-AddTo-RemoveFrom-World-Events.patch index 8c7af1f4f..eabfd7d53 100644 --- a/patches/unapplied/server/0072-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/patches/server/0073-Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c2dc2ec29949074e71d0b4e5244ec71587f01178..9d6ff9aff140574038b7f619cdfebf47d4b3a14c 100644 +index bd53d00db453767fb43ba0e50c0dc0a7730d55a4..9582da4afcc68b3c898be86dcf74f0833258e34c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1956,6 +1956,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1990,6 +1990,7 @@ public class ServerLevel extends Level implements WorldGenLevel { entity.setOrigin(entity.getOriginVector().toLocation(getWorld())); } // Paper end @@ -16,7 +16,7 @@ index c2dc2ec29949074e71d0b4e5244ec71587f01178..9d6ff9aff140574038b7f619cdfebf47 } public void onTrackingEnd(Entity entity) { -@@ -2020,6 +2021,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2054,6 +2055,7 @@ public class ServerLevel extends Level implements WorldGenLevel { } entity.valid = false; // CraftBukkit diff --git a/patches/unapplied/server/0073-Configurable-Chunk-Inhabited-Time.patch b/patches/server/0074-Configurable-Chunk-Inhabited-Time.patch similarity index 76% rename from patches/unapplied/server/0073-Configurable-Chunk-Inhabited-Time.patch rename to patches/server/0074-Configurable-Chunk-Inhabited-Time.patch index 2c00f8faf..002a8c66c 100644 --- a/patches/unapplied/server/0073-Configurable-Chunk-Inhabited-Time.patch +++ b/patches/server/0074-Configurable-Chunk-Inhabited-Time.patch @@ -30,15 +30,20 @@ index 7addb5c66c88da73a4d80da1e898d629d76074f0..a0688ef7eb38e7c156193db3d94c44a3 + } } diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -index 29fda19d7e1a8b6675598de22967e2aec81091fa..702dbe24bfd19b0999648d4364f68a5675bee6e0 100644 +index 6e998ca50d07e1ecb0cd0639b81cc07e8be71cb8..e641779c58b503c88cb533a45a3614f45c4b8fa3 100644 --- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java +++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java -@@ -984,7 +984,7 @@ public class LevelChunk implements ChunkAccess { - - @Override - public long getInhabitedTime() { -- return this.inhabitedTime; -+ return this.level.paperConfig.fixedInhabitedTime < 0 ? this.inhabitedTime : this.level.paperConfig.fixedInhabitedTime; // Paper +@@ -280,6 +280,13 @@ public class LevelChunk extends ChunkAccess { + return new ChunkAccess.TicksToSave(this.blockTicks, this.fluidTicks); } ++ // Paper start ++ @Override ++ public long getInhabitedTime() { ++ return this.level.paperConfig.fixedInhabitedTime < 0 ? super.getInhabitedTime() : this.level.paperConfig.fixedInhabitedTime; ++ } ++ // Paper end ++ @Override + public GameEventDispatcher getEventDispatcher(int ySectionCoord) { + return (GameEventDispatcher) this.gameEventDispatcherSections.computeIfAbsent(ySectionCoord, (j) -> { diff --git a/patches/unapplied/server/0074-EntityPathfindEvent.patch b/patches/server/0075-EntityPathfindEvent.patch similarity index 89% rename from patches/unapplied/server/0074-EntityPathfindEvent.patch rename to patches/server/0075-EntityPathfindEvent.patch index 659852876..49f7b83e8 100644 --- a/patches/unapplied/server/0074-EntityPathfindEvent.patch +++ b/patches/server/0075-EntityPathfindEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent Fires when an Entity decides to start moving to a location. diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java -index 3afe97f4e330016164e741934c888f5b85824e67..6cdb0f0f881ea57c95821914262208c4b636587e 100644 +index 57a17458dbe1629ebbf58fea9f43f09511b91fb0..dda38820f763f93513b5d83a4239197b48a45238 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java @@ -35,7 +35,7 @@ public class FlyingPathNavigation extends PathNavigation { @@ -19,10 +19,10 @@ index 3afe97f4e330016164e741934c888f5b85824e67..6cdb0f0f881ea57c95821914262208c4 @Override diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java -index d2e71f1e70a8b3360110f7e5e6c5ec278218ae27..f351b1eb923cc72bc5bb7f891d27246af14f4e1d 100644 +index a9fd90d5282bd013e031b9d7481e3f777d6892c6..a6f8ca71ba5d107cfbd24b8e8a225195dc233637 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java -@@ -70,7 +70,7 @@ public class GroundPathNavigation extends PathNavigation { +@@ -69,7 +69,7 @@ public class GroundPathNavigation extends PathNavigation { @Override public Path createPath(Entity entity, int distance) { @@ -32,7 +32,7 @@ index d2e71f1e70a8b3360110f7e5e6c5ec278218ae27..f351b1eb923cc72bc5bb7f891d27246a private int getSurfaceY() { diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java -index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a9be8dd4d 100644 +index 80c172b57857a19d5f78c6f06335dc7c957ccbb6..e10d377eb7540ed54ddcb6632afc2395c021b8ab 100644 --- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java +++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java @@ -10,6 +10,7 @@ import net.minecraft.core.BlockPos; @@ -43,7 +43,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Mob; -@@ -108,7 +109,13 @@ public abstract class PathNavigation { +@@ -110,7 +111,13 @@ public abstract class PathNavigation { @Nullable public Path createPath(BlockPos target, int distance) { @@ -58,7 +58,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a } @Nullable -@@ -118,7 +125,7 @@ public abstract class PathNavigation { +@@ -120,7 +127,7 @@ public abstract class PathNavigation { @Nullable public Path createPath(Entity entity, int distance) { @@ -67,7 +67,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a } @Nullable -@@ -128,6 +135,16 @@ public abstract class PathNavigation { +@@ -130,6 +137,16 @@ public abstract class PathNavigation { @Nullable protected Path createPath(Set positions, int range, boolean useHeadPos, int distance, float followRange) { @@ -84,7 +84,7 @@ index f4f2b7a1de7eb37c3d6331bd16f916cf4bbf1a03..5ddc033594c26a69f8c610cf1610a06a if (positions.isEmpty()) { return null; } else if (this.mob.getY() < (double)this.level.getMinBuildHeight()) { -@@ -137,6 +154,23 @@ public abstract class PathNavigation { +@@ -139,6 +156,23 @@ public abstract class PathNavigation { } else if (this.path != null && !this.path.isDone() && positions.contains(this.targetPos)) { return this.path; } else { diff --git a/patches/unapplied/server/0038-Per-Player-View-Distance-API-placeholders.patch b/patches/unapplied/server/0038-Per-Player-View-Distance-API-placeholders.patch deleted file mode 100644 index 3a8ce8520..000000000 --- a/patches/unapplied/server/0038-Per-Player-View-Distance-API-placeholders.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown -Date: Mon, 6 May 2019 01:29:25 -0400 -Subject: [PATCH] Per-Player View Distance API placeholders - -I hope to look at this more in-depth soon. It appears doable. -However this should not block the update. - -diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 6bee392787a517d5ab8966b94c035db00eeb7d99..ae63083b1283a5628fa900827c0af6e9254592c2 100644 ---- a/src/main/java/net/minecraft/server/level/ServerPlayer.java -+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -171,6 +171,8 @@ import org.bukkit.inventory.MainHand; - - public class ServerPlayer extends Player { - -+ public final int getViewDistance() { return this.getLevel().getChunkSource().chunkMap.viewDistance - 1; } // Paper - placeholder -+ - private static final Logger LOGGER = LogManager.getLogger(); - private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32; - private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10; -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cb91db9a25b96b0ad2b9c6a61ba26cd6d638b8a0..6572528a3a664f10d8c3a0d0808c411fcd031f71 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -371,6 +371,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - connection.disconnect(message == null ? net.kyori.adventure.text.Component.empty() : message); - } - } -+ -+ @Override -+ public int getViewDistance() { -+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ } -+ -+ @Override -+ public void setViewDistance(int viewDistance) { -+ throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO -+ } - // Paper end - - @Override