From bd34c3623be39adee52fe892fba8c1a9641c320a Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 19 Jul 2018 05:42:43 +0100 Subject: [PATCH] NOT FINISHED! She compiles, and she... suffers the wrath of chunkgen... --- ...-get-a-BlockState-without-a-snapshot.patch | 2 +- ...t-sendMessage-methods-to-CommandSend.patch | 2 +- .../Add-BeaconEffectEvent.patch | 2 +- .../Add-PlayerInitialSpawnEvent.patch | 2 +- .../Add-World.getEntity-UUID-API.patch | 2 +- .../Add-a-call-helper-to-Event.patch | 2 +- .../Add-async-chunk-load-API.patch | 90 -- .../Add-exception-reporting-event.patch | 4 +- .../Add-getI18NDisplayName-API.patch | 2 +- .../Add-player-view-distance-API.patch | 2 +- ...tional-world.getNearbyEntities-API-s.patch | 2 +- ...Entity-AddTo-RemoveFrom-World-Events.patch | 4 +- .../Entity-fromMobSpawner.patch | 2 +- .../Expand-Explosions-API.patch | 2 +- ...ld.spawnParticle-API-and-add-Builder.patch | 2 +- ...orldBorder-isInBounds-Location-check.patch | 2 +- Spigot-API-Patches/Fireworks-API-s.patch | 2 +- ...upstream-javadoc-warnings-and-errors.patch | 4 +- ...cord-chat-API-from-spigot-subclasses.patch | 2 +- ...PI-additions-for-quantity-flags-lore.patch | 2 +- .../ItemStack-getMaxItemUseDuration.patch | 2 +- .../LivingEntity-setKiller.patch | 2 +- ...Made-EntityDismountEvent-Cancellable.patch | 2 +- .../Player-Tab-List-and-Title-APIs.patch | 2 +- .../Profile-Lookup-Events.patch | 2 +- ...rovide-E-TE-Chunk-count-stat-methods.patch | 2 +- ...synchronization-in-MetadataStoreBase.patch | 2 +- .../ensureServerConversions-API.patch | 9 +- ...-get-a-BlockState-without-a-snapshot.patch | 2 +- .../Ability-to-apply-mending-to-XP-API.patch | 8 +- .../Add-ArmorStand-Item-Meta.patch | 10 +- .../Add-PlayerJumpEvent.patch | 2 +- .../Add-PlayerUseUnknownEntityEvent.patch | 2 +- .../Add-World-Util-Methods.patch | 6 +- .../Add-async-chunk-load-API.patch | 38 - ...to-disable-ender-dragon-legacy-check.patch | 2 +- .../Add-exception-reporting-event.patch | 2 +- ...ent-to-allow-plugins-to-handle-clien.patch | 47 + ...ke-parrots-stay-on-shoulders-despite.patch | 4 +- .../Add-player-view-distance-API.patch | 2 +- .../Add-velocity-warnings.patch | 4 +- ...Item-entities-with-World.spawnEntity.patch | 2 +- Spigot-Server-Patches/Anti-Xray.patch | 1171 ----------------- ...sign-the-World-in-WorldGenStronghold.patch | 20 - .../AsyncTabCompleteEvent.patch | 2 +- .../Auto-Save-Improvements.patch | 2 +- ...ups-for-Entity-TileEntity-Current-Ch.patch | 2 +- ...opper-searches-if-there-are-no-items.patch | 2 +- ...e-informative-in-maxHealth-exception.patch | 2 +- .../Block-Enderpearl-Travel-Exploit.patch | 6 +- .../Chunk-Save-Reattempt.patch | 2 +- .../Chunk-Save-Stats-Debug-Option.patch | 2 +- .../Chunk-registration-fixes.patch | 2 +- .../Chunk-save-queue-improvements.patch | 2 +- ...le-Alternative-LootPool-Luck-Formula.patch | 2 +- .../Configurable-Bed-Search-Radius.patch | 2 +- .../Configurable-Chunk-Inhabited-Timer.patch | 2 +- ...urable-Chunks-Sends-per-Tick-setting.patch | 2 +- .../Configurable-Grass-Spread-Tick-Rate.patch | 34 + ...le-Keep-Spawn-Loaded-range-per-world.patch | 4 +- .../Configurable-Player-Collision.patch | 117 ++ .../Configurable-RCON-IP-address.patch | 21 + ...figurable-container-update-tick-rate.patch | 2 +- .../Configurable-end-credits.patch | 2 +- .../Configurable-flying-kick-messages.patch | 2 +- ...onfigurable-packet-in-spam-threshold.patch | 2 +- ...urable-sprint-interruption-on-attack.patch | 2 +- ...nfigurable-top-of-nether-void-damage.patch | 2 +- ...ading-permissions.yml-before-plugins.patch | 2 +- ...unk-Unloads-based-on-Player-Movement.patch | 4 +- .../Disable-explosion-knockback.patch | 2 +- .../Disable-ice-and-snow.patch | 2 +- Spigot-Server-Patches/Disable-thunder.patch | 2 +- .../Do-not-load-chunks-for-light-checks.patch | 21 + ...am-reload-spawn-chunks-in-nether-end.patch | 32 + .../Don-t-tick-Skulls-unused-code.patch | 20 + ...ck-and-tnt-entities-at-the-specified.patch | 6 +- .../Enforce-Sync-Chunk-Unloads.patch | 2 +- .../Enforce-Sync-Player-Saves.patch | 2 +- .../Ensure-commands-are-not-ran-async.patch | 2 +- ...Entity-AddTo-RemoveFrom-World-Events.patch | 2 +- Spigot-Server-Patches/Entity-Origin-API.patch | 6 +- .../Entity-Tracking-Improvements.patch | 2 +- .../EntityPathfindEvent.patch | 37 + ...ityRegainHealthEvent-isFastRegen-API.patch | 43 + .../Expand-Explosions-API.patch | 2 +- ...ld.spawnParticle-API-and-add-Builder.patch | 2 +- .../ExperienceOrbMergeEvent.patch | 2 +- ...PI-for-Reason-Source-Triggering-play.patch | 2 +- ...nt-protocol-version-and-virtual-host.patch | 2 +- .../Extend-Player-Interact-cancellation.patch | 2 +- ...a-from-ArmorStand-and-SpawnEgg-items.patch | 2 +- Spigot-Server-Patches/Firework-API-s.patch | 4 +- .../Fix-AIOOBE-in-inventory-handling.patch | 2 +- .../Fix-Anvil-Level-sync-to-client.patch | 4 +- ...g-BlockPlaceEvent-triggering-physics.patch | 19 + .../Fix-Chunk-Unload-Queue-Issues.patch | 2 +- .../Fix-Double-World-Add-issues.patch | 4 +- .../Fix-MC-117075-TE-Unload-Lag-Spike.patch | 2 +- .../Fix-block-break-desync.patch | 2 +- ...-allowed-colored-signs-to-be-created.patch | 2 +- ...-explosions-processing-dead-entities.patch | 4 +- ...dDebugInfo-not-initialized-on-client.patch | 19 + .../Flag-to-disable-the-channel-limit.patch | 2 +- .../Handle-Item-Meta-Inconsistencies.patch | 4 +- ...n-prefixes-using-Log4J-configuration.patch | 2 +- .../Implement-World.getEntity-UUID-API.patch | 2 +- ...nt-extended-PaperServerListPingEvent.patch | 2 +- ...item-frames-performance-and-bug-fixe.patch | 2 +- .../Include-Log4J2-SLF4J-implementation.patch | 2 +- .../InventoryCloseEvent-Reason-API.patch | 6 +- .../ItemStack-getMaxItemUseDuration.patch | 2 +- Spigot-Server-Patches/Lighting-Queue.patch | 2 +- Spigot-Server-Patches/MC-Utils.patch | 180 ++- ...-max-squid-spawn-height-configurable.patch | 2 +- ...e-shield-blocking-delay-configurable.patch | 2 +- ...mative-vehicle-moved-wrongly-message.patch | 2 +- .../Optimize-ItemStack.isEmpty.patch | 2 +- ...imize-World.isLoaded-BlockPosition-Z.patch | 2 +- .../Optimize-explosions.patch | 2 +- ...Location-getType-and-getBlockData-fo.patch | 4 +- ...-maximum-exp-value-when-merging-orbs.patch | 8 +- ...sable-BlockPhysicsEvent-for-Redstone.patch | 2 +- ...nilla-per-world-scoreboard-coloring-.patch | 2 +- .../Optional-TNT-doesn-t-move-in-water.patch | 2 +- .../Player.setPlayerProfile-API.patch | 2 +- ...vent-Auto-Save-if-Save-Queue-is-full.patch | 2 +- .../Prevent-Fire-from-loading-chunks.patch | 51 + .../ProfileWhitelistVerifyEvent.patch | 2 +- .../Properly-fix-item-duplication-bug.patch | 2 +- ...le-async-calls-to-restart-the-server.patch | 2 +- ...rovide-E-TE-Chunk-count-stat-methods.patch | 2 +- ...uce-IO-ops-opening-a-new-region-file.patch | 51 + ...nventory-when-cancelling-PlayerInter.patch | 2 +- .../Remove-Debug-checks-from-DataBits.patch | 44 + ...Remove-unused-World-Tile-Entity-List.patch | 69 + ...egionFileCache-and-make-configurable.patch | 79 ++ ...dEffects-only-to-players-who-can-see.patch | 4 +- .../Shoulder-Entities-Release-API.patch | 2 +- .../String-based-Action-Bar-API.patch | 4 +- Spigot-Server-Patches/Timings-v2.patch | 125 +- ...r-crits-helps-mitigate-hacked-client.patch | 2 +- ...ams-to-redirect-System.out-err-to-lo.patch | 2 +- .../Use-Optimized-Collections.patch | 36 + ...oleAppender-for-console-improvements.patch | 6 +- .../Vehicle-Event-Cancellation-Changes.patch | 2 +- ...nd-for-setting-passengers-on-players.patch | 30 + .../handle-PacketPlayInKeepAlive-async.patch | 2 +- ...rt-serverside-behavior-of-keepalives.patch | 4 +- ...e-implementations-for-captured-block.patch | 2 +- scripts/importmcdev.sh | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- 153 files changed, 1200 insertions(+), 1535 deletions(-) delete mode 100644 Spigot-API-Patches/Add-async-chunk-load-API.patch delete mode 100644 Spigot-Server-Patches/Add-async-chunk-load-API.patch create mode 100644 Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch delete mode 100644 Spigot-Server-Patches/Anti-Xray.patch delete mode 100644 Spigot-Server-Patches/Assign-the-World-in-WorldGenStronghold.patch create mode 100644 Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch create mode 100644 Spigot-Server-Patches/Configurable-Player-Collision.patch create mode 100644 Spigot-Server-Patches/Configurable-RCON-IP-address.patch create mode 100644 Spigot-Server-Patches/Do-not-load-chunks-for-light-checks.patch create mode 100644 Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch create mode 100644 Spigot-Server-Patches/Don-t-tick-Skulls-unused-code.patch create mode 100644 Spigot-Server-Patches/EntityPathfindEvent.patch create mode 100644 Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch create mode 100644 Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch create mode 100644 Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch create mode 100644 Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch create mode 100644 Spigot-Server-Patches/Reduce-IO-ops-opening-a-new-region-file.patch create mode 100644 Spigot-Server-Patches/Remove-Debug-checks-from-DataBits.patch create mode 100644 Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch create mode 100644 Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch create mode 100644 Spigot-Server-Patches/Use-Optimized-Collections.patch create mode 100644 Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch diff --git a/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch index 1634367d3e..490a648915 100644 --- a/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-API-Patches/API-to-get-a-BlockState-without-a-snapshot.patch @@ -9,7 +9,7 @@ on the real tile entity. This is useful for where performance is needed diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 1aa3373f..9aab043c 100644 +index 679c29cf..238de6f0 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -0,0 +0,0 @@ public interface Block extends Metadatable { 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 a64264b52a..6531dc004a 100644 --- a/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch +++ b/Spigot-API-Patches/Add-BaseComponent-sendMessage-methods-to-CommandSend.patch @@ -40,7 +40,7 @@ index abf68a2c..fcb03b83 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5dbec412..5955b20c 100644 +index 65b7a076..1837a14c 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, CommandSender, Offline diff --git a/Spigot-API-Patches/Add-BeaconEffectEvent.patch b/Spigot-API-Patches/Add-BeaconEffectEvent.patch index b85d62ab7a..e82f5fe3bf 100644 --- a/Spigot-API-Patches/Add-BeaconEffectEvent.patch +++ b/Spigot-API-Patches/Add-BeaconEffectEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add BeaconEffectEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +index 00000000..6579ae99 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch b/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch index c1ca95105f..c984bd2058 100644 --- a/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch +++ b/Spigot-API-Patches/Add-PlayerInitialSpawnEvent.patch @@ -7,7 +7,7 @@ For modifying a player's initial spawn location as they join the server diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +index 00000000..d1d6f33c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch b/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch index c9ec9c94f3..a802d4a014 100644 --- a/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch +++ b/Spigot-API-Patches/Add-World.getEntity-UUID-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 04c174f7..121033e9 100644 +index 7a6728fb..550c26be 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/Add-a-call-helper-to-Event.patch b/Spigot-API-Patches/Add-a-call-helper-to-Event.patch index 5edb25efb4..cd0409ae08 100644 --- a/Spigot-API-Patches/Add-a-call-helper-to-Event.patch +++ b/Spigot-API-Patches/Add-a-call-helper-to-Event.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add a call helper to Event Reduces diff in Server patches diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +index 6677e1bd..e7061112 100644 --- a/src/main/java/org/bukkit/event/Event.java +++ b/src/main/java/org/bukkit/event/Event.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Add-async-chunk-load-API.patch b/Spigot-API-Patches/Add-async-chunk-load-API.patch deleted file mode 100644 index e44a54b6cc..0000000000 --- a/Spigot-API-Patches/Add-async-chunk-load-API.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 29 Feb 2016 17:43:33 -0600 -Subject: [PATCH] Add async chunk load API - - -diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 33b14a07..22ab4633 100644 ---- a/src/main/java/org/bukkit/World.java -+++ b/src/main/java/org/bukkit/World.java -@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Chunk getChunkAt(Block block); - -+ /** -+ * Used by {@link World#getChunkAtAsync(Location,ChunkLoadCallback)} methods -+ * to request a {@link Chunk} to be loaded, with this callback receiving -+ * the chunk when it is finished. -+ * -+ * This callback will be executed on synchronously on the main thread. -+ * -+ * Timing and order this callback is fired is intentionally not defined and -+ * and subject to change. -+ */ -+ public static interface ChunkLoadCallback { -+ public void onLoad(Chunk chunk); -+ } -+ -+ /** -+ * Requests a {@link Chunk} to be loaded at the given coordinates -+ * -+ * This method makes no guarantee on how fast the chunk will load, -+ * and will return the chunk to the callback at a later time. -+ * -+ * You should use this method if you need a chunk but do not need it -+ * immediately, and you wish to let the server control the speed -+ * of chunk loads, keeping performance in mind. -+ * -+ * The {@link ChunkLoadCallback} will always be executed synchronously -+ * on the main Server Thread. -+ * -+ * @param x Chunk X-coordinate of the chunk - (world coordinate / 16) -+ * @param z Chunk Z-coordinate of the chunk - (world coordinate / 16) -+ * @param cb Callback to receive the chunk when it is loaded. -+ * will be executed synchronously -+ */ -+ public void getChunkAtAsync(int x, int z, ChunkLoadCallback cb); -+ -+ /** -+ * Requests a {@link Chunk} to be loaded at the given {@link Location} -+ * -+ * This method makes no guarantee on how fast the chunk will load, -+ * and will return the chunk to the callback at a later time. -+ * -+ * You should use this method if you need a chunk but do not need it -+ * immediately, and you wish to let the server control the speed -+ * of chunk loads, keeping performance in mind. -+ * -+ * The {@link ChunkLoadCallback} will always be executed synchronously -+ * on the main Server Thread. -+ * -+ * @param location Location of the chunk -+ * @param cb Callback to receive the chunk when it is loaded. -+ * will be executed synchronously -+ */ -+ public void getChunkAtAsync(Location location, ChunkLoadCallback cb); -+ -+ /** -+ * Requests {@link Chunk} to be loaded that contains the given {@link Block} -+ * -+ * This method makes no guarantee on how fast the chunk will load, -+ * and will return the chunk to the callback at a later time. -+ * -+ * You should use this method if you need a chunk but do not need it -+ * immediately, and you wish to let the server control the speed -+ * of chunk loads, keeping performance in mind. -+ * -+ * The {@link ChunkLoadCallback} will always be executed synchronously -+ * on the main Server Thread. -+ * -+ * @param block Block to get the containing chunk from -+ * @param cb Callback to receive the chunk when it is loaded. -+ * will be executed synchronously -+ */ -+ public void getChunkAtAsync(Block block, ChunkLoadCallback cb); -+ - /** - * Checks if the specified {@link Chunk} is loaded - * --- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-exception-reporting-event.patch b/Spigot-API-Patches/Add-exception-reporting-event.patch index bc0a025a6b..7f19033648 100644 --- a/Spigot-API-Patches/Add-exception-reporting-event.patch +++ b/Spigot-API-Patches/Add-exception-reporting-event.patch @@ -591,6 +591,4 @@ index 80c152ba..b88f31ca 100644 } } } --- -2.17.0 (Apple Git-106) - +-- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-getI18NDisplayName-API.patch b/Spigot-API-Patches/Add-getI18NDisplayName-API.patch index 9867851286..1cd6d8dfb0 100644 --- a/Spigot-API-Patches/Add-getI18NDisplayName-API.patch +++ b/Spigot-API-Patches/Add-getI18NDisplayName-API.patch @@ -28,7 +28,7 @@ index 045c26d9..47bbc0f9 100644 // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 6df4b97a..864b16b1 100644 +index 14b6b6b3..ca7a958f 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { diff --git a/Spigot-API-Patches/Add-player-view-distance-API.patch b/Spigot-API-Patches/Add-player-view-distance-API.patch index cde2c49d7e..2319b13df5 100644 --- a/Spigot-API-Patches/Add-player-view-distance-API.patch +++ b/Spigot-API-Patches/Add-player-view-distance-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add player view distance API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 0481f15b..868d0374 100644 +index 25e44028..7f215f1a 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, CommandSender, Offline diff --git a/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch b/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch index bfba1c5b69..82e6b60414 100644 --- a/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch +++ b/Spigot-API-Patches/Additional-world.getNearbyEntities-API-s.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's Provides more methods to get nearby entities, and filter by types and predicates diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 4cc70326..97badc63 100644 +index e14098fa..ac32195d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ package org.bukkit; diff --git a/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch index 22eee48f39..5342f51464 100644 --- a/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-API-Patches/Entity-AddTo-RemoveFrom-World-Events.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +index 00000000..18b158cd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java @@ -0,0 +0,0 @@ @@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java new file mode 100644 -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 +index 00000000..800be6aa --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Entity-fromMobSpawner.patch b/Spigot-API-Patches/Entity-fromMobSpawner.patch index 342d2fb87b..6a93a7b565 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 69fbdb3c..6fc00fdf 100644 +index 9b0f97f1..3ae4de7a 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 { diff --git a/Spigot-API-Patches/Expand-Explosions-API.patch b/Spigot-API-Patches/Expand-Explosions-API.patch index e27b6b5d1f..8658c1e3b7 100644 --- a/Spigot-API-Patches/Expand-Explosions-API.patch +++ b/Spigot-API-Patches/Expand-Explosions-API.patch @@ -95,7 +95,7 @@ index c1689168..d0d86e1a 100644 @Override public boolean equals(Object obj) { diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index a22e47ea..04c174f7 100644 +index d2b3e192..7a6728fb 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch index 463753e442..1af304783e 100644 --- a/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-API-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch @@ -410,7 +410,7 @@ index 4d0acaf5..0ae85d85 100644 * Options which can be applied to redstone dust particles - a particle * color and size. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 97badc63..a22e47ea 100644 +index ac32195d..d2b3e192 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch b/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch index 2a4c7ad2e9..b9bffe75b0 100644 --- a/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch +++ b/Spigot-API-Patches/Expose-WorldBorder-isInBounds-Location-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +index 4dc18edc..41b7fae6 100644 --- a/src/main/java/org/bukkit/WorldBorder.java +++ b/src/main/java/org/bukkit/WorldBorder.java @@ -0,0 +0,0 @@ public interface WorldBorder { diff --git a/Spigot-API-Patches/Fireworks-API-s.patch b/Spigot-API-Patches/Fireworks-API-s.patch index e5e770f2cd..187260ad3f 100644 --- a/Spigot-API-Patches/Fireworks-API-s.patch +++ b/Spigot-API-Patches/Fireworks-API-s.patch @@ -7,7 +7,7 @@ Get the Entity being boosted Get the firework launcher diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +index b8a8c075..8c087bb7 100644 --- a/src/main/java/org/bukkit/entity/Firework.java +++ b/src/main/java/org/bukkit/entity/Firework.java @@ -0,0 +0,0 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch b/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch index 5c4e24918c..cf4135aae0 100644 --- a/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch +++ b/Spigot-API-Patches/Fix-upstream-javadoc-warnings-and-errors.patch @@ -21,7 +21,7 @@ index 1ed8f7e4..bd5238ce 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 1e980d2d..4cc70326 100644 +index 7875a71a..e14098fa 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -335,7 +335,7 @@ index 034421a7..f1a54c23 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java -index 92174e81..ac5cc32c 100644 +index ab71f3c3..358ea386 100644 --- a/src/main/java/org/bukkit/scoreboard/Team.java +++ b/src/main/java/org/bukkit/scoreboard/Team.java @@ -0,0 +0,0 @@ public interface Team { diff --git a/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch b/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch index fd42f68bc9..73b10c7e07 100644 --- a/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch +++ b/Spigot-API-Patches/Graduate-bungeecord-chat-API-from-spigot-subclasses.patch @@ -68,7 +68,7 @@ index 2b43ac1f..d8ce8173 100644 * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 868d0374..c2977dc4 100644 +index 7f215f1a..f4d1ade5 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, CommandSender, Offline diff --git a/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch b/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch index e11fb6689c..7751a9c0dc 100644 --- a/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch +++ b/Spigot-API-Patches/ItemStack-API-additions-for-quantity-flags-lore.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index e9f25924..7689c00a 100644 +index a240311e..c5befd8c 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ package org.bukkit.inventory; diff --git a/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch b/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch index 921c6c0e63..0a103e6098 100644 --- a/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-API-Patches/ItemStack-getMaxItemUseDuration.patch @@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 864b16b1..e9f25924 100644 +index ca7a958f..a240311e 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { diff --git a/Spigot-API-Patches/LivingEntity-setKiller.patch b/Spigot-API-Patches/LivingEntity-setKiller.patch index d1c3f44e57..210232cea0 100644 --- a/Spigot-API-Patches/LivingEntity-setKiller.patch +++ b/Spigot-API-Patches/LivingEntity-setKiller.patch @@ -5,7 +5,7 @@ Subject: [PATCH] LivingEntity#setKiller diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 4fafedc9..42cf95e1 100644 +index f6ae0a6d..700ed29f 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -0,0 +0,0 @@ import org.bukkit.potion.PotionEffect; diff --git a/Spigot-API-Patches/Made-EntityDismountEvent-Cancellable.patch b/Spigot-API-Patches/Made-EntityDismountEvent-Cancellable.patch index 587914c188..1c808cfeec 100644 --- a/Spigot-API-Patches/Made-EntityDismountEvent-Cancellable.patch +++ b/Spigot-API-Patches/Made-EntityDismountEvent-Cancellable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Made EntityDismountEvent Cancellable diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +index 24d4942a..ce989bb1 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 @@ diff --git a/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch b/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch index c1b7fc393b..ccbd26fd13 100644 --- a/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-API-Patches/Player-Tab-List-and-Title-APIs.patch @@ -369,7 +369,7 @@ index 00000000..3c2b63db + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index c2977dc4..5dbec412 100644 +index f4d1ade5..65b7a076 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/Profile-Lookup-Events.patch b/Spigot-API-Patches/Profile-Lookup-Events.patch index b16c00f3cf..bf98024b4a 100644 --- a/Spigot-API-Patches/Profile-Lookup-Events.patch +++ b/Spigot-API-Patches/Profile-Lookup-Events.patch @@ -7,7 +7,7 @@ Adds a Pre Lookup Event and a Post Lookup Event so that plugins may prefill in p profiles that had to be looked up. diff --git a/pom.xml b/pom.xml -index dfc6c9b5..e1a39bfe 100644 +index bd9146dd..44a8b2a5 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch index 7c24987edf..04d2129c4e 100644 --- a/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-API-Patches/Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 22ab4633..65156e80 100644 +index 91ad39a8..7875a71a 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -0,0 +0,0 @@ import org.bukkit.util.Vector; diff --git a/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch b/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch index 58aa0e038d..18652a39c3 100644 --- a/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch +++ b/Spigot-API-Patches/Reduce-thread-synchronization-in-MetadataStoreBase.patch @@ -8,7 +8,7 @@ limited synchronized portions to allow much higher concurrency in MetadataStore as well as far less locking, especially on reads diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +index 093c1445..64c0f0a7 100644 --- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java @@ -0,0 +0,0 @@ import org.apache.commons.lang.Validate; diff --git a/Spigot-API-Patches/ensureServerConversions-API.patch b/Spigot-API-Patches/ensureServerConversions-API.patch index 7bd554a9ef..dfc3e33b3a 100644 --- a/Spigot-API-Patches/ensureServerConversions-API.patch +++ b/Spigot-API-Patches/ensureServerConversions-API.patch @@ -28,14 +28,19 @@ index 762c43d6..045c26d9 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 6324044d..6df4b97a 100644 +index 73f79b22..14b6b6b3 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -0,0 +0,0 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { - result.setDurability(damage); + } } - return result; ++ // Set damage again incase meta overwrote it ++ if (args.containsKey("damage")) { ++ result.setDurability(damage); ++ } ++ + return result.ensureServerConversions(); // Paper } diff --git a/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch index 5ac315d855..eb8053b10e 100644 --- a/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-Server-Patches/API-to-get-a-BlockState-without-a-snapshot.patch @@ -39,7 +39,7 @@ index 2cfe2202e..909432d51 100644 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index bfed2d988..d1eea2133 100644 +index bbf7b5088..c94b5c817 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -0,0 +0,0 @@ public class CraftBlock implements Block { diff --git a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch index a3094e5a67..2420410f17 100644 --- a/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/Ability-to-apply-mending-to-XP-API.patch @@ -52,7 +52,7 @@ index a87ef5fb8..b8bfc7577 100644 return i * 2; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9f9002dd8..c2cd5ac4b 100644 +index 43e357e39..7021a81be 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -65,10 +65,10 @@ index 9f9002dd8..c2cd5ac4b 100644 + public int applyMending(int amount) { + EntityPlayer handle = getHandle(); + // Logic copied from EntityExperienceOrb and remapped to unobfuscated methods/properties -+ ItemStack itemstack = EnchantmentManager.getRandomEquippedItemWithEnchant(Enchantments.MENDING, handle); -+ if (!itemstack.isEmpty() && itemstack.hasDamage()) { ++ net.minecraft.server.ItemStack itemstack = net.minecraft.server.EnchantmentManager.getRandomEquippedItemWithEnchant(net.minecraft.server.Enchantments.MENDING, handle); ++ if (!itemstack.isEmpty() && itemstack.getItem().usesDurability()) { + -+ EntityExperienceOrb orb = new EntityExperienceOrb(handle.world); ++ net.minecraft.server.EntityExperienceOrb orb = new net.minecraft.server.EntityExperienceOrb(handle.world); + orb.value = amount; + orb.spawnReason = org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM; + orb.locX = handle.locX; diff --git a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch index ba1d2175aa..c3e5f355cb 100644 --- a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch +++ b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch @@ -40,7 +40,7 @@ index cadff64bf..b1e0d6185 100644 case TRAPPED_CHEST: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java new file mode 100644 -index 000000000..dc372f6db +index 000000000..30941c7b0 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java @@ -0,0 +0,0 @@ @@ -48,12 +48,16 @@ index 000000000..dc372f6db + +import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; +import com.google.common.collect.ImmutableMap; ++import com.mojang.datafixers.Dynamic; ++ +import net.minecraft.server.DataConverterTypes; ++import net.minecraft.server.DynamicOpsNBT; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.NBTBase; +import net.minecraft.server.NBTTagCompound; +import org.bukkit.Material; +import org.bukkit.configuration.serialization.DelegateDeserialization; ++import org.bukkit.craftbukkit.util.CraftMagicNumbers; + +import java.util.Map; + @@ -220,7 +224,7 @@ index 000000000..dc372f6db + + if (tag.hasKey(ENTITY_TAG.NBT)) { + entityTag = tag.getCompound(ENTITY_TAG.NBT); -+ MinecraftServer.getServer().dataConverterManager.a(DataConverterTypes.ENTITY, entityTag); // PAIL: convert ++ MinecraftServer.getServer().dataConverterManager.update(DataConverterTypes.ENTITY, new Dynamic(DynamicOpsNBT.a, entityTag), -1, CraftMagicNumbers.DATA_VERSION); + + if (entityTag.hasKey(INVISIBLE.NBT)) { + invisible = entityTag.getBoolean(INVISIBLE.NBT); @@ -343,7 +347,7 @@ index 000000000..dc372f6db + CraftMetaArmorStand clone = (CraftMetaArmorStand) super.clone(); + + if (entityTag != null) { -+ clone.entityTag = entityTag.g(); ++ clone.entityTag = entityTag.clone(); + } + + return clone; diff --git a/Spigot-Server-Patches/Add-PlayerJumpEvent.patch b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch index cc0bd6a974..f33441dbab 100644 --- a/Spigot-Server-Patches/Add-PlayerJumpEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch @@ -17,7 +17,7 @@ index f08c0ba60..1b944abea 100644 super.cG(); this.a(StatisticList.JUMP); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index bf549bfed..25c38f3bb 100644 +index 383ef87ba..480b93aa0 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.CraftingInventory; diff --git a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch index a4f365e843..020cb40cab 100644 --- a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch @@ -18,7 +18,7 @@ index 77440ac81..8711462e1 100644 private Vec3D c; private EnumHand d; diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 9c27966ea..5c70a4a9b 100644 +index 88b761d27..a3486bd46 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, ITickable { diff --git a/Spigot-Server-Patches/Add-World-Util-Methods.patch b/Spigot-Server-Patches/Add-World-Util-Methods.patch index e1666e6a86..de9113d8e7 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/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index fa500e93f..f376b3a34 100644 +index 7ea4b9b5c..fb27dcac2 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -18,7 +18,7 @@ index fa500e93f..f376b3a34 100644 return this.a(blockposition, i, this.world.o().g()); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d51ed0f80..1c939e523 100644 +index d51ed0f80..d3785f73b 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, IIBlockAccess, AutoClose @@ -26,7 +26,7 @@ index d51ed0f80..1c939e523 100644 protected final IntHashMap entitiesById = new IntHashMap(); private final long G = 16777215L; - private int H; -+ private int H; private int getSkylightSubtracted() { return this.H; } // Paper - OBFHELPER ++ private int H; public int getSkylightSubtracted() { return this.H; } public void setSkylightSubtracted(int value) { this.H = value;} // Paper - OBFHELPER protected int m = (new Random()).nextInt(); protected final int n = 1013904223; protected float o; diff --git a/Spigot-Server-Patches/Add-async-chunk-load-API.patch b/Spigot-Server-Patches/Add-async-chunk-load-API.patch deleted file mode 100644 index 33cb6b8c0b..0000000000 --- a/Spigot-Server-Patches/Add-async-chunk-load-API.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Tue, 1 Mar 2016 23:19:01 -0600 -Subject: [PATCH] Add async chunk load API - - -diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 0b2a9d09d..4df849eef 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 { - } - } - -+ // Paper start - Async chunk load API -+ public void getChunkAtAsync(final int x, final int z, final ChunkLoadCallback callback) { -+ final ChunkProviderServer cps = this.world.getChunkProviderServer(); -+ cps.getChunkAt(x, z, new Runnable() { -+ @Override -+ public void run() { -+ callback.onLoad(cps.getChunkAt(x, z).bukkitChunk); -+ } -+ }); -+ } -+ -+ public void getChunkAtAsync(Block block, ChunkLoadCallback callback) { -+ getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, callback); -+ } -+ -+ public void getChunkAtAsync(Location location, ChunkLoadCallback callback) { -+ getChunkAtAsync(location.getBlockX() >> 4, location.getBlockZ() >> 4, callback); -+ } -+ // Paper end -+ - public Chunk getChunkAt(int x, int z) { - return this.world.getChunkProviderServer().getChunkAt(x, z).bukkitChunk; - } --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch b/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch index 0ca219acf5..8b9cc83b6f 100644 --- a/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch +++ b/Spigot-Server-Patches/Add-config-to-disable-ender-dragon-legacy-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add config to disable ender dragon legacy check diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 650addb84..b2855f3ca 100644 +index ef4bfb480..1607619bd 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 { diff --git a/Spigot-Server-Patches/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch index 508af80fbd..f2c5bbd63a 100644 --- a/Spigot-Server-Patches/Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch @@ -50,7 +50,7 @@ index 000000000..93397188b +} \ No newline at end of file diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 32f467b37..fa500e93f 100644 +index 2d55abd7a..7ea4b9b5c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch new file mode 100644 index 0000000000..1c2ffd791f --- /dev/null +++ b/Spigot-Server-Patches/Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -0,0 +1,47 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Riley Park +Date: Wed, 13 Apr 2016 20:21:38 -0700 +Subject: [PATCH] Add handshake event to allow plugins to handle client + handshaking logic themselves + + +diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java +index 7c75433f5..088ec198e 100644 +--- a/src/main/java/net/minecraft/server/HandshakeListener.java ++++ b/src/main/java/net/minecraft/server/HandshakeListener.java +@@ -0,0 +0,0 @@ public class HandshakeListener implements PacketHandshakingInListener { + this.b.close(chatmessage); + } else { + this.b.setPacketListener(new LoginListener(this.a, this.b)); ++ // Paper start - handshake event ++ boolean proxyLogicEnabled = org.spigotmc.SpigotConfig.bungee; ++ boolean handledByEvent = false; ++ // Try and handle the handshake through the event ++ if (com.destroystokyo.paper.event.player.PlayerHandshakeEvent.getHandlerList().getRegisteredListeners().length != 0) { // Hello? Can you hear me? ++ com.destroystokyo.paper.event.player.PlayerHandshakeEvent event = new com.destroystokyo.paper.event.player.PlayerHandshakeEvent(packethandshakinginsetprotocol.hostname, !proxyLogicEnabled); ++ if (event.callEvent()) { ++ // If we've failed somehow, let the client know so and go no further. ++ if (event.isFailed()) { ++ chatmessage = new ChatMessage(event.getFailMessage()); ++ this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); ++ this.b.close(chatmessage); ++ return; ++ } ++ ++ packethandshakinginsetprotocol.hostname = event.getServerHostname(); ++ this.b.l = new java.net.InetSocketAddress(event.getSocketAddressHostname(), ((java.net.InetSocketAddress) this.b.getSocketAddress()).getPort()); ++ this.b.spoofedUUID = event.getUniqueId(); ++ this.b.spoofedProfile = gson.fromJson(event.getPropertiesJson(), com.mojang.authlib.properties.Property[].class); ++ handledByEvent = true; // Hooray, we did it! ++ } ++ } ++ // Don't try and handle default logic if it's been handled by the event. ++ if (!handledByEvent && proxyLogicEnabled) { ++ // Paper end + // Spigot Start +- if (org.spigotmc.SpigotConfig.bungee) { ++ //if (org.spigotmc.SpigotConfig.bungee) { // Paper - comment out, we check above! + String[] split = packethandshakinginsetprotocol.hostname.split("\00"); + if ( split.length == 3 || split.length == 4 ) { + packethandshakinginsetprotocol.hostname = split[0]; +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 1bcd7cb0cb..cd341a5d53 100644 --- a/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/Spigot-Server-Patches/Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -26,7 +26,7 @@ index 0b748d402..99fe720e8 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 36a961cb7..0da76b268 100644 +index 83bfb6611..0486dee2c 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 { @@ -39,7 +39,7 @@ index 36a961cb7..0da76b268 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 25e3d6423..128b2beb5 100644 +index aa93b5945..383ef87ba 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, ITickable { diff --git a/Spigot-Server-Patches/Add-player-view-distance-API.patch b/Spigot-Server-Patches/Add-player-view-distance-API.patch index fd13a9db4f..a32d8de5d3 100644 --- a/Spigot-Server-Patches/Add-player-view-distance-API.patch +++ b/Spigot-Server-Patches/Add-player-view-distance-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add player view distance API diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index cb44bf3a7..0531812fb 100644 +index ace6db1fa..8ca7da336 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/Add-velocity-warnings.patch b/Spigot-Server-Patches/Add-velocity-warnings.patch index d27c8c77b1..2a7266c9ee 100644 --- a/Spigot-Server-Patches/Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/Add-velocity-warnings.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 32a05ca18..eaac1430e 100644 +index 703d38f0c..a9d60b8d2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { @@ -17,7 +17,7 @@ index 32a05ca18..eaac1430e 100644 private final class BooleanWrapper { private boolean value = true; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 0daa15f1b..2b9c571ca 100644 +index 34246369c..03a3328b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { 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 8747174807..14f999bcb4 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 3ee663293..65ad8e588 100644 +index 1afb480f8..f7eaecb3f 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 deleted file mode 100644 index 0a0be9bdbf..0000000000 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ /dev/null @@ -1,1171 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: stonar96 -Date: Thu, 21 Sep 2017 00:38:47 +0200 -Subject: [PATCH] Anti-Xray - - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c80d84b9b..6344537ec 100644 ---- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -0,0 +0,0 @@ - package com.destroystokyo.paper; - -+import java.util.Arrays; - import java.util.List; - -+import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray.ChunkEdgeMode; -+import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray.EngineMode; - import net.minecraft.server.MinecraftServer; - import org.bukkit.Bukkit; - import org.bukkit.configuration.file.YamlConfiguration; -@@ -0,0 +0,0 @@ public class PaperWorldConfig { - disableCreeperLingeringEffect = getBoolean("disable-creeper-lingering-effect", false); - log("Creeper lingering effect: " + disableCreeperLingeringEffect); - } -+ -+ public boolean antiXray; -+ public boolean asynchronous; -+ public EngineMode engineMode; -+ public ChunkEdgeMode chunkEdgeMode; -+ public int maxChunkSectionIndex; -+ public int updateRadius; -+ public List hiddenBlocks; -+ public List replacementBlocks; -+ private void antiXray() { -+ antiXray = getBoolean("anti-xray.enabled", false); -+ asynchronous = true; -+ engineMode = EngineMode.getById(getInt("anti-xray.engine-mode", EngineMode.HIDE.getId())); -+ engineMode = engineMode == null ? EngineMode.HIDE : engineMode; -+ chunkEdgeMode = ChunkEdgeMode.getById(getInt("anti-xray.chunk-edge-mode", ChunkEdgeMode.DEFAULT.getId())); -+ chunkEdgeMode = chunkEdgeMode == null ? ChunkEdgeMode.DEFAULT : chunkEdgeMode; -+ maxChunkSectionIndex = getInt("anti-xray.max-chunk-section-index", 3); -+ maxChunkSectionIndex = maxChunkSectionIndex > 15 ? 15 : maxChunkSectionIndex; -+ updateRadius = getInt("anti-xray.update-radius", 2); -+ hiddenBlocks = getList("anti-xray.hidden-blocks", Arrays.asList((Object) "gold_ore", "iron_ore", "coal_ore", "lapis_ore", "mossy_cobblestone", "obsidian", "chest", "diamond_ore", "redstone_ore", "lit_redstone_ore", "clay", "emerald_ore", "ender_chest")); -+ replacementBlocks = getList("anti-xray.replacement-blocks", Arrays.asList((Object) "stone", "planks")); -+ log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Chunk Edge Mode: " + chunkEdgeMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks / Update Radius: " + updateRadius); -+ } - } -diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java -new file mode 100644 -index 000000000..6833cfad2 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.antixray; -+ -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.Chunk; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.PacketPlayOutMapChunk; -+import net.minecraft.server.World; -+ -+public class ChunkPacketBlockController { -+ -+ public static final ChunkPacketBlockController NO_OPERATION_INSTANCE = new ChunkPacketBlockController(); -+ -+ protected ChunkPacketBlockController() { -+ -+ } -+ -+ public IBlockData[] getPredefinedBlockData(Chunk chunk, int chunkSectionIndex) { -+ return null; -+ } -+ -+ public boolean onChunkPacketCreate(Chunk chunk, int chunkSectionSelector, boolean force) { -+ return true; -+ } -+ -+ public PacketPlayOutMapChunkInfo getPacketPlayOutMapChunkInfo(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector) { -+ return null; -+ } -+ -+ public void modifyBlocks(PacketPlayOutMapChunk packetPlayOutMapChunk, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo) { -+ packetPlayOutMapChunk.setReady(true); -+ } -+ -+ public void updateNearbyBlocks(World world, BlockPosition blockPosition) { -+ -+ } -+} -diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -new file mode 100644 -index 000000000..2dc0655a9 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.antixray; -+ -+import java.util.HashSet; -+import java.util.Set; -+import java.util.concurrent.Executors; -+import java.util.concurrent.ExecutorService; -+ -+import com.destroystokyo.paper.PaperWorldConfig; -+ -+import net.minecraft.server.Block; -+import net.minecraft.server.BlockPosition; -+import net.minecraft.server.Blocks; -+import net.minecraft.server.Chunk; -+import net.minecraft.server.ChunkSection; -+import net.minecraft.server.DataPalette; -+import net.minecraft.server.DataPaletteBlock; -+import net.minecraft.server.DataPaletteGlobal; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.PacketPlayOutMapChunk; -+import net.minecraft.server.World; -+ -+import org.bukkit.World.Environment; -+ -+public class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockController { -+ -+ private static ExecutorService executorServiceInstance = null; -+ private final ExecutorService executorService; -+ private final boolean asynchronous; -+ private final EngineMode engineMode; -+ private final ChunkEdgeMode chunkEdgeMode; -+ private final int maxChunkSectionIndex; -+ private final int updateRadius; -+ private final IBlockData[] predefinedBlockData; -+ private final IBlockData[] predefinedBlockDataStone; -+ private final IBlockData[] predefinedBlockDataNetherrack; -+ private final IBlockData[] predefinedBlockDataEndStone; -+ private final int[] predefinedBlockDataBits; -+ private final int[] predefinedBlockDataBitsGlobal; -+ private final int[] predefinedBlockDataBitsStoneGlobal; -+ private final int[] predefinedBlockDataBitsNetherrackGlobal; -+ private final int[] predefinedBlockDataBitsEndStoneGlobal; -+ private final boolean[] solidGlobal = new boolean[Block.REGISTRY_ID.size()]; -+ private final boolean[] obfuscateGlobal = new boolean[Block.REGISTRY_ID.size()]; -+ private final ChunkSection[] emptyNearbyChunkSections = {Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION}; -+ -+ public ChunkPacketBlockControllerAntiXray(PaperWorldConfig paperWorldConfig) { -+ asynchronous = paperWorldConfig.asynchronous; -+ engineMode = paperWorldConfig.engineMode; -+ chunkEdgeMode = paperWorldConfig.chunkEdgeMode; -+ maxChunkSectionIndex = paperWorldConfig.maxChunkSectionIndex; -+ updateRadius = paperWorldConfig.updateRadius; -+ -+ if (asynchronous) { -+ executorService = getExecutorServiceInstance(); -+ } else { -+ executorService = null; -+ } -+ -+ if (engineMode == EngineMode.HIDE) { -+ predefinedBlockData = null; -+ predefinedBlockDataStone = new IBlockData[] {Blocks.STONE.getBlockData()}; -+ predefinedBlockDataNetherrack = new IBlockData[] {Blocks.NETHERRACK.getBlockData()}; -+ predefinedBlockDataEndStone = new IBlockData[] {Blocks.END_STONE.getBlockData()}; -+ predefinedBlockDataBits = new int[] {1}; -+ predefinedBlockDataBitsGlobal = null; -+ predefinedBlockDataBitsStoneGlobal = new int[] {Block.REGISTRY_ID.getId(Blocks.STONE.getBlockData())}; -+ predefinedBlockDataBitsNetherrackGlobal = new int[] {Block.REGISTRY_ID.getId(Blocks.NETHERRACK.getBlockData())}; -+ predefinedBlockDataBitsEndStoneGlobal = new int[] {Block.REGISTRY_ID.getId(Blocks.END_STONE.getBlockData())}; -+ } else { -+ Set predefinedBlockDataSet = new HashSet(); -+ -+ for (Object id : paperWorldConfig.hiddenBlocks) { -+ Block block = Block.getByName(String.valueOf(id)); -+ -+ if (block != null && !block.isTileEntity()) { -+ predefinedBlockDataSet.add(block.getBlockData()); -+ } -+ } -+ -+ predefinedBlockData = predefinedBlockDataSet.size() == 0 ? new IBlockData[] {Blocks.DIAMOND_ORE.getBlockData()} : predefinedBlockDataSet.toArray(new IBlockData[predefinedBlockDataSet.size()]); -+ predefinedBlockDataStone = null; -+ predefinedBlockDataNetherrack = null; -+ predefinedBlockDataEndStone = null; -+ predefinedBlockDataBits = new int[predefinedBlockData.length]; -+ predefinedBlockDataBitsGlobal = new int[predefinedBlockData.length]; -+ boolean containsDefaultBlockData = false; -+ -+ for (int i = 0; i < predefinedBlockData.length; i++) { -+ predefinedBlockDataBits[i] = containsDefaultBlockData ? i : (containsDefaultBlockData = predefinedBlockData[i] == DataPaletteBlock.DEFAULT_BLOCK_DATA) ? 0 : i + 1; -+ predefinedBlockDataBitsGlobal[i] = Block.REGISTRY_ID.getId(predefinedBlockData[i]); -+ } -+ -+ predefinedBlockDataBitsStoneGlobal = null; -+ predefinedBlockDataBitsNetherrackGlobal = null; -+ predefinedBlockDataBitsEndStoneGlobal = null; -+ } -+ -+ for (Object id : (engineMode == EngineMode.HIDE) ? paperWorldConfig.hiddenBlocks : paperWorldConfig.replacementBlocks) { -+ Block block = Block.getByName(String.valueOf(id)); -+ -+ if (block != null) { -+ obfuscateGlobal[Block.REGISTRY_ID.getId(block.getBlockData())] = true; -+ } -+ } -+ -+ for (int i = 0; i < solidGlobal.length; i++) { -+ IBlockData blockData = Block.REGISTRY_ID.fromId(i); -+ -+ if (blockData != null) { -+ solidGlobal[i] = blockData.getBlock().isOccluding(blockData) && blockData.getBlock() != Blocks.MOB_SPAWNER && blockData.getBlock() != Blocks.BARRIER; -+ } -+ } -+ } -+ -+ private static ExecutorService getExecutorServiceInstance() { -+ if (executorServiceInstance == null) { -+ executorServiceInstance = Executors.newSingleThreadExecutor(); -+ } -+ -+ return executorServiceInstance; -+ } -+ -+ @Override -+ public IBlockData[] getPredefinedBlockData(Chunk chunk, int chunkSectionIndex) { -+ //Return the block data which should be added to the data palettes so that they can be used for the obfuscation -+ if (chunkSectionIndex <= maxChunkSectionIndex) { -+ switch (engineMode) { -+ case HIDE: -+ switch (chunk.world.getWorld().getEnvironment()) { -+ case NETHER: -+ return predefinedBlockDataNetherrack; -+ case THE_END: -+ return predefinedBlockDataEndStone; -+ default: -+ return predefinedBlockDataStone; -+ } -+ default: -+ return predefinedBlockData; -+ } -+ } -+ -+ return null; -+ } -+ -+ @Override -+ public boolean onChunkPacketCreate(Chunk chunk, int chunkSectionSelector, boolean force) { -+ //Load nearby chunks if necessary -+ if (chunkEdgeMode == ChunkEdgeMode.WAIT && !force) { -+ if (chunk.world.getChunkIfLoaded(chunk.locX - 1, chunk.locZ) == null || chunk.world.getChunkIfLoaded(chunk.locX + 1, chunk.locZ) == null || chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ - 1) == null || chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ + 1) == null) { -+ //Don't create the chunk packet now, wait until nearby chunks are loaded and create it later -+ return false; -+ } -+ } else if (chunkEdgeMode == ChunkEdgeMode.LOAD || chunkEdgeMode == ChunkEdgeMode.WAIT) { -+ chunk.world.getChunkAt(chunk.locX - 1, chunk.locZ); -+ chunk.world.getChunkAt(chunk.locX + 1, chunk.locZ); -+ chunk.world.getChunkAt(chunk.locX, chunk.locZ - 1); -+ chunk.world.getChunkAt(chunk.locX, chunk.locZ + 1); -+ } -+ -+ //Create the chunk packet now -+ return true; -+ } -+ -+ @Override -+ public PacketPlayOutMapChunkInfoAntiXray getPacketPlayOutMapChunkInfo(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector) { -+ //Return a new instance to collect data and objects in the right state while creating the chunk packet for thread safe access later -+ PacketPlayOutMapChunkInfoAntiXray packetPlayOutMapChunkInfoAntiXray = new PacketPlayOutMapChunkInfoAntiXray(packetPlayOutMapChunk, chunk, chunkSectionSelector, this); -+ packetPlayOutMapChunkInfoAntiXray.setNearbyChunks(chunk.world.getChunkIfLoaded(chunk.locX - 1, chunk.locZ), chunk.world.getChunkIfLoaded(chunk.locX + 1, chunk.locZ), chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ - 1), chunk.world.getChunkIfLoaded(chunk.locX, chunk.locZ + 1)); -+ return packetPlayOutMapChunkInfoAntiXray; -+ } -+ -+ @Override -+ public void modifyBlocks(PacketPlayOutMapChunk packetPlayOutMapChunk, PacketPlayOutMapChunkInfo packetPlayOutMapChunkInfo) { -+ if (asynchronous) { -+ executorService.submit((PacketPlayOutMapChunkInfoAntiXray) packetPlayOutMapChunkInfo); -+ } else { -+ obfuscate((PacketPlayOutMapChunkInfoAntiXray) packetPlayOutMapChunkInfo); -+ } -+ } -+ -+ //Actually these fields should be variables inside the obfuscate method but in sync mode or with SingleThreadExecutor in async mode it's okay -+ private final boolean[] solid = new boolean[Block.REGISTRY_ID.size()]; -+ private final boolean[] obfuscate = new boolean[Block.REGISTRY_ID.size()]; -+ //These boolean arrays represent chunk layers, true means don't obfuscate, false means obfuscate -+ private boolean[][] current = new boolean[16][16]; -+ private boolean[][] next = new boolean[16][16]; -+ private boolean[][] nextNext = new boolean[16][16]; -+ private final DataBitsReader dataBitsReader = new DataBitsReader(); -+ private final DataBitsWriter dataBitsWriter = new DataBitsWriter(); -+ private final ChunkSection[] nearbyChunkSections = new ChunkSection[4]; -+ -+ public void obfuscate(PacketPlayOutMapChunkInfoAntiXray packetPlayOutMapChunkInfoAntiXray) { -+ boolean[] solidTemp = null; -+ boolean[] obfuscateTemp = null; -+ dataBitsReader.setDataBits(packetPlayOutMapChunkInfoAntiXray.getData()); -+ dataBitsWriter.setDataBits(packetPlayOutMapChunkInfoAntiXray.getData()); -+ int counter = 0; -+ -+ for (int chunkSectionIndex = 0; chunkSectionIndex <= maxChunkSectionIndex; chunkSectionIndex++) { -+ if (packetPlayOutMapChunkInfoAntiXray.isWritten(chunkSectionIndex) && packetPlayOutMapChunkInfoAntiXray.getPredefinedBlockData(chunkSectionIndex) != null) { -+ int[] predefinedBlockDataBitsTemp = packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex) instanceof DataPaletteGlobal ? engineMode == EngineMode.HIDE ? packetPlayOutMapChunkInfoAntiXray.getChunk().world.getWorld().getEnvironment() == Environment.NETHER ? predefinedBlockDataBitsNetherrackGlobal : packetPlayOutMapChunkInfoAntiXray.getChunk().world.getWorld().getEnvironment() == Environment.THE_END ? predefinedBlockDataBitsEndStoneGlobal : predefinedBlockDataBitsStoneGlobal : predefinedBlockDataBitsGlobal : predefinedBlockDataBits; -+ dataBitsWriter.setIndex(packetPlayOutMapChunkInfoAntiXray.getDataBitsIndex(chunkSectionIndex)); -+ -+ //Check if the chunk section below was not obfuscated -+ if (chunkSectionIndex == 0 || !packetPlayOutMapChunkInfoAntiXray.isWritten(chunkSectionIndex - 1) || packetPlayOutMapChunkInfoAntiXray.getPredefinedBlockData(chunkSectionIndex - 1) == null) { -+ //If so, initialize some stuff -+ dataBitsReader.setBitsPerValue(packetPlayOutMapChunkInfoAntiXray.getBitsPerValue(chunkSectionIndex)); -+ dataBitsReader.setIndex(packetPlayOutMapChunkInfoAntiXray.getDataBitsIndex(chunkSectionIndex)); -+ solidTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex), solid, solidGlobal); -+ obfuscateTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex), obfuscate, obfuscateGlobal); -+ //Read the blocks of the upper layer of the chunk section below if it exists -+ ChunkSection belowChunkSection = null; -+ boolean skipFirstLayer = chunkSectionIndex == 0 || (belowChunkSection = packetPlayOutMapChunkInfoAntiXray.getChunk().getSections()[chunkSectionIndex - 1]) == Chunk.EMPTY_CHUNK_SECTION; -+ -+ for (int z = 0; z < 16; z++) { -+ for (int x = 0; x < 16; x++) { -+ current[z][x] = true; -+ next[z][x] = skipFirstLayer || !solidGlobal[Block.REGISTRY_ID.getId(belowChunkSection.getType(x, 15, z))]; -+ } -+ } -+ -+ //Abuse the obfuscateLayer method to read the blocks of the first layer of the current chunk section -+ dataBitsWriter.setBitsPerValue(0); -+ obfuscateLayer(-1, dataBitsReader, dataBitsWriter, solidTemp, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, emptyNearbyChunkSections, counter); -+ } -+ -+ dataBitsWriter.setBitsPerValue(packetPlayOutMapChunkInfoAntiXray.getBitsPerValue(chunkSectionIndex)); -+ nearbyChunkSections[0] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[0] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[0].getSections()[chunkSectionIndex]; -+ nearbyChunkSections[1] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[1] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[1].getSections()[chunkSectionIndex]; -+ nearbyChunkSections[2] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[2] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[2].getSections()[chunkSectionIndex]; -+ nearbyChunkSections[3] = packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[3] == null ? Chunk.EMPTY_CHUNK_SECTION : packetPlayOutMapChunkInfoAntiXray.getNearbyChunks()[3].getSections()[chunkSectionIndex]; -+ -+ //Obfuscate all layers of the current chunk section except the upper one -+ for (int y = 0; y < 15; y++) { -+ boolean[][] temp = current; -+ current = next; -+ next = nextNext; -+ nextNext = temp; -+ counter = obfuscateLayer(y, dataBitsReader, dataBitsWriter, solidTemp, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, nearbyChunkSections, counter); -+ } -+ -+ //Check if the chunk section above doesn't need obfuscation -+ if (chunkSectionIndex == maxChunkSectionIndex || !packetPlayOutMapChunkInfoAntiXray.isWritten(chunkSectionIndex + 1) || packetPlayOutMapChunkInfoAntiXray.getPredefinedBlockData(chunkSectionIndex + 1) == null) { -+ //If so, obfuscate the upper layer of the current chunk section by reading blocks of the first layer from the chunk section above if it exists -+ ChunkSection aboveChunkSection; -+ -+ if (chunkSectionIndex != 15 && (aboveChunkSection = packetPlayOutMapChunkInfoAntiXray.getChunk().getSections()[chunkSectionIndex + 1]) != Chunk.EMPTY_CHUNK_SECTION) { -+ boolean[][] temp = current; -+ current = next; -+ next = nextNext; -+ nextNext = temp; -+ -+ for (int z = 0; z < 16; z++) { -+ for (int x = 0; x < 16; x++) { -+ if (!solidGlobal[Block.REGISTRY_ID.getId(aboveChunkSection.getType(x, 0, z))]) { -+ current[z][x] = true; -+ } -+ } -+ } -+ -+ //There is nothing to read anymore -+ dataBitsReader.setBitsPerValue(0); -+ solid[0] = true; -+ counter = obfuscateLayer(15, dataBitsReader, dataBitsWriter, solid, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, nearbyChunkSections, counter); -+ } -+ } else { -+ //If not, initialize the reader and other stuff for the chunk section above to obfuscate the upper layer of the current chunk section -+ dataBitsReader.setBitsPerValue(packetPlayOutMapChunkInfoAntiXray.getBitsPerValue(chunkSectionIndex + 1)); -+ dataBitsReader.setIndex(packetPlayOutMapChunkInfoAntiXray.getDataBitsIndex(chunkSectionIndex + 1)); -+ solidTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex + 1), solid, solidGlobal); -+ obfuscateTemp = readDataPalette(packetPlayOutMapChunkInfoAntiXray.getDataPalette(chunkSectionIndex + 1), obfuscate, obfuscateGlobal); -+ boolean[][] temp = current; -+ current = next; -+ next = nextNext; -+ nextNext = temp; -+ counter = obfuscateLayer(15, dataBitsReader, dataBitsWriter, solidTemp, obfuscateTemp, predefinedBlockDataBitsTemp, current, next, nextNext, nearbyChunkSections, counter); -+ } -+ -+ dataBitsWriter.finish(); -+ } -+ } -+ -+ packetPlayOutMapChunkInfoAntiXray.getPacketPlayOutMapChunk().setReady(true); -+ } -+ -+ private int obfuscateLayer(int y, DataBitsReader dataBitsReader, DataBitsWriter dataBitsWriter, boolean[] solid, boolean[] obfuscate, int[] predefinedBlockDataBits, boolean[][] current, boolean[][] next, boolean[][] nextNext, ChunkSection[] nearbyChunkSections, int counter) { -+ //First block of first line -+ int dataBits = dataBitsReader.read(); -+ -+ if (nextNext[0][0] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[0][1] = true; -+ next[1][0] = true; -+ } else { -+ if (nearbyChunkSections[2] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[2].getType(0, y, 15))] || nearbyChunkSections[0] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[0].getType(15, y, 0))] || current[0][0]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[0][0] = true; -+ } -+ -+ //First line -+ for (int x = 1; x < 15; x++) { -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[0][x] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[0][x - 1] = true; -+ next[0][x + 1] = true; -+ next[1][x] = true; -+ } else { -+ if (nearbyChunkSections[2] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[2].getType(x, y, 15))] || current[0][x]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[0][x] = true; -+ } -+ } -+ -+ //Last block of first line -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[0][15] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[0][14] = true; -+ next[1][15] = true; -+ } else { -+ if (nearbyChunkSections[2] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[2].getType(15, y, 15))] || nearbyChunkSections[1] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[1].getType(0, y, 0))] || current[0][15]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[0][15] = true; -+ } -+ -+ //All inner lines -+ for (int z = 1; z < 15; z++) { -+ //First block -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[z][0] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[z][1] = true; -+ next[z - 1][0] = true; -+ next[z + 1][0] = true; -+ } else { -+ if (nearbyChunkSections[0] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[0].getType(15, y, z))] || current[z][0]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[z][0] = true; -+ } -+ -+ //All inner blocks -+ for (int x = 1; x < 15; x++) { -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[z][x] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[z][x - 1] = true; -+ next[z][x + 1] = true; -+ next[z - 1][x] = true; -+ next[z + 1][x] = true; -+ } else { -+ if (current[z][x]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[z][x] = true; -+ } -+ } -+ -+ //Last block -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[z][15] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[z][14] = true; -+ next[z - 1][15] = true; -+ next[z + 1][15] = true; -+ } else { -+ if (nearbyChunkSections[1] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[1].getType(0, y, z))] || current[z][15]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[z][15] = true; -+ } -+ } -+ -+ //First block of last line -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[15][0] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[15][1] = true; -+ next[14][0] = true; -+ } else { -+ if (nearbyChunkSections[3] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[3].getType(0, y, 0))] || nearbyChunkSections[0] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[0].getType(15, y, 15))] || current[15][0]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[15][0] = true; -+ } -+ -+ //Last line -+ for (int x = 1; x < 15; x++) { -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[15][x] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[15][x - 1] = true; -+ next[15][x + 1] = true; -+ next[14][x] = true; -+ } else { -+ if (nearbyChunkSections[3] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[3].getType(x, y, 0))] || current[15][x]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[15][x] = true; -+ } -+ } -+ -+ //Last block of last line -+ dataBits = dataBitsReader.read(); -+ -+ if (nextNext[15][15] = !solid[dataBits]) { -+ dataBitsWriter.skip(); -+ next[15][14] = true; -+ next[14][15] = true; -+ } else { -+ if (nearbyChunkSections[3] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[3].getType(15, y, 0))] || nearbyChunkSections[1] == Chunk.EMPTY_CHUNK_SECTION || !solidGlobal[Block.REGISTRY_ID.getId(nearbyChunkSections[1].getType(0, y, 15))] || current[15][15]) { -+ dataBitsWriter.skip(); -+ } else { -+ if (counter >= predefinedBlockDataBits.length) { -+ counter = 0; -+ } -+ -+ dataBitsWriter.write(predefinedBlockDataBits[counter++]); -+ } -+ } -+ -+ if (!obfuscate[dataBits]) { -+ next[15][15] = true; -+ } -+ -+ return counter; -+ } -+ -+ private boolean[] readDataPalette(DataPalette dataPalette, boolean[] temp, boolean[] global) { -+ if (dataPalette instanceof DataPaletteGlobal) { -+ return global; -+ } -+ -+ IBlockData blockData; -+ -+ for (int i = 0; (blockData = dataPalette.getBlockData(i)) != null; i++) { -+ temp[i] = global[Block.REGISTRY_ID.getId(blockData)]; -+ } -+ -+ return temp; -+ } -+ -+ @Override -+ public void updateNearbyBlocks(World world, BlockPosition blockPosition) { -+ if (updateRadius >= 2) { -+ BlockPosition temp = blockPosition.west(); -+ updateBlock(world, temp); -+ updateBlock(world, temp.west()); -+ updateBlock(world, temp.down()); -+ updateBlock(world, temp.up()); -+ updateBlock(world, temp.north()); -+ updateBlock(world, temp.south()); -+ updateBlock(world, temp = blockPosition.east()); -+ updateBlock(world, temp.east()); -+ updateBlock(world, temp.down()); -+ updateBlock(world, temp.up()); -+ updateBlock(world, temp.north()); -+ updateBlock(world, temp.south()); -+ updateBlock(world, temp = blockPosition.down()); -+ updateBlock(world, temp.down()); -+ updateBlock(world, temp.north()); -+ updateBlock(world, temp.south()); -+ updateBlock(world, temp = blockPosition.up()); -+ updateBlock(world, temp.up()); -+ updateBlock(world, temp.north()); -+ updateBlock(world, temp.south()); -+ updateBlock(world, temp = blockPosition.north()); -+ updateBlock(world, temp.north()); -+ updateBlock(world, temp = blockPosition.south()); -+ updateBlock(world, temp.south()); -+ } else if (updateRadius == 1) { -+ updateBlock(world, blockPosition.west()); -+ updateBlock(world, blockPosition.east()); -+ updateBlock(world, blockPosition.down()); -+ updateBlock(world, blockPosition.up()); -+ updateBlock(world, blockPosition.north()); -+ updateBlock(world, blockPosition.south()); -+ } else { -+ //Do nothing if updateRadius <= 0 (test mode) -+ } -+ } -+ -+ private void updateBlock(World world, BlockPosition blockPosition) { -+ if (world.isLoaded(blockPosition)) { -+ IBlockData blockData = world.getType(blockPosition); -+ -+ if (obfuscateGlobal[Block.REGISTRY_ID.getId(blockData)]) { -+ world.notify(blockPosition, blockData, blockData, 3); -+ } -+ } -+ } -+ -+ public enum EngineMode { -+ -+ HIDE(1, "hide ores"), -+ OBFUSCATE(2, "obfuscate"); -+ -+ private final int id; -+ private final String description; -+ -+ EngineMode(int id, String description) { -+ this.id = id; -+ this.description = description; -+ } -+ -+ public static EngineMode getById(int id) { -+ for (EngineMode engineMode : values()) { -+ if (engineMode.id == id) { -+ return engineMode; -+ } -+ } -+ -+ return null; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public String getDescription() { -+ return description; -+ } -+ } -+ -+ public enum ChunkEdgeMode { -+ -+ DEFAULT(1, "default"), -+ WAIT(2, "wait until nearby chunks are loaded"), -+ LOAD(3, "load nearby chunks"); -+ -+ private final int id; -+ private final String description; -+ -+ ChunkEdgeMode(int id, String description) { -+ this.id = id; -+ this.description = description; -+ } -+ -+ public static ChunkEdgeMode getById(int id) { -+ for (ChunkEdgeMode chunkEdgeMode : values()) { -+ if (chunkEdgeMode.id == id) { -+ return chunkEdgeMode; -+ } -+ } -+ -+ return null; -+ } -+ -+ public int getId() { -+ return id; -+ } -+ -+ public String getDescription() { -+ return description; -+ } -+ } -+} -diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java -new file mode 100644 -index 000000000..92399318c ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.antixray; -+ -+public class DataBitsReader { -+ -+ private byte[] dataBits; -+ private int bitsPerValue; -+ private int mask; -+ private int longInDataBitsIndex; -+ private int bitInLongIndex; -+ private long current; -+ -+ public void setDataBits(byte[] dataBits) { -+ this.dataBits = dataBits; -+ } -+ -+ public void setBitsPerValue(int bitsPerValue) { -+ this.bitsPerValue = bitsPerValue; -+ mask = (1 << bitsPerValue) - 1; -+ } -+ -+ public void setIndex(int index) { -+ this.longInDataBitsIndex = index; -+ bitInLongIndex = 0; -+ init(); -+ } -+ -+ private void init() { -+ if (dataBits.length > longInDataBitsIndex + 7) { -+ current = ((((long) dataBits[longInDataBitsIndex]) << 56) -+ | (((long) dataBits[longInDataBitsIndex + 1] & 0xff) << 48) -+ | (((long) dataBits[longInDataBitsIndex + 2] & 0xff) << 40) -+ | (((long) dataBits[longInDataBitsIndex + 3] & 0xff) << 32) -+ | (((long) dataBits[longInDataBitsIndex + 4] & 0xff) << 24) -+ | (((long) dataBits[longInDataBitsIndex + 5] & 0xff) << 16) -+ | (((long) dataBits[longInDataBitsIndex + 6] & 0xff) << 8) -+ | (((long) dataBits[longInDataBitsIndex + 7] & 0xff))); -+ } -+ } -+ -+ public int read() { -+ int value = (int) (current >>> bitInLongIndex) & mask; -+ bitInLongIndex += bitsPerValue; -+ -+ if (bitInLongIndex > 63) { -+ bitInLongIndex -= 64; -+ longInDataBitsIndex += 8; -+ init(); -+ -+ if (bitInLongIndex > 0) { -+ value |= current << bitsPerValue - bitInLongIndex & mask; -+ } -+ } -+ -+ return value; -+ } -+} -diff --git a/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java -new file mode 100644 -index 000000000..aca0b9d71 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.antixray; -+ -+public class DataBitsWriter { -+ -+ private byte[] dataBits; -+ private int bitsPerValue; -+ private long mask; -+ private int longInDataBitsIndex; -+ private int bitInLongIndex; -+ private long current; -+ private boolean dirty; -+ -+ public void setDataBits(byte[] dataBits) { -+ this.dataBits = dataBits; -+ } -+ -+ public void setBitsPerValue(int bitsPerValue) { -+ this.bitsPerValue = bitsPerValue; -+ mask = (1 << bitsPerValue) - 1; -+ } -+ -+ public void setIndex(int index) { -+ this.longInDataBitsIndex = index; -+ bitInLongIndex = 0; -+ init(); -+ } -+ -+ private void init() { -+ if (dataBits.length > longInDataBitsIndex + 7) { -+ current = ((((long) dataBits[longInDataBitsIndex]) << 56) -+ | (((long) dataBits[longInDataBitsIndex + 1] & 0xff) << 48) -+ | (((long) dataBits[longInDataBitsIndex + 2] & 0xff) << 40) -+ | (((long) dataBits[longInDataBitsIndex + 3] & 0xff) << 32) -+ | (((long) dataBits[longInDataBitsIndex + 4] & 0xff) << 24) -+ | (((long) dataBits[longInDataBitsIndex + 5] & 0xff) << 16) -+ | (((long) dataBits[longInDataBitsIndex + 6] & 0xff) << 8) -+ | (((long) dataBits[longInDataBitsIndex + 7] & 0xff))); -+ } -+ -+ dirty = false; -+ } -+ -+ public void finish() { -+ if (dirty && dataBits.length > longInDataBitsIndex + 7) { -+ dataBits[longInDataBitsIndex] = (byte) (current >> 56 & 0xff); -+ dataBits[longInDataBitsIndex + 1] = (byte) (current >> 48 & 0xff); -+ dataBits[longInDataBitsIndex + 2] = (byte) (current >> 40 & 0xff); -+ dataBits[longInDataBitsIndex + 3] = (byte) (current >> 32 & 0xff); -+ dataBits[longInDataBitsIndex + 4] = (byte) (current >> 24 & 0xff); -+ dataBits[longInDataBitsIndex + 5] = (byte) (current >> 16 & 0xff); -+ dataBits[longInDataBitsIndex + 6] = (byte) (current >> 8 & 0xff); -+ dataBits[longInDataBitsIndex + 7] = (byte) (current & 0xff); -+ } -+ } -+ -+ public void write(int value) { -+ current = current & ~(mask << bitInLongIndex) | (value & mask) << bitInLongIndex; -+ dirty = true; -+ bitInLongIndex += bitsPerValue; -+ -+ if (bitInLongIndex > 63) { -+ finish(); -+ bitInLongIndex -= 64; -+ longInDataBitsIndex += 8; -+ init(); -+ -+ if (bitInLongIndex > 0) { -+ current = current & ~(mask >>> bitsPerValue - bitInLongIndex) | (value & mask) >>> bitsPerValue - bitInLongIndex; -+ dirty = true; -+ } -+ } -+ } -+ -+ public void skip() { -+ bitInLongIndex += bitsPerValue; -+ -+ if (bitInLongIndex > 63) { -+ finish(); -+ bitInLongIndex -= 64; -+ longInDataBitsIndex += 8; -+ init(); -+ } -+ } -+} -diff --git a/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfo.java b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfo.java -new file mode 100644 -index 000000000..0bd269a07 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfo.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.antixray; -+ -+import net.minecraft.server.Chunk; -+import net.minecraft.server.DataPalette; -+import net.minecraft.server.IBlockData; -+import net.minecraft.server.PacketPlayOutMapChunk; -+ -+public class PacketPlayOutMapChunkInfo { -+ -+ private final PacketPlayOutMapChunk packetPlayOutMapChunk; -+ private final Chunk chunk; -+ private final int chunkSectionSelector; -+ private byte[] data; -+ private final int[] bitsPerValue = new int[16]; -+ private final DataPalette[] dataPalettes = new DataPalette[16]; -+ private final int[] dataBitsIndexes = new int[16]; -+ private final IBlockData[][] predefinedBlockData = new IBlockData[16][]; -+ -+ public PacketPlayOutMapChunkInfo(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector) { -+ this.packetPlayOutMapChunk = packetPlayOutMapChunk; -+ this.chunk = chunk; -+ this.chunkSectionSelector = chunkSectionSelector; -+ } -+ -+ public PacketPlayOutMapChunk getPacketPlayOutMapChunk() { -+ return packetPlayOutMapChunk; -+ } -+ -+ public Chunk getChunk() { -+ return chunk; -+ } -+ -+ public int getChunkSectionSelector() { -+ return chunkSectionSelector; -+ } -+ -+ public byte[] getData() { -+ return data; -+ } -+ -+ public void setData(byte[] data) { -+ this.data = data; -+ } -+ -+ public int getBitsPerValue(int chunkSectionIndex) { -+ return bitsPerValue[chunkSectionIndex]; -+ } -+ -+ public void setBitsPerValue(int chunkSectionIndex, int bitsPerValue) { -+ this.bitsPerValue[chunkSectionIndex] = bitsPerValue; -+ } -+ -+ public DataPalette getDataPalette(int chunkSectionIndex) { -+ return dataPalettes[chunkSectionIndex]; -+ } -+ -+ public void setDataPalette(int chunkSectionIndex, DataPalette dataPalette) { -+ dataPalettes[chunkSectionIndex] = dataPalette; -+ } -+ -+ public int getDataBitsIndex(int chunkSectionIndex) { -+ return dataBitsIndexes[chunkSectionIndex]; -+ } -+ -+ public void setDataBitsIndex(int chunkSectionIndex, int dataBitsIndex) { -+ dataBitsIndexes[chunkSectionIndex] = dataBitsIndex; -+ } -+ -+ public IBlockData[] getPredefinedBlockData(int chunkSectionIndex) { -+ return predefinedBlockData[chunkSectionIndex]; -+ } -+ -+ public void setPredefinedBlockData(int chunkSectionIndex, IBlockData[] predefinedBlockData) { -+ this.predefinedBlockData[chunkSectionIndex] = predefinedBlockData; -+ } -+ -+ public boolean isWritten(int chunkSectionIndex) { -+ return bitsPerValue[chunkSectionIndex] != 0; -+ } -+} -diff --git a/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfoAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfoAntiXray.java -new file mode 100644 -index 000000000..8ea2beb59 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/antixray/PacketPlayOutMapChunkInfoAntiXray.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.antixray; -+ -+import net.minecraft.server.Chunk; -+import net.minecraft.server.PacketPlayOutMapChunk; -+ -+public class PacketPlayOutMapChunkInfoAntiXray extends PacketPlayOutMapChunkInfo implements Runnable { -+ -+ private Chunk[] nearbyChunks; -+ private final ChunkPacketBlockControllerAntiXray chunkPacketBlockControllerAntiXray; -+ -+ public PacketPlayOutMapChunkInfoAntiXray(PacketPlayOutMapChunk packetPlayOutMapChunk, Chunk chunk, int chunkSectionSelector, ChunkPacketBlockControllerAntiXray chunkPacketBlockControllerAntiXray) { -+ super(packetPlayOutMapChunk, chunk, chunkSectionSelector); -+ this.chunkPacketBlockControllerAntiXray = chunkPacketBlockControllerAntiXray; -+ } -+ -+ public Chunk[] getNearbyChunks() { -+ return nearbyChunks; -+ } -+ -+ public void setNearbyChunks(Chunk... nearbyChunks) { -+ this.nearbyChunks = nearbyChunks; -+ } -+ -+ @Override -+ public void run() { -+ chunkPacketBlockControllerAntiXray.obfuscate(this); -+ } -+} -diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index fedc38dc1..a96a2a28d 100644 ---- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java -+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - for (int i = 0; i < nbttaglist.size(); ++i) { - NBTTagCompound nbttagcompound = nbttaglist.getCompound(i); - byte b0 = nbttagcompound.getByte("Y"); -- ChunkSection chunksection = new ChunkSection(b0 << 4, flag1); -+ ChunkSection chunksection = new ChunkSection(b0 << 4, flag1, world.chunkPacketBlockController.getPredefinedBlockData(chunk, b0)); // Paper - Anti-Xray - Add predefined block data - - chunksection.getBlocks().a(nbttagcompound, "Palette", "BlockStates"); - chunksection.a(new NibbleArray(nbttagcompound.getByteArray("BlockLight"))); -diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 0fb3162e6..54df71404 100644 ---- a/src/main/java/net/minecraft/server/DataBits.java -+++ b/src/main/java/net/minecraft/server/DataBits.java -@@ -0,0 +0,0 @@ public class DataBits { - } - } - -+ public long[] getDataBits() { return this.a(); } // Paper - Anti-Xray - OBFHELPER - public long[] a() { - return this.a; - } -diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index c4a25bd87..b92432d50 100644 ---- a/src/main/java/net/minecraft/server/EntityFallingBlock.java -+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java -@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { - blockposition = new BlockPosition(this); - if (this.world.getType(blockposition).getBlock() == block && !CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { - this.world.setAir(blockposition); -+ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray - } else if (!this.world.isClientSide) { - this.die(); - return; -@@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { - return; - } - this.world.setTypeAndData(blockposition, this.block, 3); -+ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray - // CraftBukkit end - if (block instanceof BlockFalling) { - ((BlockFalling) block).a(this.world, blockposition, this.block, iblockdata); -diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 2652b1575..09f90450a 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 { - blockposition = (BlockPosition) iterator.next(); - IBlockData iblockdata = this.world.getType(blockposition); - Block block = iblockdata.getBlock(); -+ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray - - if (flag) { - double d0 = (double) ((float) blockposition.getX() + this.world.random.nextFloat()); -diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index d04afceb7..02ab42a64 100644 ---- a/src/main/java/net/minecraft/server/PacketDataSerializer.java -+++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java -@@ -0,0 +0,0 @@ public class PacketDataSerializer extends ByteBuf { - this.a = bytebuf; - } - -+ public static int countBytes(int i) { return PacketDataSerializer.a(i); } // Paper - Anti-Xray - OBFHELPER - public static int a(int i) { - for (int j = 1; j < 5; ++j) { - if ((i & -1 << j * 7) == 0) { -diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 344b95233..32b790397 100644 ---- a/src/main/java/net/minecraft/server/PlayerChunk.java -+++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -0,0 +0,0 @@ public class PlayerChunk { - return false; - } else if (!this.chunk.isReady()) { - return false; -+ } else if (!this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, '\uffff', false)) { // Paper - Anti-Xray - Load nearby chunks if necessary -+ return false; // Paper - Anti-Xray - Wait and try again later - } else { - this.dirtyCount = 0; - this.h = 0; -@@ -0,0 +0,0 @@ public class PlayerChunk { - - public void sendChunk(EntityPlayer entityplayer) { - if (this.done) { -+ this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, '\uffff', true); // Paper - Anti-Xray - Load nearby chunks if necessary - entityplayer.playerConnection.sendPacket(new PacketPlayOutMapChunk(this.chunk, '\uffff')); - this.playerChunkMap.getWorld().getTracker().a(entityplayer, this.chunk); - } -@@ -0,0 +0,0 @@ public class PlayerChunk { - this.a(this.playerChunkMap.getWorld().getTileEntity(blockposition)); - } - } else if (this.dirtyCount == 64) { -+ // Paper - Anti-Xray - Loading chunks here could cause a ConcurrentModificationException #1104 -+ //this.chunk.world.chunkPacketBlockController.onChunkPacketCreate(this.chunk, this.h, true); // Paper - Anti-Xray - Load nearby chunks if necessary - this.a((Packet) (new PacketPlayOutMapChunk(this.chunk, this.h))); - } else { - this.a((Packet) (new PacketPlayOutMultiBlockChange(this.dirtyCount, this.dirtyBlocks, this.chunk))); -diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index e34198e40..ce8f76871 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 { - } - - } -+ -+ this.world.chunkPacketBlockController.updateNearbyBlocks(this.world, blockposition); // Paper - Anti-Xray - } - - public void a(BlockPosition blockposition) { -diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index ef332d651..35c3edca4 100644 ---- a/src/main/java/net/minecraft/server/RegistryBlockID.java -+++ b/src/main/java/net/minecraft/server/RegistryBlockID.java -@@ -0,0 +0,0 @@ public class RegistryBlockID implements Registry { - return Iterators.filter(this.c.iterator(), Predicates.notNull()); - } - -+ public int size() { return this.a(); } // Paper - Anti-Xray - OBFHELPER - public int a() { - return this.b.size(); - } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 49e7c1589..62fd2e503 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.generator.ChunkGenerator; - // CraftBukkit end - // Paper start - import java.util.Set; -+import com.destroystokyo.paper.antixray.ChunkPacketBlockController; // Anti-Xray -+import com.destroystokyo.paper.antixray.ChunkPacketBlockControllerAntiXray; // Anti-Xray - import com.google.common.collect.Sets; - // Paper end - public abstract class World implements GeneratorAccess, IIBlockAccess, AutoCloseable { -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot - - public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper -+ public final ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray - - public final co.aikar.timings.WorldTimingsHandler timings; // Paper - private boolean guardEntityList; // Spigot -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { - this.spigotConfig = new org.spigotmc.SpigotWorldConfig( worlddata.getName() ); // Spigot - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper -+ this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray - this.generator = gen; - this.world = new CraftWorld((WorldServer) this, gen, env); - this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - ((IWorldAccess) this.v.get(j)).a(this, blockposition, iblockdata, iblockdata1, i); - } - -+ this.chunkPacketBlockController.updateNearbyBlocks(this, blockposition); // Paper - Anti-Xray - } - - public void update(BlockPosition blockposition, Block block) { --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Assign-the-World-in-WorldGenStronghold.patch b/Spigot-Server-Patches/Assign-the-World-in-WorldGenStronghold.patch deleted file mode 100644 index 016cc51db4..0000000000 --- a/Spigot-Server-Patches/Assign-the-World-in-WorldGenStronghold.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Zach Brown <1254957+zachbr@users.noreply.github.com> -Date: Sat, 14 Jan 2017 01:22:07 -0600 -Subject: [PATCH] Assign the World in WorldGenStronghold - - -diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java -index 8b285bdd4..b6e60e9df 100644 ---- a/src/main/java/net/minecraft/server/WorldGenStronghold.java -+++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java -@@ -0,0 +0,0 @@ public class WorldGenStronghold extends StructureGenerator 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 801a147f0..1f2265231 100644 +index 6b7d81933..3ee587014 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 { diff --git a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index eb97d75404..fe9361e162 100644 --- a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -22,7 +22,7 @@ index 2612d4207..b3cdc0b7d 100644 this.a(entity, entity.af); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ee061d693..1b9013ab4 100644 +index d8ce3efc9..35db0e184 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch index c1534d19fd..ba67f6c0bc 100644 --- a/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/Avoid-hopper-searches-if-there-are-no-items.patch @@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear Combined, this adds up a lot. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index e5567701e..32f467b37 100644 +index b0060c363..2d55abd7a 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Be-a-bit-more-informative-in-maxHealth-exception.patch b/Spigot-Server-Patches/Be-a-bit-more-informative-in-maxHealth-exception.patch index b80e3dbc1f..a0baad54c1 100644 --- a/Spigot-Server-Patches/Be-a-bit-more-informative-in-maxHealth-exception.patch +++ b/Spigot-Server-Patches/Be-a-bit-more-informative-in-maxHealth-exception.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Be a bit more informative in maxHealth exception diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 0b12ed819..83e6276b8 100644 +index 382b8028a..2ef1433a7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { diff --git a/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch b/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch index e4a23f9fe8..184f4b7f0d 100644 --- a/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch +++ b/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch @@ -12,7 +12,7 @@ This disables that by not saving the thrower when the chunk is unloaded. This is mainly useful for survival servers that do not allow freeform teleporting. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 87d2dd131..5a9c68e4f 100644 +index b07ff9587..f1db4becd 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 { @@ -27,14 +27,14 @@ index 87d2dd131..5a9c68e4f 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index fc8c0cab5..b3323aa8e 100644 +index fc8c0cab5..dd8af4be8 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -0,0 +0,0 @@ public abstract class EntityProjectile extends Entity implements IProjectile { if (nbttagcompound.hasKeyOfType("owner", 10)) { this.shooterId = GameProfileSerializer.b(nbttagcompound.getCompound("owner")); } -+ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooterName = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit ++ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooterId = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit } diff --git a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch index 99a6b7a792..5024cb890d 100644 --- a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch +++ b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Chunk Save Reattempt We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 17996af9c..faaa1b36b 100644 +index 8701777cc..ad3bd3808 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { diff --git a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch index be143cfd39..7e3efced5a 100644 --- a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch +++ b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch @@ -55,7 +55,7 @@ index 9145401bc..ef35eb7ec 100644 return false; } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 071e8a196..fedc38dc1 100644 +index 20aa20a98..de2231bb0 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { diff --git a/Spigot-Server-Patches/Chunk-registration-fixes.patch b/Spigot-Server-Patches/Chunk-registration-fixes.patch index 364890a4e7..cae2dadb17 100644 --- a/Spigot-Server-Patches/Chunk-registration-fixes.patch +++ b/Spigot-Server-Patches/Chunk-registration-fixes.patch @@ -8,7 +8,7 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr Keep them consistent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a8ef9e337..3b2de1f31 100644 +index 067b92f3e..04b5521cd 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Chunk-save-queue-improvements.patch b/Spigot-Server-Patches/Chunk-save-queue-improvements.patch index f48473e031..410443dd1b 100644 --- a/Spigot-Server-Patches/Chunk-save-queue-improvements.patch +++ b/Spigot-Server-Patches/Chunk-save-queue-improvements.patch @@ -41,7 +41,7 @@ index 36689db74..3898ad8fa 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index e26860516..17996af9c 100644 +index 3a0e52d88..8701777cc 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ import java.util.function.Consumer; diff --git a/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch b/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch index e59224f458..25df4670a8 100644 --- a/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch +++ b/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch @@ -53,7 +53,7 @@ index b602bbf12..62bce1806 100644 + } } diff --git a/src/main/java/net/minecraft/server/LotoSelectorEntry.java b/src/main/java/net/minecraft/server/LotoSelectorEntry.java -index a540167d6..d8a882191 100644 +index add618866..9f8e17b9d 100644 --- a/src/main/java/net/minecraft/server/LotoSelectorEntry.java +++ b/src/main/java/net/minecraft/server/LotoSelectorEntry.java @@ -0,0 +0,0 @@ import java.util.Random; diff --git a/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch b/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch index 14d0689ab3..bb13203952 100644 --- a/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch +++ b/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch @@ -10,7 +10,7 @@ player at their bed should it of became obstructed. Defaults to vanilla 1. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b2855f3ca..d30a8ff6c 100644 +index 1607619bd..692206127 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 { diff --git a/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch b/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch index 4e75f06a7e..51c3394e3d 100644 --- a/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch +++ b/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch @@ -23,7 +23,7 @@ index 1c2209270..17fb883f6 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 75fcc693d..aaa65582b 100644 +index 1c0580f79..744b5bc6d 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch b/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch index 9d8f5faebf..64784cf3fa 100644 --- a/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch +++ b/Spigot-Server-Patches/Configurable-Chunks-Sends-per-Tick-setting.patch @@ -8,7 +8,7 @@ Vanilla already had this limited, make it configurable. Limit how much exploration lags the server diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 33743f8fd..49f282332 100644 +index 605e84173..703642c0b 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 { diff --git a/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch b/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch new file mode 100644 index 0000000000..62d0d58ba4 --- /dev/null +++ b/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 3 Apr 2016 16:28:17 -0400 +Subject: [PATCH] Configurable Grass Spread Tick Rate + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index 17fb883f6..eb09be512 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 { + private void useInhabitedTime() { + useInhabitedTime = getBoolean("use-chunk-inhabited-timer", true); + } ++ ++ public int grassUpdateRate = 1; ++ private void grassUpdateRate() { ++ grassUpdateRate = Math.max(0, getInt("grass-spread-tick-rate", grassUpdateRate)); ++ log("Grass Spread Tick Rate: " + grassUpdateRate); ++ } + } +diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +index 6343fb1e0..903e8241b 100644 +--- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java ++++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +@@ -0,0 +0,0 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { + } + + public void a(IBlockData iblockdata, World world, BlockPosition blockposition, Random random) { ++ if (this instanceof BlockGrass && world.paperConfig.grassUpdateRate != 1 && (world.paperConfig.grassUpdateRate < 1 || (MinecraftServer.currentTick + blockposition.hashCode()) % world.paperConfig.grassUpdateRate != 0)) { return; } // Paper + if (!world.isClientSide) { + if (!a((IWorldReader) world, blockposition)) { + // CraftBukkit start +-- \ No newline at end of file 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 811c4251c0..ca2123342f 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 @@ -39,7 +39,7 @@ index 1027b0588..b7aa9e869 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e42a334bc..d15afd595 100644 +index cc1492e4d..2c6774082 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, IIBlockAccess, AutoClose @@ -67,7 +67,7 @@ index f90dc11f2..06b59657f 100644 for (int j = -short1; j <= short1; j += 16) { for (int k = -short1; k <= short1; k += 16) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4df849eef..9d88b9ddb 100644 +index 0b2a9d09d..ff3558363 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/Configurable-Player-Collision.patch b/Spigot-Server-Patches/Configurable-Player-Collision.patch new file mode 100644 index 0000000000..90970e5d4e --- /dev/null +++ b/Spigot-Server-Patches/Configurable-Player-Collision.patch @@ -0,0 +1,117 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 13 Apr 2016 02:10:49 -0400 +Subject: [PATCH] Configurable Player Collision + + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index ec4643384..430b5d0cd 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -0,0 +0,0 @@ public class PaperConfig { + private static void regionFileCacheSize() { + regionFileCacheSize = getInt("settings.region-file-cache-size", 256); + } ++ ++ public static boolean enablePlayerCollisions = true; ++ private static void enablePlayerCollisions() { ++ enablePlayerCollisions = getBoolean("settings.enable-player-collisions", true); ++ } + } +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index b7aa9e869..c5670fe8d 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 implements IAsyncTaskHandler, IMojangStati + + this.a(this.getDifficulty()); + this.g_(); ++ ++ // Paper start - Handle collideRule team for player collision toggle ++ final Scoreboard scoreboard = this.getScoreboard(); ++ final java.util.Collection toRemove = scoreboard.getTeams().stream().filter(team -> team.getName().startsWith("collideRule_")).map(ScoreboardTeam::getName).collect(java.util.stream.Collectors.toList()); ++ for (String teamName : toRemove) { ++ scoreboard.removeTeam(scoreboard.getTeam(teamName)); // Clean up after ourselves ++ } ++ ++ if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { ++ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + worlds.get(0).random.nextInt(), 16); ++ ScoreboardTeam collideTeam = scoreboard.createTeam(this.getPlayerList().collideRuleTeamName); ++ collideTeam.setCanSeeFriendlyInvisibles(false); // Because we want to mimic them not being on a team at all ++ } ++ // Paper end + } + + protected void a(File file, WorldData worlddata) { +diff --git a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +index 5f54e7b9c..759288b97 100644 +--- a/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java ++++ b/src/main/java/net/minecraft/server/PacketPlayOutScoreboardTeam.java +@@ -0,0 +0,0 @@ public class PacketPlayOutScoreboardTeam implements Packet playersByName = new org.spigotmc.CaseInsensitiveMap(); ++ @Nullable String collideRuleTeamName; // Paper - Team name used for collideRule + + public PlayerList(MinecraftServer minecraftserver) { + this.cserver = minecraftserver.server = new CraftServer(minecraftserver, this); +@@ -0,0 +0,0 @@ public abstract class PlayerList { + } + + entityplayer.syncInventory(); ++ // Paper start - Add to collideRule team if needed ++ final Scoreboard scoreboard = this.getServer().getWorldServer(0).getScoreboard(); ++ final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName); ++ if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getTeam() == null) { ++ scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam); ++ } ++ // Paper end + // CraftBukkit - Moved from above, added world + PlayerList.f.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", entityplayer.getDisplayName().getString(), s1, Integer.valueOf(entityplayer.getId()), entityplayer.world.worldData.getName(), Double.valueOf(entityplayer.locX), Double.valueOf(entityplayer.locY), Double.valueOf(entityplayer.locZ)); + } +@@ -0,0 +0,0 @@ public abstract class PlayerList { + entityplayer.playerTick();// SPIGOT-924 + // CraftBukkit end + ++ // Paper start - Remove from collideRule team if needed ++ if (this.collideRuleTeamName != null) { ++ final Scoreboard scoreBoard = this.server.getWorldServer(0).getScoreboard(); ++ final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); ++ if (entityplayer.getTeam() == team && team != null) { ++ scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); ++ } ++ } ++ // Paper end ++ + this.savePlayerFile(entityplayer); + if (entityplayer.isPassenger()) { + Entity entity = entityplayer.getRootVehicle(); +@@ -0,0 +0,0 @@ public abstract class PlayerList { + player.playerConnection.disconnect(this.server.server.getShutdownMessage()); // CraftBukkit - add custom shutdown message + } + // CraftBukkit end +- ++ // Paper start - Remove collideRule team if it exists ++ if (this.collideRuleTeamName != null) { ++ final Scoreboard scoreboard = this.getServer().getWorldServer(0).getScoreboard(); ++ final ScoreboardTeam team = scoreboard.getTeam(this.collideRuleTeamName); ++ if (team != null) scoreboard.removeTeam(team); ++ } ++ // Paper end + } + + // CraftBukkit start +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/Configurable-RCON-IP-address.patch new file mode 100644 index 0000000000..204dbae289 --- /dev/null +++ b/Spigot-Server-Patches/Configurable-RCON-IP-address.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sat, 16 Apr 2016 00:39:33 -0400 +Subject: [PATCH] Configurable RCON IP address + +For servers with multiple IP's, ability to bind to a specific interface. + +diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java +index 6f0176f6f..1e5caa13a 100644 +--- a/src/main/java/net/minecraft/server/RemoteControlListener.java ++++ b/src/main/java/net/minecraft/server/RemoteControlListener.java +@@ -0,0 +0,0 @@ public class RemoteControlListener extends RemoteConnectionThread { + super(iminecraftserver, "RCON Listener"); + this.h = iminecraftserver.a("rcon.port", 0); + this.l = iminecraftserver.a("rcon.password", ""); +- this.j = iminecraftserver.e(); ++ this.j = iminecraftserver.a("rcon.ip", iminecraftserver.d_()); // Paper + this.i = iminecraftserver.f(); + if (0 == this.h) { + this.h = this.i + 10; +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-container-update-tick-rate.patch b/Spigot-Server-Patches/Configurable-container-update-tick-rate.patch index c07fe92e93..3871f100fb 100644 --- a/Spigot-Server-Patches/Configurable-container-update-tick-rate.patch +++ b/Spigot-Server-Patches/Configurable-container-update-tick-rate.patch @@ -19,7 +19,7 @@ index 47f391243..26d8dbb60 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0531812fb..5ca0dec1f 100644 +index 8ca7da336..55eaa89f6 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/Configurable-end-credits.patch b/Spigot-Server-Patches/Configurable-end-credits.patch index 59759947ba..b26ff05c72 100644 --- a/Spigot-Server-Patches/Configurable-end-credits.patch +++ b/Spigot-Server-Patches/Configurable-end-credits.patch @@ -20,7 +20,7 @@ index 1e3405cc1..dccccbf5b 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e035025f0..cb44bf3a7 100644 +index d4e9f489d..ace6db1fa 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { diff --git a/Spigot-Server-Patches/Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/Configurable-flying-kick-messages.patch index bfcf7826fb..039b8cf909 100644 --- a/Spigot-Server-Patches/Configurable-flying-kick-messages.patch +++ b/Spigot-Server-Patches/Configurable-flying-kick-messages.patch @@ -21,7 +21,7 @@ index 2001175bf..621c585e7 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index aa7c019ab..be0322941 100644 +index a41fa05ee..1f2cfbc92 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, ITickable { diff --git a/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch index ba1dc31e49..4d5b706d22 100644 --- a/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch +++ b/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch @@ -23,7 +23,7 @@ index cf06f8ac3..2001175bf 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e9ce81bfc..c757881b7 100644 +index b17540ecb..a41fa05ee 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, ITickable { diff --git a/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch b/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch index b7842d6892..6b8d2308c5 100644 --- a/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch +++ b/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Configurable sprint interruption on attack If the sprint interruption is disabled players continue sprinting when they attack entities. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 830b99cd7..87d2dd131 100644 +index 4ca31c8eb..b07ff9587 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 { diff --git a/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch index 6a91711c52..e59c2e3f1d 100644 --- a/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch @@ -20,7 +20,7 @@ index 4da846719..a340866f3 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 2288df268..111eeeecc 100644 +index 6bb4cf48e..d378f1a9d 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 diff --git a/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch b/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch index 5a605f497d..dffda6e7ac 100644 --- a/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch +++ b/Spigot-Server-Patches/Default-loading-permissions.yml-before-plugins.patch @@ -30,7 +30,7 @@ index 3898ad8fa..2f6e169f5 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index eaac1430e..6dae117ac 100644 +index a9d60b8d2..4db5aacc4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch b/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch index 1ff8fe343e..a4598ccc6f 100644 --- a/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/Spigot-Server-Patches/Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -131,7 +131,7 @@ index 4d888d6d4..cf5c76a78 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4588df4b1..c34f42efc 100644 +index 5102f24ed..c9b6b57af 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, IIBlockAccess, AutoClose @@ -150,7 +150,7 @@ index 4588df4b1..c34f42efc 100644 this.methodProfiler.a(() -> { return String.valueOf(TileEntityTypes.a(tileentity.C())); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9d88b9ddb..e516ec603 100644 +index ff3558363..90e260f3b 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-explosion-knockback.patch b/Spigot-Server-Patches/Disable-explosion-knockback.patch index 324993af1f..e5c3bafe0b 100644 --- a/Spigot-Server-Patches/Disable-explosion-knockback.patch +++ b/Spigot-Server-Patches/Disable-explosion-knockback.patch @@ -48,7 +48,7 @@ index 1ee54fa45..43715902e 100644 if (!this.e(damagesource)) { SoundEffect soundeffect = this.cr(); diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index ddbf667c4..2652b1575 100644 +index 8fdcd52b2..75b21010b 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 { diff --git a/Spigot-Server-Patches/Disable-ice-and-snow.patch b/Spigot-Server-Patches/Disable-ice-and-snow.patch index 720bd035b6..c5f7f224b4 100644 --- a/Spigot-Server-Patches/Disable-ice-and-snow.patch +++ b/Spigot-Server-Patches/Disable-ice-and-snow.patch @@ -19,7 +19,7 @@ index efacd5ea0..0130e5860 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 7a9cd1398..21b8a1dd9 100644 +index a4003896d..9bd11a5fd 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 implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Disable-thunder.patch b/Spigot-Server-Patches/Disable-thunder.patch index c2ae76e56e..ad8c724172 100644 --- a/Spigot-Server-Patches/Disable-thunder.patch +++ b/Spigot-Server-Patches/Disable-thunder.patch @@ -19,7 +19,7 @@ index be92c1af6..efacd5ea0 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 420cbee6a..7a9cd1398 100644 +index d7f86bf76..a4003896d 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 implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Do-not-load-chunks-for-light-checks.patch b/Spigot-Server-Patches/Do-not-load-chunks-for-light-checks.patch new file mode 100644 index 0000000000..99b6412693 --- /dev/null +++ b/Spigot-Server-Patches/Do-not-load-chunks-for-light-checks.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Thu, 31 Mar 2016 19:17:58 -0400 +Subject: [PATCH] Do not load chunks for light checks + +Should only happen for blocks on the edge that uses neighbors light level +(certain blocks). In that case, there will be 3-4 other neighbors to get a light level from. + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 307539199..cc1492e4d 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, IIBlockAccess, AutoClose + if (blockposition.getY() >= 256) { + blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); + } ++ if (!this.isLoaded(blockposition)) return 0; // Paper + + return this.getChunkAtWorldCoords(blockposition).a(blockposition, i); + } +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch b/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch new file mode 100644 index 0000000000..0ed62b158a --- /dev/null +++ b/Spigot-Server-Patches/Don-t-spam-reload-spawn-chunks-in-nether-end.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Tue, 5 Apr 2016 19:42:22 -0400 +Subject: [PATCH] Don't spam reload spawn chunks in nether/end + + +diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java +index 5b2d67260..3aecf7a5d 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, IIBlockAccess, AutoClose + return this.K; + } + ++ public boolean shouldStayLoaded(int i, int j) { return g(i, j); } // Paper - OBFHELPER + public boolean g(int i, int j) { + BlockPosition blockposition = this.getSpawn(); + int k = i * 16 + 8 - blockposition.getX(); +diff --git a/src/main/java/net/minecraft/server/WorldProvider.java b/src/main/java/net/minecraft/server/WorldProvider.java +index 6b62235e5..26ef3a41f 100644 +--- a/src/main/java/net/minecraft/server/WorldProvider.java ++++ b/src/main/java/net/minecraft/server/WorldProvider.java +@@ -0,0 +0,0 @@ public abstract class WorldProvider { + public void l() {} + + public boolean a(int i, int j) { +- return true; ++ return !this.b.shouldStayLoaded(i, j); // Paper - Use shouldStayLoaded check for all worlds + } + + protected abstract void m(); +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Don-t-tick-Skulls-unused-code.patch b/Spigot-Server-Patches/Don-t-tick-Skulls-unused-code.patch new file mode 100644 index 0000000000..172704d521 --- /dev/null +++ b/Spigot-Server-Patches/Don-t-tick-Skulls-unused-code.patch @@ -0,0 +1,20 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 13 Apr 2016 00:30:10 -0400 +Subject: [PATCH] Don't tick Skulls - unused code + + +diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java +index db4967f24..804236547 100644 +--- a/src/main/java/net/minecraft/server/TileEntitySkull.java ++++ b/src/main/java/net/minecraft/server/TileEntitySkull.java +@@ -0,0 +0,0 @@ import com.mojang.authlib.ProfileLookupCallback; + import java.util.concurrent.Callable; + // Spigot end + +-public class TileEntitySkull extends TileEntity implements ITickable { ++public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Paper - remove tickable + + private GameProfile a; + private int e; +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch b/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch index 290e692da1..67f6980cb6 100644 --- a/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/Spigot-Server-Patches/Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -24,7 +24,7 @@ index 0094d1a87..4da846719 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a5d0ae1de..12b86ab75 100644 +index 2ed362791..20248de7e 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 @@ -36,7 +36,7 @@ index a5d0ae1de..12b86ab75 100644 public EntityItem a(ItemStack itemstack, float f) { if (itemstack.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 850436d42..7aa12c3b4 100644 +index 850436d42..8d47b58c9 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { @@ -47,7 +47,7 @@ index 850436d42..7aa12c3b4 100644 + // Paper start - Configurable EntityFallingBlock height nerf + if (this.world.paperConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperConfig.fallingBlockHeightNerf) { + if (this.dropItem && this.world.getGameRules().getBoolean("doEntityDrops")) { -+ this.dropItem(new ItemStack(block, 1, block.getDropData(this.block)), 0.0F); ++ this.dropItem(new ItemStack(block), 0.0F); + } + + this.die(); diff --git a/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch b/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch index eddaaef2ed..67e25b793c 100644 --- a/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch +++ b/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch @@ -7,7 +7,7 @@ Unloading Chunks async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4fd6d3dbf..013c5b4cf 100644 +index 8b63192cf..86848543d 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/Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches/Enforce-Sync-Player-Saves.patch index 6c7a016c86..e6cea80aae 100644 --- a/Spigot-Server-Patches/Enforce-Sync-Player-Saves.patch +++ b/Spigot-Server-Patches/Enforce-Sync-Player-Saves.patch @@ -7,7 +7,7 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 1f2265231..e41850742 100644 +index 3ee587014..fdbc01792 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 { diff --git a/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch b/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch index 55f9ee6995..c856426d77 100644 --- a/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch +++ b/Spigot-Server-Patches/Ensure-commands-are-not-ran-async.patch @@ -14,7 +14,7 @@ big slowdown in execution but throwing an exception at same time to raise awaren that it is happening so that plugin authors can fix their code to stop executing commands async. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c2eb3a58d..9c27966ea 100644 +index 359aa3997..88b761d27 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, ITickable { diff --git a/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch index 2881833d06..203f64c25d 100644 --- a/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-Server-Patches/Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c9d0c22d5..e88baae1d 100644 +index 11012360b..307539199 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Entity-Origin-API.patch b/Spigot-Server-Patches/Entity-Origin-API.patch index fd38a2aefa..00be6f0548 100644 --- a/Spigot-Server-Patches/Entity-Origin-API.patch +++ b/Spigot-Server-Patches/Entity-Origin-API.patch @@ -51,7 +51,7 @@ index 20248de7e..6bb4cf48e 100644 NBTTagList nbttaglist = new NBTTagList(); double[] adouble1 = adouble; diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 7aa12c3b4..1d4a7b64d 100644 +index 8d47b58c9..7e5a2775a 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { @@ -89,7 +89,7 @@ index 5ceb3f206..87f3205f8 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index e56d4836d..0bf8d15d7 100644 +index a8280acf9..38dd8f17a 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java @@ -0,0 +0,0 @@ public class NBTTagList extends NBTList { @@ -118,7 +118,7 @@ index fd64b75ed..3f0b6ac26 100644 flag = true; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index f4edde236..9882fe466 100644 +index f09251eec..34246369c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/Spigot-Server-Patches/Entity-Tracking-Improvements.patch b/Spigot-Server-Patches/Entity-Tracking-Improvements.patch index fbd26a33dd..007e4087c9 100644 --- a/Spigot-Server-Patches/Entity-Tracking-Improvements.patch +++ b/Spigot-Server-Patches/Entity-Tracking-Improvements.patch @@ -7,7 +7,7 @@ If any part of a Vehicle/Passenger relationship is visible to a player, send all passenger/vehicles to the player in the chain. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 115504bf6..509254b35 100644 +index 9af242380..70694c8e5 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 diff --git a/Spigot-Server-Patches/EntityPathfindEvent.patch b/Spigot-Server-Patches/EntityPathfindEvent.patch new file mode 100644 index 0000000000..8d1f03abf8 --- /dev/null +++ b/Spigot-Server-Patches/EntityPathfindEvent.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Mon, 28 Mar 2016 21:22:26 -0400 +Subject: [PATCH] EntityPathfindEvent + +Fires when an Entity decides to start moving to a location. + +diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java +index 1964684ac..0c5215657 100644 +--- a/src/main/java/net/minecraft/server/NavigationAbstract.java ++++ b/src/main/java/net/minecraft/server/NavigationAbstract.java +@@ -0,0 +0,0 @@ import javax.annotation.Nullable; + + public abstract class NavigationAbstract { + +- protected EntityInsentient a; ++ protected EntityInsentient a; public Entity getEntity() { return a; } // Paper - OBFHELPER + protected World b; + @Nullable + protected PathEntity c; +@@ -0,0 +0,0 @@ public abstract class NavigationAbstract { + } else if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { + return this.c; + } else { ++ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(getEntity().world, blockposition), null).callEvent()) { return null; } // Paper + this.q = blockposition; + float f = this.k(); + +@@ -0,0 +0,0 @@ public abstract class NavigationAbstract { + if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { + return this.c; + } else { ++ if (!new com.destroystokyo.paper.event.entity.EntityPathfindEvent(getEntity().getBukkitEntity(), MCUtil.toLocation(entity.world, blockposition), entity.getBukkitEntity()).callEvent()) { return null; } // Paper + this.q = blockposition; + float f = this.k(); + +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch new file mode 100644 index 0000000000..1955a0832b --- /dev/null +++ b/Spigot-Server-Patches/EntityRegainHealthEvent-isFastRegen-API.patch @@ -0,0 +1,43 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Fri, 22 Apr 2016 01:43:11 -0500 +Subject: [PATCH] EntityRegainHealthEvent isFastRegen API + +Don't even get me started + +diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index acf0e0281..b12c9e461 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 { + } + + public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) { ++ // Paper start - Forward ++ heal(f, regainReason, false); ++ } ++ ++ public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason, boolean isFastRegen) { ++ // Paper end + float f1 = this.getHealth(); + + if (f1 > 0.0F) { +- EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason); ++ EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason, isFastRegen); // Paper - Add isFastRegen + this.world.getServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { +diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java +index bbcc488bd..d886e476b 100644 +--- a/src/main/java/net/minecraft/server/FoodMetaData.java ++++ b/src/main/java/net/minecraft/server/FoodMetaData.java +@@ -0,0 +0,0 @@ public class FoodMetaData { + if (this.foodTickTimer >= 10) { + float f = Math.min(this.saturationLevel, 6.0F); + +- entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason ++ entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen + this.a(f); + this.foodTickTimer = 0; + } +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Expand-Explosions-API.patch b/Spigot-Server-Patches/Expand-Explosions-API.patch index feb26a7b8c..765640d703 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 65ad8e588..0640ca094 100644 +index f7eaecb3f..e8290759b 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 6995e40531..b8b1748805 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 @@ -37,7 +37,7 @@ index c5da2cde3..4ac2d39c5 100644 if (this.a(entityplayer, false, d0, d1, d2, packetplayoutworldparticles)) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 817e29474..3ee663293 100644 +index 7004f1176..1afb480f8 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/ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch index 8c5161d044..0fb06c3a25 100644 --- a/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch @@ -8,7 +8,7 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor metadata such as spawn reason, or conditionally move data from source to target. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 069ba83db..ee061d693 100644 +index b96511804..d8ce3efc9 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, IIBlockAccess, AutoClose 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 27ec58e587..79d0e43c48 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 @@ -221,7 +221,7 @@ index 998662d9e..6b4eb7f05 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 013c5b4cf..817e29474 100644 +index 86848543d..7004f1176 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/Expose-client-protocol-version-and-virtual-host.patch b/Spigot-Server-Patches/Expose-client-protocol-version-and-virtual-host.patch index 441a2f6577..aea0ffdc8c 100644 --- a/Spigot-Server-Patches/Expose-client-protocol-version-and-virtual-host.patch +++ b/Spigot-Server-Patches/Expose-client-protocol-version-and-virtual-host.patch @@ -111,7 +111,7 @@ index 7acdac55e..f1a3be69d 100644 return this.a; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index d7eb4af83..9f9002dd8 100644 +index 019fd4b48..43e357e39 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch index 42d2122901..42c3579dfa 100644 --- a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch +++ b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch @@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds when cancelling interaction. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index ce8f76871..126c17d1b 100644 +index e34198e40..620efb1ac 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 { diff --git a/Spigot-Server-Patches/Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch b/Spigot-Server-Patches/Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch index e349ceb281..1d6d192f98 100644 --- a/Spigot-Server-Patches/Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch +++ b/Spigot-Server-Patches/Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch @@ -30,7 +30,7 @@ index f88444c7e..f64a5ef35 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 1d4a7b64d..c4a25bd87 100644 +index 7e5a2775a..ad5ac66ac 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -0,0 +0,0 @@ public class EntityFallingBlock extends Entity { diff --git a/Spigot-Server-Patches/Firework-API-s.patch b/Spigot-Server-Patches/Firework-API-s.patch index b25b5e2502..095edc7513 100644 --- a/Spigot-Server-Patches/Firework-API-s.patch +++ b/Spigot-Server-Patches/Firework-API-s.patch @@ -53,14 +53,14 @@ index 4c2cdd4bc..abf8799c4 100644 public boolean bk() { diff --git a/src/main/java/net/minecraft/server/ItemFireworks.java b/src/main/java/net/minecraft/server/ItemFireworks.java -index 7b1d51e5a..b0863b4db 100644 +index 7b1d51e5a..1493d0999 100644 --- a/src/main/java/net/minecraft/server/ItemFireworks.java +++ b/src/main/java/net/minecraft/server/ItemFireworks.java @@ -0,0 +0,0 @@ public class ItemFireworks extends Item { ItemStack itemstack = itemactioncontext.getItemStack(); EntityFireworks entityfireworks = new EntityFireworks(world, (double) ((float) blockposition.getX() + itemactioncontext.m()), (double) ((float) blockposition.getY() + itemactioncontext.n()), (double) ((float) blockposition.getZ() + itemactioncontext.o()), itemstack); -+ entityfireworks.spawningEntity = entityhuman.getUniqueID(); // Paper ++ entityfireworks.spawningEntity = itemactioncontext.b.getUniqueID(); // Paper world.addEntity(entityfireworks); itemstack.subtract(1); } diff --git a/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch b/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch index 786f600e46..b1dca90439 100644 --- a/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch +++ b/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix AIOOBE in inventory handling diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e4f28b8ac..c09620b37 100644 +index 32cef8e30..b17540ecb 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, ITickable { diff --git a/Spigot-Server-Patches/Fix-Anvil-Level-sync-to-client.patch b/Spigot-Server-Patches/Fix-Anvil-Level-sync-to-client.patch index 97bd38b01e..d9c86db78b 100644 --- a/Spigot-Server-Patches/Fix-Anvil-Level-sync-to-client.patch +++ b/Spigot-Server-Patches/Fix-Anvil-Level-sync-to-client.patch @@ -26,7 +26,7 @@ index 845ec2250..c252ff6d5 100644 this.lastLevelCost = this.levelCost; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3c1f02c18..d7eb4af83 100644 +index 1c8c364d3..019fd4b48 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -35,7 +35,7 @@ index 3c1f02c18..d7eb4af83 100644 } + // Paper start + if (prop == Property.REPAIR_COST && container instanceof net.minecraft.server.ContainerAnvil) { -+ ((ContainerAnvil) container).levelCost = value; ++ ((net.minecraft.server.ContainerAnvil) container).levelCost = value; + } + // Paper end getHandle().setContainerData(container, prop.getId(), value); diff --git a/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch new file mode 100644 index 0000000000..3eeffac00b --- /dev/null +++ b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 3 Apr 2016 17:48:50 -0400 +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 2c6774082..5b2d67260 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, IIBlockAccess, AutoClose + } + + public void applyPhysics(BlockPosition blockposition, Block block) { ++ if (captureBlockStates) { return; } // Paper - Cancel all physics during placement + this.a(blockposition.west(), block, blockposition); + this.a(blockposition.east(), block, blockposition); + this.a(blockposition.down(), block, blockposition); +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch b/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch index 16637d73cd..2f2cf36fc8 100644 --- a/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch +++ b/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch @@ -9,7 +9,7 @@ has not resolved all the bugs with the changes. This patch fixes known issues and really should be applied by Spigot team. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index aaa65582b..8ecdf7a5b 100644 +index 744b5bc6d..718ebfea0 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch index 4ef985519b..2a53261018 100644 --- a/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch +++ b/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch @@ -8,7 +8,7 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added. Also add debug if something else tries to, and abort before world gets bad state diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index faaa1b36b..063d53f1c 100644 +index ad3bd3808..e70c2184c 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -21,7 +21,7 @@ index faaa1b36b..063d53f1c 100644 Iterator iterator = entity.bP().iterator(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c34f42efc..a8ef9e337 100644 +index c9b6b57af..067b92f3e 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, IIBlockAccess, AutoClose 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 bf85575dbc..62f670a4cd 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 0ba99bcbc..49e7c1589 100644 +index ca7c23f54..d0ce6b363 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Fix-block-break-desync.patch b/Spigot-Server-Patches/Fix-block-break-desync.patch index 58459f7cbd..b80c0fd376 100644 --- a/Spigot-Server-Patches/Fix-block-break-desync.patch +++ b/Spigot-Server-Patches/Fix-block-break-desync.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix block break desync diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a7132427a..32c99085f 100644 +index f26636e30..aa93b5945 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, ITickable { diff --git a/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch index a35e1396c5..0033217173 100644 --- a/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/Spigot-Server-Patches/Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index d71efd62f..5fe01e7ef 100644 +index ab2bd6dae..067f7b990 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, ITickable { diff --git a/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch b/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch index 99691fc270..e4ebe5b6c3 100644 --- a/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch +++ b/Spigot-Server-Patches/Fix-lag-from-explosions-processing-dead-entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 37e6e5922..e30219258 100644 +index 37e6e5922..6b9f6c956 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 { @@ -17,7 +17,7 @@ index 37e6e5922..e30219258 100644 + List list = this.world.getEntities(this.source, new AxisAlignedBB((double) i, (double) l, (double) j1, (double) j, (double) i1, (double) k1), new com.google.common.base.Predicate() { + @Override + public boolean apply(Entity entity) { -+ return IEntitySelector.d.apply(entity) && !entity.dead; ++ return IEntitySelector.d.test(entity) && !entity.dead; + } + }); + // Paper end diff --git a/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch new file mode 100644 index 0000000000..c2c67ea960 --- /dev/null +++ b/Spigot-Server-Patches/Fix-reducedDebugInfo-not-initialized-on-client.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jedediah Smith +Date: Sat, 2 Apr 2016 20:37:03 -0400 +Subject: [PATCH] Fix reducedDebugInfo not initialized on client + + +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index 23cab725d..8e1edde31 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 { + playerconnection.sendPacket(new PacketPlayOutHeldItemSlot(entityplayer.inventory.itemInHandIndex)); + playerconnection.sendPacket(new PacketPlayOutRecipeUpdate(this.server.getCraftingManager().b())); + playerconnection.sendPacket(new PacketPlayOutTags(this.server.getTagRegistry())); ++ playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver.getGameRules().getBoolean("reducedDebugInfo") ? 22 : 23))); // Paper - fix this rule not being initialized on the client + this.f(entityplayer); + entityplayer.getStatisticManager().c(); + entityplayer.B().a(entityplayer); +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch index 9862afda98..bb437f1544 100644 --- a/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch +++ b/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch @@ -9,7 +9,7 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 12af78209..3b76c7080 100644 +index c0b484177..60bc6d331 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/Handle-Item-Meta-Inconsistencies.patch b/Spigot-Server-Patches/Handle-Item-Meta-Inconsistencies.patch index b1cd18302a..04e4c040fb 100644 --- a/Spigot-Server-Patches/Handle-Item-Meta-Inconsistencies.patch +++ b/Spigot-Server-Patches/Handle-Item-Meta-Inconsistencies.patch @@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the ItemMeta API equivalents, and should deprecate the old API's. diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 7f249a975..70f2dcc9e 100644 +index 68a59e708..ed714c2cc 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -0,0 +0,0 @@ import com.mojang.brigadier.StringReader; @@ -78,7 +78,7 @@ index 7f249a975..70f2dcc9e 100644 public boolean hasEnchantments() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 4c4f04557..cb3b952e2 100644 +index d41459ef0..cadff64bf 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -0,0 +0,0 @@ import static org.bukkit.craftbukkit.inventory.CraftMetaItem.ENCHANTMENTS; diff --git a/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch b/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch index ac94f2a4e4..0c84b6a476 100644 --- a/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/Spigot-Server-Patches/Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing the plugin logger. diff --git a/pom.xml b/pom.xml -index 1b4877868..a98abca8e 100644 +index 9d2473317..eb2cdf129 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch index 5fa2786672..e8f1311248 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 0640ca094..6705864a7 100644 +index e8290759b..0f4a894eb 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-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch index 8017d3b57b..c2724af367 100644 --- a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch @@ -226,7 +226,7 @@ index c9edd289a..8aa121e2f 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 2179664a0..616fcbf13 100644 +index d7e1ecc03..f20cddc41 100644 --- a/src/main/java/net/minecraft/server/ServerPing.java +++ b/src/main/java/net/minecraft/server/ServerPing.java @@ -0,0 +0,0 @@ public class ServerPing { diff --git a/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index 036187f425..a628846576 100644 --- a/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/Spigot-Server-Patches/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -43,7 +43,7 @@ index 6ae576a2e..af1981967 100644 ItemStack itemstack = entityitemframe.getItem(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3b3cc69de..4588df4b1 100644 +index e5ecfdbf0..5102f24ed 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch b/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch index 69209ad15d..c6432fcd51 100644 --- a/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch +++ b/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Include Log4J2 SLF4J implementation diff --git a/pom.xml b/pom.xml -index a98abca8e..9354f6edf 100644 +index eb2cdf129..353a5560e 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index 6e0c2f4b66..2240836c29 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -110,7 +110,7 @@ index c91caf578..59dc239b8 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5fe01e7ef..4ed107eac 100644 +index 067f7b990..97b315bca 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, ITickable { @@ -123,7 +123,7 @@ index 5fe01e7ef..4ed107eac 100644 this.player.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index c1de6564a..d397c6c74 100644 +index 879780c5b..907f0232b 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 { @@ -155,7 +155,7 @@ index 4b9ecb4a6..b602a5d1b 100644 public boolean isBlocking() { return getHandle().isBlocking(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 3b76c7080..79ade89c5 100644 +index 60bc6d331..b25980027 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/ItemStack-getMaxItemUseDuration.patch b/Spigot-Server-Patches/ItemStack-getMaxItemUseDuration.patch index 85ca27f00c..4ee6dea78e 100644 --- a/Spigot-Server-Patches/ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-Server-Patches/ItemStack-getMaxItemUseDuration.patch @@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index be6205275..a4a5058da 100644 +index ca169e113..dad883054 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -0,0 +0,0 @@ public final class ItemStack { diff --git a/Spigot-Server-Patches/Lighting-Queue.patch b/Spigot-Server-Patches/Lighting-Queue.patch index 59480d2d6d..0aa9703c36 100644 --- a/Spigot-Server-Patches/Lighting-Queue.patch +++ b/Spigot-Server-Patches/Lighting-Queue.patch @@ -43,7 +43,7 @@ index a340866f3..1e3405cc1 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 36ea4ad47..e5567701e 100644 +index 4a4cc6c59..b0060c363 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index 2490e15f22..dc0bb83ecf 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -18,7 +18,7 @@ index c3e990bdf..e2a7b4be2 100644 } } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 002da2a19..80cdf5528 100644 +index 002da2a19..70a7edf57 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -38,6 +38,22 @@ index 002da2a19..80cdf5528 100644 public BlockPosition a(int i, int j, int k) { return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k); } +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + return this.d; + } + ++ public BlockPosition.MutableBlockPosition setValues(int i, int j, int k) { return c(i, j, k);} // Paper - OBFHELPER + public BlockPosition.MutableBlockPosition c(int i, int j, int k) { + this.b = i; + this.c = j; +@@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { + return this; + } + ++ public BlockPosition.MutableBlockPosition setValues(double d0, double d1, double d2) { return c(d0, d1, d2);} // Paper - OBFHELPER + public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) { + return this.c(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); + } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 0ae780c8e..3b97981bc 100644 --- a/src/main/java/net/minecraft/server/Chunk.java @@ -73,7 +89,7 @@ index 00a530c51..2947d9ff6 100644 return (long) i & 4294967295L | ((long) j & 4294967295L) << 32; } diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 97cfd6695..05ed0abe7 100644 +index 97cfd6695..81605b10f 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -90,6 +106,9 @@ index 97cfd6695..05ed0abe7 100644 - EntityTypes.REGISTRY.a(new MinecraftKey(s), entitytypes); + // Paper start ++ if (clsToKeyMap == null ) clsToKeyMap = new java.util.HashMap<>(); ++ if (clsToTypeMap == null ) clsToTypeMap = new java.util.HashMap<>(); ++ + MinecraftKey key = new MinecraftKey(s); + Class entityClass = entitytypes_a.getEntityClass(); + EntityTypes.REGISTRY.a(key, entitytypes); @@ -97,8 +116,8 @@ index 97cfd6695..05ed0abe7 100644 + clsToTypeMap.put(entityClass, org.bukkit.entity.EntityType.fromName(s)); return entitytypes; } -+ public static Map, MinecraftKey> clsToKeyMap = new java.util.HashMap<>(); -+ public static Map, org.bukkit.entity.EntityType> clsToTypeMap = new java.util.HashMap<>(); ++ public static Map, MinecraftKey> clsToKeyMap; ++ public static Map, org.bukkit.entity.EntityType> clsToTypeMap; + // Paper end @Nullable @@ -113,7 +132,7 @@ index 97cfd6695..05ed0abe7 100644 private boolean c = true; private boolean d = true; diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index cc96294f4..7f249a975 100644 +index 3f0c5d7dd..68a59e708 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.Location; @@ -142,6 +161,24 @@ index cc96294f4..7f249a975 100644 public void setTag(@Nullable NBTTagCompound nbttagcompound) { this.tag = nbttagcompound; } +diff --git a/src/main/java/net/minecraft/server/LotoSelectorEntry.java b/src/main/java/net/minecraft/server/LotoSelectorEntry.java +index a540167d6..add618866 100644 +--- a/src/main/java/net/minecraft/server/LotoSelectorEntry.java ++++ b/src/main/java/net/minecraft/server/LotoSelectorEntry.java +@@ -0,0 +0,0 @@ public abstract class LotoSelectorEntry { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(LotoSelectorEntry object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((LotoSelectorEntry) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public LotoSelectorEntry deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 index 000000000..a4b0901cf @@ -349,8 +386,30 @@ index 000000000..a4b0901cf + return null; + } +} +diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java +index 8170a8428..e21e60b00 100644 +--- a/src/main/java/net/minecraft/server/NBTBase.java ++++ b/src/main/java/net/minecraft/server/NBTBase.java +@@ -0,0 +0,0 @@ public interface NBTBase { + + byte getTypeId(); + +- static default NBTBase createTag(byte b0) { ++ static NBTBase createTag(byte b0) { // Paper - decompile fix + switch (b0) { + case 0: + return new NBTTagEnd(); +@@ -0,0 +0,0 @@ public interface NBTBase { + } + } + +- static default String n(int i) { ++ static String n(int i) { // Paper - decompile fix + switch (i) { + case 0: + return "TAG_End"; diff --git a/src/main/java/net/minecraft/server/NBTList.java b/src/main/java/net/minecraft/server/NBTList.java -index 1a81d8e5f..08db5e332 100644 +index 1a81d8e5f..057c2077a 100644 --- a/src/main/java/net/minecraft/server/NBTList.java +++ b/src/main/java/net/minecraft/server/NBTList.java @@ -0,0 +0,0 @@ public abstract class NBTList extends AbstractList impleme @@ -363,10 +422,9 @@ index 1a81d8e5f..08db5e332 100644 this.a(i, t0); return nbtbase; @@ -0,0 +0,0 @@ public abstract class NBTList extends AbstractList impleme - public abstract void a(int i, NBTBase nbtbase); public abstract void b(int i); -- + - public Object set(int i, Object object) { - return this.set(i, (NBTBase) object); - } @@ -374,7 +432,22 @@ index 1a81d8e5f..08db5e332 100644 - public Object get(int i) { - return this.get(i); - } ++ public abstract NBTList clone(); // Paper - decompile fix } +diff --git a/src/main/java/net/minecraft/server/NBTTagByteArray.java b/src/main/java/net/minecraft/server/NBTTagByteArray.java +index 11ffa6c34..3ff3a2983 100644 +--- a/src/main/java/net/minecraft/server/NBTTagByteArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagByteArray.java +@@ -0,0 +0,0 @@ public class NBTTagByteArray extends NBTList { + return stringbuilder.append(']').toString(); + } + +- public NBTBase clone() { ++ @Override ++ public NBTTagByteArray clone() { + byte[] abyte = new byte[this.data.length]; + + System.arraycopy(this.data, 0, abyte, 0, this.data.length); diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java index 7fc9b5ff3..e658816c2 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -411,8 +484,21 @@ index 7fc9b5ff3..e658816c2 100644 - return this.clone(); - } } +diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java +index f5c9b97d5..d121ad4f7 100644 +--- a/src/main/java/net/minecraft/server/NBTTagIntArray.java ++++ b/src/main/java/net/minecraft/server/NBTTagIntArray.java +@@ -0,0 +0,0 @@ public class NBTTagIntArray extends NBTList { + return this.a(i); + } + +- public NBTBase clone() { ++ public NBTTagIntArray clone() { // Paper - decompile fix + return this.c(); + } + } diff --git a/src/main/java/net/minecraft/server/NBTTagList.java b/src/main/java/net/minecraft/server/NBTTagList.java -index b3c944d70..e56d4836d 100644 +index b3c944d70..a8280acf9 100644 --- a/src/main/java/net/minecraft/server/NBTTagList.java +++ b/src/main/java/net/minecraft/server/NBTTagList.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -425,7 +511,11 @@ index b3c944d70..e56d4836d 100644 public NBTTagList() {} @@ -0,0 +0,0 @@ public class NBTTagList extends NBTList { - public NBTBase clone() { + return this.type; + } + +- public NBTBase clone() { ++ public NBTTagList clone() { return this.c(); } - @@ -446,7 +536,7 @@ index b3c944d70..e56d4836d 100644 - } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index fa4a7fa63..749be86fe 100644 +index 2fb86aa19..6f21b01a8 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, ITickable { @@ -462,4 +552,72 @@ index fa4a7fa63..749be86fe 100644 // CraftBukkit start - multithreaded fields private volatile int chatThrottle; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(PlayerConnection.class, "chatThrottle"); +diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java +index ef332d651..7cc7eb773 100644 +--- a/src/main/java/net/minecraft/server/RegistryBlockID.java ++++ b/src/main/java/net/minecraft/server/RegistryBlockID.java +@@ -0,0 +0,0 @@ import java.util.Iterator; + import java.util.List; + import javax.annotation.Nullable; + +-public class RegistryBlockID implements Registry { ++public class RegistryBlockID implements Registry { // Paper - decompile fix + + private int a; + private final IdentityHashMap b; +@@ -0,0 +0,0 @@ public class RegistryBlockID implements Registry { + this.b.put(t0, Integer.valueOf(i)); + + while (this.c.size() <= i) { +- this.c.add((Object) null); ++ this.c.add(null); // Paper - decompile fix + } + + this.c.set(i, t0); +diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java +index 2179664a0..d7e1ecc03 100644 +--- a/src/main/java/net/minecraft/server/ServerPing.java ++++ b/src/main/java/net/minecraft/server/ServerPing.java +@@ -0,0 +0,0 @@ public class ServerPing { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(ServerPing object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((ServerPing) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public ServerPing deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } +@@ -0,0 +0,0 @@ public class ServerPing { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(ServerPing.ServerData object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((ServerPing.ServerData) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public ServerPing.ServerData deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } +@@ -0,0 +0,0 @@ public class ServerPing { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(ServerPing.ServerPingPlayerSample object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((ServerPing.ServerPingPlayerSample) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public ServerPing.ServerPingPlayerSample deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { // Paper - decompile fix + return this.a(jsonelement, type, jsondeserializationcontext); + } + } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch b/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch index 9243e77948..509430070a 100644 --- a/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch +++ b/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch @@ -7,7 +7,7 @@ I don't know why upstream made only the minimum height configurable but whatever diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 49f282332..d80cd60ab 100644 +index 703642c0b..a33c55f41 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 { diff --git a/Spigot-Server-Patches/Make-shield-blocking-delay-configurable.patch b/Spigot-Server-Patches/Make-shield-blocking-delay-configurable.patch index 2059ddfcb4..2191e8dce0 100644 --- a/Spigot-Server-Patches/Make-shield-blocking-delay-configurable.patch +++ b/Spigot-Server-Patches/Make-shield-blocking-delay-configurable.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make shield blocking delay configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 5a9c68e4f..650addb84 100644 +index f1db4becd..ef4bfb480 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 { diff --git a/Spigot-Server-Patches/More-informative-vehicle-moved-wrongly-message.patch b/Spigot-Server-Patches/More-informative-vehicle-moved-wrongly-message.patch index 18bedddeac..eb0c623a2d 100644 --- a/Spigot-Server-Patches/More-informative-vehicle-moved-wrongly-message.patch +++ b/Spigot-Server-Patches/More-informative-vehicle-moved-wrongly-message.patch @@ -5,7 +5,7 @@ Subject: [PATCH] More informative vehicle moved wrongly message diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index d61ce6461..e4f28b8ac 100644 +index 79fddc866..32cef8e30 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, ITickable { diff --git a/Spigot-Server-Patches/Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/Optimize-ItemStack.isEmpty.patch index 8ffbc5b1d0..c3f72c1514 100644 --- a/Spigot-Server-Patches/Optimize-ItemStack.isEmpty.patch +++ b/Spigot-Server-Patches/Optimize-ItemStack.isEmpty.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize ItemStack.isEmpty() Remove hashMap lookup every check, simplify code to remove ternary diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 70f2dcc9e..be6205275 100644 +index ed714c2cc..ca169e113 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -0,0 +0,0 @@ public final class ItemStack { diff --git a/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch index 93f00f79d7..f27cbc7cd8 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 3b2de1f31..0ba99bcbc 100644 +index 04b5521cd..ca7c23f54 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Optimize-explosions.patch b/Spigot-Server-Patches/Optimize-explosions.patch index 602a28512e..e83c836f8d 100644 --- a/Spigot-Server-Patches/Optimize-explosions.patch +++ b/Spigot-Server-Patches/Optimize-explosions.patch @@ -25,7 +25,7 @@ index dccccbf5b..3626aa717 100644 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index e30219258..ddbf667c4 100644 +index 6b9f6c956..8fdcd52b2 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 { diff --git a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch index 23b07e1e18..afd12689a8 100644 --- a/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -31,7 +31,7 @@ index e2a7b4be2..58f8b4b72 100644 public BaseBlockPosition(int i, int j, int k) { this.a = i; diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 80cdf5528..39252ad9a 100644 +index 70a7edf57..fff08f09d 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java @@ -0,0 +0,0 @@ public class BlockPosition extends BaseBlockPosition { @@ -96,7 +96,7 @@ index 7c6308dbe..880058a9e 100644 private NibbleArray skyLight; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1c939e523..9e56b046f 100644 +index d3785f73b..f8e4cd14c 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch b/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch index 57c5fd09d6..83716f5d43 100644 --- a/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch +++ b/Spigot-Server-Patches/Option-for-maximum-exp-value-when-merging-orbs.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Option for maximum exp value when merging orbs diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6344537ec..33743f8fd 100644 +index c80d84b9b..605e84173 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 { - replacementBlocks = getList("anti-xray.replacement-blocks", Arrays.asList((Object) "stone", "planks")); - log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Chunk Edge Mode: " + chunkEdgeMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks / Update Radius: " + updateRadius); + disableCreeperLingeringEffect = getBoolean("disable-creeper-lingering-effect", false); + log("Creeper lingering effect: " + disableCreeperLingeringEffect); } + + public int expMergeMaxValue; @@ -20,7 +20,7 @@ index 6344537ec..33743f8fd 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b9472dddb..d28d4a9a7 100644 +index 56292fad9..d5c509733 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch index a509cb5bb2..23975c2730 100644 --- a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch +++ b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch @@ -25,7 +25,7 @@ index 9f586774d..1c2209270 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9e56b046f..c9d0c22d5 100644 +index f8e4cd14c..11012360b 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index 8f5e4a213f..dbdfc8a14c 100644 --- a/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/Spigot-Server-Patches/Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -31,7 +31,7 @@ index c37c46e71..88092d823 100644 public ScoreboardTeamBase be() { if (!this.world.paperConfig.nonPlayerEntitiesOnScoreboards && !(this instanceof EntityHuman)) { return null; } // Paper diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 553011d88..65fa09a01 100644 +index a3486bd46..79fddc866 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, ITickable { diff --git a/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch index 3650dee296..e2ab38cf53 100644 --- a/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/Optional-TNT-doesn-t-move-in-water.patch @@ -32,7 +32,7 @@ index 38de48ebc..321da3be3 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 509254b35..1aa4519a6 100644 +index 70694c8e5..51b42933d 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 diff --git a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch index 74c45ce213..898e3fff04 100644 --- a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch @@ -48,7 +48,7 @@ index 02bbb0d1d..e73b07f42 100644 uniqueId = i.getId(); // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c2cd5ac4b..12af78209 100644 +index 7021a81be..c0b484177 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch b/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch index 788675cbaa..9b843a4037 100644 --- a/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch +++ b/Spigot-Server-Patches/Prevent-Auto-Save-if-Save-Queue-is-full.patch @@ -51,7 +51,7 @@ index 1e6ea3084..9145401bc 100644 } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 063d53f1c..071e8a196 100644 +index e70c2184c..20aa20a98 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { diff --git a/Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch b/Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch new file mode 100644 index 0000000000..dc8af97e21 --- /dev/null +++ b/Spigot-Server-Patches/Prevent-Fire-from-loading-chunks.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 17 Apr 2016 17:27:09 -0400 +Subject: [PATCH] Prevent Fire from loading chunks + +This causes the nether to spam unload/reload chunks, plus overall +bad behavior. + +diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java +index b6caf4c8a..f3a278c0b 100644 +--- a/src/main/java/net/minecraft/server/BlockFire.java ++++ b/src/main/java/net/minecraft/server/BlockFire.java +@@ -0,0 +0,0 @@ public class BlockFire extends Block { + } + + blockposition_mutableblockposition.g(blockposition).d(l, j1, i1); ++ if (!world.isLoaded(blockposition_mutableblockposition)) continue; // Paper + int l1 = this.a((IWorldReader) world, (BlockPosition) blockposition_mutableblockposition); + + if (l1 > 0) { +@@ -0,0 +0,0 @@ public class BlockFire extends Block { + } + + private void a(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition +- int k = this.f(world.getType(blockposition).getBlock()); ++ // Paper start ++ final IBlockData iblockdata = world.getTypeIfLoaded(blockposition); ++ if (iblockdata == null) return; ++ int k = this.f(iblockdata.getBlock()); ++ // Paper end + + if (random.nextInt(i) < k) { +- IBlockData iblockdata = world.getType(blockposition); ++ //IBlockData iblockdata = world.getType(blockposition); // Paper + + // CraftBukkit start + org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); +@@ -0,0 +0,0 @@ public class BlockFire extends Block { + for (int k = 0; k < j; ++k) { + EnumDirection enumdirection = aenumdirection[k]; + +- i = Math.max(this.g(iworldreader.getType(blockposition.shift(enumdirection)).getBlock()), i); ++ // Paper start ++ final IBlockData type = ((World)iworldreader).getTypeIfLoaded(blockposition.shift(enumdirection)); ++ if (type == null) continue; ++ i = Math.max(this.g(type.getBlock()), i); ++ // Paper end + } + + return i; +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch b/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch index 623dd0d37c..d5472ab94b 100644 --- a/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch +++ b/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0f39fa49f..c1de6564a 100644 +index 9e403d625..879780c5b 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 { diff --git a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch index 152c476bac..ae38156d33 100644 --- a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch @@ -19,7 +19,7 @@ index cf2a39384..c91caf578 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 53d3e9775..b69c194bb 100644 +index 1f2cfbc92..f26636e30 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, ITickable { diff --git a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch index 15f4e646ec..d2dc234320 100644 --- a/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/Properly-handle-async-calls-to-restart-the-server.patch @@ -78,7 +78,7 @@ index f81ff5628..f679c6bc2 100644 return this.serverThread; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index e41850742..5e833c378 100644 +index fdbc01792..4c9ff8c29 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 { diff --git a/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch index 92f5398692..a7975bccfa 100644 --- a/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e516ec603..4fd6d3dbf 100644 +index 90e260f3b..8b63192cf 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/Reduce-IO-ops-opening-a-new-region-file.patch b/Spigot-Server-Patches/Reduce-IO-ops-opening-a-new-region-file.patch new file mode 100644 index 0000000000..0c968aabc0 --- /dev/null +++ b/Spigot-Server-Patches/Reduce-IO-ops-opening-a-new-region-file.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Antony Riley +Date: Tue, 29 Mar 2016 06:56:23 +0300 +Subject: [PATCH] Reduce IO ops opening a new region file. + + +diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java +index 3f9aa5923..4acb6df5d 100644 +--- a/src/main/java/net/minecraft/server/RegionFile.java ++++ b/src/main/java/net/minecraft/server/RegionFile.java +@@ -0,0 +0,0 @@ import java.io.ByteArrayInputStream; + import java.io.ByteArrayOutputStream; + import java.io.DataInputStream; + import java.io.DataOutputStream; ++import java.io.EOFException; + import java.io.File; + import java.io.IOException; + import java.io.RandomAccessFile; ++import java.nio.ByteBuffer; ++import java.nio.IntBuffer; + import java.util.List; + import java.util.zip.DeflaterOutputStream; + import java.util.zip.GZIPInputStream; +@@ -0,0 +0,0 @@ public class RegionFile { + + int k; + ++ // Paper Start ++ ByteBuffer header = ByteBuffer.allocate(8192); ++ while (header.hasRemaining()) { ++ if (this.c.getChannel().read(header) == -1) throw new EOFException(); ++ } ++ header.clear(); ++ IntBuffer headerAsInts = header.asIntBuffer(); ++ // Paper End + for (j = 0; j < 1024; ++j) { +- k = this.c.readInt(); ++ k = headerAsInts.get(); // Paper + this.d[j] = k; + if (k != 0 && (k >> 8) + (k & 255) <= this.f.size()) { + for (int l = 0; l < (k & 255); ++l) { +@@ -0,0 +0,0 @@ public class RegionFile { + } + + for (j = 0; j < 1024; ++j) { +- k = this.c.readInt(); ++ k = headerAsInts.get(); // Paper + this.e[j] = k; + } + } catch (IOException ioexception) { +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch b/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch index c0414b6c6f..bc4daa79c4 100644 --- a/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -16,7 +16,7 @@ Refresh the player inventory when PlayerInteractEntityEvent is cancelled to avoid this problem. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 4ed107eac..472f40709 100644 +index 97b315bca..d9d11a531 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, ITickable { diff --git a/Spigot-Server-Patches/Remove-Debug-checks-from-DataBits.patch b/Spigot-Server-Patches/Remove-Debug-checks-from-DataBits.patch new file mode 100644 index 0000000000..431204b19c --- /dev/null +++ b/Spigot-Server-Patches/Remove-Debug-checks-from-DataBits.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Tue, 5 Apr 2016 21:38:58 -0400 +Subject: [PATCH] Remove Debug checks from DataBits + +These are super hot and causing noticeable hits + +Before: http://i.imgur.com/nQsMzAE.png +After: http://i.imgur.com/nJ46crB.png + +diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java +index d24ec3d53..0fb3162e6 100644 +--- a/src/main/java/net/minecraft/server/DataBits.java ++++ b/src/main/java/net/minecraft/server/DataBits.java +@@ -0,0 +0,0 @@ public class DataBits { + } + + public DataBits(int i, int j, long[] along) { +- Validate.inclusiveBetween(1L, 32L, (long) i); ++ //Validate.inclusiveBetween(1L, 32L, (long) i); // Paper + this.d = j; + this.b = i; + this.a = along; +@@ -0,0 +0,0 @@ public class DataBits { + } + + public void a(int i, int j) { +- Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); +- Validate.inclusiveBetween(0L, this.c, (long) j); ++ //Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); // Paper ++ //Validate.inclusiveBetween(0L, this.c, (long) j); // Paper + int k = i * this.b; + int l = k / 64; + int i1 = ((i + 1) * this.b - 1) / 64; +@@ -0,0 +0,0 @@ public class DataBits { + } + + public int a(int i) { +- Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); ++ //Validate.inclusiveBetween(0L, (long) (this.d - 1), (long) i); // Paper + int j = i * this.b; + int k = j / 64; + int l = ((i + 1) * this.b - 1) / 64; +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch new file mode 100644 index 0000000000..a753f27535 --- /dev/null +++ b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch @@ -0,0 +1,69 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 13 Apr 2016 00:25:28 -0400 +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 3aecf7a5d..e5ecfdbf0 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, IIBlockAccess, AutoClose + }; + // Spigot end + protected final Set g = Sets.newHashSet(); // Paper +- public final List tileEntityList = Lists.newArrayList(); ++ //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list + public final List tileEntityListTick = Lists.newArrayList(); + private final List c = Lists.newArrayList(); + private final Set tileEntityListUnload = Sets.newHashSet(); // Paper +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + timings.tileEntityTick.startTiming(); // Spigot + if (!this.tileEntityListUnload.isEmpty()) { + this.tileEntityListTick.removeAll(this.tileEntityListUnload); +- this.tileEntityList.removeAll(this.tileEntityListUnload); ++ //this.tileEntityList.removeAll(this.tileEntityListUnload); // Paper - remove unused list + this.tileEntityListUnload.clear(); + } + +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + if (tileentity.x()) { + tilesThisCycle--; + this.tileEntityListTick.remove(tileTickPosition--); +- this.tileEntityList.remove(tileentity); ++ //this.tileEntityList.remove(tileentity); // Paper - remove unused list + if (this.isLoaded(tileentity.getPosition())) { + this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); + } +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); + // CraftBukkit start + // From above, don't screw this up - SPIGOT-1746 +- if (!this.tileEntityList.contains(tileentity1)) { ++ if (true) { // Paper - remove unused list + this.a(tileentity1); + } + // CraftBukkit end +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + protected void p_() {} + + public boolean a(TileEntity tileentity) { +- boolean flag = this.tileEntityList.add(tileentity); ++ boolean flag = true; // Paper - remove unused list + +- if (flag && tileentity instanceof ITickable) { ++ if (flag && tileentity instanceof ITickable && !this.tileEntityListTick.contains(tileentity)) { // Paper + this.tileEntityListTick.add(tileentity); + } + +@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + } else { + if (tileentity != null) { + this.c.remove(tileentity); +- this.tileEntityList.remove(tileentity); ++ //this.tileEntityList.remove(tileentity); // Paper - remove unused list + this.tileEntityListTick.remove(tileentity); + } + +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch new file mode 100644 index 0000000000..4d4f5624ac --- /dev/null +++ b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch @@ -0,0 +1,79 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Antony Riley +Date: Tue, 29 Mar 2016 08:22:55 +0300 +Subject: [PATCH] Sanitise RegionFileCache and make configurable. + +RegionFileCache prior to this patch would close every single open region +file upon reaching a size of 256. +This patch modifies that behaviour so it closes the the least recently +used RegionFile. +The implementation uses a LinkedHashMap as an LRU cache (modified from HashMap). +The maximum size of the RegionFileCache is also made configurable. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index 2f6e169f5..ec4643384 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -0,0 +0,0 @@ public class PaperConfig { + private static void loadPermsBeforePlugins() { + loadPermsBeforePlugins = getBoolean("settings.load-permissions-yml-before-plugins", true); + } ++ ++ public static int regionFileCacheSize = 256; ++ private static void regionFileCacheSize() { ++ regionFileCacheSize = getInt("settings.region-file-cache-size", 256); ++ } + } +diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java +index 384628ccc..b335016fd 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCache.java ++++ b/src/main/java/net/minecraft/server/RegionFileCache.java +@@ -0,0 +0,0 @@ import java.io.IOException; + import java.util.Iterator; + import java.util.Map; + import javax.annotation.Nullable; ++import com.destroystokyo.paper.PaperConfig; // Paper ++import java.util.LinkedHashMap; // Paper + + public class RegionFileCache { + +- public static final Map a = Maps.newHashMap(); // Spigot - private -> public ++ public static final Map a = new LinkedHashMap(PaperConfig.regionFileCacheSize, 0.75f, true); // Spigot - private -> public, Paper - HashMap -> LinkedHashMap + + public static synchronized RegionFile a(File file, int i, int j) { + File file1 = new File(file, "region"); +@@ -0,0 +0,0 @@ public class RegionFileCache { + file1.mkdirs(); + } + +- if (RegionFileCache.a.size() >= 256) { +- a(); ++ if (RegionFileCache.a.size() >= PaperConfig.regionFileCacheSize) { // Paper ++ trimCache(); // Paper + } + + RegionFile regionfile1 = new RegionFile(file2); +@@ -0,0 +0,0 @@ public class RegionFileCache { + } + } + ++ // Paper Start ++ private static synchronized void trimCache() { ++ Iterator> itr = RegionFileCache.a.entrySet().iterator(); ++ int count = RegionFileCache.a.size() - PaperConfig.regionFileCacheSize; ++ while (count-- >= 0 && itr.hasNext()) { ++ try { ++ itr.next().getValue().c(); ++ } catch (IOException ioexception) { ++ ioexception.printStackTrace(); ++ ServerInternalException.reportInternalException(ioexception); ++ } ++ itr.remove(); ++ } ++ } ++ // Paper End ++ + public static synchronized void a() { + Iterator iterator = RegionFileCache.a.values().iterator(); + +-- \ No newline at end of file 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 6f86195255..52bd3a465d 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 8cf082d2e..34e79e7ca 100644 +index 1b944abea..ae4dd621d 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 8cf082d2e..34e79e7ca 100644 entity.extinguish(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 62fd2e503..b9472dddb 100644 +index d0ce6b363..56292fad9 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, IIBlockAccess, AutoClose diff --git a/Spigot-Server-Patches/Shoulder-Entities-Release-API.patch b/Spigot-Server-Patches/Shoulder-Entities-Release-API.patch index 951f156a4a..7240a0e090 100644 --- a/Spigot-Server-Patches/Shoulder-Entities-Release-API.patch +++ b/Spigot-Server-Patches/Shoulder-Entities-Release-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 0da76b268..85e617979 100644 +index 0486dee2c..f08c0ba60 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 { diff --git a/Spigot-Server-Patches/String-based-Action-Bar-API.patch b/Spigot-Server-Patches/String-based-Action-Bar-API.patch index 2615192eff..2de31c81a7 100644 --- a/Spigot-Server-Patches/String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/String-based-Action-Bar-API.patch @@ -62,7 +62,7 @@ index a4b0901cf..02940d697 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 7d4355439..3c1f02c18 100644 +index 7d4355439..1c8c364d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -72,7 +72,7 @@ index 7d4355439..3c1f02c18 100644 + @Override + public void sendActionBar(String message) { + if (getHandle().playerConnection == null || message == null || message.isEmpty()) return; -+ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new ChatComponentText(message), ChatMessageType.GAME_INFO)); ++ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new net.minecraft.server.ChatComponentText(message), net.minecraft.server.ChatMessageType.GAME_INFO)); + } + + @Override diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index 8f679539d7..f318dde502 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -137,7 +137,7 @@ index 000000000..4f624e39c +} diff --git a/src/main/java/co/aikar/timings/TimedChunkGenerator.java b/src/main/java/co/aikar/timings/TimedChunkGenerator.java new file mode 100644 -index 000000000..089154f62 +index 000000000..0bb63600f --- /dev/null +++ b/src/main/java/co/aikar/timings/TimedChunkGenerator.java @@ -0,0 +0,0 @@ @@ -167,11 +167,20 @@ index 000000000..089154f62 + +package co.aikar.timings; + ++import net.minecraft.server.BiomeBase; +import net.minecraft.server.BiomeBase.BiomeMeta; +import net.minecraft.server.BlockPosition; +import net.minecraft.server.Chunk; +import net.minecraft.server.EnumCreatureType; ++import net.minecraft.server.GeneratorSettings; ++import net.minecraft.server.IChunkAccess; ++import net.minecraft.server.RegionLimitedWorldAccess; ++import net.minecraft.server.StructureGenerator; ++import net.minecraft.server.StructureStart; +import net.minecraft.server.World; ++import net.minecraft.server.WorldChunkManager; ++import net.minecraft.server.WorldGenFeatureConfiguration; ++import net.minecraft.server.WorldGenStage; +import net.minecraft.server.WorldServer; +import org.bukkit.Location; +import org.bukkit.craftbukkit.generator.InternalChunkGenerator; @@ -181,6 +190,10 @@ index 000000000..089154f62 +import java.util.List; +import java.util.Random; + ++import it.unimi.dsi.fastutil.longs.Long2ObjectMap; ++import it.unimi.dsi.fastutil.longs.LongSet; ++ ++// TODO: timing handlers +public class TimedChunkGenerator extends InternalChunkGenerator { + private final WorldServer world; + private final InternalChunkGenerator timedGenerator; @@ -190,25 +203,6 @@ index 000000000..089154f62 + timedGenerator = gen; + } + -+ @Override -+ @Deprecated -+ public byte[] generate(org.bukkit.World world, Random random, int x, int z) { -+ return timedGenerator.generate(world, random, x, z); -+ } -+ -+ @Override -+ @Deprecated -+ public short[][] generateExtBlockSections(org.bukkit.World world, Random random, int x, int z, -+ BiomeGrid biomes) { -+ return timedGenerator.generateExtBlockSections(world, random, x, z, biomes); -+ } -+ -+ @Override -+ @Deprecated -+ public byte[][] generateBlockSections(org.bukkit.World world, Random random, int x, int z, -+ BiomeGrid biomes) { -+ return timedGenerator.generateBlockSections(world, random, x, z, biomes); -+ } + + @Override + public ChunkData generateChunkData(org.bukkit.World world, Random random, int x, int z, BiomeGrid biome) { @@ -229,47 +223,102 @@ index 000000000..089154f62 + public Location getFixedSpawnLocation(org.bukkit.World world, Random random) { + return timedGenerator.getFixedSpawnLocation(world, random); + } -+ ++ /* + @Override + public Chunk getOrCreateChunk(int i, int j) { + try (Timing ignored = world.timings.chunkGeneration.startTiming()) { + return timedGenerator.getOrCreateChunk(i, j); + } + } ++ */ + + @Override -+ public void recreateStructures(int i, int j) { -+ try (Timing ignored = world.timings.syncChunkLoadStructuresTimer.startTiming()) { -+ timedGenerator.recreateStructures(i, j); ++ public void createChunk(IChunkAccess ichunkaccess) { ++ try (Timing ignored = world.timings.chunkGeneration.startTiming()) { ++ timedGenerator.createChunk(ichunkaccess); + } + } + + @Override -+ public boolean a(Chunk chunk, int i, int j) { -+ return timedGenerator.a(chunk, i, j); ++ public void addFeatures(RegionLimitedWorldAccess regionlimitedworldaccess, WorldGenStage.Features worldgenstage_features) { ++ timedGenerator.addFeatures(regionlimitedworldaccess, worldgenstage_features); + } + + @Override -+ public List getMobsFor(EnumCreatureType enumcreaturetype, BlockPosition blockposition) { ++ public void addDecorations(RegionLimitedWorldAccess regionlimitedworldaccess) { ++ timedGenerator.addDecorations(regionlimitedworldaccess); ++ } ++ ++ @Override ++ public void addMobs(RegionLimitedWorldAccess regionlimitedworldaccess) { ++ timedGenerator.addMobs(regionlimitedworldaccess); ++ } ++ ++ @Override ++ public List getMobsFor(EnumCreatureType enumcreaturetype, BlockPosition blockposition) { + return timedGenerator.getMobsFor(enumcreaturetype, blockposition); + } + -+ @Override + @Nullable -+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, boolean flag) { -+ return timedGenerator.findNearestMapFeature(world, s, blockposition, flag); ++ @Override ++ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, int i) { ++ return timedGenerator.findNearestMapFeature(world, s, blockposition, i); + } + + @Override -+ public void recreateStructures(Chunk chunk, int i, int j) { -+ try (Timing ignored = world.timings.syncChunkLoadStructuresTimer.startTiming()) { -+ timedGenerator.recreateStructures(chunk, i, j); -+ } ++ public GeneratorSettings getSettings() { ++ return timedGenerator.getSettings(); + } + + @Override -+ public boolean a(World world, String s, BlockPosition blockPosition) { -+ return timedGenerator.a(world, s, blockPosition); ++ public int a(World world, boolean flag, boolean flag1) { ++ return timedGenerator.a(world, flag, flag1); ++ } ++ ++ @Override ++ public WorldChunkManager getWorldChunkManager() { ++ return timedGenerator.getWorldChunkManager(); ++ } ++ ++ @Override ++ public long getSeed() { ++ return timedGenerator.getSeed(); ++ } ++ ++ @Override ++ public int getSpawnHeight() { ++ return timedGenerator.getSpawnHeight(); ++ } ++ ++ @Override ++ public int e() { ++ return timedGenerator.e(); ++ } ++ ++ @Override ++ public World getWorld() { ++ return timedGenerator.getWorld(); ++ } ++ ++ @Override ++ public Long2ObjectMap getStructureCache(StructureGenerator structuregenerator) { ++ return timedGenerator.getStructureCache(structuregenerator); ++ } ++ ++ @Override ++ public Long2ObjectMap getStructureStartCache(StructureGenerator structuregenerator) { ++ return timedGenerator.getStructureStartCache(structuregenerator); ++ } ++ ++ @Nullable ++ @Override ++ public WorldGenFeatureConfiguration getFeatureConfiguration(BiomeBase biomebase, StructureGenerator structuregenerator) { ++ return timedGenerator.getFeatureConfiguration(biomebase, structuregenerator); ++ } ++ ++ @Override ++ public boolean canSpawnStructure(BiomeBase biomebase, StructureGenerator structuregenerator) { ++ return timedGenerator.canSpawnStructure(biomebase, structuregenerator); + } +} diff --git a/src/main/java/co/aikar/timings/WorldTimingsHandler.java b/src/main/java/co/aikar/timings/WorldTimingsHandler.java @@ -495,7 +544,7 @@ index 0296d3ef0..badfe86b2 100644 this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot } catch (IOException ioexception) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 42050f06d..e26860516 100644 +index 90d857105..3a0e52d88 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ @@ -989,7 +1038,7 @@ index ac6d8cc6e..d975c2ccf 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 749be86fe..c2eb3a58d 100644 +index 6f21b01a8..359aa3997 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.CraftingInventory; diff --git a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch index 0a757937f3..d46e251314 100644 --- a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch +++ b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index d80cd60ab..830b99cd7 100644 +index a33c55f41..4ca31c8eb 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 { 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 7d0e6e1126..a4cd188d03 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 4dd5fed25..1b4877868 100644 +index f9e225b73..9d2473317 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Use-Optimized-Collections.patch b/Spigot-Server-Patches/Use-Optimized-Collections.patch new file mode 100644 index 0000000000..377e5f0e89 --- /dev/null +++ b/Spigot-Server-Patches/Use-Optimized-Collections.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 30 Mar 2016 02:13:24 -0400 +Subject: [PATCH] Use Optimized Collections + +Swap out CraftBukkit LongObjectHashMap with Long2ObjectOpenHashMap +Swap out Integer key HashMap for a Int2ObjectOpenHashMap For ChunkProviderServer + +Amaranth, the creator of LongObjectHashMap, tested it vs fastutil and determined fastutil to be 3x faster +and could not create anything faster than fastutil. + +These collections are super fast as seen +http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/ + +diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java +index 2b27ae797..7191185ba 100644 +--- a/src/main/java/net/minecraft/server/DataWatcher.java ++++ b/src/main/java/net/minecraft/server/DataWatcher.java +@@ -0,0 +0,0 @@ import java.util.Map; + import java.util.concurrent.locks.ReadWriteLock; + import java.util.concurrent.locks.ReentrantReadWriteLock; + import javax.annotation.Nullable; ++import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; // Paper + import org.apache.commons.lang3.ObjectUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -0,0 +0,0 @@ public class DataWatcher { + private static final Logger a = LogManager.getLogger(); + private static final Map, Integer> b = Maps.newHashMap(); + private final Entity c; +- private final Map> d = Maps.newHashMap(); ++ private final Map> d = new Int2ObjectOpenHashMap<>(); // Paper + private final ReadWriteLock e = new ReentrantReadWriteLock(); + private boolean f = true; + private boolean g; +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index c42450365f..e52248a03e 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -113,7 +113,7 @@ index 000000000..685deaa0e +} diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java new file mode 100644 -index 000000000..626bfeec8 +index 000000000..d013bc047 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/TerminalHandler.java @@ -0,0 +0,0 @@ @@ -165,7 +165,7 @@ index 000000000..626bfeec8 + + line = line.trim(); + if (!line.isEmpty()) { -+ server.issueCommand(line, server); ++ server.issueCommand(line, server.getServerCommandListener()); + } + } + } catch (UserInterruptException e) { @@ -290,7 +290,7 @@ index f679c6bc2..39a8b1d69 100644 public KeyPair G() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 5e833c378..0f39fa49f 100644 +index 4c9ff8c29..9e403d625 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 { diff --git a/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch b/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch index 247575d049..3301260f19 100644 --- a/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch +++ b/Spigot-Server-Patches/Vehicle-Event-Cancellation-Changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vehicle Event Cancellation Changes diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index fecf29710..85e5a0a4c 100644 +index 88092d823..9af242380 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 diff --git a/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch b/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch new file mode 100644 index 0000000000..f663255132 --- /dev/null +++ b/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Zach Brown <1254957+zachbr@users.noreply.github.com> +Date: Sun, 10 Apr 2016 03:23:32 -0500 +Subject: [PATCH] Workaround for setting passengers on players + +SPIGOT-1915 & GH-114 + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index e71fc971d..3871f3100 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + return true; + } + ++ // Paper start - Ugly workaround for SPIGOT-1915 & GH-114 ++ @Override ++ public boolean setPassenger(org.bukkit.entity.Entity passenger) { ++ boolean wasSet = super.setPassenger(passenger); ++ if (wasSet) { ++ this.getHandle().playerConnection.sendPacket(new net.minecraft.server.PacketPlayOutMount(this.getHandle())); ++ } ++ return wasSet; ++ } ++ // Paper end ++ + @Override + public void setSneaking(boolean sneak) { + getHandle().setSneaking(sneak); +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch index dd4609df47..9cf1ce0076 100644 --- a/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch +++ b/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch @@ -15,7 +15,7 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 2255b8ccb..20bac8bc3 100644 +index 480b93aa0..9f7443ef0 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, ITickable { diff --git a/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch b/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch index 971cb80d7f..cea3044b1d 100644 --- a/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch +++ b/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch @@ -17,7 +17,7 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 20bac8bc3..4f9b4afdf 100644 +index 9f7443ef0..7e96c4eb4 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, ITickable { @@ -25,7 +25,7 @@ index 20bac8bc3..4f9b4afdf 100644 public EntityPlayer player; private int e; - private long f; private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER -+ private long f = getCurrentMillis(); private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER - set ping to delay initial ++ private long f = System.currentTimeMillis(); private void setLastPing(long lastPing) { this.f = lastPing;}; private long getLastPing() { return this.f;}; // Paper - OBFHELPER - set ping to delay initial private boolean g; private void setPendingPing(boolean isPending) { this.g = isPending;}; private boolean isPendingPing() { return this.g;}; // Paper - OBFHELPER private long h; private void setKeepAliveID(long keepAliveID) { this.h = keepAliveID;}; private long getKeepAliveID() {return this.h; }; // Paper - OBFHELPER // CraftBukkit start - multithreaded fields 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 27e107a5d6..ffa20a789a 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,7 +18,7 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d28d4a9a7..069ba83db 100644 +index d5c509733..b96511804 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, IIBlockAccess, AutoClose diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 3c54ffbbd3..255d8b25f4 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -70,7 +70,7 @@ for f in $files; do done import NBTList -import TileEntityTypes +import NBTBase set -e cd "$workdir/Spigot/Spigot-Server/" diff --git a/work/Bukkit b/work/Bukkit index 1d21dc022e..0bfac352ec 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 1d21dc022e7e6905ef64f54b165e7559dfa40ade +Subproject commit 0bfac352ece5fd5bca7b8476eb233579a0772fab diff --git a/work/CraftBukkit b/work/CraftBukkit index de019a35f0..6c944b2163 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit de019a35f009518bbabb3f39383e374cf8aae799 +Subproject commit 6c944b2163bdff312a1bccd01529124674aca7e4