From 29fe2d1e2f0f84cd6f237a27b692e92131c2e998 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 28 Jan 2020 19:43:57 +0000 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 93e39ce1 Clarify documentation regarding getMaterial with legacyName = true c3aeaea0 Improve dependency tracker 14c9d275 Add support for transitive depends in load access warning c8afe560 SPIGOT-5526: Add EntityEnterBlockEvent 6bb6f07d SPIGOT-5548: Show error that hints towards plugins misusing reflection ed75537d SPIGOT-5546: Fix bad depend access using wrong provider in message 4e4c0ee9 Fix buggy classloader warning triggering for all classes 89586a4c Print warning when loading classes from depends that have not been specified d4fe9680 Fix bug where disablePlugin could remove ConfigurationSerializable classes from other plugins 85e683b7 Add additional checkstyle checks 612fd8e1 Correct max page count in BookMeta docs fa8a9781 Correct max title length in BookMeta docs CraftBukkit Changes: ab13a117 SPIGOT-5550: Cancelled ProjectileLaunchEvent still plays sound for eggs 44016b1d SPIGOT-5538: Using javaw to run GUI prints input error e653ae76 SPIGOT-5526: Call EntityEnterBlockEvent for bees trying to enter hives 6515ea49 SPIGOT-5537: Bee nests generated by growing trees near flower have no bees d82b3149 Remove unused CraftWorld.getId method 10763a88 Change some block == AIR checks to isAir to catch CAVE_AIR Spigot Changes: f2c1cd15 Rebuild patches bcd458ad Reformat patches --- ...t-sendMessage-methods-to-CommandSend.patch | 2 +- .../Add-String-based-Action-Bar-API.patch | 2 +- ...dd-an-asterisk-to-legacy-API-plugins.patch | 2 +- ...eload-permissions.yml-and-require-co.patch | 6 +- ...n-option-to-prevent-player-names-fro.patch | 4 +- .../Add-exception-reporting-event.patch | 2 +- ...or-plugins-modifying-the-parent-of-t.patch | 4 +- .../Allow-Reloading-of-Command-Aliases.patch | 4 +- ...ly-disable-plugins-that-fail-to-load.patch | 2 +- .../Basic-PlayerProfile-API.patch | 4 +- ...lose-Plugin-Class-Loaders-on-Disable.patch | 6 +- .../Complete-resource-pack-API.patch | 6 +- Spigot-API-Patches/Entity-Origin-API.patch | 2 +- .../Entity-fromMobSpawner.patch | 2 +- Spigot-API-Patches/Entity-getChunk-API.patch | 2 +- .../Entity-getEntitySpawnReason.patch | 2 +- .../Expose-server-CommandMap.patch | 8 +- .../Expose-the-internal-current-tick.patch | 4 +- ...ault-permission-message-configurable.patch | 4 +- ...deadlock-risk-in-firing-async-events.patch | 6 +- ...tion-supression-of-EntityDismount-Ve.patch | 22 +- Spigot-API-Patches/Timings-v2.patch | 208 ++++++++---------- .../Use-ASM-for-event-executors.patch | 2 +- ...ies-option-to-debug-dupe-uuid-issues.patch | 4 +- Spigot-Server-Patches/Add-Heightmap-API.patch | 4 +- .../Add-World-Util-Methods.patch | 4 +- .../Add-exception-reporting-event.patch | 2 +- .../Add-sun-related-API.patch | 6 +- ...d-version-history-to-version-command.patch | 6 +- .../Allow-for-toggling-of-spawn-chunks.patch | 4 +- ...Item-entities-with-World.spawnEntity.patch | 2 +- Spigot-Server-Patches/Anti-Xray.patch | 2 +- .../Asynchronous-chunk-IO-and-loading.patch | 2 +- Spigot-Server-Patches/BlockDestroyEvent.patch | 2 +- ...entation-of-tile-entity-removal-list.patch | 2 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 2 +- .../Disable-spigot-tick-limiters.patch | 2 +- .../Expand-Explosions-API.patch | 2 +- ...ld.spawnParticle-API-and-add-Builder.patch | 2 +- ...PI-for-Reason-Source-Triggering-play.patch | 32 +-- ...r-redstone-torch-rapid-clock-removal.patch | 4 +- ...g-BlockPlaceEvent-triggering-physics.patch | 2 +- .../Fix-MC-117075-TE-Unload-Lag-Spike.patch | 2 +- ...x-some-generation-concurrency-issues.patch | 6 +- ...hanging-entities-that-are-not-ItemFr.patch | 2 +- ...ead-Entities-in-entityList-iteration.patch | 4 +- .../Implement-World.getEntity-UUID-API.patch | 2 +- Spigot-Server-Patches/MC-Utils.patch | 19 +- ...ckPhysicsEvent-if-a-plugin-has-a-lis.patch | 10 +- ...e-getChunkAt-calls-for-loaded-chunks.patch | 2 +- .../Optimize-Captured-TileEntity-Lookup.patch | 2 +- ...imize-World.isLoaded-BlockPosition-Z.patch | 2 +- .../Optimize-explosions.patch | 16 +- ...Location-getType-and-getBlockData-fo.patch | 2 +- .../Optimize-redstone-algorithm.patch | 8 +- ...t-armor-stands-from-doing-entity-loo.patch | 4 +- .../Paper-config-files.patch | 20 +- .../PlayerLaunchProjectileEvent.patch | 35 +-- ...event-tile-entity-and-entity-crashes.patch | 4 +- Spigot-Server-Patches/Reduce-sync-loads.patch | 2 +- ...Remove-unused-World-Tile-Entity-List.patch | 2 +- .../Seed-based-feature-search.patch | 10 +- ...dEffects-only-to-players-who-can-see.patch | 4 +- ...ets-from-world-player-list-not-serve.patch | 2 +- Spigot-Server-Patches/Timings-v2.patch | 13 +- ...ams-to-redirect-System.out-err-to-lo.patch | 4 +- ...oleAppender-for-console-improvements.patch | 30 +-- .../Use-a-Queue-for-Queueing-Commands.patch | 2 +- ...etChunkIfLoadedImmediately-in-places.patch | 8 +- .../Vanished-players-don-t-have-rights.patch | 14 +- ...e-implementations-for-captured-block.patch | 30 ++- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 74 files changed, 329 insertions(+), 330 deletions(-) diff --git a/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch index 24009bfa68..97d6b41fba 100644 --- a/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch +++ b/Spigot-API-Patches/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 74816c63..be11d52a 100644 +index a9020ecc..d3b3a8bf 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java @@ -0,0 +0,0 @@ public interface CommandSender extends Permissible { diff --git a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch index 1cddebd24b..50d0df381e 100644 --- a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch +++ b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 307e5568..85a5637f 100644 +index 943e6a64..58a6795d 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM diff --git a/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch b/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch index 294d3161c0..cf7187638a 100644 --- a/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch +++ b/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch @@ -43,7 +43,7 @@ index d4e74d29..6cfd9f3c 100644 StringBuilder pluginList = new StringBuilder(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index bc7bf6a3..31a70b29 100644 +index 32ec68b4..8ff228ce 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch b/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch index 38656351b7..fc0b3c32aa 100644 --- a/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch +++ b/Spigot-API-Patches/Add-command-to-reload-permissions.yml-and-require-co.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index b92304e9..a3682b29 100644 +index f152a60f..58a183b9 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -24,7 +24,7 @@ index b92304e9..a3682b29 100644 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index d35d2def..18faba0e 100644 +index 74f9d2bb..ca0b63fa 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { @@ -85,7 +85,7 @@ index 50cc311b..c62da413 100644 } } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 9a09b4d2..c7388d51 100644 +index 861d808c..1c355a75 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { diff --git a/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch index b5e188e2ed..edcdba58b1 100644 --- a/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-API-Patches/Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index a0a8b540..b5b77b2d 100644 +index a8fe9925..b4fef76b 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -27,7 +27,7 @@ index a0a8b540..b5b77b2d 100644 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index d20e044d..103897fb 100644 +index 9e59c9bf..c108478a 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { diff --git a/Spigot-API-Patches/Add-exception-reporting-event.patch b/Spigot-API-Patches/Add-exception-reporting-event.patch index fb1c97e62d..3c763a32a8 100644 --- a/Spigot-API-Patches/Add-exception-reporting-event.patch +++ b/Spigot-API-Patches/Add-exception-reporting-event.patch @@ -506,7 +506,7 @@ index f020cb04..adfc7aae 100644 } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 53e5045f..9a09b4d2 100644 +index 3c5d8a0e..861d808c 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ import java.util.WeakHashMap; diff --git a/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch index bf4ed19419..0f4d516052 100644 --- a/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch +++ b/Spigot-API-Patches/Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -87,13 +87,13 @@ index bb2e55e9..04fa3991 100644 /** diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 7133be0a..9924780d 100644 +index 36f542a8..3a02dbe9 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -0,0 +0,0 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot - final JavaPlugin plugin; private JavaPlugin pluginInit; private IllegalStateException pluginState; + private final Set seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>()); + private java.util.logging.Logger logger; // Paper - add field static { diff --git a/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch b/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch index a625d97a12..60d8f6621d 100644 --- a/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-API-Patches/Allow-Reloading-of-Command-Aliases.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index a3682b29..a0a8b540 100644 +index 58a183b9..a8fe9925 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -26,7 +26,7 @@ index a3682b29..a0a8b540 100644 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 18faba0e..d20e044d 100644 +index ca0b63fa..9e59c9bf 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { diff --git a/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch b/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch index c94ce887ff..cb6ca2206c 100644 --- a/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch +++ b/Spigot-API-Patches/Automatically-disable-plugins-that-fail-to-load.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Automatically disable plugins that fail to load diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 82e379d1..12601db6 100644 +index 50a51394..5cc37eee 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-API-Patches/Basic-PlayerProfile-API.patch b/Spigot-API-Patches/Basic-PlayerProfile-API.patch index afc6050935..a2d939bf38 100644 --- a/Spigot-API-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-API-Patches/Basic-PlayerProfile-API.patch @@ -235,7 +235,7 @@ index 00000000..7b3b6ef5 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index b5b77b2d..161a714e 100644 +index b4fef76b..c3bcc653 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -280,7 +280,7 @@ index b5b77b2d..161a714e 100644 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 103897fb..463724e4 100644 +index c108478a..48d8c967 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { diff --git a/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch b/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch index 377d8f42b2..05ae1f1438 100644 --- a/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch +++ b/Spigot-API-Patches/Close-Plugin-Class-Loaders-on-Disable.patch @@ -53,7 +53,7 @@ index 41e26451..86cc5025 100644 * Gets a {@link Permission} from its fully qualified name * diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index c7388d51..132c861c 100644 +index 1c355a75..7453230c 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { @@ -95,9 +95,9 @@ index c7388d51..132c861c 100644 + disablePlugins(true); // Paper - close Classloader on disable plugins.clear(); lookupNames.clear(); - HandlerList.unregisterAll(); + dependencyGraph = GraphBuilder.directed().build(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 06b6724f..bc7bf6a3 100644 +index e72cbde4..32ec68b4 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-API-Patches/Complete-resource-pack-API.patch b/Spigot-API-Patches/Complete-resource-pack-API.patch index 773901d323..5dd7b7a6dc 100644 --- a/Spigot-API-Patches/Complete-resource-pack-API.patch +++ b/Spigot-API-Patches/Complete-resource-pack-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 2017a51d..307e5568 100644 +index f0f02c32..943e6a64 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -79,8 +79,8 @@ index 2017a51d..307e5568 100644 + // Paper end + // Spigot start - public class Spigot extends Entity.Spigot - { + public class Spigot extends Entity.Spigot { + diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java index b9819565..4c2102a1 100644 --- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java diff --git a/Spigot-API-Patches/Entity-Origin-API.patch b/Spigot-API-Patches/Entity-Origin-API.patch index 519d6313be..17664b31d0 100644 --- a/Spigot-API-Patches/Entity-Origin-API.patch +++ b/Spigot-API-Patches/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 d708d62b..8cfcc3a5 100644 +index 6b550dda..4e4445d1 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/Spigot-API-Patches/Entity-fromMobSpawner.patch b/Spigot-API-Patches/Entity-fromMobSpawner.patch index c129428c5e..b3aa5633c5 100644 --- a/Spigot-API-Patches/Entity-fromMobSpawner.patch +++ b/Spigot-API-Patches/Entity-fromMobSpawner.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 8cfcc3a5..bd8507f6 100644 +index 4e4445d1..e2952209 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/Spigot-API-Patches/Entity-getChunk-API.patch b/Spigot-API-Patches/Entity-getChunk-API.patch index f6c162ece6..196d50bcd9 100644 --- a/Spigot-API-Patches/Entity-getChunk-API.patch +++ b/Spigot-API-Patches/Entity-getChunk-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API Get the chunk the entity is currently registered to diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index bd8507f6..79b94800 100644 +index e2952209..a8dbf282 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/Entity-getEntitySpawnReason.patch b/Spigot-API-Patches/Entity-getEntitySpawnReason.patch index 99d2f0b48b..988eb4f9d6 100644 --- a/Spigot-API-Patches/Entity-getEntitySpawnReason.patch +++ b/Spigot-API-Patches/Entity-getEntitySpawnReason.patch @@ -10,7 +10,7 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 83e02aea..60dbfab0 100644 +index 45e0dffe..5518ecd2 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent diff --git a/Spigot-API-Patches/Expose-server-CommandMap.patch b/Spigot-API-Patches/Expose-server-CommandMap.patch index 71aae529dd..1f96ead797 100644 --- a/Spigot-API-Patches/Expose-server-CommandMap.patch +++ b/Spigot-API-Patches/Expose-server-CommandMap.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 9f87f333..63e48ef3 100644 +index f712d27b..487ecdad 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -26,10 +26,10 @@ index 9f87f333..63e48ef3 100644 + // Paper end + @NotNull - public static Server.Spigot spigot() - { + public static Server.Spigot spigot() { + return server.spigot(); diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index e1dfa92a..87300a5d 100644 +index be17dcc6..425d8781 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { diff --git a/Spigot-API-Patches/Expose-the-internal-current-tick.patch b/Spigot-API-Patches/Expose-the-internal-current-tick.patch index e001c02ebd..d2b8b4a00e 100644 --- a/Spigot-API-Patches/Expose-the-internal-current-tick.patch +++ b/Spigot-API-Patches/Expose-the-internal-current-tick.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose the internal current tick diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 6db69159..231bc6e3 100644 +index 570c5bc8..388c2bbf 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -20,7 +20,7 @@ index 6db69159..231bc6e3 100644 @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 27d3b5ad..31470479 100644 +index 5e94b2b0..a1371730 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { diff --git a/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch b/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch index 4002335b53..ffe0cb6039 100644 --- a/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch +++ b/Spigot-API-Patches/Make-the-default-permission-message-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 0c519c41..2148a3c2 100644 +index d1ac7856..ee03abae 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -25,7 +25,7 @@ index 0c519c41..2148a3c2 100644 * Creates a PlayerProfile for the specified uuid, with name as null * @param uuid UUID to create profile for diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 8a76df52..1cbb9bc6 100644 +index 409c1624..e9e64060 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { diff --git a/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch b/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch index 2cfe2367dd..1f9d1d6c92 100644 --- a/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch +++ b/Spigot-API-Patches/Remove-deadlock-risk-in-firing-async-events.patch @@ -16,7 +16,7 @@ which results in a hard crash. This change removes the synchronize and adds some protection around enable/disable diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 79b94800..04365232 100644 +index a8dbf282..b4069dbf 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; @@ -29,7 +29,7 @@ index 79b94800..04365232 100644 * * @return a new copy of Location containing the position of this entity diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 132c861c..d0e735bc 100644 +index 7453230c..634e51d5 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { @@ -99,7 +99,7 @@ index 132c861c..d0e735bc 100644 RegisteredListener[] listeners = handlers.getRegisteredListeners(); diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java -index 17dbe913..bae26ce7 100644 +index f188cd4f..1941c9f4 100644 --- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java +++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java @@ -0,0 +0,0 @@ public class PluginManagerTest { diff --git a/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch b/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch index 9b0ae3720a..c65acce2f2 100644 --- a/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch +++ b/Spigot-API-Patches/Support-cancellation-supression-of-EntityDismount-Ve.patch @@ -64,34 +64,34 @@ index 963b9ead..a976c32d 100644 @Override public HandlerList getHandlers() { diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -index a473b2c6..a5b4aed5 100644 +index 00d8ec81..a7632c8f 100644 --- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java +++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -@@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable +@@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean cancelled; private final Entity dismounted; + private final boolean isCancellable; // Paper - public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) - { + public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) { +- super(what); + // Paper start + this(what, dismounted, true); + } + -+ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) -+ { ++ ++ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) { + // Paper end - super( what ); ++ super( what ); this.dismounted = dismounted; + this.isCancellable = isCancellable; // Paper } @NotNull -@@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable +@@ -0,0 +0,0 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { + @Override - public void setCancelled(boolean cancel) - { + public void setCancelled(boolean cancel) { + // Paper start + if (cancel && !isCancellable) { + return; @@ -106,5 +106,5 @@ index a473b2c6..a5b4aed5 100644 + @NotNull @Override - public HandlerList getHandlers() + public HandlerList getHandlers() { -- \ No newline at end of file diff --git a/Spigot-API-Patches/Timings-v2.patch b/Spigot-API-Patches/Timings-v2.patch index fede313a0f..968bfba247 100644 --- a/Spigot-API-Patches/Timings-v2.patch +++ b/Spigot-API-Patches/Timings-v2.patch @@ -3139,7 +3139,7 @@ index 00000000..5989ee21 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 0822b8e5..940c643d 100644 +index bbc68de0..a85b8b86 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -0,0 +0,0 @@ public final class Bukkit { @@ -3151,11 +3151,11 @@ index 0822b8e5..940c643d 100644 /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 11c5c205..c197e381 100644 +index 042db4f5..f4f0f3da 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient { - throw new UnsupportedOperationException( "Not supported yet." ); + throw new UnsupportedOperationException("Not supported yet."); } + // Paper start @@ -3456,7 +3456,7 @@ index 81e4fa57..f020cb04 100644 diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java deleted file mode 100644 -index 6023e4f6..00000000 +index 2a145d85..00000000 --- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java +++ /dev/null @@ -0,0 +0,0 @@ @@ -3506,26 +3506,23 @@ index 6023e4f6..00000000 - - // Spigot start - redesigned Timings Command - public void executeSpigotTimings(@NotNull CommandSender sender, @NotNull String[] args) { -- if ( "on".equals( args[0] ) ) -- { -- ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true ); +- if ("on".equals(args[0])) { +- ((SimplePluginManager) Bukkit.getPluginManager()).useTimings(true); - CustomTimingsHandler.reload(); -- sender.sendMessage( "Enabled Timings & Reset" ); +- sender.sendMessage("Enabled Timings & Reset"); - return; -- } else if ( "off".equals( args[0] ) ) -- { -- ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( false ); -- sender.sendMessage( "Disabled Timings" ); +- } else if ("off".equals(args[0])) { +- ((SimplePluginManager) Bukkit.getPluginManager()).useTimings(false); +- sender.sendMessage("Disabled Timings"); - return; - } - -- if ( !Bukkit.getPluginManager().useTimings() ) -- { -- sender.sendMessage( "Please enable timings by typing /timings on" ); +- if (!Bukkit.getPluginManager().useTimings()) { +- sender.sendMessage("Please enable timings by typing /timings on"); - return; - } - -- boolean paste = "paste".equals( args[0] ); +- boolean paste = "paste".equals(args[0]); - if ("reset".equals(args[0])) { - CustomTimingsHandler.reload(); - sender.sendMessage("Timings reset"); @@ -3535,27 +3532,26 @@ index 6023e4f6..00000000 - File timingFolder = new File("timings"); - timingFolder.mkdirs(); - File timings = new File(timingFolder, "timings.txt"); -- ByteArrayOutputStream bout = ( paste ) ? new ByteArrayOutputStream() : null; +- ByteArrayOutputStream bout = (paste) ? new ByteArrayOutputStream() : null; - while (timings.exists()) timings = new File(timingFolder, "timings" + (++index) + ".txt"); - PrintStream fileTimings = null; - try { -- fileTimings = ( paste ) ? new PrintStream( bout ) : new PrintStream( timings ); +- fileTimings = (paste) ? new PrintStream(bout) : new PrintStream(timings); - - CustomTimingsHandler.printTimings(fileTimings); -- fileTimings.println( "Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)" ); +- fileTimings.println("Sample time " + sampleTime + " (" + sampleTime / 1E9 + "s)"); - -- fileTimings.println( "" ); -- fileTimings.println( Bukkit.spigot().getConfig().saveToString() ); -- fileTimings.println( "" ); +- fileTimings.println(""); +- fileTimings.println(Bukkit.spigot().getConfig().saveToString()); +- fileTimings.println(""); - -- if ( paste ) -- { -- new PasteThread( sender, bout ).start(); +- if (paste) { +- new PasteThread(sender, bout).start(); - return; - } - - sender.sendMessage("Timings written to " + timings.getPath()); -- sender.sendMessage( "Paste contents of file into form at http://www.spigotmc.org/go/timings to read results." ); +- sender.sendMessage("Paste contents of file into form at http://www.spigotmc.org/go/timings to read results."); - - } catch (IOException e) { - } finally { @@ -3570,11 +3566,16 @@ index 6023e4f6..00000000 - @Override - public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { - if (!testPermission(sender)) return true; -- if (args.length < 1) { // Spigot +- if (args.length < 1) { // Spigot - sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); - return false; - } -- if (true) { executeSpigotTimings(sender, args); return true; } // Spigot +- // Spigot start +- if (true) { +- executeSpigotTimings(sender, args); +- return true; +- } +- // Spigot end - if (!sender.getServer().getPluginManager().useTimings()) { - sender.sendMessage("Please enable timings by setting \"settings.plugin-profiling\" to true in bukkit.yml"); - return true; @@ -3613,8 +3614,9 @@ index 6023e4f6..00000000 - if (separate) { - fileNames.println(pluginIdx + " " + plugin.getDescription().getFullName()); - fileTimings.println("Plugin " + pluginIdx); +- } else { +- fileTimings.println(plugin.getDescription().getFullName()); - } -- else fileTimings.println(plugin.getDescription().getFullName()); - for (RegisteredListener listener : HandlerList.getRegisteredListeners(plugin)) { - if (listener instanceof TimedRegisteredListener) { - TimedRegisteredListener trl = (TimedRegisteredListener) listener; @@ -3663,15 +3665,13 @@ index 6023e4f6..00000000 - } - - // Spigot start -- private static class PasteThread extends Thread -- { +- private static class PasteThread extends Thread { - - private final CommandSender sender; - private final ByteArrayOutputStream bout; - -- public PasteThread(@NotNull CommandSender sender, @NotNull ByteArrayOutputStream bout) -- { -- super( "Timings paste thread" ); +- public PasteThread(@NotNull CommandSender sender, @NotNull ByteArrayOutputStream bout) { +- super("Timings paste thread"); - this.sender = sender; - this.bout = bout; - } @@ -3686,35 +3686,32 @@ index 6023e4f6..00000000 - } - - @Override -- public void run() -- { -- try -- { -- HttpURLConnection con = (HttpURLConnection) new URL( "https://timings.spigotmc.org/paste" ).openConnection(); -- con.setDoOutput( true ); -- con.setRequestMethod( "POST" ); -- con.setInstanceFollowRedirects( false ); +- public void run() { +- try { +- HttpURLConnection con = (HttpURLConnection) new URL("https://timings.spigotmc.org/paste").openConnection(); +- con.setDoOutput(true); +- con.setRequestMethod("POST"); +- con.setInstanceFollowRedirects(false); - - OutputStream out = con.getOutputStream(); -- out.write( bout.toByteArray() ); +- out.write(bout.toByteArray()); - out.close(); - - com.google.gson.JsonObject location = new com.google.gson.Gson().fromJson(new java.io.InputStreamReader(con.getInputStream()), com.google.gson.JsonObject.class); - con.getInputStream().close(); - -- String pasteID = location.get( "key" ).getAsString(); -- sender.sendMessage( ChatColor.GREEN + "Timings results can be viewed at https://www.spigotmc.org/go/timings?url=" + pasteID ); -- } catch ( IOException ex ) -- { -- sender.sendMessage( ChatColor.RED + "Error pasting timings, check your console for more information" ); -- Bukkit.getServer().getLogger().log( Level.WARNING, "Could not paste timings", ex ); +- String pasteID = location.get("key").getAsString(); +- sender.sendMessage(ChatColor.GREEN + "Timings results can be viewed at https://www.spigotmc.org/go/timings?url=" + pasteID); +- } catch (IOException ex) { +- sender.sendMessage(ChatColor.RED + "Error pasting timings, check your console for more information"); +- Bukkit.getServer().getLogger().log(Level.WARNING, "Could not paste timings", ex); - } - } - } - // Spigot end -} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 0052cc71..4d9ed678 100644 +index 9b0153f7..9d82a691 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM @@ -3730,7 +3727,7 @@ index 0052cc71..4d9ed678 100644 @NotNull diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 2dfb8529..53e5045f 100644 +index c4ef983e..3c5d8a0e 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -0,0 +0,0 @@ public final class SimplePluginManager implements PluginManager { @@ -3787,11 +3784,11 @@ index 2dfb8529..53e5045f 100644 } } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 1173e433..82e379d1 100644 +index df8a5dcb..50a51394 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { - private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), }; + private final Pattern[] fileFilters = new Pattern[]{Pattern.compile("\\.jar$")}; private final Map> classes = new ConcurrentHashMap>(); private final List loaders = new CopyOnWriteArrayList(); - public static final CustomTimingsHandler pluginParentTimer = new CustomTimingsHandler("** Plugins"); // Spigot @@ -3802,7 +3799,7 @@ index 1173e433..82e379d1 100644 } } -- final CustomTimingsHandler timings = new CustomTimingsHandler("Plugin: " + plugin.getDescription().getFullName() + " Event: " + listener.getClass().getName() + "::" + method.getName()+"("+eventClass.getSimpleName()+")", pluginParentTimer); // Spigot +- final CustomTimingsHandler timings = new CustomTimingsHandler("Plugin: " + plugin.getDescription().getFullName() + " Event: " + listener.getClass().getName() + "::" + method.getName() + "(" + eventClass.getSimpleName() + ")", pluginParentTimer); // Spigot - EventExecutor executor = new EventExecutor() { + EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper @Override @@ -3830,7 +3827,7 @@ index 1173e433..82e379d1 100644 eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); } else { diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index a0551225..7133be0a 100644 +index 5830e8b9..36f542a8 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java @@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable; @@ -3867,7 +3864,7 @@ index 5ca863b3..612958a3 100644 + +} diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java -index b71235f6..3cbe5c2b 100644 +index 44badfed..3cbe5c2b 100644 --- a/src/main/java/org/spigotmc/CustomTimingsHandler.java +++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java @@ -0,0 +0,0 @@ @@ -3923,14 +3920,8 @@ index b71235f6..3cbe5c2b 100644 + * @deprecated + * @see co.aikar.timings.Timings#of */ --public class CustomTimingsHandler --{ -+@Deprecated -+public final class CustomTimingsHandler { -+ private final Timing handler; -+ private static Boolean sunReflectAvailable; -+ private static Method getCallerClass; - +-public class CustomTimingsHandler { +- - private static Queue HANDLERS = new ConcurrentLinkedQueue(); - /*========================================================================*/ - private final String name; @@ -3941,21 +3932,23 @@ index b71235f6..3cbe5c2b 100644 - private long totalTime = 0; - private long curTickTotal = 0; - private long violations = 0; -+ public CustomTimingsHandler(@NotNull String name) { ++@Deprecated ++public final class CustomTimingsHandler { ++ private final Timing handler; ++ private static Boolean sunReflectAvailable; ++ private static Method getCallerClass; + + public CustomTimingsHandler(@NotNull String name) { +- this(name, null); +- } + if (sunReflectAvailable == null) { + String javaVer = System.getProperty("java.version"); + String[] elements = javaVer.split("\\."); -- public CustomTimingsHandler(@NotNull String name) -- { -- this( name, null ); -- } -- -- public CustomTimingsHandler(@NotNull String name, @Nullable CustomTimingsHandler parent) -- { +- public CustomTimingsHandler(@NotNull String name, @Nullable CustomTimingsHandler parent) { - this.name = name; - this.parent = parent; -- HANDLERS.add( this ); +- HANDLERS.add(this); - } + int major = Integer.parseInt(elements.length >= 2 ? elements[1] : javaVer); + if (major <= 8) { @@ -3966,15 +3959,12 @@ index b71235f6..3cbe5c2b 100644 - * - * @param printStream output stream - */ -- public static void printTimings(@NotNull PrintStream printStream) -- { -- printStream.println( "Minecraft" ); -- for ( CustomTimingsHandler timings : HANDLERS ) -- { +- public static void printTimings(@NotNull PrintStream printStream) { +- printStream.println("Minecraft"); +- for (CustomTimingsHandler timings : HANDLERS) { - long time = timings.totalTime; - long count = timings.count; -- if ( count == 0 ) -- { +- if (count == 0) { - continue; + try { + Class reflection = Class.forName("sun.reflect.Reflection"); @@ -3986,29 +3976,25 @@ index b71235f6..3cbe5c2b 100644 } - long avg = time / count; - -- printStream.println( " " + timings.name + " Time: " + time + " Count: " + count + " Avg: " + avg + " Violations: " + timings.violations ); +- printStream.println(" " + timings.name + " Time: " + time + " Count: " + count + " Avg: " + avg + " Violations: " + timings.violations); - } -- printStream.println( "# Version " + Bukkit.getVersion() ); +- printStream.println("# Version " + Bukkit.getVersion()); - int entities = 0; - int livingEntities = 0; -- for ( World world : Bukkit.getWorlds() ) -- { +- for (World world : Bukkit.getWorlds()) { - entities += world.getEntities().size(); - livingEntities += world.getLivingEntities().size(); } -- printStream.println( "# Entities " + entities ); -- printStream.println( "# LivingEntities " + livingEntities ); +- printStream.println("# Entities " + entities); +- printStream.println("# LivingEntities " + livingEntities); - } - /** - * Resets all timings. - */ -- public static void reload() -- { -- if ( Bukkit.getPluginManager().useTimings() ) -- { -- for ( CustomTimingsHandler timings : HANDLERS ) -- { +- public static void reload() { +- if (Bukkit.getPluginManager().useTimings()) { +- for (CustomTimingsHandler timings : HANDLERS) { - timings.reset(); + Class calling = null; + if (sunReflectAvailable) { @@ -4024,15 +4010,11 @@ index b71235f6..3cbe5c2b 100644 - * Ticked every tick by CraftBukkit to count the number of times a timer - * caused TPS loss. - */ -- public static void tick() -- { -- if ( Bukkit.getPluginManager().useTimings() ) -- { -- for ( CustomTimingsHandler timings : HANDLERS ) -- { -- if ( timings.curTickTotal > 50000000 ) -- { -- timings.violations += Math.ceil( timings.curTickTotal / 50000000 ); +- public static void tick() { +- if (Bukkit.getPluginManager().useTimings()) { +- for (CustomTimingsHandler timings : HANDLERS) { +- if (timings.curTickTotal > 50000000) { +- timings.violations += Math.ceil(timings.curTickTotal / 50000000); - } - timings.curTickTotal = 0; - timings.timingDepth = 0; // incase reset messes this up @@ -4044,14 +4026,11 @@ index b71235f6..3cbe5c2b 100644 - /** - * Starts timing to track a section of code. - */ -- public void startTiming() -- { +- public void startTiming() { - // If second condtion fails we are already timing -- if ( Bukkit.getPluginManager().useTimings() && ++timingDepth == 1 ) -- { +- if (Bukkit.getPluginManager().useTimings() && ++timingDepth == 1) { - start = System.nanoTime(); -- if ( parent != null && ++parent.timingDepth == 1 ) -- { +- if (parent != null && ++parent.timingDepth == 1) { - parent.start = start; - } - } @@ -4064,12 +4043,9 @@ index b71235f6..3cbe5c2b 100644 - /** - * Stops timing a section of code. - */ -- public void stopTiming() -- { -- if ( Bukkit.getPluginManager().useTimings() ) -- { -- if ( --timingDepth != 0 || start == 0 ) -- { +- public void stopTiming() { +- if (Bukkit.getPluginManager().useTimings()) { +- if (--timingDepth != 0 || start == 0) { - return; - } - long diff = System.nanoTime() - start; @@ -4077,8 +4053,7 @@ index b71235f6..3cbe5c2b 100644 - curTickTotal += diff; - count++; - start = 0; -- if ( parent != null ) -- { +- if (parent != null) { - parent.stopTiming(); + new AuthorNagException("Deprecated use of CustomTimingsHandler. Please Switch to Timings.of ASAP").printStackTrace(); + if (plugin != null) { @@ -4100,8 +4075,7 @@ index b71235f6..3cbe5c2b 100644 - /** - * Reset this timer, setting all values to zero. - */ -- public void reset() -- { +- public void reset() { - count = 0; - violations = 0; - curTickTotal = 0; diff --git a/Spigot-API-Patches/Use-ASM-for-event-executors.patch b/Spigot-API-Patches/Use-ASM-for-event-executors.patch index c4b6c48d33..f27aedca6f 100644 --- a/Spigot-API-Patches/Use-ASM-for-event-executors.patch +++ b/Spigot-API-Patches/Use-ASM-for-event-executors.patch @@ -412,7 +412,7 @@ index a850f078..9026e108 100644 + // 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 12601db6..06b6724f 100644 +index 5cc37eee..e72cbde4 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 16bb1f7d1a..c3987c6c1e 100644 --- a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 591e2ad56c..e5987be450 100644 +index 7364b92f41..5ca3233c00 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -40,7 +40,7 @@ index bf80af2354..e93741a8e8 100644 protected void g() { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9987adb6f4..9d9e8fed27 100644 +index 2bc0368d04..a5af0f9d35 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Add-Heightmap-API.patch b/Spigot-Server-Patches/Add-Heightmap-API.patch index fb426e21be..21bfa2fc60 100644 --- a/Spigot-Server-Patches/Add-Heightmap-API.patch +++ b/Spigot-Server-Patches/Add-Heightmap-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add Heightmap API diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 13ff6a11f..6fd6c343d 100644 +index 065cb3c29a..61faf87179 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -20,7 +20,7 @@ index 13ff6a11f..6fd6c343d 100644 if (i >= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 20e4be0e3..007a74f90 100644 +index c50301fd8a..426971b55b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Add-World-Util-Methods.patch b/Spigot-Server-Patches/Add-World-Util-Methods.patch index 1b6d733dcc..b5bc91bfc3 100644 --- a/Spigot-Server-Patches/Add-World-Util-Methods.patch +++ b/Spigot-Server-Patches/Add-World-Util-Methods.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 026007891..37914c2f5 100644 +index bf20ce9341..0d403ec707 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -29,7 +29,7 @@ index 026007891..37914c2f5 100644 @Override diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 020e5c171..4ee13ac45 100644 +index 020e5c171a..4ee13ac454 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -0,0 +0,0 @@ public class WorldBorder { diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch index 977e50db24..74523f3ed7 100644 --- a/Spigot-Server-Patches/Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch @@ -209,7 +209,7 @@ index d5e9bae709..1bcf01c09a 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cb369665c4..0260078911 100644 +index caead09a64..bf20ce9341 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ package net.minecraft.server; diff --git a/Spigot-Server-Patches/Add-sun-related-API.patch b/Spigot-Server-Patches/Add-sun-related-API.patch index 6bba430d4f..872a3cf17c 100644 --- a/Spigot-Server-Patches/Add-sun-related-API.patch +++ b/Spigot-Server-Patches/Add-sun-related-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 5ca281172..e259c868e 100644 +index 5ca281172d..e259c868e1 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -17,7 +17,7 @@ index 5ca281172..e259c868e 100644 if (this.world.isDay() && !this.world.isClientSide) { float f = this.aI(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 7c7302853..20e4be0e3 100644 +index 9f356e8004..c50301fd8a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -35,7 +35,7 @@ index 7c7302853..20e4be0e3 100644 public boolean createExplosion(double x, double y, double z, float power) { return createExplosion(x, y, z, power, false, true); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 53c2d154e..56c233872 100644 +index 53c2d154ed..56c233872b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -0,0 +0,0 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { diff --git a/Spigot-Server-Patches/Add-version-history-to-version-command.patch b/Spigot-Server-Patches/Add-version-history-to-version-command.patch index 2bdfe1ea07..0dcf596aaf 100644 --- a/Spigot-Server-Patches/Add-version-history-to-version-command.patch +++ b/Spigot-Server-Patches/Add-version-history-to-version-command.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add version history to version command diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java -index 5deed3e25..49a38c660 100644 +index 5deed3e25f..49a38c6608 100644 --- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java +++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java @@ -0,0 +0,0 @@ public class PaperVersionFetcher implements VersionFetcher { @@ -42,7 +42,7 @@ index 5deed3e25..49a38c660 100644 } diff --git a/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java new file mode 100644 -index 000000000..aac3f66cb +index 0000000000..aac3f66cb2 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java @@ -0,0 +0,0 @@ @@ -192,7 +192,7 @@ index 000000000..aac3f66cb + } +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index e636433b1..a78896dc8 100644 +index d6646d7e61..4b1f8c5373 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch b/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch index d8112407e9..404ef96661 100644 --- a/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch +++ b/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow for toggling of spawn chunks diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 284568641..8ee2b9bb1 100644 +index 2845686411..8ee2b9bb1b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -20,7 +20,7 @@ index 284568641..8ee2b9bb1 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 0087bd9b1..28e67245a 100644 +index da3eb20d45..dfca06cf7c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch b/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch index 8d8b47d9cc..7971212c04 100644 --- a/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch +++ b/Spigot-Server-Patches/Allow-spawning-Item-entities-with-World.spawnEntity.patch @@ -8,7 +8,7 @@ This API has more capabilities than .dropItem with the Consumer function Item can be set inside of the Consumer pre spawn function. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 59036635d..66026f5a4 100644 +index bbc338c000..7368625685 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index a197a4b9f3..72844c7fcc 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -1648,7 +1648,7 @@ index a905a29e75..335b644351 100644 public static TicketType a(String s, Comparator comparator) { return new TicketType<>(s, comparator, 0L); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d981dfd434..a1b777ac03 100644 +index c089080a90..bcf326c859 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ package net.minecraft.server; diff --git a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch index 3a4c12782d..e13ff12e17 100644 --- a/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/Asynchronous-chunk-IO-and-loading.patch @@ -4026,7 +4026,7 @@ index 0f652e58e1..5eb52817f1 100644 // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f56ec3d341..1a6a88b178 100644 +index c3ee5411c3..9fe9098089 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/BlockDestroyEvent.patch b/Spigot-Server-Patches/BlockDestroyEvent.patch index 925dc36fea..8bbcb1890c 100644 --- a/Spigot-Server-Patches/BlockDestroyEvent.patch +++ b/Spigot-Server-Patches/BlockDestroyEvent.patch @@ -11,7 +11,7 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d62ef02e5..a5b451877 100644 +index 2a1359f7d9..0409d62e71 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch index bf1fc1be53..b7482c932a 100644 --- a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch +++ b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Change implementation of (tile)entity removal list use sets for faster removal diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 634ec82b1..cb369665c 100644 +index ef00928466..caead09a64 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch index 8d741e0099..4e29bfafcf 100644 --- a/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -207,7 +207,7 @@ index 36d5466138..32da4eb4e0 100644 public LongSet getForceLoadedChunks() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4287492381..9787d53326 100644 +index 57c9982c75..b742bb7617 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch index af709bec52..0d43668eb4 100644 --- a/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch +++ b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 94eceac2f..634ec82b1 100644 +index ea86476ea5..ef00928466 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Expand-Explosions-API.patch b/Spigot-Server-Patches/Expand-Explosions-API.patch index 82e401f2ba..786247dea7 100644 --- a/Spigot-Server-Patches/Expand-Explosions-API.patch +++ b/Spigot-Server-Patches/Expand-Explosions-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Expand Explosions API Add Entity as a Source capability, and add more API choices, and on Location. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 66026f5a4..6b04a031e 100644 +index 7368625685..2aa016921a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch index 7321184807..5e08fd164c 100644 --- a/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch @@ -43,7 +43,7 @@ index 69d2e2c3b5..62a16173b9 100644 if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 63b1cb2a4c..59036635d7 100644 +index cd6cf07f82..bbc338c000 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 1981b6ae47..df8c16cf6d 100644 --- a/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -8,7 +8,7 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 5de881371..5f261b9b9 100644 +index 5de881371a..5f261b9b92 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -0,0 +0,0 @@ public class Block implements IMaterial { @@ -28,7 +28,7 @@ index 5de881371..5f261b9b9 100644 } diff --git a/src/main/java/net/minecraft/server/ContainerGrindstone.java b/src/main/java/net/minecraft/server/ContainerGrindstone.java -index 2d2cd09ad..ed88e208d 100644 +index 2d2cd09ad1..ed88e208d0 100644 --- a/src/main/java/net/minecraft/server/ContainerGrindstone.java +++ b/src/main/java/net/minecraft/server/ContainerGrindstone.java @@ -0,0 +0,0 @@ public class ContainerGrindstone extends Container { @@ -41,7 +41,7 @@ index 2d2cd09ad..ed88e208d 100644 world.triggerEffect(1042, blockposition, 0); diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index e0d240a89..07abcc1e2 100644 +index 8762577696..138e2ea56a 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { @@ -54,7 +54,7 @@ index e0d240a89..07abcc1e2 100644 } diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 0447800d9..d4275e733 100644 +index 0447800d9d..d4275e733d 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { @@ -134,7 +134,7 @@ index 0447800d9..d4275e733 100644 @Override diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 8ad0d0db1..8d48154e5 100644 +index 8ad0d0db18..8d48154e5b 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { @@ -147,7 +147,7 @@ index 8ad0d0db1..8d48154e5 100644 // CraftBukkit end if (itemstack1.getItem().a(TagsItem.FISHES)) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index dd1caec9d..2775afc32 100644 +index dd1caec9da..2775afc327 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { @@ -161,7 +161,7 @@ index dd1caec9d..2775afc32 100644 this.expToDrop = 0; } diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java -index 0bfc0a773..ba2f90cc6 100644 +index 0bfc0a773d..ba2f90cc6a 100644 --- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java +++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java @@ -0,0 +0,0 @@ public class EntityThrownExpBottle extends EntityProjectileThrowable { @@ -174,7 +174,7 @@ index 0bfc0a773..ba2f90cc6 100644 this.die(); diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index c73cc9ae4..76296119a 100644 +index c73cc9ae4b..76296119a1 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -0,0 +0,0 @@ public class EntityTurtle extends EntityAnimal { @@ -187,7 +187,7 @@ index c73cc9ae4..76296119a 100644 } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 5e3835851..6ca4fa43c 100644 +index 5e3835851d..6ca4fa43c4 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @@ -200,7 +200,7 @@ index 5e3835851..6ca4fa43c 100644 } diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -index 530c69996..2ad8dba5c 100644 +index 530c699964..2ad8dba5c0 100644 --- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java +++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java @@ -0,0 +0,0 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { @@ -213,7 +213,7 @@ index 530c69996..2ad8dba5c 100644 } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java -index 1ab2668e9..2b708761d 100644 +index 1ab2668e91..2b708761d0 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalBreed.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalBreed.java @@ -0,0 +0,0 @@ public class PathfinderGoalBreed extends PathfinderGoal { @@ -226,7 +226,7 @@ index 1ab2668e9..2b708761d 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index f6c6ea4aa..dff3eb118 100644 +index f6c6ea4aaf..dff3eb1188 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -0,0 +0,0 @@ public class PlayerInteractManager { @@ -239,7 +239,7 @@ index f6c6ea4aa..dff3eb118 100644 return true; diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java -index d2698e847..edc4a5c34 100644 +index d2698e847c..edc4a5c34e 100644 --- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java +++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -252,7 +252,7 @@ index d2698e847..edc4a5c34 100644 public SlotFurnaceResult(EntityHuman entityhuman, IInventory iinventory, int i, int j, int k) { diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 8dc47452a..560e2f42b 100644 +index 8dc47452a4..560e2f42b7 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -0,0 +0,0 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I @@ -265,7 +265,7 @@ index 8dc47452a..560e2f42b 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index ec7396f2a..63b1cb2a4 100644 +index 81fa77946b..cd6cf07f82 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { @@ -278,7 +278,7 @@ index ec7396f2a..63b1cb2a4 100644 entity = new EntityLightning(world, x, y, z, false); } else if (Firework.class.isAssignableFrom(clazz)) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java -index 1b512cc45..fbad04567 100644 +index 1b512cc45c..fbad045675 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java @@ -0,0 +0,0 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb { diff --git a/Spigot-Server-Patches/Faster-redstone-torch-rapid-clock-removal.patch b/Spigot-Server-Patches/Faster-redstone-torch-rapid-clock-removal.patch index 417b63da38..06cc2f18f9 100644 --- a/Spigot-Server-Patches/Faster-redstone-torch-rapid-clock-removal.patch +++ b/Spigot-Server-Patches/Faster-redstone-torch-rapid-clock-removal.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Faster redstone torch rapid clock removal Only resize the the redstone torch list once, since resizing arrays / lists is costly diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java -index 98a255ae5..4c3062ece 100644 +index 98a255ae57..4c3062ece9 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java @@ -0,0 +0,0 @@ import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit @@ -77,7 +77,7 @@ index 98a255ae5..4c3062ece 100644 public RedstoneUpdateInfo(BlockPosition blockposition, long i) { this.a = blockposition; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 50c138d06..c7a4fab1c 100644 +index 5a80f35c91..3898010774 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index edc5261d7e..75270a289a 100644 --- a/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 824a3513a..e7d441b22 100644 +index 528e53fc42..1323d1959a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch index 624d074975..d2cbaaa08a 100644 --- a/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 58f1136df..eb5c95e37 100644 +index f8b2d3abf9..0dd84c0977 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Fix-some-generation-concurrency-issues.patch b/Spigot-Server-Patches/Fix-some-generation-concurrency-issues.patch index e695f46b10..0420b4dcb4 100644 --- a/Spigot-Server-Patches/Fix-some-generation-concurrency-issues.patch +++ b/Spigot-Server-Patches/Fix-some-generation-concurrency-issues.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix some generation concurrency issues diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6fd6c343d..d981dfd43 100644 +index 61faf87179..c089080a90 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -33,7 +33,7 @@ index 6fd6c343d..d981dfd43 100644 public CraftWorld getWorld() { return this.world; diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java -index 22e14fe1e..e2af6d43b 100644 +index 22e14fe1e9..e2af6d43b2 100644 --- a/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java +++ b/src/main/java/net/minecraft/server/WorldGenFeatureStateProviderWeighted.java @@ -0,0 +0,0 @@ public class WorldGenFeatureStateProviderWeighted extends WorldGenFeatureStatePr @@ -59,7 +59,7 @@ index 22e14fe1e..e2af6d43b 100644 builder.put(dynamicops.createString("type"), dynamicops.createString(IRegistry.t.getKey(this.a).toString())).put(dynamicops.createString("entries"), this.b.a(dynamicops, (iblockdata) -> { diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java -index fc4348b60..44be7169f 100644 +index fc4348b602..44be7169ff 100644 --- a/src/main/java/net/minecraft/server/WorldGenStronghold.java +++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; diff --git a/Spigot-Server-Patches/Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch b/Spigot-Server-Patches/Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch index b675a22263..e0589e7ee4 100644 --- a/Spigot-Server-Patches/Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch +++ b/Spigot-Server-Patches/Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix spawning of hanging entities that are not ItemFrames and diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1a6a88b17..be8b617f2 100644 +index 9fe9098089..7654519c9e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch index 051ab02b8a..296c5ec926 100644 --- a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch @@ -51,7 +51,7 @@ index 2004f7fbe1..7ecff4443a 100644 if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check list.add(t0); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e761f71487..ca794328a7 100644 +index 09ec144eb6..4880ece947 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -92,7 +92,7 @@ index 3d5a50ddcc..12cdb0cc9a 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a257dce8f0..0fb47579f6 100644 +index 89705e5ffa..fe91e08f22 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch index 9cbb6db451..b0c8f5f6e8 100644 --- a/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch +++ b/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 6b04a031e..a257dce8f 100644 +index 2aa016921a..89705e5ffa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index 14edd37cf1..f85b1213b1 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -2236,7 +2236,7 @@ index ba315131e1..cbe2aa4c0a 100644 IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index b5d45b43ce..766b1fe13c 100644 +index 75308712d0..aa7501d366 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -0,0 +0,0 @@ import org.bukkit.event.world.StructureGrowEvent; @@ -3147,9 +3147,17 @@ index 7b92ecfff9..7e224ebeff 100644 public static long getTimeMillis() { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 692f8e4b71..8fc88f162c 100644 +index f0deeb3d28..304dfac061 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot + import org.bukkit.craftbukkit.CraftServer; + import org.bukkit.craftbukkit.CraftWorld; + import org.bukkit.craftbukkit.block.CapturedBlockState; ++import org.bukkit.craftbukkit.block.CraftBlockState; + import org.bukkit.craftbukkit.block.data.CraftBlockData; + import org.bukkit.event.block.BlockPhysicsEvent; + // CraftBukkit end @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL); } @@ -3165,10 +3173,9 @@ index 692f8e4b71..8fc88f162c 100644 + public IBlockData getTypeIfLoaded(BlockPosition blockposition) { + // CraftBukkit start - tree generation + if (captureTreeGeneration) { -+ for (CraftBlockState previous : capturedBlockStates) { -+ if (previous.getX() == blockposition.getX() && previous.getY() == blockposition.getY() && previous.getZ() == blockposition.getZ()) { -+ return previous.getHandle(); -+ } ++ CraftBlockState previous = capturedBlockStates.get(blockposition); ++ if (previous != null) { ++ return previous.getHandle(); + } + } + // CraftBukkit end diff --git a/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 1c893c7feb..7a89da9a67 100644 --- a/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/Spigot-Server-Patches/Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -6,7 +6,7 @@ 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/BlockPlant.java b/src/main/java/net/minecraft/server/BlockPlant.java -index ed1da4f4b..a6891b9fa 100644 +index ed1da4f4ba..a6891b9fa7 100644 --- a/src/main/java/net/minecraft/server/BlockPlant.java +++ b/src/main/java/net/minecraft/server/BlockPlant.java @@ -0,0 +0,0 @@ public class BlockPlant extends Block { @@ -19,7 +19,7 @@ index ed1da4f4b..a6891b9fa 100644 } } diff --git a/src/main/java/net/minecraft/server/BlockTallPlant.java b/src/main/java/net/minecraft/server/BlockTallPlant.java -index 42e86881b..6cdce1158 100644 +index 42e86881bd..6cdce11581 100644 --- a/src/main/java/net/minecraft/server/BlockTallPlant.java +++ b/src/main/java/net/minecraft/server/BlockTallPlant.java @@ -0,0 +0,0 @@ public class BlockTallPlant extends BlockPlant { @@ -32,7 +32,7 @@ index 42e86881b..6cdce1158 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3d580a666..3094f763b 100644 +index 3d580a666b..3094f763ba 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { return worldserver.getWorldData().getName() + " " + IRegistry.DIMENSION_TYPE.getKey(worldserver.worldProvider.getDimensionManager()); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 18ee29e50..824a3513a 100644 +index d81178d26d..528e53fc42 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -66,7 +66,7 @@ index 18ee29e50..824a3513a 100644 this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0146573a3..9161d6fd6 100644 +index 6c2107bd06..4e29746c14 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World { diff --git a/Spigot-Server-Patches/Optimise-getChunkAt-calls-for-loaded-chunks.patch b/Spigot-Server-Patches/Optimise-getChunkAt-calls-for-loaded-chunks.patch index 1c9576c787..77f3cb77e8 100644 --- a/Spigot-Server-Patches/Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/Spigot-Server-Patches/Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -65,7 +65,7 @@ index 72919e4c64..42c559ad4f 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8a2bb79ad9..abd8b751ba 100644 +index 44fb13f8db..03bd681172 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch b/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch index 43bfc42f87..545f423063 100644 --- a/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch +++ b/Spigot-Server-Patches/Optimize-Captured-TileEntity-Lookup.patch @@ -10,7 +10,7 @@ Optimize to check if the captured list even has values in it, and also to just do a get call since the value can never be null. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a5b451877..13ff6a11f 100644 +index 0409d62e71..065cb3c29a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch index 41913d39b7..8b78719d08 100644 --- a/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c7a4fab1c..58f1136df 100644 +index 3898010774..f8b2d3abf9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Optimize-explosions.patch b/Spigot-Server-Patches/Optimize-explosions.patch index aff4b9c5ec..9c4630d39f 100644 --- a/Spigot-Server-Patches/Optimize-explosions.patch +++ b/Spigot-Server-Patches/Optimize-explosions.patch @@ -10,7 +10,7 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 50dec5cb5..f038d3f7d 100644 +index 50dec5cb5e..f038d3f7dc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -25,7 +25,7 @@ index 50dec5cb5..f038d3f7d 100644 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index d2c31ac1f..64cf5a29c 100644 +index a063d1bfaa..5583860f15 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -0,0 +0,0 @@ public class Explosion { @@ -123,7 +123,7 @@ index d2c31ac1f..64cf5a29c 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7b8c523e6..3d580a666 100644 +index 7b8c523e6d..3d580a666b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { @@ -17,14 +17,15 @@ index 5cab47a28..886babdcd 100644 return this.a; } diff --git a/src/main/java/net/minecraft/server/ItemEgg.java b/src/main/java/net/minecraft/server/ItemEgg.java -index c72f618bb..a41ccc8f6 100644 +index 6fccd70a03..16f1b734e0 100644 --- a/src/main/java/net/minecraft/server/ItemEgg.java +++ b/src/main/java/net/minecraft/server/ItemEgg.java @@ -0,0 +0,0 @@ public class ItemEgg extends Item { entityegg.setItem(itemstack); entityegg.a(entityhuman, entityhuman.pitch, entityhuman.yaw, 0.0F, 1.5F, 1.0F); -- world.addEntity(entityegg); +- // CraftBukkit start +- if (!world.addEntity(entityegg)) { + // Paper start + com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent event = new com.destroystokyo.paper.event.player.PlayerLaunchProjectileEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), (org.bukkit.entity.Projectile) entityegg.getBukkitEntity()); + if (event.callEvent() && world.addEntity(entityegg)) { @@ -37,13 +38,18 @@ index c72f618bb..a41ccc8f6 100644 + world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + entityhuman.b(StatisticList.ITEM_USED.b(this)); + } else { -+ if (entityhuman instanceof EntityPlayer) { -+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); -+ } + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } +- return InteractionResultWrapper.fail(itemstack); + return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); -+ } + } +- // CraftBukkit end + // Paper end ++ ++ } + world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.i.nextFloat() * 0.4F + 0.8F)); // CraftBukkit - from above + /* // Paper start - moved up entityhuman.b(StatisticList.ITEM_USED.b(this)); @@ -55,7 +61,7 @@ index c72f618bb..a41ccc8f6 100644 return InteractionResultWrapper.success(itemstack); } diff --git a/src/main/java/net/minecraft/server/ItemEnderPearl.java b/src/main/java/net/minecraft/server/ItemEnderPearl.java -index cab869e8e..b57e9f7e7 100644 +index cab869e8e9..b57e9f7e72 100644 --- a/src/main/java/net/minecraft/server/ItemEnderPearl.java +++ b/src/main/java/net/minecraft/server/ItemEnderPearl.java @@ -0,0 +0,0 @@ public class ItemEnderPearl extends Item { @@ -107,7 +113,7 @@ index cab869e8e..b57e9f7e7 100644 return InteractionResultWrapper.success(itemstack); } diff --git a/src/main/java/net/minecraft/server/ItemExpBottle.java b/src/main/java/net/minecraft/server/ItemExpBottle.java -index 071688b3a..1d575af52 100644 +index 071688b3ab..1d575af526 100644 --- a/src/main/java/net/minecraft/server/ItemExpBottle.java +++ b/src/main/java/net/minecraft/server/ItemExpBottle.java @@ -0,0 +0,0 @@ public class ItemExpBottle extends Item { @@ -152,7 +158,7 @@ index 071688b3a..1d575af52 100644 return InteractionResultWrapper.success(itemstack); } diff --git a/src/main/java/net/minecraft/server/ItemLingeringPotion.java b/src/main/java/net/minecraft/server/ItemLingeringPotion.java -index c19b678cf..7672e31fc 100644 +index c19b678cfb..7672e31fc0 100644 --- a/src/main/java/net/minecraft/server/ItemLingeringPotion.java +++ b/src/main/java/net/minecraft/server/ItemLingeringPotion.java @@ -0,0 +0,0 @@ public class ItemLingeringPotion extends ItemPotionThrowable { @@ -170,7 +176,7 @@ index c19b678cf..7672e31fc 100644 } } diff --git a/src/main/java/net/minecraft/server/ItemPotionThrowable.java b/src/main/java/net/minecraft/server/ItemPotionThrowable.java -index 5d1f118c5..d1beab1ab 100644 +index 5d1f118c51..d1beab1ab7 100644 --- a/src/main/java/net/minecraft/server/ItemPotionThrowable.java +++ b/src/main/java/net/minecraft/server/ItemPotionThrowable.java @@ -0,0 +0,0 @@ public class ItemPotionThrowable extends ItemPotion { @@ -207,7 +213,7 @@ index 5d1f118c5..d1beab1ab 100644 return InteractionResultWrapper.success(itemstack); } diff --git a/src/main/java/net/minecraft/server/ItemSnowball.java b/src/main/java/net/minecraft/server/ItemSnowball.java -index d38776b7e..e6044e654 100644 +index 56ec508959..e6044e654b 100644 --- a/src/main/java/net/minecraft/server/ItemSnowball.java +++ b/src/main/java/net/minecraft/server/ItemSnowball.java @@ -0,0 +0,0 @@ public class ItemSnowball extends Item { @@ -225,7 +231,8 @@ index d38776b7e..e6044e654 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); } -- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F)); } else if (entityhuman instanceof EntityPlayer) { +- world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F)); +- } else if (entityhuman instanceof EntityPlayer) { - ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + world.playSound((EntityHuman) null, entityhuman.locX(), entityhuman.locY(), entityhuman.locZ(), SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + entityhuman.b(StatisticList.ITEM_USED.b(this)); @@ -244,7 +251,7 @@ index d38776b7e..e6044e654 100644 /* if (!entityhuman.abilities.canInstantlyBuild) { diff --git a/src/main/java/net/minecraft/server/ItemSplashPotion.java b/src/main/java/net/minecraft/server/ItemSplashPotion.java -index 18bd846ce..e71e933ff 100644 +index 18bd846cee..e71e933fff 100644 --- a/src/main/java/net/minecraft/server/ItemSplashPotion.java +++ b/src/main/java/net/minecraft/server/ItemSplashPotion.java @@ -0,0 +0,0 @@ public class ItemSplashPotion extends ItemPotionThrowable { diff --git a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch index 757150ce22..1214d0ce04 100644 --- a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent tile entity and entity crashes diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index fa6400dcc..e2f3cec74 100644 +index fa6400dccd..e2f3cec742 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -23,7 +23,7 @@ index fa6400dcc..e2f3cec74 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 28e67245a..806768aeb 100644 +index dfca06cf7c..a7eb3e54e9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Reduce-sync-loads.patch b/Spigot-Server-Patches/Reduce-sync-loads.patch index 4cc0d24633..b48424477a 100644 --- a/Spigot-Server-Patches/Reduce-sync-loads.patch +++ b/Spigot-Server-Patches/Reduce-sync-loads.patch @@ -280,7 +280,7 @@ index e10035d461..92b22b9996 100644 this.serverThreadQueue.awaitTasks(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 0944ce0458..9df079d8af 100644 +index 9f12d765bd..79175c637c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch index 476ebfa6e4..1d124f2160 100644 --- a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e7d441b22b..50c138d06d 100644 +index 1323d1959a..5a80f35c91 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Seed-based-feature-search.patch b/Spigot-Server-Patches/Seed-based-feature-search.patch index 7b6bde04dc..6abde81571 100644 --- a/Spigot-Server-Patches/Seed-based-feature-search.patch +++ b/Spigot-Server-Patches/Seed-based-feature-search.patch @@ -15,7 +15,7 @@ changes but this should usually not happen. A config option to disable this improvement is added though in case that should ever be necessary. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 3b8488d3f..bce502181 100644 +index 3b8488d3ff..bce502181f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -32,7 +32,7 @@ index 3b8488d3f..bce502181 100644 private void maxEntityCollision() { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); diff --git a/src/main/java/net/minecraft/server/BiomeManager.java b/src/main/java/net/minecraft/server/BiomeManager.java -index e96f544f1..68423645d 100644 +index e96f544f12..68423645df 100644 --- a/src/main/java/net/minecraft/server/BiomeManager.java +++ b/src/main/java/net/minecraft/server/BiomeManager.java @@ -0,0 +0,0 @@ public class BiomeManager { @@ -49,7 +49,7 @@ index e96f544f1..68423645d 100644 return this.c.a(this.b, blockposition.getX(), blockposition.getY(), blockposition.getZ(), this.a); } diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index f2a19acd8..09f1308b0 100644 +index f2a19acd84..09f1308b0d 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java @@ -0,0 +0,0 @@ public class ChunkCoordIntPair { @@ -66,7 +66,7 @@ index f2a19acd8..09f1308b0 100644 return this.z << 4; } diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index e8ce2ecf2..acfe732af 100644 +index e8ce2ecf23..acfe732af5 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java @@ -0,0 +0,0 @@ public abstract class StructureGenerator @@ -94,7 +94,7 @@ index e8ce2ecf2..acfe732af 100644 public abstract StructureGenerator.a a(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9df079d8a..8a2bb79ad 100644 +index 79175c637c..44fb13f8db 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch b/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch index 582fa0d02e..879a385468 100644 --- a/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/Spigot-Server-Patches/Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 9717c40f4..be8b088fc 100644 +index 3bd5ddba68..c86d22e7ae 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -72,7 +72,7 @@ index 9717c40f4..be8b088fc 100644 entity.extinguish(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index eb5c95e37..74bb96ebf 100644 +index 0dd84c0977..361cc6a92e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch index dbeb166f1a..090e95ad8a 100644 --- a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch +++ b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch @@ -68,7 +68,7 @@ index 12cdb0cc9a..f12cadc735 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 0fb47579f6..bc151d8d25 100644 +index fe91e08f22..bb908f0712 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -0,0 +0,0 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index b0f32fef50..905737949a 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -565,7 +565,7 @@ index ba40d5fbb5..ee42e1dfa4 100644 int k = 0; CustomFunction.c[] acustomfunction_c = customfunction.b(); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 1cde6fc9c1..e636433b11 100644 +index 9eed98e379..d6646d7e61 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ import java.util.List; @@ -653,7 +653,7 @@ index 1cde6fc9c1..e636433b11 100644 } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3a969d92e0..2d8c37d73b 100644 +index 306724e693..5635192f7c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ import org.bukkit.command.CommandSender; @@ -1202,7 +1202,7 @@ index 820180ab3f..fa6400dccd 100644 private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public CraftPersistentDataContainer persistentDataContainer; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8fc88f162c..0087bd9b1c 100644 +index 304dfac061..da3eb20d45 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ @@ -1213,14 +1213,15 @@ index 8fc88f162c..0087bd9b1c 100644 import com.google.common.collect.Lists; import java.io.IOException; import java.util.Collection; -@@ -0,0 +0,0 @@ import java.util.ArrayList; +@@ -0,0 +0,0 @@ import org.apache.logging.log4j.util.Supplier; + import java.util.HashMap; import java.util.Map; import org.bukkit.Bukkit; - import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.SpigotTimings; // Spigot ++import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; - import org.bukkit.craftbukkit.block.CraftBlockState; + import org.bukkit.craftbukkit.block.CapturedBlockState; @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper diff --git a/Spigot-Server-Patches/Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch b/Spigot-Server-Patches/Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch index 5dbd96ec2f..bea6bb7df7 100644 --- a/Spigot-Server-Patches/Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch +++ b/Spigot-Server-Patches/Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch @@ -12,7 +12,7 @@ results in a separate line, even though it should not result in a line break. Log4j's implementation handles it correctly. diff --git a/pom.xml b/pom.xml -index 93c1a04bc..663eacfe2 100644 +index 93c1a04bc6..663eacfe27 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -28,7 +28,7 @@ index 93c1a04bc..663eacfe2 100644 org.ow2.asm asm diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 886900006..0411fb3ee 100644 +index d34f772fae..ec257ba31f 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index 1e4132f10b..a1df6f6f93 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -19,7 +19,7 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index ee7d3d521..93c1a04bc 100644 +index ee7d3d521e..93c1a04bc6 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -75,7 +75,7 @@ index ee7d3d521..93c1a04bc 100644 org.apache.maven.plugins diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 -index 000000000..cd6e25923 +index 0000000000..cd6e259239 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -0,0 +0,0 @@ @@ -121,7 +121,7 @@ index 000000000..cd6e25923 +} diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java new file mode 100644 -index 000000000..685deaa0e +index 0000000000..685deaa0e5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java @@ -0,0 +0,0 @@ @@ -143,7 +143,7 @@ index 000000000..685deaa0e + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index a78896dc8..886900006 100644 +index 4b1f8c5373..d34f772fae 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -154,8 +154,8 @@ index a78896dc8..886900006 100644 + new com.destroystokyo.paper.console.PaperConsole(DedicatedServer.this).start(); + /* jline.console.ConsoleReader bufferedreader = reader; - // CraftBukkit end + // MC-33041, SPIGOT-5538: if System.in is not valid due to javaw, then return @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer DedicatedServer.LOGGER.error("Exception handling console input", ioexception); } @@ -185,7 +185,7 @@ index a78896dc8..886900006 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e41352681..7016dac2d 100644 +index e41352681a..7016dac2d7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import org.apache.commons.lang3.Validate; @@ -244,7 +244,7 @@ index e41352681..7016dac2d 100644 public KeyPair getKeyPair() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 1eb53f67e..308bc3baf 100644 +index 1eb53f67ef..308bc3baf2 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -258,7 +258,7 @@ index 1eb53f67e..308bc3baf 100644 this.k = new GameProfileBanList(PlayerList.b); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f01d3d382..05efbd67d 100644 +index f01d3d3823..05efbd67d9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import java.util.function.Consumer; @@ -284,7 +284,7 @@ index f01d3d382..05efbd67d 100644 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 40e7c895c..d1636ce21 100644 +index 40e7c895c2..d1636ce218 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ import java.util.logging.Logger; @@ -335,7 +335,7 @@ index 40e7c895c..d1636ce21 100644 } catch (Throwable t) { diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java deleted file mode 100644 -index fdf2f075e..000000000 +index fdf2f075e2..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java +++ /dev/null @@ -0,0 +0,0 @@ @@ -412,7 +412,7 @@ index fdf2f075e..000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index befcc19f9..5510266fb 100644 +index befcc19f9b..5510266fb1 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java @@ -0,0 +0,0 @@ import java.util.Collections; @@ -495,7 +495,7 @@ index befcc19f9..5510266fb 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -index 70f8d4299..449e99d1b 100644 +index 70f8d42992..449e99d1b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java @@ -0,0 +0,0 @@ public class ServerShutdownThread extends Thread { @@ -509,7 +509,7 @@ index 70f8d4299..449e99d1b 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java deleted file mode 100644 -index 99564fed7..000000000 +index 99564fed7c..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java +++ /dev/null @@ -0,0 +0,0 @@ @@ -573,13 +573,13 @@ index 99564fed7..000000000 -} diff --git a/src/main/resources/log4j2.component.properties b/src/main/resources/log4j2.component.properties new file mode 100644 -index 000000000..0694b2146 +index 0000000000..0694b21465 --- /dev/null +++ b/src/main/resources/log4j2.component.properties @@ -0,0 +1 @@ +log4j.skipJansi=true diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml -index 722ca8496..620b9490e 100644 +index 722ca84968..620b9490e5 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch b/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch index 853d0b9064..be53c46db3 100644 --- a/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch +++ b/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use a Queue for Queueing Commands Lists are bad as Queues mmmkay. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 0411fb3ee..a74fae9ed 100644 +index ec257ba31f..349a0ea213 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/Use-getChunkIfLoadedImmediately-in-places.patch b/Spigot-Server-Patches/Use-getChunkIfLoadedImmediately-in-places.patch index 771944e102..4b0652c9f2 100644 --- a/Spigot-Server-Patches/Use-getChunkIfLoadedImmediately-in-places.patch +++ b/Spigot-Server-Patches/Use-getChunkIfLoadedImmediately-in-places.patch @@ -8,7 +8,7 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7c7cd851c..bbfbe4b1e 100644 +index a92f251ca5..2917e1bd42 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -21,7 +21,7 @@ index 7c7cd851c..bbfbe4b1e 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 8c54022e0..f6fbba36f 100644 +index 8c54022e07..f6fbba36f4 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -34,7 +34,7 @@ index 8c54022e0..f6fbba36f 100644 return; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a1b777ac0..0944ce045 100644 +index bcf326c859..9f12d765bd 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -73,7 +73,7 @@ index a1b777ac0..0944ce045 100644 return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a((IBlockAccess) this, blockposition, entity); } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index f86404f83..92601c581 100644 +index f86404f83a..92601c581c 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -0,0 +0,0 @@ public class ActivationRange diff --git a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch index 9317d0846f..2b97d5b897 100644 --- a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e5987be45..8e23f336a 100644 +index 5ca3233c00..fcc47182c8 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -18,7 +18,7 @@ index e5987be45..8e23f336a 100644 protected int j; @Nullable diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index 3a1ad2346..9ab57be85 100644 +index 3a1ad2346b..9ab57be850 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java @@ -0,0 +0,0 @@ public class IBlockData extends BlockDataAbstract implements @@ -30,7 +30,7 @@ index 3a1ad2346..9ab57be85 100644 return this.getBlock().b(this, iblockaccess, blockposition, voxelshapecollision); } diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java -index ab875a736..aed353365 100644 +index ab875a7365..aed353365b 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -0,0 +0,0 @@ public class ItemBlock extends Item { @@ -44,7 +44,7 @@ index ab875a736..aed353365 100644 BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), player, CraftBlockData.fromData(iblockdata), defaultReturn); diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index 0f64a3c05..0f95bcbcc 100644 +index 0f64a3c056..0f95bcbccb 100644 --- a/src/main/java/net/minecraft/server/VoxelShape.java +++ b/src/main/java/net/minecraft/server/VoxelShape.java @@ -0,0 +0,0 @@ public abstract class VoxelShape { @@ -56,7 +56,7 @@ index 0f64a3c05..0f95bcbcc 100644 return (VoxelShape) (this.isEmpty() ? VoxelShapes.a() : new VoxelShapeArray(this.a, new DoubleListOffset(this.a(EnumDirection.EnumAxis.X), d0), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Y), d1), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Z), d2))); } diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index 143be566c..08c83c62d 100644 +index 143be566c6..08c83c62df 100644 --- a/src/main/java/net/minecraft/server/VoxelShapes.java +++ b/src/main/java/net/minecraft/server/VoxelShapes.java @@ -0,0 +0,0 @@ public final class VoxelShapes { @@ -76,7 +76,7 @@ index 143be566c..08c83c62d 100644 if (operatorboolean.apply(false, false)) { throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException()); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6b09e2732..eb8cadf5c 100644 +index 0d12deeb55..c7b4734e94 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -127,7 +127,7 @@ index 6b09e2732..eb8cadf5c 100644 public boolean p_() { return this.isClientSide; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f931fa48b..317a5bf4e 100644 +index f931fa48b4..317a5bf4ef 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/use-CB-BlockState-implementations-for-captured-block.patch b/Spigot-Server-Patches/use-CB-BlockState-implementations-for-captured-block.patch index 9d21decc80..d1fee13149 100644 --- a/Spigot-Server-Patches/use-CB-BlockState-implementations-for-captured-block.patch +++ b/Spigot-Server-Patches/use-CB-BlockState-implementations-for-captured-block.patch @@ -18,16 +18,34 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 74bb96ebf..9987adb6f 100644 +index 361cc6a92e..2bc0368d04 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + + public boolean captureBlockStates = false; + public boolean captureTreeGeneration = false; +- public Map capturedBlockStates = new HashMap<>(); ++ public Map capturedBlockStates = new HashMap<>(); // Paper + public Map capturedTileEntities = new HashMap<>(); + public List captureDrops; + public long ticksPerAnimalSpawns; +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + public boolean setTypeAndData(BlockPosition blockposition, IBlockData iblockdata, int i) { + // CraftBukkit start - tree generation + if (this.captureTreeGeneration) { +- CapturedBlockState blockstate = capturedBlockStates.get(blockposition); ++ CraftBlockState blockstate = capturedBlockStates.get(blockposition); + if (blockstate == null) { + blockstate = CapturedBlockState.getTreeBlockState(this, blockposition, i); + this.capturedBlockStates.put(blockposition.immutableCopy(), blockstate); +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + // CraftBukkit start - capture blockstates - CraftBlockState blockstate = null; - if (this.captureBlockStates) { -- blockstate = org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(this, blockposition, i); -+ blockstate = (CraftBlockState) world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()).getState(); // Paper - use CB getState to get a suitable snapshot - this.capturedBlockStates.add(blockstate); + if (this.captureBlockStates && !this.capturedBlockStates.containsKey(blockposition)) { +- CapturedBlockState blockstate = CapturedBlockState.getBlockState(this, blockposition, i); ++ CraftBlockState blockstate = (CraftBlockState) world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()).getState(); // Paper - use CB getState to get a suitable snapshot + this.capturedBlockStates.put(blockposition.immutableCopy(), blockstate); } // CraftBukkit end -- \ No newline at end of file diff --git a/work/Bukkit b/work/Bukkit index e601e7aaa1..93e39ce193 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit e601e7aaa1372fb30ee4334f446d73273a0a3cd1 +Subproject commit 93e39ce1934a9a7675550c12a7bd4861a2030f2b diff --git a/work/CraftBukkit b/work/CraftBukkit index e911c70f85..ab13a117a9 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit e911c70f855e7785f79ffb8b428a12d0e8c31fec +Subproject commit ab13a117a910635638886991a2d77a82261b2cb6 diff --git a/work/Spigot b/work/Spigot index 800b93fb8c..f2c1cd15d9 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 800b93fb8cfcad0ac393eb401e00a40475722be3 +Subproject commit f2c1cd15d99e523ef21cd1f761914a2b9eb940b8