From 05dfa62d3206c67bbf4d4cc26d11631b46ab7825 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 26 Aug 2018 14:11:49 -0400 Subject: [PATCH] Paper 1.13.1 Update Updated Upstream (Bukkit/CraftBukkit/Spigot) Bukkit Changes: 2dcc44dc SPIGOT-4307: Fix hacky API for banners on shields e0fc6572 SPIGOT-4309: Add "forced" display of particles efeeab2f Add index to README.md for easier navigation f502bc6f Update to Minecraft 1.13.1 CraftBukkit Changes: d0bb0a1d Fix some tests randomly failing 997d378d Fix client stall in specific teleportation scenarios b3dc2366 SPIGOT-4307: Fix hacky API for banners on shields 2a271162 SPIGOT-4301: Fix more invalid enchants 5d0d83bb SPIGOT-4309: Add "forced" display of particles a6772578 Add additional tests for CraftBlockData ce1af0c3 Update to Minecraft 1.13.1 Spigot Changes: 2440e189 Rebuild patches 4ecffced Update to Minecraft 1.13.1 --- ...ile-Entities-from-a-chunk-without-sn.patch | 2 +- ...dd-SentientNPC-Interface-to-Entities.patch | 111 ----- Spigot-API-Patches/Add-TNTPrimeEvent.patch | 2 +- .../Add-World.getEntity-UUID-API.patch | 2 +- ...dd-an-asterisk-to-legacy-API-plugins.patch | 6 +- .../Add-async-chunk-load-API.patch | 2 +- .../Add-hand-to-bucket-events.patch | 6 +- ...dd-source-block-to-BlockPhysicsEvent.patch | 2 +- ...Blocks-to-be-accessed-via-a-long-key.patch | 2 +- ...Allow-disabling-armour-stand-ticking.patch | 2 +- Spigot-API-Patches/AnvilDamageEvent.patch | 2 +- ...hots-for-Timings-Tile-Entity-reports.patch | 2 +- Spigot-API-Patches/Entity-getChunk-API.patch | 2 +- ...ent-consumeArrow-and-getArrowItem-AP.patch | 2 +- .../EntityTransformedEvent.patch | 2 +- .../Expand-ArmorStand-API.patch | 2 +- .../Expand-Explosions-API.patch | 2 +- .../Expand-Location-Manipulation-API.patch | 2 +- ...ld.spawnParticle-API-and-add-Builder.patch | 6 +- ...leHitEvent-to-include-the-BlockFace-.patch | 2 +- ...PI-additions-for-quantity-flags-lore.patch | 2 +- Spigot-API-Patches/LootTable-API.patch | 109 +---- .../Make-EnderDragon-extend-Mob.patch | 6 +- Spigot-API-Patches/POM-changes.patch | 4 +- .../PlayerElytraBoostEvent.patch | 2 +- .../PlayerLaunchProjectileEvent.patch | 2 +- ...vide-Chunk-Coordinates-as-a-Long-API.patch | 4 +- Spigot-API-Patches/RangedEntity-API.patch | 5 +- .../SkeletonHorse-Additions.patch | 4 +- .../Slime-Pathfinder-Events.patch | 14 +- ...ic-1.13-versioning-branch-build-name.patch | 2 +- Spigot-API-Patches/Vex-getSummoner-API.patch | 12 +- Spigot-API-Patches/isChunkGenerated-API.patch | 4 +- ...-get-a-BlockState-without-a-snapshot.patch | 4 +- .../Ability-to-apply-mending-to-XP-API.patch | 8 +- ...e-PlayerProfile-in-AsyncPreLoginEven.patch | 2 +- ...ile-Entities-from-a-chunk-without-sn.patch | 2 +- .../Activation-Range-Improvements.patch | 12 +- ...to-control-if-armour-stands-can-move.patch | 2 +- .../Add-ArmorStand-Item-Meta.patch | 12 +- ...ies-option-to-debug-dupe-uuid-issues.patch | 8 +- ...dd-Early-Warning-Feature-to-WatchDog.patch | 14 +- .../Add-EntityZapEvent.patch | 6 +- ...-MinecraftKey-Information-to-Objects.patch | 12 +- .../Add-PlayerArmorChangeEvent.patch | 2 +- .../Add-PlayerJumpEvent.patch | 4 +- .../Add-PlayerUseUnknownEntityEvent.patch | 2 +- .../Add-ProjectileCollideEvent.patch | 6 +- Spigot-Server-Patches/Add-TNTPrimeEvent.patch | 26 +- .../Add-UnknownCommandEvent.patch | 2 +- .../Add-World-Util-Methods.patch | 30 +- ...-to-configure-frosted_ice-properties.patch | 10 +- .../Add-async-chunk-load-API.patch | 6 +- ...to-disable-ender-dragon-legacy-check.patch | 2 +- ...dd-configurable-portal-search-radius.patch | 6 +- ...n-option-to-prevent-player-names-fro.patch | 2 +- .../Add-exception-reporting-event.patch | 91 ++-- .../Add-hand-to-bucket-events.patch | 12 +- ...d-method-to-open-already-placed-sign.patch | 2 +- ...rages-for-getTileEntity-in-order-to-.patch | 2 +- ...ke-parrots-stay-on-shoulders-despite.patch | 6 +- ...-option-to-remove-invalid-statistics.patch | 12 +- .../Add-player-view-distance-API.patch | 4 +- .../Add-setPlayerProfile-API-for-Skulls.patch | 4 +- ...setting-for-proxy-online-mode-status.patch | 4 +- ...dd-some-Debug-to-Chunk-Entity-slices.patch | 4 +- ...dd-source-block-to-BlockPhysicsEvent.patch | 4 +- .../Add-source-to-PlayerExpChangeEvent.patch | 4 +- .../Add-velocity-warnings.patch | 2 +- ...chunks-are-slime-spawn-chunks-toggle.patch | 12 +- .../Allow-Reloading-of-Command-Aliases.patch | 2 +- ...llow-Reloading-of-Custom-Permissions.patch | 2 +- ...Allow-disabling-armour-stand-ticking.patch | 10 +- .../Allow-for-toggling-of-spawn-chunks.patch | 6 +- ...Item-entities-with-World.spawnEntity.patch | 2 +- ...-a-custom-authentication-servers-dow.patch | 2 +- ...cess-chunk-registration-after-moving.patch | 6 +- ...rocess-chunk-removal-in-removeEntity.patch | 6 +- Spigot-Server-Patches/Anti-Xray.patch | 102 ++-- Spigot-Server-Patches/AnvilDamageEvent.patch | 4 +- .../AsyncTabCompleteEvent.patch | 21 +- .../Auto-Save-Improvements.patch | 71 ++- ...uto-fix-bad-Y-levels-on-player-login.patch | 2 +- ...ups-for-Entity-TileEntity-Current-Ch.patch | 14 +- ...blocking-on-Network-Manager-creation.patch | 2 +- ...opper-searches-if-there-are-no-items.patch | 2 +- ...e-if-stack-size-above-max-stack-size.patch | 2 +- .../Basic-PlayerProfile-API.patch | 10 +- .../Block-Enderpearl-Travel-Exploit.patch | 2 +- ...player-logins-during-server-shutdown.patch | 2 +- .../Bound-Treasure-Maps-to-World-Border.patch | 6 +- ...nd-make-tab-spam-limits-configurable.patch | 4 +- .../Cache-World-Entity-Type-counts.patch | 28 +- .../Cache-user-authenticator-threads.patch | 6 +- ...ServerListPingEvent-for-legacy-pings.patch | 6 +- ...l-PortalCreateEvent-for-exit-portals.patch | 4 +- .../Cap-Entity-Collisions.patch | 6 +- ...entation-of-tile-entity-removal-list.patch | 22 +- ...e-before-converting-and-renaming-pla.patch | 2 +- .../Chunk-Save-Reattempt.patch | 58 ++- .../Chunk-Save-Stats-Debug-Option.patch | 87 ++-- .../Chunk-registration-fixes.patch | 4 +- .../Chunk-save-queue-improvements.patch | 87 ++-- .../Complete-resource-pack-API.patch | 2 +- ...Allowance-of-Permanent-Chunk-Loaders.patch | 36 -- ...le-Alternative-LootPool-Luck-Formula.patch | 14 +- .../Configurable-Bed-Search-Radius.patch | 4 +- ...figurable-Cartographer-Treasure-Maps.patch | 6 +- .../Configurable-Chunk-Inhabited-Timer.patch | 17 +- ...urable-Chunks-Sends-per-Tick-setting.patch | 2 +- .../Configurable-Grass-Spread-Tick-Rate.patch | 4 +- ...le-Keep-Spawn-Loaded-range-per-world.patch | 16 +- ...Configurable-Max-Chunk-Gens-per-Tick.patch | 10 +- ...urable-Non-Player-Arrow-Despawn-Rate.patch | 2 +- .../Configurable-Player-Collision.patch | 17 +- .../Configurable-RCON-IP-address.patch | 4 +- ...figurable-container-update-tick-rate.patch | 2 +- .../Configurable-end-credits.patch | 20 +- .../Configurable-flying-kick-messages.patch | 2 +- ...ble-inter-world-teleportation-safety.patch | 6 +- ...onfigurable-packet-in-spam-threshold.patch | 2 +- ...le-spawn-chances-for-skeleton-horses.patch | 17 +- ...le-speed-for-water-flowing-over-lava.patch | 34 +- ...urable-sprint-interruption-on-attack.patch | 4 +- ...nfigurable-top-of-nether-void-damage.patch | 6 +- .../Custom-replacement-for-eaten-items.patch | 2 +- ...ading-permissions.yml-before-plugins.patch | 2 +- ...unk-Unloads-based-on-Player-Movement.patch | 54 +-- ...tect-and-repair-corrupt-Region-Files.patch | 2 +- ...le-Explicit-Network-Manager-Flushing.patch | 2 +- ...oreboards-for-non-players-by-default.patch | 4 +- .../Disable-Vanilla-Chunk-GC.patch | 7 +- .../Disable-explosion-knockback.patch | 28 +- .../Disable-spigot-tick-limiters.patch | 6 +- .../Do-not-let-armorstands-drown.patch | 8 +- .../Do-not-load-chunks-for-light-checks.patch | 4 +- .../Do-not-load-chunks-for-pathfinding.patch | 2 +- ...llow-entities-to-ride-themselves-572.patch | 2 +- ...on-t-call-getItemMeta-on-hasItemMeta.patch | 4 +- ...ge-the-Entity-Random-seed-for-squids.patch | 2 +- .../Don-t-let-fishinghooks-use-portals.patch | 6 +- ...Chunks-from-Hoppers-and-other-things.patch | 2 +- ...load-chunks-for-villager-door-checks.patch | 2 +- ...spawn-if-entity-is-in-a-chunk-schedu.patch | 4 +- .../Don-t-save-Proto-Chunks.patch | 16 +- ...am-reload-spawn-chunks-in-nether-end.patch | 22 +- .../Don-t-teleport-dead-entities.patch | 4 +- ...ck-and-tnt-entities-at-the-specified.patch | 8 +- .../Duplicate-UUID-Resolve-Option.patch | 26 +- .../EnderDragon-Events.patch | 2 +- .../Enderman.teleportRandomly.patch | 8 +- .../EndermanAttackPlayerEvent.patch | 2 +- .../EndermanEscapeEvent.patch | 12 +- .../Enforce-Sync-Chunk-Unloads.patch | 4 +- .../Enforce-Sync-Player-Saves.patch | 2 +- .../Ensure-Chunks-never-ever-load-async.patch | 4 +- ...e-always-loaded-on-hard-position-set.patch | 2 +- .../Ensure-commands-are-not-ran-async.patch | 4 +- ...Entity-AddTo-RemoveFrom-World-Events.patch | 6 +- Spigot-Server-Patches/Entity-Origin-API.patch | 14 +- .../Entity-Tracking-Improvements.patch | 6 +- .../Entity-add-to-world-fixes.patch | 38 +- .../Entity-fromMobSpawner.patch | 4 +- ...ent-consumeArrow-and-getArrowItem-AP.patch | 8 +- .../EntityTransformedEvent.patch | 8 +- .../Expand-Explosions-API.patch | 2 +- ...ld.spawnParticle-API-and-add-Builder.patch | 34 +- .../ExperienceOrbMergeEvent.patch | 4 +- ...PI-for-Reason-Source-Triggering-play.patch | 20 +- ...nt-protocol-version-and-virtual-host.patch | 6 +- .../Expose-server-CommandMap.patch | 2 +- .../Extend-Player-Interact-cancellation.patch | 2 +- ...r-redstone-torch-rapid-clock-removal.patch | 2 +- ...a-from-ArmorStand-and-SpawnEgg-items.patch | 4 +- ...e-EntityShootBowEvent-for-Illusioner.patch | 2 +- .../Fix-AIOOBE-in-inventory-handling.patch | 2 +- .../Fix-Anvil-Level-sync-to-client.patch | 4 +- ...g-BlockPlaceEvent-triggering-physics.patch | 4 +- .../Fix-Chunk-Unload-Queue-Issues.patch | 36 -- .../Fix-Double-World-Add-issues.patch | 6 +- .../Fix-MC-117075-TE-Unload-Lag-Spike.patch | 4 +- Spigot-Server-Patches/Fix-MC-124320.patch | 6 +- .../Fix-NPE-Potential-in-CraftBanner.patch | 20 - .../Fix-Old-Sign-Conversion.patch | 6 +- .../Fix-block-break-desync.patch | 2 +- ...ient-rendering-skulls-from-same-user.patch | 12 +- ...-allowed-colored-signs-to-be-created.patch | 2 +- ...-explosions-processing-dead-entities.patch | 2 +- .../Flag-to-disable-the-channel-limit.patch | 2 +- .../Further-improve-server-tick-loop.patch | 46 +- .../Handle-Item-Meta-Inconsistencies.patch | 8 +- ...n-prefixes-using-Log4J-configuration.patch | 8 +- ...ead-Entities-in-entityList-iteration.patch | 16 +- ...plement-EntityKnockbackByEntityEvent.patch | 2 +- ...lement-EntityTeleportEndGatewayEvent.patch | 2 +- .../Implement-Expanded-ArmorStand-API.patch | 8 +- .../Implement-PlayerLocaleChangeEvent.patch | 14 +- .../Implement-World.getEntity-UUID-API.patch | 2 +- ...mplement-ensureServerConversions-API.patch | 2 +- ...nt-extended-PaperServerListPingEvent.patch | 30 +- .../Implement-getI18NDisplayName.patch | 4 +- ...item-frames-performance-and-bug-fixe.patch | 28 +- ...leHitEvent-to-include-the-BlockFace-.patch | 2 +- .../Include-Log4J2-SLF4J-implementation.patch | 6 +- .../InventoryCloseEvent-Reason-API.patch | 16 +- .../Item-canEntityPickup.patch | 4 +- .../ItemStack-getMaxItemUseDuration.patch | 4 +- Spigot-Server-Patches/Lighting-Queue.patch | 22 +- ...ivingEntity-Hand-Raised-Item-Use-API.patch | 4 +- .../LivingEntity-setKiller.patch | 2 +- ...Load-version-history-at-server-start.patch | 2 +- ...-API-Replenishable-Lootables-Feature.patch | 438 +++++++++--------- .../MC-111480-Start-Entity-ID-s-at-1.patch | 2 +- ...6-Experience-should-save-as-Integers.patch | 2 +- Spigot-Server-Patches/MC-Dev-fixes.patch | 238 +++++++++- Spigot-Server-Patches/MC-Utils.patch | 271 ++--------- .../Make-EnderDragon-implement-Mob.patch | 2 +- ...ke-legacy-ping-handler-more-reliable.patch | 2 +- ...-max-squid-spawn-height-configurable.patch | 6 +- ...Make-player-data-saving-configurable.patch | 2 +- ...portation-adjustment-math-more-accur.patch | 8 +- ...e-shield-blocking-delay-configurable.patch | 6 +- ...more-aggressive-in-the-chunk-unload-.patch | 2 +- ...-anytime-entities-change-to-guarante.patch | 2 +- ...mative-vehicle-moved-wrongly-message.patch | 2 +- ...awns-should-honor-nametags-and-leash.patch | 2 +- ...on-Wither-Death-sounds-to-same-world.patch | 4 +- .../Optimise-removeQueue.patch | 27 +- ...ptimize-BlockPosition-helper-methods.patch | 2 +- .../Optimize-CraftBlockData-Creation.patch | 4 +- Spigot-Server-Patches/Optimize-Hoppers.patch | 22 +- .../Optimize-ItemStack.isEmpty.patch | 2 +- .../Optimize-Network-Queue.patch | 20 - .../Optimize-Region-File-Cache.patch | 8 +- .../Optimize-RegistryID.c.patch | 2 +- .../Optimize-RegistryMaterials.patch | 34 ++ .../Optimize-UserCache-Thread-Safe.patch | 2 +- ...imize-World.isLoaded-BlockPosition-Z.patch | 6 +- .../Optimize-explosions.patch | 12 +- ...Location-getType-and-getBlockData-fo.patch | 37 +- .../Optimized-Light-Level-Comparisons.patch | 18 +- ...-maximum-exp-value-when-merging-orbs.patch | 6 +- ...sable-BlockPhysicsEvent-for-Redstone.patch | 12 +- ...t-armor-stands-from-doing-entity-loo.patch | 14 +- ...tion-to-remove-corrupt-tile-entities.patch | 8 +- ...nilla-per-world-scoreboard-coloring-.patch | 6 +- .../Optional-TNT-doesn-t-move-in-water.patch | 4 +- Spigot-Server-Patches/POM-Changes.patch | 7 +- .../Paper-config-files.patch | 28 +- .../Pass-World-to-Tile-Entity-Snapshots.patch | 2 +- .../Pass-world-to-Village-creation.patch | 4 +- .../Player-Tab-List-and-Title-APIs.patch | 44 +- .../Player-affects-spawning-API.patch | 20 +- .../Player.setPlayerProfile-API.patch | 6 +- ...PlayerAdvancementCriterionGrantEvent.patch | 2 +- .../PlayerAttemptPickupItemEvent.patch | 2 +- .../PlayerLaunchProjectileEvent.patch | 53 ++- .../PlayerNaturallySpawnCreaturesEvent.patch | 2 +- .../PlayerPickupExperienceEvent.patch | 2 +- ...PlayerPickupItemEvent-setFlyAtPlayer.patch | 2 +- .../PlayerReadyArrowEvent.patch | 2 +- .../PlayerTeleportEndGatewayEvent.patch | 2 +- .../PreCreatureSpawnEvent.patch | 4 +- ...vent-Auto-Save-if-Save-Queue-is-full.patch | 42 +- ...sted-Ice-from-loading-holding-chunks.patch | 2 +- ...vent-Pathfinding-out-of-World-Border.patch | 6 +- ...revent-Saving-Bad-entities-to-chunks.patch | 2 +- ...rom-being-processed-when-the-player-.patch | 2 +- ...event-tile-entity-and-entity-crashes.patch | 10 +- ...ils-when-failing-to-save-player-data.patch | 2 +- .../ProfileWhitelistVerifyEvent.patch | 4 +- .../Properly-fix-item-duplication-bug.patch | 4 +- ...le-async-calls-to-restart-the-server.patch | 24 +- ...emove-entities-on-dimension-teleport.patch | 4 +- ...rovide-E-TE-Chunk-count-stat-methods.patch | 2 +- ...o-use-a-versioned-world-folder-for-t.patch | 35 +- ...nilla-entity-warnings-for-duplicates.patch | 2 +- ...ers-that-dismount-from-other-players.patch | 2 +- ...nventory-when-cancelling-PlayerInter.patch | 2 +- .../Remove-Metadata-on-reload.patch | 2 +- ...ve-invalid-mob-spawner-tile-entities.patch | 2 +- ...Remove-unused-World-Tile-Entity-List.patch | 18 +- ...imer-when-spawner-event-is-cancelled.patch | 2 +- ...egionFileCache-and-make-configurable.patch | 4 +- ...dEffects-only-to-players-who-can-see.patch | 6 +- ...ets-from-world-player-list-not-serve.patch | 24 +- .../Shoulder-Entities-Release-API.patch | 4 +- ...ient-crashes-server-lists-and-Mojang.patch | 4 +- .../SkeletonHorse-Additions.patch | 10 +- .../Slime-Pathfinder-Events.patch | 6 +- .../Speedup-BlockPos-by-fixing-inlining.patch | 4 +- ...ts-for-each-Entity-Block-Entity-Type.patch | 2 +- ...to-current-Chunk-for-Entity-and-Bloc.patch | 26 +- .../String-based-Action-Bar-API.patch | 6 +- ...ad-Safe-Iteration-of-Chunk-Scheduler.patch | 45 -- Spigot-Server-Patches/Timings-v2.patch | 364 ++++----------- ...r-crits-helps-mitigate-hacked-client.patch | 4 +- ...ed-flag-on-cancel-of-Explosion-Event.patch | 4 +- .../Use-ConcurrentHashMap-in-JsonList.patch | 2 +- ...ams-to-redirect-System.out-err-to-lo.patch | 12 +- ...oleAppender-for-console-improvements.patch | 50 +- .../Use-a-Queue-for-Queueing-Commands.patch | 10 +- .../Use-asynchronous-Log4j-2-loggers.patch | 9 +- .../Vanished-players-don-t-have-rights.patch | 18 +- .../Vex-getSummoner-API.patch | 2 +- .../WitchConsumePotionEvent.patch | 2 +- .../WitchReadyPotionEvent.patch | 2 +- .../WitchThrowPotionEvent.patch | 2 +- ...nd-for-setting-passengers-on-players.patch | 2 +- ...rld-EntityHuman-Lookup-Optimizations.patch | 22 +- ...-more-information-to-Entity.toString.patch | 2 +- .../getPlayerUniqueId-API.patch | 2 +- ...th-absorb-values-and-repair-bad-data.patch | 4 +- .../handle-PacketPlayInKeepAlive-async.patch | 6 +- .../isChunkGenerated-API.patch | 21 +- ...urable-option-to-disable-creeper-lin.patch | 6 +- ...-possibility-for-getServer-singleton.patch | 2 +- ...air-bad-rcon.ip-settings-temporarily.patch | 22 - ...rt-serverside-behavior-of-keepalives.patch | 2 +- ...e-implementations-for-captured-block.patch | 4 +- work/BuildData | 2 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 324 files changed, 1984 insertions(+), 2579 deletions(-) delete mode 100644 Spigot-API-Patches/Add-SentientNPC-Interface-to-Entities.patch delete mode 100644 Spigot-Server-Patches/Configurable-Allowance-of-Permanent-Chunk-Loaders.patch delete mode 100644 Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch delete mode 100644 Spigot-Server-Patches/Fix-NPE-Potential-in-CraftBanner.patch delete mode 100644 Spigot-Server-Patches/Optimize-Network-Queue.patch create mode 100644 Spigot-Server-Patches/Optimize-RegistryMaterials.patch delete mode 100644 Spigot-Server-Patches/Thread-Safe-Iteration-of-Chunk-Scheduler.patch delete mode 100644 Spigot-Server-Patches/repair-bad-rcon.ip-settings-temporarily.patch diff --git a/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index ac98f63d6b..76fb048bdd 100644 --- a/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-API-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java -index c75bce07..dc847340 100644 +index c75bce07a..dc847340f 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -0,0 +0,0 @@ public interface Chunk { diff --git a/Spigot-API-Patches/Add-SentientNPC-Interface-to-Entities.patch b/Spigot-API-Patches/Add-SentientNPC-Interface-to-Entities.patch deleted file mode 100644 index e6353aa7b9..0000000000 --- a/Spigot-API-Patches/Add-SentientNPC-Interface-to-Entities.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 16 Jun 2018 13:41:00 -0400 -Subject: [PATCH] Add SentientNPC Interface to Entities - -Used to determine ACTUAL Living NPC's. Spigot mistakenly inversed the conditions for LivingEntity, and -used LivingEntity for Insentient Entities, and named the actual EntityLiving class EntityInsentient. - -This should of all been inversed on the implementation side. To make matters worse, Spigot never -exposed the differentiator that there are entities with AI that are not sentient/alive such as -Armor stands and Players are the only things that do not implement the REAL EntityLiving class (named Insentient internally) - -This interface lets you identify NPC entities capable of sentience, and able to move about and react to the world. - -diff --git a/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java b/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java -new file mode 100644 -index 000000000..cb8de4629 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/entity/SentientNPC.java -@@ -0,0 +0,0 @@ -+/* -+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+package com.destroystokyo.paper.entity; -+ -+import org.bukkit.entity.Mob; -+ -+ -+/** -+ * @deprecated Upstream has added this API. Use {@link Mob}. Will be removed in 1.13.1 -+ */ -+@Deprecated -+public interface SentientNPC extends Mob { -+} -diff --git a/src/main/java/org/bukkit/entity/Ambient.java b/src/main/java/org/bukkit/entity/Ambient.java -index 613830a74..4ad71c825 100644 ---- a/src/main/java/org/bukkit/entity/Ambient.java -+++ b/src/main/java/org/bukkit/entity/Ambient.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - /** - * Represents an ambient mob - */ --public interface Ambient extends Mob {} -+public interface Ambient extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper {} -diff --git a/src/main/java/org/bukkit/entity/Creature.java b/src/main/java/org/bukkit/entity/Creature.java -index 6c9c5e85e..c796c4dc2 100644 ---- a/src/main/java/org/bukkit/entity/Creature.java -+++ b/src/main/java/org/bukkit/entity/Creature.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - * Represents a Creature. Creatures are non-intelligent monsters or animals - * which have very simple abilities. - */ --public interface Creature extends Mob {} -+public interface Creature extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper -diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java -index 4ea0e44e7..8f200e6c4 100644 ---- a/src/main/java/org/bukkit/entity/EnderDragon.java -+++ b/src/main/java/org/bukkit/entity/EnderDragon.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - /** - * Represents an Ender Dragon - */ --public interface EnderDragon extends ComplexLivingEntity { -+public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper - - /** - * Represents a phase or action that an Ender Dragon can perform. -diff --git a/src/main/java/org/bukkit/entity/Flying.java b/src/main/java/org/bukkit/entity/Flying.java -index 580ce18bf..45840ee1f 100644 ---- a/src/main/java/org/bukkit/entity/Flying.java -+++ b/src/main/java/org/bukkit/entity/Flying.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - /** - * Represents a Flying Entity. - */ --public interface Flying extends Mob {} -+public interface Flying extends Mob, com.destroystokyo.paper.entity.SentientNPC {} // Paper -diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java -index 1119e26e2..46d03d29d 100644 ---- a/src/main/java/org/bukkit/entity/Slime.java -+++ b/src/main/java/org/bukkit/entity/Slime.java -@@ -0,0 +0,0 @@ package org.bukkit.entity; - /** - * Represents a Slime. - */ --public interface Slime extends Mob { -+public interface Slime extends Mob, com.destroystokyo.paper.entity.SentientNPC { // Paper - - /** - * @return The size of the slime --- \ No newline at end of file diff --git a/Spigot-API-Patches/Add-TNTPrimeEvent.patch b/Spigot-API-Patches/Add-TNTPrimeEvent.patch index e7ec2b09ff..e77176f7ed 100644 --- a/Spigot-API-Patches/Add-TNTPrimeEvent.patch +++ b/Spigot-API-Patches/Add-TNTPrimeEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java new file mode 100644 -index 00000000..2ae8826b +index 000000000..2ae8826bb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.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 e6ec1d1cb9..e0b0d98e8c 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 ef3a2f2d2..860e4374f 100644 +index 1df38ba9d..5e6cb56ab 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-an-asterisk-to-legacy-API-plugins.patch b/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch index 523b05ea0c..b506cfa4da 100644 --- a/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch +++ b/Spigot-API-Patches/Add-an-asterisk-to-legacy-API-plugins.patch @@ -7,7 +7,7 @@ Not here to name and shame, only so server admins can be aware of which plugins have and haven't been updated. diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java -index 33cad901..aff1d8e9 100644 +index 33cad9015..aff1d8e9b 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -0,0 +0,0 @@ public interface UnsafeValues { @@ -22,7 +22,7 @@ index 33cad901..aff1d8e9 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index b1d384e8..72c0c0bc 100644 +index b1d384e82..72c0c0bc6 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -0,0 +0,0 @@ public class PluginsCommand extends BukkitCommand { @@ -42,7 +42,7 @@ index b1d384e8..72c0c0bc 100644 StringBuilder pluginList = new StringBuilder(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 3cff01b6..2b9aad0a 100644 +index 3cff01b6b..2b9aad0a7 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java @@ -0,0 +0,0 @@ public final class JavaPluginLoader implements PluginLoader { diff --git a/Spigot-API-Patches/Add-async-chunk-load-API.patch b/Spigot-API-Patches/Add-async-chunk-load-API.patch index d55083c276..149094080f 100644 --- a/Spigot-API-Patches/Add-async-chunk-load-API.patch +++ b/Spigot-API-Patches/Add-async-chunk-load-API.patch @@ -5,7 +5,7 @@ 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 550c26be..121033e9 100644 +index 5e6cb56ab..dbbcfec99 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-hand-to-bucket-events.patch b/Spigot-API-Patches/Add-hand-to-bucket-events.patch index d402920ad1..7a76b8fb74 100644 --- a/Spigot-API-Patches/Add-hand-to-bucket-events.patch +++ b/Spigot-API-Patches/Add-hand-to-bucket-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java -index 8fb121a9..7b9596f3 100644 +index 8fb121a91..7b9596f30 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java @@ -0,0 +0,0 @@ import org.bukkit.block.Block; @@ -30,7 +30,7 @@ index 8fb121a9..7b9596f3 100644 public HandlerList getHandlers() { return handlers; diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java -index 56584687..3dbe428b 100644 +index 56584687f..3dbe428ba 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java @@ -0,0 +0,0 @@ import org.bukkit.block.Block; @@ -82,7 +82,7 @@ index 56584687..3dbe428b 100644 return cancelled; } diff --git a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java -index 94e042a3..884b9240 100644 +index 94e042a36..884b9240b 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java @@ -0,0 +0,0 @@ import org.bukkit.block.Block; diff --git a/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch b/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch index 7f0ccff159..a154a7109c 100644 --- a/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch +++ b/Spigot-API-Patches/Add-source-block-to-BlockPhysicsEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add source block to BlockPhysicsEvent diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java -index 5e47eabe..9d9e4712 100644 +index 5e47eabe8..9d9e4712b 100644 --- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java @@ -0,0 +0,0 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { diff --git a/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch b/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch index 564be20e1b..e045bfe492 100644 --- a/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch +++ b/Spigot-API-Patches/Allow-Blocks-to-be-accessed-via-a-long-key.patch @@ -49,7 +49,7 @@ index 8dcb15fb8..7e1ee875e 100644 * @return A new location where X/Y/Z are the center of the block */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index f84f151ad..3170a0746 100644 +index 724088ec0..d4bfbad33 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/Allow-disabling-armour-stand-ticking.patch b/Spigot-API-Patches/Allow-disabling-armour-stand-ticking.patch index 67092293db..27c13d816d 100644 --- a/Spigot-API-Patches/Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-API-Patches/Allow-disabling-armour-stand-ticking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 099da6ce..859f166f 100644 +index 099da6ce1..859f166fb 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -0,0 +0,0 @@ public interface ArmorStand extends LivingEntity { diff --git a/Spigot-API-Patches/AnvilDamageEvent.patch b/Spigot-API-Patches/AnvilDamageEvent.patch index d6d5ec79e7..76879f6245 100644 --- a/Spigot-API-Patches/AnvilDamageEvent.patch +++ b/Spigot-API-Patches/AnvilDamageEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] AnvilDamageEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java new file mode 100644 -index 00000000..fd3c5c02 +index 000000000..fd3c5c02e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch b/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch index 0b94382126..4fa0d7435e 100644 --- a/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch +++ b/Spigot-API-Patches/Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't use snapshots for Timings Tile Entity reports diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java -index c2c2fb83..769facd8 100644 +index c2c2fb838..769facd80 100644 --- a/src/main/java/co/aikar/timings/TimingHistory.java +++ b/src/main/java/co/aikar/timings/TimingHistory.java @@ -0,0 +0,0 @@ public class TimingHistory { diff --git a/Spigot-API-Patches/Entity-getChunk-API.patch b/Spigot-API-Patches/Entity-getChunk-API.patch index 49350248ff..f7a2f5f923 100644 --- a/Spigot-API-Patches/Entity-getChunk-API.patch +++ b/Spigot-API-Patches/Entity-getChunk-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API Get the chunk the entity is currently registered to diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 4548c95b..573a6918 100644 +index 4548c95b9..573a69184 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 51fe0a8034..319cd54c66 100644 --- a/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-API-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java -index f8c91a13..c9eb75aa 100644 +index f8c91a13b..c9eb75aa7 100644 --- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java @@ -0,0 +0,0 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { diff --git a/Spigot-API-Patches/EntityTransformedEvent.patch b/Spigot-API-Patches/EntityTransformedEvent.patch index 65681a00c5..8e824fcfe4 100644 --- a/Spigot-API-Patches/EntityTransformedEvent.patch +++ b/Spigot-API-Patches/EntityTransformedEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityTransformedEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java new file mode 100644 -index 00000000..d9e5cab9 +index 000000000..d9e5cab95 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Expand-ArmorStand-API.patch b/Spigot-API-Patches/Expand-ArmorStand-API.patch index 8f4cc2b8e7..de79323a33 100644 --- a/Spigot-API-Patches/Expand-ArmorStand-API.patch +++ b/Spigot-API-Patches/Expand-ArmorStand-API.patch @@ -8,7 +8,7 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 859f166f..eda4873d 100644 +index 859f166fb..eda4873d5 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Expand-Explosions-API.patch b/Spigot-API-Patches/Expand-Explosions-API.patch index cbc689f9fc..8a26fa4ae0 100644 --- a/Spigot-API-Patches/Expand-Explosions-API.patch +++ b/Spigot-API-Patches/Expand-Explosions-API.patch @@ -98,7 +98,7 @@ index 162a76e8b..056a4d6bb 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 5630c624a..ef3a2f2d2 100644 +index a8d97c519..1df38ba9d 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-Location-Manipulation-API.patch b/Spigot-API-Patches/Expand-Location-Manipulation-API.patch index 871d24565d..d6fc5e59de 100644 --- a/Spigot-API-Patches/Expand-Location-Manipulation-API.patch +++ b/Spigot-API-Patches/Expand-Location-Manipulation-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Expand Location Manipulation API Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z); diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 056a4d6b..8dcb15fb 100644 +index 056a4d6bb..8dcb15fb8 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { 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 4d80cd3c5e..7f1685457b 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 @@ -464,7 +464,7 @@ index 4d0acaf5b..255efab76 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 f9d8b14c6..5630c624a 100644 +index 0fb55b071..a8d97c519 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 { @@ -524,6 +524,6 @@ index f9d8b14c6..5630c624a 100644 + // Paper end + - // Spigot start - public class Spigot + /** + * Spawns the particle (the number of times specified by count) -- \ No newline at end of file diff --git a/Spigot-API-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-API-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index b2f0b6575b..0e9260db4f 100644 --- a/Spigot-API-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-API-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the diff --git a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java -index 35f4148b..db105e76 100644 +index 35f4148bb..db105e764 100644 --- a/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java +++ b/src/main/java/org/bukkit/event/entity/ProjectileHitEvent.java @@ -0,0 +0,0 @@ public class ProjectileHitEvent extends EntityEvent { 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 4019763da0..3c56200ba5 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 972b945d..526ff166 100644 +index 972b945d3..526ff1666 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/LootTable-API.patch b/Spigot-API-Patches/LootTable-API.patch index 2877a29c91..f7c97fdde7 100644 --- a/Spigot-API-Patches/LootTable-API.patch +++ b/Spigot-API-Patches/LootTable-API.patch @@ -10,105 +10,6 @@ auto replenish for a player. Provides methods to determine players looted state for an object -diff --git a/src/main/java/com/destroystokyo/paper/loottable/Lootable.java b/src/main/java/com/destroystokyo/paper/loottable/Lootable.java -new file mode 100644 -index 000000000..7dd3955b5 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/Lootable.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.loottable; -+ -+import org.bukkit.Bukkit; -+import org.bukkit.NamespacedKey; -+import org.bukkit.loot.LootTable; -+ -+/** -+ * Defines an object that has a Loot Table and seed associated with it. -+ *

-+ * How the Loot Table and seed are used may vary based on Minecraft Versions -+ * and what type of object is using the Loot Table -+ * -+ * @deprecated Use {@link org.bukkit.loot.Lootable} -+ */ -+@Deprecated -+public interface Lootable extends org.bukkit.loot.Lootable { -+ -+ /** -+ * Gets the name of the Loot Table to be used in the World Folder -+ * -+ * @return The name, or null if no loot table exists -+ * @deprecated Use {@link org.bukkit.loot.Lootable#getLootTable()} -+ */ -+ @Deprecated -+ default String getLootTableName() { -+ LootTable lootTable = getLootTable(); -+ return lootTable != null && lootTable.getKey() != null ? lootTable.getKey().toString() : null; -+ } -+ -+ /** -+ * Sets the name of the Loot Table to be used in the World Folder -+ * Will use a random seed (0) -+ * -+ * @param name name in either foo or minecraft:foo format -+ * @return The previous Loot Table before the change -+ * @deprecated Use {@link org.bukkit.loot.Lootable#setLootTable(LootTable)} -+ */ -+ @Deprecated -+ default String setLootTable(String name) { -+ return setLootTable(name, 0); -+ } -+ -+ /** -+ * Sets the name of the Loot Table to be used in the World Folder -+ * Uses supplied Seed -+ * -+ * @param name name in either foo or minecraft:foo format -+ * @param seed seed for the loot table. If 0, seed will be random -+ * @return The previous Loot Table before the change -+ * @deprecated Use {@link org.bukkit.loot.Lootable#setSeed(long)} -+ */ -+ @Deprecated -+ default String setLootTable(String name, long seed) { -+ String prev = getLootTableName(); -+ LootTable lootTable = Bukkit.getLootTable(NamespacedKey.minecraft(name)); -+ setLootTable(lootTable, seed); -+ return prev; -+ } -+ -+ /** -+ * Gets the current seed associated to the Loot Table on this object -+ * -+ * @return The seed, or 0 for random -+ * @deprecated Use {@link org.bukkit.loot.Lootable#getSeed()} -+ */ -+ @Deprecated -+ default long getLootTableSeed() { -+ return getSeed(); -+ } -+ -+ /** -+ * Changes the current seed associated with the Loot Table on this object. -+ *

-+ * The seed will have no affect if this object does not have a Loot Table -+ * associated with it. -+ * -+ * @param seed The seed to use, or 0 for random -+ * @return The previous seed -+ * @throws IllegalStateException If called when this object does not have a loot table -+ * @deprecated Use {@link org.bukkit.loot.Lootable#setSeed(long)} -+ */ -+ @Deprecated -+ default long setLootTableSeed(long seed) { -+ final String lootTableName = getLootTableName(); -+ if (lootTableName == null) { -+ throw new IllegalStateException("This object does not currently have a Loot Table."); -+ } -+ -+ long prev = getSeed(); -+ setSeed(seed); -+ return prev; -+ } -+} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java new file mode 100644 index 000000000..9095df616 @@ -153,13 +54,14 @@ index 000000000..a389f74c6 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java new file mode 100644 -index 000000000..cde999ef4 +index 000000000..2fc3e8a1c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.entity.Player; ++import org.bukkit.loot.Lootable; + +import java.util.UUID; + @@ -449,7 +351,7 @@ index 9ea403e6f..238d118f7 100644 +public interface StorageMinecart extends Minecart, InventoryHolder, LootableEntityInventory { // Paper } diff --git a/src/main/java/org/bukkit/loot/Lootable.java b/src/main/java/org/bukkit/loot/Lootable.java -index f4b3d0215..98a472055 100644 +index f4b3d0215..9f1c830f4 100644 --- a/src/main/java/org/bukkit/loot/Lootable.java +++ b/src/main/java/org/bukkit/loot/Lootable.java @@ -0,0 +0,0 @@ public interface Lootable { @@ -463,7 +365,10 @@ index f4b3d0215..98a472055 100644 + * @param table the Loot Table this {@link org.bukkit.block.Container} or {@link org.bukkit.entity.Mob} will have. + * @param seed the seed to used to generate loot. Default is 0. + */ -+ void setLootTable(LootTable table, long seed); ++ default void setLootTable(LootTable table, long seed) { ++ setLootTable(table); ++ setSeed(seed); ++ } + + /** + * Returns whether or not this object has a Loot Table diff --git a/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch b/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch index 2928c5b035..ef35d2d2c8 100644 --- a/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch +++ b/Spigot-API-Patches/Make-EnderDragon-extend-Mob.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Make EnderDragon extend Mob diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java -index 8f200e6c..dad0b314 100644 +index 4ea0e44e7..fa115c091 100644 --- a/src/main/java/org/bukkit/entity/EnderDragon.java +++ b/src/main/java/org/bukkit/entity/EnderDragon.java @@ -0,0 +0,0 @@ package org.bukkit.entity; /** * Represents an Ender Dragon */ --public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC { // Paper -+public interface EnderDragon extends ComplexLivingEntity, com.destroystokyo.paper.entity.SentientNPC, org.bukkit.entity.Mob { // Paper - add Mob +-public interface EnderDragon extends ComplexLivingEntity { ++public interface EnderDragon extends ComplexLivingEntity, org.bukkit.entity.Mob { // Paper - add Mob /** * Represents a phase or action that an Ender Dragon can perform. diff --git a/Spigot-API-Patches/POM-changes.patch b/Spigot-API-Patches/POM-changes.patch index 0fe869abe0..0528243c57 100644 --- a/Spigot-API-Patches/POM-changes.patch +++ b/Spigot-API-Patches/POM-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] POM changes diff --git a/pom.xml b/pom.xml -index f06c89c1..97c13752 100644 +index 117a7f8cf..03894ccf3 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -21,7 +21,7 @@ index f06c89c1..97c13752 100644 + + + paper-api - 1.13-R0.1-SNAPSHOT + 1.13.1-R0.1-SNAPSHOT jar - Spigot-API diff --git a/Spigot-API-Patches/PlayerElytraBoostEvent.patch b/Spigot-API-Patches/PlayerElytraBoostEvent.patch index a0079e2839..b55b338c3b 100644 --- a/Spigot-API-Patches/PlayerElytraBoostEvent.patch +++ b/Spigot-API-Patches/PlayerElytraBoostEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerElytraBoostEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java new file mode 100644 -index 00000000..cecb2182 +index 000000000..cecb2182c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch b/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch index 2fc6099b14..8e9ed08bab 100644 --- a/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch +++ b/Spigot-API-Patches/PlayerLaunchProjectileEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerLaunchProjectileEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java new file mode 100644 -index 00000000..d2b244a4 +index 000000000..d2b244a41 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java @@ -0,0 +0,0 @@ diff --git a/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch b/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch index 0100775d71..de36db05f9 100644 --- a/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch +++ b/Spigot-API-Patches/Provide-Chunk-Coordinates-as-a-Long-API.patch @@ -7,7 +7,7 @@ Allows you to easily access the chunks X/z as a long, and a method to look up by the long key too. diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java -index 079b9feb..c75bce07 100644 +index 079b9febe..c75bce07a 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java @@ -0,0 +0,0 @@ public interface Chunk { @@ -27,7 +27,7 @@ index 079b9feb..c75bce07 100644 * Gets the world containing this chunk * diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index ba300c29..f84f151a 100644 +index dbbcfec99..724088ec0 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/RangedEntity-API.patch b/Spigot-API-Patches/RangedEntity-API.patch index 9f3acc4955..11ebceb77c 100644 --- a/Spigot-API-Patches/RangedEntity-API.patch +++ b/Spigot-API-Patches/RangedEntity-API.patch @@ -8,15 +8,16 @@ and to perform an attack. diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java new file mode 100644 -index 000000000..ded25f214 +index 000000000..8234de28f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.entity; + +import org.bukkit.entity.LivingEntity; ++import org.bukkit.entity.Mob; + -+public interface RangedEntity extends SentientNPC { ++public interface RangedEntity extends Mob { + /** + * Attack the specified entity using a ranged attack. + * diff --git a/Spigot-API-Patches/SkeletonHorse-Additions.patch b/Spigot-API-Patches/SkeletonHorse-Additions.patch index 718d5499b6..58c1e84788 100644 --- a/Spigot-API-Patches/SkeletonHorse-Additions.patch +++ b/Spigot-API-Patches/SkeletonHorse-Additions.patch @@ -6,7 +6,7 @@ Subject: [PATCH] SkeletonHorse Additions diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java new file mode 100644 -index 00000000..55bae018 +index 000000000..55bae018e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java @@ -0,0 +0,0 @@ @@ -54,7 +54,7 @@ index 00000000..55bae018 +} + diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/org/bukkit/entity/SkeletonHorse.java -index b2c6b6a8..ba998346 100644 +index b2c6b6a86..ba9983463 100644 --- a/src/main/java/org/bukkit/entity/SkeletonHorse.java +++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java @@ -0,0 +0,0 @@ package org.bukkit.entity; diff --git a/Spigot-API-Patches/Slime-Pathfinder-Events.patch b/Spigot-API-Patches/Slime-Pathfinder-Events.patch index fd0afd1962..d148fb7422 100644 --- a/Spigot-API-Patches/Slime-Pathfinder-Events.patch +++ b/Spigot-API-Patches/Slime-Pathfinder-Events.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Slime Pathfinder Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java new file mode 100644 -index 00000000..f5a3ca3b +index 000000000..f5a3ca3b0 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java @@ -0,0 +0,0 @@ @@ -49,7 +49,7 @@ index 00000000..f5a3ca3b +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java new file mode 100644 -index 00000000..356bcca8 +index 000000000..356bcca8b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java @@ -0,0 +0,0 @@ @@ -104,7 +104,7 @@ index 00000000..356bcca8 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java new file mode 100644 -index 00000000..7c99fb53 +index 000000000..7c99fb538 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java @@ -0,0 +0,0 @@ @@ -126,7 +126,7 @@ index 00000000..7c99fb53 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java new file mode 100644 -index 00000000..7c96e326 +index 000000000..7c96e3268 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java @@ -0,0 +0,0 @@ @@ -161,7 +161,7 @@ index 00000000..7c96e326 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java new file mode 100644 -index 00000000..e55d208c +index 000000000..e55d208c6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java @@ -0,0 +0,0 @@ @@ -182,10 +182,10 @@ index 00000000..e55d208c + } +} diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java -index 46d03d29..8bd18406 100644 +index 1119e26e2..c4791f95d 100644 --- a/src/main/java/org/bukkit/entity/Slime.java +++ b/src/main/java/org/bukkit/entity/Slime.java -@@ -0,0 +0,0 @@ public interface Slime extends Mob, com.destroystokyo.paper.entity.SentientNPC { +@@ -0,0 +0,0 @@ public interface Slime extends Mob { * @param sz The new size of the slime. */ public void setSize(int sz); diff --git a/Spigot-API-Patches/Use-specific-1.13-versioning-branch-build-name.patch b/Spigot-API-Patches/Use-specific-1.13-versioning-branch-build-name.patch index ed929b2908..bb7620f54f 100644 --- a/Spigot-API-Patches/Use-specific-1.13-versioning-branch-build-name.patch +++ b/Spigot-API-Patches/Use-specific-1.13-versioning-branch-build-name.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use specific 1.13 versioning branch/build name diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index c45faf4c..7041085c 100644 +index c45faf4cb..7041085c3 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java @@ -0,0 +0,0 @@ public class VersionCommand extends BukkitCommand { diff --git a/Spigot-API-Patches/Vex-getSummoner-API.patch b/Spigot-API-Patches/Vex-getSummoner-API.patch index f35ac74cc3..5227288abf 100644 --- a/Spigot-API-Patches/Vex-getSummoner-API.patch +++ b/Spigot-API-Patches/Vex-getSummoner-API.patch @@ -6,14 +6,10 @@ Subject: [PATCH] Vex#getSummoner API Get's the Mob that summoned this Vex diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java -index a2f2fcaec..734683763 100644 +index a2f2fcaec..d395e405d 100644 --- a/src/main/java/org/bukkit/entity/Vex.java +++ b/src/main/java/org/bukkit/entity/Vex.java -@@ -0,0 +0,0 @@ - package org.bukkit.entity; - -+import com.destroystokyo.paper.entity.SentientNPC; -+ +@@ -0,0 +0,0 @@ package org.bukkit.entity; /** * Represents a Vex. */ @@ -21,11 +17,7 @@ index a2f2fcaec..734683763 100644 +public interface Vex extends Monster { + /** + * @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex -+ * @deprecated Use {@link #getSummoner()} + */ -+ @Deprecated -+ default SentientNPC getOwner() { return (SentientNPC) getSummoner(); } // Paper -+ + Mob getSummoner(); // Paper + +} diff --git a/Spigot-API-Patches/isChunkGenerated-API.patch b/Spigot-API-Patches/isChunkGenerated-API.patch index 31b5211655..082038bf84 100644 --- a/Spigot-API-Patches/isChunkGenerated-API.patch +++ b/Spigot-API-Patches/isChunkGenerated-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] isChunkGenerated API Resolves #1329 diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 7e1ee875..9457832b 100644 +index 7e1ee875e..9457832bc 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java @@ -0,0 +0,0 @@ import org.bukkit.util.NumberConversions; @@ -34,7 +34,7 @@ index 7e1ee875..9457832b 100644 /** * Sets the position of this Location and returns itself diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 3170a074..4fd4f997 100644 +index d4bfbad33..53764fae6 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-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 e6514c0fef..738fa3924f 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 @@ -13,7 +13,7 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE If Tile Entity was null, correct Sign to return empty lines instead of null diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 6021a3401f..536fd37254 100644 +index b3c5766a27..29fe031d85 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -39,7 +39,7 @@ index 6021a3401f..536fd37254 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 dfddbaf825..4aaf14e8ce 100644 +index 370a222f83..f493ebc4f3 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 fa3cad1307..fc2c1e2fc5 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 @@ -10,7 +10,7 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index 3204d94c54..e4ed9e2066 100644 +index c90e413f8c..c365bfea04 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java @@ -0,0 +0,0 @@ public class EnchantmentManager { @@ -22,7 +22,7 @@ index 3204d94c54..e4ed9e2066 100644 List list = enchantment.a(entityliving); diff --git a/src/main/java/net/minecraft/server/Enchantments.java b/src/main/java/net/minecraft/server/Enchantments.java -index 0f4aad20fe..3a5263fd9f 100644 +index 836fe13c3d..27093a672e 100644 --- a/src/main/java/net/minecraft/server/Enchantments.java +++ b/src/main/java/net/minecraft/server/Enchantments.java @@ -0,0 +0,0 @@ public class Enchantments { @@ -35,7 +35,7 @@ index 0f4aad20fe..3a5263fd9f 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index a87ef5fb8c..b8bfc75771 100644 +index dcef63bb1f..53cfc10017 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { @@ -52,7 +52,7 @@ index a87ef5fb8c..b8bfc75771 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 b455d8e287..c7adfaad91 100644 +index a89fbc6027..c2016ba003 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/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index b455b2fe49..aee5235e7c 100644 --- a/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-Server-Patches/Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent This will allow you to change the players name or skin on login. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 91cd6e0f61..f02b28059c 100644 +index 1380a14274..ab85fd9a6e 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-Server-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index e9f8c169f1..e2b3c451df 100644 --- a/Spigot-Server-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-Server-Patches/Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 0a47353b4..3238ca742 100644 +index 0a47353b48..3238ca7420 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -0,0 +0,0 @@ public class CraftChunk implements Chunk { diff --git a/Spigot-Server-Patches/Activation-Range-Improvements.patch b/Spigot-Server-Patches/Activation-Range-Improvements.patch index a617477cf1..5203bb2d81 100644 --- a/Spigot-Server-Patches/Activation-Range-Improvements.patch +++ b/Spigot-Server-Patches/Activation-Range-Improvements.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Activation Range Improvements Fixes and adds new Immunities to improve gameplay behavior diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index ceed50d8de..4c2cd41700 100644 +index 3790039f18..a644f393af 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -18,7 +18,7 @@ index ceed50d8de..4c2cd41700 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 05546ff4db..422b826d61 100644 +index 7e13a78411..60f22959b5 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 { @@ -31,15 +31,15 @@ index 05546ff4db..422b826d61 100644 protected int ticksFarFromPlayer; protected float aZ; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index bb86ecb2fb..5cd8c3f288 100644 +index cdf50ed1cf..10b325043c 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -0,0 +0,0 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn return this.bR != null; } -+ public boolean inCaravan() { return this.en(); } // Paper - OBFHELPER - public boolean en() { ++ public boolean inCaravan() { return this.em(); } // Paper - OBFHELPER + public boolean em() { return this.bQ != null; } diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -99,7 +99,7 @@ index d5c08aa7cb..fe6570c88d 100644 } } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index e02647f806..cdbf769e7b 100644 +index 34d2f11f4f..958d15a6ba 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -0,0 +0,0 @@ import net.minecraft.server.EntityFireball; diff --git a/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch index 240a2baa90..2ca17ad10d 100644 --- a/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-Server-Patches/Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index cf11a2225b..578d966401 100644 +index 5485c4bff3..00a46129b8 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving { diff --git a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch index acf9390876..91699ee39a 100644 --- a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch +++ b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch @@ -13,7 +13,7 @@ starting point for future additions in this area. Fixes GH-559 diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 3dbe9d81e..22b9674da 100644 +index 3dbe9d81ea..22b9674da3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { @@ -26,7 +26,7 @@ index 3dbe9d81e..22b9674da 100644 case CHEST: case TRAPPED_CHEST: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 69425e838..bdd4bf515 100644 +index 69425e838f..bdd4bf5151 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 @@ public final class CraftItemStack extends ItemStack { @@ -40,7 +40,7 @@ index 69425e838..bdd4bf515 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..0e8acf12e +index 0000000000..0e8acf12e4 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java @@ -0,0 +0,0 @@ @@ -354,7 +354,7 @@ index 000000000..0e8acf12e + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 3fd208803..360e1fd54 100644 +index 3fd2088039..360e1fd54c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { @@ -383,7 +383,7 @@ index 3fd208803..360e1fd54 100644 } return HANDLED_TAGS; diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index f66cc81d9..eb6cf1bb3 100644 +index 00f89f2296..ef9d40b8a0 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java @@ -0,0 +0,0 @@ import static org.hamcrest.Matchers.*; @@ -392,8 +392,8 @@ index f66cc81d9..eb6cf1bb3 100644 import java.util.List; +import com.destroystokyo.paper.inventory.meta.ArmorStandMeta; // Paper import net.minecraft.server.Block; + import net.minecraft.server.IRegistry; import net.minecraft.server.ITileEntity; - import net.minecraft.server.Item; @@ -0,0 +0,0 @@ public class ItemMetaTest extends AbstractTestingBase { cleanStack.setItemMeta(meta); return cleanStack; diff --git a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index 8f5bde5b98..bd3c161a79 100644 --- a/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 835d329f91..ff22feee4d 100644 +index 58f7489ebd..d974cb5c61 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -18,20 +18,20 @@ index 835d329f91..ff22feee4d 100644 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index b048343b7c..747d99dbe6 100644 +index 6987d9423c..8e8cf659f8 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 { - private boolean Q; // CraftBukkit start + public final DimensionManager dimension; + private static final boolean DEBUG_ENTITIES = Boolean.getBoolean("debug.entities"); // Paper + private static Throwable getAddToWorldStackTrace(Entity entity) { + return new Throwable(entity + " Added to world at " + new java.util.Date()); + } - public final int dimension; // Add env and gen to constructor + public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, PersistentCollection persistentcollection, WorldData worlddata, DimensionManager dimensionmanager, MethodProfiler methodprofiler, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { private boolean j(Entity entity) { if (entity.dead) { diff --git a/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch index d9d678bb2e..e367376663 100644 --- a/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/Add-Early-Warning-Feature-to-WatchDog.patch @@ -9,7 +9,7 @@ thread dumps at an interval until the point of crash. This will help diagnose what was going on in that time before the crash. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 046bf33f6..b23d45f7d 100644 +index 046bf33f66..b23d45f7df 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import org.bukkit.configuration.InvalidConfigurationException; @@ -37,19 +37,19 @@ index 046bf33f6..b23d45f7d 100644 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 74c97b5db..5fdd65b08 100644 +index 76e6b233b1..24e8b5ed14 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.n); + this.a(this.m); // Spigot start + org.spigotmc.WatchdogThread.hasStarted = true; // Paper Arrays.fill( recentTps, 20 ); - long start = System.nanoTime(), lastTick = start - TICK_TIME, catchupTime = 0, curTime, wait, tickSection = start; // Paper - Further improve server tick loop - while (this.isRunning) { + long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop + lastTick = start - TICK_TIME; // Paper diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 4ac0ab997..0c45d75ad 100644 +index eed96c60c5..496c5cbdff 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -0,0 +0,0 @@ public class SpigotConfig @@ -62,7 +62,7 @@ index 4ac0ab997..0c45d75ad 100644 public static boolean bungee; diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java -index 57a4748a3..19df383e0 100644 +index 57a4748a30..19df383e06 100644 --- a/src/main/java/org/spigotmc/WatchdogThread.java +++ b/src/main/java/org/spigotmc/WatchdogThread.java @@ -0,0 +0,0 @@ import java.lang.management.MonitorInfo; diff --git a/Spigot-Server-Patches/Add-EntityZapEvent.patch b/Spigot-Server-Patches/Add-EntityZapEvent.patch index f95c728d04..8ada84850b 100644 --- a/Spigot-Server-Patches/Add-EntityZapEvent.patch +++ b/Spigot-Server-Patches/Add-EntityZapEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 34b6b01a30..670f26c827 100644 +index fecc7e154d..b405e63e81 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -0,0 +0,0 @@ public class EntityPig extends EntityAnimal { @@ -22,7 +22,7 @@ index 34b6b01a30..670f26c827 100644 if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { return; diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 32893a32c9..45df38bad4 100644 +index 74a9fa9434..10921c1cbc 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -48,7 +48,7 @@ index 32893a32c9..45df38bad4 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 38e07f39c0..5227c15d71 100644 +index e39352c221..4c98c7b337 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch index cb5bbf9c12..fe09b99cb8 100644 --- a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch +++ b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add MinecraftKey Information to Objects Stores the reference to the objects respective MinecraftKey diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index e8f7b7292..7ff8e70b2 100644 +index e8f7b7292d..7ff8e70b24 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -0,0 +0,0 @@ public class PaperCommand extends Command { @@ -19,7 +19,7 @@ index e8f7b7292..7ff8e70b2 100644 MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a1050912b..7e691baf9 100644 +index 8997cf84a4..044f7b5aa0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityPortalEvent; @@ -75,7 +75,7 @@ index a1050912b..7e691baf9 100644 protected abstract void a(NBTTagCompound nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 9a513b4e3..fa268f354 100644 +index 5c1ab6a0b6..cd411a1423 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -0,0 +0,0 @@ public class EntityTypes { @@ -84,11 +84,11 @@ index 9a513b4e3..fa268f354 100644 + public boolean isPersistable() { return a(); } // Paper - OBFHELPER public boolean a() { - return this.aV; + return this.aU; } diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java new file mode 100644 -index 000000000..743142d03 +index 0000000000..743142d030 --- /dev/null +++ b/src/main/java/net/minecraft/server/KeyedObject.java @@ -0,0 +0,0 @@ @@ -102,7 +102,7 @@ index 000000000..743142d03 + } +} diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 8a0453245..5ca7fef51 100644 +index 62b6e6eb38..7390061bf0 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; diff --git a/Spigot-Server-Patches/Add-PlayerArmorChangeEvent.patch b/Spigot-Server-Patches/Add-PlayerArmorChangeEvent.patch index 95c1a9fa8c..4763a27f13 100644 --- a/Spigot-Server-Patches/Add-PlayerArmorChangeEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerArmorChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 169ad7619e..3236179a45 100644 +index 2ff82694b4..e2ceb7ae4b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Add-PlayerJumpEvent.patch b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch index d0e955a166..b944d7a49f 100644 --- a/Spigot-Server-Patches/Add-PlayerJumpEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerJumpEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index d9f81e6348..8aad37b9be 100644 +index d11edae03c..9a71fa1e94 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 { @@ -17,7 +17,7 @@ index d9f81e6348..8aad37b9be 100644 super.cH(); 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 d4701d8d56..c1dd2db89d 100644 +index 7e06e5bc67..4cf738e0f8 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 03e728aab0..c141a37735 100644 --- a/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerUseUnknownEntityEvent.patch @@ -18,7 +18,7 @@ index 77440ac81f..8711462e16 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 dc38e4e043..90ab7f065f 100644 +index 3257f41713..096e4e0d8c 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-ProjectileCollideEvent.patch b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch index 30f13cbd14..a70f86afef 100644 --- a/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/Add-ProjectileCollideEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add ProjectileCollideEvent diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 75445b00dc..4ab875a3d3 100644 +index c24225892f..187f02d4e4 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile { @@ -46,7 +46,7 @@ index 3e3619d79f..58cc4824cf 100644 this.a(movingobjectposition); diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 4f801e8fec..1804a49de9 100644 +index 62e8f27aa7..81de03084a 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { @@ -87,7 +87,7 @@ index ee402d4140..fc8c0cab55 100644 if (movingobjectposition.type == MovingObjectPosition.EnumMovingObjectType.BLOCK && this.world.getType(movingobjectposition.a()).getBlock() == Blocks.NETHER_PORTAL) { this.e(movingobjectposition.a()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 01961c5bdd..8df07536f8 100644 +index 488d0221c2..89e765e803 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Add-TNTPrimeEvent.patch b/Spigot-Server-Patches/Add-TNTPrimeEvent.patch index 7b3bf86617..cbd6ac7475 100644 --- a/Spigot-Server-Patches/Add-TNTPrimeEvent.patch +++ b/Spigot-Server-Patches/Add-TNTPrimeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index 25a8a1afd..108006d58 100644 +index 24573b4704..ea428e2daf 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -28,16 +28,17 @@ index 25a8a1afd..108006d58 100644 if (block instanceof BlockTNT) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -+ if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.FIRE, null).callEvent()) ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); ++ if (!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.FIRE, null).callEvent()) { + return; ++ } + world.setAir(blockposition); // setair after non cancelled event, it would usually be air by now + // Paper end ((BlockTNT) block).a(world, blockposition); } } diff --git a/src/main/java/net/minecraft/server/BlockTNT.java b/src/main/java/net/minecraft/server/BlockTNT.java -index 0c48a0cfe..c3eeee263 100644 +index 81c5b60ea1..5fddb29612 100644 --- a/src/main/java/net/minecraft/server/BlockTNT.java +++ b/src/main/java/net/minecraft/server/BlockTNT.java @@ -0,0 +0,0 @@ @@ -53,7 +54,7 @@ index 0c48a0cfe..c3eeee263 100644 if (iblockdata1.getBlock() != iblockdata.getBlock()) { if (world.isBlockIndirectlyPowered(blockposition)) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) + return; + // Paper end @@ -65,7 +66,7 @@ index 0c48a0cfe..c3eeee263 100644 public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (world.isBlockIndirectlyPowered(blockposition)) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.REDSTONE, null).callEvent()) + return; + // Paper end @@ -77,7 +78,7 @@ index 0c48a0cfe..c3eeee263 100644 public void wasExploded(World world, BlockPosition blockposition, Explosion explosion) { if (!world.isClientSide) { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition);; + org.bukkit.entity.Entity source = explosion.source != null ? explosion.source.bukkitEntity : null; + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.EXPLOSION, source).callEvent()) + return; @@ -90,7 +91,7 @@ index 0c48a0cfe..c3eeee263 100644 return super.interact(iblockdata, world, blockposition, entityhuman, enumhand, enumdirection, f, f1, f2); } else { + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); + if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.ITEM, entityhuman.bukkitEntity).callEvent()) + return true; + // Paper end @@ -102,15 +103,16 @@ index 0c48a0cfe..c3eeee263 100644 } // CraftBukkit end + // Paper start - TNTPrimeEvent -+ org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -+ if(!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.PROJECTILE, entityarrow.bukkitEntity).callEvent()) ++ org.bukkit.block.Block tntBlock = MCUtil.toBukkitBlock(world, blockposition); ++ if (!new TNTPrimeEvent(tntBlock, TNTPrimeEvent.PrimeReason.PROJECTILE, entityarrow.bukkitEntity).callEvent()) { + return; ++ } + // Paper end - this.a(world, blockposition, entityarrow.shooter instanceof EntityLiving ? (EntityLiving) entityarrow.shooter : null); + this.a(world, blockposition, entity1 instanceof EntityLiving ? (EntityLiving) entity1 : null); world.setAir(blockposition); } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index d8ab87e21..d5e2a0251 100644 +index 2c735a920d..74d96a2f09 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; diff --git a/Spigot-Server-Patches/Add-UnknownCommandEvent.patch b/Spigot-Server-Patches/Add-UnknownCommandEvent.patch index 32657ccdbb..05d28aa3eb 100644 --- a/Spigot-Server-Patches/Add-UnknownCommandEvent.patch +++ b/Spigot-Server-Patches/Add-UnknownCommandEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add UnknownCommandEvent diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 51ea2013e8..42b3447a1a 100644 +index 10cbe8c6a1..5c48430313 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.Versioning; diff --git a/Spigot-Server-Patches/Add-World-Util-Methods.patch b/Spigot-Server-Patches/Add-World-Util-Methods.patch index ffca5450e9..a73f81f508 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 eb6f900c39..ef6a54bcae 100644 +index 1131a092af..d86b925f0d 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,25 +18,25 @@ index eb6f900c39..ef6a54bcae 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 e0fe05a0b1..72c0c92ec1 100644 +index 879f2fe844..fd6f070417 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); - private final long G = 16777215L; -- private int H; -+ private int H; public int getSkylightSubtracted() { return this.H; } public void setSkylightSubtracted(int value) { this.H = value;} // Paper - OBFHELPER + private final long F = 16777215L; +- private int G; ++ private int G; public int getSkylightSubtracted() { return this.G; } public void setSkylightSubtracted(int value) { this.G = value;} // Paper - OBFHELPER protected int m = (new Random()).nextInt(); protected final int n = 1013904223; protected float o; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return this.getType(blockposition).isAir(); } + // Paper start + public Chunk getChunkIfLoaded(BlockPosition blockposition) { -+ return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); ++ return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); + } + // test if meets light level, return faster + // logic copied from below @@ -89,6 +89,20 @@ index e0fe05a0b1..72c0c92ec1 100644 + } + return null; + } ++ public Block getBlockIfLoaded(BlockPosition blockposition) { ++ IBlockData type = getTypeIfLoaded(blockposition); ++ if (type == null) { ++ return null; ++ } ++ return type.getBlock(); ++ } ++ public Material getMaterialIfLoaded(BlockPosition blockposition) { ++ IBlockData type = getTypeIfLoaded(blockposition); ++ if (type == null) { ++ return null; ++ } ++ return type.getBlock().material; ++ } + // Paper end + public Chunk getChunkAtWorldCoords(BlockPosition blockposition) { diff --git a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch index f59ec7bf88..69873bf4f7 100644 --- a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch +++ b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add ability to configure frosted_ice properties diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b6ef1d4378..8d54af6bb7 100644 +index 56a25531b4..25a5333219 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 { @@ -24,7 +24,7 @@ index b6ef1d4378..8d54af6bb7 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index 1d5c24c7a7..77cf6b8e9b 100644 +index 39b3c88d64..302d420512 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce { @@ -39,10 +39,8 @@ index 1d5c24c7a7..77cf6b8e9b 100644 IBlockData iblockdata1 = world.getType(blockposition_b); if (iblockdata1.getBlock() == this && !this.c(iblockdata1, world, blockposition_b)) { -- world.I().a(blockposition_b, this, MathHelper.nextInt(random, 20, 40)); -+ // Paper start - use configurable min/max delay -+ world.I().a(blockposition_b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); -+ // Paper end +- world.J().a(blockposition_b, this, MathHelper.nextInt(random, 20, 40)); ++ world.J().a(blockposition_b, this, MathHelper.nextInt(random, world.paperConfig.frostedIceDelayMin, world.paperConfig.frostedIceDelayMax)); // Paper - use configurable min/max delay } } } catch (Throwable throwable1) { diff --git a/Spigot-Server-Patches/Add-async-chunk-load-API.patch b/Spigot-Server-Patches/Add-async-chunk-load-API.patch index 5771769db6..25054be153 100644 --- a/Spigot-Server-Patches/Add-async-chunk-load-API.patch +++ b/Spigot-Server-Patches/Add-async-chunk-load-API.patch @@ -5,7 +5,7 @@ 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 f94830838..9294d1707 100644 +index e4c4cdb980..af977b171a 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 { @@ -15,7 +15,7 @@ index f94830838..9294d1707 100644 + // Paper start - Async chunk load API + public void getChunkAtAsync(final int x, final int z, final ChunkLoadCallback callback) { + final ChunkProviderServer cps = this.world.getChunkProviderServer(); -+ callback.onLoad(cps.getChunkAt(x, z).bukkitChunk); // TODO: Add back async variant ++ callback.onLoad(cps.getChunkAt(x, z, true, true).bukkitChunk); // TODO: Add back async variant + /*cps.getChunkAt(x, z, new Runnable() { + @Override + public void run() { @@ -34,6 +34,6 @@ index f94830838..9294d1707 100644 + // Paper end + public Chunk getChunkAt(int x, int z) { - return this.world.getChunkProviderServer().getChunkAt(x, z).bukkitChunk; + return this.world.getChunkProviderServer().getChunkAt(x, z, true, true).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 a1318f192d..6e7ced050d 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 ddb5ced79d..2701388043 100644 +index 2e3e48637a..8724c2816b 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-configurable-portal-search-radius.patch b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch index 56518ff64d..aeff9731d2 100644 --- a/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/Add-configurable-portal-search-radius.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add configurable portal search radius diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 7d1f6cde9..c98286999 100644 +index 7d1f6cde94..c982869995 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 { @@ -19,7 +19,7 @@ index 7d1f6cde9..c98286999 100644 + } } diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 0cb1eeb68..402d8d7d6 100644 +index 73d5b4d625..5e899e05cf 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -0,0 +0,0 @@ import org.bukkit.util.Vector; @@ -41,7 +41,7 @@ index 0cb1eeb68..402d8d7d6 100644 return false; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java -index 1d5dce10e..7ca2617a8 100644 +index d4639c8221..e1eb3aa0f3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftTravelAgent.java @@ -0,0 +0,0 @@ public class CraftTravelAgent extends PortalTravelAgent implements TravelAgent { diff --git a/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch index fe9ab81942..ed61c23a8a 100644 --- a/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/Add-configuration-option-to-prevent-player-names-fro.patch @@ -20,7 +20,7 @@ index 9f1182c723..e97dbaf8e3 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 476b01f70f..17b398cde0 100644 +index 95f28c83af..6a44428293 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/Add-exception-reporting-event.patch b/Spigot-Server-Patches/Add-exception-reporting-event.patch index 8a57f2d08f..5baf6c3d93 100644 --- a/Spigot-Server-Patches/Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/Add-exception-reporting-event.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add exception reporting event diff --git a/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java new file mode 100644 -index 000000000..93397188b +index 0000000000..93397188b7 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/ServerSchedulerReportingWrapper.java @@ -0,0 +0,0 @@ @@ -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 ea7d82f09..ec43c2659 100644 +index ef09ac7873..1131a092af 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ @@ -60,15 +60,6 @@ index ea7d82f09..ec43c2659 100644 import com.google.common.collect.Maps; import com.google.common.collect.Queues; import com.google.common.collect.Sets; -@@ -0,0 +0,0 @@ import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - - import com.google.common.collect.Lists; // CraftBukkit -+import org.bukkit.Server; // CraftBukkit -+import org.bukkit.craftbukkit.util.CraftMagicNumbers; // Paper - - public class Chunk implements IChunkAccess { - @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { return this.getBlockData(i, j, k).b(this.world, new BlockPosition(i, j, k)); } @@ -89,7 +80,7 @@ index ea7d82f09..ec43c2659 100644 + ServerInternalException e = new ServerInternalException( + "Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + + tileentity.position.getY() + "," + tileentity.position.getZ() -+ + " (" + CraftMagicNumbers.getMaterial(getBlockData(blockposition).getBlock()) + ") where there was no entity tile!\n" + ++ + " (" + getBlockData(blockposition) + ") where there was no entity tile!\n" + + "Chunk coordinates: " + (this.locX * 16) + "," + (this.locZ * 16)); + e.printStackTrace(); + ServerInternalException.reportInternalException(e); @@ -98,10 +89,10 @@ index ea7d82f09..ec43c2659 100644 } } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index d025d949e..0e04d6598 100644 +index 1379b574ef..6b041f06e4 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -0,0 +0,0 @@ import java.util.concurrent.ExecutionException; +@@ -0,0 +0,0 @@ import java.util.function.BooleanSupplier; import java.util.function.Consumer; import java.util.function.Function; import javax.annotation.Nullable; @@ -109,19 +100,6 @@ index d025d949e..0e04d6598 100644 import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - try { - // this.chunkLoader.a(this.world, chunk); // Spigot - } catch (Exception exception) { -- ChunkProviderServer.a.error("Couldn\'t save entities", exception); -+ // Paper start -+ String msg = "Couldn\'t save entities"; -+ ChunkProviderServer.a.error(msg, exception); -+ ServerInternalException.reportInternalException(exception); -+ // Paper end - } - - } @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { ichunkaccess.setLastSaved(this.world.getTime()); this.chunkLoader.saveChunk(this.world, ichunkaccess, unloaded); // Spigot @@ -140,7 +118,7 @@ index d025d949e..0e04d6598 100644 } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index 33e5aaf2c..f13534917 100644 +index 1d830dff64..58d971cf20 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -0,0 +0,0 @@ @@ -166,35 +144,8 @@ index 33e5aaf2c..f13534917 100644 } } // CraftBukkit end -diff --git a/src/main/java/net/minecraft/server/PersistentCollection.java b/src/main/java/net/minecraft/server/PersistentCollection.java -index 6b5600ba5..72f386720 100644 ---- a/src/main/java/net/minecraft/server/PersistentCollection.java -+++ b/src/main/java/net/minecraft/server/PersistentCollection.java -@@ -0,0 +0,0 @@ - package net.minecraft.server; - -+import com.destroystokyo.paper.exception.ServerInternalException; - import com.google.common.collect.Lists; - import com.google.common.collect.Maps; - import com.mojang.datafixers.DataFixTypes; -@@ -0,0 +0,0 @@ public class PersistentCollection { - nbttagcompound = GameProfileSerializer.a(this.c.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i); - } catch (Throwable throwable1) { - throwable = throwable1; -+ ServerInternalException.reportInternalException(throwable1); // Paper - throw throwable1; - } finally { - if (fileinputstream != null) { -@@ -0,0 +0,0 @@ public class PersistentCollection { - } - } catch (Exception exception) { - exception.printStackTrace(); -+ ServerInternalException.reportInternalException(exception); // Paper - } - - } diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 31899549d..cc7cad8be 100644 +index 31899549d5..cc7cad8be4 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -0,0 +0,0 @@ @@ -221,7 +172,7 @@ index 31899549d..cc7cad8be 100644 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 0e91aeec3..ff473a263 100644 +index d18921271f..e5115863ec 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -0,0 +0,0 @@ @@ -240,7 +191,7 @@ index 0e91aeec3..ff473a263 100644 } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index b12e767db..342a15db5 100644 +index 9e24b77ad1..f32191c5a2 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.LogManager; @@ -268,7 +219,7 @@ index b12e767db..342a15db5 100644 } diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java -index 4ff243dab..67b2e41c7 100644 +index e649d662ae..560edb523f 100644 --- a/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java @@ -0,0 +0,0 @@ @@ -288,7 +239,7 @@ index 4ff243dab..67b2e41c7 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index f6d7070de..e0fe05a0b 100644 +index 9fb87914ff..879f2fe844 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ @@ -299,8 +250,8 @@ index f6d7070de..e0fe05a0b 100644 +import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; - import java.util.ArrayList; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + import it.unimi.dsi.fastutil.longs.LongSet; +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); // Paper start - Prevent tile entity and entity crashes @@ -312,7 +263,7 @@ index f6d7070de..e0fe05a0b 100644 entity.dead = true; continue; // Paper end -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.e(); } catch (Throwable throwable2) { // Paper start - Prevent tile entity and entity crashes @@ -324,8 +275,20 @@ index f6d7070de..e0fe05a0b 100644 tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); continue; +diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java +index 65931bfb5f..625335c60f 100644 +--- a/src/main/java/net/minecraft/server/WorldPersistentData.java ++++ b/src/main/java/net/minecraft/server/WorldPersistentData.java +@@ -0,0 +0,0 @@ public class WorldPersistentData { + + nbttagcompound = GameProfileSerializer.a(idatamanager.i(), DataFixTypes.SAVED_DATA, nbttagcompound1, j, i); + } catch (Throwable throwable1) { ++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable1); // Paper + throwable = throwable1; + throw throwable1; + } finally { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java -index 93b9134d6..26753fac5 100644 +index 93b9134d6e..26753fac5e 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -0,0 +0,0 @@ import java.util.concurrent.atomic.AtomicReference; diff --git a/Spigot-Server-Patches/Add-hand-to-bucket-events.patch b/Spigot-Server-Patches/Add-hand-to-bucket-events.patch index a185cccfc9..47aab58337 100644 --- a/Spigot-Server-Patches/Add-hand-to-bucket-events.patch +++ b/Spigot-Server-Patches/Add-hand-to-bucket-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index b2010ffa6..3493c4c44 100644 +index 5f4f107d5a..b2e50f8532 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -0,0 +0,0 @@ public class EntityCow extends EntityAnimal { @@ -18,7 +18,7 @@ index b2010ffa6..3493c4c44 100644 if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java -index 2c36c3990..b38ee2853 100644 +index b63da71512..b0dd30dd12 100644 --- a/src/main/java/net/minecraft/server/ItemBucket.java +++ b/src/main/java/net/minecraft/server/ItemBucket.java @@ -0,0 +0,0 @@ public class ItemBucket extends Item { @@ -50,14 +50,14 @@ index 2c36c3990..b38ee2853 100644 + public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition, @Nullable MovingObjectPosition movingobjectposition, EnumDirection enumdirection, BlockPosition clicked, ItemStack itemstack, EnumHand enumhand) { + // Paper end // CraftBukkit end - if (!(this.a instanceof FluidTypeFlowing)) { + if (!(this.fluidType instanceof FluidTypeFlowing)) { return false; @@ -0,0 +0,0 @@ public class ItemBucket extends Item { boolean flag1 = material.isReplaceable(); - if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).a((IBlockAccess) world, blockposition, iblockdata, this.a))) { + if (!world.isEmpty(blockposition) && !flag && !flag1 && (!(iblockdata.getBlock() instanceof IFluidContainer) || !((IFluidContainer) iblockdata.getBlock()).canPlace(world, blockposition, iblockdata, this.fluidType))) { - return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack); // CraftBukkit -+ return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumHand ++ return movingobjectposition == null ? false : this.a(entityhuman, world, movingobjectposition.a().shift(movingobjectposition.direction), (MovingObjectPosition) null, enumdirection, clicked, itemstack, enumhand); // CraftBukkit // Paper - add enumhand } else { // CraftBukkit start if (entityhuman != null) { @@ -67,7 +67,7 @@ index 2c36c3990..b38ee2853 100644 ((EntityPlayer) entityhuman).playerConnection.sendPacket(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-4238: needed when looking through entity // TODO: inventory not updated diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 140ddae0d..9037a1233 100644 +index 1f3774c249..e0a012a82b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch index 4f0356ba4b..6570abaa7f 100644 --- a/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch +++ b/Spigot-Server-Patches/Add-method-to-open-already-placed-sign.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 4afff2f262..e9707dfa74 100644 +index 38a886fbd5..92fe80316f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/Add-missing-coverages-for-getTileEntity-in-order-to-.patch b/Spigot-Server-Patches/Add-missing-coverages-for-getTileEntity-in-order-to-.patch index 864ede83d9..568cb997cf 100644 --- a/Spigot-Server-Patches/Add-missing-coverages-for-getTileEntity-in-order-to-.patch +++ b/Spigot-Server-Patches/Add-missing-coverages-for-getTileEntity-in-order-to-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add missing coverages for getTileEntity in order to attempt diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 8f6ce6bf1a..5d5f6f6328 100644 +index e58b21ae43..e4ba13cec5 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/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 ffe40256a7..46d398b830 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 @@ -11,7 +11,7 @@ I suspect Mojang may switch to this behavior before full release. To be converted into a Paper-API event at some point in the future? diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4991138dfe..87c599338a 100644 +index 8923454524..0094f6ab98 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 { @@ -26,7 +26,7 @@ index 4991138dfe..87c599338a 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 9814075d6d..814202286c 100644 +index 79233fe463..f6600ce515 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 9814075d6d..814202286c 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 08ef17dfe1..d4701d8d56 100644 +index 7f61da1cd3..7e06e5bc67 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-option-to-remove-invalid-statistics.patch b/Spigot-Server-Patches/Add-option-to-remove-invalid-statistics.patch index 6ce400c99f..99df574af0 100644 --- a/Spigot-Server-Patches/Add-option-to-remove-invalid-statistics.patch +++ b/Spigot-Server-Patches/Add-option-to-remove-invalid-statistics.patch @@ -23,7 +23,7 @@ index c1845d6811..9f1182c723 100644 + } } diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java -index 07e7db455b..34c57e26f4 100644 +index 6405f98e06..42e2f3d22b 100644 --- a/src/main/java/net/minecraft/server/ServerStatisticManager.java +++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java @@ -0,0 +0,0 @@ public class ServerStatisticManager extends StatisticManager { @@ -36,10 +36,10 @@ index 07e7db455b..34c57e26f4 100644 jsonreader.setLenient(false); @@ -0,0 +0,0 @@ public class ServerStatisticManager extends StatisticManager { - if (statistic == null) { - ServerStatisticManager.b.warn("Invalid statistic in {}: Don\'t know what {} is", this.d, s2); + if (statistic == null) { + ServerStatisticManager.b.warn("Invalid statistic in {}: Don\'t know what {} is", this.d, s2); + if (com.destroystokyo.paper.PaperConfig.removeInvalidStatistics) invalidStats.add(s2); // Paper - } else { - this.a.put(statistic, nbttagcompound2.getInt(s2)); - } + } else { + this.a.put(statistic, nbttagcompound2.getInt(s2)); + } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Add-player-view-distance-API.patch b/Spigot-Server-Patches/Add-player-view-distance-API.patch index fff2af16de..5c8e917698 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 2dc70ffbf0..b66df45bde 100644 +index 9f23c0d2c2..b44d056651 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 { @@ -203,7 +203,7 @@ index d975c2ccf1..6ece565c51 100644 + // 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 15023a4563..43b27ea7c2 100644 +index 8ecef3ff96..3cc16b6923 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/Add-setPlayerProfile-API-for-Skulls.patch b/Spigot-Server-Patches/Add-setPlayerProfile-API-for-Skulls.patch index dfdb557dc6..6563f24a4a 100644 --- a/Spigot-Server-Patches/Add-setPlayerProfile-API-for-Skulls.patch +++ b/Spigot-Server-Patches/Add-setPlayerProfile-API-for-Skulls.patch @@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo which commonly cause rate limit issues with Mojang API diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java -index f113da713..fdfe101ae 100644 +index f113da713a..fdfe101ae3 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -0,0 +0,0 @@ @@ -48,7 +48,7 @@ index f113da713..fdfe101ae 100644 public BlockFace getRotation() { return ((Rotatable) getBlockData()).getRotation(); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java -index 7984c68cb..14d8dd65a 100644 +index 7984c68cb0..14d8dd65ac 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.inventory; diff --git a/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch index 5298590494..347a4ad9a4 100644 --- a/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch +++ b/Spigot-Server-Patches/Add-setting-for-proxy-online-mode-status.patch @@ -19,7 +19,7 @@ index a1110da38e..0a8fc7927a 100644 + } } diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java -index f135349174..85c7a96c5a 100644 +index 58d971cf20..8a2ff6a413 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java +++ b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -0,0 +0,0 @@ public class NameReferencingFileConverter { @@ -33,7 +33,7 @@ index f135349174..85c7a96c5a 100644 } else { String[] astring1 = astring; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3861c63cb8..ff1f71310e 100644 +index 89f6c77dbc..b0e8302f0c 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/Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch index 04c199298c..721017b177 100644 --- a/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/Add-some-Debug-to-Chunk-Entity-slices.patch @@ -9,7 +9,7 @@ This should hopefully avoid duplicate entities ever being created if the entity was to end up in 2 different chunk slices diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index abdcf7745a..bd31a7dcab 100644 +index 404b7d21c2..7b6b8f4824 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 { @@ -73,7 +73,7 @@ index abdcf7745a..bd31a7dcab 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4315804ddb..166abea704 100644 +index 4a2faa314e..f5d5f38232 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/Add-source-block-to-BlockPhysicsEvent.patch b/Spigot-Server-Patches/Add-source-block-to-BlockPhysicsEvent.patch index 2fd557e14d..f348369943 100644 --- a/Spigot-Server-Patches/Add-source-block-to-BlockPhysicsEvent.patch +++ b/Spigot-Server-Patches/Add-source-block-to-BlockPhysicsEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add source block to BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 16d0c0d45..a4d9f0d5f 100644 +index abf3796d91..2a7abae942 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); if (world != null && !((WorldServer)this).stopPhysicsEvent) { // Paper diff --git a/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch b/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch index dd0f7655ac..177800215c 100644 --- a/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-Server-Patches/Add-source-to-PlayerExpChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index c8698b2f67..3c888d6015 100644 +index 33b24c833b..880f496526 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { @@ -18,7 +18,7 @@ index c8698b2f67..3c888d6015 100644 this.die(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 5227c15d71..01961c5bdd 100644 +index 4c98c7b337..488d0221c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ import org.bukkit.entity.Player; diff --git a/Spigot-Server-Patches/Add-velocity-warnings.patch b/Spigot-Server-Patches/Add-velocity-warnings.patch index ad71c369fd..249349d144 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 5230867326..53adc9e1a0 100644 +index 6a7bdb9ab6..bd99aa72c4 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/All-chunks-are-slime-spawn-chunks-toggle.patch b/Spigot-Server-Patches/All-chunks-are-slime-spawn-chunks-toggle.patch index a02989f054..dac3b4f142 100644 --- a/Spigot-Server-Patches/All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/Spigot-Server-Patches/All-chunks-are-slime-spawn-chunks-toggle.patch @@ -5,7 +5,7 @@ Subject: [PATCH] All chunks are slime spawn chunks toggle diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index d91b48b0a..7d1f6cde9 100644 +index d91b48b0ae..7d1f6cde94 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 { @@ -19,16 +19,16 @@ index d91b48b0a..7d1f6cde9 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 31e066b54..eeaf98e82 100644 +index 9e0df95607..238f3c7926 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster { } ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(blockposition); -- boolean flag = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot -+ boolean flag = world.paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper - add allChunksAreSlime +- boolean flag1 = SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot ++ boolean flag1 = world.paperConfig.allChunksAreSlimeChunks || SeededRandom.a(chunkcoordintpair.x, chunkcoordintpair.z, generatoraccess.getSeed(), world.spigotConfig.slimeSeed).nextInt(10) == 0; // Spigot // Paper - add allChunksAreSlime - if (this.random.nextInt(10) == 0 && flag && this.locY < 40.0D) { - return super.a(generatoraccess); + if (this.random.nextInt(10) == 0 && flag1 && this.locY < 40.0D) { + return super.a(generatoraccess, flag); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch index 500b80f357..3f94f9d509 100644 --- a/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/Allow-Reloading-of-Command-Aliases.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ff1f71310e..476b01f70f 100644 +index b0e8302f0c..95f28c83af 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/Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch index c896253c5b..3eee9a8c98 100644 --- a/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/Allow-Reloading-of-Custom-Permissions.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b68af1c285..f70629a868 100644 +index 8d059d75ac..eacee4036e 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/Allow-disabling-armour-stand-ticking.patch b/Spigot-Server-Patches/Allow-disabling-armour-stand-ticking.patch index 2e84a22e2f..76604c2fdf 100644 --- a/Spigot-Server-Patches/Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-Server-Patches/Allow-disabling-armour-stand-ticking.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 61c8b58b1..458baf444 100644 +index 58f87794d6..06c949ef06 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 { - allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders); - log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled")); + break; + } } + + public boolean armorStandTick = true; @@ -20,7 +20,7 @@ index 61c8b58b1..458baf444 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 3b2b94d8c..7edeb9bb0 100644 +index 7647311dfd..35afffedef 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving { @@ -48,7 +48,7 @@ index 3b2b94d8c..7edeb9bb0 100644 Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.b); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 9f5c3b92e..07ce93f17 100644 +index 9f5c3b92e3..07ce93f17c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -0,0 +0,0 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { diff --git a/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch b/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch index 3237dde9af..375cb378d5 100644 --- a/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch +++ b/Spigot-Server-Patches/Allow-for-toggling-of-spawn-chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow for toggling of spawn chunks diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 02f7e506e..cef0c47ac 100644 +index 02f7e506e3..cef0c47ac7 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -20,10 +20,10 @@ index 02f7e506e..cef0c47ac 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 562a85b72..6ca7a2069 100644 +index c3c435cab9..30a46a50fb 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getServer().addWorld(this.world); // CraftBukkit end timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings 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 e94a1741be..f404b7ec7b 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 62638d4e25..affbb93bfd 100644 +index 63d9130918..c449a9a39b 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/Allow-specifying-a-custom-authentication-servers-dow.patch b/Spigot-Server-Patches/Allow-specifying-a-custom-authentication-servers-dow.patch index 4cc847796b..16cfa298e6 100644 --- a/Spigot-Server-Patches/Allow-specifying-a-custom-authentication-servers-dow.patch +++ b/Spigot-Server-Patches/Allow-specifying-a-custom-authentication-servers-dow.patch @@ -27,7 +27,7 @@ index e97dbaf8e3..45863c017c 100644 + } } diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 005efbc111..6249b0e686 100644 +index 8bbea96240..10c82107d4 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { diff --git a/Spigot-Server-Patches/Always-process-chunk-registration-after-moving.patch b/Spigot-Server-Patches/Always-process-chunk-registration-after-moving.patch index 86b0a66921..8be405de19 100644 --- a/Spigot-Server-Patches/Always-process-chunk-registration-after-moving.patch +++ b/Spigot-Server-Patches/Always-process-chunk-registration-after-moving.patch @@ -7,7 +7,7 @@ This will help guarantee that entities are always in the chunk that they are currently located at. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 6b0ca4eb9..68b4a902e 100644 +index e558197623..f5e66aaf90 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 @@ -27,7 +27,7 @@ index 6b0ca4eb9..68b4a902e 100644 protected SoundEffect ad() { diff --git a/src/main/java/net/minecraft/server/EntityLeash.java b/src/main/java/net/minecraft/server/EntityLeash.java -index f2d3d0b4c..f20060614 100644 +index f2d3d0b4c7..f20060614d 100644 --- a/src/main/java/net/minecraft/server/EntityLeash.java +++ b/src/main/java/net/minecraft/server/EntityLeash.java @@ -0,0 +0,0 @@ public class EntityLeash extends EntityHanging { @@ -39,7 +39,7 @@ index f2d3d0b4c..f20060614 100644 public void setDirection(EnumDirection enumdirection) {} diff --git a/src/main/java/net/minecraft/server/EntityShulker.java b/src/main/java/net/minecraft/server/EntityShulker.java -index 95c6cd897..bc11e7da2 100644 +index 24de5f0172..06e51d5b81 100644 --- a/src/main/java/net/minecraft/server/EntityShulker.java +++ b/src/main/java/net/minecraft/server/EntityShulker.java @@ -0,0 +0,0 @@ public class EntityShulker extends EntityGolem implements IMonster { diff --git a/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch b/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch index fdc55d6d0a..d8a6613504 100644 --- a/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch +++ b/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch @@ -8,10 +8,10 @@ which can keep them in the chunk when they shouldnt be if done during entity ticking. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 921add1dc..ff0112c52 100644 +index 3ea26d5ad8..c2d404b813 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.everyoneSleeping(); } @@ -20,7 +20,7 @@ index 921add1dc..ff0112c52 100644 int i = entity.ae; int j = entity.ag; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getChunkAt(i, j).b(entity); } diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index fc7154a597..cb2be3fc01 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Anti-Xray diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a87258bbe..a395406d5 100644 +index 19f4c61cdc..3acb1ff9fd 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ @@ -30,8 +30,8 @@ index a87258bbe..a395406d5 100644 + public ChunkEdgeMode chunkEdgeMode; + public int maxChunkSectionIndex; + public int updateRadius; -+ public List hiddenBlocks; -+ public List replacementBlocks; ++ public List hiddenBlocks; ++ public List replacementBlocks; + private void antiXray() { + antiXray = getBoolean("anti-xray.enabled", false); + asynchronous = true; @@ -42,14 +42,14 @@ index a87258bbe..a395406d5 100644 + 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")); ++ hiddenBlocks = getList("anti-xray.hidden-blocks", Arrays.asList("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("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..1ba8477bf +index 0000000000..1ba8477bf9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockController.java @@ -0,0 +0,0 @@ @@ -100,7 +100,7 @@ index 000000000..1ba8477bf +} 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..ed21f8515 +index 0000000000..65d3e88c3b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java @@ -0,0 +0,0 @@ @@ -111,6 +111,8 @@ index 000000000..ed21f8515 +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + ++import net.minecraft.server.IRegistry; ++import net.minecraft.server.MinecraftKey; +import org.bukkit.World.Environment; + +import com.destroystokyo.paper.PaperWorldConfig; @@ -177,8 +179,8 @@ index 000000000..ed21f8515 + } else { + Set predefinedBlockDataSet = new HashSet(); + -+ for (Object id : paperWorldConfig.hiddenBlocks) { -+ Block block = Block.getByName(String.valueOf(id)); ++ for (String id : paperWorldConfig.hiddenBlocks) { ++ Block block = IRegistry.BLOCK.get(new MinecraftKey(id)); + + if (block != null && !block.isTileEntity()) { + predefinedBlockDataSet.add(block.getBlockData()); @@ -200,8 +202,8 @@ index 000000000..ed21f8515 + predefinedBlockDataBitsEndStoneGlobal = null; + } + -+ for (Object id : (engineMode == EngineMode.HIDE) ? paperWorldConfig.hiddenBlocks : paperWorldConfig.replacementBlocks) { -+ Block block = Block.getByName(String.valueOf(id)); ++ for (String id : (engineMode == EngineMode.HIDE) ? paperWorldConfig.hiddenBlocks : paperWorldConfig.replacementBlocks) { ++ Block block = IRegistry.BLOCK.get(new MinecraftKey(id)); + + if (block != null) { + obfuscateGlobal[ChunkSection.GLOBAL_PALETTE.getDataBits(block.getBlockData())] = true; @@ -774,7 +776,7 @@ index 000000000..ed21f8515 +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java new file mode 100644 -index 000000000..41618994b +index 0000000000..41618994b4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfo.java @@ -0,0 +0,0 @@ @@ -861,7 +863,7 @@ index 000000000..41618994b +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java new file mode 100644 -index 000000000..e255a45fa +index 0000000000..e255a45fa3 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketInfoAntiXray.java @@ -0,0 +0,0 @@ @@ -896,7 +898,7 @@ index 000000000..e255a45fa +} 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..cc586827a +index 0000000000..cc586827aa --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsReader.java @@ -0,0 +0,0 @@ @@ -958,7 +960,7 @@ index 000000000..cc586827a +} 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..37093419c +index 0000000000..37093419cf --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/DataBitsWriter.java @@ -0,0 +0,0 @@ @@ -1047,7 +1049,7 @@ index 000000000..37093419c + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8b8083093..358934455 100644 +index eed37198b0..b88d232c85 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 { @@ -1069,7 +1071,7 @@ index 8b8083093..358934455 100644 this.initLighting(); } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 54840851b..0f1423c9a 100644 +index 68a3169c31..6a33bbb231 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 { @@ -1091,7 +1093,7 @@ index 54840851b..0f1423c9a 100644 chunksection.getBlocks().a(nbttagcompound, "Palette", "BlockStates"); chunksection.a(new NibbleArray(nbttagcompound.getByteArray("BlockLight"))); diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 233cbb6d6..8c116b74c 100644 +index 233cbb6d60..8c116b74c5 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -0,0 +0,0 @@ public class ChunkSection { @@ -1112,29 +1114,29 @@ index 233cbb6d6..8c116b74c 100644 if (flag) { this.skyLight = new NibbleArray(); diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index ed20454d0..2b14e0051 100644 +index 99e752ddd6..c2dd61248d 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java @@ -0,0 +0,0 @@ public class ChunkTaskScheduler extends Scheduler> { @@ -1332,7 +1334,7 @@ index f8facddb4..b2afec5e4 100644 public void a() { this.o(); diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 9787f5b06..d666685c5 100644 +index 6321010246..d0ff96812e 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -0,0 +0,0 @@ @@ -1421,7 +1423,7 @@ index 9787f5b06..d666685c5 100644 if (flag) { packetdataserializer.writeBytes(chunksection.getSkyLightArray().asBytes()); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index fcd9f5491..346367b68 100644 +index f8d8a44a88..e7d465fb8a 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 { @@ -1452,7 +1454,7 @@ index fcd9f5491..346367b68 100644 } 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 4a439ef4c..063f2b920 100644 +index cae24961fd..a9690fb1c3 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 { @@ -1465,7 +1467,7 @@ index 4a439ef4c..063f2b920 100644 public void a(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 584a86c11..62a7d3c23 100644 +index 541435d3e5..0b4f0d2414 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { @@ -1494,6 +1496,24 @@ index 584a86c11..62a7d3c23 100644 this.d = new AtomicInteger(); this.f = Maps.newEnumMap(HeightMap.Type.class); this.g = ChunkStatus.EMPTY; +@@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { + IRegistry iregistry1 = IRegistry.BLOCK; + + IRegistry.BLOCK.getClass(); +- this.q = new ProtoChunkTickList(predicate, function, iregistry1::getOrDefault, chunkcoordintpair); ++ this.q = new ProtoChunkTickList(predicate, function, IRegistry.BLOCK::getOrDefault, chunkcoordintpair); // Paper - decompile fix + predicate = (fluidtype) -> { + return fluidtype == null || fluidtype == FluidTypes.a; + }; +@@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { + function = iregistry::getKey; + iregistry1 = IRegistry.FLUID; + IRegistry.FLUID.getClass(); +- this.r = new ProtoChunkTickList(predicate, function, iregistry1::getOrDefault, chunkcoordintpair); ++ this.r = new ProtoChunkTickList(predicate, function, IRegistry.FLUID::getOrDefault, chunkcoordintpair); // Paper - decompile fix + } + + public static ShortList a(ShortList[] ashortlist, int i) { @@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { return iblockdata; } @@ -1513,7 +1533,7 @@ index 584a86c11..62a7d3c23 100644 if (enumskyblock == EnumSkyBlock.SKY) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a4d9f0d5f..7b694efb6 100644 +index 2a7abae942..17b5ef00f5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ @@ -1525,7 +1545,7 @@ index a4d9f0d5f..7b694efb6 100644 import com.destroystokyo.paper.event.server.ServerExceptionEvent; import com.destroystokyo.paper.exception.ServerInternalException; import com.google.common.base.MoreObjects; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1533,15 +1553,15 @@ index a4d9f0d5f..7b694efb6 100644 public final co.aikar.timings.WorldTimingsHandler timings; // Paper public boolean guardEntityList; // Spigot // Paper - public -@@ -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) { +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + protected World(IDataManager idatamanager, @Nullable PersistentCollection persistentcollection, 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit end IBlockData iblockdata1 = chunk.a(blockposition, iblockdata, (i & 64) != 0); @@ -1550,7 +1570,7 @@ index a4d9f0d5f..7b694efb6 100644 if (iblockdata1 == null) { // CraftBukkit start - remove blockstate if failed diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java -index c26f0ed16..f6915d32a 100644 +index c26f0ed16b..f6915d32ab 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java @@ -0,0 +0,0 @@ import org.bukkit.material.MaterialData; diff --git a/Spigot-Server-Patches/AnvilDamageEvent.patch b/Spigot-Server-Patches/AnvilDamageEvent.patch index 7990f3a804..4df3306a84 100644 --- a/Spigot-Server-Patches/AnvilDamageEvent.patch +++ b/Spigot-Server-Patches/AnvilDamageEvent.patch @@ -5,12 +5,12 @@ Subject: [PATCH] AnvilDamageEvent diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index fb3413d81..3b23ef986 100644 +index f2e15fa545..96fcd35bfe 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -0,0 +0,0 @@ public class ContainerAnvil extends Container { if (!world.isClientSide) { - if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a(TagsBlock.y) && entityhuman.getRandom().nextFloat() < 0.12F) { + if (!entityhuman.abilities.canInstantlyBuild && iblockdata.a(TagsBlock.ANVIL) && entityhuman.getRandom().nextFloat() < 0.12F) { IBlockData iblockdata1 = BlockAnvil.a_(iblockdata); + // Paper start + com.destroystokyo.paper.event.block.AnvilDamagedEvent event = new com.destroystokyo.paper.event.block.AnvilDamagedEvent(getBukkitView(), iblockdata1 != null ? org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(iblockdata1) : null); diff --git a/Spigot-Server-Patches/AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch index f860725797..f74ab1cb6c 100644 --- a/Spigot-Server-Patches/AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/AsyncTabCompleteEvent.patch @@ -14,7 +14,7 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 60d9f5706a..a912fb3414 100644 +index 5ffe4b374e..93807ffa62 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 { @@ -29,8 +29,16 @@ index 60d9f5706a..a912fb3414 100644 + minecraftServer.postToMainThread(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper return; } -- // CraftBukkit end -- ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener()); + // CraftBukkit end +@@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { + stringreader.skip(); + } + +- ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener()); +- +- this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { +- if (((Suggestions) suggestions).isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer +- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (Suggestions) suggestions)); // CraftBukkit - decompile error + // Paper start + com.destroystokyo.paper.event.server.AsyncTabCompleteEvent event; + java.util.List completions = new java.util.ArrayList<>(); @@ -65,10 +73,7 @@ index 60d9f5706a..a912fb3414 100644 + minecraftServer.postToMainThread(() -> sendSuggestions(packetplayintabcomplete, null)); + } + public void sendSuggestions(PacketPlayInTabComplete packetplayintabcomplete, java.util.List otherSuggestions) { - -- this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { -- if (((Suggestions) suggestions).isEmpty()) return; // CraftBukkit - don't send through empty suggestions - prevents [] from showing for plugins with nothing more to offer -- this.networkManager.sendPacket(new PacketPlayOutTabComplete(packetplayintabcomplete.b(), (Suggestions) suggestions)); // CraftBukkit - decompile error ++ + ParseResults parseresults = this.minecraftServer.getCommandDispatcher().a().parse(packetplayintabcomplete.c(), this.player.getCommandListener()); + //noinspection unchecked + java.util.concurrent.CompletableFuture completionSuggestions = this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults); @@ -85,7 +90,7 @@ index 60d9f5706a..a912fb3414 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3d4bb6d8c9..b5fd412b74 100644 +index 0eea57eb7d..99f4b40f7f 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/Auto-Save-Improvements.patch b/Spigot-Server-Patches/Auto-Save-Improvements.patch index 061a5c673e..e7fd63f3c1 100644 --- a/Spigot-Server-Patches/Auto-Save-Improvements.patch +++ b/Spigot-Server-Patches/Auto-Save-Improvements.patch @@ -32,7 +32,7 @@ index aa0e3c757d..c1845d6811 100644 + } } diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index ec6b550ff6..499230af60 100644 +index 547ab09627..78a3188274 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; @@ -64,30 +64,30 @@ index ec6b550ff6..499230af60 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ace64c0345..229215180b 100644 +index 2efb870dd6..6c766f2bf7 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 { - private final TickList t; - private final TickList u; - private boolean v; -- private boolean w; -+ private boolean w; public boolean hasEntities() { return w; } // Paper - OBFHELPER + private final TickList s; + private final TickList t; + private boolean u; +- private boolean v; ++ private boolean v;public boolean hasEntities() { return v; } // Paper - OBFHELPER private long lastSaved; -- private boolean y; -+ private boolean y; public boolean isModified() { return y; } // Paper - OBFHELPER - private int z; - private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER - private int B; +- private boolean x; ++ private boolean x; public boolean isModified() { return x; } // Paper - OBFHELPER + private int y; + private long z; + private int A; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - if (this.w && this.world.getTime() != this.lastSaved || this.y) { + if (this.v && this.world.getTime() != this.lastSaved || this.x) { return true; } -- } else if (this.w && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification +- } else if (this.v && this.world.getTime() >= this.lastSaved + MinecraftServer.getServer().autosavePeriod * 4) { // Spigot - Only save if we've passed 2 auto save intervals without modification - return true; } - -- return this.y; +- return this.x; + // Paper start - Make world configurable and incremental + // This !flag section should say if isModified or hasEntities, then check auto save + return ((isModified() || hasEntities()) && this.world.getTime() >= this.lastSaved + world.paperConfig.autoSavePeriod); @@ -96,39 +96,32 @@ index ace64c0345..229215180b 100644 public boolean isEmpty() { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index a5139b0b0d..aa8d25e765 100644 +index 53dc1322e8..90840e4709 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -0,0 +0,0 @@ - package net.minecraft.server; - -+import com.destroystokyo.paper.PaperConfig; - import com.google.common.collect.Lists; - import it.unimi.dsi.fastutil.longs.Long2ObjectMap; - import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - this.saveChunk(chunk, false); // Spigot - chunk.a(false); - ++i; -- if (i == 24 && !flag && false) { // Spigot -+ if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max per tick - return false; + this.saveChunk(chunk, false); // Spigot + chunk.a(false); + ++i; +- if (i == 24 && !flag && false) { // Spigot ++ if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max + return false; + } } - } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index bdd1fef710..9c04fa4a6f 100644 +index 96d7be49d8..2c4fc9f3e6 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 { + private static final Logger cc = LogManager.getLogger(); - private static final IChatBaseComponent cd = (new ChatMessage("multiplayer.message_not_delivered", new Object[0])).a(EnumChatFormat.RED); public String locale = null; // CraftBukkit - lowercase // Paper - default to null + public long lastSave = MinecraftServer.currentTick; // Paper public PlayerConnection playerConnection; public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e3469cacff..02daa43c68 100644 +index 25946d2d79..ee13260af7 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 @@ -140,7 +133,7 @@ index e3469cacff..02daa43c68 100644 public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.n.b().a(agameprofile); + this.m.b().a(agameprofile); } - if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit @@ -161,7 +154,7 @@ index e3469cacff..02daa43c68 100644 // and causes the main thread to sleep for random amounts of time depending on chunk activity // Also pass flag to only save modified chunks server.playerCommandState = true; - for (World world : worlds) { + for (World world : getWorlds()) { - world.getWorld().save(false); + if (world.paperConfig.autoSavePeriod > 0) world.getWorld().save(false); // Paper - Incremental / Configurable Auto Saving } @@ -173,9 +166,9 @@ index e3469cacff..02daa43c68 100644 + //} // Paper - Incremental Auto Saving this.methodProfiler.a("snooper"); - if (getSnooperEnabled() && !this.j.d() && this.ticks > 100) { // Spigot + if (getSnooperEnabled() && !this.i.d() && this.ticks > 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index d0c547cc99..12f6812d67 100644 +index 02dbb8c6c3..73d72ef7e3 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 { @@ -214,13 +207,13 @@ index d0c547cc99..12f6812d67 100644 public WhiteList getWhitelist() { return this.whitelist; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 96002184bb..bf07155bc1 100644 +index 4be3a6ae94..59b5a04581 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 { ChunkProviderServer chunkproviderserver = this.getChunkProviderServer(); - if (chunkproviderserver.e()) { + if (chunkproviderserver.d()) { - org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + if (flag) org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit // Paper - Incremental Auto Saving - Only fire event on full save timings.worldSave.startTiming(); // Paper diff --git a/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch b/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch index 8da585c64e..e9ad8ee2b9 100644 --- a/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch +++ b/Spigot-Server-Patches/Auto-fix-bad-Y-levels-on-player-login.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Auto fix bad Y levels on player login Bring down to a saner Y level if super high, as this can cause the server to crash diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9c04fa4a6f..9bb70c151d 100644 +index 2c4fc9f3e6..47cf068a1e 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/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index eae9b99d1a..5d3e97c359 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 @@ -10,7 +10,7 @@ to the object directly on the Entity/TileEntity object we can directly grab. Use that local value instead to reduce lookups in many hot places. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index d2e87693fa..1997cbdc65 100644 +index 5599025d66..37716447c2 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 { @@ -22,10 +22,10 @@ index d2e87693fa..1997cbdc65 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 852977cab3..fbca973225 100644 +index 32c8fb4531..27d84e3ba9 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int j; // Paper start - Set based removal lists for (Entity e : this.g) { @@ -42,7 +42,7 @@ index 852977cab3..fbca973225 100644 } for (Entity e : this.g) { -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.e(); this.methodProfiler.a("remove"); if (entity.dead) { @@ -61,7 +61,7 @@ index 852977cab3..fbca973225 100644 guardEntityList = false; // Spigot this.entityList.remove(this.tickPosition--); // CraftBukkit - Use field for loop variable -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc BlockPosition blockposition = tileentity.getPosition(); // Paper start - Skip ticking in chunks scheduled for unload @@ -69,8 +69,8 @@ index 852977cab3..fbca973225 100644 + net.minecraft.server.Chunk chunk = tileentity.getCurrentChunk(); boolean shouldTick = chunk != null; if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload) - shouldTick = shouldTick && !chunk.isUnloading() && chunk.scheduledForUnload == null; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + shouldTick = shouldTick && chunk.scheduledForUnload == null; +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); //this.tileEntityList.remove(tileentity); // Paper - remove unused list diff --git a/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch b/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch index 56ab77091c..2f1ea57b6a 100644 --- a/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch +++ b/Spigot-Server-Patches/Avoid-blocking-on-Network-Manager-creation.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Avoid blocking on Network Manager creation Per Paper issue 294 diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index be8d07f41e..9808561eb3 100644 +index 9cff011dac..f04ce2fb03 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java @@ -0,0 +0,0 @@ public class ServerConnection { 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 b043815129..1e0c6e80d7 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 01401c4447..57ebd1e77a 100644 +index d2412624e1..ef09ac7873 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/Avoid-item-merge-if-stack-size-above-max-stack-size.patch b/Spigot-Server-Patches/Avoid-item-merge-if-stack-size-above-max-stack-size.patch index ae4a52d773..03480ce439 100644 --- a/Spigot-Server-Patches/Avoid-item-merge-if-stack-size-above-max-stack-size.patch +++ b/Spigot-Server-Patches/Avoid-item-merge-if-stack-size-above-max-stack-size.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Avoid item merge if stack size above max stack size diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index d232bab745..b0f22f8f09 100644 +index 946e59753e..f596b4351b 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -0,0 +0,0 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch index 7e4ad8942a..79047d8e4c 100644 --- a/Spigot-Server-Patches/Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/Basic-PlayerProfile-API.patch @@ -403,7 +403,7 @@ index 0000000000..3aceb0ea8a + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 381542e0d2..80927de08b 100644 +index 966309a07d..e36e2e0a31 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +0,0 @@ @@ -428,7 +428,7 @@ index 381542e0d2..80927de08b 100644 * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5635997d0b..02b6218807 100644 +index 6aec7c31e3..014c923897 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 @@ -444,8 +444,8 @@ index 5635997d0b..02b6218807 100644 this.G = i; } -+ public MinecraftSessionService getSessionService() { return ar(); } // Paper - OBFHELPER - public MinecraftSessionService ar() { ++ public MinecraftSessionService getSessionService() { return ap(); } // Paper - OBFHELPER + public MinecraftSessionService ap() { return this.V; } diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java @@ -485,7 +485,7 @@ index a47a51a412..4c476f757c 100644 private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 42b3447a1a..3d4bb6d8c9 100644 +index 5c48430313..0eea57eb7d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.util.CraftNamespacedKey; diff --git a/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch b/Spigot-Server-Patches/Block-Enderpearl-Travel-Exploit.patch index 4d79ffa2c0..1dcb68acb0 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 9daa8f66a1..3467da7c8e 100644 +index 9ff73d531c..16e601f7e9 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/Block-player-logins-during-server-shutdown.patch b/Spigot-Server-Patches/Block-player-logins-during-server-shutdown.patch index e45ab67b5f..a7b16352b7 100644 --- a/Spigot-Server-Patches/Block-player-logins-during-server-shutdown.patch +++ b/Spigot-Server-Patches/Block-player-logins-during-server-shutdown.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Block player logins during server shutdown diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index fae8a13973..005efbc111 100644 +index 19ac21e385..8bbea96240 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { diff --git a/Spigot-Server-Patches/Bound-Treasure-Maps-to-World-Border.patch b/Spigot-Server-Patches/Bound-Treasure-Maps-to-World-Border.patch index fcfa133c65..efb80ba5c7 100644 --- a/Spigot-Server-Patches/Bound-Treasure-Maps-to-World-Border.patch +++ b/Spigot-Server-Patches/Bound-Treasure-Maps-to-World-Border.patch @@ -11,19 +11,19 @@ that is outside happens to be closer, but unreachable, yet another reachable one is in border that would of been missed. diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 263ea953ad..8b8b468f39 100644 +index 142655c57e..6c2899e84d 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java @@ -0,0 +0,0 @@ public abstract class StructureGenerator - if (flag || flag1) { + if (flag1 || flag2) { ChunkCoordIntPair chunkcoordintpair = this.a(chunkgenerator, seededrandom, j, k, i1, j1); + if (!world.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper StructureStart structurestart = this.a(world, chunkgenerator, seededrandom, chunkcoordintpair.a()); if (structurestart != StructureGenerator.a) { diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index ec5386fd50..08424a88bf 100644 +index 1a87480f09..057ea1c5ac 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -0,0 +0,0 @@ public class WorldBorder { diff --git a/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch b/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch index 13d4ed8030..c0b6891aa4 100644 --- a/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch +++ b/Spigot-Server-Patches/Break-up-and-make-tab-spam-limits-configurable.patch @@ -22,7 +22,7 @@ to take the burden of this into their own hand without having to rely on plugins doing unsafe things. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index c457d0711..046bf33f6 100644 +index c457d07110..046bf33f66 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 { @@ -45,7 +45,7 @@ index c457d0711..046bf33f6 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f7401f5c9..6ebc0a95e 100644 +index 66e01b8131..b7949ac256 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/Cache-World-Entity-Type-counts.patch b/Spigot-Server-Patches/Cache-World-Entity-Type-counts.patch index 58f01f703c..580d9e5a7c 100644 --- a/Spigot-Server-Patches/Cache-World-Entity-Type-counts.patch +++ b/Spigot-Server-Patches/Cache-World-Entity-Type-counts.patch @@ -133,7 +133,7 @@ index 0000000000..35104542c5 + } +} diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 41a951d580..03d54a7ef4 100644 +index de34a70e9b..5e87ee9726 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 @@ -145,7 +145,7 @@ index 41a951d580..03d54a7ef4 100644 public float length; public float J; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 903434e5f4..68765d2aad 100644 +index 4a8c3a428d..8f610c013a 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -170,23 +170,23 @@ index 79e52f7bac..42f6a6a93a 100644 return this.e; } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index f525fd1b42..2f20dfcfcf 100644 +index 32808558bb..0a57b26551 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { - // CraftBukkit end if ((!enumcreaturetype.c() || flag1) && (enumcreaturetype.c() || flag) && (!enumcreaturetype.d() || flag2)) { -- k = worldserver.a(enumcreaturetype.a()); -+ k = worldserver.entityList.getCreatureCount(enumcreaturetype); // Paper - entity count cache - int l1 = limit * i / b; // CraftBukkit - use per-world limits + k = limit * i / SpawnerCreature.b; // CraftBukkit - use per-world limits +- int l1 = worldserver.a(enumcreaturetype.a(), k); ++ int l1 = k = worldserver.entityList.getCreatureCount(enumcreaturetype); // Paper - entity count cache - if (k <= l1) { + if (l1 <= k) { + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 004c3ec474..16d0c0d45b 100644 +index 4ea31bc201..abf3796d91 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private static final EnumDirection[] a = EnumDirection.values(); private int b = 63; // Spigot start - guard entity list from removals @@ -196,15 +196,15 @@ index 004c3ec474..16d0c0d45b 100644 { @Override public Entity remove(int index) -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } }; + */ // Paper end // Spigot end - protected final Set g = Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER + protected final Set g = com.google.common.collect.Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper public final co.aikar.timings.WorldTimingsHandler timings; // Paper @@ -213,7 +213,7 @@ index 004c3ec474..16d0c0d45b 100644 public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; private org.spigotmc.TickLimiter entityLimiter; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.getChunkAt(i, j).b(entity); } entity.shouldBeRemoved = true; // Paper diff --git a/Spigot-Server-Patches/Cache-user-authenticator-threads.patch b/Spigot-Server-Patches/Cache-user-authenticator-threads.patch index dccf4a870a..99e5a09e37 100644 --- a/Spigot-Server-Patches/Cache-user-authenticator-threads.patch +++ b/Spigot-Server-Patches/Cache-user-authenticator-threads.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache user authenticator threads diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index eb936a0445..fae8a13973 100644 +index dea401c924..19ac21e385 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -22,7 +22,7 @@ index eb936a0445..fae8a13973 100644 public void initUUID() { @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { - this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.G().getPublic(), this.e)); + this.networkManager.sendPacket(new PacketLoginOutEncryptionBegin("", this.server.E().getPublic(), this.e)); } else { // Spigot start - new Thread("User Authenticator #" + LoginListener.b.incrementAndGet()) { @@ -54,7 +54,7 @@ index eb936a0445..fae8a13973 100644 @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { - return LoginListener.this.server.U() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; + return LoginListener.this.server.S() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; } - }; - diff --git a/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch b/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch index cb308d2eb6..693bfbcefd 100644 --- a/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch +++ b/Spigot-Server-Patches/Call-PaperServerListPingEvent-for-legacy-pings.patch @@ -84,7 +84,7 @@ index 0000000000..74c012fd40 + +} diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 07c53f5057..91acfceec8 100644 +index f7fbf1d76e..1ed2b193a5 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -0,0 +0,0 @@ import java.net.InetSocketAddress; @@ -104,7 +104,7 @@ index 07c53f5057..91acfceec8 100644 switch (i) { case 0: LegacyPingHandler.a.debug("Ping: (<1.3.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); -- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())}); +- s = String.format("%s\u00a7%d\u00a7%d", new Object[] { minecraftserver.getMotd(), Integer.valueOf(minecraftserver.y()), Integer.valueOf(minecraftserver.z())}); + // Paper start - Call PaperServerListPingEvent and use results + event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 39, null); + if (event == null) { @@ -122,7 +122,7 @@ index 07c53f5057..91acfceec8 100644 } - LegacyPingHandler.a.debug("Ping: (1.4-1.5.x) from {}:{}", inetsocketaddress.getAddress(), Integer.valueOf(inetsocketaddress.getPort())); -- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.A()), Integer.valueOf(minecraftserver.B())}); +- s = String.format("\u00a71\u0000%d\u0000%s\u0000%s\u0000%d\u0000%d", new Object[] { Integer.valueOf(127), minecraftserver.getVersion(), minecraftserver.getMotd(), Integer.valueOf(minecraftserver.y()), Integer.valueOf(minecraftserver.z())}); + // Paper start - Call PaperServerListPingEvent and use results + event = PaperLegacyStatusClient.processRequest(minecraftserver, inetsocketaddress, 61, null); + if (event == null) { diff --git a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch index 432c10677c..0384a2f3ec 100644 --- a/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch +++ b/Spigot-Server-Patches/Call-PortalCreateEvent-for-exit-portals.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Call PortalCreateEvent for exit portals diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 402d8d7d..72b85bf6 100644 +index 5e899e05cf..20f2a9197c 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -0,0 +0,0 @@ public class PortalTravelAgent { @@ -50,7 +50,7 @@ index 402d8d7d..72b85bf6 100644 + java.util.Map nmsBlocks = new java.util.LinkedHashMap<>(); // Paper + if (d0 < 0.0D) { - i1 = MathHelper.clamp(i1, 70, this.world.aa() - 10); + i1 = MathHelper.clamp(i1, 70, this.world.ab() - 10); j5 = i1; @@ -0,0 +0,0 @@ public class PortalTravelAgent { l3 = j2 + (l2 - 1) * l5 - k2 * k5; diff --git a/Spigot-Server-Patches/Cap-Entity-Collisions.patch b/Spigot-Server-Patches/Cap-Entity-Collisions.patch index c910b0ded7..d12d4f342a 100644 --- a/Spigot-Server-Patches/Cap-Entity-Collisions.patch +++ b/Spigot-Server-Patches/Cap-Entity-Collisions.patch @@ -12,7 +12,7 @@ just as it does in Vanilla, but entity pushing logic will be capped. You can set this to 0 to disable collisions. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b95f259a9a..4991138dfe 100644 +index 391cdd2fa5..8923454524 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,7 +27,7 @@ index b95f259a9a..4991138dfe 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 3955884e10..33683301b2 100644 +index a16fbd4579..cad4894000 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 @@ -39,7 +39,7 @@ index 3955884e10..33683301b2 100644 // Spigot end diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index fdfef98a3f..5da05c0825 100644 +index 1b8763f618..8c56eeb11c 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 { diff --git a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch index 80910da595..fcdf0cf28e 100644 --- a/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch +++ b/Spigot-Server-Patches/Change-implementation-of-tile-entity-removal-list.patch @@ -5,36 +5,24 @@ Subject: [PATCH] Change implementation of (tile)entity removal list diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index aed5e4330..f6d7070de 100644 +index 8b90b13d15..9fb87914ff 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.event.block.BlockPhysicsEvent; - import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; - import org.bukkit.generator.ChunkGenerator; - // CraftBukkit end -- -+// Paper start -+import java.util.Set; -+import com.google.common.collect.Sets; -+// Paper end - public abstract class World implements GeneratorAccess, IIBlockAccess, AutoCloseable { - - protected static final Logger e = LogManager.getLogger(); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } }; // Spigot end - protected final List g = Lists.newArrayList(); -+ protected final Set g = Sets.newHashSet(); // Paper ++ protected final Set g = com.google.common.collect.Sets.newHashSet(); // Paper public final List tileEntityList = Lists.newArrayList(); public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); - private final List tileEntityListUnload = Lists.newArrayList(); -+ private final Set tileEntityListUnload = Sets.newHashSet(); // Paper ++ private final Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper public final List players = Lists.newArrayList(); public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.entityList.removeAll(this.g); int j; diff --git a/Spigot-Server-Patches/Check-online-mode-before-converting-and-renaming-pla.patch b/Spigot-Server-Patches/Check-online-mode-before-converting-and-renaming-pla.patch index 178d1d875f..b476ee1201 100644 --- a/Spigot-Server-Patches/Check-online-mode-before-converting-and-renaming-pla.patch +++ b/Spigot-Server-Patches/Check-online-mode-before-converting-and-renaming-pla.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Check online mode before converting and renaming player data diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index a5157269c..a562e1e46 100644 +index ee28e4d401..0fd6efec0b 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { diff --git a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch index b1e423c302..a515a3d3fe 100644 --- a/Spigot-Server-Patches/Chunk-Save-Reattempt.patch +++ b/Spigot-Server-Patches/Chunk-Save-Reattempt.patch @@ -5,30 +5,8 @@ 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 b247d5f07..f007af2e1 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 { - NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper - - if (nbttagcompound != null) { -+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { // Paper - try { - this.b(chunkcoordintpair, nbttagcompound); -+ laste = null; break; // Paper - } catch (Exception exception) { -- ChunkRegionLoader.a.error("Failed to save chunk", exception); -+ //ChunkRegionLoader.a.error("Failed to save chunk", exception); // Paper -+ laste = exception; // Paper - } -+ try {Thread.sleep(10);} catch (InterruptedException e) {e.printStackTrace();} } // Paper -+ if (laste != null) { com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); MinecraftServer.LOGGER.error("Failed to save chunk", laste); } // Paper - } - - flag = true; diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index cc7cad8be..b8b514c87 100644 +index cc7cad8be4..b8b514c874 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -0,0 +0,0 @@ public class RegionFile { @@ -41,4 +19,38 @@ index cc7cad8be..b8b514c87 100644 } } +diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java +index e5115863ec..2217adf99c 100644 +--- a/src/main/java/net/minecraft/server/RegionFileCache.java ++++ b/src/main/java/net/minecraft/server/RegionFileCache.java +@@ -0,0 +0,0 @@ public class RegionFileCache { + + @Nullable + public static synchronized void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { ++ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper + RegionFile regionfile = a(file, i, j); + + DataOutputStream dataoutputstream = regionfile.c(i & 31, j & 31); + NBTCompressedStreamTools.a(nbttagcompound, (java.io.DataOutput) dataoutputstream); + dataoutputstream.close(); ++ // Paper start ++ laste = null; break; // Paper ++ } catch (Exception exception) { ++ //ChunkRegionLoader.a.error("Failed to save chunk", exception); // Paper ++ laste = exception; // Paper ++ } ++ try { ++ Thread.sleep(10); ++ } catch (InterruptedException e) { ++ e.printStackTrace(); ++ } ++ } ++ if (laste != null) { ++ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste); ++ MinecraftServer.LOGGER.error("Failed to save chunk", laste); ++ } ++ // Paper end + } + + public static synchronized boolean chunkExists(File file, int i, int j) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch index 38618f4377..0b7d5c2106 100644 --- a/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch +++ b/Spigot-Server-Patches/Chunk-Save-Stats-Debug-Option.patch @@ -8,58 +8,57 @@ Adds a command line flag to enable stats on how chunk saves are processing. Stats on current queue, how many was processed and how many were queued. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index c1a42e61e7..c96f1b2753 100644 +index 87960344f1..6b8d4c79e8 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - public final Long2ObjectMap chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192)); - private final ChunkTaskScheduler f; - private final SchedulerBatch g; + public final LongSet unloadQueue = new LongOpenHashSet(); + public final ChunkGenerator chunkGenerator; + private final IChunkLoader chunkLoader; + // Paper start - chunk save stats + private long lastQueuedSaves = 0L; // Paper + private long lastProcessedSaves = 0L; // Paper + private long lastSaveStatPrinted = System.currentTimeMillis(); + // Paper end - public final WorldServer world; - - public ChunkProviderServer(WorldServer worldserver, IChunkLoader ichunkloader, ChunkGenerator chunkgenerator, IAsyncTaskHandler iasynctaskhandler) { + public final Long2ObjectMap chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192)); + private Chunk lastChunk; + private final ChunkTaskScheduler chunkScheduler; @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - // Paper start - final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; - final int queueSize = chunkLoader.getQueueSize(); + // Paper start + final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; + final int queueSize = chunkLoader.getQueueSize(); + -+ final long now = System.currentTimeMillis(); -+ final long timeSince = (now - lastSaveStatPrinted) / 1000; -+ final Integer printRateSecs = Integer.getInteger("printSaveStats"); -+ if (printRateSecs != null && timeSince >= printRateSecs) { -+ final String timeStr = "/" + timeSince +"s"; -+ final long queuedSaves = chunkLoader.getQueuedSaves(); -+ long queuedDiff = queuedSaves - lastQueuedSaves; -+ lastQueuedSaves = queuedSaves; ++ final long now = System.currentTimeMillis(); ++ final long timeSince = (now - lastSaveStatPrinted) / 1000; ++ final Integer printRateSecs = Integer.getInteger("printSaveStats"); ++ if (printRateSecs != null && timeSince >= printRateSecs) { ++ final String timeStr = "/" + timeSince +"s"; ++ final long queuedSaves = chunkLoader.getQueuedSaves(); ++ long queuedDiff = queuedSaves - lastQueuedSaves; ++ lastQueuedSaves = queuedSaves; + -+ final long processedSaves = chunkLoader.getProcessedSaves(); -+ long processedDiff = processedSaves - lastProcessedSaves; -+ lastProcessedSaves = processedSaves; ++ final long processedSaves = chunkLoader.getProcessedSaves(); ++ long processedDiff = processedSaves - lastProcessedSaves; ++ lastProcessedSaves = processedSaves; + -+ lastSaveStatPrinted = now; -+ if (processedDiff > 0 || queueSize > 0 || queuedDiff > 0) { -+ System.out.println("[Chunk Save Stats] " + world.worldData.getName() + -+ " - Current: " + queueSize + -+ " - Queued: " + queuedDiff + timeStr + -+ " - Processed: " +processedDiff + timeStr -+ ); ++ lastSaveStatPrinted = now; ++ if (processedDiff > 0 || queueSize > 0 || queuedDiff > 0) { ++ System.out.println("[Chunk Save Stats] " + world.worldData.getName() + ++ " - Current: " + queueSize + ++ " - Queued: " + queuedDiff + timeStr + ++ " - Processed: " +processedDiff + timeStr ++ ); ++ } + } -+ } -+ - if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ - return false; - } + if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ + return false; + } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 859148cb86..ea8684747d 100644 +index 3283b5047d..110c9ef520 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 { - } + } - public int getQueueSize() { return queue.size(); } // Paper @@ -74,19 +73,19 @@ index 859148cb86..ea8684747d 100644 // CraftBukkit start - Add async variant, provide compatibility @Nullable @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - - protected synchronized void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot - queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements -+ queuedSaves++; // Paper - this.b.put(chunkcoordintpair, nbttagcompound); - FileIOThread.a().a(this); } + + protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot ++ queuedSaves++; // Paper + synchronized (this.queue) { // Paper - synchronize while modifying the map + queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements + this.b.put(chunkcoordintpair, nbttagcompound); @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - return false; } else { ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements + Supplier nbttagcompound = chunk.compoundSupplier; // Spigot // Paper + processedSaves.incrementAndGet(); // Paper - boolean flag; - + if (nbttagcompound == null) { + return true; -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Chunk-registration-fixes.patch b/Spigot-Server-Patches/Chunk-registration-fixes.patch index c2671acf50..974ad2d9b2 100644 --- a/Spigot-Server-Patches/Chunk-registration-fixes.patch +++ b/Spigot-Server-Patches/Chunk-registration-fixes.patch @@ -8,10 +8,10 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr Keep them consistent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e74b53c483..20e52fbcc8 100644 +index 1ed4408e2a..0fd91a687e 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } i = MathHelper.floor(entity.locX / 16.0D); diff --git a/Spigot-Server-Patches/Chunk-save-queue-improvements.patch b/Spigot-Server-Patches/Chunk-save-queue-improvements.patch index 9b26e6f928..757bf59c79 100644 --- a/Spigot-Server-Patches/Chunk-save-queue-improvements.patch +++ b/Spigot-Server-Patches/Chunk-save-queue-improvements.patch @@ -26,7 +26,7 @@ Then finally, Sleeping will by default be removed, but due to known issues with But if sleeps are to remain enabled, we at least lower the sleep interval so it doesn't have as much negative impact. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index d48ef7e85..280cfd553 100644 +index 0d68ffd75a..fd00c320ce 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 { @@ -41,7 +41,7 @@ index d48ef7e85..280cfd553 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 5001fd11d..b247d5f07 100644 +index f969c036f3..2b0a088a6a 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; @@ -66,15 +66,12 @@ index 5001fd11d..b247d5f07 100644 + this.compoundSupplier = compoundSupplier; + } + } -+ private ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); ++ final private ConcurrentLinkedQueue queue = new ConcurrentLinkedQueue<>(); + // Paper end + private static final Logger a = LogManager.getLogger(); -- private final Object2ObjectMap> b = Object2ObjectMaps.synchronize(new Object2ObjectLinkedOpenHashMap()); // Spigot -+ private final Object2ObjectMap> b = new Object2ObjectLinkedOpenHashMap(); // Spigot // Paper - remove synchronized + private final Map> b = Maps.newHashMap(); private final File c; - private final DataFixer d; - private PersistentStructureLegacy e; @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } }; @@ -89,68 +86,58 @@ index 5001fd11d..b247d5f07 100644 @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } - protected synchronized void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot -+ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements - this.b.put(chunkcoordintpair, nbttagcompound); + protected void a(ChunkCoordIntPair chunkcoordintpair, Supplier nbttagcompound) { // Spigot +- this.b.put(chunkcoordintpair, nbttagcompound); ++ synchronized (this.queue) { // Paper - synchronize while modifying the map ++ queue.add(new QueuedChunk(chunkcoordintpair, nbttagcompound)); // Paper - Chunk queue improvements ++ this.b.put(chunkcoordintpair, nbttagcompound); ++ } FileIOThread.a().a(this); } -- public synchronized boolean a() { -+ public boolean a() { // Paper - remove synchronized - // CraftBukkit start - return this.processSaveQueueEntry(false); +@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { } -- private synchronized boolean processSaveQueueEntry(boolean logCompletion) { -- Iterator>> iter = this.b.entrySet().iterator(); // Spigot -- if (!iter.hasNext()) { -+ private boolean processSaveQueueEntry(boolean logCompletion) { // Paper - dont synchronize during save -+ // CraftBukkit start + private boolean processSaveQueueEntry(boolean logCompletion) { +- Iterator iterator = this.b.entrySet().iterator(); +- if (!iterator.hasNext()) { + // Paper start - Chunk queue improvements + QueuedChunk chunk = queue.poll(); + if (chunk == null) { + // Paper - end - if (logCompletion) { - // CraftBukkit end + if (logCompletion) { // CraftBukkit ChunkRegionLoader.a.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.c.getName()); -@@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + } return false; } else { -- // CraftBukkit start -- Map.Entry> entry = iter.next(); // Spigot -- ChunkCoordIntPair chunkcoordintpair = entry.getKey(); -- Supplier value = entry.getValue(); // Spigot -- // CraftBukkit end +- Entry entry = (Entry) iterator.next(); +- +- iterator.remove(); +- ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) entry.getKey(); +- Supplier nbttagcompound = (Supplier) entry.getValue(); // Spigot + ChunkCoordIntPair chunkcoordintpair = chunk.coords; // Paper - Chunk queue improvements ++ Supplier nbttagcompound = chunk.compoundSupplier; // Spigot // Paper - boolean flag; - - try { - // NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair); // CraftBukkit -- NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(value); // Spigot -+ NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(chunk.compoundSupplier); // Spigot // Paper - - if (nbttagcompound != null) { - try { + if (nbttagcompound == null) { + return true; @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { + // CraftBukkit start + RegionFileCache.write(this.c, chunkcoordintpair.x, chunkcoordintpair.z, SupplierUtils.getIfExists(nbttagcompound)); // Spigot - flag = true; - } finally { -- this.b.remove(chunkcoordintpair, value); // CraftBukkit // Spigot -+ // Paper start - only synchronize here -+ synchronized (this) { -+ // This will not equal if a newer version is still pending - wait until newest is saved to remove -+ if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { -+ this.b.remove(chunkcoordintpair); ++ // Paper start remove from map only if this was the latest version of the chunk ++ synchronized (this.queue) { ++ // This will not equal if a newer version is still pending - wait until newest is saved to remove ++ if (this.b.get(chunkcoordintpair) == chunk.compoundSupplier) { ++ this.b.remove(chunkcoordintpair); ++ } + } -+ } -+ // Paper start - } - - return flag; ++ // Paper end + /* + NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); + dataoutputstream.close(); diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java -index 34312667a..549fab9a5 100644 +index 8c3537ab8d..170c239b77 100644 --- a/src/main/java/net/minecraft/server/FileIOThread.java +++ b/src/main/java/net/minecraft/server/FileIOThread.java @@ -0,0 +0,0 @@ public class FileIOThread implements Runnable { diff --git a/Spigot-Server-Patches/Complete-resource-pack-API.patch b/Spigot-Server-Patches/Complete-resource-pack-API.patch index 557949314b..4d23df002b 100644 --- a/Spigot-Server-Patches/Complete-resource-pack-API.patch +++ b/Spigot-Server-Patches/Complete-resource-pack-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9827e08b7d..5b045dc2a9 100644 +index 86f485e6ff..b56bb9d531 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/Configurable-Allowance-of-Permanent-Chunk-Loaders.patch b/Spigot-Server-Patches/Configurable-Allowance-of-Permanent-Chunk-Loaders.patch deleted file mode 100644 index 7e8900950a..0000000000 --- a/Spigot-Server-Patches/Configurable-Allowance-of-Permanent-Chunk-Loaders.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Sat, 21 Apr 2018 11:21:48 -0400 -Subject: [PATCH] Configurable Allowance of Permanent Chunk Loaders - -This disables the behavior that allows players to keep chunks permanently loaded -by default and allows server operators to enable it if they wish. - -diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 37315233e..044da2754 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 { - break; - } - } -+ public boolean allowPermaChunkLoaders = false; -+ private void allowPermaChunkLoaders() { -+ allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders); -+ log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled")); -+ } - } -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 497372124..0e0c7b1ab 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - Long2ObjectMap long2objectmap = this.chunks; - - synchronized (this.chunks) { -- Chunk chunk = this.getLoadedChunkAt(i, j); -+ Chunk chunk = world.paperConfig.allowPermaChunkLoaders ? getLoadedChunkAt(i, j) : getChunkIfLoaded(i, j); // Paper - Configurable perma chunk loaders - - return chunk != null ? chunk : this.loadChunkAt(i, j); - } --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch b/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch index 47829b1880..365945bd15 100644 --- a/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch +++ b/Spigot-Server-Patches/Configurable-Alternative-LootPool-Luck-Formula.patch @@ -52,13 +52,13 @@ index 9bfbaf61e5..bcdf4f91d8 100644 + } + } } -diff --git a/src/main/java/net/minecraft/server/LotoSelectorEntry.java b/src/main/java/net/minecraft/server/LotoSelectorEntry.java -index add618866b..9f8e17b9d3 100644 ---- a/src/main/java/net/minecraft/server/LotoSelectorEntry.java -+++ b/src/main/java/net/minecraft/server/LotoSelectorEntry.java +diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java +index 3d501aee30..464f74b269 100644 +--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java ++++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java @@ -0,0 +0,0 @@ import java.util.Random; - public abstract class LotoSelectorEntry { + public abstract class LootSelectorEntry { - protected final int c; - protected final int d; @@ -66,8 +66,8 @@ index add618866b..9f8e17b9d3 100644 + protected final int d; public int getQuality() { return d; } // Paper - OBFHELPER protected final LootItemCondition[] e; - protected LotoSelectorEntry(int i, int j, LootItemCondition[] alootitemcondition) { -@@ -0,0 +0,0 @@ public abstract class LotoSelectorEntry { + protected LootSelectorEntry(int i, int j, LootItemCondition[] alootitemcondition) { +@@ -0,0 +0,0 @@ public abstract class LootSelectorEntry { } public int a(float f) { diff --git a/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch b/Spigot-Server-Patches/Configurable-Bed-Search-Radius.patch index 227b6d2768..47133b6a1b 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 2701388043..7bd7aa0d94 100644 +index 8724c2816b..fb2467636a 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 { @@ -30,7 +30,7 @@ index 2701388043..7bd7aa0d94 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockBed.java b/src/main/java/net/minecraft/server/BlockBed.java -index 6832eaac5d..b9cb59fa72 100644 +index 4e60509891..47cf1db6ae 100644 --- a/src/main/java/net/minecraft/server/BlockBed.java +++ b/src/main/java/net/minecraft/server/BlockBed.java @@ -0,0 +0,0 @@ public class BlockBed extends BlockFacingHorizontal implements ITileEntity { diff --git a/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch index d5a7cd2c99..3e6aa92279 100644 --- a/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch +++ b/Spigot-Server-Patches/Configurable-Cartographer-Treasure-Maps.patch @@ -9,7 +9,7 @@ Also allow turning off treasure maps all together as they can eat up Map ID's which are limited in quantity. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 872001d041..b95f259a9a 100644 +index c22afafd6a..391cdd2fa5 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 { @@ -28,7 +28,7 @@ index 872001d041..b95f259a9a 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 45df38bad4..e8fdf86250 100644 +index 10921c1cbc..0227196f1e 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -36,7 +36,7 @@ index 45df38bad4..e8fdf86250 100644 int i = this.a.a(random); World world = imerchant.getWorld(); + if (!world.paperConfig.enableTreasureMaps) return; //Paper - BlockPosition blockposition = world.a(this.b, imerchant.getPosition(), 100); + BlockPosition blockposition = world.a(this.b, imerchant.getPosition(), 100, true); if (blockposition != null) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch b/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch index 625fa59cf2..544dca1d15 100644 --- a/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch +++ b/Spigot-Server-Patches/Configurable-Chunk-Inhabited-Timer.patch @@ -9,7 +9,7 @@ aspects of vanilla gameplay to this factor. For people who want all chunks to be treated equally, you can disable the timer. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b3b3baddc0..613964ce04 100644 +index 5f3156af60..f62faf81e7 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 { @@ -23,24 +23,15 @@ index b3b3baddc0..613964ce04 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 4b440c7077..e8a943cf74 100644 +index 30dc4fb6df..0ef1a8c7d3 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 { - private long lastSaved; - private boolean y; - private int z; -- private long A; -+ private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER - private int B; - private final ConcurrentLinkedQueue C; - public boolean d; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { } public long m() { -- return this.A; -+ return world.paperConfig.useInhabitedTime ? getInhabitedTime() : 0; // Paper +- return this.z; ++ return world.paperConfig.useInhabitedTime ? this.z : 0; // Paper } public void b(long i) { 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 872e98b212..1412c6412b 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 1c642e6364..87c0feb25e 100644 +index 9864c95a8c..9188e49b71 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 index 2faa9801d5..667bc50f90 100644 --- a/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch +++ b/Spigot-Server-Patches/Configurable-Grass-Spread-Tick-Rate.patch @@ -5,7 +5,7 @@ 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 613964ce04..bb1c1c57cc 100644 +index f62faf81e7..ee38eb8e05 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -20,7 +20,7 @@ index 613964ce04..bb1c1c57cc 100644 + } } diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java -index 6343fb1e0d..903e8241b8 100644 +index b0e08a3365..52ae980d37 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 { 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 1cc8b631c1..3ce514bdc6 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 @@ -6,7 +6,7 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world This lets you disable it for some worlds and lower it for others. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index bb1c1c57cc..667a0dde8c 100644 +index ee38eb8e05..61e6dcb0ee 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 { @@ -21,7 +21,7 @@ index bb1c1c57cc..667a0dde8c 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8fa7f6e1bb..649fff95b0 100644 +index 090618a51c..3fe374acb2 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 @@ -63,10 +63,10 @@ index 8fa7f6e1bb..649fff95b0 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index dcc1d08b16..4c33c331f0 100644 +index c862f36628..bbfa92e85f 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int k = i * 16 + 8 - blockposition.getX(); int l = j * 16 + 8 - blockposition.getZ(); boolean flag = true; @@ -76,13 +76,13 @@ index dcc1d08b16..4c33c331f0 100644 + return k >= -keepLoadedRange && k <= keepLoadedRange && l >= -keepLoadedRange && l <= keepLoadedRange && this.keepSpawnInMemory; // CraftBukkit - Added 'this.keepSpawnInMemory' // Paper - Re-add range var } - public void a(Packet packet) { + public LongSet ag() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7ad009c073..3861c63cb8 100644 +index 272e127735..89f6c77dbc 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 { - System.out.println("Preparing start region for level " + (console.worlds.size() - 1) + " (Seed: " + internal.getSeed() + ")"); + System.out.println("Preparing start region for level " + (console.worldServer.size() - 1) + " (Seed: " + internal.getSeed() + ")"); if (internal.getWorld().getKeepSpawnInMemory()) { - short short1 = 196; @@ -91,7 +91,7 @@ index 7ad009c073..3861c63cb8 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 cb80fce3b5..907791a5f1 100644 +index 132b21f8bc..9637c98994 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-Max-Chunk-Gens-per-Tick.patch b/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch index 58f591a28f..cadb090e66 100644 --- a/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch +++ b/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch @@ -13,7 +13,7 @@ This should result in no noticeable speed reduction in generation for servers no lagging, and let larger servers reduce this value according to their own desires. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 87c0feb25e..f3ab146d3b 100644 +index 9188e49b71..a225b55853 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 { @@ -33,7 +33,7 @@ index 87c0feb25e..f3ab146d3b 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 344b95233f..fcd9f5491f 100644 +index 3f4a8f21c0..f8d8a44a88 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 { @@ -45,9 +45,9 @@ index 344b95233f..fcd9f5491f 100644 private Runnable loadedRunnable = new Runnable() { public void run() { @@ -0,0 +0,0 @@ public class PlayerChunk { - this.playerChunkMap = playerchunkmap; - this.location = new ChunkCoordIntPair(i, j); - this.chunk = playerchunkmap.getWorld().getChunkProviderServer().getOrLoadChunkAt(i, j); + + chunkproviderserver.a(i, j); + this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); + this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper markChunkUsed(); // Paper - delay chunk unloads } diff --git a/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch b/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch index 91ceb20501..a4e056829b 100644 --- a/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch +++ b/Spigot-Server-Patches/Configurable-Non-Player-Arrow-Despawn-Rate.patch @@ -24,7 +24,7 @@ index 6f96627a2e..0de3007392 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index e16c8e8d98..75445b00dc 100644 +index b0f93d9cf5..c24225892f 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -0,0 +0,0 @@ public abstract class EntityArrow extends Entity implements IProjectile { diff --git a/Spigot-Server-Patches/Configurable-Player-Collision.patch b/Spigot-Server-Patches/Configurable-Player-Collision.patch index 236f2d02cc..ad85b2f881 100644 --- a/Spigot-Server-Patches/Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/Configurable-Player-Collision.patch @@ -19,14 +19,13 @@ index a6042ca607..9fe1311143 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 204cf4f648..67c60be6f7 100644 +index 3fe374acb2..b45cdcd09f 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.getWorldServer(DimensionManager.OVERWORLD).worldMaps); + // CraftBukkit end - 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()); @@ -35,7 +34,7 @@ index 204cf4f648..67c60be6f7 100644 + } + + if (!com.destroystokyo.paper.PaperConfig.enablePlayerCollisions) { -+ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + worlds.get(0).random.nextInt(), 16); ++ this.getPlayerList().collideRuleTeamName = org.apache.commons.lang3.StringUtils.left("collideRule_" + java.util.concurrent.ThreadLocalRandom.current().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 + } @@ -57,7 +56,7 @@ index a6aed2531f..575e3762b2 100644 packetdataserializer.a(this.c); packetdataserializer.a(this.d); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7f324a9c0f..d0c547cc99 100644 +index 8121f8e40a..02dbb8c6c3 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 { @@ -73,7 +72,7 @@ index 7f324a9c0f..d0c547cc99 100644 entityplayer.syncInventory(); + // Paper start - Add to collideRule team if needed -+ final Scoreboard scoreboard = this.getServer().getWorldServer(0).getScoreboard(); ++ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam collideRuleTeam = scoreboard.getTeam(collideRuleTeamName); + if (this.collideRuleTeamName != null && collideRuleTeam != null && entityplayer.getTeam() == null) { + scoreboard.addPlayerToTeam(entityplayer.getName(), collideRuleTeam); @@ -88,7 +87,7 @@ index 7f324a9c0f..d0c547cc99 100644 + // Paper start - Remove from collideRule team if needed + if (this.collideRuleTeamName != null) { -+ final Scoreboard scoreBoard = this.server.getWorldServer(0).getScoreboard(); ++ final Scoreboard scoreBoard = this.server.getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreBoard.getTeam(this.collideRuleTeamName); + if (entityplayer.getTeam() == team && team != null) { + scoreBoard.removePlayerFromTeam(entityplayer.getName(), team); @@ -106,7 +105,7 @@ index 7f324a9c0f..d0c547cc99 100644 - + // Paper start - Remove collideRule team if it exists + if (this.collideRuleTeamName != null) { -+ final Scoreboard scoreboard = this.getServer().getWorldServer(0).getScoreboard(); ++ final Scoreboard scoreboard = this.getServer().getWorldServer(DimensionManager.OVERWORLD).getScoreboard(); + final ScoreboardTeam team = scoreboard.getTeam(this.collideRuleTeamName); + if (team != null) scoreboard.removeTeam(team); + } diff --git a/Spigot-Server-Patches/Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/Configurable-RCON-IP-address.patch index acc368ad05..b97df7df66 100644 --- a/Spigot-Server-Patches/Configurable-RCON-IP-address.patch +++ b/Spigot-Server-Patches/Configurable-RCON-IP-address.patch @@ -6,7 +6,7 @@ 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 6f0176f6ff..c237f239f3 100644 +index f91da84ff9..3d831b358b 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 { @@ -15,7 +15,7 @@ index 6f0176f6ff..c237f239f3 100644 this.l = iminecraftserver.a("rcon.password", ""); - this.j = iminecraftserver.e(); + this.j = iminecraftserver.a("rcon.ip", ((DedicatedServer) iminecraftserver).getServerIp()); // Paper - this.i = iminecraftserver.f(); + this.i = iminecraftserver.e_(); 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 7ea2ec8f25..b75caf7b83 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 59bd3e28f0..f8d2aae082 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b66df45bde..0b1c5ca475 100644 +index b44d056651..a9b08dcb0e 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 8da907c3ba..17136b3874 100644 --- a/Spigot-Server-Patches/Configurable-end-credits.patch +++ b/Spigot-Server-Patches/Configurable-end-credits.patch @@ -20,24 +20,24 @@ index 4b36a0f053..53921b381e 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 3a04cac5c9..2dc70ffbf0 100644 +index 3112ee5453..9f23c0d2c2 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 { - private long cv = SystemUtils.b(); - private Entity cw; + private long cu = SystemUtils.b(); + private Entity cv; public boolean worldChangeInvuln; -- private boolean cy; -+ private boolean cy; private void setHasSeenCredits(boolean has) { this.cy = has; } // Paper - OBFHELPER - private final RecipeBookServer cz; - private Vec3D cA; - private int cB; +- private boolean cx; ++ private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER + private final RecipeBookServer cy; + private Vec3D cz; + private int cA; @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.world.kill(this); if (!this.viewingCredits) { this.viewingCredits = true; + if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits - this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cy ? 0.0F : 1.0F)); - this.cy = true; + this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(4, this.cx ? 0.0F : 1.0F)); + this.cx = true; } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/Configurable-flying-kick-messages.patch index 5507968efd..537640cbe0 100644 --- a/Spigot-Server-Patches/Configurable-flying-kick-messages.patch +++ b/Spigot-Server-Patches/Configurable-flying-kick-messages.patch @@ -21,7 +21,7 @@ index b496bc3869..aa0e3c757d 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index eec02ba0e9..969e28c3b2 100644 +index 830f3a89a8..77f12b4d1d 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-inter-world-teleportation-safety.patch b/Spigot-Server-Patches/Configurable-inter-world-teleportation-safety.patch index a12edbaeb1..08290df446 100644 --- a/Spigot-Server-Patches/Configurable-inter-world-teleportation-safety.patch +++ b/Spigot-Server-Patches/Configurable-inter-world-teleportation-safety.patch @@ -16,7 +16,7 @@ The wanted destination was on top of the emerald block however the player ended This only is the case if the player is teleporting between worlds. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c98286999..4a2d29674 100644 +index c982869995..4a2d296746 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 { @@ -30,7 +30,7 @@ index c98286999..4a2d29674 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 90cb2d277..8b3c2d287 100644 +index 4320efaef5..9f2c7d3f45 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 { @@ -43,7 +43,7 @@ index 90cb2d277..8b3c2d287 100644 entityplayer.getBukkitEntity().setVelocity(velocity); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0beb10f82..59e60923b 100644 +index 8db92714ea..86f485e6ff 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/Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/Configurable-packet-in-spam-threshold.patch index 237c1c993f..09a23af622 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 0a8fc7927a..b496bc3869 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ed02cd7a7a..eec02ba0e9 100644 +index def0db5fea..830f3a89a8 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-spawn-chances-for-skeleton-horses.patch b/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch index 1eff4dfa10..90b25e9bb5 100644 --- a/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch +++ b/Spigot-Server-Patches/Configurable-spawn-chances-for-skeleton-horses.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable spawn chances for skeleton horses diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0de3007392..c2c33d75bf 100644 +index 0de3007392..b05277067a 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 { @@ -15,20 +15,23 @@ index 0de3007392..c2c33d75bf 100644 + + public double skeleHorseSpawnChance; + private void skeleHorseSpawnChance() { -+ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state ++ skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); ++ if (skeleHorseSpawnChance < 0) { ++ skeleHorseSpawnChance = 0.01D; // Vanilla value ++ } + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index dd09ab20e7..ecee3b4064 100644 +index 1188184f13..253019d89b 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 { + blockposition = this.a(new BlockPosition(j + (l & 15), 0, k + (l >> 8 & 15))); if (this.isRainingAt(blockposition)) { DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); +- boolean flag2 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D; ++ boolean flag2 = this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper -- if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * 0.01D) { -+ if (this.getGameRules().getBoolean("doMobSpawning") && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance) { + if (flag2) { EntityHorseSkeleton entityhorseskeleton = new EntityHorseSkeleton(this); - - entityhorseskeleton.s(true); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch index d2359423bf..3d2ba08e4b 100644 --- a/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/Configurable-speed-for-water-flowing-over-lava.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable speed for water flowing over lava diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a395406d5..db2bfb851 100644 +index 3acb1ff9fd..24f353d6fc 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 { @@ -22,42 +22,44 @@ index a395406d5..db2bfb851 100644 SAFE_REGEN, REGEN, DELETE, NOTHING, WARN } diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java -index 6ecc1f84e..7c4986fab 100644 +index 5346eaa348..ec77cbd57e 100644 --- a/src/main/java/net/minecraft/server/BlockFluids.java +++ b/src/main/java/net/minecraft/server/BlockFluids.java @@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource { public void onPlace(IBlockData iblockdata, World world, BlockPosition blockposition, IBlockData iblockdata1) { if (this.a(world, blockposition, iblockdata)) { -- world.H().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.H().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } -+ /** -+ * Paper - Get flow speed. Throttle if its water and flowing adjacent to lava -+ */ ++ // Paper start - Get flow speed. Throttle if its water and flowing adjacent to lava + public int getFlowSpeed(World world, BlockPosition blockposition) { -+ if (this.material == Material.WATER && ( -+ world.getType(blockposition.north(1)).getBlock().material == Material.LAVA || -+ world.getType(blockposition.south(1)).getBlock().material == Material.LAVA || -+ world.getType(blockposition.west(1)).getBlock().material == Material.LAVA || -+ world.getType(blockposition.east(1)).getBlock().material == Material.LAVA)) { -+ return world.paperConfig.waterOverLavaFlowSpeed; ++ if (this.material == Material.WATER) { ++ if ( ++ world.getMaterialIfLoaded(blockposition.north(1)) == Material.LAVA || ++ world.getMaterialIfLoaded(blockposition.south(1)) == Material.LAVA || ++ world.getMaterialIfLoaded(blockposition.west(1)) == Material.LAVA || ++ world.getMaterialIfLoaded(blockposition.east(1)) == Material.LAVA ++ ) { ++ return world.paperConfig.waterOverLavaFlowSpeed; ++ } + } + return this.a(world); + } ++ // Paper end + public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { if (iblockdata.s().d() || iblockdata1.s().d()) { - generatoraccess.H().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); + generatoraccess.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) generatoraccess)); @@ -0,0 +0,0 @@ public class BlockFluids extends Block implements IFluidSource { public void doPhysics(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (this.a(world, blockposition, iblockdata)) { -- world.H().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); -+ world.H().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper +- world.I().a(blockposition, iblockdata.s().c(), this.a((IWorldReader) world)); ++ world.I().a(blockposition, iblockdata.s().c(), this.getFlowSpeed(world, blockposition)); // Paper } } diff --git a/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch b/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch index 2bb84546c3..b1cee7703b 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 2ce60eb05d..9daa8f66a1 100644 +index c9a44863cc..9ff73d531c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -20,7 +20,7 @@ index 2ce60eb05d..9daa8f66a1 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 55c45973e1..015cd553dd 100644 +index 0551ae2290..6ae76477c0 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/Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch index e96486c8af..89eda2a54d 100644 --- a/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/Configurable-top-of-nether-void-damage.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable top of nether void damage diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 38a697e1b..68898d624 100644 +index 38a697e1b7..68898d624f 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -20,7 +20,7 @@ index 38a697e1b..68898d624 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 106cf19d8..c7acd0629 100644 +index 02ac5c4c0c..f6cdff0ef9 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 @@ -63,7 +63,7 @@ index 106cf19d8..c7acd0629 100644 this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index 6e48cf475..4644d7efe 100644 +index 025158675f..932fbff7c7 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -0,0 +0,0 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT diff --git a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch index ef42089cb3..46223af55d 100644 --- a/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch +++ b/Spigot-Server-Patches/Custom-replacement-for-eaten-items.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5363a2c704..03c6c77a60 100644 +index ed6f5e70f3..442981f938 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 { 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 f817ebe511..433288e79a 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 fd00c320ce..620f23f4f0 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 53adc9e1a0..b68af1c285 100644 +index bd99aa72c4..8d059d75ac 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 78b99992db..598cb2cb47 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 @@ -17,7 +17,7 @@ This allows servers with smaller worlds who do less long distance exploring to s wasting cpu cycles on saving/unloading/reloading chunks repeatedly. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 41e73b3409..ec6b550ff6 100644 +index f8102d9f07..547ab09627 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 { @@ -40,23 +40,23 @@ index 41e73b3409..ec6b550ff6 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 63ca61c1d6..ace64c0345 100644 +index 0ef1a8c7d3..2efb870dd6 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 { - private boolean j; public boolean isLoaded() { return j; } // Paper - OBFHELPER + private boolean i;public boolean isLoaded() { return i; } // Paper - OBFHELPER public final World world; public final Map heightMap; + public Long scheduledForUnload; // Paper - delay chunk unloads public final int locX; public final int locZ; - private boolean m; + private boolean l; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 2925c345a1..a5139b0b0d 100644 +index 6b041f06e4..53dc1322e8 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - + } activityAccountant.endActivity(); // Spigot } + // Paper start - delayed chunk unloads @@ -73,16 +73,16 @@ index 2925c345a1..a5139b0b0d 100644 + } + // Paper end - this.f.a(); - this.chunkLoader.b(); + this.chunkScheduler.a(booleansupplier); + } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index ffff87dc03..344b95233f 100644 +index ac0e90eeca..3f4a8f21c0 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 { public void run() { loadInProgress = false; - PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getOrLoadChunkAt(location.x, location.z); + PlayerChunk.this.chunk = PlayerChunk.this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(location.x, location.z, true, true); + markChunkUsed(); // Paper - delay chunk unloads } }; @@ -96,21 +96,22 @@ index ffff87dc03..344b95233f 100644 // CraftBukkit end public PlayerChunk(PlayerChunkMap playerchunkmap, int i, int j) { - this.playerChunkMap = playerchunkmap; - this.location = new ChunkCoordIntPair(i, j); - this.chunk = playerchunkmap.getWorld().getChunkProviderServer().getOrLoadChunkAt(i, j); +@@ -0,0 +0,0 @@ public class PlayerChunk { + + chunkproviderserver.a(i, j); + this.chunk = chunkproviderserver.getChunkAt(i, j, true, false); + markChunkUsed(); // Paper - delay chunk unloads } public ChunkCoordIntPair a() { @@ -0,0 +0,0 @@ public class PlayerChunk { - this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z); - } else { - this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getOrLoadChunkAt(this.location.x, this.location.z); -+ markChunkUsed(); // Paper - delay chunk unloads - } - + return true; + } else { + this.chunk = this.playerChunkMap.getWorld().getChunkProviderServer().getChunkAt(this.location.x, this.location.z, true, flag); ++ markChunkUsed(); // Paper - delay chunk unloads return this.chunk != null; + } + } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java index 4d888d6d4f..cf5c76a78e 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -131,11 +132,11 @@ index 4d888d6d4f..cf5c76a78e 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7dae87199e..b6efd8506b 100644 +index 8005b0c110..c6fa54848e 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 (!tileentity.x() && tileentity.u()) { +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + if (!tileentity.x() && tileentity.hasWorld()) { BlockPosition blockposition = tileentity.getPosition(); - if (this.isLoaded(blockposition) && this.K.a(blockposition)) { @@ -143,14 +144,14 @@ index 7dae87199e..b6efd8506b 100644 + net.minecraft.server.Chunk chunk = this.getChunkIfLoaded(blockposition); + boolean shouldTick = chunk != null; + if(this.paperConfig.skipEntityTickingInChunksScheduledForUnload) -+ shouldTick = shouldTick && !chunk.isUnloading() && chunk.scheduledForUnload == null; ++ shouldTick = shouldTick && chunk.scheduledForUnload == null; + if (shouldTick && this.K.a(blockposition)) { + // Paper end try { 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 907791a5f1..579e783d11 100644 +index 9637c98994..6b3b45f94a 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 { @@ -163,7 +164,7 @@ index 907791a5f1..579e783d11 100644 } diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java -index a9b84fdec4..e02647f806 100644 +index a9b84fdec4..34d2f11f4f 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java @@ -0,0 +0,0 @@ public class ActivationRange @@ -171,8 +172,9 @@ index a9b84fdec4..e02647f806 100644 isActive = false; } + // Paper start - Skip ticking in chunks scheduled for unload -+ if(entity.world.paperConfig.skipEntityTickingInChunksScheduledForUnload && (chunk == null || chunk.isUnloading() || chunk.scheduledForUnload != null)) ++ else if (entity.world.paperConfig.skipEntityTickingInChunksScheduledForUnload && (chunk == null || chunk.scheduledForUnload != null)) { + isActive = false; ++ } + // Paper end return isActive; } diff --git a/Spigot-Server-Patches/Detect-and-repair-corrupt-Region-Files.patch b/Spigot-Server-Patches/Detect-and-repair-corrupt-Region-Files.patch index 814cfd37ed..4613e1e853 100644 --- a/Spigot-Server-Patches/Detect-and-repair-corrupt-Region-Files.patch +++ b/Spigot-Server-Patches/Detect-and-repair-corrupt-Region-Files.patch @@ -11,7 +11,7 @@ I don't know why mojang only checks for 4096, when anything less than 8192 is a But to be safe, it will attempt to back up the file. diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index cba237312..070392233 100644 +index cba2373125..0703922332 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -0,0 +0,0 @@ public class RegionFile { diff --git a/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch b/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch index 3757cf7443..cb04ad9fce 100644 --- a/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch +++ b/Spigot-Server-Patches/Disable-Explicit-Network-Manager-Flushing.patch @@ -12,7 +12,7 @@ flushing on the netty event loop, so it won't do the flush on the main thread. Renable flushing by passing -Dpaper.explicit-flush=true diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 4f3f88ff..f8facddb 100644 +index 4f3f88ff66..f8facddb40 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { diff --git a/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch index 2fc6071079..bb0e471761 100644 --- a/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/Disable-Scoreboards-for-non-players-by-default.patch @@ -25,7 +25,7 @@ index 4a2d296746..2b25da0465 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c7acd06298..27020c7e29 100644 +index f6cdff0ef9..9e1c427fcc 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 @@ -37,7 +37,7 @@ index c7acd06298..27020c7e29 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index af595bf2bc..5363a2c704 100644 +index dd216c64e9..ed6f5e70f3 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 { diff --git a/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch b/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch index 354749f321..0ae93102f2 100644 --- a/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch +++ b/Spigot-Server-Patches/Disable-Vanilla-Chunk-GC.patch @@ -6,18 +6,17 @@ Subject: [PATCH] Disable Vanilla Chunk GC Bukkit has its own system for this. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index bf07155bc1..8f6ce6bf1a 100644 +index 59b5a04581..e58b21ae43 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 { chunkproviderserver.a(flag); timings.worldSaveChunks.stopTiming(); // Paper // CraftBukkit - ArrayList -> Collection -- Collection arraylist = chunkproviderserver.a(); -+ /* //Paper start Collection arraylist = chunkproviderserver.a(); ++ /* //Paper start - disable vanilla chunk GC + java.util.Collection arraylist = chunkproviderserver.a(); Iterator iterator = arraylist.iterator(); - while (iterator.hasNext()) { @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { if (chunk != null && !this.manager.a(chunk.locX, chunk.locZ)) { chunkproviderserver.unload(chunk); diff --git a/Spigot-Server-Patches/Disable-explosion-knockback.patch b/Spigot-Server-Patches/Disable-explosion-knockback.patch index e3ca829f84..710c50cda1 100644 --- a/Spigot-Server-Patches/Disable-explosion-knockback.patch +++ b/Spigot-Server-Patches/Disable-explosion-knockback.patch @@ -19,36 +19,36 @@ index ae4a7cb097..f2f45ae4a6 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1722855ac5..af595bf2bc 100644 +index 8a41a1dca8..dd216c64e9 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 { - } } + } + boolean knockbackCancelled = world.paperConfig.disableExplosionKnockback && damagesource.isExplosion() && this instanceof EntityHuman; // Paper - Disable explosion knockback - if (flag1) { - if (flag) { - this.world.broadcastEntityEffect(this, (byte) 29); + if (flag1) { + if (flag) { + this.world.broadcastEntityEffect(this, (byte) 29); @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { - b0 = 2; - } + b0 = 2; + } + if (!knockbackCancelled) // Paper - Disable explosion knockback - this.world.broadcastEntityEffect(this, b0); - } + this.world.broadcastEntityEffect(this, b0); + } @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { - } } + } + if (knockbackCancelled) this.world.broadcastEntityEffect(this, (byte) 2); // Paper - Disable explosion knockback + - if (this.getHealth() <= 0.0F) { - if (!this.e(damagesource)) { - SoundEffect soundeffect = this.cs(); + if (this.getHealth() <= 0.0F) { + if (!this.e(damagesource)) { + SoundEffect soundeffect = this.cs(); diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 18c55402d9..7c676f9f34 100644 +index e440d6d631..3521d9e10c 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-spigot-tick-limiters.patch b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch index edf1878bbf..43836d0ee0 100644 --- a/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch +++ b/Spigot-Server-Patches/Disable-spigot-tick-limiters.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4a6e3c403..aed5e4330 100644 +index 9e192b7c04..8b90b13d15 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit start - Use field for loop variable co.aikar.timings.TimingHistory.entityTicks += this.entityList.size(); // Paper int entitiesThisCycle = 0; @@ -23,7 +23,7 @@ index 4a6e3c403..aed5e4330 100644 tickPosition = (tickPosition < entityList.size()) ? tickPosition : 0; entity = (Entity) this.entityList.get(this.tickPosition); // CraftBukkit end -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // Spigot start // Iterator iterator = this.tileEntityListTick.iterator(); int tilesThisCycle = 0; diff --git a/Spigot-Server-Patches/Do-not-let-armorstands-drown.patch b/Spigot-Server-Patches/Do-not-let-armorstands-drown.patch index 9fddd4ee19..5258c75259 100644 --- a/Spigot-Server-Patches/Do-not-let-armorstands-drown.patch +++ b/Spigot-Server-Patches/Do-not-let-armorstands-drown.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Do not let armorstands drown diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 578d966401..e9a746f138 100644 +index 00a46129b8..6628af7778 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving { @@ -20,7 +20,7 @@ index 578d966401..e9a746f138 100644 // Paper end } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5da05c0825..169ad7619e 100644 +index 8c56eeb11c..2ff82694b4 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 { @@ -34,10 +34,10 @@ index 5da05c0825..169ad7619e 100644 @@ -0,0 +0,0 @@ public abstract class EntityLiving extends Entity { if (this.isAlive()) { - if (this.a(TagsFluid.a) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) { + if (this.a(TagsFluid.WATER) && this.world.getType(new BlockPosition(this.locX, this.locY + (double) this.getHeadHeight(), this.locZ)).getBlock() != Blocks.BUBBLE_COLUMN) { - if (!this.ca() && !MobEffectUtil.c(this) && !flag1) { + if (!this.canBreatheUnderwater() && !MobEffectUtil.c(this) && !flag1) { // Paper - use OBFHELPER so it can be overridden - this.setAirTicks(this.l(this.getAirTicks())); + this.setAirTicks(this.k(this.getAirTicks())); if (this.getAirTicks() == -20) { this.setAirTicks(0); -- \ No newline at end of file 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 index 49d193d228..22315fe6e6 100644 --- a/Spigot-Server-Patches/Do-not-load-chunks-for-light-checks.patch +++ b/Spigot-Server-Patches/Do-not-load-chunks-for-light-checks.patch @@ -7,10 +7,10 @@ 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 83955fdd81..dcc1d08b16 100644 +index 7f39a321db..c862f36628 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (blockposition.getY() >= 256) { blockposition = new BlockPosition(blockposition.getX(), 255, blockposition.getZ()); } diff --git a/Spigot-Server-Patches/Do-not-load-chunks-for-pathfinding.patch b/Spigot-Server-Patches/Do-not-load-chunks-for-pathfinding.patch index 2c7b523d45..c27145d0ac 100644 --- a/Spigot-Server-Patches/Do-not-load-chunks-for-pathfinding.patch +++ b/Spigot-Server-Patches/Do-not-load-chunks-for-pathfinding.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Do not load chunks for pathfinding diff --git a/src/main/java/net/minecraft/server/ChunkCache.java b/src/main/java/net/minecraft/server/ChunkCache.java -index 6d153e4311..07444a86ac 100644 +index 96c0c762ac..7020152a2d 100644 --- a/src/main/java/net/minecraft/server/ChunkCache.java +++ b/src/main/java/net/minecraft/server/ChunkCache.java @@ -0,0 +0,0 @@ public class ChunkCache implements IIBlockAccess { diff --git a/Spigot-Server-Patches/Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/Don-t-allow-entities-to-ride-themselves-572.patch index f7032929bf..cab69a6173 100644 --- a/Spigot-Server-Patches/Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/Don-t-allow-entities-to-ride-themselves-572.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c287231584..3955884e10 100644 +index 7f430e590f..a16fbd4579 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/Don-t-call-getItemMeta-on-hasItemMeta.patch b/Spigot-Server-Patches/Don-t-call-getItemMeta-on-hasItemMeta.patch index c2e4e8aae3..1ef14b0aa6 100644 --- a/Spigot-Server-Patches/Don-t-call-getItemMeta-on-hasItemMeta.patch +++ b/Spigot-Server-Patches/Don-t-call-getItemMeta-on-hasItemMeta.patch @@ -11,7 +11,7 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set. Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 911463f5b..974321df8 100644 +index 911463f5b2..974321df82 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 @@ public final class CraftItemStack extends ItemStack { @@ -24,7 +24,7 @@ index 911463f5b..974321df8 100644 static boolean hasItemMeta(net.minecraft.server.ItemStack item) { diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index eb6cf1bb3..79ce3752e 100644 +index ef9d40b8a0..a161993876 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java @@ -0,0 +0,0 @@ import static org.hamcrest.Matchers.*; diff --git a/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch b/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch index a2fa02261a..11c75a1f46 100644 --- a/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch +++ b/Spigot-Server-Patches/Don-t-change-the-Entity-Random-seed-for-squids.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't change the Entity Random seed for squids diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 3099f6aa7a..2205932295 100644 +index 2dfa794a3f..522ce36cba 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal { diff --git a/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch index b1139318af..594295e180 100644 --- a/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/Don-t-let-fishinghooks-use-portals.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't let fishinghooks use portals diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 964caa080c..c287231584 100644 +index 5bd129bcaf..7f430e590f 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 @@ -15,10 +15,10 @@ index 964caa080c..c287231584 100644 - protected boolean an; + protected boolean an; public boolean inPortal() { return an; } // Paper - OBFHELPER protected int ao; - public int dimension; + public DimensionManager dimension; protected BlockPosition aq; diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 7c119282b9..4f801e8fec 100644 +index b52aaa57e3..62e8f27aa7 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { diff --git a/Spigot-Server-Patches/Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/Spigot-Server-Patches/Don-t-load-Chunks-from-Hoppers-and-other-things.patch index df470bab95..01288a6ddb 100644 --- a/Spigot-Server-Patches/Don-t-load-Chunks-from-Hoppers-and-other-things.patch +++ b/Spigot-Server-Patches/Don-t-load-Chunks-from-Hoppers-and-other-things.patch @@ -13,7 +13,7 @@ This of course is undesirable, so just return the loaded side as "primary" and treat it as a single chest if the other sides are unloaded diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index 1ad39aca3b..7262c2b19f 100644 +index dd2d62bfba..8afd48de96 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java @@ -0,0 +0,0 @@ public class BlockChest extends BlockTileEntity implements IFluidSource, IFluidC diff --git a/Spigot-Server-Patches/Don-t-load-chunks-for-villager-door-checks.patch b/Spigot-Server-Patches/Don-t-load-chunks-for-villager-door-checks.patch index 3ef7e8b6ec..8456a6de32 100644 --- a/Spigot-Server-Patches/Don-t-load-chunks-for-villager-door-checks.patch +++ b/Spigot-Server-Patches/Don-t-load-chunks-for-villager-door-checks.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Don't load chunks for villager door checks This avoids villages spam loading chunks sync diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java -index dfcabb83a1..22fe23e8ed 100644 +index bda67faefe..955041e266 100644 --- a/src/main/java/net/minecraft/server/Village.java +++ b/src/main/java/net/minecraft/server/Village.java @@ -0,0 +0,0 @@ public class Village { diff --git a/Spigot-Server-Patches/Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch b/Spigot-Server-Patches/Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch index a4455a98c0..f2731dda5a 100644 --- a/Spigot-Server-Patches/Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch +++ b/Spigot-Server-Patches/Don-t-process-despawn-if-entity-is-in-a-chunk-schedu.patch @@ -12,7 +12,7 @@ keep it vanilla in behavior a player may teleport away, and trigger instant despawn diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index bca2aa8298..903434e5f4 100644 +index d4c86c2d65..4a8c3a428d 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -20,7 +20,7 @@ index bca2aa8298..903434e5f4 100644 this.ticksFarFromPlayer = 0; } else { + Chunk currentChunk = getChunkAtLocation(); // Paper -+ if (currentChunk != null && (currentChunk.isUnloading() || currentChunk.scheduledForUnload != null)) return; // Paper ++ if (currentChunk != null && currentChunk.scheduledForUnload != null) return; // Paper EntityHuman entityhuman = this.world.findNearbyPlayer(this, -1.0D); if (entityhuman != null && entityhuman.affectsSpawning) { // Paper - Affects Spawning API diff --git a/Spigot-Server-Patches/Don-t-save-Proto-Chunks.patch b/Spigot-Server-Patches/Don-t-save-Proto-Chunks.patch index 0bed416658..21318e04d7 100644 --- a/Spigot-Server-Patches/Don-t-save-Proto-Chunks.patch +++ b/Spigot-Server-Patches/Don-t-save-Proto-Chunks.patch @@ -8,19 +8,19 @@ the loadChunk method refuses to acknoledge they exists, and will restart a new chunk generation process to begin with, so saving them serves no benefit. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index ea8684747..a97e024ec 100644 +index 110c9ef520..3074aa50e8 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 { } - public synchronized void saveChunk(World world, IChunkAccess ichunkaccess, boolean unloaded) throws IOException, ExceptionWorldConflict { + public void saveChunk(World world, IChunkAccess ichunkaccess, boolean unloaded) throws IOException, ExceptionWorldConflict { + if (ichunkaccess.i().d() == ChunkStatus.Type.PROTOCHUNK) { return; } // Paper - don't save proto chunks // Spigot end world.checkSession(); diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 5d9118daa..7629e0d05 100644 +index 22af9c1885..95eb1a84ac 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java @@ -0,0 +0,0 @@ public class ChunkTaskScheduler extends Scheduler { + return !(entity instanceof EntityHuman); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ff22feee4d..9ab6350587 100644 +index d974cb5c61..d86a23d71d 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 @@ -180,20 +180,20 @@ index ff22feee4d..9ab6350587 100644 this.uniqueID = uuid; this.au = this.uniqueID.toString(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index fbca973225..064c31c035 100644 +index 27d84e3ba9..2ad02b0a61 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } }; // Spigot end -- protected final Set g = Sets.newHashSet(); // Paper -+ protected final Set g = Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER +- protected final Set g = com.google.common.collect.Sets.newHashSet(); // Paper ++ protected final Set g = com.google.common.collect.Sets.newHashSet(); public Set getEntityUnloadQueue() { return g; };// Paper - OBFHELPER //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list public final List tileEntityListTick = Lists.newArrayList(); private final List c = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 817915a0c0..6b5b2c8258 100644 +index 8e8cf659f8..6579387623 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 { @@ -203,7 +203,7 @@ index 817915a0c0..6b5b2c8258 100644 - private final Map entitiesByUUID = Maps.newHashMap(); + public final Map entitiesByUUID = Maps.newHashMap(); // Paper public boolean savingDisabled; - private boolean K; + private boolean J; private int emptyTime; @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { this.g.remove(entity1); diff --git a/Spigot-Server-Patches/EnderDragon-Events.patch b/Spigot-Server-Patches/EnderDragon-Events.patch index 1f7c6aae4d..75346e098e 100644 --- a/Spigot-Server-Patches/EnderDragon-Events.patch +++ b/Spigot-Server-Patches/EnderDragon-Events.patch @@ -27,7 +27,7 @@ index b78d3fe508..ef8b0e765f 100644 if (this.d != null) { this.d.die(); diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java -index f741ada670..a9954c12e9 100644 +index 9c158fd588..b4887d6586 100644 --- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java +++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java @@ -0,0 +0,0 @@ public class DragonControllerStrafe extends AbstractDragonController { diff --git a/Spigot-Server-Patches/Enderman.teleportRandomly.patch b/Spigot-Server-Patches/Enderman.teleportRandomly.patch index 88307ff8a9..9c93b39afa 100644 --- a/Spigot-Server-Patches/Enderman.teleportRandomly.patch +++ b/Spigot-Server-Patches/Enderman.teleportRandomly.patch @@ -6,19 +6,19 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index a766b3895..0f64c8f2b 100644 +index 6abe45fd6f..5f636efb0c 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { super.mobTick(); } -+ public boolean teleportRandomly() { return dA(); } // Paper - OBFHELPER - protected boolean dA() { ++ public boolean teleportRandomly() { return dz(); } // Paper - OBFHELPER + protected boolean dz() { double d0 = this.locX + (this.random.nextDouble() - 0.5D) * 64.0D; double d1 = this.locY + (double) (this.random.nextInt(64) - 32); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java -index b81693d9f..9bc6a6c0c 100644 +index b81693d9ff..9bc6a6c0c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java @@ -0,0 +0,0 @@ public class CraftEnderman extends CraftMonster implements Enderman { diff --git a/Spigot-Server-Patches/EndermanAttackPlayerEvent.patch b/Spigot-Server-Patches/EndermanAttackPlayerEvent.patch index da5c8f8cb6..c4c53cfa3d 100644 --- a/Spigot-Server-Patches/EndermanAttackPlayerEvent.patch +++ b/Spigot-Server-Patches/EndermanAttackPlayerEvent.patch @@ -8,7 +8,7 @@ Allow control over whether or not an enderman aggros a player. This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 0f64c8f2b5..2db0eb4946 100644 +index 5f636efb0c..e5ccd29a08 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { diff --git a/Spigot-Server-Patches/EndermanEscapeEvent.patch b/Spigot-Server-Patches/EndermanEscapeEvent.patch index 1fbc449a60..2a01ce8f90 100644 --- a/Spigot-Server-Patches/EndermanEscapeEvent.patch +++ b/Spigot-Server-Patches/EndermanEscapeEvent.patch @@ -8,7 +8,7 @@ Fires an event anytime an enderman intends to teleport away from the player You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index ddf64ee6c5..a766b38959 100644 +index 53a3819ee4..6abe45fd6f 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -0,0 +0,0 @@ @@ -33,13 +33,13 @@ index ddf64ee6c5..a766b38959 100644 public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { if (!super.setGoalTarget(entityliving, reason, fireEvent)) { @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { - if (this.world.K() && this.ticksLived >= this.bE + 600) { + if (this.world.L() && this.ticksLived >= this.bE + 600) { float f = this.az(); - if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { + if (f > 0.5F && this.world.e(new BlockPosition(this)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper this.setGoalTarget((EntityLiving) null); - this.dA(); + this.dz(); } @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { public boolean damageEntity(DamageSource damagesource, float f) { @@ -48,7 +48,7 @@ index ddf64ee6c5..a766b38959 100644 - } else if (damagesource instanceof EntityDamageSourceIndirect) { + } else if (damagesource instanceof EntityDamageSourceIndirect && tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper for (int i = 0; i < 64; ++i) { - if (this.dA()) { + if (this.dz()) { return true; @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { } else { @@ -56,7 +56,7 @@ index ddf64ee6c5..a766b38959 100644 - if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0) { + if (damagesource.ignoresArmor() && this.random.nextInt(10) != 0 && tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper - this.dA(); + this.dz(); } @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { @@ -74,7 +74,7 @@ index ddf64ee6c5..a766b38959 100644 if (this.i.f((EntityHuman) this.d)) { - if (((EntityHuman) this.d).h(this.i) < 16.0D) { + if (((EntityHuman) this.d).h(this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper - this.i.dA(); + this.i.dz(); } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch b/Spigot-Server-Patches/Enforce-Sync-Chunk-Unloads.patch index 14580863ea..aefb4e7adc 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 84fcebd710..9cd991c3e7 100644 +index f75a2e6be7..5bfcedccc1 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 { @@ -15,7 +15,7 @@ index 84fcebd710..9cd991c3e7 100644 private boolean unloadChunk0(int x, int z, boolean save) { + Boolean result = MCUtil.ensureMain("Unload Chunk", () -> { // Paper - Ensure never async - net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkIfLoaded(x, z); + net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z, false, false); if (chunk == null) { return true; @@ -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 e5eea373a3..a19c3802d2 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 12f6812d67..c8b5a610aa 100644 +index 73d72ef7e3..cc0ed8546f 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-Chunks-never-ever-load-async.patch b/Spigot-Server-Patches/Ensure-Chunks-never-ever-load-async.patch index 23691eb737..cc3eedd2df 100644 --- a/Spigot-Server-Patches/Ensure-Chunks-never-ever-load-async.patch +++ b/Spigot-Server-Patches/Ensure-Chunks-never-ever-load-async.patch @@ -27,7 +27,7 @@ index 7b7a3d01b9..9aaca21a79 100644 public static void queueChunkLoad(World world, ChunkRegionLoader loader, ChunkProviderServer provider, int x, int z, Runnable runnable) { diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java -index 52a8c48fa4..2bbd5a7e2a 100644 +index 52a8c48fa4..4cfe24df15 100644 --- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java +++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java @@ -0,0 +0,0 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider { @@ -101,10 +101,10 @@ index a8280acf9..38dd8f17a 100644 if (i >= 0 && i < this.list.size()) { NBTBase nbtbase = (NBTBase) this.list.get(i); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d0516b088..6bb52c7d4 100644 +index dc49d9917e..be2feb441d 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc int j = MathHelper.floor(entity.locZ / 16.0D); boolean flag = entity.attachedToPlayer; @@ -118,7 +118,7 @@ index d0516b088..6bb52c7d4 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 9fc7ac8c0..249d8115e 100644 +index 9fc7ac8c02..249d8115e8 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 c59b5cf9c5..dea518e69a 100644 --- a/Spigot-Server-Patches/Entity-Tracking-Improvements.patch +++ b/Spigot-Server-Patches/Entity-Tracking-Improvements.patch @@ -7,11 +7,11 @@ 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 da1254f5e1..428eaca37a 100644 +index d070d68d7c..4d2e978894 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 - + public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper protected CraftEntity bukkitEntity; + EntityTrackerEntry tracker; // Paper @@ -19,7 +19,7 @@ index da1254f5e1..428eaca37a 100644 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index a04a06f3bf..c405cc74ba 100644 +index cce2ce9397..4dbc5eca34 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -0,0 +0,0 @@ public class EntityTrackerEntry { diff --git a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch index 5aee61ab61..f39d550f70 100644 --- a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch +++ b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch @@ -14,11 +14,11 @@ Fix this by differing entity add to world for all entities at the same time the original entity is dead, overwrite it as the logic does for unloaod queued entities. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bd31a7dcab..8b80830933 100644 +index 7b6b8f4824..eed37198b0 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 { - this.world.b(this.tileEntities.values()); + this.world.a(this.tileEntities.values()); List[] aentityslice = this.entitySlices; // Spigot int i = aentityslice.length; + List toAdd = new java.util.ArrayList<>(32); // Paper @@ -31,20 +31,21 @@ index bd31a7dcab..8b80830933 100644 } - // Paper end -- this.world.a((Collection) entityslice); -+ //this.world.a((Collection) entityslice); // Move down, add all entities at same time +- this.world.a(entityslice.stream().filter((entity) -> { +- return !(entity instanceof EntityHuman); +- })); + toAdd.addAll(entityslice); + // Paper end } -+ this.world.addChunkEntities(toAdd); // Paper - add all at same time to avoid entities adding to world modifying slice state ++ this.world.addChunkEntities(toAdd.stream().filter((entity) -> !(entity instanceof EntityHuman))); // Paper - add all at same time to avoid entities adding to world modifying slice state // CraftBukkit start org.bukkit.Server server = this.world.getServer(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b0053e5e63..004c3ec474 100644 +index 26007862ab..4ea31bc201 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } this.getChunkAt(i, j).a(entity); @@ -52,25 +53,22 @@ index b0053e5e63..004c3ec474 100644 this.entityList.add(entity); this.b(entity); return true; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - return i; +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc + return j; } -+ public void addChunkEntities(Collection collection) { a(collection); } // Paper - OBFHELPER - public void a(Collection collection) { ++ public void addChunkEntities(Stream collection) { a(collection); } // Paper - OBFHELPER + public void a(Stream stream) { org.spigotmc.AsyncCatcher.catchOp( "entity world add"); // Spigot - // CraftBukkit start -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose - while (iterator.hasNext()) { - Entity entity = (Entity) iterator.next(); - -- if (entity == null) { + stream.forEach((entity) -> { + if (entity == null || entity.dead || entity.valid) { // Paper - prevent adding already added or dead entities - continue; - } ++ return; ++ } this.entityList.add(entity); + this.b(entity); + }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 6b5b2c8258..f5911fbf08 100644 +index 6579387623..788ab40d0e 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/Entity-fromMobSpawner.patch b/Spigot-Server-Patches/Entity-fromMobSpawner.patch index 336e08afdd..f6dbbf00bd 100644 --- a/Spigot-Server-Patches/Entity-fromMobSpawner.patch +++ b/Spigot-Server-Patches/Entity-fromMobSpawner.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 33683301b2..aba517a710 100644 +index cad4894000..0e8c95d96b 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 @@ -37,7 +37,7 @@ index 33683301b2..aba517a710 100644 } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 61472a0eb2..2b6b062c61 100644 +index a62e34f7f9..ef93f433d6 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract { diff --git a/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index b40f9b9395..492b587b7b 100644 --- a/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -index 8e1f6427d5..e262ce0969 100644 +index c2bc8060ac..1ae967d1c0 100644 --- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java @@ -0,0 +0,0 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR @@ -19,7 +19,7 @@ index 8e1f6427d5..e262ce0969 100644 event.getProjectile().remove(); return; diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index 8489f45be2..379a7f84a5 100644 +index b0f7649b82..152b179ce1 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java @@ -0,0 +0,0 @@ public class ItemBow extends Item { @@ -51,14 +51,14 @@ index 8489f45be2..379a7f84a5 100644 @@ -0,0 +0,0 @@ public class ItemBow extends Item { } - world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.k.nextFloat() * 0.4F + 1.2F) + f * 0.5F); + world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ARROW_SHOOT, SoundCategory.PLAYERS, 1.0F, 1.0F / (ItemBow.i.nextFloat() * 0.4F + 1.2F) + f * 0.5F); - if (!flag1 && !entityhuman.abilities.canInstantlyBuild) { + if (!flag1 && !entityhuman.abilities.canInstantlyBuild && consumeArrow) { // Paper itemstack1.subtract(1); if (itemstack1.isEmpty()) { entityhuman.inventory.f(itemstack1); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8df07536f8..28b156e439 100644 +index 89e765e803..92960eb735 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/EntityTransformedEvent.patch b/Spigot-Server-Patches/EntityTransformedEvent.patch index b4d437eb15..dcd94e18f7 100644 --- a/Spigot-Server-Patches/EntityTransformedEvent.patch +++ b/Spigot-Server-Patches/EntityTransformedEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] EntityTransformedEvent diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index c6babe6af..a7159ef96 100644 +index 5b856aea2f..13a6ddac59 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java @@ -0,0 +0,0 @@ public class EntityMushroomCow extends EntityCow { @@ -18,7 +18,7 @@ index c6babe6af..a7159ef96 100644 for (int i = 0; i < 5; ++i) { diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index b51543ea7..51be54684 100644 +index 8fe68c2eb4..3b5d95945a 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -31,7 +31,7 @@ index b51543ea7..51be54684 100644 this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 2818ded92..d2d17094d 100644 +index e5170bff5b..04d25ad76a 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -52,7 +52,7 @@ index 2818ded92..d2d17094d 100644 this.world.a((EntityHuman) null, 1026, new BlockPosition(this), 0); } diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 9f61523be..b8b0d6592 100644 +index bf136a6aa3..94bd3c5b37 100644 --- a/src/main/java/net/minecraft/server/EntityZombieVillager.java +++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java @@ -0,0 +0,0 @@ public class EntityZombieVillager extends EntityZombie { diff --git a/Spigot-Server-Patches/Expand-Explosions-API.patch b/Spigot-Server-Patches/Expand-Explosions-API.patch index bc3ebb8a87..6ce8b3ac84 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 affbb93bfd..23f0d5cb7d 100644 +index c449a9a39b..b6589fdc68 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 c51e0931a0..0386e35f85 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 @@ -10,24 +10,20 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 5d5f6f6328..544f789bda 100644 +index e4ba13cec5..d6e330d345 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 { - // CraftBukkit - visibility api support - return sendParticles(null, t0, d0, d1, d2, i, d3, d4, d5, d6); } -- -+ // Paper start - Particle API Expansion - public int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { -+ return sendParticles(this.players, sender, t0, false, d0, d1, d2, i, d3, d5, d5, d6); + + public int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { ++ // Paper start - Particle API Expansion ++ return sendParticles(players, sender, t0, d0, d1, d2, i, d3, d4, d5, d6, force); + } -+ -+ public int sendParticles(List receivers, EntityPlayer sender, T t0, boolean force, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { - // CraftBukkit end -- PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, false, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); -+ PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, force, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); ++ public int sendParticles(List receivers, EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { + // Paper end + PacketPlayOutWorldParticles packetplayoutworldparticles = new PacketPlayOutWorldParticles(t0, force, (float) d0, (float) d1, (float) d2, (float) d3, (float) d4, (float) d5, (float) d6, i); + // CraftBukkit end int j = 0; - for (int k = 0; k < this.players.size(); ++k) { @@ -36,18 +32,18 @@ index 5d5f6f6328..544f789bda 100644 + EntityPlayer entityplayer = (EntityPlayer) entityhuman; // Paper - Particle API Expansion if (sender != null && !entityplayer.getBukkitEntity().canSee(sender.getBukkitEntity())) continue; // CraftBukkit - if (this.a(entityplayer, false, d0, d1, d2, packetplayoutworldparticles)) { + if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 5cadee4ae0..92fadd7f78 100644 +index 6347d3d1f2..63d9130918 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 { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data); - } -+ // Paper start - Particle API Expansion @Override -- public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { ++ // Paper start - Particle API Expansion ++ spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, force); ++ } + public void spawnParticle(Particle particle, List receivers, Player sender, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { + // Paper end if (data != null && !particle.getDataType().isInstance(data)) { @@ -58,8 +54,6 @@ index 5cadee4ae0..92fadd7f78 100644 + receivers == null ? getHandle().players : receivers.stream().map(player -> ((CraftPlayer) player).getHandle()).collect(java.util.stream.Collectors.toList()), // Paper - Particle API Expansion + sender != null ? ((CraftPlayer) sender).getHandle() : null, // Sender // Paper - Particle API Expansion CraftParticle.toNMS(particle, data), // Particle -+ force , // Extended range // Paper - Particle API Expansion x, y, z, // Position count, // Count - offsetX, offsetY, offsetZ, // Random offset -- \ No newline at end of file diff --git a/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch index cc40ba3b7c..8fcdaf07dc 100644 --- a/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/ExperienceOrbMergeEvent.patch @@ -8,10 +8,10 @@ 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 7cd07112a3..852977cab3 100644 +index 08aab08ec2..32c8fb4531 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; // Paper start 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 b5aa1851ec..d22de31cea 100644 --- a/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-Server-Patches/ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -8,7 +8,7 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 43feccef8f..e820bfbd56 100644 +index 7818a3b6a7..d55b076f5d 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -0,0 +0,0 @@ public class Block implements IMaterial { @@ -28,7 +28,7 @@ index 43feccef8f..e820bfbd56 100644 } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 131f8a5156..d8ab87e216 100644 +index b9afeaf72e..2c735a920d 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo @@ -41,7 +41,7 @@ index 131f8a5156..d8ab87e216 100644 } diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 3c888d6015..79d80596df 100644 +index 880f496526..31c8d4bc86 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { @@ -120,7 +120,7 @@ index 3c888d6015..79d80596df 100644 public void d(EntityHuman entityhuman) { diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 1804a49de9..82e4d2eab6 100644 +index 81de03084a..4c92896ef8 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { @@ -131,9 +131,9 @@ index 1804a49de9..82e4d2eab6 100644 + this.owner.world.addEntity(new EntityExperienceOrb(this.owner.world, this.owner.locX, this.owner.locY + 0.5D, this.owner.locZ + 0.5D, playerFishEvent.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.FISHING, this.owner, this)); // Paper } // CraftBukkit end - if (itemstack1.getItem().a(TagsItem.D)) { + if (itemstack1.getItem().a(TagsItem.FISHES)) { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 422b826d61..fdfef98a3f 100644 +index 60f22959b5..1b8763f618 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 { @@ -160,7 +160,7 @@ index a5e1939e05..e73dba09a6 100644 this.die(); diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index e8fdf86250..b51543ea7a 100644 +index 0227196f1e..8fe68c2eb4 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -0,0 +0,0 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -186,7 +186,7 @@ index 4a128f707b..b870964674 100644 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 54ee305eba..6e524353b5 100644 +index 1bfa7e5e69..4e44180329 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 { @@ -199,7 +199,7 @@ index 54ee305eba..6e524353b5 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/SlotFurnaceResult.java b/src/main/java/net/minecraft/server/SlotFurnaceResult.java -index 998662d9e6..6b4eb7f053 100644 +index 22c47c63c7..52e296d468 100644 --- a/src/main/java/net/minecraft/server/SlotFurnaceResult.java +++ b/src/main/java/net/minecraft/server/SlotFurnaceResult.java @@ -0,0 +0,0 @@ import org.bukkit.event.inventory.FurnaceExtractEvent; @@ -221,7 +221,7 @@ index 998662d9e6..6b4eb7f053 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9cd991c3e7..b3756074b5 100644 +index 5bfcedccc1..6347d3d1f2 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 5194c1f9f7..2569648eab 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 @@ -61,7 +61,7 @@ index 0000000000..5caca6439d + +} diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 2d57bdf40e..816210fb91 100644 +index 6aabdc2974..a02fa29217 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 { @@ -84,7 +84,7 @@ index 2d57bdf40e..816210fb91 100644 public void a(IChatBaseComponent ichatbasecomponent) {} diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 0afaea8109..61f9eb3e64 100644 +index 26da897243..4f3f88ff66 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -111,7 +111,7 @@ index 7acdac55e5..f1a3be69d0 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 bf7bfb427b..b455d8e287 100644 +index b3479a6194..a89fbc6027 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/Expose-server-CommandMap.patch b/Spigot-Server-Patches/Expose-server-CommandMap.patch index 8a7b818236..0e16cd17e9 100644 --- a/Spigot-Server-Patches/Expose-server-CommandMap.patch +++ b/Spigot-Server-Patches/Expose-server-CommandMap.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d9cba38080..5230867326 100644 +index e047d68f3e..6a7bdb9ab6 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/Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch index f69c1a655b..c43456546b 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 6e524353b5..4a439ef4ca 100644 +index 4e44180329..cae24961fd 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/Faster-redstone-torch-rapid-clock-removal.patch b/Spigot-Server-Patches/Faster-redstone-torch-rapid-clock-removal.patch index cb9cfaa64a..5286a82b82 100644 --- a/Spigot-Server-Patches/Faster-redstone-torch-rapid-clock-removal.patch +++ b/Spigot-Server-Patches/Faster-redstone-torch-rapid-clock-removal.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Faster redstone torch rapid clock removal Only resize the the redstone torch list once, since resizing arrays / lists is costly diff --git a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java -index c912fb8ae0..d2246cfb10 100644 +index 35abdee5e5..42cb2d47ca 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneTorch.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneTorch.java @@ -0,0 +0,0 @@ public class BlockRedstoneTorch extends BlockTorch { 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 cf0ba63efd..258e81e17b 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 @@ -5,7 +5,7 @@ Subject: [PATCH] Filter bad data from ArmorStand and SpawnEgg items diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4d0f2051aa..872001d041 100644 +index 381edf3e7d..c22afafd6a 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; @@ -30,7 +30,7 @@ index 4d0f2051aa..872001d041 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 33bc46b054..4e1b74ebe4 100644 +index 1fb912eb0d..3c3f82f987 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/Fire-EntityShootBowEvent-for-Illusioner.patch b/Spigot-Server-Patches/Fire-EntityShootBowEvent-for-Illusioner.patch index 10c4cfaa64..f76c7a0bbd 100644 --- a/Spigot-Server-Patches/Fire-EntityShootBowEvent-for-Illusioner.patch +++ b/Spigot-Server-Patches/Fire-EntityShootBowEvent-for-Illusioner.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fire EntityShootBowEvent for Illusioner diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -index 82b36350c4..aebf704664 100644 +index 54c7c95a3b..6db21668d4 100644 --- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java +++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java @@ -0,0 +0,0 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan diff --git a/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch b/Spigot-Server-Patches/Fix-AIOOBE-in-inventory-handling.patch index 773c3a1f95..5fc72fd1d0 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 0fe8d1c3f1..ed02cd7a7a 100644 +index 078230521f..def0db5fea 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 198e6d7278..d02007d1cf 100644 --- a/Spigot-Server-Patches/Fix-Anvil-Level-sync-to-client.patch +++ b/Spigot-Server-Patches/Fix-Anvil-Level-sync-to-client.patch @@ -10,7 +10,7 @@ Was done incorrectly and is now causing level desyncs to client. Always send current level to the client, and instead make setWindowProperty set the level. diff --git a/src/main/java/net/minecraft/server/ContainerAnvil.java b/src/main/java/net/minecraft/server/ContainerAnvil.java -index 229f4f8829..fb3413d81e 100644 +index a8a875fe11..f2e15fa545 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvil.java +++ b/src/main/java/net/minecraft/server/ContainerAnvil.java @@ -0,0 +0,0 @@ public class ContainerAnvil extends Container { @@ -26,7 +26,7 @@ index 229f4f8829..fb3413d81e 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 63341ec778..bf7bfb427b 100644 +index 2837fb87e5..b3479a6194 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/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index e2f86c38fd..f15bfc5e21 100644 --- a/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/Spigot-Server-Patches/Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4c33c331f0..e693b43a23 100644 +index bbfa92e85f..0cdebf702a 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public void applyPhysics(BlockPosition blockposition, Block block) { diff --git a/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch b/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch deleted file mode 100644 index a16c0f788d..0000000000 --- a/Spigot-Server-Patches/Fix-Chunk-Unload-Queue-Issues.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Thu, 12 May 2016 02:03:56 -0400 -Subject: [PATCH] Fix Chunk Unload Queue Issues - -Vanilla implemented similar logic as Paper had pre 1.9.4, but Spigot -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 e8a943cf74..63ca61c1d6 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 { - private long A; public long getInhabitedTime() { return A; } // Paper - OBFHELPER - private int B; - private final ConcurrentLinkedQueue C; -- public boolean d; -+ public boolean d; public void setShouldUnload(boolean unload) { this.d = unload; } public boolean isUnloading() { return d; } // Paper - OBFHELPER - private ChunkStatus D; - private int E; - private final AtomicInteger F; -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0e04d65981..2925c345a1 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - - if (chunk != null && chunk.d) { - // CraftBukkit start - move unload logic to own method -+ chunk.setShouldUnload(false); // Paper - if (!unloadChunk(chunk, true)) { - continue; - } --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch index 2d87a6de42..e3f7a9f4ec 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 f007af2e1a..2f1488ee53 100644 +index dcd236a8e5..c85a8dac3e 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,10 +21,10 @@ index f007af2e1a..2f1488ee53 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 b6efd8506b..e74b53c483 100644 +index c6fa54848e..1ed4408e2a 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot if (entity == null) return false; 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 cd5e26c079..0ad16ac1da 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,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6fe8ce96aa..6d314a7124 100644 +index 0cf5d80899..109e718118 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.c("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { diff --git a/Spigot-Server-Patches/Fix-MC-124320.patch b/Spigot-Server-Patches/Fix-MC-124320.patch index 686063ae2b..78408f0794 100644 --- a/Spigot-Server-Patches/Fix-MC-124320.patch +++ b/Spigot-Server-Patches/Fix-MC-124320.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix MC-124320 diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index fd1aec43b..1dc2b11e3 100644 +index d55b076f5d..297f674d08 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -0,0 +0,0 @@ public class Block implements IMaterial { @@ -17,11 +17,11 @@ index fd1aec43b..1dc2b11e3 100644 IBlockData iblockdata1 = iblockdata; BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 2db0eb494..9e708f1fa 100644 +index e5ccd29a08..9116e52911 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -0,0 +0,0 @@ public class EntityEnderman extends EntityMonster { - if (block.a(TagsBlock.G) && flag) { + if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) { // CraftBukkit start - Pickup event if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { - this.enderman.setCarried(iblockdata); diff --git a/Spigot-Server-Patches/Fix-NPE-Potential-in-CraftBanner.patch b/Spigot-Server-Patches/Fix-NPE-Potential-in-CraftBanner.patch deleted file mode 100644 index c05b661b48..0000000000 --- a/Spigot-Server-Patches/Fix-NPE-Potential-in-CraftBanner.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 15 Aug 2018 08:46:20 -0400 -Subject: [PATCH] Fix NPE Potential in CraftBanner - - -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -index 4332a03a4..448832101 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java -@@ -0,0 +0,0 @@ public class CraftBanner extends CraftBlockEntityState impleme - public void load(TileEntityBanner banner) { - super.load(banner); - -- base = DyeColor.getByWoolData((byte) banner.color.getColorIndex()); -+ base = banner.color != null ? DyeColor.getByWoolData((byte) banner.color.getColorIndex()) : null; // Paper - patterns = new ArrayList(); - - if (banner.patterns != null) { --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch b/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch index 7f52dec911..2647a47802 100644 --- a/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch +++ b/Spigot-Server-Patches/Fix-Old-Sign-Conversion.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Fix Old Sign Conversion This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java -index 785a1a2184..528db8704e 100644 +index bb1d00e440..9f29225cbd 100644 --- a/src/main/java/net/minecraft/server/DefinedStructure.java +++ b/src/main/java/net/minecraft/server/DefinedStructure.java @@ -0,0 +0,0 @@ public class DefinedStructure { @@ -25,7 +25,7 @@ index 785a1a2184..528db8704e 100644 } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index d8d519143e..6021a3401f 100644 +index c5212417c6..b3c5766a27 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder; // CraftBukkit @@ -37,7 +37,7 @@ index d8d519143e..6021a3401f 100644 private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER protected World world; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index c5164ca3f4..2591c2f0b2 100644 +index 00b6a3c16d..20dc3f272c 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -0,0 +0,0 @@ public class TileEntitySign extends TileEntity implements ICommandListener { diff --git a/Spigot-Server-Patches/Fix-block-break-desync.patch b/Spigot-Server-Patches/Fix-block-break-desync.patch index 409dc5575c..a5faae4669 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 3885c8628c..08ef17dfe1 100644 +index 9de392315e..7f61da1cd3 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-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch index b4aeea913a..6c74495dff 100644 --- a/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch +++ b/Spigot-Server-Patches/Fix-client-rendering-skulls-from-same-user.patch @@ -12,7 +12,7 @@ This allows the client to render multiple skull textures from the same user, for when different skins were used when skull was made. diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index e52014fd8..da11ec167 100644 +index a238388012..9326eaa2a9 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 { @@ -25,7 +25,7 @@ index e52014fd8..da11ec167 100644 private EntityItemFrame i; private ShapeDetectorBlock j; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index d04afceb7..b0e8ffc4b 100644 +index a63a5811d6..cab8374832 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 { @@ -62,7 +62,7 @@ index d04afceb7..b0e8ffc4b 100644 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 1aa36156a..c5f0b8530 100644 +index 33436ac65b..6321010246 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet { @@ -77,13 +77,13 @@ index 1aa36156a..c5f0b8530 100644 BiomeBase[] abiomebase = chunk.getBiomeIndex(); for (l = 0; l < abiomebase.length; ++l) { -- packetdataserializer.writeInt(BiomeBase.REGISTRY_ID.a((Object) abiomebase[l])); -+ packetdataserializer.writeInt(BiomeBase.REGISTRY_ID.a(abiomebase[l])); // Paper - decompile fix +- packetdataserializer.writeInt(IRegistry.BIOME.a((Object) abiomebase[l])); ++ packetdataserializer.writeInt(IRegistry.BIOME.a(abiomebase[l])); // Paper - decompile fix } } diff --git a/src/main/java/net/minecraft/server/TileEntitySkull.java b/src/main/java/net/minecraft/server/TileEntitySkull.java -index 85fd8dab6..16a5537ce 100644 +index e59f3c21d7..05fca47f34 100644 --- a/src/main/java/net/minecraft/server/TileEntitySkull.java +++ b/src/main/java/net/minecraft/server/TileEntitySkull.java @@ -0,0 +0,0 @@ public class TileEntitySkull extends TileEntity /*implements ITickable*/ { // Pa 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 589140e646..0685cb9a9f 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 a912fb3414..ce8170ea9f 100644 +index 93807ffa62..a7bdb9737b 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 e4ebe5b6c3..80e1ab1152 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..6b9f6c956 100644 +index e5ba6eddd3..439d7ef40c 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/Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/Flag-to-disable-the-channel-limit.patch index 7b988c8663..916fbfa158 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 349afa3f33..b768327bbb 100644 +index 41bd979797..88caea739c 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/Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch index 350dd46646..03fd2fbbdb 100644 --- a/Spigot-Server-Patches/Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/Further-improve-server-tick-loop.patch @@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c72bdd29d1..687250c639 100644 +index 8dc922ccd0..e8c3dcc244 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 @@ -25,34 +25,36 @@ index c72bdd29d1..687250c639 100644 public java.util.Queue processQueue = new java.util.concurrent.ConcurrentLinkedQueue(); public int autosavePeriod; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - public CommandDispatcher vanillaCommandDispatcher; - // CraftBukkit end // Spigot start -- public static final int TPS = 20; -- public static final int TICK_TIME = 1000000000 / TPS; + public static final int TPS = 20; + public static final int TICK_TIME = 1000000000 / TPS; - private static final int SAMPLE_INTERVAL = 100; -- public final double[] recentTps = new double[ 3 ]; ++ private static final int SAMPLE_INTERVAL = 20; // Paper + public final double[] recentTps = new double[ 3 ]; public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant(); // Spigot end - @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - this.isRunning = false; } -- // Spigot Start -- private static double calcTps(double avg, double exp, double tps) -- { -- return ( avg * exp ) + ( tps * ( 1 - exp ) ); + private boolean aT() { +- return SystemUtils.b() < this.aa; ++ return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own + } + + // Spigot Start +@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati + { + return ( avg * exp ) + ( tps * ( 1 - exp ) ); + } ++ + // Paper start - Further improve server tick loop -+ private static final int TPS = 20; + private static final long SEC_IN_NANO = 1000000000; -+ public static final long TICK_TIME = SEC_IN_NANO / TPS; + private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L; -+ private static final int SAMPLE_INTERVAL = 20; ++ private long lastTick = 0; ++ private long catchupTime = 0; + public final RollingAverage tps1 = new RollingAverage(60); + public final RollingAverage tps5 = new RollingAverage(60 * 5); + public final RollingAverage tps15 = new RollingAverage(60 * 15); -+ public double[] recentTps = new double[3]; // Paper - Fine have your darn compat with bad plugins + + public static class RollingAverage { + private final int size; @@ -89,18 +91,18 @@ index c72bdd29d1..687250c639 100644 + public double getAverage() { + return total / time; + } - } -- // Spigot End ++ } + // Paper End + // Spigot End public void run() { - try { @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati // Spigot start Arrays.fill( recentTps, 20 ); - long lastTick = System.nanoTime(), catchupTime = 0, curTime, wait, tickSection = lastTick, tickCount = 1; -+ long start = System.nanoTime(), lastTick = start - TICK_TIME, catchupTime = 0, curTime, wait, tickSection = start; // Paper - Further improve server tick loop ++ long start = System.nanoTime(), curTime, wait, tickSection = start; // Paper - Further improve server tick loop ++ lastTick = start - TICK_TIME; // Paper while (this.isRunning) { curTime = System.nanoTime(); - wait = TICK_TIME - (curTime - lastTick) - catchupTime; @@ -151,11 +153,11 @@ index c72bdd29d1..687250c639 100644 - MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit + //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time - this.v(); + this.a(this::aT); this.aa += 50L; // Spigot end diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 567af5b9fa..1c003a3898 100644 +index 6414f3d6b0..f066af3fe5 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/Handle-Item-Meta-Inconsistencies.patch b/Spigot-Server-Patches/Handle-Item-Meta-Inconsistencies.patch index 6375ba61b6..a313b63447 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 0c54eaa52..c7ef9c689 100644 +index 318c4204df..56787ed25c 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; @@ -70,7 +70,7 @@ index 0c54eaa52..c7ef9c689 100644 public IChatBaseComponent getName() { @@ -0,0 +0,0 @@ public final class ItemStack { - nbttagcompound.setString("id", String.valueOf(Enchantment.enchantments.b(enchantment))); + nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment))); nbttagcompound.setShort("lvl", (short) ((byte) i)); nbttaglist.add((NBTBase) nbttagcompound); + processEnchantOrder(nbttagcompound); // Paper @@ -78,7 +78,7 @@ index 0c54eaa52..c7ef9c689 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 f4672b9a4..8c0409797 100644 +index ef4c49f1ff..69425e838f 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; @@ -201,7 +201,7 @@ index f4672b9a4..8c0409797 100644 static Map getEnchantments(net.minecraft.server.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 1fe5ddcd5..1d3333fd7 100644 +index 3db06bed2c..3fd2088039 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -0,0 +0,0 @@ import java.lang.reflect.Constructor; 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 baea72b9dc..be48043213 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 a93ed45df9..bb32cb749d 100644 +index 5afd16d7fe..cb42202add 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -25,10 +25,10 @@ index a93ed45df9..bb32cb749d 100644 - runtime + compile - - + + org.apache.logging.log4j diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index ff85d45ab1..abf281c748 100644 +index 9dca5aeda1..9584950c63 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -0,0 +0,0 @@ public class SpigotConfig diff --git a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch index e40558a5b3..335d6f98d0 100644 --- a/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/Ignore-Dead-Entities-in-entityList-iteration.patch @@ -11,7 +11,7 @@ This will ensure that dead entities are skipped from iteration since they shouldn't of been in the list in the first place. diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java -index 7ff8e70b2..4e854c6db 100644 +index 56700fc596..9b9c8361e9 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -0,0 +0,0 @@ public class PaperCommand extends Command { @@ -23,7 +23,7 @@ index 7ff8e70b2..4e854c6db 100644 MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 785c31089..6b0ca4eb9 100644 +index f5d5f38232..e558197623 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 @@ -35,10 +35,10 @@ index 785c31089..6b0ca4eb9 100644 public float length; public float J; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ff0112c52..82f4f00a7 100644 +index c2d404b813..255829b0b5 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } entity.valid = true; // CraftBukkit @@ -46,7 +46,7 @@ index ff0112c52..82f4f00a7 100644 new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (entity.inChunk && this.isChunkLoaded(i, j, true)) { this.getChunkAt(i, j).b(entity); } @@ -54,7 +54,7 @@ index ff0112c52..82f4f00a7 100644 if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - always remove from current chunk above // CraftBukkit start - Decrement loop variable field if we've already ticked this entity -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -62,7 +62,7 @@ index ff0112c52..82f4f00a7 100644 if (oclass.isAssignableFrom(entity.getClass()) && predicate.test((T) entity)) { arraylist.add(entity); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -71,7 +71,7 @@ index ff0112c52..82f4f00a7 100644 if (entity instanceof EntityInsentient) { EntityInsentient entityinsentient = (EntityInsentient) entity; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9294d1707..b09f0353a 100644 +index af977b171a..80fd49b6e1 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-EntityKnockbackByEntityEvent.patch b/Spigot-Server-Patches/Implement-EntityKnockbackByEntityEvent.patch index 8dec2d0470..be2cf2413d 100644 --- a/Spigot-Server-Patches/Implement-EntityKnockbackByEntityEvent.patch +++ b/Spigot-Server-Patches/Implement-EntityKnockbackByEntityEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent This event is called when an entity receives knockback by another entity. diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index f4a7db369f..faa90e9ee5 100644 +index ef1a1e5790..9f0bc5a8e2 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 { diff --git a/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch index 85916f7f5e..41f3e77057 100644 --- a/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/Implement-EntityTeleportEndGatewayEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement EntityTeleportEndGatewayEvent diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 888bbd7a45..c6632588eb 100644 +index b36dcb4d7d..268e4996bc 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java @@ -0,0 +0,0 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick diff --git a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch index 33caecf400..df1bf7ab94 100644 --- a/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch +++ b/Spigot-Server-Patches/Implement-Expanded-ArmorStand-API.patch @@ -8,7 +8,7 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index e9a746f13..3b2b94d8c 100644 +index 6628af7778..7647311dfd 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -0,0 +0,0 @@ public class EntityArmorStand extends EntityLiving { @@ -25,11 +25,11 @@ index e9a746f13..3b2b94d8c 100644 } + public boolean isSlotDisabled(EnumItemSlot slot) { return this.c(slot); } // Paper - OBFHELPER - private boolean c(EnumItemSlot enumitemslot) { - return (this.bH & 1 << enumitemslot.c()) != 0; + public boolean c(EnumItemSlot enumitemslot) { + return (this.bH & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 124c3185b..9f5c3b92e 100644 +index 124c3185bc..9f5c3b92e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -0,0 +0,0 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { diff --git a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch index 087b05f370..590dffb9f5 100644 --- a/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch +++ b/Spigot-Server-Patches/Implement-PlayerLocaleChangeEvent.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0b1c5ca475..e036716970 100644 +index a9b08dcb0e..68e71a2f9d 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 { +@@ -0,0 +0,0 @@ import org.bukkit.inventory.MainHand; + public class EntityPlayer extends EntityHuman implements ICrafting { private static final Logger cc = LogManager.getLogger(); - private static final IChatBaseComponent cd = (new ChatMessage("multiplayer.message_not_delivered", new Object[0])).a(EnumChatFormat.RED); - public String locale = "en_us"; // CraftBukkit - lowercase + public String locale = null; // CraftBukkit - lowercase // Paper - default to null public PlayerConnection playerConnection; @@ -22,7 +22,7 @@ index 0b1c5ca475..e036716970 100644 this.server.server.getPluginManager().callEvent(event); } - if (!this.locale.equals(packetplayinsettings.b())) { -+ if (this.locale == null || !this.locale.equals(packetplayinsettings.b())) { // Paper - fix bug and check for null ++ if (this.locale == null || !this.locale.equals(packetplayinsettings.b())) { // Paper - check for null PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), packetplayinsettings.b()); this.server.server.getPluginManager().callEvent(event); } @@ -35,11 +35,11 @@ index 0b1c5ca475..e036716970 100644 + new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent(); + } + // Paper end - this.ct = packetplayinsettings.d(); - this.cu = packetplayinsettings.e(); + this.cs = packetplayinsettings.d(); + this.ct = packetplayinsettings.e(); this.getDataWatcher().set(EntityPlayer.bx, Byte.valueOf((byte) packetplayinsettings.f())); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 93e2a34fec..4475d3318b 100644 +index 9a3e36f17f..e98f344c52 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/Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/Implement-World.getEntity-UUID-API.patch index 3e8ab08b47..e9d702b4b7 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 dee9c01e77..654e7cdfa2 100644 +index b6589fdc68..e4c4cdb980 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-ensureServerConversions-API.patch b/Spigot-Server-Patches/Implement-ensureServerConversions-API.patch index 12e080fa8d..68d35d640e 100644 --- a/Spigot-Server-Patches/Implement-ensureServerConversions-API.patch +++ b/Spigot-Server-Patches/Implement-ensureServerConversions-API.patch @@ -7,7 +7,7 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 6998fddc5..f7e11412a 100644 +index 6998fddc5a..f7e11412a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { diff --git a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch index 0f678d414f..e156d2d4e6 100644 --- a/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/Implement-extended-PaperServerListPingEvent.patch @@ -177,29 +177,37 @@ index 0000000000..350410527b + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a2e685acf7..d6b56d685e 100644 +index 014c923897..76e6b233b1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -0,0 +0,0 @@ + package net.minecraft.server; + + import co.aikar.timings.Timings; ++import com.destroystokyo.paper.event.server.PaperServerListPingEvent; + import com.google.common.base.Stopwatch; + import com.google.common.collect.Lists; + import com.google.common.collect.Maps; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati if (i - this.Y >= 5000000000L) { this.Y = i; - this.n.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.B(), this.A())); -- GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), 12)]; -+ GameProfile[] agameprofile = new GameProfile[Math.min(this.A(), org.spigotmc.SpigotConfig.playerSample)]; // Paper - int j = MathHelper.nextInt(this.o, 0, this.A() - agameprofile.length); + this.m.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.z(), this.y())); +- GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), 12)]; ++ GameProfile[] agameprofile = new GameProfile[Math.min(this.y(), org.spigotmc.SpigotConfig.playerSample)]; // Paper + int j = MathHelper.nextInt(this.n, 0, this.y() - agameprofile.length); for (int k = 0; k < agameprofile.length; ++k) { @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - return "1.13"; + return "1.13.1"; } -+ public int getPlayerCount() { return A(); } // Paper - OBFHELPER - public int A() { ++ public int getPlayerCount() { return y(); } // Paper - OBFHELPER + public int y() { return this.s.getPlayerCount(); } -+ public int getMaxPlayers() { return B(); } // Paper - OBFHELPER - public int B() { ++ public int getMaxPlayers() { return z(); } // Paper - OBFHELPER + public int z() { return this.s.getMaxPlayers(); } diff --git a/src/main/java/net/minecraft/server/PacketStatusListener.java b/src/main/java/net/minecraft/server/PacketStatusListener.java @@ -251,7 +259,7 @@ index d7e1ecc031..f20cddc41c 100644 this.c = agameprofile; } diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index abf281c748..4ac0ab9974 100644 +index 9584950c63..eed96c60c5 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -0,0 +0,0 @@ public class SpigotConfig diff --git a/Spigot-Server-Patches/Implement-getI18NDisplayName.patch b/Spigot-Server-Patches/Implement-getI18NDisplayName.patch index edba90559c..5e2f392eb8 100644 --- a/Spigot-Server-Patches/Implement-getI18NDisplayName.patch +++ b/Spigot-Server-Patches/Implement-getI18NDisplayName.patch @@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java -index 4361b2cee..f81887c66 100644 +index 4361b2cee5..f81887c661 100644 --- a/src/main/java/net/minecraft/server/LocaleLanguage.java +++ b/src/main/java/net/minecraft/server/LocaleLanguage.java @@ -0,0 +0,0 @@ public class LocaleLanguage { @@ -25,7 +25,7 @@ index 4361b2cee..f81887c66 100644 return this.c(s); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index f7e11412a..3dbe9d81e 100644 +index f7e11412a5..3dbe9d81ea 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -0,0 +0,0 @@ public final class CraftItemFactory implements ItemFactory { 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 3c4c508095..573f57e074 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 @@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index ca14080ccd..9814075d6d 100644 +index 63f78924cb..79233fe463 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 { @@ -30,7 +30,7 @@ index ca14080ccd..9814075d6d 100644 ItemStack itemstack1 = this.a(entityitem); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 40e0bd7ce2..a04a06f3bf 100644 +index 63dfede645..cce2ce9397 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -0,0 +0,0 @@ public class EntityTrackerEntry { @@ -43,25 +43,25 @@ index 40e0bd7ce2..a04a06f3bf 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 f314925b6b..7dae87199e 100644 +index 3ce6058d4c..8005b0c110 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 ( iter.next().trackee == entity ) +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc { -+ map.decorations.remove(entity.getUniqueID()); // Paper - iter.remove(); + if ( iter.next().trackee == entity ) + { ++ map.decorations.remove(entity.getDisplayName().getString()); // Paper + iter.remove(); + } } - } diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java -index c73ffc3bc2..14754bbeb2 100644 +index aa58e34c6f..f26b91b407 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase { - public final Map j = Maps.newHashMap(); // Spigot private -> public private final Map k = Maps.newHashMap(); public Map decorations = Maps.newLinkedHashMap(); + private final Map l = Maps.newHashMap(); + private org.bukkit.craftbukkit.map.RenderData vanillaRender = new org.bukkit.craftbukkit.map.RenderData(); // Paper // CraftBukkit start @@ -80,7 +80,7 @@ index c73ffc3bc2..14754bbeb2 100644 } + vanillaRender.buffer = colors; // Paper - } + NBTTagList nbttaglist1 = nbttagcompound.getList("frames", 10); @@ -0,0 +0,0 @@ public class WorldMap extends PersistentBase { return nbttagcompound; @@ -97,9 +97,9 @@ index c73ffc3bc2..14754bbeb2 100644 + // Paper start + private void addSeenPlayers(java.util.Collection icons) { + org.bukkit.entity.Player player = (org.bukkit.entity.Player) trackee.getBukkitEntity(); -+ WorldMap.this.decorations.forEach((uuid, mapIcon) -> { ++ WorldMap.this.decorations.forEach((name, mapIcon) -> { + // If this cursor is for a player check visibility with vanish system -+ org.bukkit.entity.Player other = org.bukkit.Bukkit.getPlayer(uuid); // Spigot ++ org.bukkit.entity.Player other = org.bukkit.Bukkit.getPlayerExact(name); // Spigot + if (other == null || player.canSee(other)) { + icons.add(mapIcon); + } diff --git a/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index a86ff89218..331c5bef7c 100644 --- a/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 28b156e439..8ac599b7a2 100644 +index 92960eb735..ea2faf9539 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch b/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch index e16da13198..fce2c753ce 100644 --- a/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch +++ b/Spigot-Server-Patches/Include-Log4J2-SLF4J-implementation.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Include Log4J2 SLF4J implementation diff --git a/pom.xml b/pom.xml -index bb32cb749d..a319cfe3b8 100644 +index cb42202add..3be49ee7f4 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ + 2.8.1 + compile - - + + org.apache.logging.log4j + log4j-slf4j-impl diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index 5c4049d23b..aa6f220dbf 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index f6beb6886d..d2e87693fa 100644 +index fa549cc372..5599025d66 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 { @@ -29,7 +29,7 @@ index f6beb6886d..d2e87693fa 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 015cd553dd..f7588c4d44 100644 +index 6ae76477c0..f2bce333d9 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 { @@ -56,7 +56,7 @@ index 015cd553dd..f7588c4d44 100644 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9b1edab77d..8fd7a0d029 100644 +index 49470bf5f0..781c8abc39 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 { @@ -110,7 +110,7 @@ index 9b1edab77d..8fd7a0d029 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ce8170ea9f..da501a1c5f 100644 +index a7bdb9737b..4fc5e4b7b3 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 ce8170ea9f..da501a1c5f 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 45e42e9989..7a2b219c67 100644 +index 304cae655d..6d511b6230 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 { @@ -136,7 +136,7 @@ index 45e42e9989..7a2b219c67 100644 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index e9707dfa74..a16bfc7f65 100644 +index 92fe80316f..70a4dbe26b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -155,7 +155,7 @@ index e9707dfa74..a16bfc7f65 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 b768327bbb..029d8d8179 100644 +index 88caea739c..b7144c5d2f 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 { @@ -168,7 +168,7 @@ index b768327bbb..029d8d8179 100644 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8ac599b7a2..cf398cd250 100644 +index ea2faf9539..9fb1b75413 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Item-canEntityPickup.patch b/Spigot-Server-Patches/Item-canEntityPickup.patch index bad8058bb4..d98c37b70c 100644 --- a/Spigot-Server-Patches/Item-canEntityPickup.patch +++ b/Spigot-Server-Patches/Item-canEntityPickup.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 0cfda190bc..bca2aa8298 100644 +index ec06f4badb..d4c86c2d65 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -21,7 +21,7 @@ index 0cfda190bc..bca2aa8298 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 4af09f5cdb..f2a4476c5c 100644 +index eecebafdad..3e70a06397 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -0,0 +0,0 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/ItemStack-getMaxItemUseDuration.patch b/Spigot-Server-Patches/ItemStack-getMaxItemUseDuration.patch index 0af65e6499..c9489e591e 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 4f230975aa..e52014fd8f 100644 +index f71d9ee578..a238388012 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 { @@ -18,7 +18,7 @@ index 4f230975aa..e52014fd8f 100644 return this.getItem().c(this); } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 83f89a2365..8ca161f0ed 100644 +index bdd4bf5151..911463f5b2 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 @@ public final class CraftItemStack extends ItemStack { diff --git a/Spigot-Server-Patches/Lighting-Queue.patch b/Spigot-Server-Patches/Lighting-Queue.patch index 8c20dd03c5..7e468e3474 100644 --- a/Spigot-Server-Patches/Lighting-Queue.patch +++ b/Spigot-Server-Patches/Lighting-Queue.patch @@ -28,7 +28,7 @@ index 145cb274b0..eff9dcf54f 100644 public static Timing getTickList(WorldServer worldserver, String timingsType) { diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 68898d624f..4b36a0f053 100644 +index 39d565db1f..f0d1ae630e 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 { @@ -43,7 +43,7 @@ index 68898d624f..4b36a0f053 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 849d8de69b..01401c4447 100644 +index 8507392628..d2412624e1 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 { @@ -67,7 +67,7 @@ index 849d8de69b..01401c4447 100644 + // Paper end for (int i = 0; i < 16; ++i) { for (int j = 0; j < 16; ++j) { - if (this.h[i + j * 16]) { + if (this.g[i + j * 16]) { @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { if (flag1) { this.initLighting(); @@ -85,7 +85,7 @@ index 849d8de69b..01401c4447 100644 TileEntity tileentity; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - return this.E == 8; + return this.D == 8; } + // Paper start @@ -102,7 +102,7 @@ index 849d8de69b..01401c4447 100644 IMMEDIATE, QUEUED, CHECK; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index aabdc9e2f0..d025d949e3 100644 +index 0034956af9..1379b574ef 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { @@ -114,11 +114,11 @@ index aabdc9e2f0..d025d949e3 100644 // Update neighbor counts for (int x = -2; x < 3; x++) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6fbf841f06..9dc9668c45 100644 +index e8c3dcc244..c47f56ed8d 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 - protected void v() { + protected void a(BooleanSupplier booleansupplier) { co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot - long i = SystemUtils.c(); @@ -136,7 +136,7 @@ index 6fbf841f06..9dc9668c45 100644 } diff --git a/src/main/java/net/minecraft/server/PaperLightingQueue.java b/src/main/java/net/minecraft/server/PaperLightingQueue.java new file mode 100644 -index 0000000000..345cd58240 +index 0000000000..60562f1fd2 --- /dev/null +++ b/src/main/java/net/minecraft/server/PaperLightingQueue.java @@ -0,0 +0,0 @@ @@ -159,7 +159,7 @@ index 0000000000..345cd58240 + final long maxTickTime = MAX_TIME - (startTime - curTime); + + START: -+ for (World world : MinecraftServer.getServer().worlds) { ++ for (World world : MinecraftServer.getServer().getWorlds()) { + if (!world.paperConfig.queueLightUpdates) { + continue; + } @@ -233,10 +233,10 @@ index 0000000000..345cd58240 + } +} diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ada8376e8c..776882ba4f 100644 +index 0b38093f91..93d1449750 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (iblockdata2.b(this, blockposition) != iblockdata1.b(this, blockposition) || iblockdata2.e() != iblockdata1.e()) { this.methodProfiler.a("checkLight"); diff --git a/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch index f0995fead9..034defa469 100644 --- a/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-Server-Patches/LivingEntity-Hand-Raised-Item-Use-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index faa90e9ee5..a57dcc41bd 100644 +index 9f0bc5a8e2..dd14f99dee 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 { @@ -32,7 +32,7 @@ index faa90e9ee5..a57dcc41bd 100644 return this.isHandRaised() ? this.activeItem.k() - this.cX() : 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index fab1af7159..71e0da894b 100644 +index a09cd02403..0860f2334d 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/LivingEntity-setKiller.patch b/Spigot-Server-Patches/LivingEntity-setKiller.patch index b3818c7cf0..9411fbbcc4 100644 --- a/Spigot-Server-Patches/LivingEntity-setKiller.patch +++ b/Spigot-Server-Patches/LivingEntity-setKiller.patch @@ -5,7 +5,7 @@ Subject: [PATCH] LivingEntity#setKiller diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index ac301d379b..49f515d868 100644 +index 09cf843d46..9acafadbbf 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/Load-version-history-at-server-start.patch b/Spigot-Server-Patches/Load-version-history-at-server-start.patch index 9be7e37f5d..d1a4655be5 100644 --- a/Spigot-Server-Patches/Load-version-history-at-server-start.patch +++ b/Spigot-Server-Patches/Load-version-history-at-server-start.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Load version history at server start diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 8c76300185..8e15710caf 100644 +index 50d7ef0b2a..c4e99ef2a9 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch index 653c3ad2f4..3f17b9add0 100644 --- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch @@ -11,7 +11,7 @@ This feature is good for long term worlds so that newer players do not suffer with "Every chest has been looted" diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 8d54af6bb7..a3823408ca 100644 +index df2863ce1b..c2c4e16d13 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 { @@ -41,29 +41,11 @@ index 8d54af6bb7..a3823408ca 100644 + } + } } -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootable.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootable.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java new file mode 100644 -index 0000000000..36c36d158f +index 0000000000..d6fce3112e --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootable.java -@@ -0,0 +0,0 @@ -+package com.destroystokyo.paper.loottable; -+ -+import net.minecraft.server.World; -+ -+interface CraftLootable extends Lootable { -+ -+ World getNMSWorld(); -+ -+ default org.bukkit.World getBukkitWorld() { -+ return getNMSWorld().getWorld(); -+ } -+} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableBlockInventory.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableBlockInventory.java -new file mode 100644 -index 0000000000..20d236c451 ---- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableBlockInventory.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableBlockInventory.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + @@ -73,7 +55,7 @@ index 0000000000..20d236c451 +import org.bukkit.Chunk; +import org.bukkit.block.Block; + -+public interface CraftLootableBlockInventory extends LootableBlockInventory, CraftLootableInventory { ++public interface PaperLootableBlockInventory extends LootableBlockInventory, PaperLootableInventory { + + TileEntityLootable getTileEntity(); + @@ -94,22 +76,22 @@ index 0000000000..20d236c451 + } + + @Override -+ default CraftLootableInventoryData getLootableData() { -+ return getTileEntity().getLootableData(); ++ default PaperLootableInventoryData getLootableData() { ++ return getTileEntity().lootableData; + } +} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableEntityInventory.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java new file mode 100644 -index 0000000000..1150dee01e +index 0000000000..5e637782d5 --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableEntityInventory.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableEntityInventory.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + +import net.minecraft.server.World; +import org.bukkit.entity.Entity; + -+public interface CraftLootableEntityInventory extends LootableEntityInventory, CraftLootableInventory { ++public interface PaperLootableEntityInventory extends LootableEntityInventory, PaperLootableInventory { + + net.minecraft.server.Entity getHandle(); + @@ -128,28 +110,34 @@ index 0000000000..1150dee01e + } + + @Override -+ default CraftLootableInventoryData getLootableData() { -+ if (getHandle() instanceof CraftLootableInventory) { -+ return ((CraftLootableInventory) getHandle()).getLootableData(); -+ } -+ return null; ++ default PaperLootableInventoryData getLootableData() { ++ return getHandle().lootableData; + } +} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventory.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java new file mode 100644 -index 0000000000..b72232093b +index 0000000000..856843fc91 --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventory.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventory.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + ++import net.minecraft.server.World; ++import org.bukkit.loot.Lootable; ++ +import java.util.UUID; + -+public interface CraftLootableInventory extends CraftLootable, LootableInventory { ++public interface PaperLootableInventory extends LootableInventory, Lootable { + -+ CraftLootableInventoryData getLootableData(); ++ PaperLootableInventoryData getLootableData(); + LootableInventory getAPILootableInventory(); + ++ World getNMSWorld(); ++ ++ default org.bukkit.World getBukkitWorld() { ++ return getNMSWorld().getWorld(); ++ } ++ + @Override + default boolean isRefillEnabled() { + return getNMSWorld().paperConfig.autoReplenishLootables; @@ -203,11 +191,11 @@ index 0000000000..b72232093b + return getLootableData().setNextRefill(refillAt); + } +} -diff --git a/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java new file mode 100644 -index 0000000000..8547205456 +index 0000000000..6e17af86a0 --- /dev/null -+++ b/src/main/java/com/destroystokyo/paper/loottable/CraftLootableInventoryData.java ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java @@ -0,0 +0,0 @@ +package com.destroystokyo.paper.loottable; + @@ -222,7 +210,7 @@ index 0000000000..8547205456 +import java.util.Random; +import java.util.UUID; + -+public class CraftLootableInventoryData { ++public class PaperLootableInventoryData { + + private static final Random RANDOM = new Random(); + @@ -230,9 +218,9 @@ index 0000000000..8547205456 + private long nextRefill = -1; + private int numRefills = 0; + private Map lootedPlayers; -+ private final CraftLootableInventory lootable; ++ private final PaperLootableInventory lootable; + -+ public CraftLootableInventoryData(CraftLootableInventory lootable) { ++ public PaperLootableInventoryData(PaperLootableInventory lootable) { + this.lootable = lootable; + } + @@ -302,7 +290,7 @@ index 0000000000..8547205456 + this.nextRefill = this.lastFill + (min + RANDOM.nextInt(max - min + 1)) * 1000L; + this.numRefills++; + if (paperConfig.changeLootTableSeedOnFill) { -+ this.lootable.setLootTableSeed(0); ++ this.lootable.setSeed(0); + } + if (player != null) { // This means that numRefills can be incremented without a player being in the lootedPlayers list - Seems to be EntityMinecartChest specific + this.setPlayerLootedState(player.getUniqueID(), true); @@ -388,39 +376,178 @@ index 0000000000..8547205456 + return lootedPlayers != null ? lootedPlayers.get(player) : null; + } +} -diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index 91b38fd64b..7120f00b6a 100644 ---- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java -+++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -@@ -0,0 +0,0 @@ import java.util.Random; - import javax.annotation.Nullable; - // CraftBukkit start - import java.util.List; -+// Paper start -+import com.destroystokyo.paper.loottable.CraftLootableInventoryData; -+import com.destroystokyo.paper.loottable.CraftLootableInventory; -+import com.destroystokyo.paper.loottable.LootableInventory; +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java +new file mode 100644 +index 0000000000..f9fbc221bd +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperMinecartLootableInventory.java +@@ -0,0 +0,0 @@ ++package com.destroystokyo.paper.loottable; ++ ++import net.minecraft.server.Entity; ++import net.minecraft.server.EntityMinecartContainer; ++import net.minecraft.server.MinecraftKey; ++import net.minecraft.server.World; +import org.bukkit.Bukkit; +import org.bukkit.craftbukkit.util.CraftNamespacedKey; -+// Paper end - import org.bukkit.Location; - import org.bukkit.craftbukkit.entity.CraftHumanEntity; - import org.bukkit.entity.HumanEntity; - import org.bukkit.inventory.InventoryHolder; - // CraftBukkit end ++ ++public class PaperMinecartLootableInventory implements PaperLootableEntityInventory { ++ ++ private EntityMinecartContainer entity; ++ ++ public PaperMinecartLootableInventory(EntityMinecartContainer entity) { ++ this.entity = entity; ++ } ++ ++ @Override ++ public org.bukkit.loot.LootTable getLootTable() { ++ return entity.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(entity.getLootTableKey())) : null; ++ } ++ ++ @Override ++ public void setLootTable(org.bukkit.loot.LootTable table, long seed) { ++ setLootTable(table); ++ setSeed(seed); ++ } ++ ++ @Override ++ public void setSeed(long seed) { ++ entity.lootTableSeed = seed; ++ } ++ ++ @Override ++ public long getSeed() { ++ return entity.lootTableSeed; ++ } ++ ++ @Override ++ public void setLootTable(org.bukkit.loot.LootTable table) { ++ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); ++ entity.setLootTable(newKey); ++ } ++ ++ @Override ++ public PaperLootableInventoryData getLootableData() { ++ return entity.lootableData; ++ } ++ ++ @Override ++ public Entity getHandle() { ++ return entity; ++ } ++ ++ @Override ++ public LootableInventory getAPILootableInventory() { ++ return (LootableInventory) entity.getBukkitEntity(); ++ } ++ ++ @Override ++ public World getNMSWorld() { ++ return entity.world; ++ } ++} +diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java +new file mode 100644 +index 0000000000..d50410532c +--- /dev/null ++++ b/src/main/java/com/destroystokyo/paper/loottable/PaperTileEntityLootableInventory.java +@@ -0,0 +0,0 @@ ++package com.destroystokyo.paper.loottable; ++ ++import net.minecraft.server.MCUtil; ++import net.minecraft.server.MinecraftKey; ++import net.minecraft.server.TileEntityLootable; ++import net.minecraft.server.World; ++import org.bukkit.Bukkit; ++import org.bukkit.craftbukkit.util.CraftNamespacedKey; ++ ++public class PaperTileEntityLootableInventory implements PaperLootableBlockInventory { ++ private TileEntityLootable tileEntityLootable; ++ ++ public PaperTileEntityLootableInventory(TileEntityLootable tileEntityLootable) { ++ this.tileEntityLootable = tileEntityLootable; ++ } ++ ++ @Override ++ public org.bukkit.loot.LootTable getLootTable() { ++ return tileEntityLootable.getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(tileEntityLootable.getLootTableKey())) : null; ++ } ++ ++ @Override ++ public void setLootTable(org.bukkit.loot.LootTable table, long seed) { ++ setLootTable(table); ++ setSeed(seed); ++ } ++ ++ @Override ++ public void setLootTable(org.bukkit.loot.LootTable table) { ++ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); ++ tileEntityLootable.setLootTable(newKey); ++ } ++ ++ @Override ++ public void setSeed(long seed) { ++ tileEntityLootable.setSeed(seed); ++ } ++ ++ @Override ++ public long getSeed() { ++ return tileEntityLootable.getSeed(); ++ } ++ ++ @Override ++ public PaperLootableInventoryData getLootableData() { ++ return tileEntityLootable.lootableData; ++ } ++ ++ @Override ++ public TileEntityLootable getTileEntity() { ++ return tileEntityLootable; ++ } ++ ++ @Override ++ public LootableInventory getAPILootableInventory() { ++ World world = tileEntityLootable.getWorld(); ++ if (world == null) { ++ return null; ++ } ++ return (LootableInventory) getBukkitWorld().getBlockAt(MCUtil.toLocation(world, tileEntityLootable.getPosition())).getState(); ++ } ++ ++ @Override ++ public World getNMSWorld() { ++ return tileEntityLootable.getWorld(); ++ } ++} +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 3fc9568663..d070d68d7c 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 + return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; + } --public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable { -+public abstract class EntityMinecartContainer extends EntityMinecartAbstract implements ITileInventory, ILootable, CraftLootableInventory { // Paper ++ public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper + protected CraftEntity bukkitEntity; + + public CraftEntity getBukkitEntity() { +diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +index 8945ab275b..184809b832 100644 +--- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java ++++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java +@@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp private NonNullList items; private boolean b; - private MinecraftKey c; -- public long d; // CraftBukkit private -> public -+ private MinecraftKey c; private MinecraftKey getLootTableKey() { return c; } private void setLootTable(MinecraftKey key) { c = key; } // Paper - OBFHELPER -+ public long d; public long getSeed() { return d; } public void setSeed(long seed) { d = seed; } // Paper - OBFHELPER // CraftBukkit private -> public ++ private MinecraftKey c; public MinecraftKey getLootTableKey() { return c; } public void setLootTable(MinecraftKey key) { c = key; } // Paper - OBFHELPER + public long lootTableSeed; // CraftBukkit start ++ { lootableData = new com.destroystokyo.paper.loottable.PaperLootableInventoryData(new com.destroystokyo.paper.loottable.PaperMinecartLootableInventory(this)); } // Paper public List transaction = new java.util.ArrayList(); + private int maxStack = MAX_STACK; + @@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp protected void b(NBTTagCompound nbttagcompound) { @@ -428,8 +555,8 @@ index 91b38fd64b..7120f00b6a 100644 + lootableData.saveNbt(nbttagcompound); // Paper if (this.c != null) { nbttagcompound.setString("LootTable", this.c.toString()); - if (this.d != 0L) { - nbttagcompound.setLong("LootTableSeed", this.d); + if (this.lootTableSeed != 0L) { + nbttagcompound.setLong("LootTableSeed", this.lootTableSeed); } - } else { + } if (true) { // Paper - Always save the items, Table may stick around @@ -444,7 +571,7 @@ index 91b38fd64b..7120f00b6a 100644 this.items = NonNullList.a(this.getSize(), ItemStack.a); if (nbttagcompound.hasKeyOfType("LootTable", 8)) { this.c = new MinecraftKey(nbttagcompound.getString("LootTable")); - this.d = nbttagcompound.getLong("LootTableSeed"); + this.lootTableSeed = nbttagcompound.getLong("LootTableSeed"); - } else { + } if (true) { // Paper - always load the items, table may still remain ContainerUtil.b(nbttagcompound, this.items); @@ -456,81 +583,30 @@ index 91b38fd64b..7120f00b6a 100644 public void f(@Nullable EntityHuman entityhuman) { - if (this.c != null && this.world.getMinecraftServer() != null) { + if (lootableData.shouldReplenish(entityhuman) && this.world.getMinecraftServer() != null) { // Paper - LootTable loottable = this.world.getMinecraftServer().aP().a(this.c); + LootTable loottable = this.world.getMinecraftServer().getLootTableRegistry().getLootTable(this.c); - this.c = null; + lootableData.processRefill(entityhuman); // Paper Random random; - if (this.d == 0L) { -@@ -0,0 +0,0 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp - public MinecraftKey Q_() { - return this.c; - } -+ -+ // Paper start -+ @Override -+ public org.bukkit.loot.LootTable getLootTable() { -+ return getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(getLootTableKey())) : null; -+ } -+ -+ @Override -+ public void setLootTable(org.bukkit.loot.LootTable table, long seed) { -+ setLootTable(table); -+ setSeed(seed); -+ } -+ -+ @Override -+ public void setLootTable(org.bukkit.loot.LootTable table) { -+ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ setLootTable(newKey); -+ } -+ private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this); -+ -+ @Override -+ public CraftLootableInventoryData getLootableData() { -+ return lootableData; -+ } -+ -+ @Override -+ public LootableInventory getAPILootableInventory() { -+ return (LootableInventory) this.getBukkitEntity(); -+ } -+ -+ @Override -+ public World getNMSWorld() { -+ return this.world; -+ } -+ // Paper end - } + if (this.lootTableSeed == 0L) { diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java -index fbda02b321..e0f87a3533 100644 +index 60d200f9eb..228d6b2800 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java -@@ -0,0 +0,0 @@ - package net.minecraft.server; +@@ -0,0 +0,0 @@ import javax.annotation.Nullable; -+// Paper start -+import com.destroystokyo.paper.loottable.CraftLootableInventoryData; -+import com.destroystokyo.paper.loottable.CraftLootableInventory; -+import com.destroystokyo.paper.loottable.LootableInventory; -+import org.bukkit.Bukkit; -+import org.bukkit.craftbukkit.util.CraftNamespacedKey; -+// Paper end -+ - import java.util.Random; - import javax.annotation.Nullable; - --public abstract class TileEntityLootable extends TileEntityContainer implements ILootable { -+public abstract class TileEntityLootable extends TileEntityContainer implements ILootable, CraftLootableInventory { // Paper + public abstract class TileEntityLootable extends TileEntityContainer implements ILootable { - protected MinecraftKey g; - protected long h; -+ protected MinecraftKey g; private MinecraftKey getLootTableKey() { return g; } private void setLootTable(MinecraftKey key) { g = key; } // Paper - OBFHELPER ++ protected MinecraftKey g; public MinecraftKey getLootTableKey() { return g; } public void setLootTable(MinecraftKey key) { g = key; } // Paper - OBFHELPER + protected long h; public long getSeed() { return h; } public void setSeed(long seed) { h = seed; } // Paper - OBFHELPER protected IChatBaseComponent i; ++ public final com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData = new com.destroystokyo.paper.loottable.PaperLootableInventoryData(new com.destroystokyo.paper.loottable.PaperTileEntityLootableInventory(this)); // Paper protected TileEntityLootable(TileEntityTypes tileentitytypes) { + super(tileentitytypes); @@ -0,0 +0,0 @@ public abstract class TileEntityLootable extends TileEntityContainer implements } @@ -563,53 +639,13 @@ index fbda02b321..e0f87a3533 100644 public void d(@Nullable EntityHuman entityhuman) { - if (this.g != null && this.world.getMinecraftServer() != null) { + if (lootableData.shouldReplenish(entityhuman) && this.world.getMinecraftServer() != null) { // Paper - LootTable loottable = this.world.getMinecraftServer().aP().a(this.g); + LootTable loottable = this.world.getMinecraftServer().getLootTableRegistry().getLootTable(this.g); - this.g = null; + lootableData.processRefill(entityhuman); // Paper Random random; if (this.h == 0L) { -@@ -0,0 +0,0 @@ public abstract class TileEntityLootable extends TileEntityContainer implements - protected abstract NonNullList q(); - - protected abstract void a(NonNullList nonnulllist); -+ // Paper start - LootTable API -+ @Override -+ public org.bukkit.loot.LootTable getLootTable() { -+ return getLootTableKey() != null ? Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(getLootTableKey())) : null; -+ } -+ -+ @Override -+ public void setLootTable(org.bukkit.loot.LootTable table, long seed) { -+ setLootTable(table); -+ setSeed(seed); -+ } -+ -+ @Override -+ public void setLootTable(org.bukkit.loot.LootTable table) { -+ MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); -+ setLootTable(newKey); -+ } -+ private final CraftLootableInventoryData lootableData = new CraftLootableInventoryData(this); -+ -+ @Override -+ public CraftLootableInventoryData getLootableData() { -+ return lootableData; -+ } -+ -+ @Override -+ public LootableInventory getAPILootableInventory() { -+ return (LootableInventory) getBukkitWorld().getBlockAt(MCUtil.toLocation(world, getPosition())).getState(); -+ } -+ -+ @Override -+ public World getNMSWorld() { -+ return world; -+ } -+ // Paper end -+ - } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java index ac9b4297b2..0558cafe31 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -624,14 +660,14 @@ index ac9b4297b2..0558cafe31 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index dff5bb5171..e7b719b43d 100644 +index dff5bb5171..c3e40aa172 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.block; import net.minecraft.server.BlockChest; -+import com.destroystokyo.paper.loottable.CraftLootableBlockInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableBlockInventory; // Paper import net.minecraft.server.BlockPosition; import net.minecraft.server.Blocks; import net.minecraft.server.ITileInventory; @@ -640,18 +676,18 @@ index dff5bb5171..e7b719b43d 100644 import org.bukkit.inventory.Inventory; -public class CraftChest extends CraftLootable implements Chest { -+public class CraftChest extends CraftLootable implements Chest, CraftLootableBlockInventory { // Paper ++public class CraftChest extends CraftLootable implements Chest, PaperLootableBlockInventory { // Paper public CraftChest(final Block block) { super(block, TileEntityChest.class); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java -index 34bcc49cf9..7ff7d33f06 100644 +index d519252521..a2324c7c8b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.block; -+import com.destroystokyo.paper.loottable.CraftLootableBlockInventory; ++import com.destroystokyo.paper.loottable.PaperLootableBlockInventory; import net.minecraft.server.MinecraftKey; import net.minecraft.server.TileEntityLootable; import org.bukkit.Bukkit; @@ -660,7 +696,7 @@ index 34bcc49cf9..7ff7d33f06 100644 import org.bukkit.loot.Lootable; -public abstract class CraftLootable extends CraftContainer implements Nameable, Lootable { -+public abstract class CraftLootable extends CraftContainer implements Nameable, Lootable, CraftLootableBlockInventory { ++public abstract class CraftLootable extends CraftContainer implements Nameable, Lootable, PaperLootableBlockInventory { // Paper public CraftLootable(Block block, Class tileEntityClass) { super(block, tileEntityClass); @@ -671,16 +707,16 @@ index 34bcc49cf9..7ff7d33f06 100644 - private void setLootTable(LootTable table, long seed) { + public void setLootTable(LootTable table, long seed) { // Paper - public MinecraftKey key = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); - getSnapshot().a(key, seed); // PAIL setLootTable + getSnapshot().setLootTable(key, seed); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java -index 1b5b266c05..3d5225e9f2 100644 +index 1b5b266c05..e0b99207b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; -+import com.destroystokyo.paper.loottable.CraftLootableEntityInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper import net.minecraft.server.EntityMinecartChest; import org.bukkit.craftbukkit.CraftServer; @@ -689,31 +725,31 @@ index 1b5b266c05..3d5225e9f2 100644 @SuppressWarnings("deprecation") -public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart { -+public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart, CraftLootableEntityInventory { // Paper ++public class CraftMinecartChest extends CraftMinecartContainer implements StorageMinecart, PaperLootableEntityInventory { // Paper private final CraftInventory inventory; public CraftMinecartChest(CraftServer server, EntityMinecartChest entity) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java -index 8ce9737451..7e11993aa6 100644 +index 87303ecd13..6790fa2fee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartContainer.java @@ -0,0 +0,0 @@ public abstract class CraftMinecartContainer extends CraftMinecart implements Lo - return getHandle().d; // PAIL rename lootTableSeed + return getHandle().lootTableSeed; } - private void setLootTable(LootTable table, long seed) { -+ public void setLootTable(LootTable table, long seed) { ++ public void setLootTable(LootTable table, long seed) { // Paper MinecraftKey newKey = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); getHandle().a(newKey, seed); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java -index f29365c948..c51de47433 100644 +index f29365c948..1937f7b9a2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartHopper.java @@ -0,0 +0,0 @@ package org.bukkit.craftbukkit.entity; -+import com.destroystokyo.paper.loottable.CraftLootableEntityInventory; // Paper ++import com.destroystokyo.paper.loottable.PaperLootableEntityInventory; // Paper import net.minecraft.server.EntityMinecartHopper; import org.bukkit.craftbukkit.CraftServer; @@ -722,34 +758,8 @@ index f29365c948..c51de47433 100644 import org.bukkit.inventory.Inventory; -public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart { -+public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart, CraftLootableEntityInventory { // Paper ++public final class CraftMinecartHopper extends CraftMinecartContainer implements HopperMinecart, PaperLootableEntityInventory { // Paper private final CraftInventory inventory; public CraftMinecartHopper(CraftServer server, EntityMinecartHopper entity) { -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index eb643cff3a..a3789c86b0 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -@@ -0,0 +0,0 @@ - package org.bukkit.craftbukkit.entity; - - import net.minecraft.server.EntityInsentient; -+import net.minecraft.server.MinecraftKey; - import org.bukkit.Bukkit; - import org.bukkit.NamespacedKey; - import org.bukkit.craftbukkit.CraftServer; -@@ -0,0 +0,0 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { - getHandle().bI = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey()); // PAIL rename lootTableKey - } - -+ // Paper start -+ public void setLootTable(LootTable table, long seed) { -+ setLootTable(table); -+ setSeed(seed); -+ } -+ // Paper end -+ - @Override - public LootTable getLootTable() { - if (getHandle().bI == null) { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/MC-111480-Start-Entity-ID-s-at-1.patch b/Spigot-Server-Patches/MC-111480-Start-Entity-ID-s-at-1.patch index 1e8bccfe1b..9a333bfda3 100644 --- a/Spigot-Server-Patches/MC-111480-Start-Entity-ID-s-at-1.patch +++ b/Spigot-Server-Patches/MC-111480-Start-Entity-ID-s-at-1.patch @@ -7,7 +7,7 @@ DataWatchers that store Entity ID's treat 0 as special, and can break things such as Elytra Fireworks. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 68b4a902e..ce33cd5b8 100644 +index f5e66aaf90..7b07fe1990 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/MC-135506-Experience-should-save-as-Integers.patch b/Spigot-Server-Patches/MC-135506-Experience-should-save-as-Integers.patch index 63cc3d25a3..14f9ae2a21 100644 --- a/Spigot-Server-Patches/MC-135506-Experience-should-save-as-Integers.patch +++ b/Spigot-Server-Patches/MC-135506-Experience-should-save-as-Integers.patch @@ -5,7 +5,7 @@ Subject: [PATCH] MC-135506: Experience should save as Integers diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index b8bfc7577..13299ad10 100644 +index 53cfc10017..904c6e1a7d 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { diff --git a/Spigot-Server-Patches/MC-Dev-fixes.patch b/Spigot-Server-Patches/MC-Dev-fixes.patch index da23674256..dd5f875069 100644 --- a/Spigot-Server-Patches/MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/MC-Dev-fixes.patch @@ -4,8 +4,21 @@ Date: Wed, 30 Mar 2016 19:36:20 -0400 Subject: [PATCH] MC Dev fixes +diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java +index c3e990bdff..e2a7b4be2c 100644 +--- a/src/main/java/net/minecraft/server/BaseBlockPosition.java ++++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java +@@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { + return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); + } + +- public int compareTo(Object object) { ++ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix + return this.l((BaseBlockPosition) object); + } + } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 002da2a19..9f3aa2459 100644 +index 002da2a191..9f3aa24590 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 { @@ -59,7 +72,7 @@ index 002da2a19..9f3aa2459 100644 } diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 650ef1475..35aea4829 100644 +index 650ef14758..35aea4829f 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -0,0 +0,0 @@ public class ChunkSection { @@ -72,7 +85,7 @@ index 650ef1475..35aea4829 100644 if (flag) { this.skyLight = new NibbleArray(); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 20b1bc1b4..030ec8704 100644 +index 20b1bc1b48..030ec87047 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -0,0 +0,0 @@ public class DataPaletteBlock implements DataPaletteExpandable { @@ -111,7 +124,7 @@ index 20b1bc1b4..030ec8704 100644 datapalettehash.a(nbttaglist); DataBits databits = new DataBits(i, 4096, along); diff --git a/src/main/java/net/minecraft/server/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/DedicatedPlayerList.java -index 4997255c7..a5545bd4c 100644 +index 1b91759cb2..ba1e38f8e0 100644 --- a/src/main/java/net/minecraft/server/DedicatedPlayerList.java +++ b/src/main/java/net/minecraft/server/DedicatedPlayerList.java @@ -0,0 +0,0 @@ public class DedicatedPlayerList extends PlayerList { @@ -124,7 +137,7 @@ index 4997255c7..a5545bd4c 100644 - } } diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java -index a661789c1..785a1a218 100644 +index cd883e8529..bb1d00e440 100644 --- a/src/main/java/net/minecraft/server/DefinedStructure.java +++ b/src/main/java/net/minecraft/server/DefinedStructure.java @@ -0,0 +0,0 @@ public class DefinedStructure { @@ -179,7 +192,7 @@ index a661789c1..785a1a218 100644 public Iterator iterator() { diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 188d49d82..854ad49b6 100644 +index 188d49d820..854ad49b6c 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { @@ -243,7 +256,7 @@ index 188d49d82..854ad49b6 100644 } diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java -index 8f06c5848..4361b2cee 100644 +index 8f06c58485..4361b2cee5 100644 --- a/src/main/java/net/minecraft/server/LocaleLanguage.java +++ b/src/main/java/net/minecraft/server/LocaleLanguage.java @@ -0,0 +0,0 @@ public class LocaleLanguage { @@ -255,8 +268,26 @@ index 8f06c5848..4361b2cee 100644 } this.e = SystemUtils.b(); +diff --git a/src/main/java/net/minecraft/server/LootSelectorEntry.java b/src/main/java/net/minecraft/server/LootSelectorEntry.java +index 3cd5045636..3d501aee30 100644 +--- a/src/main/java/net/minecraft/server/LootSelectorEntry.java ++++ b/src/main/java/net/minecraft/server/LootSelectorEntry.java +@@ -0,0 +0,0 @@ public abstract class LootSelectorEntry { + return jsonobject; + } + +- public JsonElement serialize(Object object, Type type, JsonSerializationContext jsonserializationcontext) { ++ public JsonElement serialize(LootSelectorEntry object, Type type, JsonSerializationContext jsonserializationcontext) { // Paper - decompile fix + return this.a((LootSelectorEntry) object, type, jsonserializationcontext); + } + +- public Object deserialize(JsonElement jsonelement, Type type, JsonDeserializationContext jsondeserializationcontext) throws JsonParseException { ++ public LootSelectorEntry 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/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java -index 86585a13f..f52b9c6f0 100644 +index 28fb88dade..5329102dd7 100644 --- a/src/main/java/net/minecraft/server/MathHelper.java +++ b/src/main/java/net/minecraft/server/MathHelper.java @@ -0,0 +0,0 @@ import java.util.function.IntPredicate; @@ -268,8 +299,121 @@ index 86585a13f..f52b9c6f0 100644 for (int i = 0; i < afloat.length; ++i) { afloat[i] = (float) Math.sin((double) i * 3.141592653589793D * 2.0D / 65536.0D); } +diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java +index 8170a84280..e21e60b003 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 1a81d8e5f6..057c2077a0 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 + } + + public T set(int i, T t0) { +- NBTBase nbtbase = this.get(i); ++ T nbtbase = this.get(i); // Paper - decompile fix + + this.a(i, t0); + return nbtbase; +@@ -0,0 +0,0 @@ public abstract class NBTList extends AbstractList impleme + + public abstract void b(int i); + +- public Object set(int i, Object object) { +- return this.set(i, (NBTBase) object); +- } +- +- 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 11ffa6c342..5d61cf70bc 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() { // Paper - decompile fix + 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/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java +index f5c9b97d5c..d121ad4f7a 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 b3c944d701..a8280acf94 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; + public class NBTTagList extends NBTList { + + private static final Logger f = LogManager.getLogger(); +- private List list = Lists.newArrayList(); ++ public List list = Lists.newArrayList(); // Paper + private byte type = 0; + + public NBTTagList() {} +@@ -0,0 +0,0 @@ public class NBTTagList extends NBTList { + return this.type; + } + +- public NBTBase clone() { ++ public NBTTagList clone() { + return this.c(); + } +- +- public Object remove(int i) { +- return this.remove(i); +- } +- +- public Object set(int i, Object object) { +- return this.set(i, (NBTBase) object); +- } +- +- public Object get(int i) { +- return this.get(i); +- } +- +- public boolean add(Object object) { +- return this.add((NBTBase) object); +- } + } diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 824e68b50..584a86c11 100644 +index 528eb255ec..541435d3e5 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { @@ -279,7 +423,7 @@ index 824e68b50..584a86c11 100644 - return block == null || block.getBlockData().isAir(); + return block == null || ((Block) block).getBlockData().isAir(); // Paper - decompile fix }; - RegistryBlocks registryblocks = Block.REGISTRY; + IRegistry iregistry = IRegistry.BLOCK; @@ -0,0 +0,0 @@ public class ProtoChunk implements IChunkAccess { } @@ -317,8 +461,30 @@ index 824e68b50..584a86c11 100644 return new BitSet(65536); }); } +diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java +index ef332d6517..7cc7eb7735 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/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java -index 3b8f6ec16..bde5714dd 100644 +index 3b8f6ec167..bde5714dd6 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java @@ -0,0 +0,0 @@ import java.util.Arrays; @@ -358,8 +524,54 @@ index 3b8f6ec16..bde5714dd 100644 this.e = 0; this.f = 0; +diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java +index 2179664a0c..d7e1ecc031 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); + } + } diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index 43596cb2d..3faf74a22 100644 +index 43596cb2d5..3faf74a22f 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java @@ -0,0 +0,0 @@ public class ShapeDetector { @@ -372,7 +584,7 @@ index 43596cb2d..3faf74a22 100644 } } diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index 4b5463cca..53c9f2188 100644 +index 0b3141d3e7..700900256b 100644 --- a/src/main/java/net/minecraft/server/VoxelShape.java +++ b/src/main/java/net/minecraft/server/VoxelShape.java @@ -0,0 +0,0 @@ public abstract class VoxelShape { diff --git a/Spigot-Server-Patches/MC-Utils.patch b/Spigot-Server-Patches/MC-Utils.patch index e3075ea349..c0bff0aaf2 100644 --- a/Spigot-Server-Patches/MC-Utils.patch +++ b/Spigot-Server-Patches/MC-Utils.patch @@ -4,21 +4,8 @@ Date: Mon, 28 Mar 2016 20:55:47 -0400 Subject: [PATCH] MC Utils -diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index c3e990bd..e2a7b4be 100644 ---- a/src/main/java/net/minecraft/server/BaseBlockPosition.java -+++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java -@@ -0,0 +0,0 @@ public class BaseBlockPosition implements Comparable { - return MoreObjects.toStringHelper(this).add("x", this.getX()).add("y", this.getY()).add("z", this.getZ()).toString(); - } - -- public int compareTo(Object object) { -+ public int compareTo(BaseBlockPosition object) { // Paper - decompile fix - return this.l((BaseBlockPosition) object); - } - } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 9f3aa245..7dbea909 100644 +index 9f3aa24590..ca5c56c2b6 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; @@ -26,6 +13,7 @@ index 9f3aa245..7dbea909 100644 public class BlockPosition extends BaseBlockPosition { - private static final Logger b = LogManager.getLogger(); ++ //private static final Logger b = LogManager.getLogger(); // Paper - variable name conflict, logger isn't used public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); private static final int c = 1 + MathHelper.e(MathHelper.c(30000000)); private static final int d = BlockPosition.c; @@ -54,18 +42,18 @@ index 9f3aa245..7dbea909 100644 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 03c96de9..2d06202d 100644 +index 542b2aaf4d..35cb5ca575 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ import com.google.common.collect.Lists; // CraftBukkit public class Chunk implements IChunkAccess { - private static final Logger e = LogManager.getLogger(); + private static final Logger d = LogManager.getLogger(); - public static final ChunkSection a = null; + public static final ChunkSection a = null; public static final ChunkSection EMPTY_CHUNK_SECTION = Chunk.a; // Paper - OBFHELPER private final ChunkSection[] sections; - private final BiomeBase[] g; - private final boolean[] h; + private final BiomeBase[] f; + private final boolean[] g; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { return this.a(blockposition, Chunk.EnumTileEntityState.CHECK); } @@ -75,7 +63,7 @@ index 03c96de9..2d06202d 100644 public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 00a530c5..2947d9ff 100644 +index 34586bca65..b0c004b1f2 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java @@ -0,0 +0,0 @@ public class ChunkCoordIntPair { @@ -88,7 +76,7 @@ index 00a530c5..2947d9ff 100644 return (long) i & 4294967295L | ((long) j & 4294967295L) << 32; } diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 5d9118da..8b50ec53 100644 +index 3b6b3b9a99..22af9c1885 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; @@ -101,7 +89,7 @@ index 5d9118da..8b50ec53 100644 private final IChunkLoader e; private final IAsyncTaskHandler f; diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index d24ec3d5..9e83610f 100644 +index d24ec3d53c..9e83610f1a 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 { @@ -113,7 +101,7 @@ index d24ec3d5..9e83610f 100644 return this.a; } diff --git a/src/main/java/net/minecraft/server/DataPalette.java b/src/main/java/net/minecraft/server/DataPalette.java -index dae40b9c..0be0b0ef 100644 +index dae40b9cde..0be0b0ef51 100644 --- a/src/main/java/net/minecraft/server/DataPalette.java +++ b/src/main/java/net/minecraft/server/DataPalette.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -128,7 +116,7 @@ index dae40b9c..0be0b0ef 100644 T a(int i); diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 030ec870..575f9b55 100644 +index 030ec87047..575f9b5587 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -0,0 +0,0 @@ import java.util.stream.Collectors; @@ -170,7 +158,7 @@ index 030ec870..575f9b55 100644 this.b(); packetdataserializer.writeByte(this.i); diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index b3475676..ceed50d8 100644 +index 2c6fbd1d6f..3790039f18 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -182,7 +170,7 @@ index b3475676..ceed50d8 100644 private float b; diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 514c9515..5b339975 100644 +index fd050c5f32..91c4785889 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 { @@ -194,7 +182,7 @@ index 514c9515..5b339975 100644 @Override public float getBukkitYaw() { diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index 494ce0bc..04c3756e 100644 +index 96e0122150..a3449e9a8d 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -0,0 +0,0 @@ package net.minecraft.server; @@ -206,7 +194,7 @@ index 494ce0bc..04c3756e 100644 super(entitytypes, world); this.b_ = 5; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index ca2a14d7..9a513b4e 100644 +index 17bfa356f1..5c1ab6a0b6 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; @@ -221,14 +209,13 @@ index ca2a14d7..9a513b4e 100644 public static EntityTypes a(String s, EntityTypes.a entitytypes_a) { EntityTypes entitytypes = entitytypes_a.a(s); -- 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); + IRegistry.ENTITY_TYPE.a(new MinecraftKey(s), entitytypes); // CraftBukkit - decompile error + clsToKeyMap.put(entityClass, key); + clsToTypeMap.put(entityClass, org.bukkit.entity.EntityType.fromName(s)); return entitytypes; @@ -248,8 +235,17 @@ index ca2a14d7..9a513b4e 100644 private final Function b; private boolean c = true; private boolean d = true; +@@ -0,0 +0,0 @@ public class EntityTypes { + + // Paper start + public static Set getEntityNameList() { +- return REGISTRY.keySet(); ++ return IRegistry.ENTITY_TYPE.keySet(); + } + // Paper end + } diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 359979cc..0c54eaa5 100644 +index c54275bc2f..318c4204df 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.TreeType; @@ -278,27 +274,9 @@ index 359979cc..0c54eaa5 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 a540167d..add61886 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 00000000..70cdc3f1 +index 0000000000..9f9341c98f --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +0,0 @@ @@ -540,6 +518,10 @@ index 00000000..70cdc3f1 + return new Location(entity.getWorld().getWorld(), entity.locX, entity.locY, entity.locZ); + } + ++ public static org.bukkit.block.Block toBukkitBlock(World world, BlockPosition pos) { ++ return world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ()); ++ } ++ + public static BlockPosition toBlockPosition(Location loc) { + return new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); + } @@ -594,70 +576,8 @@ index 00000000..70cdc3f1 + return null; + } +} -diff --git a/src/main/java/net/minecraft/server/NBTBase.java b/src/main/java/net/minecraft/server/NBTBase.java -index 8170a842..e21e60b0 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 1a81d8e5..057c2077 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 - } - - public T set(int i, T t0) { -- NBTBase nbtbase = this.get(i); -+ T nbtbase = this.get(i); // Paper - decompile fix - - this.a(i, t0); - return nbtbase; -@@ -0,0 +0,0 @@ public abstract class NBTList extends AbstractList impleme - - public abstract void b(int i); - -- public Object set(int i, Object object) { -- return this.set(i, (NBTBase) object); -- } -- -- 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 11ffa6c3..3ff3a298 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 7fc9b5ff..e658816c 100644 +index 7fc9b5ff32..e658816c24 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -0,0 +0,0 @@ public class NBTTagCompound implements NBTBase { @@ -690,61 +610,10 @@ index 7fc9b5ff..e658816c 100644 - - public NBTBase clone() { - return this.clone(); -- } - } -diff --git a/src/main/java/net/minecraft/server/NBTTagIntArray.java b/src/main/java/net/minecraft/server/NBTTagIntArray.java -index f5c9b97d..d121ad4f 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 b3c944d7..a8280acf 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; - public class NBTTagList extends NBTList { - - private static final Logger f = LogManager.getLogger(); -- private List list = Lists.newArrayList(); -+ public List list = Lists.newArrayList(); // Paper - private byte type = 0; - - public NBTTagList() {} -@@ -0,0 +0,0 @@ public class NBTTagList extends NBTList { - return this.type; - } - -- public NBTBase clone() { -+ public NBTTagList clone() { - return this.c(); - } -- -- public Object remove(int i) { -- return this.remove(i); -- } -- -- public Object set(int i, Object object) { -- return this.set(i, (NBTBase) object); -- } -- -- public Object get(int i) { -- return this.get(i); -- } -- -- public boolean add(Object object) { -- return this.add((NBTBase) object); - } } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 0afaea81..26da8972 100644 +index 0afaea8109..26da897243 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -0,0 +0,0 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -785,7 +654,7 @@ index 0afaea81..26da8972 100644 public QueuedPacket(Packet packet, @Nullable GenericFutureListener> genericfuturelistener) { this.a = packet; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index d04afceb..a63a5811 100644 +index d04afceb70..a63a5811d6 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 { @@ -797,7 +666,7 @@ index d04afceb..a63a5811 100644 for (int j = 1; j < 5; ++j) { if ((i & -1 << j * 7) == 0) { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 1aa36156..ae95fdf9 100644 +index a8363f47b3..33436ac65b 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -0,0 +0,0 @@ public class PacketPlayOutMapChunk implements Packet { @@ -818,7 +687,7 @@ index 1aa36156..ae95fdf9 100644 int j = 0; ChunkSection[] achunksection = chunk.getSections(); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0618962e..42e0630e 100644 +index 43bd6aba9d..7dee734a70 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 { @@ -835,28 +704,10 @@ index 0618962e..42e0630e 100644 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 ef332d65..a804a67e 100644 +index 7cc7eb7735..a804a67e16 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); -@@ -0,0 +0,0 @@ public class RegistryBlockID implements Registry { +@@ -0,0 +0,0 @@ public class RegistryBlockID implements Registry { // Paper - decompile fix return Iterators.filter(this.c.iterator(), Predicates.notNull()); } @@ -864,50 +715,4 @@ index ef332d65..a804a67e 100644 public int a() { return this.b.size(); } -diff --git a/src/main/java/net/minecraft/server/ServerPing.java b/src/main/java/net/minecraft/server/ServerPing.java -index 2179664a..d7e1ecc0 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-EnderDragon-implement-Mob.patch b/Spigot-Server-Patches/Make-EnderDragon-implement-Mob.patch index 46a73bcd79..a1c858da6a 100644 --- a/Spigot-Server-Patches/Make-EnderDragon-implement-Mob.patch +++ b/Spigot-Server-Patches/Make-EnderDragon-implement-Mob.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make EnderDragon implement Mob diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java -index cc115cc36..4947249da 100644 +index cc115cc368..4947249da2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftComplexLivingEntity.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch b/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch index 99a8f8f01c..39b3b01d91 100644 --- a/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch +++ b/Spigot-Server-Patches/Make-legacy-ping-handler-more-reliable.patch @@ -28,7 +28,7 @@ respond to the request. [2]: https://netty.io/wiki/user-guide-for-4.x.html#wiki-h4-13 diff --git a/src/main/java/net/minecraft/server/LegacyPingHandler.java b/src/main/java/net/minecraft/server/LegacyPingHandler.java -index 41115108f1..07c53f5057 100644 +index 64fe1d7e83..f7fbf1d76e 100644 --- a/src/main/java/net/minecraft/server/LegacyPingHandler.java +++ b/src/main/java/net/minecraft/server/LegacyPingHandler.java @@ -0,0 +0,0 @@ public class LegacyPingHandler extends ChannelInboundHandlerAdapter { 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 d8a58e2eab..b35f3ab3df 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 f3ab146d3b..128034dbb2 100644 +index a225b55853..63f8f566cb 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 { @@ -21,13 +21,13 @@ index f3ab146d3b..128034dbb2 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 97de169de2..3099f6aa7a 100644 +index 5d7d0b6910..2dfa794a3f 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -0,0 +0,0 @@ public class EntitySquid extends EntityWaterAnimal { } - public boolean a(GeneratorAccess generatoraccess) { + public boolean a(GeneratorAccess generatoraccess, boolean flag) { - return this.locY > this.world.spigotConfig.squidSpawnRangeMin && this.locY < (double) generatoraccess.getSeaLevel(); // Spigot + // Paper - Make max spawn height configurable + final double maxHeight = world.paperConfig.squidMaxSpawnHeight > 0 ? world.paperConfig.squidMaxSpawnHeight : world.getSeaLevel(); diff --git a/Spigot-Server-Patches/Make-player-data-saving-configurable.patch b/Spigot-Server-Patches/Make-player-data-saving-configurable.patch index b8acd7b8b7..dc2e4d122b 100644 --- a/Spigot-Server-Patches/Make-player-data-saving-configurable.patch +++ b/Spigot-Server-Patches/Make-player-data-saving-configurable.patch @@ -23,7 +23,7 @@ index 45863c017c..9bfbaf61e5 100644 + } } diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index a562e1e46c..cbfdb3cf79 100644 +index 0fd6efec0b..7553280d21 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { diff --git a/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch b/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch index de553d61e7..b34acf2511 100644 --- a/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch +++ b/Spigot-Server-Patches/Make-portal-teleportation-adjustment-math-more-accur.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make portal teleportation adjustment math more accurate diff --git a/src/main/java/net/minecraft/server/EnumDirection.java b/src/main/java/net/minecraft/server/EnumDirection.java -index 854ad49b6..3ee310a9a 100644 +index 854ad49b6c..3ee310a9aa 100644 --- a/src/main/java/net/minecraft/server/EnumDirection.java +++ b/src/main/java/net/minecraft/server/EnumDirection.java @@ -0,0 +0,0 @@ public enum EnumDirection implements INamable { @@ -33,7 +33,7 @@ index 854ad49b6..3ee310a9a 100644 return this.c; } diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java -index f52b9c6f0..3adbfb820 100644 +index 5329102dd7..2e5b89af82 100644 --- a/src/main/java/net/minecraft/server/MathHelper.java +++ b/src/main/java/net/minecraft/server/MathHelper.java @@ -0,0 +0,0 @@ public class MathHelper { @@ -45,7 +45,7 @@ index f52b9c6f0..3adbfb820 100644 return d0 < d1 ? d1 : (d0 > d2 ? d2 : d0); } diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 72b85bf60..67938e39c 100644 +index 20f2a9197c..fd372103be 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -0,0 +0,0 @@ public class PortalTravelAgent { @@ -79,7 +79,7 @@ index 72b85bf60..67938e39c 100644 float f1 = 0.0F; float f2 = 0.0F; diff --git a/src/main/java/net/minecraft/server/ShapeDetector.java b/src/main/java/net/minecraft/server/ShapeDetector.java -index 3faf74a22..4e1f8c211 100644 +index 3faf74a22f..4e1f8c211d 100644 --- a/src/main/java/net/minecraft/server/ShapeDetector.java +++ b/src/main/java/net/minecraft/server/ShapeDetector.java @@ -0,0 +0,0 @@ public class ShapeDetector { diff --git a/Spigot-Server-Patches/Make-shield-blocking-delay-configurable.patch b/Spigot-Server-Patches/Make-shield-blocking-delay-configurable.patch index 795c7a3bbb..5119f06c90 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 3467da7c8e..ddb5ced79d 100644 +index 16e601f7e9..2e3e48637a 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 { @@ -19,7 +19,7 @@ index 3467da7c8e..ddb5ced79d 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 3236179a45..f4a7db369f 100644 +index e2ceb7ae4b..ef1a1e5790 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 { @@ -49,7 +49,7 @@ index 3236179a45..f4a7db369f 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 49f515d868..fab1af7159 100644 +index 9acafadbbf..a09cd02403 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/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/Spigot-Server-Patches/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch index efbaa29978..9f03b0b03b 100644 --- a/Spigot-Server-Patches/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch +++ b/Spigot-Server-Patches/Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index c96f1b2753..4973721243 100644 +index 6b8d4c79e8..5e8a20fdd6 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { diff --git a/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch b/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch index 2f43bcbd8c..d0c157cc9f 100644 --- a/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch +++ b/Spigot-Server-Patches/Mark-chunk-dirty-anytime-entities-change-to-guarante.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 724c1f572..67e2158ca 100644 +index 4eb08553c6..404b7d21c2 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/More-informative-vehicle-moved-wrongly-message.patch b/Spigot-Server-Patches/More-informative-vehicle-moved-wrongly-message.patch index b297a72a52..2b1280e112 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 1ca3c87c7a..0fe8d1c3f1 100644 +index cc72398715..078230521f 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/Ocelot-despawns-should-honor-nametags-and-leash.patch b/Spigot-Server-Patches/Ocelot-despawns-should-honor-nametags-and-leash.patch index f4b3635d3b..2c16a87b07 100644 --- a/Spigot-Server-Patches/Ocelot-despawns-should-honor-nametags-and-leash.patch +++ b/Spigot-Server-Patches/Ocelot-despawns-should-honor-nametags-and-leash.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ocelot despawns should honor nametags and leash diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index 4e132eabb1..c28b72222e 100644 +index 447e6c2d12..5431ef57ab 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -0,0 +0,0 @@ public class EntityOcelot extends EntityTameableAnimal { diff --git a/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch index e1ddc48c68..9852b6bfee 100644 --- a/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch +++ b/Spigot-Server-Patches/Only-send-Dragon-Wither-Death-sounds-to-same-world.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Only send Dragon/Wither Death sounds to same world Also fix view distance lookup diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index bbd807315a..131f8a5156 100644 +index 5375ef4699..b9afeaf72e 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IComplex, IMo @@ -25,7 +25,7 @@ index bbd807315a..131f8a5156 100644 double deltaZ = this.locZ - player.locZ; double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 4f73b02baf..0d68a9be6c 100644 +index b84e5728a0..485cac3240 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java @@ -0,0 +0,0 @@ public class EntityWither extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/Optimise-removeQueue.patch b/Spigot-Server-Patches/Optimise-removeQueue.patch index 58b4f08f97..bb27eb9baa 100644 --- a/Spigot-Server-Patches/Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/Optimise-removeQueue.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9bb70c151d..9505511b14 100644 +index 47cf068a1e..d8299a5759 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ import com.mojang.authlib.GameProfile; @@ -25,11 +25,15 @@ index 9bb70c151d..9505511b14 100644 public double e; - public final List removeQueue = Lists.newLinkedList(); + public final Deque removeQueue = new ArrayDeque<>(); // Paper - private final AdvancementDataPlayer cg; - private final ServerStatisticManager ch; - private float ci = Float.MIN_VALUE; + private final AdvancementDataPlayer cf; + private final ServerStatisticManager cg; + private float ch = Float.MIN_VALUE; @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - Iterator iterator = this.removeQueue.iterator(); + while (!this.removeQueue.isEmpty()) { + int i = Math.min(this.removeQueue.size(), Integer.MAX_VALUE); + int[] aint = new int[i]; +- Iterator iterator = this.removeQueue.iterator(); ++ //Iterator iterator = this.removeQueue.iterator(); // Paper int j = 0; - while (iterator.hasNext() && j < i) { @@ -49,15 +53,18 @@ index 9bb70c151d..9505511b14 100644 } @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.lastHealthSent = -1.0F; - this.cp = -1; - // this.cz.a((RecipeBook) entityplayer.cz); // CraftBukkit + this.co = -1; + // this.cy.a((RecipeBook) entityplayer.cy); // CraftBukkit - this.removeQueue.addAll(entityplayer.removeQueue); -+ // Paper start - Optimize remove queue ++ // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only ++ // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting" ++ // type logic so it does need to be called, maybe? This is silly. + //this.removeQueue.addAll(entityplayer.removeQueue); + if (this.removeQueue != entityplayer.removeQueue) { + this.removeQueue.addAll(entityplayer.removeQueue); + } - this.cy = entityplayer.cy; - this.cD = entityplayer.cD; ++ // Paper end + this.cx = entityplayer.cx; + this.cC = entityplayer.cC; this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-BlockPosition-helper-methods.patch b/Spigot-Server-Patches/Optimize-BlockPosition-helper-methods.patch index be358715ba..472077b0be 100644 --- a/Spigot-Server-Patches/Optimize-BlockPosition-helper-methods.patch +++ b/Spigot-Server-Patches/Optimize-BlockPosition-helper-methods.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize BlockPosition helper methods Resolves #1338 diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index f769b178c..bff8fcd47 100644 +index 936a49a3e8..7215056bd1 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 { diff --git a/Spigot-Server-Patches/Optimize-CraftBlockData-Creation.patch b/Spigot-Server-Patches/Optimize-CraftBlockData-Creation.patch index 2809225756..eadeb88b79 100644 --- a/Spigot-Server-Patches/Optimize-CraftBlockData-Creation.patch +++ b/Spigot-Server-Patches/Optimize-CraftBlockData-Creation.patch @@ -34,7 +34,7 @@ index 4dd6c32761..1b226a77e0 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index b57f6efb3a..7b1d750f3a 100644 +index 6f80876990..726b178fd8 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java @@ -0,0 +0,0 @@ public interface IBlockData extends IBlockDataHolder { @@ -47,7 +47,7 @@ index b57f6efb3a..7b1d750f3a 100644 return this.getBlock().n(this); } diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index a4f3dd1b03..baaace6937 100644 +index d470e2b34a..b9279d925c 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -0,0 +0,0 @@ public class CraftBlockData implements BlockData { diff --git a/Spigot-Server-Patches/Optimize-Hoppers.patch b/Spigot-Server-Patches/Optimize-Hoppers.patch index b0637a7bfc..0726ea944f 100644 --- a/Spigot-Server-Patches/Optimize-Hoppers.patch +++ b/Spigot-Server-Patches/Optimize-Hoppers.patch @@ -11,7 +11,7 @@ Subject: [PATCH] Optimize Hoppers * Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 458baf4442..a87258bbed 100644 +index 06c949ef06..19f4c61cdc 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 { @@ -31,7 +31,7 @@ index 458baf4442..a87258bbed 100644 private void disableSprintInterruptionOnAttack() { disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index da11ec1672..d96fdad668 100644 +index 9326eaa2a9..4641113f9d 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 { @@ -47,19 +47,21 @@ index da11ec1672..d96fdad668 100644 itemstack.d(this.B()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5fdd65b083..f8a1c3b8fa 100644 +index 24e8b5ed14..42e0e16949 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 - if (true || i == 0 || this.getAllowNether()) { // CraftBukkit - WorldServer worldserver = this.worlds.get(i); -+ TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - + // CraftBukkit - dropTickTime + for (Iterator iterator = this.getWorlds().iterator(); iterator.hasNext();) { +- WorldServer worldserver = (WorldServer) iterator.next(); ++ WorldServer worldserver = (WorldServer) iterator.next(); ++ TileEntityHopper.skipHopperEvents = worldserver.paperConfig.disableHopperMoveEvents || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper + i = SystemUtils.c(); + if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit this.methodProfiler.a(() -> { - return worldserver.getWorldData().getName(); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 536fd37254..d2359a30f8 100644 +index 29fe031d85..d67fd92d9d 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -79,7 +81,7 @@ index 536fd37254..d2359a30f8 100644 this.world.b(this.position, this); if (!this.f.isAir()) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index bb41d4780f..ef0f8d5c27 100644 +index 5ba009c7cf..a8cf160fe4 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -0,0 +0,0 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi diff --git a/Spigot-Server-Patches/Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/Optimize-ItemStack.isEmpty.patch index f0d40aed0e..672e89ee7a 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 c7ef9c6890..4f230975aa 100644 +index 56787ed25c..f71d9ee578 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-Network-Queue.patch b/Spigot-Server-Patches/Optimize-Network-Queue.patch deleted file mode 100644 index 2c39157d8e..0000000000 --- a/Spigot-Server-Patches/Optimize-Network-Queue.patch +++ /dev/null @@ -1,20 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: vemacs -Date: Wed, 23 Nov 2016 12:54:56 -0500 -Subject: [PATCH] Optimize Network Queue - - -diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 02daa43c68..0560882314 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 - private final GameProfileRepository W; - private final UserCache X; - private long Y; -- protected final Queue> g = Queues.newConcurrentLinkedQueue(); -+ protected final Queue> g = new com.destroystokyo.paper.utils.CachedSizeConcurrentLinkedQueue<>(); // Spigot, PAIL: Rename // Paper - Make size() constant-time - private Thread serverThread; - private long aa = SystemUtils.b(); - private final IReloadableResourceManager ac; --- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-Region-File-Cache.patch b/Spigot-Server-Patches/Optimize-Region-File-Cache.patch index fabd8d2f87..b8895e717d 100644 --- a/Spigot-Server-Patches/Optimize-Region-File-Cache.patch +++ b/Spigot-Server-Patches/Optimize-Region-File-Cache.patch @@ -32,7 +32,7 @@ synchronized context, reducing lock times. Ultimately: This brings us back to Vanilla, which has had no indication of region file loss. diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 3b8d01ea1..609d6c355 100644 +index c0ab543b91..15666325ea 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -0,0 +0,0 @@ public class RegionFileCache { @@ -49,13 +49,13 @@ index 3b8d01ea1..609d6c355 100644 @Nullable - public static synchronized void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { -+ public static void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { // Paper - remove synchronization ++ public static void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException { + int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper RegionFile regionfile = a(file, i, j); - DataOutputStream dataoutputstream = regionfile.c(i & 31, j & 31); @@ -0,0 +0,0 @@ public class RegionFileCache { + // Paper end } - // CraftBukkit end - public static synchronized boolean chunkExists(File file, int i, int j) { + public static boolean chunkExists(File file, int i, int j) { // Paper - remove synchronization diff --git a/Spigot-Server-Patches/Optimize-RegistryID.c.patch b/Spigot-Server-Patches/Optimize-RegistryID.c.patch index 151f5c5dca..97f312f7e5 100644 --- a/Spigot-Server-Patches/Optimize-RegistryID.c.patch +++ b/Spigot-Server-Patches/Optimize-RegistryID.c.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize RegistryID.c() This is a frequent hotspot for world loading/saving. diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java -index bde5714dd..a01cda9d8 100644 +index bde5714dd6..a01cda9d81 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java @@ -0,0 +0,0 @@ public class RegistryID implements Registry { // Paper - decompile fix diff --git a/Spigot-Server-Patches/Optimize-RegistryMaterials.patch b/Spigot-Server-Patches/Optimize-RegistryMaterials.patch new file mode 100644 index 0000000000..482bef5eb8 --- /dev/null +++ b/Spigot-Server-Patches/Optimize-RegistryMaterials.patch @@ -0,0 +1,34 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Sun, 26 Aug 2018 20:49:50 -0400 +Subject: [PATCH] Optimize RegistryMaterials + +Use larger initial sizes to increase bucket capacity on the BiMap + +BiMap.get was seen to be using a good bit of CPU time. + +diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java +index 2aa6f89c18..1974baff83 100644 +--- a/src/main/java/net/minecraft/server/RegistryMaterials.java ++++ b/src/main/java/net/minecraft/server/RegistryMaterials.java +@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; + public class RegistryMaterials implements IRegistry { + + protected static final Logger a = LogManager.getLogger(); +- protected final RegistryID b = new RegistryID(256); +- protected final BiMap c = HashBiMap.create(); ++ protected final RegistryID b = new RegistryID<>(2048); // Paper - use bigger expected size to reduce collisions ++ protected final BiMap c = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions + protected Object[] d; + private int x; + +@@ -0,0 +0,0 @@ public class RegistryMaterials implements IRegistry { + this.d = set.toArray(new Object[set.size()]); + } + +- return this.d[random.nextInt(this.d.length)]; ++ return (V) this.d[random.nextInt(this.d.length)]; // Paper - decompile fix + } + + public boolean c(MinecraftKey minecraftkey) { +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch index 6b1c1c4edc..cea4cba056 100644 --- a/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/Optimize-UserCache-Thread-Safe.patch @@ -10,7 +10,7 @@ Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b41e7badff..e3469cacff 100644 +index 18aa3bbb22..b1fbba3e2f 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 diff --git a/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch index 339a3a3a89..e662c2df5c 100644 --- a/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/Spigot-Server-Patches/Optimize-World.isLoaded-BlockPosition-Z.patch @@ -6,10 +6,10 @@ 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 20e52fbcc8..6fe8ce96aa 100644 +index 0fd91a687e..0cf5d80899 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return this.getType(blockposition).isAir(); } @@ -19,5 +19,5 @@ index 20e52fbcc8..6fe8ce96aa 100644 + // Paper start public Chunk getChunkIfLoaded(BlockPosition blockposition) { - return ((ChunkProviderServer) this.chunkProvider).getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); + return getChunkIfLoaded(blockposition.getX() >> 4, blockposition.getZ() >> 4); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimize-explosions.patch b/Spigot-Server-Patches/Optimize-explosions.patch index 25f5fc26ee..251f1961d0 100644 --- a/Spigot-Server-Patches/Optimize-explosions.patch +++ b/Spigot-Server-Patches/Optimize-explosions.patch @@ -10,7 +10,7 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 53921b381..ae4a7cb09 100644 +index aa2f5414b0..bd1ac77aef 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -25,7 +25,7 @@ index 53921b381..ae4a7cb09 100644 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index e558a3a57..18c55402d 100644 +index 439d7ef40c..e440d6d631 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 { @@ -124,7 +124,7 @@ index e558a3a57..18c55402d 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1ac8d61cd..96d31f874 100644 +index c47f56ed8d..bdc779ef3b 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 @@ -133,10 +133,10 @@ index 1ac8d61cd..96d31f874 100644 this.methodProfiler.e(); + worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions } + } - // this.f[i][this.ticks % 100] = SystemUtils.c() - j; // CraftBukkit diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c40ecbc0c..1ca3eef11 100644 +index 93d1449750..9e192b7c04 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.apache.logging.log4j.Logger; @@ -147,7 +147,7 @@ index c40ecbc0c..1ca3eef11 100644 import java.util.Map; import org.bukkit.Bukkit; import org.bukkit.block.BlockState; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; private int tileTickPosition; 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 e16cc3c609..da382981b9 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 e2a7b4be2c..58f8b4b720 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 7dbea90902..252e00e166 100644 +index ca5c56c2b6..42e5e9ad8f 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 { @@ -52,7 +52,7 @@ index 7dbea90902..252e00e166 100644 public MutableBlockPosition() { this(0, 0, 0); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index ef6a54bcae..4b440c7077 100644 +index d86b925f0d..30dc4fb6df 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 { @@ -60,9 +60,10 @@ index ef6a54bcae..4b440c7077 100644 } - public IBlockData getBlockData(BlockPosition blockposition) { return getType(blockposition); } // Paper +- public IBlockData getType(BlockPosition blockposition) { + // Paper start - Optimize getBlockData to reduce instructions -+ public IBlockData getBlockData(BlockPosition pos) { return getBlockData(pos.getX(), pos.getY(), pos.getZ()); } // Paper - public IBlockData getType(BlockPosition blockposition) { ++ public final IBlockData getBlockData(BlockPosition pos) { return getBlockData(pos.getX(), pos.getY(), pos.getZ()); } // Paper ++ public final IBlockData getType(BlockPosition blockposition) { return this.getBlockData(blockposition.getX(), blockposition.getY(), blockposition.getZ()); } @@ -79,7 +80,7 @@ index ef6a54bcae..4b440c7077 100644 + + public IBlockData getBlockData_unused(int i, int j, int k) { + // Paper end - if (this.world.R() == WorldType.DEBUG_ALL_BLOCK_STATES) { + if (this.world.S() == WorldType.DEBUG_ALL_BLOCK_STATES) { IBlockData iblockdata = null; diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java @@ -96,10 +97,10 @@ index 35aea4829f..233cbb6d60 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 72c0c92ec1..1df7528949 100644 +index fd6f070417..45b0880607 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public static boolean isValidLocation(BlockPosition blockposition) { @@ -113,7 +114,7 @@ index 72c0c92ec1..1df7528949 100644 } public boolean isEmpty(BlockPosition blockposition) { -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // test if meets light level, return faster // logic copied from below public boolean isLightLevel(BlockPosition blockposition, int level) { @@ -122,7 +123,7 @@ index 72c0c92ec1..1df7528949 100644 if (this.getType(blockposition).c(this, blockposition)) { int sky = getSkylightSubtracted(); if (this.getLightLevel(blockposition.up(), sky) >= level) { -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit end Chunk chunk = this.getChunkIfLoaded(blockposition); if (chunk != null) { @@ -131,16 +132,16 @@ index 72c0c92ec1..1df7528949 100644 } return null; } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc return true; } // CraftBukkit end - if (k(blockposition)) { -+ if (blockposition.isInvalidYLocation()) { // Paper ++ if (blockposition.isInvalidYLocation()) { // Paper return false; } else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) { return false; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc blockposition = new BlockPosition(blockposition.getX(), 0, blockposition.getZ()); } @@ -154,7 +155,7 @@ index 72c0c92ec1..1df7528949 100644 if (this.isLoaded(blockposition)) { this.getChunkAtWorldCoords(blockposition).a(enumskyblock, blockposition, i); this.m(blockposition); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } // CraftBukkit end @@ -163,7 +164,7 @@ index 72c0c92ec1..1df7528949 100644 return Blocks.VOID_AIR.getBlockData(); } else { Chunk chunk = this.getChunkAtWorldCoords(blockposition); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public Fluid b(BlockPosition blockposition) { @@ -172,7 +173,7 @@ index 72c0c92ec1..1df7528949 100644 return FluidTypes.a.i(); } else { Chunk chunk = this.getChunkAtWorldCoords(blockposition); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public Map capturedTileEntities = Maps.newHashMap(); @Nullable public TileEntity getTileEntity(BlockPosition blockposition) { @@ -181,7 +182,7 @@ index 72c0c92ec1..1df7528949 100644 return null; } else { // CraftBukkit start -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { @@ -190,7 +191,7 @@ index 72c0c92ec1..1df7528949 100644 if (tileentity != null && !tileentity.x()) { // CraftBukkit start if (captureBlockStates) { -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } public boolean p(BlockPosition blockposition) { @@ -198,5 +199,5 @@ index 72c0c92ec1..1df7528949 100644 + if (blockposition.isInvalidYLocation()) { // Paper return false; } else { - Chunk chunk = this.chunkProvider.getLoadedChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4); + Chunk chunk = this.chunkProvider.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4, false, false); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch b/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch index 45e52d6607..e3b3d3cba4 100644 --- a/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch +++ b/Spigot-Server-Patches/Optimized-Light-Level-Comparisons.patch @@ -8,7 +8,7 @@ Use an optimized method to test if a block position meets a desired light level. This method benefits from returning as soon as the desired light level matches. diff --git a/src/main/java/net/minecraft/server/BlockCrops.java b/src/main/java/net/minecraft/server/BlockCrops.java -index b392846aa0..c64e6c197e 100644 +index 1506c9ede0..6ae6fc3ecb 100644 --- a/src/main/java/net/minecraft/server/BlockCrops.java +++ b/src/main/java/net/minecraft/server/BlockCrops.java @@ -0,0 +0,0 @@ public class BlockCrops extends BlockPlant implements IBlockFragilePlantElement @@ -21,7 +21,7 @@ index b392846aa0..c64e6c197e 100644 if (i < this.e()) { diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java -index 723e5c9b44..e24fb17366 100644 +index 42478d1fed..7426d14cbf 100644 --- a/src/main/java/net/minecraft/server/BlockSapling.java +++ b/src/main/java/net/minecraft/server/BlockSapling.java @@ -0,0 +0,0 @@ public class BlockSapling extends BlockPlant implements IBlockFragilePlantElemen @@ -34,7 +34,7 @@ index 723e5c9b44..e24fb17366 100644 world.captureTreeGeneration = true; // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java -index 0192f93864..334c42d0d8 100644 +index 4fc8c5d3c6..0fc39bb9fb 100644 --- a/src/main/java/net/minecraft/server/BlockStem.java +++ b/src/main/java/net/minecraft/server/BlockStem.java @@ -0,0 +0,0 @@ public class BlockStem extends BlockPlant implements IBlockFragilePlantElement { @@ -47,20 +47,20 @@ index 0192f93864..334c42d0d8 100644 if (random.nextInt((int) ((100.0F / (this == Blocks.PUMPKIN_STEM ? world.spigotConfig.pumpkinModifier : world.spigotConfig.melonModifier)) * (25.0F / f)) + 1) == 0) { // Spigot diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index 04c3756ea3..e0e5ba539c 100644 +index a3449e9a8d..5f60bf04e6 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -0,0 +0,0 @@ public abstract class EntityMonster extends EntityCreature implements IMonster { if (this.world.getBrightness(EnumSkyBlock.SKY, blockposition) > this.random.nextInt(32)) { return false; } else { -- int i = this.world.X() ? this.world.d(blockposition, 10) : this.world.getLightLevel(blockposition); +- int i = this.world.Y() ? this.world.d(blockposition, 10) : this.world.getLightLevel(blockposition); - - return i <= this.random.nextInt(8); + // Paper start - optimized light check, returns faster + boolean passes; -+ if (this.world.X()) { -+ int orig = world.getSkylightSubtracted(); ++ if (this.world.Y()) { ++ final int orig = world.getSkylightSubtracted(); + world.setSkylightSubtracted(10); + passes = !this.world.isLightLevel(blockposition, this.random.nextInt(8)); + world.setSkylightSubtracted(orig); @@ -73,7 +73,7 @@ index 04c3756ea3..e0e5ba539c 100644 } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 5c1bde19c5..2818ded921 100644 +index 1ab3072cc3..e5170bff5b 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -0,0 +0,0 @@ public class EntityZombie extends EntityMonster { @@ -83,6 +83,6 @@ index 5c1bde19c5..2818ded921 100644 - if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && this.world.getLightLevel(new BlockPosition(i1, j1, k1)) < 10) { + if (this.world.getType(new BlockPosition(i1, j1 - 1, k1)).q() && !this.world.isLightLevel(new BlockPosition(i1, j1, k1), 10)) { // Paper entityzombie.setPosition((double) i1, (double) j1, (double) k1); - if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.b((Entity) entityzombie, entityzombie.getBoundingBox()) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { + if (!this.world.isPlayerNearby((double) i1, (double) j1, (double) k1, 7.0D) && this.world.a_(entityzombie, entityzombie.getBoundingBox()) && this.world.getCubes(entityzombie, entityzombie.getBoundingBox()) && !this.world.containsLiquid(entityzombie.getBoundingBox())) { this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.REINFORCEMENTS); // CraftBukkit -- \ No newline at end of file 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 30ecc0b875..cc8b4a17bf 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,7 +5,7 @@ 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 23cb3feef0..1c642e6364 100644 +index 22af662ff3..9864c95a8c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -20,10 +20,10 @@ index 23cb3feef0..1c642e6364 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 412300fbb5..f740328183 100644 +index 9f6027d5e4..a6d5fb7c73 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc EntityExperienceOrb xp = (EntityExperienceOrb) entity; double radius = spigotConfig.expMerge; if (radius > 0) { 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 5e93d5ded9..cdc8503342 100644 --- a/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch +++ b/Spigot-Server-Patches/Option-to-disable-BlockPhysicsEvent-for-Redstone.patch @@ -11,12 +11,12 @@ Defaulting this to false will provide substantial performance improvement by saving millions of event calls on redstone heavy servers. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c2c33d75bf..b3b3baddc0 100644 +index b05277067a..5f3156af60 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 skeleHorseSpawnChance() { - skeleHorseSpawnChance = getDouble("skeleton-horse-thunder-spawn-chance", 0.01D); // -1.0D represents a "vanilla" state + skeleHorseSpawnChance = 0.01D; // Vanilla value + } } + + public boolean firePhysicsEventForRedstone = false; @@ -25,10 +25,10 @@ index c2c33d75bf..b3b3baddc0 100644 + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 1df7528949..87fd23c7f8 100644 +index 45b0880607..8f3b1d529a 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc try { // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); @@ -38,7 +38,7 @@ index 1df7528949..87fd23c7f8 100644 this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index ecee3b4064..96002184bb 100644 +index 253019d89b..8f704a0e0b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ import org.bukkit.event.weather.LightningStrikeEvent; diff --git a/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 3b47957047..300d9e0c57 100644 --- a/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Option to prevent armor stands from doing entity lookups diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 044da2754..61c8b58b1 100644 +index 3aa6f031f3..58f87794d6 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 { @@ -21,18 +21,10 @@ index 044da2754..61c8b58b1 100644 private void maxEntityCollision() { maxCollisionsPerEntity = getInt( "max-entity-collisions", this.spigotConfig.getInt("max-entity-collisions", 8) ); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 064c31c03..4b03f1965 100644 +index 2ad02b0a61..73cd2d015b 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -0,0 +0,0 @@ import java.util.Iterator; - import java.util.List; - import java.util.Random; - import java.util.UUID; -+ - import java.util.function.Function; - import java.util.function.Predicate; - import java.util.function.Supplier; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } diff --git a/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch index 6b8a367feb..660ab25d1b 100644 --- a/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch +++ b/Spigot-Server-Patches/Option-to-remove-corrupt-tile-entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Option to remove corrupt tile entities diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 499230af60..189ec79f05 100644 +index 78a3188274..79260172d9 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 { @@ -19,7 +19,7 @@ index 499230af60..189ec79f05 100644 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 229215180b..f6beb6886d 100644 +index 6c766f2bf7..fa549cc372 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 { @@ -36,11 +36,11 @@ index 229215180b..f6beb6886d 100644 // CraftBukkit end } @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - this.i.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound); + this.h.put(new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")), nbttagcompound); } + public void removeTileEntity(BlockPosition blockposition) { this.d(blockposition); } // Paper - OBFHELPER public void d(BlockPosition blockposition) { - if (this.j) { + if (this.i) { TileEntity tileentity = (TileEntity) this.tileEntities.remove(blockposition); -- \ No newline at end of file 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 fcd3236db4..4f2a963b85 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 @@ -5,7 +5,7 @@ Subject: [PATCH] Option to use vanilla per-world scoreboard coloring on names diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 667a0dde8c..b6ef1d4378 100644 +index 61e6dcb0ee..56a25531b4 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 { @@ -19,7 +19,7 @@ index 667a0dde8c..b6ef1d4378 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 53ef6b0ed6..da1254f5e1 100644 +index 5ab98cbcf1..3fc9568663 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 @@ -31,7 +31,7 @@ index 53ef6b0ed6..da1254f5e1 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 90ab7f065f..1ca3c87c7a 100644 +index 096e4e0d8c..cc72398715 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 4bca39329f..e376bacb49 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 @@ -5,7 +5,7 @@ Subject: [PATCH] Optional TNT doesn't move in water diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a3823408ca..41e73b3409 100644 +index c2c4e16d13..f8102d9f07 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; @@ -32,7 +32,7 @@ index a3823408ca..41e73b3409 100644 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 428eaca37a..964caa080c 100644 +index 4fb42a6319..5bd129bcaf 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/POM-Changes.patch b/Spigot-Server-Patches/POM-Changes.patch index 0fb3c57073..8d609a874d 100644 --- a/Spigot-Server-Patches/POM-Changes.patch +++ b/Spigot-Server-Patches/POM-Changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] POM Changes diff --git a/pom.xml b/pom.xml -index 5d398f7cb..09b4ddf19 100644 +index f1f0c20a52..17c3baaec9 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ @@ -16,7 +16,7 @@ index 5d398f7cb..09b4ddf19 100644 - spigot + paper jar - 1.13-R0.1-SNAPSHOT + 1.13.1-R0.1-SNAPSHOT - Spigot - http://www.spigotmc.org + Paper @@ -101,6 +101,7 @@ index 5d398f7cb..09b4ddf19 100644 org.bukkit.craftbukkit.Main CraftBukkit - ${spigot.desc}${craftbukkit.desc} ++ + ${describe} ${maven.build.timestamp} Bukkit @@ -168,7 +169,7 @@ index 5d398f7cb..09b4ddf19 100644 diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java -index 93046379d..674096cab 100644 +index 93046379d0..674096cab1 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java @@ -0,0 +0,0 @@ public final class Versioning { diff --git a/Spigot-Server-Patches/Paper-config-files.patch b/Spigot-Server-Patches/Paper-config-files.patch index 92b1234a42..77599bc884 100644 --- a/Spigot-Server-Patches/Paper-config-files.patch +++ b/Spigot-Server-Patches/Paper-config-files.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Paper config files diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java new file mode 100644 -index 0000000000..e8f7b7292d +index 0000000000..961966e169 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -0,0 +0,0 @@ @@ -239,7 +239,7 @@ index 0000000000..e8f7b7292d + + MinecraftServer console = MinecraftServer.getServer(); + com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); -+ for (WorldServer world : console.worlds) { ++ for (WorldServer world : console.getWorlds()) { + world.paperConfig.init(); + } + console.server.reloadCount++; @@ -432,7 +432,7 @@ index 0000000000..104abab84b +} diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java new file mode 100644 -index 0000000000..b8a6161d84 +index 0000000000..a738657394 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ @@ -493,7 +493,7 @@ index 0000000000..b8a6161d84 + return (float) getDouble(path, (double) def); + } + -+ private List getList(String path, T def) { ++ private List getList(String path, List def) { + config.addDefault("world-settings.default." + path, def); + return (List) config.getList("world-settings." + worldName + "." + path, config.getList("world-settings.default." + path)); + } @@ -504,7 +504,7 @@ index 0000000000..b8a6161d84 + } +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 5ff1e96861..3706e44a34 100644 +index 38720a87da..efa738d4ec 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -519,7 +519,7 @@ index 5ff1e96861..3706e44a34 100644 DedicatedServer.LOGGER.info("Generating keypair"); this.a(MinecraftEncryption.b()); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 55bf00be93..a1050912bc 100644 +index ef9f0e8834..8997cf84a4 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 { @@ -536,7 +536,7 @@ index 55bf00be93..a1050912bc 100644 public boolean impulse; public int portalCooldown; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index ad3f891999..ca2a14d7ac 100644 +index c6434ec371..17bfa356f1 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; @@ -547,7 +547,7 @@ index ad3f891999..ca2a14d7ac 100644 +import java.util.Set; import java.util.UUID; import java.util.function.Function; - import javax.annotation.Nullable; + import java.util.stream.Stream; @@ -0,0 +0,0 @@ public class EntityTypes { return new EntityTypes(this.a, this.b, this.c, this.d, type); } @@ -560,10 +560,10 @@ index ad3f891999..ca2a14d7ac 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 73bd5e1d74..e1cf1e579a 100644 +index 8d69cea10e..028678379a 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private int tickPosition; public final org.spigotmc.SpigotWorldConfig spigotConfig; // Spigot @@ -572,16 +572,16 @@ index 73bd5e1d74..e1cf1e579a 100644 public final SpigotTimings.WorldTimingsHandler timings; // Spigot private boolean guardEntityList; // Spigot public static boolean haveWeSilencedAPhysicsCrash; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc - protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag, ChunkGenerator gen, org.bukkit.World.Environment env) { + protected World(IDataManager idatamanager, @Nullable PersistentCollection persistentcollection, 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.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6ee7c56ada..ed3c23b74e 100644 +index 77cb857989..46a9ff9482 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 { @@ -589,7 +589,7 @@ index 6ee7c56ada..ed3c23b74e 100644 org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot + com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper - for (WorldServer world : console.worlds) { + for (WorldServer world : console.getWorlds()) { world.worldData.setDifficulty(difficulty); world.setSpawnFlags(monsters, animals); @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/Spigot-Server-Patches/Pass-World-to-Tile-Entity-Snapshots.patch b/Spigot-Server-Patches/Pass-World-to-Tile-Entity-Snapshots.patch index 64e3bf9568..4fa01d7e95 100644 --- a/Spigot-Server-Patches/Pass-World-to-Tile-Entity-Snapshots.patch +++ b/Spigot-Server-Patches/Pass-World-to-Tile-Entity-Snapshots.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Pass World to Tile Entity Snapshots diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java -index d4d9c5fc5..a72bbdbed 100644 +index d4d9c5fc50..a72bbdbedb 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -0,0 +0,0 @@ public class CraftBlockEntityState extends CraftBlockState diff --git a/Spigot-Server-Patches/Pass-world-to-Village-creation.patch b/Spigot-Server-Patches/Pass-world-to-Village-creation.patch index 6828660f25..cdd966e61b 100644 --- a/Spigot-Server-Patches/Pass-world-to-Village-creation.patch +++ b/Spigot-Server-Patches/Pass-world-to-Village-creation.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Pass world to Village creation fixes NPE bug #95 diff --git a/src/main/java/net/minecraft/server/PersistentVillage.java b/src/main/java/net/minecraft/server/PersistentVillage.java -index c09326636c..3219ccca40 100644 +index 98c6bbc183..7a9fb97530 100644 --- a/src/main/java/net/minecraft/server/PersistentVillage.java +++ b/src/main/java/net/minecraft/server/PersistentVillage.java @@ -0,0 +0,0 @@ public class PersistentVillage extends PersistentBase { @@ -19,7 +19,7 @@ index c09326636c..3219ccca40 100644 village.a(nbttagcompound1); this.villages.add(village); diff --git a/src/main/java/net/minecraft/server/Village.java b/src/main/java/net/minecraft/server/Village.java -index e742cbe120..dfcabb83a1 100644 +index f87e8e05af..bda67faefe 100644 --- a/src/main/java/net/minecraft/server/Village.java +++ b/src/main/java/net/minecraft/server/Village.java @@ -0,0 +0,0 @@ public class Village { diff --git a/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch b/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch index 8cda7943f3..72ea4e24cd 100644 --- a/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-Server-Patches/Player-Tab-List-and-Title-APIs.patch @@ -4,42 +4,8 @@ Date: Thu, 3 Mar 2016 02:32:10 -0600 Subject: [PATCH] Player Tab List and Title APIs -diff --git a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java -index d7c583a71..7096799c5 100644 ---- a/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java -+++ b/src/main/java/net/minecraft/server/PacketPlayOutPlayerListHeaderFooter.java -@@ -0,0 +0,0 @@ public class PacketPlayOutPlayerListHeaderFooter implements Packet { @@ -77,7 +43,7 @@ index 7b18c1640..900bd8357 100644 if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 02d2c00c0..0beb10f82 100644 +index 3cc16b6923..eceba690af 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 @@ @@ -94,10 +60,8 @@ index 02d2c00c0..0beb10f82 100644 + // Paper start + @Override + public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) { -+ PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter(); -+ packet.header = header; -+ packet.footer = footer; -+ getHandle().playerConnection.sendPacket(packet); ++ setPlayerListHeader(header == null ? null : net.md_5.bungee.chat.ComponentSerializer.toString(header)); ++ setPlayerListFooter(footer == null ? null : net.md_5.bungee.chat.ComponentSerializer.toString(footer)); + } + + @Override diff --git a/Spigot-Server-Patches/Player-affects-spawning-API.patch b/Spigot-Server-Patches/Player-affects-spawning-API.patch index 91b57bf010..99b9a2c03e 100644 --- a/Spigot-Server-Patches/Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/Player-affects-spawning-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index c5bc976c79..ca14080ccd 100644 +index 72477ec9ad..63f78924cb 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 { @@ -19,7 +19,7 @@ index c5bc976c79..ca14080ccd 100644 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 98b28e8573..0cfda190bc 100644 +index d4e688d4c0..ec06f4badb 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { @@ -32,11 +32,11 @@ index 98b28e8573..0cfda190bc 100644 double d1 = entityhuman.locY - this.locY; double d2 = entityhuman.locZ - this.locZ; diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java -index 75040a0f21..683191c4a8 100644 +index 850569f6b7..f958bd5bac 100644 --- a/src/main/java/net/minecraft/server/EntitySilverfish.java +++ b/src/main/java/net/minecraft/server/EntitySilverfish.java @@ -0,0 +0,0 @@ public class EntitySilverfish extends EntityMonster { - if (super.a(generatoraccess)) { + if (super.a(generatoraccess, flag)) { EntityHuman entityhuman = generatoraccess.b(this, 5.0D); - return entityhuman == null; @@ -45,7 +45,7 @@ index 75040a0f21..683191c4a8 100644 return false; } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index e54dcaa994..b12e767db9 100644 +index cbdd2431fd..9e24b77ad1 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { @@ -58,7 +58,7 @@ index e54dcaa994..b12e767db9 100644 j = MathHelper.floor(entityhuman.locZ / 16.0D); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 38d169cc14..d0516b0885 100644 +index 30a46a50fb..dc49d9917e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData; @@ -69,17 +69,17 @@ index 38d169cc14..d0516b0885 100644 import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -- if (IEntitySelector.e.test(entityhuman)) { -+ if (IEntitySelector.e.test(entityhuman) && entityhuman.affectsSpawning) { // Paper - Affects Spawning API +- if (IEntitySelector.f.test(entityhuman)) { ++ if (IEntitySelector.f.test(entityhuman) && entityhuman.affectsSpawning) { // Paper - Affects Spawning API double d4 = entityhuman.d(d0, d1, d2); if (d3 < 0.0D || d4 < d3 * d3) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 563e90d4dc..cfea81bf78 100644 +index b8bdcb6b74..91e585048a 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/Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch index 1db98718b7..fb04706697 100644 --- a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index bd25a00d82..55c45973e1 100644 +index fcb5f07d78..0551ae2290 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 { @@ -19,7 +19,7 @@ index bd25a00d82..55c45973e1 100644 private final ItemCooldown ce; @Nullable diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index f02b28059c..bb33cf3029 100644 +index ab85fd9a6e..5778a5201d 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -48,7 +48,7 @@ index f02b28059c..bb33cf3029 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 c7adfaad91..349afa3f33 100644 +index c2016ba003..41bd979797 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/PlayerAdvancementCriterionGrantEvent.patch b/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch index de8f6f34e7..6c212891c0 100644 --- a/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch +++ b/Spigot-Server-Patches/PlayerAdvancementCriterionGrantEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent diff --git a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java -index d0eb65aaf0..5fe0e947c3 100644 +index eff9589320..26eaa9be90 100644 --- a/src/main/java/net/minecraft/server/AdvancementDataPlayer.java +++ b/src/main/java/net/minecraft/server/AdvancementDataPlayer.java @@ -0,0 +0,0 @@ public class AdvancementDataPlayer { diff --git a/Spigot-Server-Patches/PlayerAttemptPickupItemEvent.patch b/Spigot-Server-Patches/PlayerAttemptPickupItemEvent.patch index 03d0facb77..2902be395e 100644 --- a/Spigot-Server-Patches/PlayerAttemptPickupItemEvent.patch +++ b/Spigot-Server-Patches/PlayerAttemptPickupItemEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 62d1c3d119..d232bab745 100644 +index d9d52a63d8..946e59753e 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; diff --git a/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch b/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch index 905f36a6b9..7d42083273 100644 --- a/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch +++ b/Spigot-Server-Patches/PlayerLaunchProjectileEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerLaunchProjectileEvent diff --git a/src/main/java/net/minecraft/server/ItemEgg.java b/src/main/java/net/minecraft/server/ItemEgg.java -index 771e809fb..ab4fdb7f0 100644 +index 9ae1f5b318..0a9680bf5d 100644 --- a/src/main/java/net/minecraft/server/ItemEgg.java +++ b/src/main/java/net/minecraft/server/ItemEgg.java @@ -0,0 +0,0 @@ public class ItemEgg extends Item { @@ -16,13 +16,13 @@ index 771e809fb..ab4fdb7f0 100644 - itemstack.subtract(1); - } - -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.i.nextFloat() * 0.4F + 0.8F)); + // Paper start - moved down + //if (!entityhuman.abilities.canInstantlyBuild) { + // itemstack.subtract(1); + //} + // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.k.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { EntityEgg entityegg = new EntityEgg(world, entityhuman); @@ -38,7 +38,7 @@ index 771e809fb..ab4fdb7f0 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemEgg.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EGG_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -50,7 +50,7 @@ index 771e809fb..ab4fdb7f0 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); diff --git a/src/main/java/net/minecraft/server/ItemEnderPearl.java b/src/main/java/net/minecraft/server/ItemEnderPearl.java -index 5559a5abe..cf1ba7ec9 100644 +index 876384f37b..8b8bc8ec1c 100644 --- a/src/main/java/net/minecraft/server/ItemEnderPearl.java +++ b/src/main/java/net/minecraft/server/ItemEnderPearl.java @@ -0,0 +0,0 @@ public class ItemEnderPearl extends Item { @@ -67,7 +67,7 @@ index 5559a5abe..cf1ba7ec9 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + entityhuman.getCooldownTracker().a(this, 20); + } else { + // Paper end @@ -82,7 +82,7 @@ index 5559a5abe..cf1ba7ec9 100644 - itemstack.subtract(1); - } - -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F)); - entityhuman.getCooldownTracker().a(this, 20); - // CraftBukkit end + // Paper start - moved up @@ -90,7 +90,7 @@ index 5559a5abe..cf1ba7ec9 100644 + // itemstack.subtract(1); + //} + // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.k.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_ENDER_PEARL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemEnderPearl.i.nextFloat() * 0.4F + 0.8F)); + //entityhuman.getCooldownTracker().a(this, 20); + // // CraftBukkit end + // Paper end @@ -98,7 +98,7 @@ index 5559a5abe..cf1ba7ec9 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); return new InteractionResultWrapper(EnumInteractionResult.SUCCESS, itemstack); diff --git a/src/main/java/net/minecraft/server/ItemExpBottle.java b/src/main/java/net/minecraft/server/ItemExpBottle.java -index c16456c4d..49c58fee7 100644 +index 5312c473ea..7b5eca925f 100644 --- a/src/main/java/net/minecraft/server/ItemExpBottle.java +++ b/src/main/java/net/minecraft/server/ItemExpBottle.java @@ -0,0 +0,0 @@ public class ItemExpBottle extends Item { @@ -109,13 +109,13 @@ index c16456c4d..49c58fee7 100644 - itemstack.subtract(1); - } - -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.i.nextFloat() * 0.4F + 0.8F)); + // Paper start - moved down + //if (!entityhuman.abilities.canInstantlyBuild) { + // itemstack.subtract(1); + //} + // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.k.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { EntityThrownExpBottle entitythrownexpbottle = new EntityThrownExpBottle(world, entityhuman); @@ -131,7 +131,7 @@ index c16456c4d..49c58fee7 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemExpBottle.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_EXPERIENCE_BOTTLE_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -143,7 +143,7 @@ index c16456c4d..49c58fee7 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); diff --git a/src/main/java/net/minecraft/server/ItemLingeringPotion.java b/src/main/java/net/minecraft/server/ItemLingeringPotion.java -index 8d3969b5f..44af46cbf 100644 +index e1c6ad80f0..7acdb63f7b 100644 --- a/src/main/java/net/minecraft/server/ItemLingeringPotion.java +++ b/src/main/java/net/minecraft/server/ItemLingeringPotion.java @@ -0,0 +0,0 @@ public class ItemLingeringPotion extends ItemPotion { @@ -151,12 +151,11 @@ index 8d3969b5f..44af46cbf 100644 public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); - ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -- -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); + // Paper start - moved down + //ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -+ // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); + +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.i.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { + // Paper start - ensure stack count matches vanilla behavior without modifying original stack yet @@ -178,7 +177,7 @@ index 8d3969b5f..44af46cbf 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_LINGERING_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -190,7 +189,7 @@ index 8d3969b5f..44af46cbf 100644 entityhuman.b(StatisticList.ITEM_USED.b(this)); diff --git a/src/main/java/net/minecraft/server/ItemSnowball.java b/src/main/java/net/minecraft/server/ItemSnowball.java -index 597413f25..9d316bde3 100644 +index 332145c32b..5c23c9ae0c 100644 --- a/src/main/java/net/minecraft/server/ItemSnowball.java +++ b/src/main/java/net/minecraft/server/ItemSnowball.java @@ -0,0 +0,0 @@ public class ItemSnowball extends Item { @@ -208,9 +207,10 @@ index 597413f25..9d316bde3 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); } - world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.k.nextFloat() * 0.4F + 0.8F)); +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemSnowball.i.nextFloat() * 0.4F + 0.8F)); - } else if (entityhuman instanceof EntityPlayer) { - ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); @@ -222,7 +222,7 @@ index 597413f25..9d316bde3 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ItemSplashPotion.java b/src/main/java/net/minecraft/server/ItemSplashPotion.java -index 7427f97d5..bc90d8936 100644 +index 593009579b..d935ae834f 100644 --- a/src/main/java/net/minecraft/server/ItemSplashPotion.java +++ b/src/main/java/net/minecraft/server/ItemSplashPotion.java @@ -0,0 +0,0 @@ public class ItemSplashPotion extends ItemPotion { @@ -230,12 +230,11 @@ index 7427f97d5..bc90d8936 100644 public InteractionResultWrapper a(World world, EntityHuman entityhuman, EnumHand enumhand) { ItemStack itemstack = entityhuman.b(enumhand); - ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -- -- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.k.nextFloat() * 0.4F + 0.8F)); -+ // Paper start - moved down ++ // Paper start - moved sound down, clone handled diff + //ItemStack itemstack1 = entityhuman.abilities.canInstantlyBuild ? itemstack.cloneItemStack() : itemstack.cloneAndSubtract(1); -+ // -+ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.k.nextFloat() * 0.4F + 0.8F)); + +- world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.i.nextFloat() * 0.4F + 0.8F)); ++ //world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (ItemSplashPotion.i.nextFloat() * 0.4F + 0.8F)); + // Paper end if (!world.isClientSide) { + // Paper start - ensure stack count matches vanilla behavior without modifying original stack yet @@ -257,7 +256,7 @@ index 7427f97d5..bc90d8936 100644 + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); + } + -+ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (ItemLingeringPotion.k.nextFloat() * 0.4F + 0.8F)); ++ world.a((EntityHuman) null, entityhuman.locX, entityhuman.locY, entityhuman.locZ, SoundEffects.ENTITY_SPLASH_POTION_THROW, SoundCategory.PLAYERS, 0.5F, 0.4F / (Entity.SHARED_RANDOM.nextFloat() * 0.4F + 0.8F)); + } else { + if (entityhuman instanceof EntityPlayer) { + ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); diff --git a/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch index f99e4b4f4d..7a9d44eccc 100644 --- a/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-Server-Patches/PlayerNaturallySpawnCreaturesEvent.patch @@ -9,7 +9,7 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 973c3d1e9e..f525fd1b42 100644 +index 4a2153b68f..32808558bb 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { diff --git a/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch index 3e773ff4f9..d3c6115357 100644 --- a/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch +++ b/Spigot-Server-Patches/PlayerPickupExperienceEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerPickupExperienceEvent Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 79d80596df..a87ef5fb8c 100644 +index 31c8d4bc86..dcef63bb1f 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -0,0 +0,0 @@ public class EntityExperienceOrb extends Entity { diff --git a/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch index cef658d7ed..7fd11a1d5e 100644 --- a/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-Server-Patches/PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index f2a4476c5c..62d1c3d119 100644 +index 3e70a06397..d9d52a63d8 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -0,0 +0,0 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/PlayerReadyArrowEvent.patch b/Spigot-Server-Patches/PlayerReadyArrowEvent.patch index 91458d966e..430e77121e 100644 --- a/Spigot-Server-Patches/PlayerReadyArrowEvent.patch +++ b/Spigot-Server-Patches/PlayerReadyArrowEvent.patch @@ -7,7 +7,7 @@ Called when a player is firing a bow and the server is choosing an arrow to use. Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index 379a7f84a5..c0caeda362 100644 +index 152b179ce1..797e9ecf11 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch index e012e4a85f..afd23c21a8 100644 --- a/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/PlayerTeleportEndGatewayEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 9fd4ab6a7f..888bbd7a45 100644 +index 2a17115ac6..b36dcb4d7d 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java @@ -0,0 +0,0 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick diff --git a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch index 66579184d2..7bdf8b2e4a 100644 --- a/Spigot-Server-Patches/PreCreatureSpawnEvent.patch +++ b/Spigot-Server-Patches/PreCreatureSpawnEvent.patch @@ -15,7 +15,7 @@ instead and save a lot of server resources. See: https://github.com/PaperMC/Paper/issues/917 diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index c76dbe74ac..d10196fcbd 100644 +index e4598d8314..6ee069cd12 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -0,0 +0,0 @@ @@ -56,7 +56,7 @@ index c76dbe74ac..d10196fcbd 100644 if (entity == null) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 342a15db5e..973c3d1e9e 100644 +index f32191c5a2..4a2153b68f 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -0,0 +0,0 @@ public final class SpawnerCreature { 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 75034ad565..0a9cafc547 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 @@ -7,7 +7,7 @@ If the save queue already has 50 (configurable) of chunks pending, then avoid processing auto save (which would add more) diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 189ec79f05..4d0f2051aa 100644 +index 79260172d9..381edf3e7d 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 { @@ -23,44 +23,34 @@ index 189ec79f05..4d0f2051aa 100644 private void removeCorruptTEs() { removeCorruptTEs = getBoolean("remove-corrupt-tile-entities", false); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index aa8d25e765..c1a42e61e7 100644 +index 90840e4709..87960344f1 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - ArrayList arraylist = Lists.newArrayList(this.chunks.values()); - Iterator iterator = arraylist.iterator(); + synchronized (this.chunkLoader) { + ObjectIterator objectiterator = this.chunks.values().iterator(); -+ // Paper start -+ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; -+ final int queueSize = chunkLoader.getQueueSize(); -+ if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ -+ return false; -+ } -+ final int autoSaveLimit = world.paperConfig.maxAutoSaveChunksPerTick; -+ // Paper end - while (iterator.hasNext()) { - Chunk chunk = (Chunk) iterator.next(); ++ // Paper start ++ final ChunkRegionLoader chunkLoader = (ChunkRegionLoader) world.getChunkProviderServer().chunkLoader; ++ final int queueSize = chunkLoader.getQueueSize(); ++ if (queueSize > world.paperConfig.queueSizeAutoSaveThreshold){ ++ return false; ++ } ++ // Paper end + while (objectiterator.hasNext()) { + Chunk chunk = (Chunk) objectiterator.next(); -@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - this.saveChunk(chunk, false); // Spigot - chunk.a(false); - ++i; -- if (!flag && i >= world.paperConfig.maxAutoSaveChunksPerTick) { // Spigot - // Paper - Incremental Auto Save - cap max per tick -+ if (!flag && i >= autoSaveLimit) { // Spigot - // Paper - Incremental Auto Save - cap max per tick - return false; - } - } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 2f1488ee53..859148cb86 100644 +index c85a8dac3e..0fc50ce60c 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 { - } + } + public int getQueueSize() { return queue.size(); } // Paper + // CraftBukkit start - Add async variant, provide compatibility @Nullable - public synchronized Chunk a(GeneratorAccess generatoraccess, int i, int j, Consumer consumer) throws IOException { + public Chunk a(GeneratorAccess generatoraccess, int i, int j, Consumer consumer) throws IOException { -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch b/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch index 141f89ab65..c575ac7857 100644 --- a/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch +++ b/Spigot-Server-Patches/Prevent-Frosted-Ice-from-loading-holding-chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Frosted Ice from loading/holding chunks diff --git a/src/main/java/net/minecraft/server/BlockIceFrost.java b/src/main/java/net/minecraft/server/BlockIceFrost.java -index 77cf6b8e9b..9d9671eaec 100644 +index 302d420512..c97937e810 100644 --- a/src/main/java/net/minecraft/server/BlockIceFrost.java +++ b/src/main/java/net/minecraft/server/BlockIceFrost.java @@ -0,0 +0,0 @@ public class BlockIceFrost extends BlockIce { diff --git a/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch index dc7525434d..5505429cc9 100644 --- a/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/Prevent-Pathfinding-out-of-World-Border.patch @@ -26,12 +26,12 @@ index 76d1f4bd21..76b2787bae 100644 if (this.c != null && !this.c.b() && blockposition.equals(this.q)) { return this.c; diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 4763c30a81..ec5386fd50 100644 +index acd76e13bb..1a87480f09 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -0,0 +0,0 @@ public class WorldBorder { - this.l = 5; - } + + public WorldBorder() {} - public boolean a(BlockPosition blockposition) { + public boolean isInBounds(BlockPosition blockposition) { return a(blockposition); }public boolean a(BlockPosition blockposition) { // Paper - OBFHELPER diff --git a/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch index 1c03894467..6e14884f67 100644 --- a/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch +++ b/Spigot-Server-Patches/Prevent-Saving-Bad-entities-to-chunks.patch @@ -18,7 +18,7 @@ an invalid entity. This should reduce log occurrences of dupe uuid messages. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index a97e024ec..bd52bf656 100644 +index a3b7d359dc..ffa94ea674 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-logins-from-being-processed-when-the-player-.patch b/Spigot-Server-Patches/Prevent-logins-from-being-processed-when-the-player-.patch index 4d2e6084a3..7ffadc8730 100644 --- a/Spigot-Server-Patches/Prevent-logins-from-being-processed-when-the-player-.patch +++ b/Spigot-Server-Patches/Prevent-logins-from-being-processed-when-the-player-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent logins from being processed when the player has diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 6249b0e686..91cd6e0f61 100644 +index 10c82107d4..1380a14274 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -0,0 +0,0 @@ public class LoginListener implements PacketLoginInListener, ITickable { diff --git a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch index 7beb9cc361..a4f41f17a3 100644 --- a/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/Prevent-tile-entity-and-entity-crashes.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Prevent tile entity and entity crashes diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 0d54513a4..d8d519143 100644 +index 68ac014aab..c5212417c6 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper - return TileEntityTypes.a.b(this.C()) + " // " + this.getClass().getCanonicalName(); + return IRegistry.BLOCK_ENTITY_TYPE.getKey(this.C()) + " // " + this.getClass().getCanonicalName(); }); if (this.world != null) { - CrashReportSystemDetails.a(crashreportsystemdetails, this.position, this.getBlock()); @@ -23,10 +23,10 @@ index 0d54513a4..d8d519143 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6bb52c7d4..ada8376e8 100644 +index be2feb441d..0b38093f91 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.tickTimer.stopTiming(); // Paper } catch (Throwable throwable1) { entity.tickTimer.stopTiming(); @@ -43,7 +43,7 @@ index 6bb52c7d4..ada8376e8 100644 } } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc ((ITickable) tileentity).Y_(); this.methodProfiler.e(); } catch (Throwable throwable2) { diff --git a/Spigot-Server-Patches/Print-Error-details-when-failing-to-save-player-data.patch b/Spigot-Server-Patches/Print-Error-details-when-failing-to-save-player-data.patch index b7cb64909d..36e383d382 100644 --- a/Spigot-Server-Patches/Print-Error-details-when-failing-to-save-player-data.patch +++ b/Spigot-Server-Patches/Print-Error-details-when-failing-to-save-player-data.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Print Error details when failing to save player data diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index cbfdb3cf79..9a243010d0 100644 +index 7553280d21..ab085788ab 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { diff --git a/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch b/Spigot-Server-Patches/ProfileWhitelistVerifyEvent.patch index 619fd970ac..0f3c1e2b34 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 4cbe148010..45e42e9989 100644 +index 2f2f301383..304cae655d 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 { @@ -46,5 +46,5 @@ index 4cbe148010..45e42e9989 100644 + // Paper end public boolean isOp(GameProfile gameprofile) { - return this.operators.d(gameprofile) || this.server.J() && this.server.worlds.get(0).getWorldData().u() && this.server.I().equalsIgnoreCase(gameprofile.getName()) || this.u; // CraftBukkit + return this.operators.d(gameprofile) || this.server.H() && this.server.getWorldServer(DimensionManager.OVERWORLD).getWorldData().u() && this.server.G().equalsIgnoreCase(gameprofile.getName()) || this.u; -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch index 705764c814..4a94e9d57d 100644 --- a/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/Properly-fix-item-duplication-bug.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 9505511b14..9b1edab77d 100644 +index d8299a5759..49470bf5f0 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 { @@ -19,7 +19,7 @@ index 9505511b14..9b1edab77d 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 969e28c3b2..3885c8628c 100644 +index 77f12b4d1d..9de392315e 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 bddae0c816..7a2d71590c 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 @@ -30,23 +30,23 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0560882314..7a7893c4df 100644 +index ee13260af7..5d8dbdf8a3 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 - public WorldServer[] worldServer; + public final Map worldServer = Maps.newIdentityHashMap(); private PlayerList s; private boolean isRunning = true; + private boolean isRestarting = false; // Paper - flag to signify we're attempting to restart private boolean isStopped; private int ticks; - protected final Proxy d; + protected final Proxy c; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati if (this.s != null) { MinecraftServer.LOGGER.info("Saving players"); this.s.savePlayers(); - this.s.u(); -+ this.s.u(isRestarting);; ++ this.s.u(isRestarting); // Paper try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets } @@ -63,22 +63,12 @@ index 0560882314..7a7893c4df 100644 this.isRunning = false; + this.isRestarting = isRestarting; } - + // Paper end -+ - // Paper start - Further improve server tick loop - private static final int TPS = 20; - private static final long SEC_IN_NANO = 1000000000; -@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - return this.aa; - } -+ public final Thread getServerThread() { return this.aA(); } // Paper - OBFHELPER - public Thread aA() { - return this.serverThread; - } + private boolean aT() { + return System.nanoTime() - lastTick + catchupTime < TICK_TIME; // Paper - improved "are we lagging" check to match our own diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index c8b5a610aa..0b0d996523 100644 +index cc0ed8546f..a9906f03c9 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-remove-entities-on-dimension-teleport.patch b/Spigot-Server-Patches/Properly-remove-entities-on-dimension-teleport.patch index d729803e4f..b4e82ee890 100644 --- a/Spigot-Server-Patches/Properly-remove-entities-on-dimension-teleport.patch +++ b/Spigot-Server-Patches/Properly-remove-entities-on-dimension-teleport.patch @@ -22,7 +22,7 @@ requirement, but plugins (such as my own) use this method to trigger a "reload" of the entity on the client. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index aba517a710..20c2bf16be 100644 +index 0e8c95d96b..111c2c3df6 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 @@ -35,7 +35,7 @@ index aba517a710..20c2bf16be 100644 this.world.methodProfiler.a("reposition"); /* CraftBukkit start - Handled in calculateTarget diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d506503e93..697296acd0 100644 +index d6e330d345..3b3ace52b0 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/Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/Provide-E-TE-Chunk-count-stat-methods.patch index 30fa752616..3e8aad6f18 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 d4851dd2a6..84fcebd710 100644 +index 6b3b45f94a..f75a2e6be7 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/Provide-option-to-use-a-versioned-world-folder-for-t.patch b/Spigot-Server-Patches/Provide-option-to-use-a-versioned-world-folder-for-t.patch index 7bf87be2ed..35bdd5930e 100644 --- a/Spigot-Server-Patches/Provide-option-to-use-a-versioned-world-folder-for-t.patch +++ b/Spigot-Server-Patches/Provide-option-to-use-a-versioned-world-folder-for-t.patch @@ -19,7 +19,7 @@ may be some delay there, but region files are only copied on demand. This is highly experiemental so backup your world before relying on this to not modify it diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index bcdf4f91d..c457d0711 100644 +index bcdf4f91d8..c457d07110 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ import java.util.List; @@ -59,7 +59,7 @@ index bcdf4f91d..c457d0711 100644 + } } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index bd52bf656..54840851b 100644 +index ffa94ea674..68a3169c31 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 { @@ -71,10 +71,6 @@ index bd52bf656..54840851b 100644 + private final File actualWorld; + private final boolean useAltWorld; + -+ private boolean chunkExists0(int x, int z) { -+ copyIfNeeded(x, z); -+ return RegionFileCache.chunkExists(this.actualWorld, x, z); -+ } + private synchronized void copyIfNeeded(int x, int z) { + if (!useAltWorld) { + return; @@ -124,7 +120,7 @@ index bd52bf656..54840851b 100644 } - if (RegionFileCache.chunkExists(this.c, x, z)) { -+ if (chunkExists0(x, z)) { // Paper ++ if (chunkExists(x, z)) { // Paper NBTTagCompound nbt = RegionFileCache.read(this.c, x, z); if (nbt != null) { NBTTagCompound level = nbt.getCompound("Level"); @@ -133,20 +129,27 @@ index bd52bf656..54840851b 100644 @Nullable private NBTTagCompound a(DimensionManager dimensionmanager, @Nullable PersistentCollection persistentcollection, int i, int j, @Nullable GeneratorAccess generatoraccess) throws IOException { + copyIfNeeded(i, j); // Paper - NBTTagCompound nbttagcompound = RegionFileCache.read(this.c, i, j); + NBTTagCompound nbttagcompound = SupplierUtils.getIfExists(this.b.get(new ChunkCoordIntPair(i, j))); // Spigot - if (nbttagcompound == null) { + if (nbttagcompound != null) { @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); - Supplier nbttagcompound = this.b.get(chunkcoordintpair); // Spigot - -- return nbttagcompound != null ? true : RegionFileCache.chunkExists(this.c, i, j); -+ return nbttagcompound != null ? true : chunkExists0(i, j); // Paper + } } ++ public boolean chunkExists(int x, int z) { ++ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z); ++ if (this.b.containsKey(chunkcoordintpair)) { ++ return true; ++ } ++ copyIfNeeded(x, z); ++ return RegionFileCache.chunkExists(this.actualWorld, x, z); ++ } ++ @Nullable + protected Object[] a(GeneratorAccess generatoraccess, int i, int j, NBTTagCompound nbttagcompound) { // CraftBukkit - return Chunk -> Object[] + if (nbttagcompound.hasKeyOfType("Level", 10) && nbttagcompound.getCompound("Level").hasKeyOfType("Status", 8)) { diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 609d6c355..f1fa7c717 100644 +index 15666325ea..3501b87f75 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -0,0 +0,0 @@ public class RegionFileCache { @@ -164,7 +167,7 @@ index 609d6c355..f1fa7c717 100644 public static synchronized void a() { diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index 9a243010d..3fabbe94f 100644 +index ab085788ab..c84e6acdbe 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -0,0 +0,0 @@ public class WorldNBTStorage implements IDataManager, IPlayerFileData { diff --git a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch index f41b29a0f2..d5d7677e2e 100644 --- a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -8,7 +8,7 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 697296acd0..b048343b7c 100644 +index 3b3ace52b0..6987d9423c 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/Re-track-players-that-dismount-from-other-players.patch b/Spigot-Server-Patches/Re-track-players-that-dismount-from-other-players.patch index be558275dc..57716701f2 100644 --- a/Spigot-Server-Patches/Re-track-players-that-dismount-from-other-players.patch +++ b/Spigot-Server-Patches/Re-track-players-that-dismount-from-other-players.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Re-track players that dismount from other players diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e036716970..bdd1fef710 100644 +index 68e71a2f9d..96d7be49d8 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/Refresh-player-inventory-when-cancelling-PlayerInter.patch b/Spigot-Server-Patches/Refresh-player-inventory-when-cancelling-PlayerInter.patch index 754bfbeb53..4eda9cff41 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 da501a1c5f..f7401f5c98 100644 +index 4fc5e4b7b3..66e01b8131 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-Metadata-on-reload.patch b/Spigot-Server-Patches/Remove-Metadata-on-reload.patch index bff64d9b5e..d28c4490f3 100644 --- a/Spigot-Server-Patches/Remove-Metadata-on-reload.patch +++ b/Spigot-Server-Patches/Remove-Metadata-on-reload.patch @@ -7,7 +7,7 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f70629a868..7ad009c073 100644 +index eacee4036e..272e127735 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/Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch index da1236f475..008076a927 100644 --- a/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch +++ b/Spigot-Server-Patches/Remove-invalid-mob-spawner-tile-entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove invalid mob spawner tile entities diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 0a0d04cf6..adf3dee2e 100644 +index bcafd86fb8..8507392628 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/Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch index 4ef16f9252..4cf4f855f4 100644 --- a/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/Remove-unused-World-Tile-Entity-List.patch @@ -6,19 +6,19 @@ 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 e75ce9b4f5..f314925b6b 100644 +index 8abe3cdd92..3ce6058d4c 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc }; // Spigot end - protected final Set g = Sets.newHashSet(); // Paper + protected final Set g = com.google.common.collect.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 + private final Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { this.tileEntityListTick.removeAll(this.tileEntityListUnload); @@ -27,7 +27,7 @@ index e75ce9b4f5..f314925b6b 100644 this.tileEntityListUnload.clear(); } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc if (tileentity.x()) { tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); @@ -36,7 +36,7 @@ index e75ce9b4f5..f314925b6b 100644 if (this.isLoaded(tileentity.getPosition())) { this.getChunkAtWorldCoords(tileentity.getPosition()).d(tileentity.getPosition()); } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); // CraftBukkit start // From above, don't screw this up - SPIGOT-1746 @@ -45,7 +45,7 @@ index e75ce9b4f5..f314925b6b 100644 this.a(tileentity1); } // CraftBukkit end -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc protected void p_() {} public boolean a(TileEntity tileentity) { @@ -57,7 +57,7 @@ index e75ce9b4f5..f314925b6b 100644 this.tileEntityListTick.add(tileentity); } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } else { if (tileentity != null) { this.c.remove(tileentity); diff --git a/Spigot-Server-Patches/Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/Spigot-Server-Patches/Reset-spawner-timer-when-spawner-event-is-cancelled.patch index 6ac89f6cb5..6a54f68646 100644 --- a/Spigot-Server-Patches/Reset-spawner-timer-when-spawner-event-is-cancelled.patch +++ b/Spigot-Server-Patches/Reset-spawner-timer-when-spawner-event-is-cancelled.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reset spawner timer when spawner event is cancelled diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 2b6b062c61..c76dbe74ac 100644 +index ef93f433d6..e4598d8314 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -0,0 +0,0 @@ public abstract class MobSpawnerAbstract { diff --git a/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch index e8716305cc..5a5ed1f7d4 100644 --- a/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch +++ b/Spigot-Server-Patches/Sanitise-RegionFileCache-and-make-configurable.patch @@ -25,7 +25,7 @@ index 620f23f4f0..a6042ca607 100644 + } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index ff473a263f..3b8d01ea1a 100644 +index 2217adf99c..c0ab543b91 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; @@ -54,8 +54,8 @@ index ff473a263f..3b8d01ea1a 100644 RegionFile regionfile1 = new RegionFile(file2); @@ -0,0 +0,0 @@ public class RegionFileCache { - } } + // CraftBukkit end + // Paper Start + private static synchronized void trimCache() { 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 c6fca2bb07..f7f078949c 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 8aad37b9be..686c61133d 100644 +index 9a71fa1e94..380192501e 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,10 +72,10 @@ index 8aad37b9be..686c61133d 100644 entity.extinguish(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 6d314a7124..412300fbb5 100644 +index 109e718118..9f6027d5e4 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.a(entityhuman, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, soundeffect, soundcategory, f, f1); } diff --git a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch index 0d182152c6..184b6e8cca 100644 --- a/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch +++ b/Spigot-Server-Patches/Send-nearby-packets-from-world-player-list-not-serve.patch @@ -5,24 +5,24 @@ Subject: [PATCH] Send nearby packets from world player list not server list diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 7a2b219c6..41c187084 100644 +index 6d511b6230..d8eb2e9864 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 { } - public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, Packet packet) { -- for (int j = 0; j < this.players.size(); ++j) { -- EntityPlayer entityplayer = (EntityPlayer) this.players.get(j); + public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, DimensionManager dimensionmanager, Packet packet) { +- for (int i = 0; i < this.players.size(); ++i) { +- EntityPlayer entityplayer = (EntityPlayer) this.players.get(i); + // Paper start - Use world list instead of server list where preferable -+ sendPacketNearby(entityhuman, d0, d1, d2, d3, i, null, packet); // Retained for compatibility ++ sendPacketNearby(entityhuman, d0, d1, d2, d3, dimensionmanager, null, packet); // Retained for compatibility + } + + public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, WorldServer world, Packet packet) { + sendPacketNearby(entityhuman, d0, d1, d2, d3, world.dimension, world, packet); + } + -+ public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, int i, @Nullable WorldServer world, Packet packet) { ++ public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, DimensionManager dimensionmanager, @Nullable WorldServer world, Packet packet) { + if (world == null && entityhuman != null && entityhuman.world instanceof WorldServer) { + world = (WorldServer) entityhuman.world; + } @@ -31,7 +31,7 @@ index 7a2b219c6..41c187084 100644 + for (int j = 0; j < players1.size(); ++j) { + EntityHuman entity = players1.get(j); + if (!(entity instanceof EntityPlayer)) continue; -+ EntityPlayer entityplayer = (EntityPlayer) players1.get(j); ++ EntityPlayer entityplayer = (EntityPlayer) entity; + // Paper end // CraftBukkit start - Test if player receiving packet can see the source of the packet @@ -40,13 +40,13 @@ index 7a2b219c6..41c187084 100644 } // CraftBukkit end -- if (entityplayer != entityhuman && entityplayer.dimension == i) { -+ if (entityplayer != entityhuman && (world != null || entityplayer.dimension == i)) { // Paper +- if (entityplayer != entityhuman && entityplayer.dimension == dimensionmanager) { ++ if (entityplayer != entityhuman && (world != null || entityplayer.dimension == dimensionmanager)) { // Paper double d4 = d0 - entityplayer.locX; double d5 = d1 - entityplayer.locY; double d6 = d2 - entityplayer.locZ; diff --git a/src/main/java/net/minecraft/server/WorldManager.java b/src/main/java/net/minecraft/server/WorldManager.java -index e26405d34..23f390c22 100644 +index e26405d341..23f390c221 100644 --- a/src/main/java/net/minecraft/server/WorldManager.java +++ b/src/main/java/net/minecraft/server/WorldManager.java @@ -0,0 +0,0 @@ public class WorldManager implements IWorldAccess { @@ -95,7 +95,7 @@ index e26405d34..23f390c22 100644 if (entityplayer != null && entityplayer.world == this.world && entityplayer.getId() != i) { double d0 = (double) blockposition.getX() - entityplayer.locX; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f5911fbf0..377831cdf 100644 +index 788ab40d0e..1e30ba0548 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 { @@ -119,7 +119,7 @@ index f5911fbf0..377831cdf 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b09f0353a..aa0b1f5fa 100644 +index 80fd49b6e1..ba2e768594 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/Shoulder-Entities-Release-API.patch b/Spigot-Server-Patches/Shoulder-Entities-Release-API.patch index d41abcb2c1..002d724b4e 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 814202286c..d9f81e6348 100644 +index f6600ce515..d11edae03c 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 { @@ -62,7 +62,7 @@ index 814202286c..d9f81e6348 100644 public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index cce9366f4d..4afff2f262 100644 +index 289e267bdd..38a886fbd5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index d8ea5e4934..889ff95897 100644 --- a/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/Spigot-Server-Patches/Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -25,7 +25,7 @@ index 220ca7bca0..eb4b08be46 100644 } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ce4bf0a68f..c72bdd29d1 100644 +index 0ebe754619..8dc922ccd0 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 @@ -38,7 +38,7 @@ index ce4bf0a68f..c72bdd29d1 100644 public CrashReport b(CrashReport crashreport) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a4112c54ea..567af5b9fa 100644 +index 9ba50a2daa..6414f3d6b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import org.bukkit.event.server.TabCompleteEvent; diff --git a/Spigot-Server-Patches/SkeletonHorse-Additions.patch b/Spigot-Server-Patches/SkeletonHorse-Additions.patch index 794ff5efb1..a132f190f2 100644 --- a/Spigot-Server-Patches/SkeletonHorse-Additions.patch +++ b/Spigot-Server-Patches/SkeletonHorse-Additions.patch @@ -5,7 +5,7 @@ Subject: [PATCH] SkeletonHorse Additions diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index 70985bf52..9fb86eefd 100644 +index e643201ebf..edd272eabd 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -0,0 +0,0 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { @@ -21,8 +21,8 @@ index 70985bf52..9fb86eefd 100644 return 0.96F; } -+ public boolean isTrap() { return this.dz(); } // Paper - OBFHELPER - public boolean dz() { ++ public boolean isTrap() { return this.dy(); } // Paper - OBFHELPER + public boolean dy() { return this.bN; } @@ -31,7 +31,7 @@ index 70985bf52..9fb86eefd 100644 if (flag != this.bN) { this.bN = flag; diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java -index f69170559..cba8b91e5 100644 +index 82403c8165..2ee91bbb02 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java @@ -0,0 +0,0 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { @@ -43,7 +43,7 @@ index f69170559..cba8b91e5 100644 this.a.s(false); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java -index e822c2200..496d0c0ca 100644 +index e822c2200d..496d0c0cac 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java @@ -0,0 +0,0 @@ public class CraftSkeletonHorse extends CraftAbstractHorse implements SkeletonHo diff --git a/Spigot-Server-Patches/Slime-Pathfinder-Events.patch b/Spigot-Server-Patches/Slime-Pathfinder-Events.patch index d868c5bba6..23e4d5fddc 100644 --- a/Spigot-Server-Patches/Slime-Pathfinder-Events.patch +++ b/Spigot-Server-Patches/Slime-Pathfinder-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Slime Pathfinder Events diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index eeaf98e8..8752c62b 100644 +index 238f3c7926..cfa4710b78 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster { @@ -23,7 +23,7 @@ index eeaf98e8..8752c62b 100644 + this.canWander = nbttagcompound.getBoolean("Paper.canWander"); // Paper } - public boolean dz() { + public boolean dy() { @@ -0,0 +0,0 @@ public class EntitySlime extends EntityInsentient implements IMonster { } @@ -115,7 +115,7 @@ index eeaf98e8..8752c62b 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java -index 18e7ef80..8403c1e0 100644 +index 18e7ef80ac..8403c1e01c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSlime.java @@ -0,0 +0,0 @@ public class CraftSlime extends CraftMob implements Slime { diff --git a/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch b/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch index bf494c164f..43e73fc561 100644 --- a/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch +++ b/Spigot-Server-Patches/Speedup-BlockPos-by-fixing-inlining.patch @@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt They had 'callq' (invoke) instead of 'mov' (get from memory) instructions. diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 58f8b4b72..98992513d 100644 +index 58f8b4b720..98992513da 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -0,0 +0,0 @@ import javax.annotation.concurrent.Immutable; @@ -80,7 +80,7 @@ index 58f8b4b72..98992513d 100644 public BaseBlockPosition d(BaseBlockPosition baseblockposition) { return new BaseBlockPosition(this.getY() * baseblockposition.getZ() - this.getZ() * baseblockposition.getY(), this.getZ() * baseblockposition.getX() - this.getX() * baseblockposition.getZ(), this.getX() * baseblockposition.getY() - this.getY() * baseblockposition.getX()); diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 252e00e16..f769b178c 100644 +index 42e5e9ad8f..936a49a3e8 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 { diff --git a/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch b/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch index 95e1c44303..e51bdafcc1 100644 --- a/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch +++ b/Spigot-Server-Patches/Store-counts-for-each-Entity-Block-Entity-Type.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type Opens door for future patches to optimize performance diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7837f1024c..24a2ec4b4a 100644 +index 85f33c140e..bcafd86fb8 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/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index 9fbdef2164..41fb5f1a03 100644 --- a/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -8,15 +8,15 @@ This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 2d06202da..8d9aa271a 100644 +index 35cb5ca575..85f33c140e 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 { - private final BiomeBase[] g; - private final boolean[] h; - private final Map i; -- private boolean j; -+ private boolean j; public boolean isLoaded() { return j; } // Paper - OBFHELPER + private final BiomeBase[] f; + private final boolean[] g; + private final Map h; +- private boolean i; ++ private boolean i;public boolean isLoaded() { return i; } // Paper - OBFHELPER public final World world; public final Map heightMap; public final int locX; @@ -52,14 +52,14 @@ index 2d06202da..8d9aa271a 100644 switch (radius) { case 2: @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { - this.h = new boolean[256]; - this.i = Maps.newHashMap(); + this.g = new boolean[256]; + this.h = Maps.newHashMap(); this.heightMap = Maps.newHashMap(); - this.tileEntities = Maps.newHashMap(); + this.tileEntities = new TileEntityHashMap(); // Paper + this.p = Maps.newHashMap(); this.q = Maps.newHashMap(); - this.r = Maps.newHashMap(); - this.s = new ShortList[16]; + this.r = new ShortList[16]; @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { entity.af = k; entity.ag = this.locZ; @@ -94,7 +94,7 @@ index 2d06202da..8d9aa271a 100644 // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 7e691baf9..19109ee1d 100644 +index 044f7b5aa0..591ae114cf 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 @@ -147,7 +147,7 @@ index 7e691baf9..19109ee1d 100644 private String entityKeyString; diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 5ca7fef51..9361667c3 100644 +index 7390061bf0..c69209497b 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -167,7 +167,7 @@ index 5ca7fef51..9361667c3 100644 @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index b542b17fd..9fc7ac8c0 100644 +index b542b17fd0..9fc7ac8c02 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 @@ import java.util.UUID; diff --git a/Spigot-Server-Patches/String-based-Action-Bar-API.patch b/Spigot-Server-Patches/String-based-Action-Bar-API.patch index de78909aa6..b0c530ab6f 100644 --- a/Spigot-Server-Patches/String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/String-based-Action-Bar-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] String based Action Bar API diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 70cdc3f102..381542e0d2 100644 +index 9f9341c98f..966309a07d 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -0,0 +0,0 @@ @@ -62,7 +62,7 @@ index 70cdc3f102..381542e0d2 100644 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 6f23ef5b81..63341ec778 100644 +index 03c262935d..2837fb87e5 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 { @@ -83,5 +83,5 @@ index 6f23ef5b81..63341ec778 100644 + @Override public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) { - PacketPlayOutPlayerListHeaderFooter packet = new PacketPlayOutPlayerListHeaderFooter(); + setPlayerListHeader(header == null ? null : net.md_5.bungee.chat.ComponentSerializer.toString(header)); -- \ No newline at end of file diff --git a/Spigot-Server-Patches/Thread-Safe-Iteration-of-Chunk-Scheduler.patch b/Spigot-Server-Patches/Thread-Safe-Iteration-of-Chunk-Scheduler.patch deleted file mode 100644 index 19f5ecd23f..0000000000 --- a/Spigot-Server-Patches/Thread-Safe-Iteration-of-Chunk-Scheduler.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 23 Jul 2018 19:13:06 -0400 -Subject: [PATCH] Thread Safe Iteration of Chunk Scheduler - - -diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index 7629e0d05..5ee8bedf3 100644 ---- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -+++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -@@ -0,0 +0,0 @@ - package net.minecraft.server; - -+import com.google.common.collect.Lists; - import it.unimi.dsi.fastutil.longs.Long2ObjectMap; - import it.unimi.dsi.fastutil.longs.Long2ObjectMaps; - import java.io.IOException; -+import java.util.ArrayList; - import java.util.EnumMap; - import java.util.Map; - import java.util.function.Consumer; -@@ -0,0 +0,0 @@ public class ChunkTaskScheduler extends Scheduler { -+ // Paper start -+ ArrayList list; -+ synchronized (this.g) { -+ list = Lists.newArrayList(this.g.values()); -+ } -+ list.forEach((scheduler_a) -> { -+ // Paper end - ProtoChunk protochunk = (ProtoChunk) scheduler_a.a(); - - if (protochunk.h() && protochunk.i().d() == ChunkStatus.Type.PROTOCHUNK) { -@@ -0,0 +0,0 @@ public class ChunkTaskScheduler extends Scheduler -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a copy -+ * of this software and associated documentation files (the "Software"), to deal -+ * in the Software without restriction, including without limitation the rights -+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -+ * copies of the Software, and to permit persons to whom the Software is -+ * furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -+ * THE SOFTWARE. -+ */ -+ -+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; -+import org.bukkit.generator.BlockPopulator; -+ -+import javax.annotation.Nullable; -+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; -+ -+ public TimedChunkGenerator(WorldServer worldServer, InternalChunkGenerator gen) { -+ world = worldServer; -+ timedGenerator = gen; -+ } -+ -+ -+ @Override -+ public ChunkData generateChunkData(org.bukkit.World world, Random random, int x, int z, BiomeGrid biome) { -+ return timedGenerator.generateChunkData(world, random, x, z, biome); -+ } -+ -+ @Override -+ public boolean canSpawn(org.bukkit.World world, int x, int z) { -+ return timedGenerator.canSpawn(world, x, z); -+ } -+ -+ @Override -+ public List getDefaultPopulators(org.bukkit.World world) { -+ return timedGenerator.getDefaultPopulators(world); -+ } -+ -+ @Override -+ 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 createChunk(IChunkAccess ichunkaccess) { -+ try (Timing ignored = world.timings.chunkGeneration.startTiming()) { -+ timedGenerator.createChunk(ichunkaccess); -+ } -+ } -+ -+ @Override -+ public void addFeatures(RegionLimitedWorldAccess regionlimitedworldaccess, WorldGenStage.Features worldgenstage_features) { -+ timedGenerator.addFeatures(regionlimitedworldaccess, worldgenstage_features); -+ } -+ -+ @Override -+ 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); -+ } -+ -+ @Nullable -+ @Override -+ public BlockPosition findNearestMapFeature(World world, String s, BlockPosition blockposition, int i) { -+ return timedGenerator.findNearestMapFeature(world, s, blockposition, i); -+ } -+ -+ @Override -+ public GeneratorSettings getSettings() { -+ return timedGenerator.getSettings(); -+ } -+ -+ @Override -+ 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 new file mode 100644 index 0000000000..145cb274b0 @@ -476,17 +290,14 @@ index d2efcca80a..4812da0dac 100644 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 9e298f1216..a0c9fc617a 100644 +index 8811dbc9b3..7818a3b6a7 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -0,0 +0,0 @@ public class Block implements IMaterial { - private IBlockData blockData; - protected final boolean o; - private final boolean p; -- @Nullable -- private String name; -+ @Nullable // Paper start -+ public String name; + protected final boolean i; + protected final SoundEffectType stepSound; + protected final Material material; ++ // Paper start + public co.aikar.timings.Timing timing; + public co.aikar.timings.Timing getTiming() { + if (timing == null) { @@ -495,11 +306,11 @@ index 9e298f1216..a0c9fc617a 100644 + return timing; + } + // Paper end - private static final ThreadLocal> r = ThreadLocal.withInitial(() -> { - Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap = new Object2ByteLinkedOpenHashMap(200) { - protected void rehash(int i) {} + protected final MaterialMapColor l; + private final float frictionFactor; + protected final BlockStateList blockStateList; diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index 027b7cce98..4e51bd301a 100644 +index e3d1761b49..fbebd4591c 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -0,0 +0,0 @@ public class ChunkMap extends Long2ObjectOpenHashMap { @@ -530,26 +341,37 @@ index 027b7cce98..4e51bd301a 100644 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 00cd8d8cea..aabdc9e2f0 100644 +index 9e805c5d22..0034956af9 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - if (chunk != null) { + } + + if (flag) { +- try { ++ try (co.aikar.timings.Timing timing = world.timings.syncChunkLoadTimer.startTiming()) { // Paper + // CraftBukkit - decompile error + chunk = this.chunkLoader.a(this.world, i, j, (chunk1) -> { + chunk1.setLastSaved(this.world.getTime()); +@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { + this.asyncTaskHandler.postToMainThread(chunk::addEntities); return chunk; - } else { + } else if (flag1) { - try { - world.timings.syncChunkLoadTimer.startTiming(); // Spigot -+ try (co.aikar.timings.Timing timing = world.timings.chunkGeneration.startTiming()) { -+ ; // Spigot - chunk = (Chunk) this.generateChunk(i, j).get(); - return chunk; - } catch (ExecutionException | InterruptedException interruptedexception) { - throw this.a(i, j, (Throwable) interruptedexception); ++ try (co.aikar.timings.Timing timing = world.timings.chunkGeneration.startTiming()) { // Paper + this.batchScheduler.b(); + this.batchScheduler.a(new ChunkCoordIntPair(i, j)); + CompletableFuture completablefuture = this.batchScheduler.c(); // CraftBukkit - decompile error +@@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { + } catch (RuntimeException runtimeexception) { + throw this.a(i, j, (Throwable) runtimeexception); } - finally { world.timings.syncChunkLoadTimer.stopTiming(); } // Spigot ++ // finally { world.timings.syncChunkLoadTimer.stopTiming(); } // Spigot // Paper + } else { + return null; } - } - @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { } @@ -560,7 +382,7 @@ index 00cd8d8cea..aabdc9e2f0 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 88301ee61e..5001fd11dc 100644 +index df07b2b889..f969c036f3 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -0,0 +0,0 @@ @@ -595,11 +417,11 @@ index 88301ee61e..5001fd11dc 100644 - world.timings.syncChunkLoadTileEntitiesTimer.stopTiming(); // Spigot - world.timings.syncChunkLoadTileTicksTimer.startTiming(); // Spigot - if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.I() instanceof TickListServer) { - ((TickListServer) world.I()).a(nbttagcompound.getList("TileTicks", 10)); + if (nbttagcompound.hasKeyOfType("TileTicks", 9) && world.J() instanceof TickListServer) { + ((TickListServer) world.J()).a(nbttagcompound.getList("TileTicks", 10)); @@ -0,0 +0,0 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { - if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.H() instanceof TickListServer) { - ((TickListServer) world.H()).a(nbttagcompound.getList("LiquidTicks", 10)); + if (nbttagcompound.hasKeyOfType("LiquidTicks", 9) && world.I() instanceof TickListServer) { + ((TickListServer) world.I()).a(nbttagcompound.getList("LiquidTicks", 10)); } - world.timings.syncChunkLoadTileTicksTimer.stopTiming(); // Spigot + world.timings.chunkLoadLevelTimer.stopTiming(); // Spigot @@ -607,7 +429,7 @@ index 88301ee61e..5001fd11dc 100644 } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 3706e44a34..bf1fffcfee 100644 +index efa738d4ec..dabad6b055 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ import org.apache.logging.log4j.Level; @@ -622,7 +444,7 @@ index 3706e44a34..bf1fffcfee 100644 @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } - public void aW() { + public void aU() { - SpigotTimings.serverCommandTimer.startTiming(); // Spigot + MinecraftTimings.serverCommandTimer.startTiming(); // Spigot while (!this.serverCommandQueue.isEmpty()) { @@ -636,7 +458,7 @@ index 3706e44a34..bf1fffcfee 100644 + MinecraftTimings.serverCommandTimer.stopTiming(); // Spigot } - public boolean S() { + public boolean Q() { @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer return remoteControlCommandListener.getMessages(); } @@ -660,7 +482,7 @@ index 3706e44a34..bf1fffcfee 100644 return waitable.get(); } catch (java.util.concurrent.ExecutionException e) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 19109ee1dd..7c238d728b 100644 +index 591ae114cf..ec5c9fd735 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -0,0 +0,0 @@ import org.bukkit.command.CommandSender; @@ -699,7 +521,7 @@ index 19109ee1dd..7c238d728b 100644 protected float ab() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 5b33997529..1722855ac5 100644 +index 91c4785889..8a41a1dca8 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -0,0 +0,0 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -806,7 +628,7 @@ index ae31935c48..70c9b1f50c 100644 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1a59a6a1f2..ce4bf0a68f 100644 +index 2c69e68276..0ebe754619 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ @@ -815,7 +637,7 @@ index 1a59a6a1f2..ce4bf0a68f 100644 +import co.aikar.timings.Timings; import com.google.common.base.Stopwatch; import com.google.common.collect.Lists; - import com.google.common.collect.Queues; + import com.google.common.collect.Maps; @@ -0,0 +0,0 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.Main; @@ -835,9 +657,9 @@ index 1a59a6a1f2..ce4bf0a68f 100644 if (this.server != null) { this.server.disablePlugins(); @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - public void u() {} + public void t() {} - protected void v() { + protected void a(BooleanSupplier booleansupplier) { - SpigotTimings.serverTickTimer.startTiming(); // Spigot + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.startTiming(); // Paper this.slackActivityAccountant.tickStarted(); // Spigot @@ -868,7 +690,7 @@ index 1a59a6a1f2..ce4bf0a68f 100644 + co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } - public void w() { + public void b(BooleanSupplier booleansupplier) { - SpigotTimings.schedulerTimer.startTiming(); // Spigot + MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Paper this.server.getScheduler().mainThreadHeartbeat(this.ticks); // CraftBukkit @@ -879,7 +701,7 @@ index 1a59a6a1f2..ce4bf0a68f 100644 FutureTask futuretask; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati - while ((futuretask = (FutureTask) this.g.poll()) != null) { + while ((futuretask = (FutureTask) this.f.poll()) != null) { SystemUtils.a(futuretask, MinecraftServer.LOGGER); } + MinecraftTimings.minecraftSchedulerTimer.stopTiming(); // Paper @@ -920,8 +742,8 @@ index 1a59a6a1f2..ce4bf0a68f 100644 - SpigotTimings.timeUpdateTimer.stopTiming(); // Spigot + MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot - int i; - + // WorldServer worldserver; // CraftBukkit - dropped down + long i; @@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati this.methodProfiler.e(); @@ -932,7 +754,6 @@ index 1a59a6a1f2..ce4bf0a68f 100644 this.methodProfiler.e(); this.methodProfiler.e(); } -@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati } this.methodProfiler.c("connection"); @@ -948,11 +769,11 @@ index 1a59a6a1f2..ce4bf0a68f 100644 - SpigotTimings.playerListTimer.stopTiming(); // Spigot + MinecraftTimings.playerListTimer.stopTiming(); // Spigot this.methodProfiler.c("tickables"); -- + - SpigotTimings.tickablesTimer.startTiming(); // Spigot + MinecraftTimings.tickablesTimer.startTiming(); // Spigot - for (i = 0; i < this.l.size(); ++i) { - ((ITickable) this.l.get(i)).Y_(); + for (int j = 0; j < this.k.size(); ++j) { + ((ITickable) this.k.get(j)).Y_(); } - SpigotTimings.tickablesTimer.stopTiming(); // Spigot + MinecraftTimings.tickablesTimer.stopTiming(); // Spigot @@ -1054,7 +875,7 @@ index ac6d8cc6e6..d975c2ccf1 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 42e0630e60..5d42cfe81c 100644 +index 7dee734a70..37284fae4d 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; @@ -1116,7 +937,7 @@ index 889b32287e..69da194f52 100644 throw CancelledPacketHandleException.INSTANCE; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index e476d3433b..9cef6b9af6 100644 +index ead9697e65..26df2ff32f 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ @@ -1194,7 +1015,7 @@ index a07895935e..ee5c2421bb 100644 } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 9361667c3b..0d54513a44 100644 +index c69209497b..68ac014aab 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ import javax.annotation.Nullable; @@ -1214,7 +1035,7 @@ index 9361667c3b..0d54513a44 100644 private final TileEntityTypes e; public TileEntityTypes getTileEntityType() { return e; } // Paper - OBFHELPER protected World world; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e1cf1e579a..3cb7c1d540 100644 +index 028678379a..c3c435cab9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -0,0 +0,0 @@ @@ -1223,7 +1044,7 @@ index e1cf1e579a..3cb7c1d540 100644 +import co.aikar.timings.Timings; import com.google.common.base.MoreObjects; import com.google.common.collect.Lists; - import java.util.ArrayList; + import it.unimi.dsi.fastutil.longs.LongSet; @@ -0,0 +0,0 @@ import com.google.common.collect.Maps; import java.util.Map; import org.bukkit.Bukkit; @@ -1239,7 +1060,7 @@ index e1cf1e579a..3cb7c1d540 100644 import org.bukkit.event.block.BlockCanBuildEvent; import org.bukkit.event.block.BlockPhysicsEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc public final com.destroystokyo.paper.PaperWorldConfig paperConfig; // Paper @@ -1248,7 +1069,7 @@ index e1cf1e579a..3cb7c1d540 100644 private boolean guardEntityList; // Spigot public static boolean haveWeSilencedAPhysicsCrash; public static String blockLocation; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc }); this.getServer().addWorld(this.world); // CraftBukkit end @@ -1257,7 +1078,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } this.methodProfiler.c("remove"); @@ -1265,7 +1086,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.entityList.removeAll(this.g); int j; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.g.clear(); this.p_(); @@ -1273,7 +1094,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.methodProfiler.c("regular"); CrashReportSystemDetails crashreportsystemdetails1; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc timings.entityTick.startTiming(); // Spigot guardEntityList = true; // Spigot // CraftBukkit start - Use field for loop variable @@ -1281,7 +1102,7 @@ index e1cf1e579a..3cb7c1d540 100644 int entitiesThisCycle = 0; if (tickPosition < 0) tickPosition = 0; for (entityLimiter.initTick(); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc this.methodProfiler.a("tick"); if (!entity.dead && !(entity instanceof EntityPlayer)) { try { @@ -1295,7 +1116,7 @@ index e1cf1e579a..3cb7c1d540 100644 crashreport1 = CrashReport.a(throwable1, "Ticking entity"); crashreportsystemdetails1 = crashreport1.a("Entity being ticked"); entity.appendEntityCrashDetails(crashreportsystemdetails1); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } timings.tileEntityPending.stopTiming(); // Spigot @@ -1303,7 +1124,7 @@ index e1cf1e579a..3cb7c1d540 100644 this.methodProfiler.e(); this.methodProfiler.e(); } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } // CraftBukkit end @@ -1311,7 +1132,7 @@ index e1cf1e579a..3cb7c1d540 100644 entity.N = entity.locX; entity.O = entity.locY; entity.P = entity.locZ; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.lastPitch = entity.pitch; if (flag && entity.inChunk) { ++entity.ticksLived; @@ -1319,7 +1140,7 @@ index e1cf1e579a..3cb7c1d540 100644 if (entity.isPassenger()) { entity.aH(); } else { -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } } @@ -1329,7 +1150,7 @@ index e1cf1e579a..3cb7c1d540 100644 public boolean a(@Nullable Entity entity, VoxelShape voxelshape) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 2c6f6de4ce..f032ecab64 100644 +index c276c259ae..badec349b7 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ @@ -1340,20 +1161,20 @@ index 2c6f6de4ce..f032ecab64 100644 import com.google.common.collect.Maps; import com.google.common.util.concurrent.ListenableFuture; @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - RegistryBlocks registryblocks1 = Block.REGISTRY; // CraftBukkit - decompile error + IRegistry iregistry1 = IRegistry.BLOCK; // CraftBukkit - decompile error - Block.REGISTRY.getClass(); -- this.nextTickListBlock = new TickListServer<>(this, predicate, function, registryblocks1::get, this::b); // CraftBukkit - decompile error -+ this.nextTickListBlock = new TickListServer<>(this, predicate, function, registryblocks1::get, this::b, "Blocks"); // CraftBukkit - decompile error // Paper - Timings v2 - Predicate predicate2 = (fluidtype) -> { + IRegistry.BLOCK.getClass(); +- this.nextTickListBlock = new TickListServer<>(this, predicate, function, iregistry1::getOrDefault, this::b); // CraftBukkit - decompile error ++ this.nextTickListBlock = new TickListServer<>(this, predicate, function, iregistry1::getOrDefault, this::b, "Blocks"); // CraftBukkit - decompile error // Paper - Timings v2 + Predicate predicate2 = (fluidtype) -> { // CraftBukkit - decompile error return fluidtype == null || fluidtype == FluidTypes.a; }; @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - function = registryblocks::b; - RegistryBlocks registryblocks2 = FluidType.c; // CraftBukkit - decompile error - FluidType.c.getClass(); -- this.nextTickListFluid = new TickListServer<>(this, predicate2, function, registryblocks2::get, this::a); // CraftBukkit - decompile error -+ this.nextTickListFluid = new TickListServer<>(this, predicate2, function, registryblocks2::get, this::a, "Fluids"); // CraftBukkit - decompile error // Paper - Timings v2 + function = iregistry::getKey; + IRegistry iregistry2 = IRegistry.FLUID; // CraftBukkit - decompile error + IRegistry.FLUID.getClass(); +- this.nextTickListFluid = new TickListServer<>(this, predicate2, function, iregistry2::getOrDefault, this::a); // CraftBukkit - decompile error ++ this.nextTickListFluid = new TickListServer<>(this, predicate2, function, iregistry2::getOrDefault, this::a, "Fluids"); // CraftBukkit - decompile error // Paper - Timings v2 this.siegeManager = new VillageSiege(this); this.d = new ObjectLinkedOpenHashSet(); this.server = minecraftserver; @@ -1363,13 +1184,13 @@ index 2c6f6de4ce..f032ecab64 100644 this.methodProfiler.c("tickPending"); - timings.doTickPending.startTiming(); // Spigot + timings.scheduledBlocks.startTiming(); // Paper - this.p(); + this.q(); - timings.doTickPending.stopTiming(); // Spigot + timings.scheduledBlocks.stopTiming(); // Paper this.methodProfiler.c("tickBlocks"); - timings.doTickTiles.startTiming(); // Spigot + timings.chunkTicks.startTiming(); // Paper - this.l(); + this.n_(); - timings.doTickTiles.stopTiming(); // Spigot + timings.chunkTicks.stopTiming(); // Paper this.methodProfiler.c("chunkMap"); @@ -1393,17 +1214,8 @@ index 2c6f6de4ce..f032ecab64 100644 this.methodProfiler.e(); @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - gen = new org.bukkit.craftbukkit.generator.NormalChunkGenerator(this, this.getSeed()); - } -- return new ChunkProviderServer(this, ichunkloader, gen, this.server); -+ return new ChunkProviderServer(this, ichunkloader, new co.aikar.timings.TimedChunkGenerator(this, gen), this.server); // Paper - // CraftBukkit end - } - -@@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - - if (chunkproviderserver.e()) { + if (chunkproviderserver.d()) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit + timings.worldSave.startTiming(); // Paper if (iprogressupdate != null) { @@ -1417,7 +1229,7 @@ index 2c6f6de4ce..f032ecab64 100644 chunkproviderserver.a(flag); + timings.worldSaveChunks.stopTiming(); // Paper // CraftBukkit - ArrayList -> Collection - Collection arraylist = chunkproviderserver.a(); + java.util.Collection arraylist = chunkproviderserver.a(); Iterator iterator = arraylist.iterator(); @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { chunkproviderserver.unload(chunk); @@ -1434,18 +1246,18 @@ index 2c6f6de4ce..f032ecab64 100644 protected void a() throws ExceptionWorldConflict { + timings.worldSaveLevel.startTiming(); // Paper this.checkSession(); - WorldServer[] aworldserver = this.server.worldServer; - int i = aworldserver.length; + Iterator iterator = this.server.getWorlds().iterator(); + @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { - this.worldData.c(this.server.aR().c()); + this.worldData.c(this.server.aP().c()); this.dataManager.saveWorldData(this.worldData, this.server.getPlayerList().t()); - this.worldMaps.a(); + this.h().a(); + timings.worldSaveLevel.stopTiming(); // Paper } // CraftBukkit start diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ed3c23b74e..a4112c54ea 100644 +index 46a9ff9482..9ba50a2daa 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 { @@ -1697,7 +1509,7 @@ index 413dd35f06..52a8c48fa4 100644 public void callStage3(QueuedChunk queuedChunk, Chunk chunk, Runnable runnable) throws RuntimeException { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 390fd92738..563e90d4dc 100644 +index 9f78f2c4ae..b8bdcb6b74 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/Toggleable-player-crits-helps-mitigate-hacked-client.patch b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch index 308c5330ff..13b45a1137 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 128034dbb2..2ce60eb05d 100644 +index 63f8f566cb..c9a44863cc 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 { @@ -21,7 +21,7 @@ index 128034dbb2..2ce60eb05d 100644 private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 686c61133d..bd25a00d82 100644 +index 380192501e..fcb5f07d78 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/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/Spigot-Server-Patches/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch index 7c6f6b73bf..003af1b3a3 100644 --- a/Spigot-Server-Patches/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch +++ b/Spigot-Server-Patches/Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event Otherwise the creeper infinite explodes diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 0147054dff..bbb4ca0fe6 100644 +index 765123e3d2..19022b6e24 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { @@ -19,7 +19,7 @@ index 0147054dff..bbb4ca0fe6 100644 private int fuseTicks; public int maxFuseTicks = 30; @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { - this.dG(); + this.dF(); } else { fuseTicks = 0; + this.datawatcher.set(isIgnitedDW, Boolean.valueOf(false)); // Paper diff --git a/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch b/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch index 98fd5e0dca..140e85e1c0 100644 --- a/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch +++ b/Spigot-Server-Patches/Use-ConcurrentHashMap-in-JsonList.patch @@ -25,7 +25,7 @@ The point of this is readability, but does have a side-benefit of a small microp Finally, added a couple obfhelpers for the modified code diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java -index 6700e68c0..a2815b91f 100644 +index 6700e68c06..a2815b91fd 100644 --- a/src/main/java/net/minecraft/server/JsonList.java +++ b/src/main/java/net/minecraft/server/JsonList.java @@ -0,0 +0,0 @@ public class JsonList> { 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 94ed9bb931..6e49e0a1d6 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,25 +12,23 @@ 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 47e307a246..a93ed45df9 100644 +index ced853423d..5afd16d7fe 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ + 2.8.1 runtime - -+ + + org.apache.logging.log4j + log4j-iostreams + 2.8.1 + -+ - - junit + org.ow2.asm + asm diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index af430b73f0..8c76300185 100644 +index fc7e244f8b..50d7ef0b2a 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index 00180c1cb3..55a45b8491 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -19,28 +19,17 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index 09b4ddf19..47e307a24 100644 +index 17c3baaec9..ced853423d 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ - ${minecraft.version}-SNAPSHOT compile -- + - jline - jline - 2.12.1 - compile -- - - org.ow2.asm - asm -@@ -0,0 +0,0 @@ - 3.0.3 - compile - -+ -+ + net.minecrell + terminalconsoleappender + 1.1.1 @@ -51,7 +40,6 @@ index 09b4ddf19..47e307a24 100644 + 4.5.2 + runtime + -+ + + - junit + org.ow2.asm @@ -0,0 +0,0 @@ META-INF/services/java.sql.Driver @@ -89,7 +75,7 @@ index 09b4ddf19..47e307a24 100644 org.apache.maven.plugins diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java new file mode 100644 -index 000000000..688b4715e +index 0000000000..688b4715eb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java @@ -0,0 +0,0 @@ @@ -135,7 +121,7 @@ index 000000000..688b4715e +} diff --git a/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java new file mode 100644 -index 000000000..685deaa0e +index 0000000000..685deaa0e5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/console/TerminalConsoleCommandSender.java @@ -0,0 +0,0 @@ @@ -157,7 +143,7 @@ index 000000000..685deaa0e + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index bf1fffcfe..af430b73f 100644 +index dabad6b055..fc7e244f8b 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -199,7 +185,7 @@ index bf1fffcfe..af430b73f 100644 System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a49393b2f..5635997d0 100644 +index 5d8dbdf8a3..6aec7c31e3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import org.apache.commons.lang3.Validate; @@ -255,9 +241,9 @@ index a49393b2f..5635997d0 100644 + MinecraftServer.LOGGER.info(org.bukkit.craftbukkit.util.CraftChatMessage.fromComponent(ichatbasecomponent, net.minecraft.server.EnumChatFormat.WHITE));// Paper - Log message with colors } - public KeyPair G() { + public KeyPair E() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0b0d99652..4cbe14801 100644 +index a9906f03c9..2f2f301383 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 { @@ -271,7 +257,7 @@ index 0b0d99652..4cbe14801 100644 this.k = new GameProfileBanList(PlayerList.a); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 17b398cde..51ea2013e 100644 +index 6a44428293..10cbe8c6a1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ import java.nio.ByteBuffer; @@ -299,7 +285,7 @@ index 17b398cde..51ea2013e 100644 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index ced9b7231..e68d2d6bb 100644 +index 5c26e78a71..69a7c5205e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -0,0 +0,0 @@ import java.util.logging.Logger; @@ -338,10 +324,10 @@ index ced9b7231..e68d2d6bb 100644 + System.setProperty(TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } - if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { + if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { diff --git a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java b/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java deleted file mode 100644 -index 26a2fb894..000000000 +index 26a2fb8942..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/command/ColouredConsoleSender.java +++ /dev/null @@ -0,0 +0,0 @@ @@ -420,7 +406,7 @@ index 26a2fb894..000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java -index 33e8ea02c..1e3aae3b8 100644 +index 33e8ea02c4..1e3aae3b8f 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java +++ b/src/main/java/org/bukkit/craftbukkit/command/ConsoleCommandCompleter.java @@ -0,0 +0,0 @@ import java.util.logging.Level; @@ -499,7 +485,7 @@ index 33e8ea02c..1e3aae3b8 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java -index 984df4083..bbb5a84f3 100644 +index 984df4083d..bbb5a84f36 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java +++ b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java @@ -0,0 +0,0 @@ public class ServerShutdownThread extends Thread { @@ -513,7 +499,7 @@ index 984df4083..bbb5a84f3 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java b/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java deleted file mode 100644 -index b64097113..000000000 +index b640971130..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/TerminalConsoleWriterThread.java +++ /dev/null @@ -0,0 +0,0 @@ @@ -572,7 +558,7 @@ index b64097113..000000000 - } -} diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml -index 5cee8f00e..08b6bb7f9 100644 +index 5cee8f00ef..08b6bb7f97 100644 --- a/src/main/resources/log4j2.xml +++ b/src/main/resources/log4j2.xml @@ -0,0 +0,0 @@ diff --git a/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch b/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch index 2b95083031..28c8b74b97 100644 --- a/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch +++ b/Spigot-Server-Patches/Use-a-Queue-for-Queueing-Commands.patch @@ -6,21 +6,21 @@ Subject: [PATCH] Use a Queue for Queueing Commands Lists are bad as Queues mmmkay. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 8e15710ca..eae83ab9f 100644 +index c4e99ef2a9..98d3bad378 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer private static final Logger LOGGER = LogManager.getLogger(); - private static final Pattern i = Pattern.compile("^[a-fA-F0-9]{40}$"); + private static final Pattern h = Pattern.compile("^[a-fA-F0-9]{40}$"); - private final List serverCommandQueue = Collections.synchronizedList(Lists.newArrayList()); // CraftBukkit - fix decompile error + private final java.util.Queue serverCommandQueue = new java.util.concurrent.ConcurrentLinkedQueue<>(); // Paper - use a proper queue - private RemoteStatusListener k; + private RemoteStatusListener j; public final RemoteControlCommandListener remoteControlCommandListener = new RemoteControlCommandListener(this); - private RemoteControlListener m; + private RemoteControlListener l; @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - public void aW() { + public void aU() { MinecraftTimings.serverCommandTimer.startTiming(); // Spigot - while (!this.serverCommandQueue.isEmpty()) { - ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); diff --git a/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch b/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch index ecd5ac7a83..ed4155b47d 100644 --- a/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch +++ b/Spigot-Server-Patches/Use-asynchronous-Log4j-2-loggers.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Use asynchronous Log4j 2 loggers diff --git a/pom.xml b/pom.xml -index a319cfe3b8..ddee1b0488 100644 +index 3be49ee7f4..1e7d2b5506 100644 --- a/pom.xml +++ b/pom.xml @@ -0,0 +0,0 @@ + log4j-iostreams 2.8.1 - + + + com.lmax @@ -19,10 +19,9 @@ index a319cfe3b8..ddee1b0488 100644 + 3.4.2 + runtime + -+ - - junit + org.ow2.asm + asm diff --git a/src/main/resources/log4j2.component.properties b/src/main/resources/log4j2.component.properties new file mode 100644 index 0000000000..ee7c90784c diff --git a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch index 5401d7f9a1..25cfa2cdd0 100644 --- a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9ab635058..4315804dd 100644 +index d86a23d71d..4a2faa314e 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 @@ -16,9 +16,9 @@ index 9ab635058..4315804dd 100644 + public boolean j; public boolean blocksEntitySpawning() { return j; } // Paper - OBFHELPER public final List passengers; protected int k; - private Entity ax; + private Entity vehicle; diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index c8f305e6d..b57f6efb3 100644 +index 0a4ee39d67..6f80876990 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java @@ -0,0 +0,0 @@ public interface IBlockData extends IBlockDataHolder { @@ -30,7 +30,7 @@ index c8f305e6d..b57f6efb3 100644 return this.getBlock().f(this, iblockaccess, blockposition); } diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java -index 1cecccef2..afc881d9a 100644 +index 1cecccef23..afc881d9af 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -0,0 +0,0 @@ public class ItemBlock extends Item { @@ -44,11 +44,11 @@ index 1cecccef2..afc881d9a 100644 BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), CraftBlockData.fromData(iblockdata), defaultReturn); blockactioncontext.getWorld().getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index 53c9f2188..71e408432 100644 +index 700900256b..b7d2fa2f0e 100644 --- a/src/main/java/net/minecraft/server/VoxelShape.java +++ b/src/main/java/net/minecraft/server/VoxelShape.java @@ -0,0 +0,0 @@ public abstract class VoxelShape { - return this.a(enumdirection_enumaxis, this.a.b(enumdirection_enumaxis)); + return i <= 0 ? Double.NEGATIVE_INFINITY : this.a(enumdirection_enumaxis, i); } + public AxisAlignedBB getBounds() { return a(); } // Paper - OBFHELPER @@ -64,10 +64,10 @@ index 53c9f2188..71e408432 100644 return this.a.a(); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 4b03f1965..921add1dc 100644 +index 73cd2d015b..3ea26d5ad8 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } } @@ -106,7 +106,7 @@ index 4b03f1965..921add1dc 100644 if (voxelshape.b()) { return true; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index cf398cd25..140ddae0d 100644 +index 9fb1b75413..1f3774c249 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Vex-getSummoner-API.patch b/Spigot-Server-Patches/Vex-getSummoner-API.patch index 32d4c56509..4967898d28 100644 --- a/Spigot-Server-Patches/Vex-getSummoner-API.patch +++ b/Spigot-Server-Patches/Vex-getSummoner-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Vex#getSummoner API Get's the NPC that summoned this Vex diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index 80403473c8..36f8c315b5 100644 +index 9c08b3e182..6e029ff44c 100644 --- a/src/main/java/net/minecraft/server/EntityVex.java +++ b/src/main/java/net/minecraft/server/EntityVex.java @@ -0,0 +0,0 @@ public class EntityVex extends EntityMonster { diff --git a/Spigot-Server-Patches/WitchConsumePotionEvent.patch b/Spigot-Server-Patches/WitchConsumePotionEvent.patch index 8bfdec2b3f..b6fca3bfcd 100644 --- a/Spigot-Server-Patches/WitchConsumePotionEvent.patch +++ b/Spigot-Server-Patches/WitchConsumePotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchConsumePotionEvent Fires when a witch consumes the potion in their hand diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index b397636247..790ab11c17 100644 +index a586689acf..6717d3c331 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/WitchReadyPotionEvent.patch b/Spigot-Server-Patches/WitchReadyPotionEvent.patch index ca04c9edec..67f0539a82 100644 --- a/Spigot-Server-Patches/WitchReadyPotionEvent.patch +++ b/Spigot-Server-Patches/WitchReadyPotionEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] WitchReadyPotionEvent diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 9d802be18a..0096df5de0 100644 +index 648ed17a30..b5f676f045 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/WitchThrowPotionEvent.patch b/Spigot-Server-Patches/WitchThrowPotionEvent.patch index 4e26e54ffd..c65fd819bd 100644 --- a/Spigot-Server-Patches/WitchThrowPotionEvent.patch +++ b/Spigot-Server-Patches/WitchThrowPotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 790ab11c17..9d802be18a 100644 +index 6717d3c331..648ed17a30 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch b/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch index d4e3e81e8a..f99d6d27ff 100644 --- a/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch +++ b/Spigot-Server-Patches/Workaround-for-setting-passengers-on-players.patch @@ -6,7 +6,7 @@ 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 be29f85a05..a84f1a055c 100644 +index f4d06a9465..9a3e36f17f 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/World-EntityHuman-Lookup-Optimizations.patch b/Spigot-Server-Patches/World-EntityHuman-Lookup-Optimizations.patch index 51d05c3517..078c3ca583 100644 --- a/Spigot-Server-Patches/World-EntityHuman-Lookup-Optimizations.patch +++ b/Spigot-Server-Patches/World-EntityHuman-Lookup-Optimizations.patch @@ -5,18 +5,18 @@ Subject: [PATCH] World EntityHuman Lookup Optimizations diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 82f4f00a7..b0053e5e6 100644 +index 255829b0b5..26007862ab 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc private final List c = Lists.newArrayList(); - private final Set tileEntityListUnload = Sets.newHashSet(); // Paper + private final Set tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); // Paper public final List players = Lists.newArrayList(); + public final Map playersByName = Maps.newHashMap(); // Paper - World EntityHuman Lookup Optimizations public final List k = Lists.newArrayList(); protected final IntHashMap entitiesById = new IntHashMap(); - private final long G = 16777215L; -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose + private final long F = 16777215L; +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc EntityHuman entityhuman = (EntityHuman) entity; this.players.add(entityhuman); @@ -25,15 +25,15 @@ index 82f4f00a7..b0053e5e6 100644 this.everyoneSleeping(); } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); + this.playersByName.remove(entity.getName()); // Paper - World EntityHuman Lookup Optimizations // Spigot start - for ( Object o : worldMaps.d ) + for ( WorldPersistentData worldData : worldMaps.a.values() ) { -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc entity.die(); if (entity instanceof EntityHuman) { this.players.remove(entity); @@ -41,7 +41,7 @@ index 82f4f00a7..b0053e5e6 100644 this.everyoneSleeping(); } -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @Nullable public EntityHuman a(String s) { @@ -50,7 +50,7 @@ index 82f4f00a7..b0053e5e6 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } return null; @@ -66,7 +66,7 @@ index 82f4f00a7..b0053e5e6 100644 for (int i = 0; i < this.players.size(); ++i) { EntityHuman entityhuman = (EntityHuman) this.players.get(i); -@@ -0,0 +0,0 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc } return null; diff --git a/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch index 1589509ebc..1d28aef788 100644 --- a/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/add-more-information-to-Entity.toString.patch @@ -6,7 +6,7 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 20c2bf16be..835d329f91 100644 +index 111c2c3df6..58f7489ebd 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/getPlayerUniqueId-API.patch b/Spigot-Server-Patches/getPlayerUniqueId-API.patch index ce2cc586e8..1b4e148993 100644 --- a/Spigot-Server-Patches/getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/getPlayerUniqueId-API.patch @@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b5fd412b74..0552659354 100644 +index 99f4b40f7f..a6d1fde496 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/handle-NaN-health-absorb-values-and-repair-bad-data.patch b/Spigot-Server-Patches/handle-NaN-health-absorb-values-and-repair-bad-data.patch index d9578836c3..faf242ff55 100644 --- a/Spigot-Server-Patches/handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/Spigot-Server-Patches/handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -5,7 +5,7 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 03c6c77a60..2d80f4e3e9 100644 +index 442981f938..edd2ffa394 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 { @@ -44,7 +44,7 @@ index 03c6c77a60..2d80f4e3e9 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1f716013ac..be29f85a05 100644 +index b56bb9d531..f4d06a9465 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-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/handle-PacketPlayInKeepAlive-async.patch index d6e1dffdea..5724a5d6fb 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 c1dd2db89d..b106454447 100644 +index 4cf738e0f8..66d7d76d41 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 { @@ -29,11 +29,11 @@ index c1dd2db89d..b106454447 100644 this.player.ping = (this.player.ping * 3 + i) / 4; this.g = false; - } else if (!this.player.getDisplayName().getString().equals(this.minecraftServer.I())) { + } else if (!this.player.getDisplayName().getString().equals(this.minecraftServer.G())) { - this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); + // Paper start - This needs to be handled on the main thread for plugins + minecraftServer.postToMainThread(() -> { -+ this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); ++ this.disconnect(new ChatMessage("disconnect.timeout", new Object[0])); + }); + // Paper end } diff --git a/Spigot-Server-Patches/isChunkGenerated-API.patch b/Spigot-Server-Patches/isChunkGenerated-API.patch index 1054e92a6e..f395206277 100644 --- a/Spigot-Server-Patches/isChunkGenerated-API.patch +++ b/Spigot-Server-Patches/isChunkGenerated-API.patch @@ -6,24 +6,21 @@ Subject: [PATCH] isChunkGenerated API Resolves #1329 diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0e0c7b1ab..cb4a2a0b9 100644 +index 5e8a20fdd6..5eaef413a6 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -0,0 +0,0 @@ public class ChunkProviderServer implements IChunkProvider { - - } - -+ // Paper start + private long lastQueuedSaves = 0L; // Paper + private long lastProcessedSaves = 0L; // Paper + private long lastSaveStatPrinted = System.currentTimeMillis(); + public boolean isChunkGenerated(int x, int z) { -+ return this.chunks.containsKey(ChunkCoordIntPair.asLong(x, z)) || this.chunkLoader.chunkExists(x, z); ++ return this.chunks.containsKey(ChunkCoordIntPair.asLong(x, z)) || ((ChunkRegionLoader) this.chunkLoader).chunkExists(x, z); + } -+ // Paper end -+ - @Nullable - public Chunk getLoadedChunkAt(int i, int j) { - long k = ChunkCoordIntPair.a(i, j); + // Paper end + public final Long2ObjectMap chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192)); + private Chunk lastChunk; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index aa0b1f5fa..9a78fa687 100644 +index ba2e768594..1ccf2a7609 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/provide-a-configurable-option-to-disable-creeper-lin.patch b/Spigot-Server-Patches/provide-a-configurable-option-to-disable-creeper-lin.patch index fd82fc3d11..173b57f350 100644 --- a/Spigot-Server-Patches/provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/Spigot-Server-Patches/provide-a-configurable-option-to-disable-creeper-lin.patch @@ -6,7 +6,7 @@ Subject: [PATCH] provide a configurable option to disable creeper lingering diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 87c599338a..23cb3feef0 100644 +index 0094f6ab98..22af662ff3 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 { @@ -21,11 +21,11 @@ index 87c599338a..23cb3feef0 100644 + } } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 8b0134ecdb..0147054dff 100644 +index a1c343d77b..765123e3d2 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -0,0 +0,0 @@ public class EntityCreeper extends EntityMonster { - private void dG() { + private void dF() { Collection collection = this.getEffects(); - if (!collection.isEmpty()) { diff --git a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch index fcfaf4168e..9b32855120 100644 --- a/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch +++ b/Spigot-Server-Patches/remove-null-possibility-for-getServer-singleton.patch @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 67c60be6f7..b41e7badff 100644 +index c7791dd925..ea882e4b82 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -0,0 +0,0 @@ import co.aikar.timings.MinecraftTimings; // Paper diff --git a/Spigot-Server-Patches/repair-bad-rcon.ip-settings-temporarily.patch b/Spigot-Server-Patches/repair-bad-rcon.ip-settings-temporarily.patch deleted file mode 100644 index ce571b1836..0000000000 --- a/Spigot-Server-Patches/repair-bad-rcon.ip-settings-temporarily.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 25 Jul 2018 01:21:05 -0400 -Subject: [PATCH] repair bad rcon.ip settings temporarily - -accidently missed mapping change, and we defaulted rcon.ip to the server.properties file path - -clean up values for people, drop this patch after like 2 weeks. - -diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java -index c237f239f..1319b3b91 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 { - this.h = iminecraftserver.a("rcon.port", 0); - this.l = iminecraftserver.a("rcon.password", ""); - this.j = iminecraftserver.a("rcon.ip", ((DedicatedServer) iminecraftserver).getServerIp()); // Paper -+ if (this.j.equals(iminecraftserver.d_())) this.j = ((DedicatedServer) iminecraftserver).getServerIp(); // Paper - temporary - remove this after like 2 weeks - repair bad settings - 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/revert-serverside-behavior-of-keepalives.patch b/Spigot-Server-Patches/revert-serverside-behavior-of-keepalives.patch index 7b721ba4ad..38ef6d3d86 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 b106454447..60d9f5706a 100644 +index 66d7d76d41..5ffe4b374e 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/use-CB-BlockState-implementations-for-captured-block.patch b/Spigot-Server-Patches/use-CB-BlockState-implementations-for-captured-block.patch index e92e2dc61b..0bdfd4f6b4 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,10 +18,10 @@ 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 f740328183..7cd07112a3 100644 +index a6d5fb7c73..08aab08ec2 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 +@@ -0,0 +0,0 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc // CraftBukkit start - capture blockstates CraftBlockState blockstate = null; if (this.captureBlockStates) { diff --git a/work/BuildData b/work/BuildData index 351106b633..83455962ed 160000 --- a/work/BuildData +++ b/work/BuildData @@ -1 +1 @@ -Subproject commit 351106b6336fc52f6acf94aabd34ac54fc772432 +Subproject commit 83455962edb05fea080f04d6708eede4fa8be7b1 diff --git a/work/Bukkit b/work/Bukkit index 23c1a2ba03..2dcc44dcec 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 23c1a2ba03b96b52f69a93e07706f9ccc33fd683 +Subproject commit 2dcc44dcec8a985ef4da59f6c95ea4ed732f9444 diff --git a/work/CraftBukkit b/work/CraftBukkit index 162bda93ff..479ec05e3b 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 162bda93ff76fe96a6138a14176807f21a6ddef4 +Subproject commit 479ec05e3b15937ae7e988d9050d167fc6ba307d diff --git a/work/Spigot b/work/Spigot index fe3ab0d858..2440e18926 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit fe3ab0d858960183da1da1b1378c363c3da94bbb +Subproject commit 2440e18926007124b1b968b7d81b0aa29627c332