From 0976d52bbd4f541253f458859ff460ce2401b1ba Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 20 Mar 2019 00:28:15 +0000 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Please note that this build includes changes to meet upstreams requirements for nullability annotations. While we aim for a level of accuracy, these might not be 100% correct, if there are any issues, please speak to us on discord, or open an issue on the tracker to discuss. Bukkit Changes: 9a6a1de3 Remove nullability annotations from enum constructors 3f0591ea SPIGOT-2540: Add nullability annotations to entire Bukkit API CraftBukkit Changes: 8d8475fc SPIGOT-4666: Force parameter in HumanEntity#sleep 8b1588e2 Fix ExplosionPrimeEvent#setFire not working with EnderCrystals 39a287b7 Don't ignore newlines in PlayerListHeader/Footer Spigot Changes: cf694d87 Add nullability annotations --- Spigot-API-Patches/0001-POM-changes.patch | 10 +- Spigot-API-Patches/0003-Paper-Utils.patch | 14 +- Spigot-API-Patches/0004-Timings-v2.patch | 646 +++++++++++------- .../0005-Player-affects-spawning-API.patch | 10 +- .../0006-Add-getTPS-method.patch | 18 +- .../0007-Entity-Origin-API.patch | 19 +- .../0008-Check-Paper-versions.patch | 24 +- .../0010-Add-player-view-distance-API.patch | 8 +- .../0011-Add-BeaconEffectEvent.patch | 17 +- .../0012-Add-PlayerInitialSpawnEvent.patch | 18 +- ...ly-disable-plugins-that-fail-to-load.patch | 8 +- .../0014-Expose-server-CommandMap.patch | 17 +- ...cord-chat-API-from-spigot-subclasses.patch | 34 +- .../0016-Player-Tab-List-and-Title-APIs.patch | 75 +- .../0017-Add-exception-reporting-event.patch | 48 +- ...erverListPingEvent-flagging-as-Async.patch | 14 +- ...t-sendMessage-methods-to-CommandSend.patch | 34 +- ...working-with-arrows-stuck-in-living-.patch | 8 +- .../0021-Complete-resource-pack-API.patch | 22 +- .../0022-Use-ASM-for-event-executors.patch | 103 +-- .../0023-Add-a-call-helper-to-Event.patch | 17 +- ...der-name-to-commands.yml-replacement.patch | 23 +- ...eload-permissions.yml-and-require-co.patch | 40 +- ...6-Custom-replacement-for-eaten-items.patch | 19 +- .../0027-Access-items-by-EquipmentSlot.patch | 15 +- ...Entity-AddTo-RemoveFrom-World-Events.patch | 22 +- .../0029-EntityPathfindEvent.patch | 22 +- ...synchronization-in-MetadataStoreBase.patch | 49 +- ...d-MetadataStoreBase.removeAll-Plugin.patch | 10 +- ...0032-Add-PlayerUseUnknownEntityEvent.patch | 16 +- ...ent-to-allow-plugins-to-handle-clien.patch | 40 +- .../0034-Arrow-pickup-rule-API.patch | 8 +- ...ityRegainHealthEvent-isFastRegen-API.patch | 12 +- Spigot-API-Patches/0036-LootTable-API.patch | 76 ++- .../0037-Add-EntityZapEvent.patch | 32 +- Spigot-API-Patches/0038-Misc-Utils.patch | 13 +- ...9-Allow-Reloading-of-Command-Aliases.patch | 34 +- ...0-Add-source-to-PlayerExpChangeEvent.patch | 15 +- .../0041-Add-ProjectileCollideEvent.patch | 17 +- ...0042-Add-String-based-Action-Bar-API.patch | 24 +- ...to-control-if-armour-stands-can-move.patch | 8 +- .../0044-IllegalPacketEvent.patch | 27 +- Spigot-API-Patches/0045-Fireworks-API-s.patch | 15 +- .../0046-PlayerTeleportEndGatewayEvent.patch | 14 +- ...rovide-E-TE-Chunk-count-stat-methods.patch | 8 +- ...PI-for-Reason-Source-Triggering-play.patch | 14 +- ...orldBorder-isInBounds-Location-check.patch | 12 +- ...n-option-to-prevent-player-names-fro.patch | 18 +- ...upstream-javadoc-warnings-and-errors.patch | 160 ++--- .../0052-Item-canEntityPickup.patch | 8 +- ...PlayerPickupItemEvent-setFlyAtPlayer.patch | 12 +- .../0054-PlayerAttemptPickupItemEvent.patch | 20 +- .../0055-Add-UnknownCommandEvent.patch | 25 +- .../0056-Basic-PlayerProfile-API.patch | 89 ++- .../0057-Shoulder-Entities-Release-API.patch | 10 +- .../0058-Profile-Lookup-Events.patch | 41 +- .../0059-Entity-fromMobSpawner.patch | 10 +- ...60-Improve-the-Saddle-API-for-Horses.patch | 28 +- .../0061-ensureServerConversions-API.patch | 22 +- .../0062-Add-getI18NDisplayName-API.patch | 20 +- .../0063-ProfileWhitelistVerifyEvent.patch | 22 +- .../0064-Make-plugins-list-alphabetical.patch | 10 +- .../0065-LivingEntity-setKiller.patch | 19 +- ...efixes-in-implementation-logging-con.patch | 10 +- ...low-plugins-to-use-SLF4J-for-logging.patch | 20 +- ...or-plugins-modifying-the-parent-of-t.patch | 30 +- .../0069-Add-PlayerJumpEvent.patch | 21 +- ...nt-protocol-version-and-virtual-host.patch | 16 +- .../0071-Add-PlayerArmorChangeEvent.patch | 30 +- ...-get-a-BlockState-without-a-snapshot.patch | 11 +- .../0073-AsyncTabCompleteEvent.patch | 48 +- ...lay-warning-on-deprecated-recipe-API.patch | 16 +- .../0075-PlayerPickupExperienceEvent.patch | 16 +- .../0076-ExperienceOrbMergeEvent.patch | 19 +- ...7-Ability-to-apply-mending-to-XP-API.patch | 8 +- .../0078-PreCreatureSpawnEvent.patch | 22 +- ...9-PlayerNaturallySpawnCreaturesEvent.patch | 13 +- ...-Add-setPlayerProfile-API-for-Skulls.patch | 34 +- .../0081-Fill-Profile-Property-Events.patch | 34 +- ...PlayerAdvancementCriterionGrantEvent.patch | 19 +- .../0084-Optimize-Hoppers.patch | 18 +- .../0085-Tameable-getOwnerUniqueId-API.patch | 18 +- ...e-PlayerProfile-in-AsyncPreLoginEven.patch | 17 +- ...dd-extended-PaperServerListPingEvent.patch | 50 +- .../0088-Player.setPlayerProfile-API.patch | 13 +- .../0089-getPlayerUniqueId-API.patch | 20 +- ...d-method-to-open-already-placed-sign.patch | 12 +- ...d-version-history-to-version-command.patch | 27 +- ...93-Add-Ban-Methods-to-Player-Objects.patch | 81 ++- .../0094-EndermanEscapeEvent.patch | 17 +- .../0095-Enderman.teleportRandomly.patch | 8 +- ...tional-world.getNearbyEntities-API-s.patch | 66 +- .../0097-Location.isChunkLoaded-API.patch | 8 +- ...ld.spawnParticle-API-and-add-Builder.patch | 185 +++-- .../0099-EndermanAttackPlayerEvent.patch | 17 +- ...lose-Plugin-Class-Loaders-on-Disable.patch | 45 +- .../0101-WitchConsumePotionEvent.patch | 22 +- .../0102-WitchThrowPotionEvent.patch | 31 +- ...ion.toBlockLocation-toCenterLocation.patch | 10 +- .../0104-PotionEffect-clone-methods.patch | 20 +- .../0105-WitchReadyPotionEvent.patch | 22 +- ...0106-ItemStack-getMaxItemUseDuration.patch | 8 +- ...07-Add-EntityTeleportEndGatewayEvent.patch | 14 +- ...e-shield-blocking-delay-configurable.patch | 8 +- ...ent-consumeArrow-and-getArrowItem-AP.patch | 20 +- ...Add-getNearbyXXX-methods-to-Location.patch | 258 ------- ...patch => 0110-PlayerReadyArrowEvent.patch} | 19 +- ...11-Add-EntityKnockbackByEntityEvent.patch} | 20 +- ...patch => 0112-Expand-Explosions-API.patch} | 46 +- ...I-additions-for-quantity-flags-lore.patch} | 32 +- ...vingEntity-Hand-Raised-Item-Use-API.patch} | 9 +- ...-API.patch => 0115-RangedEntity-API.patch} | 33 +- ...> 0116-Add-World.getEntity-UUID-API.patch} | 15 +- ...0117-InventoryCloseEvent-Reason-API.patch} | 22 +- ...I.patch => 0118-Entity-getChunk-API.patch} | 14 +- ...d-an-asterisk-to-legacy-API-plugins.patch} | 14 +- ...ts.patch => 0120-EnderDragon-Events.patch} | 47 +- .../0120-Vex-getSummoner-API.patch | 24 - ...=> 0121-PlayerLaunchProjectileEvent.patch} | 19 +- ...atch => 0122-PlayerElytraBoostEvent.patch} | 19 +- ...atch => 0123-EntityTransformedEvent.patch} | 6 +- ...llow-disabling-armour-stand-ticking.patch} | 8 +- ...tch => 0125-SkeletonHorse-Additions.patch} | 16 +- ...26-Expand-Location-Manipulation-API.patch} | 15 +- ...patch => 0127-Expand-ArmorStand-API.patch} | 31 +- ...vent.patch => 0128-AnvilDamageEvent.patch} | 27 +- ...eadlock-risk-in-firing-async-events.patch} | 34 +- ...h => 0130-Add-hand-to-bucket-events.patch} | 40 +- ...ent.patch => 0131-Add-TNTPrimeEvent.patch} | 20 +- ...ide-Chunk-Coordinates-as-a-Long-API.patch} | 19 +- ...-API.patch => 0133-Async-Chunks-API.patch} | 54 +- ...=> 0134-Make-EnderDragon-extend-Mob.patch} | 8 +- ...le-Entities-from-a-chunk-without-sn.patch} | 34 +- ...ots-for-Timings-Tile-Entity-reports.patch} | 8 +- ...locks-to-be-accessed-via-a-long-key.patch} | 30 +- ...tch => 0138-Slime-Pathfinder-Events.patch} | 47 +- ....patch => 0139-isChunkGenerated-API.patch} | 25 +- ....patch => 0140-Add-More-Creeper-API.patch} | 16 +- ...ch => 0141-Add-PhantomPreSpawnEvent.patch} | 29 +- ...d-source-block-to-BlockPhysicsEvent.patch} | 10 +- ...=> 0143-Inventory-removeItemAnySlot.patch} | 15 +- ...ray-tracing-methods-to-LivingEntity.patch} | 28 +- ....patch => 0145-Improve-death-events.patch} | 27 +- ...I.patch => 0146-Mob-Pathfinding-API.patch} | 46 +- ...anPlaceOn-and-CanDestroy-NBT-values.patch} | 55 +- ...e-attack-cooldown-methods-for-Player.patch | 40 -- ...urrency-Improvements-to-Permissions.patch} | 51 +- ...Add-ItemStackRecipeChoice-Draft-API.patch} | 6 +- ...t-furnace-cook-speed-multiplier-API.patch} | 10 +- ....patch => 0151-PreSpawnerSpawnEvent.patch} | 14 +- ...ition-on-name-for-AttributeModifier.patch} | 10 +- ...atch => 0153-Material-API-additions.patch} | 10 +- ...ags.patch => 0154-Add-Material-Tags.patch} | 89 ++- ...55-Allow-setting-the-vex-s-summoner.patch} | 26 +- ...56-Add-LivingEntity-getTargetEntity.patch} | 19 +- ...I.patch => 0157-Add-sun-related-API.patch} | 14 +- ...-Johnny.patch => 0158-Here-s-Johnny.patch} | 6 +- ...Turtle-API.patch => 0159-Turtle-API.patch} | 47 +- ...-and-setters-for-EntityItem-owner-a.patch} | 17 +- ...=> 0161-Add-spectator-target-events.patch} | 31 +- ...PI.patch => 0162-Add-more-Witch-API.patch} | 11 +- ...ult-permission-message-configurable.patch} | 18 +- ...ion-supression-of-EntityDismount-Ve.patch} | 32 +- ...I.patch => 0165-Add-more-Zombie-API.patch} | 8 +- ...served-channel-check-to-be-sensible.patch} | 14 +- ...0167-Add-PlayerConnectionCloseEvent.patch} | 22 +- ...replace-OfflinePlayer-getLastPlayed.patch} | 12 +- ...ent.patch => 0169-BlockDestroyEvent.patch} | 16 +- ...ItemStack-Recipe-API-helper-methods.patch} | 36 +- ...ch => 0171-Add-WhitelistToggleEvent.patch} | 9 +- .../0172-Annotation-Test-changes.patch | 32 + ...06-Implement-PlayerLocaleChangeEvent.patch | 10 +- ...ers-that-dismount-from-other-players.patch | 8 +- .../0147-Optimise-removeQueue.patch | 8 +- ...58-Properly-fix-item-duplication-bug.patch | 10 +- .../0185-Shoulder-Entities-Release-API.patch | 10 +- .../0206-Add-PlayerJumpEvent.patch | 10 +- .../0280-InventoryCloseEvent-Reason-API.patch | 20 +- ...oadChunk-int-int-false-load-unconve.patch} | 4 +- ...-fix-newlines-in-spigot-tab-list-API.patch | 59 -- ...ray-tracing-methods-to-LivingEntity.patch} | 6 +- ...-attack-cooldown-methods-for-Player.patch} | 10 +- ....patch => 0347-Improve-death-events.patch} | 20 +- ...w-chests-to-be-placed-with-NBT-data.patch} | 8 +- ...I.patch => 0349-Mob-Pathfinding-API.patch} | 14 +- ...nt-chunk-loading-from-Fluid-Flowing.patch} | 6 +- ...for-CanPlaceOn-and-CanDestroy-NBT-v.patch} | 8 +- ...nt-Mob-AI-Rules-from-Loading-Chunks.patch} | 10 +- ...ning-from-loading-generating-chunks.patch} | 6 +- ...-Biome-Mob-Lookups-for-Mob-Spawning.patch} | 6 +- ...Optimize-and-Fix-ExpiringMap-Issues.patch} | 12 +- ...t-furnace-cook-speed-multiplier-API.patch} | 8 +- ...0357-Support-Overriding-World-Seeds.patch} | 12 +- ...h => 0358-Optimize-Server-World-Map.patch} | 8 +- ....patch => 0359-PreSpawnerSpawnEvent.patch} | 6 +- ...rseException-in-Entity-and-TE-names.patch} | 24 +- ... 0361-Avoid-dimension-id-collisions.patch} | 6 +- ...=> 0362-Honor-EntityAgeable.ageLock.patch} | 6 +- ...-Async-Chunk-Loading-and-Generation.patch} | 60 +- ...-Dimension-NBT-field-in-Entity-data.patch} | 6 +- ... 0365-Optimize-Light-Recalculations.patch} | 10 +- ...-entity-loss-due-to-unloaded-chunks.patch} | 6 +- ...-recheck-type-after-setting-a-block.patch} | 6 +- ...> 0368-Fix-Sending-Chunks-to-Client.patch} | 8 +- ...le-connection-throttle-kick-message.patch} | 8 +- ...Fix-FileIOThread-concurrency-issues.patch} | 6 +- ...> 0371-Hook-into-CB-plugin-rewrites.patch} | 6 +- ...72-Allow-setting-the-vex-s-summoner.patch} | 8 +- ...73-Add-LivingEntity-getTargetEntity.patch} | 14 +- ...I.patch => 0374-Add-sun-related-API.patch} | 12 +- ...wned-for-Villager-Aggression-Config.patch} | 6 +- ...-Johnny.patch => 0376-Here-s-Johnny.patch} | 8 +- ...Turtle-API.patch => 0377-Turtle-API.patch} | 8 +- ...it-lightning-strike-effect-distance.patch} | 10 +- ...-and-setters-for-EntityItem-owner-a.patch} | 8 +- ...her-worlds-for-shooter-of-projectil.patch} | 6 +- ...Call-player-spectator-target-events.patch} | 8 +- ...-Add-Velocity-IP-Forwarding-Support.patch} | 18 +- ...PI.patch => 0383-Add-more-Witch-API.patch} | 8 +- ...MC-93764.patch => 0384-Fix-MC-93764.patch} | 6 +- ...vent-players-from-moving-into-unloa.patch} | 8 +- ...6-Reset-players-airTicks-on-respawn.patch} | 10 +- ...-area-unicode-characters-from-signs.patch} | 6 +- ...after-profile-lookups-if-not-needed.patch} | 6 +- ...le-thread-count-default-for-bootstr.patch} | 6 +- ...Use-EntityTypes-for-living-entities.patch} | 84 +-- ...id-item-for-enchantment-checks-on-b.patch} | 6 +- ...=> 0392-Optimize-World-Time-Updates.patch} | 6 +- ...tore-custom-InventoryHolder-support.patch} | 6 +- ...=> 0394-Use-Vanilla-Minecart-Speeds.patch} | 6 +- ...0395-Fix-SpongeAbsortEvent-handling.patch} | 8 +- ...-allow-digging-into-unloaded-chunks.patch} | 6 +- ...=> 0397-Optimize-redstone-algorithm.patch} | 12 +- ...ntity-dismount-during-teleportation.patch} | 14 +- ...mits.patch => 0399-Book-Size-Limits.patch} | 8 +- ...ult-permission-message-configurable.patch} | 8 +- ...I.patch => 0401-Add-more-Zombie-API.patch} | 8 +- ...t-which-we-ll-consider-an-attackabl.patch} | 6 +- ...revent-rayTrace-from-loading-chunks.patch} | 6 +- ...-Large-Packets-disconnecting-client.patch} | 14 +- ...world-storage-in-CraftOfflinePlayer.patch} | 6 +- ...0406-Add-PlayerConnectionCloseEvent.patch} | 8 +- ...revent-Enderman-from-loading-chunks.patch} | 6 +- ...replace-OfflinePlayer-getLastPlayed.patch} | 12 +- ...tch => 0409-Fix-PlayerEditBookEvent.patch} | 6 +- ...ehicle-tracking-issue-on-disconnect.patch} | 8 +- ...nRetractEvent-for-all-empty-pistons.patch} | 6 +- ...remove-from-being-called-on-Players.patch} | 6 +- ...13-Allow-Saving-of-Oversized-Chunks.patch} | 10 +- ...ent.patch => 0414-BlockDestroyEvent.patch} | 6 +- ...m-Shapeless-Custom-Crafting-Recipes.patch} | 6 +- ...h => 0416-Fix-sign-edit-memory-leak.patch} | 8 +- ... 0417-Limit-Client-Sign-length-more.patch} | 6 +- ...onvertSigns-boolean-every-sign-save.patch} | 6 +- ...Signs-in-Chunks-creating-too-large-.patch} | 10 +- ...-Fix-Whitelist-On-Off-inconsistency.patch} | 8 +- ...t-tick-at-start-of-drowning-process.patch} | 6 +- ...ggleEvent-when-whitelist-is-toggled.patch} | 6 +- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 261 files changed, 3224 insertions(+), 2923 deletions(-) delete mode 100644 Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch rename Spigot-API-Patches/{0111-PlayerReadyArrowEvent.patch => 0110-PlayerReadyArrowEvent.patch} (89%) rename Spigot-API-Patches/{0112-Add-EntityKnockbackByEntityEvent.patch => 0111-Add-EntityKnockbackByEntityEvent.patch} (82%) rename Spigot-API-Patches/{0113-Expand-Explosions-API.patch => 0112-Expand-Explosions-API.patch} (80%) rename Spigot-API-Patches/{0114-ItemStack-API-additions-for-quantity-flags-lore.patch => 0113-ItemStack-API-additions-for-quantity-flags-lore.patch} (87%) rename Spigot-API-Patches/{0115-LivingEntity-Hand-Raised-Item-Use-API.patch => 0114-LivingEntity-Hand-Raised-Item-Use-API.patch} (90%) rename Spigot-API-Patches/{0116-RangedEntity-API.patch => 0115-RangedEntity-API.patch} (87%) rename Spigot-API-Patches/{0117-Add-World.getEntity-UUID-API.patch => 0116-Add-World.getEntity-UUID-API.patch} (65%) rename Spigot-API-Patches/{0118-InventoryCloseEvent-Reason-API.patch => 0117-InventoryCloseEvent-Reason-API.patch} (80%) rename Spigot-API-Patches/{0119-Entity-getChunk-API.patch => 0118-Entity-getChunk-API.patch} (79%) rename Spigot-API-Patches/{0121-Add-an-asterisk-to-legacy-API-plugins.patch => 0119-Add-an-asterisk-to-legacy-API-plugins.patch} (90%) rename Spigot-API-Patches/{0122-EnderDragon-Events.patch => 0120-EnderDragon-Events.patch} (81%) delete mode 100644 Spigot-API-Patches/0120-Vex-getSummoner-API.patch rename Spigot-API-Patches/{0123-PlayerLaunchProjectileEvent.patch => 0121-PlayerLaunchProjectileEvent.patch} (83%) rename Spigot-API-Patches/{0124-PlayerElytraBoostEvent.patch => 0122-PlayerElytraBoostEvent.patch} (84%) rename Spigot-API-Patches/{0125-EntityTransformedEvent.patch => 0123-EntityTransformedEvent.patch} (96%) rename Spigot-API-Patches/{0126-Allow-disabling-armour-stand-ticking.patch => 0124-Allow-disabling-armour-stand-ticking.patch} (85%) rename Spigot-API-Patches/{0127-SkeletonHorse-Additions.patch => 0125-SkeletonHorse-Additions.patch} (87%) rename Spigot-API-Patches/{0128-Expand-Location-Manipulation-API.patch => 0126-Expand-Location-Manipulation-API.patch} (84%) rename Spigot-API-Patches/{0129-Expand-ArmorStand-API.patch => 0127-Expand-ArmorStand-API.patch} (78%) rename Spigot-API-Patches/{0130-AnvilDamageEvent.patch => 0128-AnvilDamageEvent.patch} (85%) rename Spigot-API-Patches/{0131-Remove-deadlock-risk-in-firing-async-events.patch => 0129-Remove-deadlock-risk-in-firing-async-events.patch} (78%) rename Spigot-API-Patches/{0132-Add-hand-to-bucket-events.patch => 0130-Add-hand-to-bucket-events.patch} (67%) rename Spigot-API-Patches/{0133-Add-TNTPrimeEvent.patch => 0131-Add-TNTPrimeEvent.patch} (88%) rename Spigot-API-Patches/{0134-Provide-Chunk-Coordinates-as-a-Long-API.patch => 0132-Provide-Chunk-Coordinates-as-a-Long-API.patch} (84%) rename Spigot-API-Patches/{0135-Async-Chunks-API.patch => 0133-Async-Chunks-API.patch} (90%) rename Spigot-API-Patches/{0136-Make-EnderDragon-extend-Mob.patch => 0134-Make-EnderDragon-extend-Mob.patch} (79%) rename Spigot-API-Patches/{0137-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch => 0135-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch} (82%) rename Spigot-API-Patches/{0138-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch => 0136-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch} (85%) rename Spigot-API-Patches/{0139-Allow-Blocks-to-be-accessed-via-a-long-key.patch => 0137-Allow-Blocks-to-be-accessed-via-a-long-key.patch} (84%) rename Spigot-API-Patches/{0140-Slime-Pathfinder-Events.patch => 0138-Slime-Pathfinder-Events.patch} (85%) rename Spigot-API-Patches/{0141-isChunkGenerated-API.patch => 0139-isChunkGenerated-API.patch} (77%) rename Spigot-API-Patches/{0142-Add-More-Creeper-API.patch => 0140-Add-More-Creeper-API.patch} (89%) rename Spigot-API-Patches/{0143-Add-PhantomPreSpawnEvent.patch => 0141-Add-PhantomPreSpawnEvent.patch} (70%) rename Spigot-API-Patches/{0144-Add-source-block-to-BlockPhysicsEvent.patch => 0142-Add-source-block-to-BlockPhysicsEvent.patch} (77%) rename Spigot-API-Patches/{0145-Inventory-removeItemAnySlot.patch => 0143-Inventory-removeItemAnySlot.patch} (78%) rename Spigot-API-Patches/{0146-Add-ray-tracing-methods-to-LivingEntity.patch => 0144-Add-ray-tracing-methods-to-LivingEntity.patch} (84%) rename Spigot-API-Patches/{0148-Improve-death-events.patch => 0145-Improve-death-events.patch} (87%) rename Spigot-API-Patches/{0149-Mob-Pathfinding-API.patch => 0146-Mob-Pathfinding-API.patch} (86%) rename Spigot-API-Patches/{0150-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch => 0147-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch} (89%) delete mode 100644 Spigot-API-Patches/0147-Expose-attack-cooldown-methods-for-Player.patch rename Spigot-API-Patches/{0151-Performance-Concurrency-Improvements-to-Permissions.patch => 0148-Performance-Concurrency-Improvements-to-Permissions.patch} (65%) rename Spigot-API-Patches/{0152-Add-ItemStackRecipeChoice-Draft-API.patch => 0149-Add-ItemStackRecipeChoice-Draft-API.patch} (95%) rename Spigot-API-Patches/{0153-Implement-furnace-cook-speed-multiplier-API.patch => 0150-Implement-furnace-cook-speed-multiplier-API.patch} (86%) rename Spigot-API-Patches/{0154-PreSpawnerSpawnEvent.patch => 0151-PreSpawnerSpawnEvent.patch} (80%) rename Spigot-API-Patches/{0155-Remove-Precondition-on-name-for-AttributeModifier.patch => 0152-Remove-Precondition-on-name-for-AttributeModifier.patch} (74%) rename Spigot-API-Patches/{0156-Material-API-additions.patch => 0153-Material-API-additions.patch} (81%) rename Spigot-API-Patches/{0157-Add-Material-Tags.patch => 0154-Add-Material-Tags.patch} (89%) rename Spigot-API-Patches/{0158-Allow-setting-the-vex-s-summoner.patch => 0155-Allow-setting-the-vex-s-summoner.patch} (62%) rename Spigot-API-Patches/{0159-Add-LivingEntity-getTargetEntity.patch => 0156-Add-LivingEntity-getTargetEntity.patch} (86%) rename Spigot-API-Patches/{0160-Add-sun-related-API.patch => 0157-Add-sun-related-API.patch} (77%) rename Spigot-API-Patches/{0161-Here-s-Johnny.patch => 0158-Here-s-Johnny.patch} (93%) rename Spigot-API-Patches/{0162-Turtle-API.patch => 0159-Turtle-API.patch} (86%) rename Spigot-API-Patches/{0163-Implement-getters-and-setters-for-EntityItem-owner-a.patch => 0160-Implement-getters-and-setters-for-EntityItem-owner-a.patch} (80%) rename Spigot-API-Patches/{0164-Add-spectator-target-events.patch => 0161-Add-spectator-target-events.patch} (83%) rename Spigot-API-Patches/{0165-Add-more-Witch-API.patch => 0162-Add-more-Witch-API.patch} (86%) rename Spigot-API-Patches/{0166-Make-the-default-permission-message-configurable.patch => 0163-Make-the-default-permission-message-configurable.patch} (84%) rename Spigot-API-Patches/{0167-Support-cancellation-supression-of-EntityDismount-Ve.patch => 0164-Support-cancellation-supression-of-EntityDismount-Ve.patch} (77%) rename Spigot-API-Patches/{0168-Add-more-Zombie-API.patch => 0165-Add-more-Zombie-API.patch} (90%) rename Spigot-API-Patches/{0169-Change-the-reserved-channel-check-to-be-sensible.patch => 0166-Change-the-reserved-channel-check-to-be-sensible.patch} (82%) rename Spigot-API-Patches/{0170-Add-PlayerConnectionCloseEvent.patch => 0167-Add-PlayerConnectionCloseEvent.patch} (89%) rename Spigot-API-Patches/{0171-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch => 0168-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch} (90%) rename Spigot-API-Patches/{0172-BlockDestroyEvent.patch => 0169-BlockDestroyEvent.patch} (90%) rename Spigot-API-Patches/{0173-Add-ItemStack-Recipe-API-helper-methods.patch => 0170-Add-ItemStack-Recipe-API-helper-methods.patch} (68%) rename Spigot-API-Patches/{0174-Add-WhitelistToggleEvent.patch => 0171-Add-WhitelistToggleEvent.patch} (87%) create mode 100644 Spigot-API-Patches/0172-Annotation-Test-changes.patch rename Spigot-Server-Patches/{0345-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch => 0344-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch} (93%) delete mode 100644 Spigot-Server-Patches/0344-fix-newlines-in-spigot-tab-list-API.patch rename Spigot-Server-Patches/{0346-Add-ray-tracing-methods-to-LivingEntity.patch => 0345-Add-ray-tracing-methods-to-LivingEntity.patch} (97%) rename Spigot-Server-Patches/{0347-Expose-attack-cooldown-methods-for-Player.patch => 0346-Expose-attack-cooldown-methods-for-Player.patch} (90%) rename Spigot-Server-Patches/{0348-Improve-death-events.patch => 0347-Improve-death-events.patch} (98%) rename Spigot-Server-Patches/{0349-Allow-chests-to-be-placed-with-NBT-data.patch => 0348-Allow-chests-to-be-placed-with-NBT-data.patch} (92%) rename Spigot-Server-Patches/{0350-Mob-Pathfinding-API.patch => 0349-Mob-Pathfinding-API.patch} (97%) rename Spigot-Server-Patches/{0351-Prevent-chunk-loading-from-Fluid-Flowing.patch => 0350-Prevent-chunk-loading-from-Fluid-Flowing.patch} (97%) rename Spigot-Server-Patches/{0352-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch => 0351-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch} (99%) rename Spigot-Server-Patches/{0353-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch => 0352-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch} (96%) rename Spigot-Server-Patches/{0354-Prevent-mob-spawning-from-loading-generating-chunks.patch => 0353-Prevent-mob-spawning-from-loading-generating-chunks.patch} (95%) rename Spigot-Server-Patches/{0355-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch => 0354-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch} (95%) rename Spigot-Server-Patches/{0356-Optimize-and-Fix-ExpiringMap-Issues.patch => 0355-Optimize-and-Fix-ExpiringMap-Issues.patch} (98%) rename Spigot-Server-Patches/{0357-Implement-furnace-cook-speed-multiplier-API.patch => 0356-Implement-furnace-cook-speed-multiplier-API.patch} (96%) rename Spigot-Server-Patches/{0358-Support-Overriding-World-Seeds.patch => 0357-Support-Overriding-World-Seeds.patch} (96%) rename Spigot-Server-Patches/{0359-Optimize-Server-World-Map.patch => 0358-Optimize-Server-World-Map.patch} (98%) rename Spigot-Server-Patches/{0360-PreSpawnerSpawnEvent.patch => 0359-PreSpawnerSpawnEvent.patch} (93%) rename Spigot-Server-Patches/{0361-Catch-JsonParseException-in-Entity-and-TE-names.patch => 0360-Catch-JsonParseException-in-Entity-and-TE-names.patch} (95%) rename Spigot-Server-Patches/{0362-Avoid-dimension-id-collisions.patch => 0361-Avoid-dimension-id-collisions.patch} (90%) rename Spigot-Server-Patches/{0363-Honor-EntityAgeable.ageLock.patch => 0362-Honor-EntityAgeable.ageLock.patch} (85%) rename Spigot-Server-Patches/{0364-Async-Chunk-Loading-and-Generation.patch => 0363-Async-Chunk-Loading-and-Generation.patch} (99%) rename Spigot-Server-Patches/{0365-Ignore-Dimension-NBT-field-in-Entity-data.patch => 0364-Ignore-Dimension-NBT-field-in-Entity-data.patch} (92%) rename Spigot-Server-Patches/{0366-Optimize-Light-Recalculations.patch => 0365-Optimize-Light-Recalculations.patch} (95%) rename Spigot-Server-Patches/{0367-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch => 0366-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch} (94%) rename Spigot-Server-Patches/{0368-Don-t-recheck-type-after-setting-a-block.patch => 0367-Don-t-recheck-type-after-setting-a-block.patch} (92%) rename Spigot-Server-Patches/{0369-Fix-Sending-Chunks-to-Client.patch => 0368-Fix-Sending-Chunks-to-Client.patch} (94%) rename Spigot-Server-Patches/{0370-Configurable-connection-throttle-kick-message.patch => 0369-Configurable-connection-throttle-kick-message.patch} (94%) rename Spigot-Server-Patches/{0371-Fix-FileIOThread-concurrency-issues.patch => 0370-Fix-FileIOThread-concurrency-issues.patch} (93%) rename Spigot-Server-Patches/{0372-Hook-into-CB-plugin-rewrites.patch => 0371-Hook-into-CB-plugin-rewrites.patch} (98%) rename Spigot-Server-Patches/{0373-Allow-setting-the-vex-s-summoner.patch => 0372-Allow-setting-the-vex-s-summoner.patch} (90%) rename Spigot-Server-Patches/{0374-Add-LivingEntity-getTargetEntity.patch => 0373-Add-LivingEntity-getTargetEntity.patch} (97%) rename Spigot-Server-Patches/{0375-Add-sun-related-API.patch => 0374-Add-sun-related-API.patch} (91%) rename Spigot-Server-Patches/{0376-Check-Drowned-for-Villager-Aggression-Config.patch => 0375-Check-Drowned-for-Villager-Aggression-Config.patch} (92%) rename Spigot-Server-Patches/{0377-Here-s-Johnny.patch => 0376-Here-s-Johnny.patch} (91%) rename Spigot-Server-Patches/{0378-Turtle-API.patch => 0377-Turtle-API.patch} (97%) rename Spigot-Server-Patches/{0379-Limit-lightning-strike-effect-distance.patch => 0378-Limit-lightning-strike-effect-distance.patch} (96%) rename Spigot-Server-Patches/{0380-Implement-getters-and-setters-for-EntityItem-owner-a.patch => 0379-Implement-getters-and-setters-for-EntityItem-owner-a.patch} (94%) rename Spigot-Server-Patches/{0381-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch => 0380-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch} (94%) rename Spigot-Server-Patches/{0382-Call-player-spectator-target-events.patch => 0381-Call-player-spectator-target-events.patch} (94%) rename Spigot-Server-Patches/{0383-Add-Velocity-IP-Forwarding-Support.patch => 0382-Add-Velocity-IP-Forwarding-Support.patch} (97%) rename Spigot-Server-Patches/{0384-Add-more-Witch-API.patch => 0383-Add-more-Witch-API.patch} (98%) rename Spigot-Server-Patches/{0385-Fix-MC-93764.patch => 0384-Fix-MC-93764.patch} (85%) rename Spigot-Server-Patches/{0386-Add-option-to-prevent-players-from-moving-into-unloa.patch => 0385-Add-option-to-prevent-players-from-moving-into-unloa.patch} (97%) rename Spigot-Server-Patches/{0387-Reset-players-airTicks-on-respawn.patch => 0386-Reset-players-airTicks-on-respawn.patch} (84%) rename Spigot-Server-Patches/{0388-Strip-private-area-unicode-characters-from-signs.patch => 0387-Strip-private-area-unicode-characters-from-signs.patch} (97%) rename Spigot-Server-Patches/{0389-Don-t-sleep-after-profile-lookups-if-not-needed.patch => 0388-Don-t-sleep-after-profile-lookups-if-not-needed.patch} (93%) rename Spigot-Server-Patches/{0390-Use-more-reasonable-thread-count-default-for-bootstr.patch => 0389-Use-more-reasonable-thread-count-default-for-bootstr.patch} (91%) rename Spigot-Server-Patches/{0391-Use-EntityTypes-for-living-entities.patch => 0390-Use-EntityTypes-for-living-entities.patch} (97%) rename Spigot-Server-Patches/{0392-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch => 0391-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch} (94%) rename Spigot-Server-Patches/{0393-Optimize-World-Time-Updates.patch => 0392-Optimize-World-Time-Updates.patch} (96%) rename Spigot-Server-Patches/{0394-Restore-custom-InventoryHolder-support.patch => 0393-Restore-custom-InventoryHolder-support.patch} (94%) rename Spigot-Server-Patches/{0395-Use-Vanilla-Minecart-Speeds.patch => 0394-Use-Vanilla-Minecart-Speeds.patch} (91%) rename Spigot-Server-Patches/{0396-Fix-SpongeAbsortEvent-handling.patch => 0395-Fix-SpongeAbsortEvent-handling.patch} (93%) rename Spigot-Server-Patches/{0397-Don-t-allow-digging-into-unloaded-chunks.patch => 0396-Don-t-allow-digging-into-unloaded-chunks.patch} (91%) rename Spigot-Server-Patches/{0398-Optimize-redstone-algorithm.patch => 0397-Optimize-redstone-algorithm.patch} (99%) rename Spigot-Server-Patches/{0399-force-entity-dismount-during-teleportation.patch => 0398-force-entity-dismount-during-teleportation.patch} (95%) rename Spigot-Server-Patches/{0400-Book-Size-Limits.patch => 0399-Book-Size-Limits.patch} (96%) rename Spigot-Server-Patches/{0401-Make-the-default-permission-message-configurable.patch => 0400-Make-the-default-permission-message-configurable.patch} (94%) rename Spigot-Server-Patches/{0402-Add-more-Zombie-API.patch => 0401-Add-more-Zombie-API.patch} (97%) rename Spigot-Server-Patches/{0403-limit-the-range-at-which-we-ll-consider-an-attackabl.patch => 0402-limit-the-range-at-which-we-ll-consider-an-attackabl.patch} (94%) rename Spigot-Server-Patches/{0404-Prevent-rayTrace-from-loading-chunks.patch => 0403-Prevent-rayTrace-from-loading-chunks.patch} (94%) rename Spigot-Server-Patches/{0405-Handle-Large-Packets-disconnecting-client.patch => 0404-Handle-Large-Packets-disconnecting-client.patch} (95%) rename Spigot-Server-Patches/{0406-Lazy-init-world-storage-in-CraftOfflinePlayer.patch => 0405-Lazy-init-world-storage-in-CraftOfflinePlayer.patch} (96%) rename Spigot-Server-Patches/{0407-Add-PlayerConnectionCloseEvent.patch => 0406-Add-PlayerConnectionCloseEvent.patch} (97%) rename Spigot-Server-Patches/{0408-Prevent-Enderman-from-loading-chunks.patch => 0407-Prevent-Enderman-from-loading-chunks.patch} (95%) rename Spigot-Server-Patches/{0409-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch => 0408-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch} (96%) rename Spigot-Server-Patches/{0410-Fix-PlayerEditBookEvent.patch => 0409-Fix-PlayerEditBookEvent.patch} (94%) rename Spigot-Server-Patches/{0411-Workaround-for-vehicle-tracking-issue-on-disconnect.patch => 0410-Workaround-for-vehicle-tracking-issue-on-disconnect.patch} (83%) rename Spigot-Server-Patches/{0412-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch => 0411-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch} (96%) rename Spigot-Server-Patches/{0413-Block-Entity-remove-from-being-called-on-Players.patch => 0412-Block-Entity-remove-from-being-called-on-Players.patch} (92%) rename Spigot-Server-Patches/{0414-Allow-Saving-of-Oversized-Chunks.patch => 0413-Allow-Saving-of-Oversized-Chunks.patch} (99%) rename Spigot-Server-Patches/{0415-BlockDestroyEvent.patch => 0414-BlockDestroyEvent.patch} (95%) rename Spigot-Server-Patches/{0416-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch => 0415-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch} (96%) rename Spigot-Server-Patches/{0417-Fix-sign-edit-memory-leak.patch => 0416-Fix-sign-edit-memory-leak.patch} (94%) rename Spigot-Server-Patches/{0418-Limit-Client-Sign-length-more.patch => 0417-Limit-Client-Sign-length-more.patch} (96%) rename Spigot-Server-Patches/{0419-Don-t-check-ConvertSigns-boolean-every-sign-save.patch => 0418-Don-t-check-ConvertSigns-boolean-every-sign-save.patch} (92%) rename Spigot-Server-Patches/{0420-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch => 0419-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch} (95%) rename Spigot-Server-Patches/{0421-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch => 0420-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch} (95%) rename Spigot-Server-Patches/{0422-Set-Zombie-last-tick-at-start-of-drowning-process.patch => 0421-Set-Zombie-last-tick-at-start-of-drowning-process.patch} (88%) rename Spigot-Server-Patches/{0423-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch => 0422-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch} (86%) diff --git a/Spigot-API-Patches/0001-POM-changes.patch b/Spigot-API-Patches/0001-POM-changes.patch index 97480147b5..d5a93f9783 100644 --- a/Spigot-API-Patches/0001-POM-changes.patch +++ b/Spigot-API-Patches/0001-POM-changes.patch @@ -1,11 +1,11 @@ -From 02d5007d081bde67f58dac3e04ce1df9e70ff9b4 Mon Sep 17 00:00:00 2001 +From 16f2fa8f86ea4272386830faf08c84cde635a753 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 1 Mar 2016 00:16:08 +0100 Subject: [PATCH] POM changes diff --git a/pom.xml b/pom.xml -index 23fde9622..a613cf963 100644 +index b3369ecf..c2ec40c7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,33 +3,28 @@ @@ -80,7 +80,7 @@ index 23fde9622..a613cf963 100644 com.google.guava -@@ -107,15 +113,12 @@ +@@ -119,15 +125,12 @@ @@ -97,7 +97,7 @@ index 23fde9622..a613cf963 100644 -@@ -150,6 +153,7 @@ +@@ -162,6 +165,7 @@ @@ -106,5 +106,5 @@ index 23fde9622..a613cf963 100644 true -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0003-Paper-Utils.patch b/Spigot-API-Patches/0003-Paper-Utils.patch index 661b5e6a6b..e9421fd60f 100644 --- a/Spigot-API-Patches/0003-Paper-Utils.patch +++ b/Spigot-API-Patches/0003-Paper-Utils.patch @@ -1,4 +1,4 @@ -From d7927f758fcbaeb1c2bf4fa4debed90eb6f04991 Mon Sep 17 00:00:00 2001 +From e7c9d3dadf38b1314ad78cce03635eec74035855 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 23 Feb 2019 11:26:21 -0500 Subject: [PATCH] Paper Utils @@ -6,24 +6,26 @@ Subject: [PATCH] Paper Utils diff --git a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java new file mode 100644 -index 00000000..e5850967 +index 000000000..9db0056ab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java -@@ -0,0 +1,14 @@ +@@ -0,0 +1,16 @@ +package com.destroystokyo.paper.util; + ++import org.jetbrains.annotations.NotNull; ++ +public class SneakyThrow { + -+ public static void sneaky(Throwable exception) { ++ public static void sneaky(@NotNull Throwable exception) { + SneakyThrow.throwSneaky(exception); + } + + @SuppressWarnings("unchecked") -+ private static void throwSneaky(Throwable exception) throws T { ++ private static void throwSneaky(@NotNull Throwable exception) throws T { + throw (T) exception; + } + +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0004-Timings-v2.patch b/Spigot-API-Patches/0004-Timings-v2.patch index 390da8d72c..41039f4be0 100644 --- a/Spigot-API-Patches/0004-Timings-v2.patch +++ b/Spigot-API-Patches/0004-Timings-v2.patch @@ -1,4 +1,4 @@ -From 2853582c3382e794163a9c8a02e139eac9a8ea8e Mon Sep 17 00:00:00 2001 +From d207bdace7d156b6b41a793c67dc8c457f397ab7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 18:48:17 -0600 Subject: [PATCH] Timings v2 @@ -6,14 +6,16 @@ Subject: [PATCH] Timings v2 diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java new file mode 100644 -index 00000000..98079dc0 +index 000000000..f6d616732 --- /dev/null +++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java -@@ -0,0 +1,82 @@ +@@ -0,0 +1,85 @@ +package co.aikar.timings; + +import static co.aikar.timings.TimingsManager.*; + ++import org.jetbrains.annotations.NotNull; ++ +public class FullServerTickHandler extends TimingHandler { + private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null); + final TimingData minuteData; @@ -26,6 +28,7 @@ index 00000000..98079dc0 + TIMING_MAP.put(IDENTITY, this); + } + ++ @NotNull + @Override + public Timing startTiming() { + if (TimingsManager.needsFullReset) { @@ -94,10 +97,10 @@ index 00000000..98079dc0 +} diff --git a/src/main/java/co/aikar/timings/NullTimingHandler.java b/src/main/java/co/aikar/timings/NullTimingHandler.java new file mode 100644 -index 00000000..8c43e206 +index 000000000..8e0cd40e8 --- /dev/null +++ b/src/main/java/co/aikar/timings/NullTimingHandler.java -@@ -0,0 +1,61 @@ +@@ -0,0 +1,67 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -123,7 +126,11 @@ index 00000000..8c43e206 + */ +package co.aikar.timings; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ +public final class NullTimingHandler implements Timing { ++ @NotNull + @Override + public Timing startTiming() { + return this; @@ -134,6 +141,7 @@ index 00000000..8c43e206 + + } + ++ @NotNull + @Override + public Timing startTimingIfSync() { + return this; @@ -149,6 +157,7 @@ index 00000000..8c43e206 + + } + ++ @Nullable + @Override + public TimingHandler getTimingHandler() { + return null; @@ -161,10 +170,10 @@ index 00000000..8c43e206 +} diff --git a/src/main/java/co/aikar/timings/TimedEventExecutor.java b/src/main/java/co/aikar/timings/TimedEventExecutor.java new file mode 100644 -index 00000000..feddcdbd +index 000000000..68f7866e1 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java -@@ -0,0 +1,81 @@ +@@ -0,0 +1,83 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -198,6 +207,8 @@ index 00000000..feddcdbd +import org.bukkit.plugin.Plugin; + +import java.lang.reflect.Method; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class TimedEventExecutor implements EventExecutor { + @@ -212,7 +223,7 @@ index 00000000..feddcdbd + * @param method EventHandler method + * @param eventClass Owning class + */ -+ public TimedEventExecutor(EventExecutor executor, Plugin plugin, Method method, Class eventClass) { ++ public TimedEventExecutor(@NotNull EventExecutor executor, @NotNull Plugin plugin, @Nullable Method method, @NotNull Class eventClass) { + this.executor = executor; + String id; + @@ -236,7 +247,7 @@ index 00000000..feddcdbd + } + + @Override -+ public void execute(Listener listener, Event event) throws EventException { ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { + if (event.isAsynchronous() || !Timings.timingsEnabled || !Bukkit.isPrimaryThread()) { + executor.execute(listener, event); + return; @@ -248,10 +259,10 @@ index 00000000..feddcdbd +} diff --git a/src/main/java/co/aikar/timings/Timing.java b/src/main/java/co/aikar/timings/Timing.java new file mode 100644 -index 00000000..b2260104 +index 000000000..a562796ce --- /dev/null +++ b/src/main/java/co/aikar/timings/Timing.java -@@ -0,0 +1,76 @@ +@@ -0,0 +1,82 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -277,6 +288,9 @@ index 00000000..b2260104 + */ +package co.aikar.timings; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ +/** + * Provides an ability to time sections of code within the Minecraft Server + */ @@ -286,6 +300,7 @@ index 00000000..b2260104 + * + * @return Timing + */ ++ @NotNull + Timing startTiming(); + + /** @@ -302,6 +317,7 @@ index 00000000..b2260104 + * + * @return Timing + */ ++ @NotNull + Timing startTimingIfSync(); + + /** @@ -323,6 +339,7 @@ index 00000000..b2260104 + * + * @return TimingHandler + */ ++ @Nullable + TimingHandler getTimingHandler(); + + @Override @@ -330,10 +347,10 @@ index 00000000..b2260104 +} diff --git a/src/main/java/co/aikar/timings/TimingData.java b/src/main/java/co/aikar/timings/TimingData.java new file mode 100644 -index 00000000..f222d6b7 +index 000000000..a5d13a1e4 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingData.java -@@ -0,0 +1,120 @@ +@@ -0,0 +1,122 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -360,6 +377,7 @@ index 00000000..f222d6b7 +package co.aikar.timings; + +import java.util.List; ++import org.jetbrains.annotations.NotNull; + +import static co.aikar.util.JSONUtil.toArray; + @@ -418,6 +436,7 @@ index 00000000..f222d6b7 + return new TimingData(this); + } + ++ @NotNull + List export() { + List list = toArray( + id, @@ -456,7 +475,7 @@ index 00000000..f222d6b7 +} diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java new file mode 100644 -index 00000000..521c985e +index 000000000..6bf8cb688 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHandler.java @@ -0,0 +1,200 @@ @@ -487,10 +506,9 @@ index 00000000..521c985e + +import co.aikar.util.LoadingIntMap; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; -+import org.bukkit.Bukkit; -+ +import java.util.concurrent.atomic.AtomicInteger; -+import java.util.logging.Level; ++import org.bukkit.Bukkit; ++import org.jetbrains.annotations.NotNull; + +class TimingHandler implements Timing { + @@ -512,7 +530,7 @@ index 00000000..521c985e + private boolean enabled; + private TimingHandler parent; + -+ TimingHandler(TimingIdentifier id) { ++ TimingHandler(@NotNull TimingIdentifier id) { + if (id.name.startsWith("##")) { + verbose = true; + this.name = id.name.substring(3); @@ -545,6 +563,7 @@ index 00000000..521c985e + } + } + ++ @NotNull + @Override + public Timing startTimingIfSync() { + startTiming(); @@ -556,6 +575,7 @@ index 00000000..521c985e + stopTiming(); + } + ++ @NotNull + public Timing startTiming() { + if (enabled && Bukkit.isPrimaryThread() && ++timingDepth == 1) { + start = System.nanoTime(); @@ -600,8 +620,6 @@ index 00000000..521c985e + + /** + * Reset this timer, setting all values to zero. -+ * -+ * @param full + */ + void reset(boolean full) { + record.reset(); @@ -615,6 +633,7 @@ index 00000000..521c985e + checkEnabled(); + } + ++ @NotNull + @Override + public TimingHandler getTimingHandler() { + return this; @@ -631,8 +650,7 @@ index 00000000..521c985e + } + + /** -+ * This is simply for the Closeable interface so it can be used with -+ * try-with-resources () ++ * This is simply for the Closeable interface so it can be used with try-with-resources () + */ + @Override + public void close() { @@ -651,6 +669,7 @@ index 00000000..521c985e + return enabled; + } + ++ @NotNull + TimingData[] cloneChildren() { + final TimingData[] clonedChildren = new TimingData[children.size()]; + int i = 0; @@ -662,10 +681,10 @@ index 00000000..521c985e +} diff --git a/src/main/java/co/aikar/timings/TimingHistory.java b/src/main/java/co/aikar/timings/TimingHistory.java new file mode 100644 -index 00000000..e08a25f5 +index 000000000..8726bb9a2 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistory.java -@@ -0,0 +1,345 @@ +@@ -0,0 +1,357 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -711,6 +730,8 @@ index 00000000..e08a25f5 +import java.util.List; +import java.util.Map; +import java.util.Set; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +import static co.aikar.timings.TimingsManager.FULL_SERVER_TICK; +import static co.aikar.timings.TimingsManager.MINUTE_REPORTS; @@ -726,8 +747,9 @@ index 00000000..e08a25f5 + public static long activatedEntityTicks; + private static int worldIdPool = 1; + static Map worldMap = LoadingMap.newHashMap(new Function() { ++ @NotNull + @Override -+ public Integer apply(String input) { ++ public Integer apply(@Nullable String input) { + return worldIdPool++; + } + }); @@ -770,6 +792,7 @@ index 00000000..e08a25f5 + // Information about all loaded chunks/entities + //noinspection unchecked + this.worlds = toObjectMapper(Bukkit.getWorlds(), new Function() { ++ @NotNull + @Override + public JSONPair apply(World world) { + Map regions = LoadingMap.newHashMap(RegionData.LOADER); @@ -798,6 +821,7 @@ index 00000000..e08a25f5 + return pair( + worldMap.get(world.getName()), + toArrayMapper(regions.values(),new Function() { ++ @NotNull + @Override + public Object apply(RegionData input) { + return toArray( @@ -805,6 +829,7 @@ index 00000000..e08a25f5 + input.regionId.z, + toObjectMapper(input.entityCounts.entrySet(), + new Function, JSONPair>() { ++ @NotNull + @Override + public JSONPair apply(Map.Entry entry) { + entityTypeSet.add(entry.getKey()); @@ -817,6 +842,7 @@ index 00000000..e08a25f5 + ), + toObjectMapper(input.tileEntityCounts.entrySet(), + new Function, JSONPair>() { ++ @NotNull + @Override + public JSONPair apply(Map.Entry entry) { + tileEntityTypeSet.add(entry.getKey()); @@ -838,12 +864,13 @@ index 00000000..e08a25f5 + final RegionId regionId; + @SuppressWarnings("Guava") + static Function LOADER = new Function() { ++ @NotNull + @Override -+ public RegionData apply(RegionId id) { ++ public RegionData apply(@NotNull RegionId id) { + return new RegionData(id); + } + }; -+ RegionData(RegionId id) { ++ RegionData(@NotNull RegionId id) { + this.regionId = id; + } + @@ -914,6 +941,7 @@ index 00000000..e08a25f5 + activatedEntityTicks = 0; + } + ++ @NotNull + Object export() { + return createObject( + pair("s", startTime), @@ -922,6 +950,7 @@ index 00000000..e08a25f5 + pair("tm", totalTime), + pair("w", worlds), + pair("h", toArrayMapper(entries, new Function() { ++ @Nullable + @Override + public Object apply(TimingHistoryEntry entry) { + TimingData record = entry.data; @@ -932,6 +961,7 @@ index 00000000..e08a25f5 + } + })), + pair("mp", toArrayMapper(minuteReports, new Function() { ++ @NotNull + @Override + public Object apply(MinuteReport input) { + return input.export(); @@ -951,6 +981,7 @@ index 00000000..e08a25f5 + final double freeMemory = TimingsManager.FULL_SERVER_TICK.avgFreeMemory; + final double loadAvg = ManagementFactory.getOperatingSystemMXBean().getSystemLoadAverage(); + ++ @NotNull + List export() { + return toArray( + time, @@ -1013,10 +1044,10 @@ index 00000000..e08a25f5 +} diff --git a/src/main/java/co/aikar/timings/TimingHistoryEntry.java b/src/main/java/co/aikar/timings/TimingHistoryEntry.java new file mode 100644 -index 00000000..0e114eb3 +index 000000000..86d5ac6bd --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingHistoryEntry.java -@@ -0,0 +1,55 @@ +@@ -0,0 +1,58 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -1045,6 +1076,7 @@ index 00000000..0e114eb3 +import com.google.common.base.Function; + +import java.util.List; ++import org.jetbrains.annotations.NotNull; + +import static co.aikar.util.JSONUtil.toArrayMapper; + @@ -1052,16 +1084,18 @@ index 00000000..0e114eb3 + final TimingData data; + private final TimingData[] children; + -+ TimingHistoryEntry(TimingHandler handler) { ++ TimingHistoryEntry(@NotNull TimingHandler handler) { + this.data = handler.record.clone(); + children = handler.cloneChildren(); + } + ++ @NotNull + List export() { + List result = data.export(); + if (children.length > 0) { + result.add( + toArrayMapper(children, new Function() { ++ @NotNull + @Override + public Object apply(TimingData child) { + return child.export(); @@ -1074,10 +1108,10 @@ index 00000000..0e114eb3 +} diff --git a/src/main/java/co/aikar/timings/TimingIdentifier.java b/src/main/java/co/aikar/timings/TimingIdentifier.java new file mode 100644 -index 00000000..d3258a09 +index 000000000..4d140f344 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingIdentifier.java -@@ -0,0 +1,107 @@ +@@ -0,0 +1,111 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -1112,6 +1146,8 @@ index 00000000..d3258a09 +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicInteger; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + *

Used as a basis for fast HashMap key comparisons for the Timing Map.

@@ -1129,15 +1165,17 @@ index 00000000..d3258a09 + final TimingHandler groupHandler; + private final int hashCode; + -+ TimingIdentifier(String group, String name, Timing groupHandler) { ++ TimingIdentifier(@Nullable String group, @NotNull String name, @Nullable Timing groupHandler) { + this.group = group != null ? group: DEFAULT_GROUP.name; + this.name = name; + this.groupHandler = groupHandler != null ? groupHandler.getTimingHandler() : null; + this.hashCode = (31 * this.group.hashCode()) + this.name.hashCode(); + } + -+ static TimingGroup getGroup(String groupName) { ++ @NotNull ++ static TimingGroup getGroup(@Nullable String groupName) { + if (groupName == null) { ++ //noinspection ConstantConditions + return DEFAULT_GROUP; + } + @@ -1187,10 +1225,10 @@ index 00000000..d3258a09 +} diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java new file mode 100644 -index 00000000..f907649b +index 000000000..0b34e0d01 --- /dev/null +++ b/src/main/java/co/aikar/timings/Timings.java -@@ -0,0 +1,284 @@ +@@ -0,0 +1,293 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -1225,6 +1263,8 @@ index 00000000..f907649b + +import java.util.Queue; +import java.util.logging.Level; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +@SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"}) +public final class Timings { @@ -1245,7 +1285,8 @@ index 00000000..f907649b + * @param name Name of Timing + * @return Handler + */ -+ public static Timing of(Plugin plugin, String name) { ++ @NotNull ++ public static Timing of(@NotNull Plugin plugin, @NotNull String name) { + Timing pluginHandler = null; + if (plugin != null) { + pluginHandler = ofSafe(plugin.getName(), "Combined Total", TimingsManager.PLUGIN_GROUP_HANDLER); @@ -1265,7 +1306,8 @@ index 00000000..f907649b + * @param groupHandler Parent handler to mirror .start/stop calls to + * @return Timing Handler + */ -+ public static Timing of(Plugin plugin, String name, Timing groupHandler) { ++ @NotNull ++ public static Timing of(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) { + Preconditions.checkNotNull(plugin, "Plugin can not be null"); + return TimingsManager.getHandler(plugin.getName(), name, groupHandler); + } @@ -1281,7 +1323,8 @@ index 00000000..f907649b + * @param name Name of Timing + * @return Timing Handler + */ -+ public static Timing ofStart(Plugin plugin, String name) { ++ @NotNull ++ public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name) { + return ofStart(plugin, name, null); + } + @@ -1297,7 +1340,8 @@ index 00000000..f907649b + * @param groupHandler Parent handler to mirror .start/stop calls to + * @return Timing Handler + */ -+ public static Timing ofStart(Plugin plugin, String name, Timing groupHandler) { ++ @NotNull ++ public static Timing ofStart(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) { + Timing timing = of(plugin, name, groupHandler); + timing.startTiming(); + return timing; @@ -1431,7 +1475,7 @@ index 00000000..f907649b + * If sender is null, ConsoleCommandSender will be used. + * @param sender The sender to send to, or null to use the ConsoleCommandSender + */ -+ public static void generateReport(CommandSender sender) { ++ public static void generateReport(@Nullable CommandSender sender) { + if (sender == null) { + sender = Bukkit.getConsoleSender(); + } @@ -1443,7 +1487,7 @@ index 00000000..f907649b + * Use with {@link org.bukkit.command.BufferedCommandSender} to get full response when done! + * @param sender The listener to send responses too. + */ -+ public static void generateReport(TimingsReportListener sender) { ++ public static void generateReport(@NotNull TimingsReportListener sender) { + Validate.notNull(sender); + TimingsExport.requestingReport.add(sender); + } @@ -1454,12 +1498,13 @@ index 00000000..f907649b + These do not have isPrimaryThread() checks in the startTiming/stopTiming + ================= + */ -+ -+ static TimingHandler ofSafe(String name) { ++ @NotNull ++ static TimingHandler ofSafe(@NotNull String name) { + return ofSafe(null, name, null); + } + -+ static Timing ofSafe(Plugin plugin, String name) { ++ @NotNull ++ static Timing ofSafe(@Nullable Plugin plugin, @NotNull String name) { + Timing pluginHandler = null; + if (plugin != null) { + pluginHandler = ofSafe(plugin.getName(), "Combined Total", TimingsManager.PLUGIN_GROUP_HANDLER); @@ -1467,20 +1512,22 @@ index 00000000..f907649b + return ofSafe(plugin != null ? plugin.getName() : "Minecraft - Invalid Plugin", name, pluginHandler); + } + -+ static TimingHandler ofSafe(String name, Timing groupHandler) { ++ @NotNull ++ static TimingHandler ofSafe(@NotNull String name, @Nullable Timing groupHandler) { + return ofSafe(null, name, groupHandler); + } + -+ static TimingHandler ofSafe(String groupName, String name, Timing groupHandler) { ++ @NotNull ++ static TimingHandler ofSafe(@Nullable String groupName, @NotNull String name, @Nullable Timing groupHandler) { + return TimingsManager.getHandler(groupName, name, groupHandler); + } +} diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java new file mode 100644 -index 00000000..56b10e89 +index 000000000..c0d8f2016 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsCommand.java -@@ -0,0 +1,119 @@ +@@ -0,0 +1,122 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -1515,13 +1562,15 @@ index 00000000..56b10e89 + +import java.util.ArrayList; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + +public class TimingsCommand extends BukkitCommand { + private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste", "verbon", "verboff"); + private long lastResetAttempt = 0; + -+ public TimingsCommand(String name) { ++ public TimingsCommand(@NotNull String name) { + super(name); + this.description = "Manages Spigot Timings data to see performance of the server."; + this.usageMessage = "/timings "; @@ -1529,7 +1578,7 @@ index 00000000..56b10e89 + } + + @Override -+ public boolean execute(CommandSender sender, String currentAlias, String[] args) { ++ public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { + if (!testPermission(sender)) { + return true; + } @@ -1587,8 +1636,9 @@ index 00000000..56b10e89 + return true; + } + ++ @NotNull + @Override -+ public List tabComplete(CommandSender sender, String alias, String[] args) { ++ public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) { + Validate.notNull(sender, "Sender cannot be null"); + Validate.notNull(args, "Arguments cannot be null"); + Validate.notNull(alias, "Alias cannot be null"); @@ -1602,7 +1652,7 @@ index 00000000..56b10e89 +} diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java new file mode 100644 -index 00000000..4a69074a +index 000000000..4a69074a8 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -0,0 +1,350 @@ @@ -1958,10 +2008,10 @@ index 00000000..4a69074a +} diff --git a/src/main/java/co/aikar/timings/TimingsManager.java b/src/main/java/co/aikar/timings/TimingsManager.java new file mode 100644 -index 00000000..127651ff +index 000000000..0109065d3 --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsManager.java -@@ -0,0 +1,189 @@ +@@ -0,0 +1,193 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -1995,13 +2045,14 @@ index 00000000..127651ff +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.java.PluginClassLoader; + -+import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.logging.Level; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public final class TimingsManager { + static final Map TIMING_MAP = LoadingMap.of( @@ -2098,7 +2149,8 @@ index 00000000..127651ff + historyStart = System.currentTimeMillis(); + } + -+ static TimingHandler getHandler(String group, String name, Timing parent) { ++ @NotNull ++ static TimingHandler getHandler(@Nullable String group, @NotNull String name, @Nullable Timing parent) { + return TIMING_MAP.get(new TimingIdentifier(group, name, parent)); + } + @@ -2112,7 +2164,8 @@ index 00000000..127651ff + * @param command Command to get timings for + * @return TimingHandler + */ -+ public static Timing getCommandTiming(String pluginName, Command command) { ++ @NotNull ++ public static Timing getCommandTiming(@Nullable String pluginName, @NotNull Command command) { + Plugin plugin = null; + final Server server = Bukkit.getServer(); + if (!( server == null || pluginName == null || @@ -2139,6 +2192,7 @@ index 00000000..127651ff + * @param clazz Class to check + * @return Plugin if created by a plugin + */ ++ @Nullable + public static Plugin getPluginByClassloader(@Nullable Class clazz) { + if (clazz == null) { + return null; @@ -2153,10 +2207,10 @@ index 00000000..127651ff +} diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java new file mode 100644 -index 00000000..e7c389c0 +index 000000000..bf3e059fe --- /dev/null +++ b/src/main/java/co/aikar/timings/TimingsReportListener.java -@@ -0,0 +1,72 @@ +@@ -0,0 +1,75 @@ +package co.aikar.timings; + +import com.google.common.collect.Lists; @@ -2168,6 +2222,8 @@ index 00000000..e7c389c0 +import org.bukkit.command.RemoteConsoleCommandSender; + +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +@SuppressWarnings("WeakerAccess") +public class TimingsReportListener implements MessageCommandSender { @@ -2175,16 +2231,16 @@ index 00000000..e7c389c0 + private final Runnable onDone; + private String timingsURL; + -+ public TimingsReportListener(CommandSender senders) { ++ public TimingsReportListener(@NotNull CommandSender senders) { + this(senders, null); + } -+ public TimingsReportListener(CommandSender sender, Runnable onDone) { ++ public TimingsReportListener(@NotNull CommandSender sender, @Nullable Runnable onDone) { + this(Lists.newArrayList(sender), onDone); + } -+ public TimingsReportListener(List senders) { ++ public TimingsReportListener(@NotNull List senders) { + this(senders, null); + } -+ public TimingsReportListener(List senders, Runnable onDone) { ++ public TimingsReportListener(@NotNull List senders, @Nullable Runnable onDone) { + Validate.notNull(senders); + Validate.notEmpty(senders); + @@ -2192,6 +2248,7 @@ index 00000000..e7c389c0 + this.onDone = onDone; + } + ++ @Nullable + public String getTimingsURL() { + return timingsURL; + } @@ -2200,7 +2257,7 @@ index 00000000..e7c389c0 + done(null); + } + -+ public void done(String url) { ++ public void done(@Nullable String url) { + this.timingsURL = url; + if (onDone != null) { + onDone.run(); @@ -2213,7 +2270,7 @@ index 00000000..e7c389c0 + } + + @Override -+ public void sendMessage(String message) { ++ public void sendMessage(@NotNull String message) { + senders.forEach((sender) -> sender.sendMessage(message)); + } + @@ -2231,10 +2288,10 @@ index 00000000..e7c389c0 +} diff --git a/src/main/java/co/aikar/timings/UnsafeTimingHandler.java b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java new file mode 100644 -index 00000000..5edaba12 +index 000000000..632c49615 --- /dev/null +++ b/src/main/java/co/aikar/timings/UnsafeTimingHandler.java -@@ -0,0 +1,51 @@ +@@ -0,0 +1,53 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -2261,10 +2318,11 @@ index 00000000..5edaba12 +package co.aikar.timings; + +import org.bukkit.Bukkit; ++import org.jetbrains.annotations.NotNull; + +class UnsafeTimingHandler extends TimingHandler { + -+ UnsafeTimingHandler(TimingIdentifier id) { ++ UnsafeTimingHandler(@NotNull TimingIdentifier id) { + super(id); + } + @@ -2274,6 +2332,7 @@ index 00000000..5edaba12 + } + } + ++ @NotNull + @Override + public Timing startTiming() { + checkThread(); @@ -2288,40 +2347,43 @@ index 00000000..5edaba12 +} diff --git a/src/main/java/co/aikar/util/Counter.java b/src/main/java/co/aikar/util/Counter.java new file mode 100644 -index 00000000..23ac07f2 +index 000000000..80155072d --- /dev/null +++ b/src/main/java/co/aikar/util/Counter.java -@@ -0,0 +1,35 @@ +@@ -0,0 +1,38 @@ +package co.aikar.util; + +import com.google.common.collect.ForwardingMap; + +import java.util.HashMap; +import java.util.Map; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class Counter extends ForwardingMap { + private final Map counts = new HashMap<>(); + -+ public long decrement(T key) { ++ public long decrement(@Nullable T key) { + return increment(key, -1); + } -+ public long increment(T key) { ++ public long increment(@Nullable T key) { + return increment(key, 1); + } -+ public long decrement(T key, long amount) { ++ public long decrement(@Nullable T key, long amount) { + return decrement(key, -amount); + } -+ public long increment(T key, long amount) { ++ public long increment(@Nullable T key, long amount) { + Long count = this.getCount(key); + count += amount; + this.counts.put(key, count); + return count; + } + -+ public long getCount(T key) { ++ public long getCount(@Nullable T key) { + return this.counts.getOrDefault(key, 0L); + } + ++ @NotNull + @Override + protected Map delegate() { + return this.counts; @@ -2329,15 +2391,17 @@ index 00000000..23ac07f2 +} diff --git a/src/main/java/co/aikar/util/JSONUtil.java b/src/main/java/co/aikar/util/JSONUtil.java new file mode 100644 -index 00000000..96274975 +index 000000000..e43599b47 --- /dev/null +++ b/src/main/java/co/aikar/util/JSONUtil.java -@@ -0,0 +1,129 @@ +@@ -0,0 +1,140 @@ +package co.aikar.util; + +import com.google.common.base.Function; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; +import org.json.simple.JSONArray; +import org.json.simple.JSONObject; + @@ -2360,11 +2424,13 @@ index 00000000..96274975 + * @param obj Value to use + * @return JSONPair + */ -+ public static JSONPair pair(String key, Object obj) { ++ @NotNull ++ public static JSONPair pair(@NotNull String key, @Nullable Object obj) { + return new JSONPair(key, obj); + } + -+ public static JSONPair pair(long key, Object obj) { ++ @NotNull ++ public static JSONPair pair(long key, @Nullable Object obj) { + return new JSONPair(String.valueOf(key), obj); + } + @@ -2374,7 +2440,8 @@ index 00000000..96274975 + * @param data JSONPairs + * @return Map + */ -+ public static Map createObject(JSONPair... data) { ++ @NotNull ++ public static Map createObject(@NotNull JSONPair... data) { + return appendObjectData(new LinkedHashMap(), data); + } + @@ -2385,7 +2452,8 @@ index 00000000..96274975 + * @param data Data to append + * @return Map + */ -+ public static Map appendObjectData(Map parent, JSONPair... data) { ++ @NotNull ++ public static Map appendObjectData(@NotNull Map parent, @NotNull JSONPair... data) { + for (JSONPair JSONPair : data) { + parent.put(JSONPair.key, JSONPair.val); + } @@ -2398,7 +2466,8 @@ index 00000000..96274975 + * @param data Data to build JSON array from + * @return List + */ -+ public static List toArray(Object... data) { ++ @NotNull ++ public static List toArray(@NotNull Object... data) { + return Lists.newArrayList(data); + } + @@ -2410,11 +2479,13 @@ index 00000000..96274975 + * @param Element Type + * @return List + */ -+ public static List toArrayMapper(E[] collection, Function mapper) { ++ @NotNull ++ public static List toArrayMapper(@NotNull E[] collection, @NotNull Function mapper) { + return toArrayMapper(Lists.newArrayList(collection), mapper); + } + -+ public static List toArrayMapper(Iterable collection, Function mapper) { ++ @NotNull ++ public static List toArrayMapper(@NotNull Iterable collection, @NotNull Function mapper) { + List array = Lists.newArrayList(); + for (E e : collection) { + Object object = mapper.apply(e); @@ -2433,11 +2504,13 @@ index 00000000..96274975 + * @param Element Type + * @return Map + */ -+ public static Map toObjectMapper(E[] collection, Function mapper) { ++ @NotNull ++ public static Map toObjectMapper(@NotNull E[] collection, @NotNull Function mapper) { + return toObjectMapper(Lists.newArrayList(collection), mapper); + } + -+ public static Map toObjectMapper(Iterable collection, Function mapper) { ++ @NotNull ++ public static Map toObjectMapper(@NotNull Iterable collection, @NotNull Function mapper) { + Map object = Maps.newLinkedHashMap(); + for (E e : collection) { + JSONPair JSONPair = mapper.apply(e); @@ -2456,7 +2529,7 @@ index 00000000..96274975 + final String key; + final Object val; + -+ JSONPair(String key, Object val) { ++ JSONPair(@NotNull String key, @NotNull Object val) { + this.key = key; + this.val = val; + } @@ -2464,10 +2537,10 @@ index 00000000..96274975 +} diff --git a/src/main/java/co/aikar/util/LoadingIntMap.java b/src/main/java/co/aikar/util/LoadingIntMap.java new file mode 100644 -index 00000000..24eae4be +index 000000000..63a899c7d --- /dev/null +++ b/src/main/java/co/aikar/util/LoadingIntMap.java -@@ -0,0 +1,71 @@ +@@ -0,0 +1,76 @@ +/* + * Copyright (c) 2015. Starlis LLC / dba Empire Minecraft + * @@ -2479,6 +2552,8 @@ index 00000000..24eae4be + +import com.google.common.base.Function; +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows you to pass a Loader function that when a key is accessed that doesn't exist, @@ -2497,22 +2572,23 @@ index 00000000..24eae4be +public class LoadingIntMap extends Int2ObjectOpenHashMap { + private final Function loader; + -+ public LoadingIntMap(Function loader) { ++ public LoadingIntMap(@NotNull Function loader) { + super(); + this.loader = loader; + } + -+ public LoadingIntMap(int expectedSize, Function loader) { ++ public LoadingIntMap(int expectedSize, @NotNull Function loader) { + super(expectedSize); + this.loader = loader; + } + -+ public LoadingIntMap(int expectedSize, float loadFactor, Function loader) { ++ public LoadingIntMap(int expectedSize, float loadFactor, @NotNull Function loader) { + super(expectedSize, loadFactor); + this.loader = loader; + } + + ++ @Nullable + @Override + public V get(int key) { + V res = super.get(key); @@ -2531,20 +2607,22 @@ index 00000000..24eae4be + * @param Type + */ + public abstract static class Feeder implements Function { ++ @Nullable + @Override -+ public T apply(Object input) { ++ public T apply(@Nullable Object input) { + return apply(); + } + ++ @Nullable + public abstract T apply(); + } +} diff --git a/src/main/java/co/aikar/util/LoadingMap.java b/src/main/java/co/aikar/util/LoadingMap.java new file mode 100644 -index 00000000..dfefda35 +index 000000000..aedbb0332 --- /dev/null +++ b/src/main/java/co/aikar/util/LoadingMap.java -@@ -0,0 +1,343 @@ +@@ -0,0 +1,368 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -2570,6 +2648,7 @@ index 00000000..dfefda35 + */ +package co.aikar.util; + ++import com.google.common.base.Preconditions; +import java.lang.reflect.Constructor; +import java.util.AbstractMap; +import java.util.Collection; @@ -2578,6 +2657,8 @@ index 00000000..dfefda35 +import java.util.Map; +import java.util.Set; +import java.util.function.Function; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows you to pass a Loader function that when a key is accessed that doesn't exists, @@ -2603,7 +2684,7 @@ index 00000000..dfefda35 + * @param backingMap Map to wrap + * @param loader Loader + */ -+ public LoadingMap(Map backingMap, java.util.function.Function loader) { ++ public LoadingMap(@NotNull Map backingMap, @NotNull java.util.function.Function loader) { + this.backingMap = backingMap; + this.loader = loader; + } @@ -2617,7 +2698,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map of(Map backingMap, Function loader) { ++ @NotNull ++ public static Map of(@NotNull Map backingMap, @NotNull Function loader) { + return new LoadingMap<>(backingMap, loader); + } + @@ -2636,8 +2718,9 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newAutoMap(Map backingMap, final Class keyClass, -+ final Class valueClass) { ++ @NotNull ++ public static Map newAutoMap(@NotNull Map backingMap, @Nullable final Class keyClass, ++ @NotNull final Class valueClass) { + return new LoadingMap<>(backingMap, new AutoInstantiatingLoader<>(keyClass, valueClass)); + } + /** @@ -2654,8 +2737,9 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newAutoMap(Map backingMap, -+ final Class valueClass) { ++ @NotNull ++ public static Map newAutoMap(@NotNull Map backingMap, ++ @NotNull final Class valueClass) { + return newAutoMap(backingMap, null, valueClass); + } + @@ -2670,7 +2754,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class keyClass, final Class valueClass) { ++ @NotNull ++ public static Map newHashAutoMap(@Nullable final Class keyClass, @NotNull final Class valueClass) { + return newAutoMap(new HashMap<>(), keyClass, valueClass); + } + @@ -2684,7 +2769,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class valueClass) { ++ @NotNull ++ public static Map newHashAutoMap(@NotNull final Class valueClass) { + return newHashAutoMap(null, valueClass); + } + @@ -2701,7 +2787,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class keyClass, final Class valueClass, int initialCapacity, float loadFactor) { ++ @NotNull ++ public static Map newHashAutoMap(@Nullable final Class keyClass, @NotNull final Class valueClass, int initialCapacity, float loadFactor) { + return newAutoMap(new HashMap<>(initialCapacity, loadFactor), keyClass, valueClass); + } + @@ -2717,7 +2804,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map that auto instantiates on .get() + */ -+ public static Map newHashAutoMap(final Class valueClass, int initialCapacity, float loadFactor) { ++ @NotNull ++ public static Map newHashAutoMap(@NotNull final Class valueClass, int initialCapacity, float loadFactor) { + return newHashAutoMap(null, valueClass, initialCapacity, loadFactor); + } + @@ -2729,7 +2817,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newHashMap(Function loader) { ++ @NotNull ++ public static Map newHashMap(@NotNull Function loader) { + return new LoadingMap<>(new HashMap<>(), loader); + } + @@ -2742,7 +2831,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newHashMap(Function loader, int initialCapacity) { ++ @NotNull ++ public static Map newHashMap(@NotNull Function loader, int initialCapacity) { + return new LoadingMap<>(new HashMap<>(initialCapacity), loader); + } + /** @@ -2755,7 +2845,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newHashMap(Function loader, int initialCapacity, float loadFactor) { ++ @NotNull ++ public static Map newHashMap(@NotNull Function loader, int initialCapacity, float loadFactor) { + return new LoadingMap<>(new HashMap<>(initialCapacity, loadFactor), loader); + } + @@ -2767,7 +2858,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newIdentityHashMap(Function loader) { ++ @NotNull ++ public static Map newIdentityHashMap(@NotNull Function loader) { + return new LoadingMap<>(new IdentityHashMap<>(), loader); + } + @@ -2780,7 +2872,8 @@ index 00000000..dfefda35 + * @param Value Type of the Map + * @return Map + */ -+ public static Map newIdentityHashMap(Function loader, int initialCapacity) { ++ @NotNull ++ public static Map newIdentityHashMap(@NotNull Function loader, int initialCapacity) { + return new LoadingMap<>(new IdentityHashMap<>(initialCapacity), loader); + } + @@ -2791,13 +2884,14 @@ index 00000000..dfefda35 + public boolean isEmpty() {return backingMap.isEmpty();} + + @Override -+ public boolean containsKey(Object key) {return backingMap.containsKey(key);} ++ public boolean containsKey(@Nullable Object key) {return backingMap.containsKey(key);} + + @Override -+ public boolean containsValue(Object value) {return backingMap.containsValue(value);} ++ public boolean containsValue(@Nullable Object value) {return backingMap.containsValue(value);} + ++ @Nullable + @Override -+ public V get(Object key) { ++ public V get(@Nullable Object key) { + V v = backingMap.get(key); + if (v != null) { + return v; @@ -2805,33 +2899,39 @@ index 00000000..dfefda35 + return backingMap.computeIfAbsent((K) key, loader); + } + -+ public V put(K key, V value) {return backingMap.put(key, value);} ++ @Nullable ++ public V put(@Nullable K key, @Nullable V value) {return backingMap.put(key, value);} + ++ @Nullable + @Override -+ public V remove(Object key) {return backingMap.remove(key);} ++ public V remove(@Nullable Object key) {return backingMap.remove(key);} + -+ public void putAll(Map m) {backingMap.putAll(m);} ++ public void putAll(@NotNull Map m) {backingMap.putAll(m);} + + @Override + public void clear() {backingMap.clear();} + ++ @NotNull + @Override + public Set keySet() {return backingMap.keySet();} + ++ @NotNull + @Override + public Collection values() {return backingMap.values();} + + @Override -+ public boolean equals(Object o) {return backingMap.equals(o);} ++ public boolean equals(@Nullable Object o) {return backingMap.equals(o);} + + @Override + public int hashCode() {return backingMap.hashCode();} + ++ @NotNull + @Override + public Set> entrySet() { + return backingMap.entrySet(); + } + ++ @NotNull + public LoadingMap clone() { + return new LoadingMap<>(backingMap, loader); + } @@ -2840,7 +2940,7 @@ index 00000000..dfefda35 + final Constructor constructor; + private final Class valueClass; + -+ AutoInstantiatingLoader(Class keyClass, Class valueClass) { ++ AutoInstantiatingLoader(@Nullable Class keyClass, @NotNull Class valueClass) { + try { + this.valueClass = valueClass; + if (keyClass != null) { @@ -2854,8 +2954,9 @@ index 00000000..dfefda35 + } + } + ++ @NotNull + @Override -+ public V apply(K input) { ++ public V apply(@Nullable K input) { + try { + return (constructor != null ? constructor.newInstance(input) : valueClass.newInstance()); + } catch (Exception e) { @@ -2880,20 +2981,22 @@ index 00000000..dfefda35 + * @param Type + */ + public abstract static class Feeder implements Function { ++ @Nullable + @Override -+ public T apply(Object input) { ++ public T apply(@Nullable Object input) { + return apply(); + } + ++ @Nullable + public abstract T apply(); + } +} diff --git a/src/main/java/co/aikar/util/MRUMapCache.java b/src/main/java/co/aikar/util/MRUMapCache.java new file mode 100644 -index 00000000..df592d85 +index 000000000..5989ee212 --- /dev/null +++ b/src/main/java/co/aikar/util/MRUMapCache.java -@@ -0,0 +1,102 @@ +@@ -0,0 +1,111 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -2923,6 +3026,8 @@ index 00000000..df592d85 +import java.util.Collection; +import java.util.Map; +import java.util.Set; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Implements a Most Recently Used cache in front of a backing map, to quickly access the last accessed result. @@ -2934,7 +3039,7 @@ index 00000000..df592d85 + final Map backingMap; + Object cacheKey; + V cacheValue; -+ public MRUMapCache(final Map backingMap) { ++ public MRUMapCache(@NotNull final Map backingMap) { + this.backingMap = backingMap; + } + @@ -2942,15 +3047,16 @@ index 00000000..df592d85 + + public boolean isEmpty() {return backingMap.isEmpty();} + -+ public boolean containsKey(Object key) { ++ public boolean containsKey(@Nullable Object key) { + return key != null && key.equals(cacheKey) || backingMap.containsKey(key); + } + -+ public boolean containsValue(Object value) { ++ public boolean containsValue(@Nullable Object value) { + return value != null && value == cacheValue || backingMap.containsValue(value); + } + -+ public V get(Object key) { ++ @Nullable ++ public V get(@Nullable Object key) { + if (cacheKey != null && cacheKey.equals(key)) { + return cacheValue; + } @@ -2958,19 +3064,21 @@ index 00000000..df592d85 + return cacheValue = backingMap.get(key); + } + -+ public V put(K key, V value) { ++ @Nullable ++ public V put(@Nullable K key, @Nullable V value) { + cacheKey = key; + return cacheValue = backingMap.put(key, value); + } + -+ public V remove(Object key) { ++ @Nullable ++ public V remove(@Nullable Object key) { + if (key != null && key.equals(cacheKey)) { + cacheKey = null; + } + return backingMap.remove(key); + } + -+ public void putAll(Map m) {backingMap.putAll(m);} ++ public void putAll(@NotNull Map m) {backingMap.putAll(m);} + + public void clear() { + cacheKey = null; @@ -2978,10 +3086,13 @@ index 00000000..df592d85 + backingMap.clear(); + } + ++ @NotNull + public Set keySet() {return backingMap.keySet();} + ++ @NotNull + public Collection values() {return backingMap.values();} + ++ @NotNull + public Set> entrySet() {return backingMap.entrySet();} + + /** @@ -2992,15 +3103,16 @@ index 00000000..df592d85 + * @param Value Type of the Map + * @return Map + */ -+ public static Map of(Map map) { ++ @NotNull ++ public static Map of(@NotNull Map map) { + return new MRUMapCache(map); + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index d8014f14..14e425d1 100644 +index 27988a66b..cffa0c65f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -572,7 +572,6 @@ public final class Bukkit { +@@ -602,7 +602,6 @@ public final class Bukkit { */ public static void reload() { server.reload(); @@ -3009,54 +3121,55 @@ index d8014f14..14e425d1 100644 /** diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index fac90a48..9d2326ca 100644 +index 12660040b..9f7f760af 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1193,12 +1193,27 @@ public interface Server extends PluginMessageRecipient { - // Spigot start - public class Spigot - { -- -+ @Deprecated - public org.bukkit.configuration.file.YamlConfiguration getConfig() - { +@@ -1278,6 +1278,26 @@ public interface Server extends PluginMessageRecipient { throw new UnsupportedOperationException( "Not supported yet." ); } ++ // Paper start ++ @NotNull + public org.bukkit.configuration.file.YamlConfiguration getBukkitConfig() + { + throw new UnsupportedOperationException( "Not supported yet." ); + } + ++ @NotNull + public org.bukkit.configuration.file.YamlConfiguration getSpigotConfig() + { + throw new UnsupportedOperationException("Not supported yet."); + } + ++ @NotNull + public org.bukkit.configuration.file.YamlConfiguration getPaperConfig() + { + throw new UnsupportedOperationException("Not supported yet."); + } ++ // Paper end + /** * Sends the component to the player * diff --git a/src/main/java/org/bukkit/command/BufferedCommandSender.java b/src/main/java/org/bukkit/command/BufferedCommandSender.java new file mode 100644 -index 00000000..fd452bce +index 000000000..f9a00aecc --- /dev/null +++ b/src/main/java/org/bukkit/command/BufferedCommandSender.java -@@ -0,0 +1,18 @@ +@@ -0,0 +1,21 @@ +package org.bukkit.command; + ++import org.jetbrains.annotations.NotNull; ++ +public class BufferedCommandSender implements MessageCommandSender { + private final StringBuffer buffer = new StringBuffer(); + @Override -+ public void sendMessage(String message) { ++ public void sendMessage(@NotNull String message) { + buffer.append(message); + buffer.append("\n"); + } + ++ @NotNull + public String getBuffer() { + return buffer.toString(); + } @@ -3066,29 +3179,29 @@ index 00000000..fd452bce + } +} diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index 33e8681d..db7f4428 100644 +index b354b617f..01ea1ca67 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java -@@ -33,7 +33,8 @@ public abstract class Command { +@@ -35,7 +35,8 @@ public abstract class Command { protected String usageMessage; private String permission; private String permissionMessage; - public org.spigotmc.CustomTimingsHandler timings; // Spigot -+ public co.aikar.timings.Timing timings; // Spigot -+ public String getTimingName() {return getName();} // Spigot ++ public co.aikar.timings.Timing timings; // Paper ++ @NotNull public String getTimingName() {return getName();} // Paper - protected Command(String name) { + protected Command(@NotNull String name) { this(name, "", "/" + name, new ArrayList()); -@@ -47,7 +48,6 @@ public abstract class Command { - this.usageMessage = usageMessage; +@@ -49,7 +50,6 @@ public abstract class Command { + this.usageMessage = (usageMessage == null) ? "/" + name : usageMessage; this.aliases = aliases; this.activeAliases = new ArrayList(aliases); - this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot } /** -@@ -236,7 +236,6 @@ public abstract class Command { - public boolean setLabel(String name) { +@@ -247,7 +247,6 @@ public abstract class Command { + } this.nextLabel = name; if (!isRegistered()) { - this.timings = new org.spigotmc.CustomTimingsHandler("** Command: " + name); // Spigot @@ -3096,33 +3209,34 @@ index 33e8681d..db7f4428 100644 return true; } diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java -index 50257883..9c80f464 100644 +index 2035880ee..b8c97a4bf 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java +++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java -@@ -9,6 +9,7 @@ public class FormattedCommandAlias extends Command { +@@ -10,6 +10,7 @@ public class FormattedCommandAlias extends Command { - public FormattedCommandAlias(String alias, String[] formatStrings) { + public FormattedCommandAlias(@NotNull String alias, @NotNull String[] formatStrings) { super(alias); + timings = co.aikar.timings.TimingsManager.getCommandTiming("minecraft", this); // Spigot this.formatStrings = formatStrings; } -@@ -113,6 +114,9 @@ public class FormattedCommandAlias extends Command { +@@ -114,6 +115,10 @@ public class FormattedCommandAlias extends Command { return formatString; } -+ @Override // Spigot -+ public String getTimingName() {return "Command Forwarder - " + super.getTimingName();} // Spigot ++ @NotNull ++ @Override // Paper ++ public String getTimingName() {return "Command Forwarder - " + super.getTimingName();} // Paper + private static boolean inRange(int i, int j, int k) { return i >= j && i <= k; } diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java new file mode 100644 -index 00000000..5527e7c8 +index 000000000..ca1893e9f --- /dev/null +++ b/src/main/java/org/bukkit/command/MessageCommandSender.java -@@ -0,0 +1,105 @@ +@@ -0,0 +1,114 @@ +package org.bukkit.command; + +import org.apache.commons.lang.NotImplementedException; @@ -3134,6 +3248,7 @@ index 00000000..5527e7c8 +import org.bukkit.plugin.Plugin; + +import java.util.Set; ++import org.jetbrains.annotations.NotNull; + +/** + * For when all you care about is just messaging @@ -3141,17 +3256,19 @@ index 00000000..5527e7c8 +public interface MessageCommandSender extends CommandSender { + + @Override -+ default void sendMessage(String[] messages) { ++ default void sendMessage(@NotNull String[] messages) { + for (String message : messages) { + sendMessage(message); + } + } + ++ @NotNull + @Override + default Server getServer() { + return Bukkit.getServer(); + } + ++ @NotNull + @Override + default String getName() { + throw new NotImplementedException(); @@ -3168,47 +3285,51 @@ index 00000000..5527e7c8 + } + + @Override -+ default boolean isPermissionSet(String name) { ++ default boolean isPermissionSet(@NotNull String name) { + throw new NotImplementedException(); + } + + @Override -+ default boolean isPermissionSet(Permission perm) { ++ default boolean isPermissionSet(@NotNull Permission perm) { + throw new NotImplementedException(); + } + + @Override -+ default boolean hasPermission(String name) { ++ default boolean hasPermission(@NotNull String name) { + throw new NotImplementedException(); + } + + @Override -+ default boolean hasPermission(Permission perm) { ++ default boolean hasPermission(@NotNull Permission perm) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) { ++ throw new NotImplementedException(); ++ } ++ ++ @NotNull ++ @Override ++ default PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) { + throw new NotImplementedException(); + } + + @Override -+ default PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default PermissionAttachment addAttachment(Plugin plugin) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default PermissionAttachment addAttachment(Plugin plugin, int ticks) { -+ throw new NotImplementedException(); -+ } -+ -+ @Override -+ default void removeAttachment(PermissionAttachment attachment) { ++ default void removeAttachment(@NotNull PermissionAttachment attachment) { + throw new NotImplementedException(); + } + @@ -3217,11 +3338,13 @@ index 00000000..5527e7c8 + throw new NotImplementedException(); + } + ++ @NotNull + @Override + default Set getEffectivePermissions() { + throw new NotImplementedException(); + } + ++ @NotNull + @Override + default Spigot spigot() { + throw new NotImplementedException(); @@ -3229,27 +3352,27 @@ index 00000000..5527e7c8 + +} diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index d9183db2..43e52a77 100644 +index 1586f6480..f7ec2e55f 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java -@@ -29,7 +29,7 @@ public class SimpleCommandMap implements CommandMap { +@@ -31,7 +31,7 @@ public class SimpleCommandMap implements CommandMap { register("bukkit", new VersionCommand("version")); register("bukkit", new ReloadCommand("reload")); register("bukkit", new PluginsCommand("plugins")); - register("bukkit", new TimingsCommand("timings")); -+ register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Spigot ++ register("bukkit", new co.aikar.timings.TimingsCommand("timings")); // Paper } public void setFallbackCommands() { -@@ -58,6 +58,7 @@ public class SimpleCommandMap implements CommandMap { +@@ -60,6 +60,7 @@ public class SimpleCommandMap implements CommandMap { * {@inheritDoc} */ - public boolean register(String label, String fallbackPrefix, Command command) { -+ command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Spigot + public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @NotNull Command command) { ++ command.timings = co.aikar.timings.TimingsManager.getCommandTiming(fallbackPrefix, command); // Paper label = label.toLowerCase(java.util.Locale.ENGLISH).trim(); fallbackPrefix = fallbackPrefix.toLowerCase(java.util.Locale.ENGLISH).trim(); boolean registered = register(label, command, false, fallbackPrefix); -@@ -133,6 +134,12 @@ public class SimpleCommandMap implements CommandMap { +@@ -135,6 +136,12 @@ public class SimpleCommandMap implements CommandMap { return false; } @@ -3264,10 +3387,10 @@ index d9183db2..43e52a77 100644 // Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false) diff --git a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java b/src/main/java/org/bukkit/command/defaults/TimingsCommand.java deleted file mode 100644 -index bba914d7..00000000 +index 1e6e7033d..000000000 --- a/src/main/java/org/bukkit/command/defaults/TimingsCommand.java +++ /dev/null -@@ -1,253 +0,0 @@ +@@ -1,255 +0,0 @@ -package org.bukkit.command.defaults; - -import java.io.File; @@ -3288,6 +3411,7 @@ index bba914d7..00000000 -import org.bukkit.util.StringUtil; - -import com.google.common.collect.ImmutableList; +-import org.jetbrains.annotations.NotNull; - -// Spigot start -import java.io.ByteArrayOutputStream; @@ -3306,7 +3430,7 @@ index bba914d7..00000000 - private static final List TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste"); // Spigot - public static long timingStart = 0; // Spigot - -- public TimingsCommand(String name) { +- public TimingsCommand(@NotNull String name) { - super(name); - this.description = "Manages Spigot Timings data to see performance of the server."; // Spigot - this.usageMessage = "/timings "; // Spigot @@ -3314,7 +3438,7 @@ index bba914d7..00000000 - } - - // Spigot start - redesigned Timings Command -- public void executeSpigotTimings(CommandSender sender, String[] args) { +- public void executeSpigotTimings(@NotNull CommandSender sender, @NotNull String[] args) { - if ( "on".equals( args[0] ) ) - { - ( (SimplePluginManager) Bukkit.getPluginManager() ).useTimings( true ); @@ -3377,7 +3501,7 @@ index bba914d7..00000000 - // Spigot end - - @Override -- public boolean execute(CommandSender sender, String currentAlias, String[] args) { +- public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { - if (!testPermission(sender)) return true; - if (args.length < 1) { // Spigot - sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage); @@ -3458,8 +3582,9 @@ index bba914d7..00000000 - return true; - } - +- @NotNull - @Override -- public List tabComplete(CommandSender sender, String alias, String[] args) { +- public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) { - Validate.notNull(sender, "Sender cannot be null"); - Validate.notNull(args, "Arguments cannot be null"); - Validate.notNull(alias, "Alias cannot be null"); @@ -3477,7 +3602,7 @@ index bba914d7..00000000 - private final CommandSender sender; - private final ByteArrayOutputStream bout; - -- public PasteThread(CommandSender sender, ByteArrayOutputStream bout) +- public PasteThread(@NotNull CommandSender sender, @NotNull ByteArrayOutputStream bout) - { - super( "Timings paste thread" ); - this.sender = sender; @@ -3522,11 +3647,11 @@ index bba914d7..00000000 - // Spigot end -} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 71fe947b..75f21146 100644 +index 97504e6f9..777994f7a 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1551,6 +1551,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { +@@ -1566,6 +1566,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } + @@ -3536,12 +3661,12 @@ index 71fe947b..75f21146 100644 + } } - @Override + @NotNull diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 92db0663..0185934b 100644 +index 76137a800..fe5725519 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -@@ -294,7 +294,6 @@ public final class SimplePluginManager implements PluginManager { +@@ -297,7 +297,6 @@ public final class SimplePluginManager implements PluginManager { } } @@ -3549,35 +3674,35 @@ index 92db0663..0185934b 100644 return result.toArray(new Plugin[result.size()]); } -@@ -331,7 +330,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -335,7 +334,7 @@ public final class SimplePluginManager implements PluginManager { if (result != null) { plugins.add(result); - lookupNames.put(result.getDescription().getName(), result); -+ lookupNames.put(result.getDescription().getName().toLowerCase(java.util.Locale.ENGLISH), result); // Spigot ++ lookupNames.put(result.getDescription().getName().toLowerCase(java.util.Locale.ENGLISH), result); // Paper } return result; -@@ -357,7 +356,7 @@ public final class SimplePluginManager implements PluginManager { - * @return Plugin if it exists, otherwise null +@@ -362,7 +361,7 @@ public final class SimplePluginManager implements PluginManager { */ - public synchronized Plugin getPlugin(String name) { + @Nullable + public synchronized Plugin getPlugin(@NotNull String name) { - return lookupNames.get(name.replace(' ', '_')); -+ return lookupNames.get(name.replace(' ', '_').toLowerCase(java.util.Locale.ENGLISH)); // Spigot ++ return lookupNames.get(name.replace(' ', '_').toLowerCase(java.util.Locale.ENGLISH)); // Paper } - public synchronized Plugin[] getPlugins() { -@@ -555,7 +554,8 @@ public final class SimplePluginManager implements PluginManager { + @NotNull +@@ -561,7 +560,8 @@ public final class SimplePluginManager implements PluginManager { throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled"); } - if (useTimings) { -+ executor = new co.aikar.timings.TimedEventExecutor(executor, plugin, null, event); // Spigot -+ if (false) { // Spigot - RL handles useTimings check now ++ executor = new co.aikar.timings.TimedEventExecutor(executor, plugin, null, event); // Paper ++ if (false) { // Spigot - RL handles useTimings check now // Paper getEventListeners(event).register(new TimedRegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); } else { getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled)); -@@ -731,7 +731,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -744,7 +744,7 @@ public final class SimplePluginManager implements PluginManager { } public boolean useTimings() { @@ -3586,27 +3711,19 @@ index 92db0663..0185934b 100644 } /** -@@ -740,6 +740,6 @@ public final class SimplePluginManager implements PluginManager { +@@ -753,6 +753,6 @@ public final class SimplePluginManager implements PluginManager { * @param use True if per event timing code should be used */ public void useTimings(boolean use) { - useTimings = use; -+ co.aikar.timings.Timings.setTimingsEnabled(use); // Spigot ++ co.aikar.timings.Timings.setTimingsEnabled(use); // Paper } } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 2d4c75ab..54594546 100644 +index 56f933360..5b29076fe 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -41,7 +41,6 @@ import org.bukkit.plugin.PluginLoader; - import org.bukkit.plugin.RegisteredListener; - import org.bukkit.plugin.TimedRegisteredListener; - import org.bukkit.plugin.UnknownDependencyException; --import org.spigotmc.CustomTimingsHandler; // Spigot - import org.yaml.snakeyaml.error.YAMLException; - - /** -@@ -52,7 +51,6 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -54,7 +54,6 @@ public final class JavaPluginLoader implements PluginLoader { private final Pattern[] fileFilters = new Pattern[] { Pattern.compile("\\.jar$"), }; private final Map> classes = new ConcurrentHashMap>(); private final List loaders = new CopyOnWriteArrayList(); @@ -3614,14 +3731,15 @@ index 2d4c75ab..54594546 100644 /** * This class was not meant to be constructed explicitly -@@ -292,26 +290,20 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -299,26 +298,20 @@ public final class JavaPluginLoader implements PluginLoader { } } - final CustomTimingsHandler timings = new CustomTimingsHandler("Plugin: " + plugin.getDescription().getFullName() + " Event: " + listener.getClass().getName() + "::" + method.getName()+"("+eventClass.getSimpleName()+")", pluginParentTimer); // Spigot - EventExecutor executor = new EventExecutor() { -+ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Spigot - public void execute(Listener listener, Event event) throws EventException { +- public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { ++ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper try { if (!eventClass.isAssignableFrom(event.getClass())) { return; @@ -3639,15 +3757,15 @@ index 2d4c75ab..54594546 100644 } } - }; -+ }, plugin, method, eventClass); // Spigot ++ }, plugin, method, eventClass); // Paper if (false) { // Spigot - RL handles useTimings check now eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); } else { diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index 7a8abe75..bc33ff33 100644 +index 541d8ee6b..c39fcac5a 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -23,7 +23,8 @@ import org.bukkit.plugin.PluginDescriptionFile; +@@ -25,7 +25,8 @@ import org.jetbrains.annotations.Nullable; /** * A ClassLoader for plugins, to allow shared classes across multiple plugins */ @@ -3658,22 +3776,33 @@ index 7a8abe75..bc33ff33 100644 private final Map> classes = new ConcurrentHashMap>(); private final PluginDescriptionFile description; diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java -index 5ca863b3..04804706 100644 +index 5ca863b36..612958a33 100644 --- a/src/main/java/org/bukkit/util/CachedServerIcon.java +++ b/src/main/java/org/bukkit/util/CachedServerIcon.java -@@ -12,4 +12,6 @@ import org.bukkit.event.server.ServerListPingEvent; +@@ -2,6 +2,7 @@ package org.bukkit.util; + + import org.bukkit.Server; + import org.bukkit.event.server.ServerListPingEvent; ++import org.jetbrains.annotations.Nullable; + + /** + * This is a cached version of a server-icon. It's internal representation +@@ -12,4 +13,9 @@ import org.bukkit.event.server.ServerListPingEvent; * @see Server#loadServerIcon(java.io.File) * @see ServerListPingEvent#setServerIcon(CachedServerIcon) */ -public interface CachedServerIcon {} +public interface CachedServerIcon { -+ public String getData(); // Spigot ++ ++ @Nullable ++ public String getData(); // Paper ++ +} diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java -index 8d982974..e9f76006 100644 +index 6a8f7f551..3cbe5c2bb 100644 --- a/src/main/java/org/spigotmc/CustomTimingsHandler.java +++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java -@@ -1,165 +1,105 @@ +@@ -1,3 +1,26 @@ +/* + * This file is licensed under the MIT License (MIT). + * @@ -3699,25 +3828,20 @@ index 8d982974..e9f76006 100644 + */ package org.spigotmc; + import java.io.PrintStream; +@@ -5,155 +28,84 @@ import java.util.Queue; + import java.util.concurrent.ConcurrentLinkedQueue; + import org.bukkit.Bukkit; + import org.bukkit.World; -import org.bukkit.command.defaults.TimingsCommand; --import org.bukkit.event.HandlerList; -+import org.bukkit.Bukkit; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +import org.bukkit.plugin.AuthorNagException; - import org.bukkit.plugin.Plugin; --import org.bukkit.plugin.RegisteredListener; --import org.bukkit.plugin.TimedRegisteredListener; --import java.io.PrintStream; --import java.util.Collection; --import java.util.HashSet; --import java.util.List; --import java.util.Queue; --import java.util.concurrent.ConcurrentLinkedQueue; ++import org.bukkit.plugin.Plugin; +import co.aikar.timings.Timing; +import co.aikar.timings.Timings; +import co.aikar.timings.TimingsManager; - --import org.bukkit.Bukkit; --import org.bukkit.World; ++ +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.logging.Level; @@ -3749,17 +3873,17 @@ index 8d982974..e9f76006 100644 - private long totalTime = 0; - private long curTickTotal = 0; - private long violations = 0; -+ public CustomTimingsHandler(String name) { ++ public CustomTimingsHandler(@NotNull String name) { + if (sunReflectAvailable == null) { + String javaVer = System.getProperty("java.version"); + String[] elements = javaVer.split("\\."); -- public CustomTimingsHandler(String name) +- public CustomTimingsHandler(@NotNull String name) - { - this( name, null ); - } - -- public CustomTimingsHandler(String name, CustomTimingsHandler parent) +- public CustomTimingsHandler(@NotNull String name, @Nullable CustomTimingsHandler parent) - { - this.name = name; - this.parent = parent; @@ -3774,7 +3898,7 @@ index 8d982974..e9f76006 100644 - * - * @param printStream - */ -- public static void printTimings(PrintStream printStream) +- public static void printTimings(@NotNull PrintStream printStream) - { - printStream.println( "Minecraft" ); - for ( CustomTimingsHandler timings : HANDLERS ) @@ -3922,5 +4046,5 @@ index 8d982974..e9f76006 100644 + } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0005-Player-affects-spawning-API.patch b/Spigot-API-Patches/0005-Player-affects-spawning-API.patch index 3d616c3482..35a4e75eb5 100644 --- a/Spigot-API-Patches/0005-Player-affects-spawning-API.patch +++ b/Spigot-API-Patches/0005-Player-affects-spawning-API.patch @@ -1,15 +1,15 @@ -From 44c7da0daea1759a7b45d8e5393ca84216ed9c0a Mon Sep 17 00:00:00 2001 +From 3fbe48f546b9da11b1e6baa07d639960dd30a9dc Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Mon, 29 Feb 2016 17:22:34 -0600 Subject: [PATCH] Player affects spawning API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 75f21146..694254f1 100644 +index 777994f7..95ebf016 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1444,6 +1444,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - */ +@@ -1456,6 +1456,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + @NotNull public String getLocale(); + // Paper start @@ -32,5 +32,5 @@ index 75f21146..694254f1 100644 * Update the list of commands sent to the client. *
-- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0006-Add-getTPS-method.patch b/Spigot-API-Patches/0006-Add-getTPS-method.patch index 3294374e51..8f6f045f60 100644 --- a/Spigot-API-Patches/0006-Add-getTPS-method.patch +++ b/Spigot-API-Patches/0006-Add-getTPS-method.patch @@ -1,14 +1,14 @@ -From 55f158cbeaa2938c3bc32d50ddd023ab6a172f67 Mon Sep 17 00:00:00 2001 +From 046a9cacf026fd179eba24607ba5401c03b45b42 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 17:24:57 -0600 Subject: [PATCH] Add getTPS method diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 14e425d1..6055c801 100644 +index cffa0c65f..2ad9a7d7f 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1274,6 +1274,16 @@ public final class Bukkit { +@@ -1341,6 +1341,17 @@ public final class Bukkit { return server.getEntity(uuid); } @@ -17,6 +17,7 @@ index 14e425d1..6055c801 100644 + * Gets the current server TPS + * @return current server TPS (1m, 5m, 15m in Paper-Server) + */ ++ @NotNull + public static double[] getTPS() { + return server.getTPS(); + } @@ -26,12 +27,12 @@ index 14e425d1..6055c801 100644 * Get the advancement specified by this key. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 9d2326ca..1632af18 100644 +index 9f7f760af..3ad70b92f 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1056,6 +1056,15 @@ public interface Server extends PluginMessageRecipient { - */ - Entity getEntity(UUID uuid); +@@ -1122,6 +1122,16 @@ public interface Server extends PluginMessageRecipient { + @Nullable + Entity getEntity(@NotNull UUID uuid); + // Paper start + /** @@ -39,6 +40,7 @@ index 9d2326ca..1632af18 100644 + * + * @return current server TPS (1m, 5m, 15m in Paper-Server) + */ ++ @NotNull + public double[] getTPS(); + // Paper end + @@ -46,5 +48,5 @@ index 9d2326ca..1632af18 100644 * Get the advancement specified by this key. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0007-Entity-Origin-API.patch b/Spigot-API-Patches/0007-Entity-Origin-API.patch index 82fce96a5d..2cb7c64738 100644 --- a/Spigot-API-Patches/0007-Entity-Origin-API.patch +++ b/Spigot-API-Patches/0007-Entity-Origin-API.patch @@ -1,14 +1,14 @@ -From ac7b32c1796b75c604e78cde4e691fbf4611df50 Mon Sep 17 00:00:00 2001 +From c59a5c4c7d44ac1e718fb648531bdba8132dbe23 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Mon, 29 Feb 2016 17:50:31 -0600 Subject: [PATCH] Entity Origin API diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 236cddb2..015a4c56 100644 +index 19dc1e6a8..69307e252 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -559,4 +559,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable { +@@ -580,4 +580,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable { @Override Spigot spigot(); // Spigot end @@ -21,14 +21,15 @@ index 236cddb2..015a4c56 100644 + * + * @return Location where entity originates or null if not yet added + */ ++ @Nullable + Location getOrigin(); + // Paper end } diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java -index 0cd830d9..170a9aee 100644 +index 64f9d3fd8..14cb0d770 100644 --- a/src/main/java/org/bukkit/entity/FallingBlock.java +++ b/src/main/java/org/bukkit/entity/FallingBlock.java -@@ -51,4 +51,15 @@ public interface FallingBlock extends Entity { +@@ -54,4 +54,15 @@ public interface FallingBlock extends Entity { * @param hurtEntities whether entities will be damaged by this block. */ void setHurtEntities(boolean hurtEntities); @@ -45,12 +46,12 @@ index 0cd830d9..170a9aee 100644 + } } diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java -index a439eaf5..04cc23ef 100644 +index 5a8789324..3022b4a27 100644 --- a/src/main/java/org/bukkit/entity/TNTPrimed.java +++ b/src/main/java/org/bukkit/entity/TNTPrimed.java -@@ -37,4 +37,15 @@ public interface TNTPrimed extends Explosive { - * @return the source of this primed TNT +@@ -39,4 +39,15 @@ public interface TNTPrimed extends Explosive { */ + @Nullable public Entity getSource(); + + /** @@ -65,5 +66,5 @@ index a439eaf5..04cc23ef 100644 + } } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0008-Check-Paper-versions.patch b/Spigot-API-Patches/0008-Check-Paper-versions.patch index 7ed92d4c05..eea53cc12e 100644 --- a/Spigot-API-Patches/0008-Check-Paper-versions.patch +++ b/Spigot-API-Patches/0008-Check-Paper-versions.patch @@ -1,14 +1,14 @@ -From 33f3804404e0c186f8cf33f8f3a226e0d84b7dfc Mon Sep 17 00:00:00 2001 +From 1a30440641954b395935425e537a9b77857aacdc Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 29 Feb 2016 17:58:01 -0600 Subject: [PATCH] Check Paper versions diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index 5a994953..f38f6864 100644 +index 0305548e..8e57aa91 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -@@ -26,6 +26,11 @@ import org.json.simple.JSONObject; +@@ -28,6 +28,11 @@ import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -18,18 +18,18 @@ index 5a994953..f38f6864 100644 +// Paper end + public class VersionCommand extends BukkitCommand { - public VersionCommand(String name) { + public VersionCommand(@NotNull String name) { super(name); -@@ -149,7 +154,7 @@ public class VersionCommand extends BukkitCommand { +@@ -153,7 +158,7 @@ public class VersionCommand extends BukkitCommand { - private void sendVersion(CommandSender sender) { + private void sendVersion(@NotNull CommandSender sender) { if (hasVersion) { - if (System.currentTimeMillis() - lastCheck > 21600000) { + if (System.currentTimeMillis() - lastCheck > 7200000) { // Paper - Lower to 2 hours lastCheck = System.currentTimeMillis(); hasVersion = false; } else { -@@ -180,24 +185,28 @@ public class VersionCommand extends BukkitCommand { +@@ -184,24 +189,28 @@ public class VersionCommand extends BukkitCommand { } } @@ -70,13 +70,13 @@ index 5a994953..f38f6864 100644 version = version.substring("git-Bukkit-".length()); int cbVersions = getDistance("craftbukkit", version.substring(0, version.indexOf(' '))); if (cbVersions == -1) { -@@ -230,8 +239,16 @@ public class VersionCommand extends BukkitCommand { +@@ -234,8 +243,16 @@ public class VersionCommand extends BukkitCommand { } } -- private static int getDistance(String repo, String hash) { +- private static int getDistance(@NotNull String repo, @NotNull String hash) { + // Paper start -+ private static int getDistance(String repo, String verInfo) { ++ private static int getDistance(@NotNull String repo, @NotNull String verInfo) { try { + int currentVer = Integer.decode(verInfo); + return getFromJenkins(currentVer); @@ -88,7 +88,7 @@ index 5a994953..f38f6864 100644 BufferedReader reader = Resources.asCharSource( new URL("https://hub.spigotmc.org/stash/rest/api/1.0/projects/SPIGOT/repos/" + repo + "/commits?since=" + URLEncoder.encode(hash, "UTF-8") + "&withCounts=true"), Charsets.UTF_8 -@@ -245,9 +262,57 @@ public class VersionCommand extends BukkitCommand { +@@ -249,9 +266,57 @@ public class VersionCommand extends BukkitCommand { } finally { reader.close(); } @@ -147,5 +147,5 @@ index 5a994953..f38f6864 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0010-Add-player-view-distance-API.patch b/Spigot-API-Patches/0010-Add-player-view-distance-API.patch index effe07fde2..8df3e63d42 100644 --- a/Spigot-API-Patches/0010-Add-player-view-distance-API.patch +++ b/Spigot-API-Patches/0010-Add-player-view-distance-API.patch @@ -1,14 +1,14 @@ -From e802df27e5944819165eb81c78b5c6e4842a15dd Mon Sep 17 00:00:00 2001 +From 331efa882680033d3d69d00d3717886572cf5051 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Mon, 29 Feb 2016 18:05:37 -0600 Subject: [PATCH] Add player view distance API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 694254f1..d72a7e3d 100644 +index 95ebf016..51a145a4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1468,6 +1468,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1480,6 +1480,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void updateCommands(); @@ -30,5 +30,5 @@ index 694254f1..d72a7e3d 100644 public class Spigot extends Entity.Spigot { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0011-Add-BeaconEffectEvent.patch b/Spigot-API-Patches/0011-Add-BeaconEffectEvent.patch index 4b63a3b880..2bfc0b9a47 100644 --- a/Spigot-API-Patches/0011-Add-BeaconEffectEvent.patch +++ b/Spigot-API-Patches/0011-Add-BeaconEffectEvent.patch @@ -1,4 +1,4 @@ -From 41cb3feff77a6e684cefbc546f48245294a2d978 Mon Sep 17 00:00:00 2001 +From 187c890c4b97f0664edd8959a7dd28e30ad611d4 Mon Sep 17 00:00:00 2001 From: Byteflux Date: Mon, 29 Feb 2016 18:09:40 -0600 Subject: [PATCH] Add BeaconEffectEvent @@ -6,10 +6,10 @@ Subject: [PATCH] Add BeaconEffectEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java new file mode 100644 -index 00000000..6579ae99 +index 000000000..978813b94 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java -@@ -0,0 +1,81 @@ +@@ -0,0 +1,86 @@ +package com.destroystokyo.paper.event.block; + +import org.bukkit.block.Block; @@ -18,6 +18,7 @@ index 00000000..6579ae99 +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.BlockEvent; +import org.bukkit.potion.PotionEffect; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a beacon effect is being applied to a player. @@ -29,7 +30,7 @@ index 00000000..6579ae99 + private Player player; + private boolean primary; + -+ public BeaconEffectEvent(Block block, PotionEffect effect, Player player, boolean primary) { ++ public BeaconEffectEvent(@NotNull Block block, @NotNull PotionEffect effect, @NotNull Player player, boolean primary) { + super(block); + this.effect = effect; + this.player = player; @@ -51,6 +52,7 @@ index 00000000..6579ae99 + * + * @return Potion effect + */ ++ @NotNull + public PotionEffect getEffect() { + return effect; + } @@ -60,7 +62,7 @@ index 00000000..6579ae99 + * + * @param effect Potion effect + */ -+ public void setEffect(PotionEffect effect) { ++ public void setEffect(@NotNull PotionEffect effect) { + this.effect = effect; + } + @@ -69,6 +71,7 @@ index 00000000..6579ae99 + * + * @return Affected player + */ ++ @NotNull + public Player getPlayer() { + return player; + } @@ -82,15 +85,17 @@ index 00000000..6579ae99 + return primary; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0012-Add-PlayerInitialSpawnEvent.patch b/Spigot-API-Patches/0012-Add-PlayerInitialSpawnEvent.patch index a712cb014a..3ea56ad8a7 100644 --- a/Spigot-API-Patches/0012-Add-PlayerInitialSpawnEvent.patch +++ b/Spigot-API-Patches/0012-Add-PlayerInitialSpawnEvent.patch @@ -1,4 +1,4 @@ -From 31ed8767255c5f82dbb149e44a080e17a52d7f29 Mon Sep 17 00:00:00 2001 +From 29f3d0354d4a1dd627e60c82bd78e01655df4dc3 Mon Sep 17 00:00:00 2001 From: Steve Anton Date: Mon, 29 Feb 2016 18:13:58 -0600 Subject: [PATCH] Add PlayerInitialSpawnEvent @@ -7,22 +7,23 @@ For modifying a player's initial spawn location as they join the server diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java new file mode 100644 -index 00000000..d1d6f33c +index 000000000..8e407eff1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,47 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +public class PlayerInitialSpawnEvent extends PlayerEvent { + private static final HandlerList handlers = new HandlerList(); -+ private Location spawnLocation; ++ @NotNull private Location spawnLocation; + -+ public PlayerInitialSpawnEvent(final Player player, final Location spawnLocation) { ++ public PlayerInitialSpawnEvent(@NotNull final Player player, @NotNull final Location spawnLocation) { + super(player); + this.spawnLocation = spawnLocation; + } @@ -32,6 +33,7 @@ index 00000000..d1d6f33c + * + * @return Location current spawn location + */ ++ @NotNull + public Location getSpawnLocation() { + return this.spawnLocation; + } @@ -41,19 +43,21 @@ index 00000000..d1d6f33c + * + * @param spawnLocation new location for the spawn + */ -+ public void setSpawnLocation(Location spawnLocation) { ++ public void setSpawnLocation(@NotNull Location spawnLocation) { + this.spawnLocation = spawnLocation; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0013-Automatically-disable-plugins-that-fail-to-load.patch b/Spigot-API-Patches/0013-Automatically-disable-plugins-that-fail-to-load.patch index b869efe76b..efd6be7c74 100644 --- a/Spigot-API-Patches/0013-Automatically-disable-plugins-that-fail-to-load.patch +++ b/Spigot-API-Patches/0013-Automatically-disable-plugins-that-fail-to-load.patch @@ -1,14 +1,14 @@ -From 022b86144f12f59ec72a1d51aa364d1dfecd590f Mon Sep 17 00:00:00 2001 +From 42102ce2e5ad6be437319492744160cde67deed9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 19:45:21 -0600 Subject: [PATCH] Automatically disable plugins that fail to load diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 54594546..bf972302 100644 +index 5b29076f..ac0702df 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -332,6 +332,10 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -340,6 +340,10 @@ public final class JavaPluginLoader implements PluginLoader { jPlugin.setEnabled(true); } catch (Throwable ex) { server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); @@ -20,5 +20,5 @@ index 54594546..bf972302 100644 // Perhaps abort here, rather than continue going, but as it stands, -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0014-Expose-server-CommandMap.patch b/Spigot-API-Patches/0014-Expose-server-CommandMap.patch index a5856c7e83..d38322b0f3 100644 --- a/Spigot-API-Patches/0014-Expose-server-CommandMap.patch +++ b/Spigot-API-Patches/0014-Expose-server-CommandMap.patch @@ -1,36 +1,38 @@ -From 1810c82d5d0939592b9bd28dff43af08b9913578 Mon Sep 17 00:00:00 2001 +From b61d6612271e90b23b9ffeb9d5a16d9df184287a Mon Sep 17 00:00:00 2001 From: kashike Date: Mon, 29 Feb 2016 19:48:59 -0600 Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 6055c801..cb7dc068 100644 +index 2ad9a7d7f..3a80f2e29 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1437,6 +1437,17 @@ public final class Bukkit { +@@ -1517,6 +1517,19 @@ public final class Bukkit { return server.getUnsafe(); } ++ + // Paper start + /** + * Gets the active {@link org.bukkit.command.CommandMap} + * + * @return the active command map + */ ++ @NotNull + public static org.bukkit.command.CommandMap getCommandMap() { + return server.getCommandMap(); + } + // Paper end + + @NotNull public static Server.Spigot spigot() { - return server.spigot(); diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1632af18..c4dc1de2 100644 +index 3ad70b92f..4c3156071 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1065,6 +1065,14 @@ public interface Server extends PluginMessageRecipient { +@@ -1132,6 +1132,15 @@ public interface Server extends PluginMessageRecipient { public double[] getTPS(); // Paper end @@ -40,11 +42,12 @@ index 1632af18..c4dc1de2 100644 + * + * @return the active command map + */ ++ @NotNull + org.bukkit.command.CommandMap getCommandMap(); + /** * Get the advancement specified by this key. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0015-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch b/Spigot-API-Patches/0015-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch index 38e38f9709..02e9adf563 100644 --- a/Spigot-API-Patches/0015-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch +++ b/Spigot-API-Patches/0015-Graduate-bungeecord-chat-API-from-spigot-subclasses.patch @@ -1,4 +1,4 @@ -From fb9cdc4061e67e97aa4bb394408fa0ed58d5980d Mon Sep 17 00:00:00 2001 +From 6bc816b2ea026b0d07a19fa4bb3453c03ed421e6 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 29 Feb 2016 19:54:32 -0600 Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses @@ -6,10 +6,10 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses Change Javadoc to be accurate diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index cb7dc068..22704949 100644 +index 3a80f2e29..e27bdb7bf 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -289,6 +289,26 @@ public final class Bukkit { +@@ -302,6 +302,26 @@ public final class Bukkit { return server.broadcastMessage(message); } @@ -19,7 +19,7 @@ index cb7dc068..22704949 100644 + * + * @param component the component to send + */ -+ public static void broadcast(net.md_5.bungee.api.chat.BaseComponent component) { ++ public static void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + server.broadcast(component); + } + @@ -28,7 +28,7 @@ index cb7dc068..22704949 100644 + * + * @param components the components to send + */ -+ public static void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { ++ public static void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + server.broadcast(components); + } + // Paper end @@ -37,12 +37,12 @@ index cb7dc068..22704949 100644 * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c4dc1de2..f4f4f291 100644 +index 4c3156071..ab0438b81 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -237,6 +237,26 @@ public interface Server extends PluginMessageRecipient { +@@ -249,6 +249,26 @@ public interface Server extends PluginMessageRecipient { */ - public int broadcastMessage(String message); + public int broadcastMessage(@NotNull String message); + // Paper start + /** @@ -50,7 +50,7 @@ index c4dc1de2..f4f4f291 100644 + * + * @param component the component to send + */ -+ public default void broadcast(net.md_5.bungee.api.chat.BaseComponent component) { ++ public default void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + spigot().broadcast(component); + } + @@ -59,7 +59,7 @@ index c4dc1de2..f4f4f291 100644 + * + * @param components the components to send + */ -+ public default void broadcast(net.md_5.bungee.api.chat.BaseComponent... components) { ++ public default void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + spigot().broadcast(components); + } + // Paper end @@ -68,12 +68,12 @@ index c4dc1de2..f4f4f291 100644 * Gets the name of the update folder. The update folder is used to safely * update plugins at the right moment on a plugin load. diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d72a7e3d..bf86eb67 100644 +index 51a145a4a..5a741b41e 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -414,6 +414,36 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -421,6 +421,38 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ - public void sendMap(MapView map); + public void sendMap(@NotNull MapView map); + // Paper start + /** @@ -81,7 +81,8 @@ index d72a7e3d..bf86eb67 100644 + * + * @param component the components to send + */ -+ public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { ++ @Override ++ public default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + spigot().sendMessage(component); + } + @@ -90,7 +91,8 @@ index d72a7e3d..bf86eb67 100644 + * + * @param components the components to send + */ -+ public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { ++ @Override ++ public default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + spigot().sendMessage(components); + } + @@ -109,5 +111,5 @@ index d72a7e3d..bf86eb67 100644 * Forces an update of the player's entire inventory. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0016-Player-Tab-List-and-Title-APIs.patch b/Spigot-API-Patches/0016-Player-Tab-List-and-Title-APIs.patch index 684a07af8d..a054fee72f 100644 --- a/Spigot-API-Patches/0016-Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-API-Patches/0016-Player-Tab-List-and-Title-APIs.patch @@ -1,4 +1,4 @@ -From 4a3c14108319be72d10d723765208489faeade93 Mon Sep 17 00:00:00 2001 +From cc380b206c9722db4792168359563441f224663a Mon Sep 17 00:00:00 2001 From: Techcable Date: Mon, 29 Feb 2016 20:02:40 -0600 Subject: [PATCH] Player Tab List and Title APIs @@ -6,16 +6,18 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/com/destroystokyo/paper/Title.java b/src/main/java/com/destroystokyo/paper/Title.java new file mode 100644 -index 00000000..3c2b63db +index 000000000..4fe18540f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/Title.java -@@ -0,0 +1,358 @@ +@@ -0,0 +1,373 @@ +package com.destroystokyo.paper; + +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.TextComponent; + +import org.bukkit.entity.Player; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; @@ -55,7 +57,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @throws NullPointerException if the title is null + */ -+ public Title(BaseComponent title) { ++ public Title(@NotNull BaseComponent title) { + this(title, null); + } + @@ -67,7 +69,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @throws NullPointerException if the title is null + */ -+ public Title(BaseComponent[] title) { ++ public Title(@NotNull BaseComponent[] title) { + this(title, null); + } + @@ -79,7 +81,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @throws NullPointerException if the title is null + */ -+ public Title(String title) { ++ public Title(@NotNull String title) { + this(title, null); + } + @@ -91,7 +93,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @param subtitle the secondary text of the title + */ -+ public Title(BaseComponent title, BaseComponent subtitle) { ++ public Title(@NotNull BaseComponent title, @Nullable BaseComponent subtitle) { + this(title, subtitle, DEFAULT_FADE_IN, DEFAULT_STAY, DEFAULT_FADE_OUT); + } + @@ -103,7 +105,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @param subtitle the secondary text of the title + */ -+ public Title(BaseComponent[] title, BaseComponent[] subtitle) { ++ public Title(@NotNull BaseComponent[] title, @Nullable BaseComponent[] subtitle) { + this(title, subtitle, DEFAULT_FADE_IN, DEFAULT_STAY, DEFAULT_FADE_OUT); + } + @@ -115,7 +117,7 @@ index 00000000..3c2b63db + * @param title the main text of the title + * @param subtitle the secondary text of the title + */ -+ public Title(String title, String subtitle) { ++ public Title(@NotNull String title, @Nullable String subtitle) { + this(title, subtitle, DEFAULT_FADE_IN, DEFAULT_STAY, DEFAULT_FADE_OUT); + } + @@ -129,7 +131,7 @@ index 00000000..3c2b63db + * @param fadeOut the number of ticks for the title to fade out + * @throws IllegalArgumentException if any of the times are negative + */ -+ public Title(BaseComponent title, BaseComponent subtitle, int fadeIn, int stay, int fadeOut) { ++ public Title(@NotNull BaseComponent title, @Nullable BaseComponent subtitle, int fadeIn, int stay, int fadeOut) { + this( + new BaseComponent[]{checkNotNull(title, "title")}, + subtitle == null ? null : new BaseComponent[]{subtitle}, @@ -149,7 +151,7 @@ index 00000000..3c2b63db + * @param fadeOut the number of ticks for the title to fade out + * @throws IllegalArgumentException if any of the times are negative + */ -+ public Title(BaseComponent[] title, BaseComponent[] subtitle, int fadeIn, int stay, int fadeOut) { ++ public Title(@Nullable BaseComponent[] title, @NotNull BaseComponent[] subtitle, int fadeIn, int stay, int fadeOut) { + checkArgument(fadeIn >= 0, "Negative fadeIn: %s", fadeIn); + checkArgument(stay >= 0, "Negative stay: %s", stay); + checkArgument(fadeOut >= 0, "Negative fadeOut: %s", fadeOut); @@ -171,7 +173,7 @@ index 00000000..3c2b63db + * @param stay the number of ticks for the title to stay on screen + * @param fadeOut the number of ticks for the title to fade out + */ -+ public Title(String title, String subtitle, int fadeIn, int stay, int fadeOut) { ++ public Title(@NotNull String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut) { + this( + TextComponent.fromLegacyText(checkNotNull(title, "title")), + subtitle == null ? null : TextComponent.fromLegacyText(subtitle), @@ -186,6 +188,7 @@ index 00000000..3c2b63db + * + * @return the text + */ ++ @NotNull + public BaseComponent[] getTitle() { + return this.title; + } @@ -195,6 +198,7 @@ index 00000000..3c2b63db + * + * @return the text + */ ++ @Nullable + public BaseComponent[] getSubtitle() { + return this.subtitle; + } @@ -232,6 +236,7 @@ index 00000000..3c2b63db + return this.fadeOut; + } + ++ @NotNull + public static Builder builder() { + return new Builder(); + } @@ -254,7 +259,8 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws NullPointerException if the title is null + */ -+ public Builder title(BaseComponent title) { ++ @NotNull ++ public Builder title(@NotNull BaseComponent title) { + return this.title(new BaseComponent[]{checkNotNull(title, "title")}); + } + @@ -265,7 +271,8 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws NullPointerException if the title is null + */ -+ public Builder title(BaseComponent[] title) { ++ @NotNull ++ public Builder title(@NotNull BaseComponent[] title) { + this.title = checkNotNull(title, "title"); + return this; + } @@ -279,7 +286,8 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws NullPointerException if the title is null + */ -+ public Builder title(String title) { ++ @NotNull ++ public Builder title(@NotNull String title) { + return this.title(TextComponent.fromLegacyText(checkNotNull(title, "title"))); + } + @@ -289,7 +297,8 @@ index 00000000..3c2b63db + * @param subtitle the title text + * @return this builder instance + */ -+ public Builder subtitle(BaseComponent subtitle) { ++ @NotNull ++ public Builder subtitle(@Nullable BaseComponent subtitle) { + return this.subtitle(subtitle == null ? null : new BaseComponent[]{subtitle}); + } + @@ -299,7 +308,8 @@ index 00000000..3c2b63db + * @param subtitle the title text + * @return this builder instance + */ -+ public Builder subtitle(BaseComponent[] subtitle) { ++ @NotNull ++ public Builder subtitle(@Nullable BaseComponent[] subtitle) { + this.subtitle = subtitle; + return this; + } @@ -312,7 +322,8 @@ index 00000000..3c2b63db + * @param subtitle the title text + * @return this builder instance + */ -+ public Builder subtitle(String subtitle) { ++ @NotNull ++ public Builder subtitle(@Nullable String subtitle) { + return this.subtitle(subtitle == null ? null : TextComponent.fromLegacyText(subtitle)); + } + @@ -323,6 +334,7 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws IllegalArgumentException if it is negative + */ ++ @NotNull + public Builder fadeIn(int fadeIn) { + checkArgument(fadeIn >= 0, "Negative fadeIn: %s", fadeIn); + this.fadeIn = fadeIn; @@ -337,6 +349,7 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws IllegalArgumentException if it is negative + */ ++ @NotNull + public Builder stay(int stay) { + checkArgument(stay >= 0, "Negative stay: %s", stay); + this.stay = stay; @@ -350,6 +363,7 @@ index 00000000..3c2b63db + * @return this builder instance + * @throws IllegalArgumentException if it is negative + */ ++ @NotNull + public Builder fadeOut(int fadeOut) { + checkArgument(fadeOut >= 0, "Negative fadeOut: %s", fadeOut); + this.fadeOut = fadeOut; @@ -362,6 +376,7 @@ index 00000000..3c2b63db + * @return a title from the values in this builder + * @throws IllegalStateException if title isn't specified + */ ++ @NotNull + public Title build() { + checkState(title != null, "Title not specified"); + return new Title(this.title, this.subtitle, this.fadeIn, this.stay, this.fadeOut); @@ -369,7 +384,7 @@ index 00000000..3c2b63db + } +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index bf86eb67..959add05 100644 +index 5a741b41e..1de43bd33 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -2,6 +2,7 @@ package org.bukkit.entity; @@ -378,9 +393,9 @@ index bf86eb67..959add05 100644 +import com.destroystokyo.paper.Title; import org.bukkit.Achievement; - import org.bukkit.ChatColor; import org.bukkit.Effect; -@@ -442,6 +443,116 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + import org.bukkit.GameMode; +@@ -451,6 +452,116 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); } @@ -391,7 +406,7 @@ index bf86eb67..959add05 100644 + * @param header content for the top of the player list + * @param footer content for the bottom of the player list + */ -+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent[] header, net.md_5.bungee.api.chat.BaseComponent[] footer); ++ public void setPlayerListHeaderFooter(@Nullable net.md_5.bungee.api.chat.BaseComponent[] header, @Nullable net.md_5.bungee.api.chat.BaseComponent[] footer); + + /** + * Set the text displayed in the player list header and footer for this player @@ -399,7 +414,7 @@ index bf86eb67..959add05 100644 + * @param header content for the top of the player list + * @param footer content for the bottom of the player list + */ -+ public void setPlayerListHeaderFooter(net.md_5.bungee.api.chat.BaseComponent header, net.md_5.bungee.api.chat.BaseComponent footer); ++ public void setPlayerListHeaderFooter(@Nullable net.md_5.bungee.api.chat.BaseComponent header, @Nullable net.md_5.bungee.api.chat.BaseComponent footer); + + /** + * Update the times for titles displayed to the player @@ -434,7 +449,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent[] title); + + /** + * Show the given title to the player, along with the last subtitle set, using the last set times @@ -442,7 +457,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent title); + + /** + * Show the given title and subtitle to the player using the given times @@ -455,7 +470,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent[] title, net.md_5.bungee.api.chat.BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent[] title, @Nullable net.md_5.bungee.api.chat.BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); + + /** + * Show the given title and subtitle to the player using the given times @@ -468,7 +483,7 @@ index bf86eb67..959add05 100644 + * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} + */ + @Deprecated -+ public void showTitle(net.md_5.bungee.api.chat.BaseComponent title, net.md_5.bungee.api.chat.BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); ++ public void showTitle(@Nullable net.md_5.bungee.api.chat.BaseComponent title, @Nullable net.md_5.bungee.api.chat.BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks); + + /** + * Show the title to the player, overriding any previously displayed title. @@ -478,7 +493,7 @@ index bf86eb67..959add05 100644 + * @param title the title to send + * @throws NullPointerException if the title is null + */ -+ void sendTitle(Title title); ++ void sendTitle(@NotNull Title title); + + /** + * Show the title to the player, overriding any previously displayed title. @@ -488,7 +503,7 @@ index bf86eb67..959add05 100644 + * @param title the title to send + * @throws NullPointerException if title is null + */ -+ void updateTitle(Title title); ++ void updateTitle(@NotNull Title title); + + /** + * Hide any title that is currently visible to the player @@ -498,5 +513,5 @@ index bf86eb67..959add05 100644 /** -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0017-Add-exception-reporting-event.patch b/Spigot-API-Patches/0017-Add-exception-reporting-event.patch index 41ac375c81..fcb3ee95d2 100644 --- a/Spigot-API-Patches/0017-Add-exception-reporting-event.patch +++ b/Spigot-API-Patches/0017-Add-exception-reporting-event.patch @@ -1,4 +1,4 @@ -From e2ae8da9f75fcb1125eb4b5d155f87c10402abdc Mon Sep 17 00:00:00 2001 +From 6c5e4653f78507a8553b8e9f915449a0ca3aa50f Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 29 Feb 2016 20:24:35 -0600 Subject: [PATCH] Add exception reporting event @@ -6,10 +6,10 @@ Subject: [PATCH] Add exception reporting event diff --git a/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java new file mode 100644 -index 00000000..4109454a +index 000000000..d3b00f741 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java -@@ -0,0 +1,37 @@ +@@ -0,0 +1,41 @@ +package com.destroystokyo.paper.event.server; + +import com.google.common.base.Preconditions; @@ -17,15 +17,16 @@ index 00000000..4109454a +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import com.destroystokyo.paper.exception.ServerException; ++import org.jetbrains.annotations.NotNull; + +/** + * Called whenever an exception is thrown in a recoverable section of the server. + */ +public class ServerExceptionEvent extends Event { + private static final HandlerList handlers = new HandlerList(); -+ private ServerException exception; ++ @NotNull private ServerException exception; + -+ public ServerExceptionEvent(ServerException exception) { ++ public ServerExceptionEvent(@NotNull ServerException exception) { + this.exception = Preconditions.checkNotNull(exception, "exception"); + } + @@ -34,22 +35,25 @@ index 00000000..4109454a + * + * @return Exception thrown + */ ++ @NotNull + public ServerException getException() { + return exception; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerCommandException.java b/src/main/java/com/destroystokyo/paper/exception/ServerCommandException.java new file mode 100644 -index 00000000..6fb39af0 +index 000000000..6fb39af04 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerCommandException.java @@ -0,0 +1,64 @@ @@ -119,7 +123,7 @@ index 00000000..6fb39af0 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java b/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java new file mode 100644 -index 00000000..410b2413 +index 000000000..410b24139 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerEventException.java @@ -0,0 +1,52 @@ @@ -177,7 +181,7 @@ index 00000000..410b2413 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerException.java b/src/main/java/com/destroystokyo/paper/exception/ServerException.java new file mode 100644 -index 00000000..c06ea394 +index 000000000..c06ea3942 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerException.java @@ -0,0 +1,23 @@ @@ -206,7 +210,7 @@ index 00000000..c06ea394 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java b/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java new file mode 100644 -index 00000000..e762ed0d +index 000000000..e762ed0db --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerInternalException.java @@ -0,0 +1,35 @@ @@ -247,7 +251,7 @@ index 00000000..e762ed0d +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginEnableDisableException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginEnableDisableException.java new file mode 100644 -index 00000000..f016ba3b +index 000000000..f016ba3b1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginEnableDisableException.java @@ -0,0 +1,20 @@ @@ -274,7 +278,7 @@ index 00000000..f016ba3b \ No newline at end of file diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java new file mode 100644 -index 00000000..6defac28 +index 000000000..6defac287 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginException.java @@ -0,0 +1,38 @@ @@ -318,7 +322,7 @@ index 00000000..6defac28 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java new file mode 100644 -index 00000000..89e13252 +index 000000000..89e132525 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java @@ -0,0 +1,64 @@ @@ -388,7 +392,7 @@ index 00000000..89e13252 +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerSchedulerException.java b/src/main/java/com/destroystokyo/paper/exception/ServerSchedulerException.java new file mode 100644 -index 00000000..2d0b2d4a +index 000000000..2d0b2d4a9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerSchedulerException.java @@ -0,0 +1,37 @@ @@ -431,7 +435,7 @@ index 00000000..2d0b2d4a +} diff --git a/src/main/java/com/destroystokyo/paper/exception/ServerTabCompleteException.java b/src/main/java/com/destroystokyo/paper/exception/ServerTabCompleteException.java new file mode 100644 -index 00000000..5582999f +index 000000000..5582999fe --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/exception/ServerTabCompleteException.java @@ -0,0 +1,22 @@ @@ -458,7 +462,7 @@ index 00000000..5582999f + } +} diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index 43e52a77..65ad78c4 100644 +index f7ec2e55f..f52d91d19 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -9,6 +9,9 @@ import java.util.Iterator; @@ -471,7 +475,7 @@ index 43e52a77..65ad78c4 100644 import org.apache.commons.lang.Validate; import org.bukkit.Location; import org.bukkit.Server; -@@ -146,11 +149,14 @@ public class SimpleCommandMap implements CommandMap { +@@ -148,11 +151,14 @@ public class SimpleCommandMap implements CommandMap { target.execute(sender, sentCommandLabel, Arrays.copyOfRange(args, 1, args.length)); target.timings.stopTiming(); // Spigot } catch (CommandException ex) { @@ -487,7 +491,7 @@ index 43e52a77..65ad78c4 100644 } // return true as command was handled -@@ -222,7 +228,9 @@ public class SimpleCommandMap implements CommandMap { +@@ -227,7 +233,9 @@ public class SimpleCommandMap implements CommandMap { } catch (CommandException ex) { throw ex; } catch (Throwable ex) { @@ -499,7 +503,7 @@ index 43e52a77..65ad78c4 100644 } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 0185934b..b7627e39 100644 +index fe5725519..4c55f5f8c 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java @@ -19,6 +19,9 @@ import java.util.logging.Level; @@ -512,7 +516,7 @@ index 0185934b..b7627e39 100644 import org.apache.commons.lang.Validate; import org.bukkit.Server; import org.bukkit.command.Command; -@@ -402,7 +405,8 @@ public final class SimplePluginManager implements PluginManager { +@@ -408,7 +411,8 @@ public final class SimplePluginManager implements PluginManager { try { plugin.getPluginLoader().enablePlugin(plugin); } catch (Throwable ex) { @@ -522,7 +526,7 @@ index 0185934b..b7627e39 100644 } HandlerList.bakeAll(); -@@ -421,36 +425,48 @@ public final class SimplePluginManager implements PluginManager { +@@ -427,36 +431,48 @@ public final class SimplePluginManager implements PluginManager { try { plugin.getPluginLoader().disablePlugin(plugin); } catch (Throwable ex) { @@ -576,7 +580,7 @@ index 0185934b..b7627e39 100644 public void clearPlugins() { synchronized (this) { disablePlugins(); -@@ -512,7 +528,13 @@ public final class SimplePluginManager implements PluginManager { +@@ -518,7 +534,13 @@ public final class SimplePluginManager implements PluginManager { )); } } catch (Throwable ex) { @@ -592,5 +596,5 @@ index 0185934b..b7627e39 100644 } } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0018-Fix-ServerListPingEvent-flagging-as-Async.patch b/Spigot-API-Patches/0018-Fix-ServerListPingEvent-flagging-as-Async.patch index 4888311280..163904e8fb 100644 --- a/Spigot-API-Patches/0018-Fix-ServerListPingEvent-flagging-as-Async.patch +++ b/Spigot-API-Patches/0018-Fix-ServerListPingEvent-flagging-as-Async.patch @@ -1,4 +1,4 @@ -From 53967b181e239d26686641531567dd5ca810eaef Mon Sep 17 00:00:00 2001 +From 1b07518a82ecb065e8b048fbf5dee4498d15c1be Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 20:26:39 -0600 Subject: [PATCH] Fix ServerListPingEvent flagging as Async @@ -30,25 +30,25 @@ index eb00d6af..70416c81 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -index 343f238f..3c38d857 100644 +index d873763d..b68d7b2f 100644 --- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java +++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java -@@ -21,6 +21,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable +@@ -23,6 +23,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable private int maxPlayers; - public ServerListPingEvent(final InetAddress address, final String motd, final int numPlayers, final int maxPlayers) { + public ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int numPlayers, final int maxPlayers) { + super(); // Paper - Is this event being fired async? Validate.isTrue(numPlayers >= 0, "Cannot have negative number of players online", numPlayers); this.address = address; this.motd = motd; -@@ -38,6 +39,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable +@@ -40,6 +41,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable * @param maxPlayers the max number of players */ - protected ServerListPingEvent(final InetAddress address, final String motd, final int maxPlayers) { + protected ServerListPingEvent(@NotNull final InetAddress address, @NotNull final String motd, final int maxPlayers) { + super(); // Paper - Is this event being fired async? this.numPlayers = MAGIC_PLAYER_COUNT; this.address = address; this.motd = motd; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0019-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch b/Spigot-API-Patches/0019-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch index 99a97e74c3..1093272840 100644 --- a/Spigot-API-Patches/0019-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch +++ b/Spigot-API-Patches/0019-Add-BaseComponent-sendMessage-methods-to-CommandSend.patch @@ -1,15 +1,15 @@ -From 325fb41de3f83292cb643328dca9fe1cf88a4285 Mon Sep 17 00:00:00 2001 +From 38ce360e0c5d461a283fd77ec5ebea7849e42728 Mon Sep 17 00:00:00 2001 From: kashike Date: Tue, 8 Mar 2016 13:05:59 -0800 Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java -index abf68a2c..fcb03b83 100644 +index 74816c63f..be11d52a0 100644 --- a/src/main/java/org/bukkit/command/CommandSender.java +++ b/src/main/java/org/bukkit/command/CommandSender.java -@@ -58,4 +58,30 @@ public interface CommandSender extends Permissible { - +@@ -62,4 +62,30 @@ public interface CommandSender extends Permissible { + @NotNull Spigot spigot(); // Spigot end + @@ -22,7 +22,7 @@ index abf68a2c..fcb03b83 100644 + * + * @param component the component to send + */ -+ default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { ++ default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent component) { + this.sendMessage(component.toLegacyText()); + } + @@ -34,31 +34,11 @@ index abf68a2c..fcb03b83 100644 + * + * @param components the components to send + */ -+ default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { ++ default void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) { + this.sendMessage(new net.md_5.bungee.api.chat.TextComponent(components).toLegacyText()); + } + // Paper end } -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 959add05..5109a0c3 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -421,6 +421,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * - * @param component the components to send - */ -+ @Override - public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent component) { - spigot().sendMessage(component); - } -@@ -430,6 +431,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * - * @param components the components to send - */ -+ @Override - public default void sendMessage(net.md_5.bungee.api.chat.BaseComponent... components) { - spigot().sendMessage(components); - } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0020-Add-methods-for-working-with-arrows-stuck-in-living-.patch b/Spigot-API-Patches/0020-Add-methods-for-working-with-arrows-stuck-in-living-.patch index f78051bfa9..cd35e01819 100644 --- a/Spigot-API-Patches/0020-Add-methods-for-working-with-arrows-stuck-in-living-.patch +++ b/Spigot-API-Patches/0020-Add-methods-for-working-with-arrows-stuck-in-living-.patch @@ -1,14 +1,14 @@ -From b7ed9b6398099edd1abbd197e97f6ccd0f3bf446 Mon Sep 17 00:00:00 2001 +From 23b2c19d3d32bb5b75160c6aaab8cde7331b8068 Mon Sep 17 00:00:00 2001 From: mrapple Date: Sun, 25 Nov 2012 13:47:27 -0600 Subject: [PATCH] Add methods for working with arrows stuck in living entities diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 8cf98673..f67711fd 100644 +index af8ea5ca..1100e305 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -453,4 +453,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -468,4 +468,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @return collision status */ boolean isCollidable(); @@ -29,5 +29,5 @@ index 8cf98673..f67711fd 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0021-Complete-resource-pack-API.patch b/Spigot-API-Patches/0021-Complete-resource-pack-API.patch index 26db8c91c6..189b85d3a2 100644 --- a/Spigot-API-Patches/0021-Complete-resource-pack-API.patch +++ b/Spigot-API-Patches/0021-Complete-resource-pack-API.patch @@ -1,24 +1,24 @@ -From 84cb83edc3529a5d89c634cf92d88e36ea7b051a Mon Sep 17 00:00:00 2001 +From 3006cdc9d1fe4ed39e0cbf17b4a2726245c0efa6 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sat, 4 Apr 2015 22:59:54 -0400 Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5109a0c3..96d97bf3 100644 +index 1de43bd33..c237073a3 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1204,7 +1204,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1212,7 +1212,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @throws IllegalArgumentException Thrown if the URL is null. * @throws IllegalArgumentException Thrown if the URL is too long. The * length restriction is an implementation specific arbitrary value. + * @deprecated use {@link #setResourcePack(String, String)} */ + @Deprecated // Paper - public void setResourcePack(String url); + public void setResourcePack(@NotNull String url); /** -@@ -1625,6 +1627,60 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1637,6 +1639,62 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void setViewDistance(int viewDistance); @@ -52,12 +52,13 @@ index 5109a0c3..96d97bf3 100644 + * @throws IllegalArgumentException Thrown if the URL is too long. The + * length restriction is an implementation specific arbitrary value. + */ -+ void setResourcePack(String url, String hash); ++ void setResourcePack(@NotNull String url, @NotNull String hash); + + /** + * @return the most recent resource pack status received from the player, + * or null if no status has ever been received from this player. + */ ++ @Nullable + org.bukkit.event.player.PlayerResourcePackStatusEvent.Status getResourcePackStatus(); + + /** @@ -66,6 +67,7 @@ index 5109a0c3..96d97bf3 100644 + * + * @deprecated This is no longer sent from the client and will always be null + */ ++ @Nullable + @Deprecated + String getResourcePackHash(); + @@ -80,10 +82,10 @@ index 5109a0c3..96d97bf3 100644 public class Spigot extends Entity.Spigot { diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java -index 4c498016..aa18a766 100644 +index b98195650..4c2102a11 100644 --- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java -@@ -10,13 +10,32 @@ import org.bukkit.event.HandlerList; +@@ -11,13 +11,32 @@ import org.jetbrains.annotations.NotNull; public class PlayerResourcePackStatusEvent extends PlayerEvent { private static final HandlerList handlers = new HandlerList(); @@ -91,7 +93,7 @@ index 4c498016..aa18a766 100644 + private final String hash; // Paper private final Status status; - public PlayerResourcePackStatusEvent(final Player who, Status resourcePackStatus) { + public PlayerResourcePackStatusEvent(@NotNull final Player who, @NotNull Status resourcePackStatus) { super(who); + this.hash = null; // Paper this.status = resourcePackStatus; @@ -117,5 +119,5 @@ index 4c498016..aa18a766 100644 * Gets the status of this pack. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch b/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch index da02c0758f..e6147b76a7 100644 --- a/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch +++ b/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch @@ -1,4 +1,4 @@ -From c3ff7d3fbb2e568bfc8c25a3c3f0857e73c2c184 Mon Sep 17 00:00:00 2001 +From 5fda55b242bfa249aed8325120b652cc33f04288 Mon Sep 17 00:00:00 2001 From: Techcable Date: Thu, 3 Mar 2016 13:20:33 -0700 Subject: [PATCH] Use ASM for event executors. @@ -6,33 +6,33 @@ Subject: [PATCH] Use ASM for event executors. Uses method handles for private or static methods. diff --git a/pom.xml b/pom.xml -index f8f12595..84ba2076 100644 +index 524231ecc..082f2f0c5 100644 --- a/pom.xml +++ b/pom.xml -@@ -116,6 +116,17 @@ - 1.3 +@@ -128,6 +128,17 @@ + 7.1 test + + + org.ow2.asm + asm -+ 6.1.1 ++ 7.1 + + + org.ow2.asm + asm-commons -+ 6.1.1 ++ 7.1 + diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java new file mode 100644 -index 00000000..9ff99e3b +index 000000000..72318d42d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java -@@ -0,0 +1,40 @@ +@@ -0,0 +1,41 @@ +package com.destroystokyo.paper.event.executor; + +import java.lang.invoke.MethodHandle; @@ -43,17 +43,18 @@ index 00000000..9ff99e3b +import org.bukkit.event.EventException; +import org.bukkit.event.Listener; +import org.bukkit.plugin.EventExecutor; ++import org.jetbrains.annotations.NotNull; + +public class MethodHandleEventExecutor implements EventExecutor { + private final Class eventClass; + private final MethodHandle handle; + -+ public MethodHandleEventExecutor(Class eventClass, MethodHandle handle) { ++ public MethodHandleEventExecutor(@NotNull Class eventClass, @NotNull MethodHandle handle) { + this.eventClass = eventClass; + this.handle = handle; + } + -+ public MethodHandleEventExecutor(Class eventClass, Method m) { ++ public MethodHandleEventExecutor(@NotNull Class eventClass, @NotNull Method m) { + this.eventClass = eventClass; + try { + m.setAccessible(true); @@ -64,7 +65,7 @@ index 00000000..9ff99e3b + } + + @Override -+ public void execute(Listener listener, Event event) throws EventException { ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { + if (!eventClass.isInstance(event)) return; + try { + handle.invoke(listener, event); @@ -75,10 +76,10 @@ index 00000000..9ff99e3b +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java new file mode 100644 -index 00000000..bac04fd8 +index 000000000..c83672427 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java -@@ -0,0 +1,41 @@ +@@ -0,0 +1,43 @@ +package com.destroystokyo.paper.event.executor; + +import java.lang.invoke.MethodHandle; @@ -94,13 +95,15 @@ index 00000000..bac04fd8 +import org.bukkit.event.EventException; +import org.bukkit.event.Listener; +import org.bukkit.plugin.EventExecutor; ++import org.jetbrains.annotations.NotNull; + +public class StaticMethodHandleEventExecutor implements EventExecutor { + private final Class eventClass; + private final MethodHandle handle; + -+ public StaticMethodHandleEventExecutor(Class eventClass, Method m) { ++ public StaticMethodHandleEventExecutor(@NotNull Class eventClass, @NotNull Method m) { + Preconditions.checkArgument(Modifier.isStatic(m.getModifiers()), "Not a static method: %s", m); ++ Preconditions.checkArgument(eventClass != null, "eventClass is null"); + this.eventClass = eventClass; + try { + m.setAccessible(true); @@ -111,7 +114,7 @@ index 00000000..bac04fd8 + } + + @Override -+ public void execute(Listener listener, Event event) throws EventException { ++ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { + if (!eventClass.isInstance(event)) return; + try { + handle.invoke(event); @@ -122,16 +125,17 @@ index 00000000..bac04fd8 +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java new file mode 100644 -index 00000000..140cf0ad +index 000000000..b6e7d8ee8 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java -@@ -0,0 +1,44 @@ +@@ -0,0 +1,47 @@ +package com.destroystokyo.paper.event.executor.asm; + +import java.lang.reflect.Method; +import java.util.concurrent.atomic.AtomicInteger; + +import org.bukkit.plugin.EventExecutor; ++import org.jetbrains.annotations.NotNull; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Type; +import org.objectweb.asm.commons.GeneratorAdapter; @@ -139,7 +143,8 @@ index 00000000..140cf0ad +import static org.objectweb.asm.Opcodes.*; + +public class ASMEventExecutorGenerator { -+ public static byte[] generateEventExecutor(Method m, String name) { ++ @NotNull ++ public static byte[] generateEventExecutor(@NotNull Method m, @NotNull String name) { + ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS); + writer.visit(V1_8, ACC_PUBLIC, name.replace('.', '/'), null, Type.getInternalName(Object.class), new String[] {Type.getInternalName(EventExecutor.class)}); + // Generate constructor @@ -165,6 +170,7 @@ index 00000000..140cf0ad + } + + public static AtomicInteger NEXT_ID = new AtomicInteger(1); ++ @NotNull + public static String generateName() { + int id = NEXT_ID.getAndIncrement(); + return "com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor" + id; @@ -172,13 +178,14 @@ index 00000000..140cf0ad +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java new file mode 100644 -index 00000000..6941d9fb +index 000000000..beed9e6e0 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java -@@ -0,0 +1,32 @@ +@@ -0,0 +1,35 @@ +package com.destroystokyo.paper.event.executor.asm; + +import com.destroystokyo.paper.utils.UnsafeUtils; ++import org.jetbrains.annotations.NotNull; + +public interface ClassDefiner { + @@ -201,8 +208,10 @@ index 00000000..6941d9fb + * @throws ClassFormatError if the class data is invalid + * @throws NullPointerException if any of the arguments are null + */ -+ public Class defineClass(ClassLoader parentLoader, String name, byte[] data); ++ @NotNull ++ public Class defineClass(@NotNull ClassLoader parentLoader, @NotNull String name, @NotNull byte[] data); + ++ @NotNull + public static ClassDefiner getInstance() { + return SafeClassDefiner.INSTANCE; + } @@ -210,10 +219,10 @@ index 00000000..6941d9fb +} diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java new file mode 100644 -index 00000000..1473ff8c +index 000000000..ac99477e9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java -@@ -0,0 +1,63 @@ +@@ -0,0 +1,66 @@ +package com.destroystokyo.paper.event.executor.asm; + +import java.util.concurrent.ConcurrentHashMap; @@ -222,6 +231,7 @@ index 00000000..1473ff8c +import com.google.common.base.Preconditions; + +import com.google.common.collect.MapMaker; ++import org.jetbrains.annotations.NotNull; +import org.objectweb.asm.Type; + +public class SafeClassDefiner implements ClassDefiner { @@ -231,8 +241,9 @@ index 00000000..1473ff8c + + private final ConcurrentMap loaders = new MapMaker().weakKeys().makeMap(); + ++ @NotNull + @Override -+ public Class defineClass(ClassLoader parentLoader, String name, byte[] data) { ++ public Class defineClass(@NotNull ClassLoader parentLoader, @NotNull String name, @NotNull byte[] data) { + GeneratedClassLoader loader = loaders.computeIfAbsent(parentLoader, GeneratedClassLoader::new); + synchronized (loader.getClassLoadingLock(name)) { + Preconditions.checkState(!loader.hasClass(name), "%s already defined", name); @@ -247,11 +258,11 @@ index 00000000..1473ff8c + ClassLoader.registerAsParallelCapable(); + } + -+ protected GeneratedClassLoader(ClassLoader parent) { ++ protected GeneratedClassLoader(@NotNull ClassLoader parent) { + super(parent); + } + -+ private Class define(String name, byte[] data) { ++ private Class define(@NotNull String name, byte[] data) { + synchronized (getClassLoadingLock(name)) { + assert !hasClass(name); + Class c = defineClass(name, data, 0, data.length); @@ -261,11 +272,12 @@ index 00000000..1473ff8c + } + + @Override -+ public Object getClassLoadingLock(String name) { ++ @NotNull ++ public Object getClassLoadingLock(@NotNull String name) { + return super.getClassLoadingLock(name); + } + -+ public boolean hasClass(String name) { ++ public boolean hasClass(@NotNull String name) { + synchronized (getClassLoadingLock(name)) { + try { + Class.forName(name); @@ -279,12 +291,13 @@ index 00000000..1473ff8c +} diff --git a/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java b/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java new file mode 100644 -index 00000000..62acbf82 +index 000000000..72e48e8ef --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/utils/UnsafeUtils.java -@@ -0,0 +1,33 @@ +@@ -0,0 +1,35 @@ +package com.destroystokyo.paper.utils; + ++import org.jetbrains.annotations.Nullable; +import sun.misc.Unsafe; + +import java.lang.reflect.Field; @@ -312,22 +325,22 @@ index 00000000..62acbf82 + return UNSAFE != null; + } + ++ @Nullable + public static Unsafe getUnsafe() { + return UNSAFE; + } +} diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java -index 3b2c99ea..b11c6ce6 100644 +index a850f0780..9026e108c 100644 --- a/src/main/java/org/bukkit/plugin/EventExecutor.java +++ b/src/main/java/org/bukkit/plugin/EventExecutor.java -@@ -4,9 +4,74 @@ import org.bukkit.event.Event; - import org.bukkit.event.EventException; +@@ -5,9 +5,75 @@ import org.bukkit.event.EventException; import org.bukkit.event.Listener; + import org.jetbrains.annotations.NotNull; +// Paper start +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; -+import java.util.HashMap; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.function.Function; @@ -343,12 +356,13 @@ index 3b2c99ea..b11c6ce6 100644 * Interface which defines the class for event call backs to plugins */ public interface EventExecutor { - public void execute(Listener listener, Event event) throws EventException; + public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException; + + // Paper start + ConcurrentMap> eventExecutorMap = new ConcurrentHashMap>() { ++ @NotNull + @Override -+ public Class computeIfAbsent(Method key, Function> mappingFunction) { ++ public Class computeIfAbsent(@NotNull Method key, @NotNull Function> mappingFunction) { + Class executorClass = get(key); + if (executorClass != null) + return executorClass; @@ -364,7 +378,8 @@ index 3b2c99ea..b11c6ce6 100644 + } + }; + -+ public static EventExecutor create(Method m, Class eventClass) { ++ @NotNull ++ public static EventExecutor create(@NotNull Method m, @NotNull Class eventClass) { + Preconditions.checkNotNull(m, "Null method"); + Preconditions.checkArgument(m.getParameterCount() != 0, "Incorrect number of arguments %s", m.getParameterCount()); + Preconditions.checkArgument(m.getParameterTypes()[0] == eventClass, "First parameter %s doesn't match event class %s", m.getParameterTypes()[0], eventClass); @@ -396,15 +411,15 @@ index 3b2c99ea..b11c6ce6 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index bf972302..77207f14 100644 +index ac0702dfb..b9bf2124b 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -290,20 +290,7 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -298,20 +298,7 @@ public final class JavaPluginLoader implements PluginLoader { } } -- EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Spigot -- public void execute(Listener listener, Event event) throws EventException { +- EventExecutor executor = new co.aikar.timings.TimedEventExecutor(new EventExecutor() { // Paper +- public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException { // Paper - try { - if (!eventClass.isAssignableFrom(event.getClass())) { - return; @@ -416,11 +431,11 @@ index bf972302..77207f14 100644 - throw new EventException(t); - } - } -- }, plugin, method, eventClass); // Spigot -+ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); // Spigot // Paper - Use factory method `EventExecutor.create()` +- }, plugin, method, eventClass); // Paper ++ EventExecutor executor = new co.aikar.timings.TimedEventExecutor(EventExecutor.create(method, eventClass), plugin, method, eventClass); // Paper // Paper (Yes.) - Use factory method `EventExecutor.create()` if (false) { // Spigot - RL handles useTimings check now eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled())); } else { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0023-Add-a-call-helper-to-Event.patch b/Spigot-API-Patches/0023-Add-a-call-helper-to-Event.patch index b67d54a1e8..086169a47a 100644 --- a/Spigot-API-Patches/0023-Add-a-call-helper-to-Event.patch +++ b/Spigot-API-Patches/0023-Add-a-call-helper-to-Event.patch @@ -1,4 +1,4 @@ -From 39a9d269c567db7d72040f7bd62befb4c4a09482 Mon Sep 17 00:00:00 2001 +From cce6ae851ef26907674e191596d14c4769c953f2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 19 May 2013 20:36:58 -0400 Subject: [PATCH] Add a call helper to Event @@ -6,17 +6,10 @@ Subject: [PATCH] Add a call helper to Event Reduces diff in Server patches diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java -index 6677e1bd..e7061112 100644 +index 18d0636b..8ec56cd6 100644 --- a/src/main/java/org/bukkit/event/Event.java +++ b/src/main/java/org/bukkit/event/Event.java -@@ -1,5 +1,6 @@ - package org.bukkit.event; - -+import org.bukkit.Bukkit; - import org.bukkit.plugin.PluginManager; - - /** -@@ -33,6 +34,22 @@ public abstract class Event { +@@ -35,6 +35,22 @@ public abstract class Event { this.async = isAsync; } @@ -27,7 +20,7 @@ index 6677e1bd..e7061112 100644 + * @return false if event was cancelled, if cancellable. otherwise true. + */ + public boolean callEvent() { -+ Bukkit.getPluginManager().callEvent(this); ++ org.bukkit.Bukkit.getPluginManager().callEvent(this); + if (this instanceof Cancellable) { + return !((Cancellable) this).isCancelled(); + } else { @@ -40,5 +33,5 @@ index 6677e1bd..e7061112 100644 * Convenience method for providing a user-friendly identifier. By * default, it is the event's class's {@linkplain Class#getSimpleName() -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0024-Add-sender-name-to-commands.yml-replacement.patch b/Spigot-API-Patches/0024-Add-sender-name-to-commands.yml-replacement.patch index 8406b7b8b4..eaca94a82a 100644 --- a/Spigot-API-Patches/0024-Add-sender-name-to-commands.yml-replacement.patch +++ b/Spigot-API-Patches/0024-Add-sender-name-to-commands.yml-replacement.patch @@ -1,4 +1,4 @@ -From 01aa5305d302cfcdfdd2fb0ba3726cf5f3e7f8cd Mon Sep 17 00:00:00 2001 +From 897b248eb3ad7bb683e285b8c144942bc9e8e951 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 22 Jul 2015 18:50:41 -0400 Subject: [PATCH] Add sender name to commands.yml replacement @@ -7,20 +7,19 @@ This allows you to use $sender in commands.yml definitions to make commands that auto target self. diff --git a/src/main/java/org/bukkit/command/FormattedCommandAlias.java b/src/main/java/org/bukkit/command/FormattedCommandAlias.java -index 9c80f464..631be1cb 100644 +index 982f0fb4..3276879d 100644 --- a/src/main/java/org/bukkit/command/FormattedCommandAlias.java +++ b/src/main/java/org/bukkit/command/FormattedCommandAlias.java -@@ -1,6 +1,9 @@ +@@ -1,6 +1,8 @@ package org.bukkit.command; import java.util.ArrayList; -+import java.util.logging.Level; -+import java.util.regex.Matcher; -+import java.util.regex.Pattern; ++import java.util.regex.Matcher; // Paper ++import java.util.regex.Pattern; // Paper import org.bukkit.Bukkit; - -@@ -19,7 +22,7 @@ public class FormattedCommandAlias extends Command { + import org.jetbrains.annotations.NotNull; +@@ -20,7 +22,7 @@ public class FormattedCommandAlias extends Command { ArrayList commands = new ArrayList(); for (String formatString : formatStrings) { try { @@ -29,12 +28,12 @@ index 9c80f464..631be1cb 100644 } catch (Throwable throwable) { if (throwable instanceof IllegalArgumentException) { sender.sendMessage(throwable.getMessage()); -@@ -37,7 +40,10 @@ public class FormattedCommandAlias extends Command { +@@ -38,7 +40,10 @@ public class FormattedCommandAlias extends Command { return result; } -- private String buildCommand(String formatString, String[] args) { -+ private String buildCommand(CommandSender sender, String formatString, String[] args) { // Paper +- private String buildCommand(@NotNull String formatString, @NotNull String[] args) { ++ private String buildCommand(@NotNull CommandSender sender, @NotNull String formatString, @NotNull String[] args) { // Paper + if (formatString.contains("$sender")) { // Paper + formatString = formatString.replaceAll(Pattern.quote("$sender"), Matcher.quoteReplacement(sender.getName())); // Paper + } // Paper @@ -42,5 +41,5 @@ index 9c80f464..631be1cb 100644 while (index != -1) { int start = index; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0025-Add-command-to-reload-permissions.yml-and-require-co.patch b/Spigot-API-Patches/0025-Add-command-to-reload-permissions.yml-and-require-co.patch index a6c93beaf5..ac9ffc0e9d 100644 --- a/Spigot-API-Patches/0025-Add-command-to-reload-permissions.yml-and-require-co.patch +++ b/Spigot-API-Patches/0025-Add-command-to-reload-permissions.yml-and-require-co.patch @@ -1,4 +1,4 @@ -From 0e952a407295877a6c5dd1afc482fc75ef8ba8f9 Mon Sep 17 00:00:00 2001 +From 9ffedfc9f2e8b401d42cf593c943f35d508d828e Mon Sep 17 00:00:00 2001 From: William Date: Fri, 18 Mar 2016 03:28:07 -0400 Subject: [PATCH] Add command to reload permissions.yml and require confirm to @@ -6,10 +6,10 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 22704949..2d588c6b 100644 +index e27bdb7bf..d009aebd6 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1466,6 +1466,13 @@ public final class Bukkit { +@@ -1548,6 +1548,13 @@ public final class Bukkit { public static org.bukkit.command.CommandMap getCommandMap() { return server.getCommandMap(); } @@ -22,24 +22,24 @@ index 22704949..2d588c6b 100644 + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index f4f4f291..18e5dd48 100644 +index ab0438b81..e7e7dab8c 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1279,4 +1279,6 @@ public interface Server extends PluginMessageRecipient { - +@@ -1366,4 +1366,6 @@ public interface Server extends PluginMessageRecipient { + @NotNull Spigot spigot(); // Spigot end + + void reloadPermissions(); // Paper } diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java -index 0ab7e295..f331a442 100644 +index 1104c6037..ba118dbfe 100644 --- a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java -@@ -13,15 +13,36 @@ public class ReloadCommand extends BukkitCommand { - public ReloadCommand(String name) { +@@ -14,15 +14,35 @@ public class ReloadCommand extends BukkitCommand { + public ReloadCommand(@NotNull String name) { super(name); this.description = "Reloads the server configuration and plugins"; - this.usageMessage = "/reload"; @@ -49,8 +49,8 @@ index 0ab7e295..f331a442 100644 } @Override - public boolean execute(CommandSender sender, String currentAlias, String[] args) { -+ +- public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { ++ public boolean execute(@NotNull CommandSender sender, @NotNull String currentAlias, @NotNull String[] args) { // Paper if (!testPermission(sender)) return true; + // Paper start - Reload permissions.yml & require confirm @@ -76,23 +76,21 @@ index 0ab7e295..f331a442 100644 Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues when using some plugins."); Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server."); Bukkit.reload(); -@@ -31,7 +52,7 @@ public class ReloadCommand extends BukkitCommand { - } - +@@ -34,6 +54,6 @@ public class ReloadCommand extends BukkitCommand { + @NotNull @Override -- public List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { + public List tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException { - return Collections.emptyList(); -+ public java.util.List tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { + return java.util.Collections.singletonList("permissions"); // Paper } } diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index b7627e39..5034215a 100644 +index 4c55f5f8c..12e17709c 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -@@ -764,4 +764,13 @@ public final class SimplePluginManager implements PluginManager { +@@ -777,4 +777,13 @@ public final class SimplePluginManager implements PluginManager { public void useTimings(boolean use) { - co.aikar.timings.Timings.setTimingsEnabled(use); // Spigot + co.aikar.timings.Timings.setTimingsEnabled(use); // Paper } + + // Paper start @@ -105,5 +103,5 @@ index b7627e39..5034215a 100644 + } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0026-Custom-replacement-for-eaten-items.patch b/Spigot-API-Patches/0026-Custom-replacement-for-eaten-items.patch index f865d52404..7b36dc0aaf 100644 --- a/Spigot-API-Patches/0026-Custom-replacement-for-eaten-items.patch +++ b/Spigot-API-Patches/0026-Custom-replacement-for-eaten-items.patch @@ -1,23 +1,14 @@ -From ecd8d3e4642c78e5943717aed64df470aa7f83c9 Mon Sep 17 00:00:00 2001 +From 3221e9c9ac4d74ffe7e815253fc93a2bd323a958 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sun, 21 Jun 2015 15:05:21 -0400 Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java -index 8ab76b1d..7d28155b 100644 +index ee0f95b1..864c0a9e 100644 --- a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java -@@ -6,6 +6,8 @@ import org.bukkit.event.Cancellable; - import org.bukkit.event.HandlerList; - import org.bukkit.inventory.ItemStack; - -+import javax.annotation.Nullable; -+ - /** - * This event will fire when a player is finishing consuming an item (food, - * potion, milk bucket). -@@ -20,6 +22,7 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { +@@ -22,6 +22,7 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean isCancelled = false; private ItemStack item; @@ -25,7 +16,7 @@ index 8ab76b1d..7d28155b 100644 /** * @param player the player consuming -@@ -55,6 +58,29 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { +@@ -58,6 +59,29 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable { } } @@ -56,5 +47,5 @@ index 8ab76b1d..7d28155b 100644 return this.isCancelled; } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0027-Access-items-by-EquipmentSlot.patch b/Spigot-API-Patches/0027-Access-items-by-EquipmentSlot.patch index 3d4e37b8c7..ae97abc291 100644 --- a/Spigot-API-Patches/0027-Access-items-by-EquipmentSlot.patch +++ b/Spigot-API-Patches/0027-Access-items-by-EquipmentSlot.patch @@ -1,16 +1,16 @@ -From 1d864e4056e3e6dbfbdc8675781c0310b9215925 Mon Sep 17 00:00:00 2001 +From 14d0514052df4c676af720494e3e328846fa3483 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sun, 20 Mar 2016 06:44:49 -0400 Subject: [PATCH] Access items by EquipmentSlot diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java -index fc5772e8..d56f6e00 100644 +index ef55b1463..eb71f01e4 100644 --- a/src/main/java/org/bukkit/inventory/PlayerInventory.java +++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java -@@ -202,4 +202,22 @@ public interface PlayerInventory extends Inventory { - public void setHeldItemSlot(int slot); +@@ -214,4 +214,23 @@ public interface PlayerInventory extends Inventory { + @Nullable public HumanEntity getHolder(); + + // Paper start @@ -20,7 +20,8 @@ index fc5772e8..d56f6e00 100644 + * @param slot The slot + * @return The item stack in the slot + */ -+ ItemStack getItem(EquipmentSlot slot); ++ @Nullable ++ ItemStack getItem(@NotNull EquipmentSlot slot); + + /** + * Sets the {@link ItemStack} at the given {@link EquipmentSlot}. @@ -28,9 +29,9 @@ index fc5772e8..d56f6e00 100644 + * @param slot The slot for the stack + * @param stack The item stack to set + */ -+ void setItem(EquipmentSlot slot, ItemStack stack); ++ void setItem(@NotNull EquipmentSlot slot, @Nullable ItemStack stack); + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0028-Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-API-Patches/0028-Entity-AddTo-RemoveFrom-World-Events.patch index a77334e951..b3006109de 100644 --- a/Spigot-API-Patches/0028-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-API-Patches/0028-Entity-AddTo-RemoveFrom-World-Events.patch @@ -1,4 +1,4 @@ -From 317c71255861fe7a849577db4f289473425bd0d6 Mon Sep 17 00:00:00 2001 +From a07f747027ae1079c6e620e5881667686c265c13 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 20:26:34 -0400 Subject: [PATCH] Entity AddTo/RemoveFrom World Events @@ -6,16 +6,17 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java new file mode 100644 -index 00000000..18b158cd +index 000000000..07660202e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java -@@ -0,0 +1,29 @@ +@@ -0,0 +1,32 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Entity; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired any time an entity is being added to the world for any reason. @@ -25,52 +26,57 @@ index 00000000..18b158cd + */ +public class EntityAddToWorldEvent extends EntityEvent { + -+ public EntityAddToWorldEvent(Entity entity) { ++ public EntityAddToWorldEvent(@NotNull Entity entity) { + super(entity); + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java new file mode 100644 -index 00000000..800be6aa +index 000000000..e5dbbd660 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java -@@ -0,0 +1,26 @@ +@@ -0,0 +1,29 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Entity; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired any time an entity is being removed from a world for any reason + */ +public class EntityRemoveFromWorldEvent extends EntityEvent { + -+ public EntityRemoveFromWorldEvent(Entity entity) { ++ public EntityRemoveFromWorldEvent(@NotNull Entity entity) { + super(entity); + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0029-EntityPathfindEvent.patch b/Spigot-API-Patches/0029-EntityPathfindEvent.patch index 78b69ec3b5..93acc43a25 100644 --- a/Spigot-API-Patches/0029-EntityPathfindEvent.patch +++ b/Spigot-API-Patches/0029-EntityPathfindEvent.patch @@ -1,4 +1,4 @@ -From b9ed451873b6f1026308d423f636604f07fcf31c Mon Sep 17 00:00:00 2001 +From fa357068acea340946c5984451c2889eb725c7ac Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 28 Mar 2016 21:15:34 -0400 Subject: [PATCH] EntityPathfindEvent @@ -7,10 +7,10 @@ Fires when an Entity decides to start moving to a location. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java new file mode 100644 -index 00000000..0e4902d9 +index 000000000..63e46b2fb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java -@@ -0,0 +1,74 @@ +@@ -0,0 +1,82 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.Location; @@ -18,6 +18,8 @@ index 00000000..0e4902d9 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Fired when an Entity decides to start moving towards a location. @@ -26,9 +28,10 @@ index 00000000..0e4902d9 + * is choosing to start moving to a location. + */ +public class EntityPathfindEvent extends EntityEvent implements Cancellable { -+ private final Entity targetEntity; -+ private final Location loc; -+ public EntityPathfindEvent(Entity entity, Location loc, Entity targetEntity) { ++ @Nullable private final Entity targetEntity; ++ @NotNull private final Location loc; ++ ++ public EntityPathfindEvent(@NotNull Entity entity, @NotNull Location loc, @Nullable Entity targetEntity) { + super(entity); + this.targetEntity = targetEntity; + this.loc = loc; @@ -38,6 +41,7 @@ index 00000000..0e4902d9 + * The Entity that is pathfinding. + * @return The Entity that is pathfinding. + */ ++ @NotNull + public Entity getEntity() { + return entity; + } @@ -49,6 +53,7 @@ index 00000000..0e4902d9 + * + * @return The entity target or null + */ ++ @Nullable + public Entity getTargetEntity() { + return targetEntity; + } @@ -59,16 +64,19 @@ index 00000000..0e4902d9 + * Note that if the target happened to of been an entity + * @return Location of where the entity is trying to pathfind to. + */ ++ @NotNull + public Location getLoc() { + return loc; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -86,5 +94,5 @@ index 00000000..0e4902d9 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0030-Reduce-thread-synchronization-in-MetadataStoreBase.patch b/Spigot-API-Patches/0030-Reduce-thread-synchronization-in-MetadataStoreBase.patch index dfdb525daf..47b328d4ae 100644 --- a/Spigot-API-Patches/0030-Reduce-thread-synchronization-in-MetadataStoreBase.patch +++ b/Spigot-API-Patches/0030-Reduce-thread-synchronization-in-MetadataStoreBase.patch @@ -1,4 +1,4 @@ -From 6c27ed542ca4cd73af3d8ae98f29511c827003f3 Mon Sep 17 00:00:00 2001 +From 3fe3136ff948b8361bfadeb5e0acd6836bf8831c Mon Sep 17 00:00:00 2001 From: crast Date: Sat, 1 Jun 2013 13:52:30 -0600 Subject: [PATCH] Reduce thread synchronization in MetadataStoreBase @@ -8,31 +8,22 @@ limited synchronized portions to allow much higher concurrency in MetadataStore as well as far less locking, especially on reads diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -index 093c1445..64c0f0a7 100644 +index 9dbc32d8..32728628 100644 --- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -@@ -4,9 +4,10 @@ import org.apache.commons.lang.Validate; - import org.bukkit.plugin.Plugin; +@@ -5,9 +5,10 @@ import org.bukkit.plugin.Plugin; + import org.jetbrains.annotations.NotNull; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; public abstract class MetadataStoreBase { - private Map> metadataMap = new HashMap>(); -+ private Map> metadataMap = new ConcurrentHashMap>(); ++ private Map> metadataMap = new ConcurrentHashMap>(); // Paper /** * Adds a metadata value to an object. Each metadata value is owned by a -@@ -30,7 +31,7 @@ public abstract class MetadataStoreBase { - * @throws IllegalArgumentException If value is null, or the owning plugin - * is null - */ -- public synchronized void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) { -+ public void setMetadata(T subject, String metadataKey, MetadataValue newMetadataValue) { - Validate.notNull(newMetadataValue, "Value cannot be null"); - Plugin owningPlugin = newMetadataValue.getOwningPlugin(); - Validate.notNull(owningPlugin, "Plugin cannot be null"); -@@ -40,7 +41,9 @@ public abstract class MetadataStoreBase { +@@ -41,7 +42,9 @@ public abstract class MetadataStoreBase { entry = new WeakHashMap(1); metadataMap.put(key, entry); } @@ -43,12 +34,12 @@ index 093c1445..64c0f0a7 100644 } /** -@@ -53,10 +56,11 @@ public abstract class MetadataStoreBase { - * requested value. +@@ -55,10 +58,11 @@ public abstract class MetadataStoreBase { * @see MetadataStore#getMetadata(Object, String) */ -- public synchronized List getMetadata(T subject, String metadataKey) { -+ public List getMetadata(T subject, String metadataKey) { + @NotNull +- public synchronized List getMetadata(@NotNull T subject, @NotNull String metadataKey) { ++ public List getMetadata(@NotNull T subject, @NotNull String metadataKey) { // Paper String key = disambiguate(subject, metadataKey); - if (metadataMap.containsKey(key)) { - Collection values = metadataMap.get(key).values(); @@ -58,21 +49,21 @@ index 093c1445..64c0f0a7 100644 return Collections.unmodifiableList(new ArrayList(values)); } else { return Collections.emptyList(); -@@ -71,7 +75,7 @@ public abstract class MetadataStoreBase { +@@ -73,7 +77,7 @@ public abstract class MetadataStoreBase { * @param metadataKey the unique metadata key being queried. * @return the existence of the metadataKey within subject. */ -- public synchronized boolean hasMetadata(T subject, String metadataKey) { -+ public boolean hasMetadata(T subject, String metadataKey) { +- public synchronized boolean hasMetadata(@NotNull T subject, @NotNull String metadataKey) { ++ public boolean hasMetadata(@NotNull T subject, @NotNull String metadataKey) { // Paper String key = disambiguate(subject, metadataKey); return metadataMap.containsKey(key); } -@@ -87,17 +91,18 @@ public abstract class MetadataStoreBase { +@@ -89,17 +93,18 @@ public abstract class MetadataStoreBase { * org.bukkit.plugin.Plugin) * @throws IllegalArgumentException If plugin is null */ -- public synchronized void removeMetadata(T subject, String metadataKey, Plugin owningPlugin) { -+ public void removeMetadata(T subject, String metadataKey, Plugin owningPlugin) { +- public synchronized void removeMetadata(@NotNull T subject, @NotNull String metadataKey, @NotNull Plugin owningPlugin) { ++ public void removeMetadata(@NotNull T subject, @NotNull String metadataKey, @NotNull Plugin owningPlugin) { // Paper Validate.notNull(owningPlugin, "Plugin cannot be null"); String key = disambiguate(subject, metadataKey); Map entry = metadataMap.get(key); @@ -91,15 +82,15 @@ index 093c1445..64c0f0a7 100644 } } -@@ -110,7 +115,7 @@ public abstract class MetadataStoreBase { +@@ -112,7 +117,7 @@ public abstract class MetadataStoreBase { * @see MetadataStore#invalidateAll(org.bukkit.plugin.Plugin) * @throws IllegalArgumentException If plugin is null */ -- public synchronized void invalidateAll(Plugin owningPlugin) { -+ public void invalidateAll(Plugin owningPlugin) { +- public synchronized void invalidateAll(@NotNull Plugin owningPlugin) { ++ public void invalidateAll(@NotNull Plugin owningPlugin) { // Paper Validate.notNull(owningPlugin, "Plugin cannot be null"); for (Map values : metadataMap.values()) { if (values.containsKey(owningPlugin)) { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0031-Add-MetadataStoreBase.removeAll-Plugin.patch b/Spigot-API-Patches/0031-Add-MetadataStoreBase.removeAll-Plugin.patch index 62ea7f24a7..3a229e0398 100644 --- a/Spigot-API-Patches/0031-Add-MetadataStoreBase.removeAll-Plugin.patch +++ b/Spigot-API-Patches/0031-Add-MetadataStoreBase.removeAll-Plugin.patch @@ -1,4 +1,4 @@ -From 28cef08075786587ecc702ad3dab4bc06d3ce624 Mon Sep 17 00:00:00 2001 +From 0ae676c5ab5d5819d3e94e9ec554162a34fffa28 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 16 Jul 2013 21:26:50 -0400 Subject: [PATCH] Add MetadataStoreBase.removeAll(Plugin) @@ -6,10 +6,10 @@ Subject: [PATCH] Add MetadataStoreBase.removeAll(Plugin) So that on reload, metadata will be cleared diff --git a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -index 64c0f0a7..6da6abd8 100644 +index 32728628e..b634b124e 100644 --- a/src/main/java/org/bukkit/metadata/MetadataStoreBase.java +++ b/src/main/java/org/bukkit/metadata/MetadataStoreBase.java -@@ -124,6 +124,26 @@ public abstract class MetadataStoreBase { +@@ -126,6 +126,26 @@ public abstract class MetadataStoreBase { } } @@ -20,7 +20,7 @@ index 64c0f0a7..6da6abd8 100644 + * @param owningPlugin the plugin requesting the invalidation. + * @throws IllegalArgumentException If plugin is null + */ -+ public void removeAll(Plugin owningPlugin) { ++ public void removeAll(@NotNull Plugin owningPlugin) { + Validate.notNull(owningPlugin, "Plugin cannot be null"); + for (Iterator> iterator = metadataMap.values().iterator(); iterator.hasNext(); ) { + Map values = iterator.next(); @@ -37,5 +37,5 @@ index 64c0f0a7..6da6abd8 100644 * Creates a unique name for the object receiving metadata by combining * unique data from the subject with a metadataKey. -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0032-Add-PlayerUseUnknownEntityEvent.patch b/Spigot-API-Patches/0032-Add-PlayerUseUnknownEntityEvent.patch index e7f9b3070d..9f99f16b05 100644 --- a/Spigot-API-Patches/0032-Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-API-Patches/0032-Add-PlayerUseUnknownEntityEvent.patch @@ -1,4 +1,4 @@ -From 0e2bcd42ff189af6160bf962e5c8371b067d9cd9 Mon Sep 17 00:00:00 2001 +From adf141eaef52e9506de1c92a9145d884468f277f Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Sat, 2 Apr 2016 05:08:36 -0400 Subject: [PATCH] Add PlayerUseUnknownEntityEvent @@ -6,25 +6,26 @@ Subject: [PATCH] Add PlayerUseUnknownEntityEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java new file mode 100644 -index 00000000..70eeaf5c +index 000000000..09cfdf48e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java -@@ -0,0 +1,42 @@ +@@ -0,0 +1,46 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.EquipmentSlot; ++import org.jetbrains.annotations.NotNull; + +public class PlayerUseUnknownEntityEvent extends PlayerEvent { + + private static final HandlerList handlers = new HandlerList(); + private final int entityId; + private final boolean attack; -+ private final EquipmentSlot hand; ++ @NotNull private final EquipmentSlot hand; + -+ public PlayerUseUnknownEntityEvent(Player who, int entityId, boolean attack, EquipmentSlot hand) { ++ public PlayerUseUnknownEntityEvent(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand) { + super(who); + this.entityId = entityId; + this.attack = attack; @@ -39,19 +40,22 @@ index 00000000..70eeaf5c + return this.attack; + } + ++ @NotNull + public EquipmentSlot getHand() { + return this.hand; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0033-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-API-Patches/0033-Add-handshake-event-to-allow-plugins-to-handle-clien.patch index 40c9577fd9..ab7078a048 100644 --- a/Spigot-API-Patches/0033-Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/Spigot-API-Patches/0033-Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -1,4 +1,4 @@ -From 9cab068579819105524d58de846e54b9a4050bb2 Mon Sep 17 00:00:00 2001 +From 55a53dc9696b2fa72c0d886729547b776cd0a76a Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 13 Apr 2016 20:20:18 -0700 Subject: [PATCH] Add handshake event to allow plugins to handle client @@ -7,10 +7,10 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java new file mode 100644 -index 00000000..e44d03a2 +index 000000000..46d6f6ad6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java -@@ -0,0 +1,211 @@ +@@ -0,0 +1,221 @@ +package com.destroystokyo.paper.event.player; + +import org.apache.commons.lang.Validate; @@ -19,6 +19,8 @@ index 00000000..e44d03a2 +import org.bukkit.event.HandlerList; + +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * This event is fired during a player handshake. @@ -31,12 +33,12 @@ index 00000000..e44d03a2 +public class PlayerHandshakeEvent extends Event implements Cancellable { + + private static final HandlerList HANDLERS = new HandlerList(); -+ private final String originalHandshake; ++ @NotNull private final String originalHandshake; + private boolean cancelled; -+ private String serverHostname; -+ private String socketAddressHostname; -+ private UUID uniqueId; -+ private String propertiesJson; ++ @Nullable private String serverHostname; ++ @Nullable private String socketAddressHostname; ++ @Nullable private UUID uniqueId; ++ @Nullable private String propertiesJson; + private boolean failed; + private String failMessage = "If you wish to use IP forwarding, please enable it in your BungeeCord config as well!"; + @@ -46,7 +48,7 @@ index 00000000..e44d03a2 + * @param originalHandshake the original handshake string + * @param cancelled if this event is enabled + */ -+ public PlayerHandshakeEvent(String originalHandshake, boolean cancelled) { ++ public PlayerHandshakeEvent(@NotNull String originalHandshake, boolean cancelled) { + this.originalHandshake = originalHandshake; + this.cancelled = cancelled; + } @@ -82,6 +84,7 @@ index 00000000..e44d03a2 + * + * @return the original handshake string + */ ++ @NotNull + public String getOriginalHandshake() { + return this.originalHandshake; + } @@ -93,6 +96,7 @@ index 00000000..e44d03a2 + * + * @return the server hostname string + */ ++ @Nullable + public String getServerHostname() { + return this.serverHostname; + } @@ -104,7 +108,7 @@ index 00000000..e44d03a2 + * + * @param serverHostname the server hostname string + */ -+ public void setServerHostname(String serverHostname) { ++ public void setServerHostname(@NotNull String serverHostname) { + this.serverHostname = serverHostname; + } + @@ -115,6 +119,7 @@ index 00000000..e44d03a2 + * + * @return the socket address hostname string + */ ++ @Nullable + public String getSocketAddressHostname() { + return this.socketAddressHostname; + } @@ -126,7 +131,7 @@ index 00000000..e44d03a2 + * + * @param socketAddressHostname the socket address hostname string + */ -+ public void setSocketAddressHostname(String socketAddressHostname) { ++ public void setSocketAddressHostname(@NotNull String socketAddressHostname) { + this.socketAddressHostname = socketAddressHostname; + } + @@ -135,6 +140,7 @@ index 00000000..e44d03a2 + * + * @return the unique id + */ ++ @Nullable + public UUID getUniqueId() { + return this.uniqueId; + } @@ -144,7 +150,7 @@ index 00000000..e44d03a2 + * + * @param uniqueId the unique id + */ -+ public void setUniqueId(UUID uniqueId) { ++ public void setUniqueId(@NotNull UUID uniqueId) { + this.uniqueId = uniqueId; + } + @@ -155,6 +161,7 @@ index 00000000..e44d03a2 + * + * @return the profile properties, as JSON + */ ++ @Nullable + public String getPropertiesJson() { + return this.propertiesJson; + } @@ -190,7 +197,7 @@ index 00000000..e44d03a2 + * + * @param propertiesJson the profile properties, as JSON + */ -+ public void setPropertiesJson(String propertiesJson) { ++ public void setPropertiesJson(@NotNull String propertiesJson) { + this.propertiesJson = propertiesJson; + } + @@ -199,6 +206,7 @@ index 00000000..e44d03a2 + * + * @return the message to display to the client + */ ++ @NotNull + public String getFailMessage() { + return this.failMessage; + } @@ -208,20 +216,22 @@ index 00000000..e44d03a2 + * + * @param failMessage the message to display to the client + */ -+ public void setFailMessage(String failMessage) { ++ public void setFailMessage(@NotNull String failMessage) { + Validate.notEmpty(failMessage, "fail message cannot be null or empty"); + this.failMessage = failMessage; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return HANDLERS; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return HANDLERS; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0034-Arrow-pickup-rule-API.patch b/Spigot-API-Patches/0034-Arrow-pickup-rule-API.patch index 00ef787774..e111fa2077 100644 --- a/Spigot-API-Patches/0034-Arrow-pickup-rule-API.patch +++ b/Spigot-API-Patches/0034-Arrow-pickup-rule-API.patch @@ -1,14 +1,14 @@ -From 14622209c86028ac63d81543497dfa48290ba377 Mon Sep 17 00:00:00 2001 +From 2286649eb07e4a21436f8d660059dd6fa2f47641 Mon Sep 17 00:00:00 2001 From: Jedediah Smith Date: Fri, 4 Mar 2016 03:13:18 -0500 Subject: [PATCH] Arrow pickup rule API diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java -index b74d5f9d..99a44006 100644 +index 99f73a2b..b63f2fd9 100644 --- a/src/main/java/org/bukkit/entity/Arrow.java +++ b/src/main/java/org/bukkit/entity/Arrow.java -@@ -144,4 +144,38 @@ public interface Arrow extends Projectile { +@@ -149,4 +149,38 @@ public interface Arrow extends Projectile { @Override Spigot spigot(); // Spigot end @@ -48,5 +48,5 @@ index b74d5f9d..99a44006 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0035-EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-API-Patches/0035-EntityRegainHealthEvent-isFastRegen-API.patch index f383a3a4bb..b34d90df3f 100644 --- a/Spigot-API-Patches/0035-EntityRegainHealthEvent-isFastRegen-API.patch +++ b/Spigot-API-Patches/0035-EntityRegainHealthEvent-isFastRegen-API.patch @@ -1,25 +1,25 @@ -From 927a3bee043bc15d1c0c0f60be3e4afb3f440ab6 Mon Sep 17 00:00:00 2001 +From e7360254c9b8b35b93943d7608685f5c7ffd20e1 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Fri, 22 Apr 2016 01:43:11 -0500 Subject: [PATCH] EntityRegainHealthEvent isFastRegen API diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java -index 976b80b7..a5ac3edf 100644 +index 8feb6698..d51d2ec1 100644 --- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java -@@ -12,12 +12,31 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable +@@ -13,12 +13,31 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable private boolean cancelled; private double amount; private final RegainReason regainReason; + private final boolean isFastRegen; // Paper - public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason) { + public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason) { + // Paper start - Forward + this(entity, amount, regainReason, false); + } + -+ public EntityRegainHealthEvent(final Entity entity, final double amount, final RegainReason regainReason, boolean isFastRegen) { ++ public EntityRegainHealthEvent(@NotNull final Entity entity, final double amount, @NotNull final RegainReason regainReason, boolean isFastRegen) { + // Paper end super(entity); this.amount = amount; @@ -41,5 +41,5 @@ index 976b80b7..a5ac3edf 100644 /** * Gets the amount of regained health -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0036-LootTable-API.patch b/Spigot-API-Patches/0036-LootTable-API.patch index 9cb37f08a5..d3fc4c25d9 100644 --- a/Spigot-API-Patches/0036-LootTable-API.patch +++ b/Spigot-API-Patches/0036-LootTable-API.patch @@ -1,4 +1,4 @@ -From 8c74a2e04e4a744068d564312cd647bc53898a59 Mon Sep 17 00:00:00 2001 +From fe6d16006ce532f553e149aa9943ba4776afad0b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 1 May 2016 15:19:49 -0400 Subject: [PATCH] LootTable API @@ -12,13 +12,14 @@ Provides methods to determine players looted state for an object 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 00000000..9095df61 +index 000000000..92d7b853a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableBlockInventory.java -@@ -0,0 +1,15 @@ +@@ -0,0 +1,17 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.block.Block; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents an Inventory that can generate loot, such as Chests inside of Fortresses and Mineshafts @@ -29,17 +30,19 @@ index 00000000..9095df61 + * Gets the block that is lootable + * @return The Block + */ ++ @NotNull + Block getBlock(); +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableEntityInventory.java b/src/main/java/com/destroystokyo/paper/loottable/LootableEntityInventory.java new file mode 100644 -index 00000000..a389f74c +index 000000000..b387894fe --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableEntityInventory.java -@@ -0,0 +1,15 @@ +@@ -0,0 +1,17 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.entity.Entity; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents an Inventory that can generate loot, such as Minecarts inside of Mineshafts @@ -50,20 +53,23 @@ index 00000000..a389f74c + * Gets the entity that is lootable + * @return The Entity + */ ++ @NotNull + Entity getEntity(); +} 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 00000000..2fc3e8a1 +index 000000000..97815eeb2 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java -@@ -0,0 +1,112 @@ +@@ -0,0 +1,116 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.entity.Player; +import org.bukkit.loot.Lootable; + +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents an Inventory that contains a Loot Table associated to it that will @@ -95,7 +101,7 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Whether or not this player has looted this block + */ -+ default boolean hasPlayerLooted(Player player) { ++ default boolean hasPlayerLooted(@NotNull Player player) { + return hasPlayerLooted(player.getUniqueId()); + } + @@ -104,7 +110,7 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Whether or not this player has looted this block + */ -+ boolean hasPlayerLooted(UUID player); ++ boolean hasPlayerLooted(@NotNull UUID player); + + /** + * Gets the timestamp, in milliseconds, of when the player last looted this object @@ -112,7 +118,8 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Timestamp last looted, or null if player has not looted this object + */ -+ default Long getLastLooted(Player player) { ++ @Nullable ++ default Long getLastLooted(@NotNull Player player) { + return getLastLooted(player.getUniqueId()); + } + @@ -122,7 +129,8 @@ index 00000000..2fc3e8a1 + * @param player The player to check + * @return Timestamp last looted, or null if player has not looted this object + */ -+ Long getLastLooted(UUID player); ++ @Nullable ++ Long getLastLooted(@NotNull UUID player); + + /** + * Change the state of whether or not a player has looted this block @@ -130,7 +138,7 @@ index 00000000..2fc3e8a1 + * @param looted true to add player to looted list, false to remove + * @return The previous state of whether the player had looted this or not + */ -+ default boolean setHasPlayerLooted(Player player, boolean looted) { ++ default boolean setHasPlayerLooted(@NotNull Player player, boolean looted) { + return setHasPlayerLooted(player.getUniqueId(), looted); + } + @@ -140,7 +148,7 @@ index 00000000..2fc3e8a1 + * @param looted true to add player to looted list, false to remove + * @return The previous state of whether the player had looted this or not + */ -+ boolean setHasPlayerLooted(UUID player, boolean looted); ++ boolean setHasPlayerLooted(@NotNull UUID player, boolean looted); + + /** + * Returns Whether or not this object has been filled and now has a pending refill @@ -172,35 +180,39 @@ index 00000000..2fc3e8a1 +} diff --git a/src/main/java/com/destroystokyo/paper/loottable/LootableInventoryReplenishEvent.java b/src/main/java/com/destroystokyo/paper/loottable/LootableInventoryReplenishEvent.java new file mode 100644 -index 00000000..2169493d +index 000000000..fd184f13f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventoryReplenishEvent.java -@@ -0,0 +1,41 @@ +@@ -0,0 +1,45 @@ +package com.destroystokyo.paper.loottable; + +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +public class LootableInventoryReplenishEvent extends PlayerEvent implements Cancellable { -+ private final LootableInventory inventory; ++ @NotNull private final LootableInventory inventory; + -+ public LootableInventoryReplenishEvent(Player player, LootableInventory inventory) { ++ public LootableInventoryReplenishEvent(@NotNull Player player, @NotNull LootableInventory inventory) { + super(player); + this.inventory = inventory; + } + ++ @NotNull + public LootableInventory getInventory() { + return inventory; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -218,7 +230,7 @@ index 00000000..2169493d + } +} diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java -index 815d79a5..b68ab881 100644 +index c553891e0..eb475ec84 100644 --- a/src/main/java/org/bukkit/block/Chest.java +++ b/src/main/java/org/bukkit/block/Chest.java @@ -1,5 +1,6 @@ @@ -228,7 +240,7 @@ index 815d79a5..b68ab881 100644 import org.bukkit.Nameable; import org.bukkit.inventory.Inventory; import org.bukkit.loot.Lootable; -@@ -7,7 +8,7 @@ import org.bukkit.loot.Lootable; +@@ -8,7 +9,7 @@ import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a chest. */ @@ -238,7 +250,7 @@ index 815d79a5..b68ab881 100644 /** * Gets the inventory of the chest block represented by this block state. diff --git a/src/main/java/org/bukkit/block/Dispenser.java b/src/main/java/org/bukkit/block/Dispenser.java -index 2741625d..6d180117 100644 +index 74cd194c9..07af1a3f0 100644 --- a/src/main/java/org/bukkit/block/Dispenser.java +++ b/src/main/java/org/bukkit/block/Dispenser.java @@ -1,5 +1,6 @@ @@ -248,7 +260,7 @@ index 2741625d..6d180117 100644 import org.bukkit.Nameable; import org.bukkit.loot.Lootable; import org.bukkit.projectiles.BlockProjectileSource; -@@ -7,7 +8,7 @@ import org.bukkit.projectiles.BlockProjectileSource; +@@ -8,7 +9,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents a captured state of a dispenser. */ @@ -258,7 +270,7 @@ index 2741625d..6d180117 100644 /** * Gets the BlockProjectileSource object for the dispenser. diff --git a/src/main/java/org/bukkit/block/Dropper.java b/src/main/java/org/bukkit/block/Dropper.java -index 2e8c3f71..47737b59 100644 +index 2e8c3f711..47737b590 100644 --- a/src/main/java/org/bukkit/block/Dropper.java +++ b/src/main/java/org/bukkit/block/Dropper.java @@ -1,12 +1,13 @@ @@ -277,7 +289,7 @@ index 2e8c3f71..47737b59 100644 /** * Tries to drop a randomly selected item from the dropper's inventory, diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java -index 73fce5f3..221123e8 100644 +index 73fce5f33..221123e8c 100644 --- a/src/main/java/org/bukkit/block/Hopper.java +++ b/src/main/java/org/bukkit/block/Hopper.java @@ -1,9 +1,10 @@ @@ -293,7 +305,7 @@ index 73fce5f3..221123e8 100644 -public interface Hopper extends Container, Nameable, Lootable { } +public interface Hopper extends Container, Nameable, LootableBlockInventory { } // Paper diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java -index 8e061e4a..1c02c6e1 100644 +index 5a6bed64a..8c8811d4d 100644 --- a/src/main/java/org/bukkit/block/ShulkerBox.java +++ b/src/main/java/org/bukkit/block/ShulkerBox.java @@ -1,5 +1,6 @@ @@ -303,7 +315,7 @@ index 8e061e4a..1c02c6e1 100644 import org.bukkit.DyeColor; import org.bukkit.Nameable; import org.bukkit.loot.Lootable; -@@ -7,7 +8,7 @@ import org.bukkit.loot.Lootable; +@@ -8,7 +9,7 @@ import org.jetbrains.annotations.NotNull; /** * Represents a captured state of a ShulkerBox. */ @@ -313,7 +325,7 @@ index 8e061e4a..1c02c6e1 100644 /** * Get the {@link DyeColor} corresponding to this ShulkerBox diff --git a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java -index 8ced5403..86588550 100644 +index 8ced54039..865885501 100644 --- a/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/HopperMinecart.java @@ -1,5 +1,6 @@ @@ -333,7 +345,7 @@ index 8ced5403..86588550 100644 /** * Checks whether or not this Minecart will pick up diff --git a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java -index 9ea403e6..238d118f 100644 +index 9ea403e6f..238d118f7 100644 --- a/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java +++ b/src/main/java/org/bukkit/entity/minecart/StorageMinecart.java @@ -1,5 +1,6 @@ @@ -351,11 +363,11 @@ index 9ea403e6..238d118f 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 f4b3d021..9f1c830f 100644 +index 24a3d989d..901db8524 100644 --- a/src/main/java/org/bukkit/loot/Lootable.java +++ b/src/main/java/org/bukkit/loot/Lootable.java -@@ -33,6 +33,34 @@ public interface Lootable { - */ +@@ -36,6 +36,34 @@ public interface Lootable { + @Nullable LootTable getLootTable(); + // Paper start @@ -365,7 +377,7 @@ index f4b3d021..9f1c830f 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. + */ -+ default void setLootTable(LootTable table, long seed) { ++ default void setLootTable(@Nullable LootTable table, long seed) { + setLootTable(table); + setSeed(seed); + } @@ -390,5 +402,5 @@ index f4b3d021..9f1c830f 100644 * Set the seed used when this Loot Table generates loot. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0037-Add-EntityZapEvent.patch b/Spigot-API-Patches/0037-Add-EntityZapEvent.patch index 415defa0b9..0a4127afdc 100644 --- a/Spigot-API-Patches/0037-Add-EntityZapEvent.patch +++ b/Spigot-API-Patches/0037-Add-EntityZapEvent.patch @@ -1,4 +1,4 @@ -From a520009d4480e4b49846a57681d065a651c45419 Mon Sep 17 00:00:00 2001 +From d83973b95e1f261cb7d70b06771709d73a73624f Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Sun, 16 Oct 2016 23:19:34 -0700 Subject: [PATCH] Add EntityZapEvent @@ -6,10 +6,10 @@ Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java new file mode 100644 -index 00000000..c8f0bb05 +index 000000000..3b725a489 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityZapEvent.java -@@ -0,0 +1,63 @@ +@@ -0,0 +1,65 @@ +package com.destroystokyo.paper.event.entity; + +import org.apache.commons.lang.Validate; @@ -20,8 +20,8 @@ index 00000000..c8f0bb05 +import org.bukkit.event.entity.EntityEvent; +import org.bukkit.event.entity.EntityTransformEvent; + -+import javax.annotation.Nonnull; +import java.util.Collections; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when lightning strikes an entity @@ -29,9 +29,9 @@ index 00000000..c8f0bb05 +public class EntityZapEvent extends EntityTransformEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private final LightningStrike bolt; ++ @NotNull private final LightningStrike bolt; + -+ public EntityZapEvent(final Entity entity, @Nonnull final LightningStrike bolt, @Nonnull final Entity replacementEntity) { ++ public EntityZapEvent(@NotNull final Entity entity, @NotNull final LightningStrike bolt, @NotNull final Entity replacementEntity) { + super(entity, Collections.singletonList(replacementEntity), TransformReason.LIGHTNING); + Validate.notNull(bolt); + Validate.notNull(replacementEntity); @@ -50,7 +50,7 @@ index 00000000..c8f0bb05 + * Gets the lightning bolt that is striking the entity. + * @return The lightning bolt responsible for this event + */ -+ @Nonnull ++ @NotNull + public LightningStrike getBolt() { + return bolt; + } @@ -59,22 +59,24 @@ index 00000000..c8f0bb05 + * Gets the entity that will replace the struck entity. + * @return The entity that will replace the struck entity + */ -+ @Nonnull ++ @NotNull + public Entity getReplacementEntity() { + return getTransformedEntity(); + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/event/entity/PigZapEvent.java b/src/main/java/org/bukkit/event/entity/PigZapEvent.java -index c1d4b30a..de8cad81 100644 +index 0074423fd..0eaa8df94 100644 --- a/src/main/java/org/bukkit/event/entity/PigZapEvent.java +++ b/src/main/java/org/bukkit/event/entity/PigZapEvent.java @@ -2,6 +2,7 @@ package org.bukkit.event.entity; @@ -85,7 +87,7 @@ index c1d4b30a..de8cad81 100644 import org.bukkit.entity.LightningStrike; import org.bukkit.entity.Pig; import org.bukkit.entity.PigZombie; -@@ -11,14 +12,14 @@ import org.bukkit.event.HandlerList; +@@ -12,14 +13,14 @@ import org.jetbrains.annotations.NotNull; /** * Stores data for pigs being zapped */ @@ -97,22 +99,22 @@ index c1d4b30a..de8cad81 100644 private final PigZombie pigzombie; private final LightningStrike bolt; - public PigZapEvent(final Pig pig, final LightningStrike bolt, final PigZombie pigzombie) { + public PigZapEvent(@NotNull final Pig pig, @NotNull final LightningStrike bolt, @NotNull final PigZombie pigzombie) { - super(pig, Collections.singletonList((Entity) pigzombie), TransformReason.LIGHTNING); + super(pig, bolt, pigzombie); this.bolt = bolt; this.pigzombie = pigzombie; } -@@ -57,6 +58,8 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable { +@@ -61,6 +62,8 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable { return pigzombie; } + // Paper start + /* + @NotNull @Override public HandlerList getHandlers() { - return handlers; -@@ -65,4 +68,6 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable { +@@ -71,4 +74,6 @@ public class PigZapEvent extends EntityTransformEvent implements Cancellable { public static HandlerList getHandlerList() { return handlers; } @@ -120,5 +122,5 @@ index c1d4b30a..de8cad81 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0038-Misc-Utils.patch b/Spigot-API-Patches/0038-Misc-Utils.patch index 69a3659239..e98131ab68 100644 --- a/Spigot-API-Patches/0038-Misc-Utils.patch +++ b/Spigot-API-Patches/0038-Misc-Utils.patch @@ -1,4 +1,4 @@ -From 3fabac75e83331f5b4ac0cefaa42b16441a2956e Mon Sep 17 00:00:00 2001 +From a3d13870daf8d1b11309cbbf8947ae5324aed6b5 Mon Sep 17 00:00:00 2001 From: vemacs Date: Wed, 23 Nov 2016 12:53:43 -0500 Subject: [PATCH] Misc Utils @@ -6,20 +6,22 @@ Subject: [PATCH] Misc Utils diff --git a/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java b/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java new file mode 100644 -index 00000000..d60ecbb1 +index 000000000..5bb677ce5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/utils/CachedSizeConcurrentLinkedQueue.java -@@ -0,0 +1,31 @@ +@@ -0,0 +1,34 @@ +package com.destroystokyo.paper.utils; + +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.atomic.LongAdder; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class CachedSizeConcurrentLinkedQueue extends ConcurrentLinkedQueue { + private final LongAdder cachedSize = new LongAdder(); + + @Override -+ public boolean add(E e) { ++ public boolean add(@NotNull E e) { + boolean result = super.add(e); + if (result) { + cachedSize.increment(); @@ -27,6 +29,7 @@ index 00000000..d60ecbb1 + return result; + } + ++ @Nullable + @Override + public E poll() { + E result = super.poll(); @@ -42,5 +45,5 @@ index 00000000..d60ecbb1 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0039-Allow-Reloading-of-Command-Aliases.patch b/Spigot-API-Patches/0039-Allow-Reloading-of-Command-Aliases.patch index b26f3d8b1e..45aef62e57 100644 --- a/Spigot-API-Patches/0039-Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-API-Patches/0039-Allow-Reloading-of-Command-Aliases.patch @@ -1,4 +1,4 @@ -From a7f30eb6aff66658a5731d0ee906374a2a823788 Mon Sep 17 00:00:00 2001 +From ad0c8ca9e48518bfdc7f2d0b624298e45ab22aae Mon Sep 17 00:00:00 2001 From: willies952002 Date: Mon, 28 Nov 2016 10:16:39 -0500 Subject: [PATCH] Allow Reloading of Command Aliases @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 2d588c6b..5715057a 100644 +index d009aebd6..8e0cbbf15 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1473,6 +1473,15 @@ public final class Bukkit { +@@ -1555,6 +1555,15 @@ public final class Bukkit { public static void reloadPermissions() { server.reloadPermissions(); } @@ -24,12 +24,12 @@ index 2d588c6b..5715057a 100644 + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 18e5dd48..259a0fbe 100644 +index e7e7dab8c..8f61619a3 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1281,4 +1281,6 @@ public interface Server extends PluginMessageRecipient { +@@ -1368,4 +1368,6 @@ public interface Server extends PluginMessageRecipient { // Spigot end void reloadPermissions(); // Paper @@ -37,13 +37,13 @@ index 18e5dd48..259a0fbe 100644 + boolean reloadCommandAliases(); // Paper } diff --git a/src/main/java/org/bukkit/command/CommandMap.java b/src/main/java/org/bukkit/command/CommandMap.java -index 30d60247..938959aa 100644 +index bd2c7a696..864c263bb 100644 --- a/src/main/java/org/bukkit/command/CommandMap.java +++ b/src/main/java/org/bukkit/command/CommandMap.java -@@ -123,4 +123,13 @@ public interface CommandMap { - * @throws IllegalArgumentException if either sender or cmdLine are null +@@ -128,4 +128,14 @@ public interface CommandMap { */ - public List tabComplete(CommandSender sender, String cmdLine, Location location) throws IllegalArgumentException; + @Nullable + public List tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location) throws IllegalArgumentException; + + // Paper start - Expose Known Commands + /** @@ -51,30 +51,32 @@ index 30d60247..938959aa 100644 + * + * @return known commands + */ ++ @NotNull + public java.util.Map getKnownCommands(); + // Paper end } diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java -index 65ad78c4..41e95692 100644 +index f52d91d19..d7ca4fa3f 100644 --- a/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java -@@ -279,4 +279,10 @@ public class SimpleCommandMap implements CommandMap { +@@ -285,4 +285,11 @@ public class SimpleCommandMap implements CommandMap { } } } + + // Paper start - Expose Known Commands ++ @NotNull + public Map getKnownCommands() { + return knownCommands; + } + // Paper end } diff --git a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java -index f331a442..a977045d 100644 +index ba118dbfe..607323a83 100644 --- a/src/main/java/org/bukkit/command/defaults/ReloadCommand.java +++ b/src/main/java/org/bukkit/command/defaults/ReloadCommand.java -@@ -13,7 +13,7 @@ public class ReloadCommand extends BukkitCommand { - public ReloadCommand(String name) { +@@ -14,7 +14,7 @@ public class ReloadCommand extends BukkitCommand { + public ReloadCommand(@NotNull String name) { super(name); this.description = "Reloads the server configuration and plugins"; - this.usageMessage = "/reload [permissions]"; // Paper @@ -97,5 +99,5 @@ index f331a442..a977045d 100644 confirmed = true; } else { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0040-Add-source-to-PlayerExpChangeEvent.patch b/Spigot-API-Patches/0040-Add-source-to-PlayerExpChangeEvent.patch index 38d1648a0b..944f2303d1 100644 --- a/Spigot-API-Patches/0040-Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-API-Patches/0040-Add-source-to-PlayerExpChangeEvent.patch @@ -1,21 +1,22 @@ -From 089130d865363f60ffce7794d8ba7080e9475a81 Mon Sep 17 00:00:00 2001 +From 50250b4955c5c76238ed4e75479dfa1aa751ba02 Mon Sep 17 00:00:00 2001 From: AlphaBlend Date: Thu, 8 Sep 2016 08:47:08 -0700 Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java -index f37491d7..30882559 100644 +index c99c9281e..7c340f539 100644 --- a/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerExpChangeEvent.java -@@ -1,20 +1,42 @@ +@@ -1,21 +1,43 @@ package org.bukkit.event.player; +import org.bukkit.entity.Entity; // Paper import org.bukkit.entity.Player; import org.bukkit.event.HandlerList; + import org.jetbrains.annotations.NotNull; -+import javax.annotation.Nullable; // Paper ++import org.jetbrains.annotations.Nullable; // Paper + /** * Called when a players experience changes naturally @@ -27,11 +28,11 @@ index f37491d7..30882559 100644 + private final Entity source; private int exp; - public PlayerExpChangeEvent(final Player player, final int expAmount) { + public PlayerExpChangeEvent(@NotNull final Player player, final int expAmount) { + this(player, null, expAmount); + } + -+ public PlayerExpChangeEvent(final Player player, @Nullable final Entity sourceEntity, final int expAmount) { ++ public PlayerExpChangeEvent(@NotNull final Player player, @Nullable final Entity sourceEntity, final int expAmount) { super(player); + source = sourceEntity; exp = expAmount; @@ -52,5 +53,5 @@ index f37491d7..30882559 100644 * Get the amount of experience the player will receive * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0041-Add-ProjectileCollideEvent.patch b/Spigot-API-Patches/0041-Add-ProjectileCollideEvent.patch index a7bf6caf4c..5b2fcef34b 100644 --- a/Spigot-API-Patches/0041-Add-ProjectileCollideEvent.patch +++ b/Spigot-API-Patches/0041-Add-ProjectileCollideEvent.patch @@ -1,4 +1,4 @@ -From 0d310faa3823420b08c8d77d29833c910e196c51 Mon Sep 17 00:00:00 2001 +From b82e438ee56e44088151a3448d9c6ea578145238 Mon Sep 17 00:00:00 2001 From: Techcable Date: Fri, 16 Dec 2016 21:25:39 -0600 Subject: [PATCH] Add ProjectileCollideEvent @@ -6,10 +6,10 @@ Subject: [PATCH] Add ProjectileCollideEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java new file mode 100644 -index 00000000..f42e9851 +index 000000000..453663893 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/ProjectileCollideEvent.java -@@ -0,0 +1,62 @@ +@@ -0,0 +1,67 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Entity; @@ -17,6 +17,7 @@ index 00000000..f42e9851 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when an projectile collides with an entity @@ -24,18 +25,19 @@ index 00000000..f42e9851 + * This event is called before {@link org.bukkit.event.entity.EntityDamageByEntityEvent}, and cancelling it will allow the projectile to continue flying + */ +public class ProjectileCollideEvent extends EntityEvent implements Cancellable { -+ private final Entity collidedWith; ++ @NotNull private final Entity collidedWith; + + /** + * Get the entity the projectile collided with + * + * @return the entity collided with + */ ++ @NotNull + public Entity getCollidedWith() { + return collidedWith; + } + -+ public ProjectileCollideEvent(Projectile what, Entity collidedWith) { ++ public ProjectileCollideEvent(@NotNull Projectile what, @NotNull Entity collidedWith) { + super(what); + this.collidedWith = collidedWith; + } @@ -45,16 +47,19 @@ index 00000000..f42e9851 + * + * @return the projectile that collided + */ ++ @NotNull + public Projectile getEntity() { + return (Projectile) super.getEntity(); + } + + private static final HandlerList handlerList = new HandlerList(); + ++ @NotNull + public static HandlerList getHandlerList() { + return handlerList; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlerList; @@ -73,5 +78,5 @@ index 00000000..f42e9851 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0042-Add-String-based-Action-Bar-API.patch b/Spigot-API-Patches/0042-Add-String-based-Action-Bar-API.patch index 6927d38659..c2e7f452c6 100644 --- a/Spigot-API-Patches/0042-Add-String-based-Action-Bar-API.patch +++ b/Spigot-API-Patches/0042-Add-String-based-Action-Bar-API.patch @@ -1,15 +1,15 @@ -From 64e90092e25dfcb2093727229eabe28f667ee6aa Mon Sep 17 00:00:00 2001 +From 5867309b06bfe09471d79910963d912d588e860d Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 20 Dec 2016 15:55:55 -0500 Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 96d97bf3..d9965ddc 100644 +index c237073a3..219556ed5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -416,6 +416,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - public void sendMap(MapView map); +@@ -423,6 +423,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + public void sendMap(@NotNull MapView map); // Paper start + @@ -20,7 +20,7 @@ index 96d97bf3..d9965ddc 100644 + * + * @param message The message to send + */ -+ public void sendActionBar(String message); ++ public void sendActionBar(@NotNull String message); + + /** + * Sends an Action Bar message to the client. @@ -30,12 +30,12 @@ index 96d97bf3..d9965ddc 100644 + * @param alternateChar Alternate symbol such as '&' + * @param message The message to send + */ -+ public void sendActionBar(char alternateChar, String message); ++ public void sendActionBar(char alternateChar, @NotNull String message); + /** * Sends the component to the player * -@@ -439,9 +459,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -446,9 +466,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Sends an array of components as a single message to the specified screen position of this player * @@ -47,7 +47,7 @@ index 96d97bf3..d9965ddc 100644 public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { spigot().sendMessage(position, components); } -@@ -1764,9 +1786,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1781,9 +1803,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Sends the component to the specified screen position of this player * @@ -56,10 +56,10 @@ index 96d97bf3..d9965ddc 100644 * @param component the components to send */ + @Deprecated - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent component) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) { throw new UnsupportedOperationException("Not supported yet."); } -@@ -1774,9 +1798,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1791,9 +1815,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Sends an array of components as a single message to the specified screen position of this player * @@ -68,9 +68,9 @@ index 96d97bf3..d9965ddc 100644 * @param components the components to send */ + @Deprecated - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { + public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) { throw new UnsupportedOperationException("Not supported yet."); } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0043-Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-API-Patches/0043-Add-API-methods-to-control-if-armour-stands-can-move.patch index 52fb0a9567..6e6b3b38dc 100644 --- a/Spigot-API-Patches/0043-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-API-Patches/0043-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -1,14 +1,14 @@ -From c8592d0fed70ee265eb9bc9c2aa45cf3efacf890 Mon Sep 17 00:00:00 2001 +From 6edfd35a599174ec0bc6a869b274e5f7e74b54fb Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 21 Dec 2016 11:47:25 -0600 Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index b4f04517..099da6ce 100644 +index d04e52fb..387d04e5 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java -@@ -258,4 +258,22 @@ public interface ArmorStand extends LivingEntity { +@@ -271,4 +271,22 @@ public interface ArmorStand extends LivingEntity { * @param marker whether this is a marker */ void setMarker(boolean marker); @@ -32,5 +32,5 @@ index b4f04517..099da6ce 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0044-IllegalPacketEvent.patch b/Spigot-API-Patches/0044-IllegalPacketEvent.patch index 180eb29106..51bf5fee9d 100644 --- a/Spigot-API-Patches/0044-IllegalPacketEvent.patch +++ b/Spigot-API-Patches/0044-IllegalPacketEvent.patch @@ -1,4 +1,4 @@ -From df9951c426373976f105802670f755706705761d Mon Sep 17 00:00:00 2001 +From 1f9c546f72d454fff0de581f0c64cdd552520787 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 4 Dec 2016 01:19:14 -0500 Subject: [PATCH] IllegalPacketEvent @@ -9,24 +9,26 @@ Lets plugins change the kick message and if it should kick or not. diff --git a/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java b/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java new file mode 100644 -index 00000000..e11f74fc +index 000000000..37a17f0bb --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/IllegalPacketEvent.java -@@ -0,0 +1,63 @@ +@@ -0,0 +1,70 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.Bukkit; +import org.bukkit.entity.Player; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class IllegalPacketEvent extends PlayerEvent { -+ private final String type; -+ private final String ex; -+ private String kickMessage; ++ @Nullable private final String type; ++ @Nullable private final String ex; ++ @Nullable private String kickMessage; + private boolean shouldKick = true; + -+ public IllegalPacketEvent(Player player, String type, String kickMessage, Exception e) { ++ public IllegalPacketEvent(@NotNull Player player, @Nullable String type, @Nullable String kickMessage, @NotNull Exception e) { + super(player); + this.type = type; + this.kickMessage = kickMessage; @@ -41,33 +43,38 @@ index 00000000..e11f74fc + this.shouldKick = shouldKick; + } + ++ @Nullable + public String getKickMessage() { + return kickMessage; + } + -+ public void setKickMessage(String kickMessage) { ++ public void setKickMessage(@Nullable String kickMessage) { + this.kickMessage = kickMessage; + } + ++ @Nullable + public String getType() { + return type; + } + ++ @Nullable + public String getExceptionMessage() { + return ex; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } + -+ public static void process(Player player, String type, String kickMessage, Exception exception) { ++ public static void process(@NotNull Player player, @Nullable String type, @Nullable String kickMessage, @NotNull Exception exception) { + IllegalPacketEvent event = new IllegalPacketEvent(player, type, kickMessage, exception); + event.callEvent(); + if (event.shouldKick) { @@ -77,5 +84,5 @@ index 00000000..e11f74fc + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0045-Fireworks-API-s.patch b/Spigot-API-Patches/0045-Fireworks-API-s.patch index e31130b524..e1f65e3ff3 100644 --- a/Spigot-API-Patches/0045-Fireworks-API-s.patch +++ b/Spigot-API-Patches/0045-Fireworks-API-s.patch @@ -1,4 +1,4 @@ -From 03c53cfd5436f75a613567236c4c97f9a0859497 Mon Sep 17 00:00:00 2001 +From 598ca05d30454f06b4b08c9080ad038b0ffcb8d5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 28 Dec 2016 01:18:55 -0500 Subject: [PATCH] Fireworks API's @@ -7,32 +7,35 @@ Get the Entity being boosted Get the firework launcher diff --git a/src/main/java/org/bukkit/entity/Firework.java b/src/main/java/org/bukkit/entity/Firework.java -index b8a8c075..8c087bb7 100644 +index 1c55f0338..7df26cf7f 100644 --- a/src/main/java/org/bukkit/entity/Firework.java +++ b/src/main/java/org/bukkit/entity/Firework.java -@@ -2,6 +2,8 @@ package org.bukkit.entity; - +@@ -3,6 +3,9 @@ package org.bukkit.entity; import org.bukkit.inventory.meta.FireworkMeta; + import org.jetbrains.annotations.NotNull; +import java.util.UUID; ++import org.jetbrains.annotations.Nullable; + public interface Firework extends Entity { /** -@@ -23,4 +25,13 @@ public interface Firework extends Entity { +@@ -25,4 +28,15 @@ public interface Firework extends Entity { * remaining fuse. */ void detonate(); + + // Paper start ++ @Nullable + public UUID getSpawningEntity(); + /** + * If this firework is boosting an entity, return it + * @return The entity being boosted + */ ++ @Nullable + public LivingEntity getBoostedEntity(); + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0046-PlayerTeleportEndGatewayEvent.patch b/Spigot-API-Patches/0046-PlayerTeleportEndGatewayEvent.patch index 34a9c06805..b9ccbcb090 100644 --- a/Spigot-API-Patches/0046-PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-API-Patches/0046-PlayerTeleportEndGatewayEvent.patch @@ -1,4 +1,4 @@ -From b1cdd9cf910f3b9b6c0adb16d110a9f32b5fa87d Mon Sep 17 00:00:00 2001 +From 21f79b080ee93ae3e8f46411349e84b6bb1f87f3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 31 Dec 2016 20:29:33 -0500 Subject: [PATCH] PlayerTeleportEndGatewayEvent @@ -7,24 +7,25 @@ Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java new file mode 100644 -index 00000000..bdefbc9f +index 000000000..b64ab6eec --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerTeleportEndGatewayEvent.java -@@ -0,0 +1,27 @@ +@@ -0,0 +1,29 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.Location; +import org.bukkit.block.EndGateway; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerTeleportEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a teleport is triggered for an End Gateway + */ +public class PlayerTeleportEndGatewayEvent extends PlayerTeleportEvent { -+ private final EndGateway gateway; ++ @NotNull private final EndGateway gateway; + -+ public PlayerTeleportEndGatewayEvent(Player player, Location from, Location to, EndGateway gateway) { ++ public PlayerTeleportEndGatewayEvent(@NotNull Player player, @NotNull Location from, @NotNull Location to, @NotNull EndGateway gateway) { + super(player, from, to, PlayerTeleportEvent.TeleportCause.END_GATEWAY); + this.gateway = gateway; + } @@ -34,10 +35,11 @@ index 00000000..bdefbc9f + * + * @return EndGateway used + */ ++ @NotNull + public EndGateway getGateway() { + return gateway; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0047-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-API-Patches/0047-Provide-E-TE-Chunk-count-stat-methods.patch index 93d4dcbb3c..b5be45bdbf 100644 --- a/Spigot-API-Patches/0047-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-API-Patches/0047-Provide-E-TE-Chunk-count-stat-methods.patch @@ -1,4 +1,4 @@ -From fe9d5c94dc4df94951b626e28eeb13a0a4fbbeaa Mon Sep 17 00:00:00 2001 +From 689c6a8f4240960a10dbfce71ad4b2c1dd456251 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 7 Jan 2017 15:23:03 -0500 Subject: [PATCH] Provide E/TE/Chunk count stat methods @@ -7,10 +7,10 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index d62277de..8a0f992f 100644 +index ffae53d6..846b0619 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -28,6 +28,33 @@ import org.bukkit.util.Vector; +@@ -31,6 +31,33 @@ import org.jetbrains.annotations.Nullable; */ public interface World extends PluginMessageRecipient, Metadatable { @@ -45,5 +45,5 @@ index d62277de..8a0f992f 100644 * Gets the {@link Block} at the given coordinates * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index 8b92f53cfb..a7916ae3a7 100644 --- a/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-API-Patches/0048-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -1,4 +1,4 @@ -From 0115c934227d7ae971e287367407bd7a72a186ba Mon Sep 17 00:00:00 2001 +From 92864aea93c48d6757f3ec929d235f61563bf0b6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 16:28:32 -0500 Subject: [PATCH] ExperienceOrbs API for Reason/Source/Triggering player @@ -8,18 +8,19 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/org/bukkit/entity/ExperienceOrb.java b/src/main/java/org/bukkit/entity/ExperienceOrb.java -index c286edfd..f847543b 100644 +index c286edfd8..57029d9bc 100644 --- a/src/main/java/org/bukkit/entity/ExperienceOrb.java +++ b/src/main/java/org/bukkit/entity/ExperienceOrb.java -@@ -1,5 +1,7 @@ +@@ -1,5 +1,8 @@ package org.bukkit.entity; -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; // Paper + /** * Represents an Experience Orb. */ -@@ -18,4 +20,94 @@ public interface ExperienceOrb extends Entity { +@@ -18,4 +21,95 @@ public interface ExperienceOrb extends Entity { * @param value Amount of experience */ public void setExperience(int value); @@ -111,9 +112,10 @@ index c286edfd..f847543b 100644 + * do not know, such as orbs spawned before this API was added, UNKNOWN is returned. + * @return The reason for this orb being spawned. + */ ++ @NotNull + SpawnReason getSpawnReason(); + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0049-Expose-WorldBorder-isInBounds-Location-check.patch b/Spigot-API-Patches/0049-Expose-WorldBorder-isInBounds-Location-check.patch index 7e6a9296c4..a6f58b97ca 100644 --- a/Spigot-API-Patches/0049-Expose-WorldBorder-isInBounds-Location-check.patch +++ b/Spigot-API-Patches/0049-Expose-WorldBorder-isInBounds-Location-check.patch @@ -1,17 +1,17 @@ -From bd7776459d0b309752fcdc6b0169ac8508a34989 Mon Sep 17 00:00:00 2001 +From 4e9c8caa8395d98ee682ff83f656c5128a5801d0 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 21 Jan 2017 17:03:10 -0600 Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java -index 4dc18edc..41b7fae6 100644 +index 7e8f5649..afb7b136 100644 --- a/src/main/java/org/bukkit/WorldBorder.java +++ b/src/main/java/org/bukkit/WorldBorder.java -@@ -114,4 +114,18 @@ public interface WorldBorder { +@@ -117,4 +117,18 @@ public interface WorldBorder { * @return if this location is inside the border or not */ - public boolean isInside(Location location); + public boolean isInside(@NotNull Location location); + + // Paper start + /** @@ -22,11 +22,11 @@ index 4dc18edc..41b7fae6 100644 + * @deprecated use {@link #isInside(Location)} for an upstream compatible replacement + */ + @Deprecated -+ public default boolean isInBounds(Location location) { ++ public default boolean isInBounds(@NotNull Location location) { + return this.isInside(location); + } + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0050-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-API-Patches/0050-Add-configuration-option-to-prevent-player-names-fro.patch index 6fe896eb29..9a5eeb3747 100644 --- a/Spigot-API-Patches/0050-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-API-Patches/0050-Add-configuration-option-to-prevent-player-names-fro.patch @@ -1,4 +1,4 @@ -From e8a0fcc32795014e18a8be640522fecddc8f4541 Mon Sep 17 00:00:00 2001 +From c74ed751192df73e8d8ee4ccc6c8cec0d44a2116 Mon Sep 17 00:00:00 2001 From: kashike Date: Fri, 9 Jun 2017 07:24:24 -0700 Subject: [PATCH] Add configuration option to prevent player names from being @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 5715057a..eb180374 100644 +index 8e0cbbf15..90b41fd25 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1482,6 +1482,16 @@ public final class Bukkit { +@@ -1564,6 +1564,16 @@ public final class Bukkit { public static boolean reloadCommandAliases() { return server.reloadCommandAliases(); } @@ -25,12 +25,12 @@ index 5715057a..eb180374 100644 + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 259a0fbe..c57f81fd 100644 +index 8f61619a3..fe3144c00 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1283,4 +1283,14 @@ public interface Server extends PluginMessageRecipient { +@@ -1370,4 +1370,14 @@ public interface Server extends PluginMessageRecipient { void reloadPermissions(); // Paper boolean reloadCommandAliases(); // Paper @@ -46,10 +46,10 @@ index 259a0fbe..c57f81fd 100644 + // Paper end } diff --git a/src/main/java/org/bukkit/command/PluginCommand.java b/src/main/java/org/bukkit/command/PluginCommand.java -index 2abe1208..c660c178 100644 +index 92c23424e..e420b7902 100644 --- a/src/main/java/org/bukkit/command/PluginCommand.java +++ b/src/main/java/org/bukkit/command/PluginCommand.java -@@ -145,6 +145,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo +@@ -151,6 +151,7 @@ public final class PluginCommand extends Command implements PluginIdentifiableCo } if (completions == null) { @@ -58,5 +58,5 @@ index 2abe1208..c660c178 100644 } return completions; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0051-Fix-upstream-javadoc-warnings-and-errors.patch b/Spigot-API-Patches/0051-Fix-upstream-javadoc-warnings-and-errors.patch index 8535795b82..b3c61fd1ec 100644 --- a/Spigot-API-Patches/0051-Fix-upstream-javadoc-warnings-and-errors.patch +++ b/Spigot-API-Patches/0051-Fix-upstream-javadoc-warnings-and-errors.patch @@ -1,4 +1,4 @@ -From 7c8eed2edc8e4783ed66f36cb206b95a1f3039de Mon Sep 17 00:00:00 2001 +From 0073358c87abe5e1b89363c51a06ff694a01f965 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 10 Jun 2017 16:59:40 -0500 Subject: [PATCH] Fix upstream javadoc warnings and errors @@ -6,10 +6,10 @@ Subject: [PATCH] Fix upstream javadoc warnings and errors Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues. diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java -index 43239f84..fe8d3468 100644 +index ffebffd8b..f5e3929aa 100644 --- a/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java -@@ -38,8 +38,8 @@ public final class NamespacedKey { +@@ -39,8 +39,8 @@ public final class NamespacedKey { /** * Create a key in a specific namespace. * @@ -21,78 +21,78 @@ index 43239f84..fe8d3468 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 8a0f992f..d499e41b 100644 +index 846b0619a..84abeb216 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1606,6 +1606,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1666,6 +1666,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data); -@@ -1621,6 +1622,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1681,6 +1682,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data); -@@ -1670,6 +1672,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1730,6 +1732,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); -@@ -1689,6 +1692,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1749,6 +1752,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); -@@ -1744,6 +1748,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1804,6 +1808,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); -@@ -1765,6 +1770,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1825,6 +1830,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - 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(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); -@@ -1787,6 +1793,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1847,6 +1853,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param force whether to send the particle to players within an extended * range and encourage their client to render it regardless of * settings + * @param Particle data type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); -@@ -1811,6 +1818,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1871,6 +1878,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param force whether to send the particle to players within an extended * range and encourage their client to render it regardless of * settings + * @param Particle data type */ - 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); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); diff --git a/src/main/java/org/bukkit/entity/AbstractHorse.java b/src/main/java/org/bukkit/entity/AbstractHorse.java -index 10757454..6d5410ea 100644 +index 2f1956724..234aa9dd2 100644 --- a/src/main/java/org/bukkit/entity/AbstractHorse.java +++ b/src/main/java/org/bukkit/entity/AbstractHorse.java -@@ -22,7 +22,7 @@ public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameab +@@ -25,7 +25,7 @@ public interface AbstractHorse extends Animals, Vehicle, InventoryHolder, Tameab public Horse.Variant getVariant(); /** @@ -102,19 +102,19 @@ index 10757454..6d5410ea 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/AreaEffectCloud.java b/src/main/java/org/bukkit/entity/AreaEffectCloud.java -index 9a569d3a..8c5efd17 100644 +index d258e734e..123d87954 100644 --- a/src/main/java/org/bukkit/entity/AreaEffectCloud.java +++ b/src/main/java/org/bukkit/entity/AreaEffectCloud.java -@@ -138,6 +138,7 @@ public interface AreaEffectCloud extends Entity { +@@ -141,6 +141,7 @@ public interface AreaEffectCloud extends Entity { * @param particle the new particle type * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param the particle data type // Paper */ - void setParticle(Particle particle, T data); + void setParticle(@NotNull Particle particle, @Nullable T data); diff --git a/src/main/java/org/bukkit/entity/Guardian.java b/src/main/java/org/bukkit/entity/Guardian.java -index 98af0563..ec6890ae 100644 +index 98af0563c..ec6890ae6 100644 --- a/src/main/java/org/bukkit/entity/Guardian.java +++ b/src/main/java/org/bukkit/entity/Guardian.java @@ -12,7 +12,7 @@ public interface Guardian extends Monster { @@ -127,10 +127,10 @@ index 98af0563..ec6890ae 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/Horse.java b/src/main/java/org/bukkit/entity/Horse.java -index cfce8fa5..8660070b 100644 +index 734f5ac7b..5efa4e606 100644 --- a/src/main/java/org/bukkit/entity/Horse.java +++ b/src/main/java/org/bukkit/entity/Horse.java -@@ -151,7 +151,7 @@ public interface Horse extends AbstractHorse { +@@ -154,7 +154,7 @@ public interface Horse extends AbstractHorse { public boolean isCarryingChest(); /** @@ -140,10 +140,10 @@ index cfce8fa5..8660070b 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index d9965ddc..bf284f2c 100644 +index 219556ed5..c21785d58 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -431,7 +431,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -438,7 +438,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * * Use supplied alternative character to the section symbol to represent legacy color codes. * @@ -151,8 +151,8 @@ index d9965ddc..bf284f2c 100644 + * @param alternateChar Alternate symbol such as '&' * @param message The message to send */ - public void sendActionBar(char alternateChar, String message); -@@ -498,6 +498,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + public void sendActionBar(char alternateChar, @NotNull String message); +@@ -505,6 +505,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Update the subtitle of titles displayed to the player * @@ -160,7 +160,7 @@ index d9965ddc..bf284f2c 100644 * @deprecated Use {@link #updateTitle(Title)} */ @Deprecated -@@ -506,6 +507,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -513,6 +514,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Update the subtitle of titles displayed to the player * @@ -168,7 +168,7 @@ index d9965ddc..bf284f2c 100644 * @deprecated Use {@link #updateTitle(Title)} */ @Deprecated -@@ -514,6 +516,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -521,6 +523,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Show the given title to the player, along with the last subtitle set, using the last set times * @@ -176,7 +176,7 @@ index d9965ddc..bf284f2c 100644 * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} */ @Deprecated -@@ -522,6 +525,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -529,6 +532,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM /** * Show the given title to the player, along with the last subtitle set, using the last set times * @@ -184,59 +184,59 @@ index d9965ddc..bf284f2c 100644 * @deprecated Use {@link #sendTitle(Title)} or {@link #updateTitle(Title)} */ @Deprecated -@@ -1418,6 +1422,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1428,6 +1432,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data); -@@ -1433,6 +1438,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1443,6 +1448,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data); -@@ -1482,6 +1488,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1492,6 +1498,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); -@@ -1501,6 +1508,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1511,6 +1518,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data); + public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); -@@ -1556,6 +1564,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1566,6 +1574,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); + public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); -@@ -1577,6 +1586,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -1587,6 +1596,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} + * @param Type */ - 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(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java -index 2a02ab85..e33d00b3 100644 +index 2a0b01097..2ac30c0f6 100644 --- a/src/main/java/org/bukkit/entity/Skeleton.java +++ b/src/main/java/org/bukkit/entity/Skeleton.java -@@ -15,6 +15,7 @@ public interface Skeleton extends Monster { +@@ -19,6 +19,7 @@ public interface Skeleton extends Monster { public SkeletonType getSkeletonType(); /** @@ -245,10 +245,10 @@ index 2a02ab85..e33d00b3 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java -index bdc6206a..48034198 100644 +index 756f285eb..ee2e70c67 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java -@@ -29,14 +29,14 @@ public interface Zombie extends Monster { +@@ -32,7 +32,7 @@ public interface Zombie extends Monster { public boolean isVillager(); /** @@ -257,6 +257,7 @@ index bdc6206a..48034198 100644 * @deprecated must spawn {@link ZombieVillager}. */ @Deprecated +@@ -40,7 +40,7 @@ public interface Zombie extends Monster { public void setVillager(boolean flag); /** @@ -266,30 +267,30 @@ index bdc6206a..48034198 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java -index 6532c24f..ee0b1273 100644 +index 8d4c70031..b493173e2 100644 --- a/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerLoginEvent.java -@@ -28,6 +28,7 @@ public class PlayerLoginEvent extends PlayerEvent { +@@ -29,6 +29,7 @@ public class PlayerLoginEvent extends PlayerEvent { * @param hostname The hostname that was used to connect to the server * @param address The address the player used to connect, provided for * timing issues + * @param realAddress The unspoofed, actual address, that the player used to connect */ - public PlayerLoginEvent(final Player player, final String hostname, final InetAddress address, final InetAddress realAddress) { // Spigot + public PlayerLoginEvent(@NotNull final Player player, @NotNull final String hostname, @NotNull final InetAddress address, final @NotNull InetAddress realAddress) { // Spigot super(player); -@@ -51,6 +52,7 @@ public class PlayerLoginEvent extends PlayerEvent { +@@ -52,6 +53,7 @@ public class PlayerLoginEvent extends PlayerEvent { * timing issues * @param result The result status for this event * @param message The message to be displayed if result denies login + * @param realAddress The unspoofed, actual address, that the player used to connect */ - public PlayerLoginEvent(final Player player, String hostname, final InetAddress address, final Result result, final String message, final InetAddress realAddress) { // Spigot + public PlayerLoginEvent(@NotNull final Player player, @NotNull String hostname, @NotNull final InetAddress address, @NotNull final Result result, @NotNull final String message, @NotNull final InetAddress realAddress) { // Spigot this(player, hostname, address, realAddress); // Spigot diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 762c43d6..ec2b8b8e 100644 +index 07d2b4cfe..cbcbe8c8a 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -126,10 +126,10 @@ public interface ItemFactory { +@@ -132,10 +132,10 @@ public interface ItemFactory { * Apply a material change for an item meta. Do not use under any * circumstances. * @@ -304,32 +305,32 @@ index 762c43d6..ec2b8b8e 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/inventory/Merchant.java b/src/main/java/org/bukkit/inventory/Merchant.java -index c8e68570..45431b36 100644 +index 668e91958..5ff1f93d1 100644 --- a/src/main/java/org/bukkit/inventory/Merchant.java +++ b/src/main/java/org/bukkit/inventory/Merchant.java -@@ -32,7 +32,7 @@ public interface Merchant { +@@ -35,7 +35,7 @@ public interface Merchant { * * @param i the index * @return the recipe - * @throws IndexOutOfBoundsException + * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory */ + @NotNull MerchantRecipe getRecipe(int i) throws IndexOutOfBoundsException; - -@@ -41,7 +41,7 @@ public interface Merchant { +@@ -45,7 +45,7 @@ public interface Merchant { * * @param i the index * @param recipe the recipe - * @throws IndexOutOfBoundsException + * @throws IndexOutOfBoundsException Throws when specified index is larger than Merchant's inventory */ - void setRecipe(int i, MerchantRecipe recipe) throws IndexOutOfBoundsException; + void setRecipe(int i, @NotNull MerchantRecipe recipe) throws IndexOutOfBoundsException; diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java -index 1413b361..b4a8051c 100644 +index 63b7c70ce..a57f70ec6 100644 --- a/src/main/java/org/bukkit/potion/Potion.java +++ b/src/main/java/org/bukkit/potion/Potion.java -@@ -78,6 +78,7 @@ public class Potion { +@@ -79,6 +79,7 @@ public class Potion { } /** @@ -338,10 +339,10 @@ index 1413b361..b4a8051c 100644 */ @Deprecated diff --git a/src/main/java/org/bukkit/potion/PotionBrewer.java b/src/main/java/org/bukkit/potion/PotionBrewer.java -index 40f8d12b..33d19228 100644 +index 9f913e1ee..254bd6f3e 100644 --- a/src/main/java/org/bukkit/potion/PotionBrewer.java +++ b/src/main/java/org/bukkit/potion/PotionBrewer.java -@@ -34,6 +34,8 @@ public interface PotionBrewer { +@@ -38,6 +38,8 @@ public interface PotionBrewer { * a potion with the given type. * * @param type The type of the potion @@ -349,12 +350,12 @@ index 40f8d12b..33d19228 100644 + * @param extended Whether the potion is extended * @return The list of effects */ - public Collection getEffects(PotionType type, boolean upgraded, boolean extended); + @NotNull diff --git a/src/main/java/org/bukkit/potion/PotionType.java b/src/main/java/org/bukkit/potion/PotionType.java -index 034421a7..f1a54c23 100644 +index 9b0fcf2da..e83e4b4fd 100644 --- a/src/main/java/org/bukkit/potion/PotionType.java +++ b/src/main/java/org/bukkit/potion/PotionType.java -@@ -68,6 +68,7 @@ public enum PotionType { +@@ -72,6 +72,7 @@ public enum PotionType { } /** @@ -362,7 +363,7 @@ index 034421a7..f1a54c23 100644 * @deprecated Non-functional */ @Deprecated -@@ -80,6 +81,8 @@ public enum PotionType { +@@ -84,6 +85,8 @@ public enum PotionType { } /** @@ -371,7 +372,7 @@ index 034421a7..f1a54c23 100644 * @deprecated Non-functional */ @Deprecated -@@ -88,6 +91,8 @@ public enum PotionType { +@@ -94,6 +97,8 @@ public enum PotionType { } /** @@ -380,19 +381,6 @@ index 034421a7..f1a54c23 100644 * @deprecated Misleading */ @Deprecated -diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java -index ab71f3c3..358ea386 100644 ---- a/src/main/java/org/bukkit/scoreboard/Team.java -+++ b/src/main/java/org/bukkit/scoreboard/Team.java -@@ -84,7 +84,7 @@ public interface Team { - * names are handled by prefixes / suffixes. - * - * @return team color, defaults to {@link ChatColor#RESET} -- * @throws IllegalStateException -+ * @throws IllegalStateException if this team has been unregistered - */ - ChatColor getColor() throws IllegalStateException; - -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0052-Item-canEntityPickup.patch b/Spigot-API-Patches/0052-Item-canEntityPickup.patch index 0f4576f0f6..07a90fe33e 100644 --- a/Spigot-API-Patches/0052-Item-canEntityPickup.patch +++ b/Spigot-API-Patches/0052-Item-canEntityPickup.patch @@ -1,14 +1,14 @@ -From 717972d0fe8f0692924a0818c12d44f078ef63fc Mon Sep 17 00:00:00 2001 +From 437d485cd0d2633307712d9f0c05e5ad4d809bf9 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 5 May 2017 03:57:08 -0500 Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java -index 90260b7e..2e98e4f9 100644 +index 00c58c1d..cb9e9f36 100644 --- a/src/main/java/org/bukkit/entity/Item.java +++ b/src/main/java/org/bukkit/entity/Item.java -@@ -34,4 +34,20 @@ public interface Item extends Entity { +@@ -37,4 +37,20 @@ public interface Item extends Entity { * @param delay New delay */ public void setPickupDelay(int delay); @@ -30,5 +30,5 @@ index 90260b7e..2e98e4f9 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0053-PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-API-Patches/0053-PlayerPickupItemEvent-setFlyAtPlayer.patch index dffce0a515..d2614c2651 100644 --- a/Spigot-API-Patches/0053-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-API-Patches/0053-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -1,14 +1,14 @@ -From 7e146962920f6d97ea5d9505e4351731dda96483 Mon Sep 17 00:00:00 2001 +From bfb751c0cc1a9b5d9e913c1334d2fd5b67045402 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 May 2017 06:26:01 -0500 Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java -index c76f423e..46c6d519 100644 +index c7599116..5777d380 100644 --- a/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerPickupItemEvent.java -@@ -16,6 +16,7 @@ import org.bukkit.event.entity.EntityPickupItemEvent; +@@ -17,6 +17,7 @@ import org.jetbrains.annotations.NotNull; public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private final Item item; @@ -16,7 +16,7 @@ index c76f423e..46c6d519 100644 private boolean cancel = false; private final int remaining; -@@ -43,12 +44,34 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { +@@ -45,12 +46,34 @@ public class PlayerPickupItemEvent extends PlayerEvent implements Cancellable { return remaining; } @@ -50,7 +50,7 @@ index c76f423e..46c6d519 100644 + this.flyAtPlayer = !cancel; // Paper } - @Override + @NotNull -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0054-PlayerAttemptPickupItemEvent.patch b/Spigot-API-Patches/0054-PlayerAttemptPickupItemEvent.patch index f500c90a49..c9ad8ebf52 100644 --- a/Spigot-API-Patches/0054-PlayerAttemptPickupItemEvent.patch +++ b/Spigot-API-Patches/0054-PlayerAttemptPickupItemEvent.patch @@ -1,4 +1,4 @@ -From feb2578249055b5ea84eefea5352074314225f0d Mon Sep 17 00:00:00 2001 +From 75757b48a916e1c8b4d1dd2d543baae0526525e2 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 11 Jun 2017 16:30:37 -0500 Subject: [PATCH] PlayerAttemptPickupItemEvent @@ -6,33 +6,34 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/org/bukkit/event/player/PlayerAttemptPickupItemEvent.java b/src/main/java/org/bukkit/event/player/PlayerAttemptPickupItemEvent.java new file mode 100644 -index 00000000..480293e9 +index 000000000..fb5cb3dc4 --- /dev/null +++ b/src/main/java/org/bukkit/event/player/PlayerAttemptPickupItemEvent.java -@@ -0,0 +1,85 @@ +@@ -0,0 +1,89 @@ +package org.bukkit.event.player; + +import org.bukkit.entity.Item; +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; + +/** + * Thrown when a player attempts to pick an item up from the ground + */ +public class PlayerAttemptPickupItemEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); -+ private final Item item; ++ @NotNull private final Item item; + private final int remaining; + private boolean flyAtPlayer = true; + private boolean isCancelled = false; + -+ @Deprecated // Remove in 1.13 -+ public PlayerAttemptPickupItemEvent(final Player player, final Item item) { ++ @Deprecated // Remove in 1.13 // Remove in 1.14? ++ public PlayerAttemptPickupItemEvent(@NotNull final Player player, @NotNull final Item item) { + this(player, item, 0); + } + -+ public PlayerAttemptPickupItemEvent(final Player player, final Item item, final int remaining) { ++ public PlayerAttemptPickupItemEvent(@NotNull final Player player, @NotNull final Item item, final int remaining) { + super(player); + this.item = item; + this.remaining = remaining; @@ -43,6 +44,7 @@ index 00000000..480293e9 + * + * @return Item + */ ++ @NotNull + public Item getItem() { + return item; + } @@ -86,15 +88,17 @@ index 00000000..480293e9 + this.isCancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0055-Add-UnknownCommandEvent.patch b/Spigot-API-Patches/0055-Add-UnknownCommandEvent.patch index 8168c0fe55..f56840a0bf 100644 --- a/Spigot-API-Patches/0055-Add-UnknownCommandEvent.patch +++ b/Spigot-API-Patches/0055-Add-UnknownCommandEvent.patch @@ -1,4 +1,4 @@ -From 4c16ebe8f181e90a58c0d8546eec8bed09fbb5f7 Mon Sep 17 00:00:00 2001 +From 935c2498cb5d9d4920e90ab90ff786114a1d114f Mon Sep 17 00:00:00 2001 From: Sweepyoface Date: Sat, 17 Jun 2017 18:48:06 -0400 Subject: [PATCH] Add UnknownCommandEvent @@ -6,28 +6,29 @@ Subject: [PATCH] Add UnknownCommandEvent diff --git a/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java new file mode 100644 -index 00000000..19d634c3 +index 000000000..251342c3c --- /dev/null +++ b/src/main/java/org/bukkit/event/command/UnknownCommandEvent.java -@@ -0,0 +1,77 @@ +@@ -0,0 +1,82 @@ +package org.bukkit.event.command; + +import org.bukkit.command.CommandSender; +import org.bukkit.event.HandlerList; +import org.bukkit.event.Event; + -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Thrown when a player executes a command that is not defined + */ +public class UnknownCommandEvent extends Event { + private static final HandlerList handlers = new HandlerList(); -+ private CommandSender sender; -+ private String commandLine; -+ private String message; ++ @NotNull private CommandSender sender; ++ @NotNull private String commandLine; ++ @Nullable private String message; + -+ public UnknownCommandEvent(final CommandSender sender, final String commandLine, final String message) { ++ public UnknownCommandEvent(@NotNull final CommandSender sender, @NotNull final String commandLine, @Nullable final String message) { + super(false); + this.sender = sender; + this.commandLine = commandLine; @@ -40,6 +41,7 @@ index 00000000..19d634c3 + * + * @return Sender of the command + */ ++ @NotNull + public CommandSender getSender() { + return sender; + } @@ -50,6 +52,7 @@ index 00000000..19d634c3 + * + * @return Command sent + */ ++ @NotNull + public String getCommandLine() { + return commandLine; + } @@ -73,20 +76,22 @@ index 00000000..19d634c3 + * + * @param message the message to be returned, or null + */ -+ public void setMessage(String message) { ++ public void setMessage(@Nullable String message) { + this.message = message; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} + -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0056-Basic-PlayerProfile-API.patch b/Spigot-API-Patches/0056-Basic-PlayerProfile-API.patch index 82a033ea55..25f6b3f1af 100644 --- a/Spigot-API-Patches/0056-Basic-PlayerProfile-API.patch +++ b/Spigot-API-Patches/0056-Basic-PlayerProfile-API.patch @@ -1,4 +1,4 @@ -From 61c8f560cab2b9ca2664390d3284a22a9578d775 Mon Sep 17 00:00:00 2001 +From cccc14b25c7e3a218b057172eb111bcb5b89ca27 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 15 Jan 2018 21:46:46 -0500 Subject: [PATCH] Basic PlayerProfile API @@ -7,17 +7,17 @@ Provides basic elements of a PlayerProfile to be used by future API/events diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java new file mode 100644 -index 00000000..529c5376 +index 000000000..476151d2a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java -@@ -0,0 +1,142 @@ +@@ -0,0 +1,145 @@ +package com.destroystokyo.paper.profile; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.Collection; +import java.util.Set; +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents a players profile for the game, such as UUID, Name, and textures. @@ -27,7 +27,8 @@ index 00000000..529c5376 + /** + * @return The players name, if set + */ -+ @Nullable String getName(); ++ @Nullable ++ String getName(); + + /** + * Sets this profiles Name @@ -35,6 +36,7 @@ index 00000000..529c5376 + * @param name The new Name + * @return The previous Name + */ ++ @NotNull + String setName(@Nullable String name); + + /** @@ -48,46 +50,47 @@ index 00000000..529c5376 + * @param uuid The new UUID + * @return The previous UUID + */ ++ @Nullable + UUID setId(@Nullable UUID uuid); + + /** + * @return A Mutable set of this players properties, such as textures. + * Values specified here are subject to implementation details. + */ -+ @Nonnull Set getProperties(); ++ @NotNull Set getProperties(); + + /** + * Check if the Profile has the specified property + * @param property Property name to check + * @return If the property is set + */ -+ boolean hasProperty(String property); ++ boolean hasProperty(@Nullable String property); + + /** + * Sets a property. If the property already exists, the previous one will be replaced + * @param property Property to set. + */ -+ void setProperty(ProfileProperty property); ++ void setProperty(@NotNull ProfileProperty property); + + /** + * Sets multiple properties. If any of the set properties already exist, it will be replaced + * @param properties The properties to set + */ -+ void setProperties(Collection properties); ++ void setProperties(@NotNull Collection properties); + + /** + * Removes a specific property from this profile + * @param property The property to remove + * @return If a property was removed + */ -+ boolean removeProperty(String property); ++ boolean removeProperty(@Nullable String property); + + /** + * Removes a specific property from this profile + * @param property The property to remove + * @return If a property was removed + */ -+ default boolean removeProperty(@Nonnull ProfileProperty property) { ++ default boolean removeProperty(@NotNull ProfileProperty property) { + return removeProperty(property.getName()); + } + @@ -96,7 +99,7 @@ index 00000000..529c5376 + * @param properties The properties to remove + * @return If any property was removed + */ -+ default boolean removeProperties(Collection properties) { ++ default boolean removeProperties(@NotNull Collection properties) { + boolean removed = false; + for (ProfileProperty property : properties) { + if (removeProperty(property)) { @@ -155,7 +158,7 @@ index 00000000..529c5376 +} diff --git a/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java new file mode 100644 -index 00000000..d17061e6 +index 000000000..7b3b6ef53 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java @@ -0,0 +1,72 @@ @@ -163,9 +166,9 @@ index 00000000..d17061e6 + +import com.google.common.base.Preconditions; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.Objects; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents a property on a {@link PlayerProfile} @@ -175,11 +178,11 @@ index 00000000..d17061e6 + private final String value; + private final String signature; + -+ public ProfileProperty(@Nonnull String name, @Nonnull String value) { ++ public ProfileProperty(@NotNull String name, @NotNull String value) { + this(name, value, null); + } + -+ public ProfileProperty(@Nonnull String name, @Nonnull String value, @Nullable String signature) { ++ public ProfileProperty(@NotNull String name, @NotNull String value, @Nullable String signature) { + this.name = Preconditions.checkNotNull(name, "ProfileProperty name can not be null"); + this.value = Preconditions.checkNotNull(value, "ProfileProperty value can not be null"); + this.signature = signature; @@ -188,7 +191,7 @@ index 00000000..d17061e6 + /** + * @return The property name, ie "textures" + */ -+ @Nonnull ++ @NotNull + public String getName() { + return name; + } @@ -196,7 +199,7 @@ index 00000000..d17061e6 + /** + * @return The property value, likely to be base64 encoded + */ -+ @Nonnull ++ @NotNull + public String getValue() { + return value; + } @@ -232,20 +235,10 @@ index 00000000..d17061e6 + } +} diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index eb180374..75634a8d 100644 +index 90b41fd25..16fa78b86 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -51,6 +51,9 @@ import org.bukkit.generator.ChunkGenerator; - import org.bukkit.inventory.ItemFactory; - import org.bukkit.inventory.meta.ItemMeta; - -+import javax.annotation.Nullable; // Paper -+import javax.annotation.Nonnull; // Paper -+ - /** - * Represents the Bukkit core, for version and Server singleton handling - */ -@@ -1492,6 +1495,37 @@ public final class Bukkit { +@@ -1574,6 +1574,40 @@ public final class Bukkit { public static boolean suggestPlayerNamesWhenNullTabCompletions() { return server.suggestPlayerNamesWhenNullTabCompletions(); } @@ -255,7 +248,8 @@ index eb180374..75634a8d 100644 + * @param uuid UUID to create profile for + * @return A PlayerProfile object + */ -+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) { ++ @NotNull ++ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull UUID uuid) { + return server.createProfile(uuid); + } + @@ -264,7 +258,8 @@ index eb180374..75634a8d 100644 + * @param name Name to create profile for + * @return A PlayerProfile object + */ -+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull String name) { ++ @NotNull ++ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull String name) { + return server.createProfile(name); + } + @@ -277,27 +272,18 @@ index eb180374..75634a8d 100644 + * @param name Name to create profile for + * @return A PlayerProfile object + */ ++ @NotNull + public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) { + return server.createProfile(uuid, name); + } // Paper end - public static Server.Spigot spigot() + @NotNull diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index c57f81fd..1d1f7784 100644 +index fe3144c00..edbfa3fdc 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -52,6 +52,9 @@ import org.bukkit.generator.ChunkGenerator; - import org.bukkit.inventory.ItemFactory; - import org.bukkit.inventory.meta.ItemMeta; - -+import javax.annotation.Nullable; // Paper -+import javax.annotation.Nonnull; // Paper -+ - /** - * Represents a server implementation. - */ -@@ -1292,5 +1295,30 @@ public interface Server extends PluginMessageRecipient { +@@ -1379,5 +1379,33 @@ public interface Server extends PluginMessageRecipient { * @return true if player names should be suggested */ boolean suggestPlayerNamesWhenNullTabCompletions(); @@ -307,14 +293,16 @@ index c57f81fd..1d1f7784 100644 + * @param uuid UUID to create profile for + * @return A PlayerProfile object + */ -+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid); ++ @NotNull ++ com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull UUID uuid); + + /** + * Creates a PlayerProfile for the specified name, with UUID as null + * @param name Name to create profile for + * @return A PlayerProfile object + */ -+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull String name); ++ @NotNull ++ com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull String name); + + /** + * Creates a PlayerProfile for the specified name/uuid @@ -325,9 +313,10 @@ index c57f81fd..1d1f7784 100644 + * @param name Name to create profile for + * @return A PlayerProfile object + */ ++ @NotNull + com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name); // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0057-Shoulder-Entities-Release-API.patch b/Spigot-API-Patches/0057-Shoulder-Entities-Release-API.patch index bbff278c64..ffa6216371 100644 --- a/Spigot-API-Patches/0057-Shoulder-Entities-Release-API.patch +++ b/Spigot-API-Patches/0057-Shoulder-Entities-Release-API.patch @@ -1,14 +1,14 @@ -From 20ce1d6f58eaa8aa7b041d8f0588ab9505d035ae Mon Sep 17 00:00:00 2001 +From 5fcee5665b665276220dc2a9eedb5588880b2f9d Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Jun 2017 15:04:51 -0400 Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 8fc5c83c..040562eb 100644 +index f76bc85c4..037e23930 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -312,6 +312,24 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -331,6 +331,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public int getExpToLevel(); @@ -19,6 +19,7 @@ index 8fc5c83c..040562eb 100644 + * + * @return The released entity, or null + */ ++ @Nullable + public Entity releaseLeftShoulderEntity(); + + /** @@ -27,6 +28,7 @@ index 8fc5c83c..040562eb 100644 + * + * @return The released entity, or null + */ ++ @Nullable + public Entity releaseRightShoulderEntity(); + // Paper end + @@ -34,5 +36,5 @@ index 8fc5c83c..040562eb 100644 * Discover a recipe for this player such that it has not already been * discovered. This method will add the key's associated recipe to the -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0058-Profile-Lookup-Events.patch b/Spigot-API-Patches/0058-Profile-Lookup-Events.patch index 582fe8a24a..5270fd596a 100644 --- a/Spigot-API-Patches/0058-Profile-Lookup-Events.patch +++ b/Spigot-API-Patches/0058-Profile-Lookup-Events.patch @@ -1,4 +1,4 @@ -From cbcd37fcba051f9148b24a33e042f21093ed9f2e Mon Sep 17 00:00:00 2001 +From 0e47d3ccc037ae116f442c963aef0ff5115a4186 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Jun 2017 16:30:44 -0400 Subject: [PATCH] Profile Lookup Events @@ -8,10 +8,10 @@ profiles that had to be looked up. diff --git a/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java new file mode 100644 -index 00000000..160c98fe +index 000000000..8df37c07c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/LookupProfileEvent.java -@@ -0,0 +1,44 @@ +@@ -0,0 +1,46 @@ +package com.destroystokyo.paper.event.profile; + +import com.destroystokyo.paper.profile.PlayerProfile; @@ -19,7 +19,7 @@ index 00000000..160c98fe +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + -+import javax.annotation.Nonnull; ++import org.jetbrains.annotations.NotNull; + +/** + * Allows a plugin to be notified anytime AFTER a Profile has been looked up from the Mojang API @@ -32,9 +32,9 @@ index 00000000..160c98fe + + private static final HandlerList handlers = new HandlerList(); + -+ private final PlayerProfile profile; ++ @NotNull private final PlayerProfile profile; + -+ public LookupProfileEvent(@Nonnull PlayerProfile profile) { ++ public LookupProfileEvent(@NotNull PlayerProfile profile) { + super(!Bukkit.isPrimaryThread()); + this.profile = profile; + } @@ -42,26 +42,28 @@ index 00000000..160c98fe + /** + * @return The profile that was recently looked up. This profile can be mutated + */ -+ @Nonnull ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java new file mode 100644 -index 00000000..e5a5986a +index 000000000..4dcf6242c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/PreLookupProfileEvent.java -@@ -0,0 +1,105 @@ +@@ -0,0 +1,108 @@ +package com.destroystokyo.paper.event.profile; + +import com.destroystokyo.paper.profile.PlayerProfile; @@ -71,11 +73,11 @@ index 00000000..e5a5986a +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows a plugin to intercept a Profile Lookup for a Profile by name @@ -90,11 +92,11 @@ index 00000000..e5a5986a +public class PreLookupProfileEvent extends Event { + + private static final HandlerList handlers = new HandlerList(); -+ private final String name; ++ @NotNull private final String name; + private UUID uuid; -+ private Set properties = new HashSet<>(); ++ @NotNull private Set properties = new HashSet<>(); + -+ public PreLookupProfileEvent(@Nonnull String name) { ++ public PreLookupProfileEvent(@NotNull String name) { + super(!Bukkit.isPrimaryThread()); + this.name = name; + } @@ -102,7 +104,7 @@ index 00000000..e5a5986a + /** + * @return Name of the profile + */ -+ @Nonnull ++ @NotNull + public String getName() { + return name; + } @@ -134,6 +136,7 @@ index 00000000..e5a5986a + * @return The currently pending prepopulated properties. + * Any property in this Set will be automatically prefilled on this Profile + */ ++ @NotNull + public Set getProfileProperties() { + return this.properties; + } @@ -143,7 +146,7 @@ index 00000000..e5a5986a + * Any property in this Set will be automatically prefilled on this Profile + * @param properties The properties to add + */ -+ public void setProfileProperties(Set properties) { ++ public void setProfileProperties(@NotNull Set properties) { + this.properties = new HashSet<>(); + this.properties.addAll(properties); + } @@ -153,20 +156,22 @@ index 00000000..e5a5986a + * Any property in this Set will be automatically prefilled on this Profile + * @param properties The properties to add + */ -+ public void addProfileProperties(Set properties) { ++ public void addProfileProperties(@NotNull Set properties) { + this.properties.addAll(properties); + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } + +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0059-Entity-fromMobSpawner.patch b/Spigot-API-Patches/0059-Entity-fromMobSpawner.patch index 44d0d5d8f8..6b4ac293bc 100644 --- a/Spigot-API-Patches/0059-Entity-fromMobSpawner.patch +++ b/Spigot-API-Patches/0059-Entity-fromMobSpawner.patch @@ -1,16 +1,16 @@ -From e5a62fbf4f51754de1e49ce6046eefc76c317a73 Mon Sep 17 00:00:00 2001 +From c98cd92d19f14a732e1ac7e3e3922047e4dbf817 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 18 Jun 2017 18:17:05 -0500 Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 015a4c56..13de2d74 100644 +index 69307e252..373204d37 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -569,5 +569,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable { - * @return Location where entity originates or null if not yet added +@@ -591,5 +591,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable { */ + @Nullable Location getOrigin(); + + /** @@ -22,5 +22,5 @@ index 015a4c56..13de2d74 100644 // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0060-Improve-the-Saddle-API-for-Horses.patch b/Spigot-API-Patches/0060-Improve-the-Saddle-API-for-Horses.patch index 2c0856bc58..aefa6df2d2 100644 --- a/Spigot-API-Patches/0060-Improve-the-Saddle-API-for-Horses.patch +++ b/Spigot-API-Patches/0060-Improve-the-Saddle-API-for-Horses.patch @@ -1,4 +1,4 @@ -From 9185b0d77ba37d0e88629037967032c2b4ba3761 Mon Sep 17 00:00:00 2001 +From 01ff2f70c2ef6bafe4b99eb940d63bb256526819 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 10 Dec 2016 16:12:48 -0500 Subject: [PATCH] Improve the Saddle API for Horses @@ -8,12 +8,14 @@ and access their saddle state separately from an interface shared with Armor. diff --git a/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java b/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java new file mode 100644 -index 00000000..a39b9544 +index 000000000..163ffe8ff --- /dev/null +++ b/src/main/java/org/bukkit/inventory/ArmoredHorseInventory.java -@@ -0,0 +1,18 @@ +@@ -0,0 +1,21 @@ +package org.bukkit.inventory; + ++import org.jetbrains.annotations.Nullable; ++ +public interface ArmoredHorseInventory extends AbstractHorseInventory { + + /** @@ -21,6 +23,7 @@ index 00000000..a39b9544 + * + * @return the armor item + */ ++ @Nullable + ItemStack getArmor(); + + /** @@ -28,13 +31,13 @@ index 00000000..a39b9544 + * + * @param stack the new item + */ -+ void setArmor(ItemStack stack); ++ void setArmor(@Nullable ItemStack stack); +} diff --git a/src/main/java/org/bukkit/inventory/HorseInventory.java b/src/main/java/org/bukkit/inventory/HorseInventory.java -index a73c9850..e14c1277 100644 +index 608e99c42..53498debe 100644 --- a/src/main/java/org/bukkit/inventory/HorseInventory.java +++ b/src/main/java/org/bukkit/inventory/HorseInventory.java -@@ -3,19 +3,4 @@ package org.bukkit.inventory; +@@ -5,20 +5,4 @@ import org.jetbrains.annotations.Nullable; /** * An interface to the inventory of a Horse. */ @@ -45,6 +48,7 @@ index a73c9850..e14c1277 100644 - * - * @return the armor item - */ +- @Nullable - ItemStack getArmor(); - - /** @@ -52,25 +56,25 @@ index a73c9850..e14c1277 100644 - * - * @param stack the new item - */ -- void setArmor(ItemStack stack); +- void setArmor(@Nullable ItemStack stack); -} +public interface HorseInventory extends AbstractHorseInventory, ArmoredHorseInventory {} diff --git a/src/main/java/org/bukkit/inventory/LlamaInventory.java b/src/main/java/org/bukkit/inventory/LlamaInventory.java -index 9b3dcf3f..7856a7f2 100644 +index 2fa2c9d07..5ac1afb8a 100644 --- a/src/main/java/org/bukkit/inventory/LlamaInventory.java +++ b/src/main/java/org/bukkit/inventory/LlamaInventory.java -@@ -5,7 +5,7 @@ import org.bukkit.entity.Llama; +@@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable; /** * An interface to the inventory of a {@link Llama}. */ -public interface LlamaInventory extends AbstractHorseInventory { +public interface LlamaInventory extends SaddledHorseInventory { - /* + /** * Gets the item in the llama's decor slot. diff --git a/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java new file mode 100644 -index 00000000..7944f26a +index 000000000..7944f26a3 --- /dev/null +++ b/src/main/java/org/bukkit/inventory/SaddledHorseInventory.java @@ -0,0 +1,3 @@ @@ -78,5 +82,5 @@ index 00000000..7944f26a + +public interface SaddledHorseInventory extends AbstractHorseInventory {} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0061-ensureServerConversions-API.patch b/Spigot-API-Patches/0061-ensureServerConversions-API.patch index 88ff60f508..6a870beb35 100644 --- a/Spigot-API-Patches/0061-ensureServerConversions-API.patch +++ b/Spigot-API-Patches/0061-ensureServerConversions-API.patch @@ -1,4 +1,4 @@ -From c6f53269f00ebf72dfb63f9e60fe9d96762faf50 Mon Sep 17 00:00:00 2001 +From 4c5a58a93cd324de4bbb929a3feac630cd3a758d Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 23:55:48 -0400 Subject: [PATCH] ensureServerConversions API @@ -7,13 +7,13 @@ 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/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index ec2b8b8e..3012aec2 100644 +index cbcbe8c8a..8e602cf51 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -134,4 +134,16 @@ public interface ItemFactory { - */ +@@ -141,4 +141,17 @@ public interface ItemFactory { @Deprecated - Material updateMaterial(final ItemMeta meta, final Material material) throws IllegalArgumentException; + @NotNull + Material updateMaterial(@NotNull final ItemMeta meta, @NotNull final Material material) throws IllegalArgumentException; + // Paper start + /** + * Minecart updates are converting simple item stacks into more complex NBT oriented Item Stacks. @@ -24,14 +24,15 @@ index ec2b8b8e..3012aec2 100644 + * @param item The item to process conversions on + * @return A potentially Data Converted ItemStack + */ -+ ItemStack ensureServerConversions(ItemStack item); ++ @NotNull ++ ItemStack ensureServerConversions(@NotNull ItemStack item); + // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index c744799f..5e8de115 100644 +index 7b709457f..e8f97c949 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -506,7 +506,12 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { +@@ -517,7 +517,12 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { } } @@ -45,7 +46,7 @@ index c744799f..5e8de115 100644 } /** -@@ -564,4 +569,18 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { +@@ -576,4 +581,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { return true; } @@ -59,11 +60,12 @@ index c744799f..5e8de115 100644 + * + * @return A potentially Data Converted ItemStack + */ ++ @NotNull + public ItemStack ensureServerConversions() { + return Bukkit.getServer().getItemFactory().ensureServerConversions(this); + } + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0062-Add-getI18NDisplayName-API.patch b/Spigot-API-Patches/0062-Add-getI18NDisplayName-API.patch index 8700439dfe..94727ace32 100644 --- a/Spigot-API-Patches/0062-Add-getI18NDisplayName-API.patch +++ b/Spigot-API-Patches/0062-Add-getI18NDisplayName-API.patch @@ -1,4 +1,4 @@ -From f31c0b3a4d3fe17a7fd04057156089d7db81dc3a Mon Sep 17 00:00:00 2001 +From c2814c3f3d70e2834f47c4bb3beafb0d591d4985 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 May 2016 23:55:48 -0400 Subject: [PATCH] Add getI18NDisplayName API @@ -8,13 +8,13 @@ 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/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 3012aec2..63dd1b32 100644 +index 8e602cf51..dca77bbaf 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -145,5 +145,15 @@ public interface ItemFactory { - * @return A potentially Data Converted ItemStack +@@ -153,5 +153,16 @@ public interface ItemFactory { */ - ItemStack ensureServerConversions(ItemStack item); + @NotNull + ItemStack ensureServerConversions(@NotNull ItemStack item); + + /** + * Gets the Display name as seen in the Client. @@ -24,14 +24,15 @@ index 3012aec2..63dd1b32 100644 + * @param item Item to return Display name of + * @return Display name of Item + */ -+ String getI18NDisplayName(ItemStack item); ++ @Nullable ++ String getI18NDisplayName(@Nullable ItemStack item); // Paper end } diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index 5e8de115..c3cb1247 100644 +index e8f97c949..b1c02ac0d 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -582,5 +582,16 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { +@@ -595,5 +595,17 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { public ItemStack ensureServerConversions() { return Bukkit.getServer().getItemFactory().ensureServerConversions(this); } @@ -43,11 +44,12 @@ index 5e8de115..c3cb1247 100644 + * + * @return Display name of Item + */ ++ @Nullable + public String getI18NDisplayName() { + return Bukkit.getServer().getItemFactory().getI18NDisplayName(this); + } // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0063-ProfileWhitelistVerifyEvent.patch b/Spigot-API-Patches/0063-ProfileWhitelistVerifyEvent.patch index 56a4ba613a..81d24e0344 100644 --- a/Spigot-API-Patches/0063-ProfileWhitelistVerifyEvent.patch +++ b/Spigot-API-Patches/0063-ProfileWhitelistVerifyEvent.patch @@ -1,4 +1,4 @@ -From ad76debcffa4a9ef371ba7f2d8b9c1034f16fba4 Mon Sep 17 00:00:00 2001 +From c76cd792c71b03975683e5660613d55613c025f8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 3 Jul 2017 18:11:34 -0500 Subject: [PATCH] ProfileWhitelistVerifyEvent @@ -9,10 +9,10 @@ Allows you to do dynamic whitelisting and change of kick message diff --git a/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java new file mode 100644 -index 00000000..b57fff9f +index 000000000..b10176289 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java -@@ -0,0 +1,111 @@ +@@ -0,0 +1,117 @@ +/* + * Copyright (c) 2017 - Daniel Ennis (Aikar) - MIT License + * @@ -41,6 +41,8 @@ index 00000000..b57fff9f +import com.destroystokyo.paper.profile.PlayerProfile; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Fires when the server needs to verify if a player is whitelisted. @@ -51,13 +53,13 @@ index 00000000..b57fff9f + */ +public class ProfileWhitelistVerifyEvent extends Event { + private static final HandlerList handlers = new HandlerList(); -+ private final PlayerProfile profile; ++ @NotNull private final PlayerProfile profile; + private final boolean whitelistEnabled; + private boolean whitelisted; + private final boolean isOp; -+ private String kickMessage; ++ @Nullable private String kickMessage; + -+ public ProfileWhitelistVerifyEvent(final PlayerProfile profile, boolean whitelistEnabled, boolean whitelisted, boolean isOp, String kickMessage) { ++ public ProfileWhitelistVerifyEvent(@NotNull final PlayerProfile profile, boolean whitelistEnabled, boolean whitelisted, boolean isOp, @Nullable String kickMessage) { + this.profile = profile; + this.whitelistEnabled = whitelistEnabled; + this.whitelisted = whitelisted; @@ -68,6 +70,7 @@ index 00000000..b57fff9f + /** + * @return the currently planned message to send to the user if they are not whitelisted + */ ++ @Nullable + public String getKickMessage() { + return kickMessage; + } @@ -75,13 +78,14 @@ index 00000000..b57fff9f + /** + * @param kickMessage The message to send to the player on kick if not whitelisted. May set to null to use the server configured default + */ -+ public void setKickMessage(String kickMessage) { ++ public void setKickMessage(@Nullable String kickMessage) { + this.kickMessage = kickMessage; + } + + /** + * @return The profile of the player trying to connect + */ ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } @@ -115,15 +119,17 @@ index 00000000..b57fff9f + return whitelistEnabled; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0064-Make-plugins-list-alphabetical.patch b/Spigot-API-Patches/0064-Make-plugins-list-alphabetical.patch index 30c3586989..1aca737c1a 100644 --- a/Spigot-API-Patches/0064-Make-plugins-list-alphabetical.patch +++ b/Spigot-API-Patches/0064-Make-plugins-list-alphabetical.patch @@ -1,11 +1,11 @@ -From 37c5379af867301839590856be1d68cdf1a0b4de Mon Sep 17 00:00:00 2001 +From 482ec24d923b8dc78080d5edcfe1422087035346 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 02:08:55 -0500 Subject: [PATCH] Make /plugins list alphabetical diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index e40b03a7..b1d384e8 100644 +index 6f95bf3c..d4e74d29 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -3,6 +3,8 @@ package org.bukkit.command.defaults; @@ -17,9 +17,9 @@ index e40b03a7..b1d384e8 100644 import org.bukkit.Bukkit; import org.bukkit.ChatColor; -@@ -32,19 +34,24 @@ public class PluginsCommand extends BukkitCommand { - } +@@ -35,19 +37,24 @@ public class PluginsCommand extends BukkitCommand { + @NotNull private String getPluginList() { - StringBuilder pluginList = new StringBuilder(); - Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); @@ -50,5 +50,5 @@ index e40b03a7..b1d384e8 100644 } } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0065-LivingEntity-setKiller.patch b/Spigot-API-Patches/0065-LivingEntity-setKiller.patch index 02fba3485b..1f0cffd326 100644 --- a/Spigot-API-Patches/0065-LivingEntity-setKiller.patch +++ b/Spigot-API-Patches/0065-LivingEntity-setKiller.patch @@ -1,24 +1,15 @@ -From 66621223158643139e2189afc257009daf70f05e Mon Sep 17 00:00:00 2001 +From 8b825df13b6aaa53037a89ec4c1c05b4b6ea4173 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 31 Jul 2017 01:49:43 -0500 Subject: [PATCH] LivingEntity#setKiller diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index f67711fd..3f93b70c 100644 +index 1100e305..706d8f52 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -17,6 +17,8 @@ import org.bukkit.projectiles.ProjectileSource; - import org.bukkit.util.RayTraceResult; - import org.bukkit.util.Vector; - -+import javax.annotation.Nullable; -+ - /** - * Represents a living entity, such as a monster or player - */ -@@ -239,6 +241,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource - */ +@@ -250,6 +250,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource + @Nullable public Player getKiller(); + // Paper start @@ -34,5 +25,5 @@ index f67711fd..3f93b70c 100644 * Adds the given {@link PotionEffect} to the living entity. *

-- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0066-Handle-plugin-prefixes-in-implementation-logging-con.patch b/Spigot-API-Patches/0066-Handle-plugin-prefixes-in-implementation-logging-con.patch index e563d0cd4a..4767e6d40f 100644 --- a/Spigot-API-Patches/0066-Handle-plugin-prefixes-in-implementation-logging-con.patch +++ b/Spigot-API-Patches/0066-Handle-plugin-prefixes-in-implementation-logging-con.patch @@ -1,4 +1,4 @@ -From 950732e4f72ad1ebd0983638df104c7957ecc3ef Mon Sep 17 00:00:00 2001 +From 6b3735bc5ec6609bb14a78335eaa7ea5c5574db4 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 16:14:13 +0200 Subject: [PATCH] Handle plugin prefixes in implementation logging @@ -17,10 +17,10 @@ The implementation should handle plugin prefixes by displaying logger names when appropriate. diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -index 67887806..a81dae43 100644 +index 7c934899..9a342788 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -@@ -42,7 +42,7 @@ public abstract class JavaPlugin extends PluginBase { +@@ -44,7 +44,7 @@ public abstract class JavaPlugin extends PluginBase { private boolean naggable = true; private FileConfiguration newConfig = null; private File configFile = null; @@ -29,7 +29,7 @@ index 67887806..a81dae43 100644 public JavaPlugin() { final ClassLoader classLoader = this.getClass().getClassLoader(); -@@ -267,7 +267,8 @@ public abstract class JavaPlugin extends PluginBase { +@@ -278,7 +278,8 @@ public abstract class JavaPlugin extends PluginBase { this.dataFolder = dataFolder; this.classLoader = classLoader; this.configFile = new File(dataFolder, "config.yml"); @@ -40,5 +40,5 @@ index 67887806..a81dae43 100644 /** -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0067-Allow-plugins-to-use-SLF4J-for-logging.patch b/Spigot-API-Patches/0067-Allow-plugins-to-use-SLF4J-for-logging.patch index b8196a0ba4..c6aab3f05a 100644 --- a/Spigot-API-Patches/0067-Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/Spigot-API-Patches/0067-Allow-plugins-to-use-SLF4J-for-logging.patch @@ -1,4 +1,4 @@ -From 83b0d804b7335d31c3ff87a7070c401dc869d824 Mon Sep 17 00:00:00 2001 +From 4d33389d2be22a2955605e09a43ffd1109a3eddb Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 16:33:12 +0200 Subject: [PATCH] Allow plugins to use SLF4J for logging @@ -14,13 +14,13 @@ it without having to shade it in the plugin and going through several layers of logging abstraction. diff --git a/pom.xml b/pom.xml -index 84ba2076..3ebc6287 100644 +index 082f2f0c5..13cdc25f8 100644 --- a/pom.xml +++ b/pom.xml -@@ -103,6 +103,14 @@ - compile +@@ -109,6 +109,13 @@ + 17.0.0 + provided - + + + org.slf4j @@ -28,19 +28,19 @@ index 84ba2076..3ebc6287 100644 + 1.7.25 + compile + -+ junit diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java -index 55debf5d..8d2999ac 100644 +index 076ec041f..b4882f48b 100644 --- a/src/main/java/org/bukkit/plugin/Plugin.java +++ b/src/main/java/org/bukkit/plugin/Plugin.java -@@ -157,6 +157,12 @@ public interface Plugin extends TabExecutor { - */ +@@ -167,6 +167,13 @@ public interface Plugin extends TabExecutor { + @NotNull public Logger getLogger(); + // Paper start - Add SLF4J logger ++ @NotNull + default org.slf4j.Logger getSLF4JLogger() { + return org.slf4j.LoggerFactory.getLogger(getLogger().getName()); + } @@ -50,5 +50,5 @@ index 55debf5d..8d2999ac 100644 * Returns the name of the plugin. *

-- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch b/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch index df0ee2fa33..7aed5d070d 100644 --- a/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch +++ b/Spigot-API-Patches/0068-Add-workaround-for-plugins-modifying-the-parent-of-t.patch @@ -1,4 +1,4 @@ -From ab1ab274192f3fbc229d5480bf989597e383f1c2 Mon Sep 17 00:00:00 2001 +From ab3fa3cb5c5e5389c8fb4900b9e5fb6800e11be1 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Thu, 21 Sep 2017 19:41:20 +0200 Subject: [PATCH] Add workaround for plugins modifying the parent of the plugin @@ -14,10 +14,10 @@ parent of the plugin logger to avoid this. diff --git a/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java new file mode 100644 -index 00000000..d052b2f5 +index 000000000..76f2cb9cd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/utils/PaperPluginLogger.java -@@ -0,0 +1,39 @@ +@@ -0,0 +1,41 @@ +package com.destroystokyo.paper.utils; + +import org.bukkit.plugin.PluginDescriptionFile; @@ -25,13 +25,15 @@ index 00000000..d052b2f5 +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.Logger; ++import org.jetbrains.annotations.NotNull; + +/** + * Prevents plugins (e.g. Essentials) from changing the parent of the plugin logger. + */ +public class PaperPluginLogger extends Logger { + -+ public static Logger getLogger(PluginDescriptionFile description) { ++ @NotNull ++ public static Logger getLogger(@NotNull PluginDescriptionFile description) { + Logger logger = new PaperPluginLogger(description); + if (!LogManager.getLogManager().addLogger(logger)) { + // Disable this if it's going to happen across reloads anyways... @@ -42,12 +44,12 @@ index 00000000..d052b2f5 + return logger; + } + -+ private PaperPluginLogger(PluginDescriptionFile description) { ++ private PaperPluginLogger(@NotNull PluginDescriptionFile description) { + super(description.getPrefix() != null ? description.getPrefix() : description.getName(), null); + } + + @Override -+ public void setParent(Logger parent) { ++ public void setParent(@NotNull Logger parent) { + if (getParent() != null) { + warning("Ignoring attempt to change parent of plugin logger"); + } else { @@ -58,10 +60,10 @@ index 00000000..d052b2f5 + +} diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -index a81dae43..15f22ade 100644 +index 9a3427882..96ebe72ca 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java -@@ -42,7 +42,7 @@ public abstract class JavaPlugin extends PluginBase { +@@ -44,7 +44,7 @@ public abstract class JavaPlugin extends PluginBase { private boolean naggable = true; private FileConfiguration newConfig = null; private File configFile = null; @@ -70,7 +72,7 @@ index a81dae43..15f22ade 100644 public JavaPlugin() { final ClassLoader classLoader = this.getClass().getClassLoader(); -@@ -267,8 +267,11 @@ public abstract class JavaPlugin extends PluginBase { +@@ -278,8 +278,11 @@ public abstract class JavaPlugin extends PluginBase { this.dataFolder = dataFolder; this.classLoader = classLoader; this.configFile = new File(dataFolder, "config.yml"); @@ -85,10 +87,10 @@ index a81dae43..15f22ade 100644 /** diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -index bc33ff33..213f6234 100644 +index c39fcac5a..0df1926fa 100644 --- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java +++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java -@@ -36,6 +36,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -38,6 +38,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot final JavaPlugin plugin; private JavaPlugin pluginInit; private IllegalStateException pluginState; @@ -96,7 +98,7 @@ index bc33ff33..213f6234 100644 static { ClassLoader.registerAsParallelCapable(); -@@ -53,6 +54,8 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -55,6 +56,8 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot this.manifest = jar.getManifest(); this.url = file.toURI().toURL(); @@ -105,7 +107,7 @@ index bc33ff33..213f6234 100644 try { Class jarClass; try { -@@ -169,6 +172,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot +@@ -172,6 +175,7 @@ public final class PluginClassLoader extends URLClassLoader { // Spigot pluginState = new IllegalStateException("Initial initialization"); this.pluginInit = javaPlugin; @@ -114,5 +116,5 @@ index bc33ff33..213f6234 100644 } } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0069-Add-PlayerJumpEvent.patch b/Spigot-API-Patches/0069-Add-PlayerJumpEvent.patch index 2bb328fd7e..5872e058a1 100644 --- a/Spigot-API-Patches/0069-Add-PlayerJumpEvent.patch +++ b/Spigot-API-Patches/0069-Add-PlayerJumpEvent.patch @@ -1,4 +1,4 @@ -From f260a9837d5bc3512ba711e4612fb095e71a0c23 Mon Sep 17 00:00:00 2001 +From c6b1a2b8f11a56eb2d4e78d492fc679cc20fbed1 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 28 Sep 2017 17:21:32 -0400 Subject: [PATCH] Add PlayerJumpEvent @@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java new file mode 100644 -index 00000000..dd24f9b0 +index 000000000..289a0d784 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java -@@ -0,0 +1,101 @@ +@@ -0,0 +1,106 @@ +package com.destroystokyo.paper.event.player; + +import com.google.common.base.Preconditions; @@ -18,6 +18,7 @@ index 00000000..dd24f9b0 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when the server detects the player is jumping. @@ -29,10 +30,10 @@ index 00000000..dd24f9b0 +public class PlayerJumpEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancel = false; -+ private Location from; -+ private Location to; ++ @NotNull private Location from; ++ @NotNull private Location to; + -+ public PlayerJumpEvent(final Player player, final Location from, final Location to) { ++ public PlayerJumpEvent(@NotNull final Player player, @NotNull final Location from, @NotNull final Location to) { + super(player); + this.from = from; + this.to = to; @@ -71,6 +72,7 @@ index 00000000..dd24f9b0 + * + * @return Location the player jumped from + */ ++ @NotNull + public Location getFrom() { + return from; + } @@ -80,7 +82,7 @@ index 00000000..dd24f9b0 + * + * @param from New location to mark as the players previous location + */ -+ public void setFrom(Location from) { ++ public void setFrom(@NotNull Location from) { + validateLocation(from); + this.from = from; + } @@ -93,6 +95,7 @@ index 00000000..dd24f9b0 + * + * @return Location the player jumped to + */ ++ @NotNull + public Location getTo() { + return to; + } @@ -102,15 +105,17 @@ index 00000000..dd24f9b0 + Preconditions.checkArgument(loc.getWorld() != null, "Cannot use location with null world!"); + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0070-Expose-client-protocol-version-and-virtual-host.patch b/Spigot-API-Patches/0070-Expose-client-protocol-version-and-virtual-host.patch index fc0a8cb7d8..a27aad40c4 100644 --- a/Spigot-API-Patches/0070-Expose-client-protocol-version-and-virtual-host.patch +++ b/Spigot-API-Patches/0070-Expose-client-protocol-version-and-virtual-host.patch @@ -1,4 +1,4 @@ -From 16cc6fb4885d1c34e7c05dad55cd53b16931ca41 Mon Sep 17 00:00:00 2001 +From 288a297fa9c66575aca683e0f2cb693bc119a3c2 Mon Sep 17 00:00:00 2001 From: Minecrell Date: Tue, 10 Oct 2017 18:44:42 +0200 Subject: [PATCH] Expose client protocol version and virtual host @@ -11,15 +11,16 @@ Add a NetworkClient interface that provides access to: diff --git a/src/main/java/com/destroystokyo/paper/network/NetworkClient.java b/src/main/java/com/destroystokyo/paper/network/NetworkClient.java new file mode 100644 -index 00000000..9072e384 +index 000000000..7b2af1bd7 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/NetworkClient.java -@@ -0,0 +1,39 @@ +@@ -0,0 +1,41 @@ +package com.destroystokyo.paper.network; + +import java.net.InetSocketAddress; + -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Represents a client connected to the server. @@ -31,6 +32,7 @@ index 00000000..9072e384 + * + * @return The client's socket address + */ ++ @NotNull + InetSocketAddress getAddress(); + + /** @@ -55,10 +57,10 @@ index 00000000..9072e384 + +} diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index bf284f2c..5e65657a 100644 +index 4b59f8feb..eeed2e796 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -30,7 +30,7 @@ import org.bukkit.scoreboard.Scoreboard; +@@ -31,7 +31,7 @@ import org.jetbrains.annotations.Nullable; /** * Represents a player, connected or not */ @@ -68,5 +70,5 @@ index bf284f2c..5e65657a 100644 /** * Gets the "friendly" name to display of this player. This may include -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0071-Add-PlayerArmorChangeEvent.patch b/Spigot-API-Patches/0071-Add-PlayerArmorChangeEvent.patch index 863fdcf422..eeac729132 100644 --- a/Spigot-API-Patches/0071-Add-PlayerArmorChangeEvent.patch +++ b/Spigot-API-Patches/0071-Add-PlayerArmorChangeEvent.patch @@ -1,4 +1,4 @@ -From fa9d75620f187b39ddf397a8a37e951768f1a1f5 Mon Sep 17 00:00:00 2001 +From 72e0411e853da36205ab8e3d24041de5d7b80ac5 Mon Sep 17 00:00:00 2001 From: pkt77 Date: Fri, 10 Nov 2017 23:45:59 -0500 Subject: [PATCH] Add PlayerArmorChangeEvent @@ -6,10 +6,10 @@ Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java new file mode 100644 -index 00000000..0783ac82 +index 000000000..2827a1002 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java -@@ -0,0 +1,135 @@ +@@ -0,0 +1,137 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.Material; @@ -18,12 +18,12 @@ index 00000000..0783ac82 +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +import static org.bukkit.Material.*; + @@ -35,11 +35,11 @@ index 00000000..0783ac82 +public class PlayerArmorChangeEvent extends PlayerEvent { + private static final HandlerList HANDLERS = new HandlerList(); + -+ private final SlotType slotType; -+ private final ItemStack oldItem; -+ private final ItemStack newItem; ++ @NotNull private final SlotType slotType; ++ @Nullable private final ItemStack oldItem; ++ @Nullable private final ItemStack newItem; + -+ public PlayerArmorChangeEvent(Player player, SlotType slotType, ItemStack oldItem, ItemStack newItem) { ++ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @Nullable ItemStack oldItem, @Nullable ItemStack newItem) { + super(player); + this.slotType = slotType; + this.oldItem = oldItem; @@ -51,7 +51,7 @@ index 00000000..0783ac82 + * + * @return type of slot being altered + */ -+ @Nonnull ++ @NotNull + public SlotType getSlotType() { + return this.slotType; + } @@ -81,11 +81,13 @@ index 00000000..0783ac82 + return "ArmorChangeEvent{" + "player=" + player + ", slotType=" + slotType + ", oldItem=" + oldItem + ", newItem=" + newItem + '}'; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return HANDLERS; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return HANDLERS; + } @@ -109,7 +111,7 @@ index 00000000..0783ac82 + * + * @return immutable set of material types + */ -+ @Nonnull ++ @NotNull + public Set getTypes() { + if (immutableTypes == null) { + immutableTypes = Collections.unmodifiableSet(mutableTypes); @@ -125,7 +127,7 @@ index 00000000..0783ac82 + * @return slot type the material will go in, or null if it won't + */ + @Nullable -+ public static SlotType getByMaterial(Material material) { ++ public static SlotType getByMaterial(@NotNull Material material) { + for (SlotType slotType : values()) { + if (slotType.getTypes().contains(material)) { + return slotType; @@ -140,11 +142,11 @@ index 00000000..0783ac82 + * @param material material to check + * @return whether or not this material can be equipped + */ -+ public static boolean isEquipable(Material material) { ++ public static boolean isEquipable(@NotNull Material material) { + return getByMaterial(material) != null; + } + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0072-API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-API-Patches/0072-API-to-get-a-BlockState-without-a-snapshot.patch index 91699d6ba6..a7e8b099aa 100644 --- a/Spigot-API-Patches/0072-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-API-Patches/0072-API-to-get-a-BlockState-without-a-snapshot.patch @@ -1,4 +1,4 @@ -From 4196a2419eb0aef7c2d79bc5373c2fc3bd38c81e Mon Sep 17 00:00:00 2001 +From f88c6e674e15899aa75a38b121eda2ee7e3f8cd2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 6 Nov 2017 21:10:01 -0500 Subject: [PATCH] API to get a BlockState without a snapshot @@ -9,11 +9,11 @@ on the real tile entity. This is useful for where performance is needed diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 7664728a..064acf32 100644 +index c88088c0f..708288e99 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -254,6 +254,15 @@ public interface Block extends Metadatable { - */ +@@ -269,6 +269,16 @@ public interface Block extends Metadatable { + @NotNull BlockState getState(); + // Paper start @@ -22,6 +22,7 @@ index 7664728a..064acf32 100644 + * @param useSnapshot if this block is a TE, should we create a fully copy of the TileEntity + * @return BlockState with the current state of this block + */ ++ @NotNull + BlockState getState(boolean useSnapshot); + // Paper end + @@ -29,5 +30,5 @@ index 7664728a..064acf32 100644 * Returns the biome that this block resides in * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0073-AsyncTabCompleteEvent.patch b/Spigot-API-Patches/0073-AsyncTabCompleteEvent.patch index b151a0c972..f10fc7ecb9 100644 --- a/Spigot-API-Patches/0073-AsyncTabCompleteEvent.patch +++ b/Spigot-API-Patches/0073-AsyncTabCompleteEvent.patch @@ -1,4 +1,4 @@ -From e45cd02ad7224199d008068ce464d820e036130c Mon Sep 17 00:00:00 2001 +From aaede4321cd33af05db4d80ad1e75d17782fd65b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 26 Nov 2017 13:17:09 -0500 Subject: [PATCH] AsyncTabCompleteEvent @@ -13,10 +13,10 @@ completion, such as offline players. diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java new file mode 100644 -index 00000000..3c51aaf9 +index 000000000..619ed3716 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java -@@ -0,0 +1,168 @@ +@@ -0,0 +1,177 @@ +/* + * Copyright (c) 2017 Daniel Ennis (Aikar) MIT License + * @@ -53,6 +53,8 @@ index 00000000..3c51aaf9 + +import java.util.ArrayList; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Allows plugins to compute tab completion results asynchronously. If this event provides completions, then the standard synchronous process will not be fired to populate the results. However, the synchronous TabCompleteEvent will fire with the Async results. @@ -60,16 +62,17 @@ index 00000000..3c51aaf9 + * Only 1 process will be allowed to provide completions, the Async Event, or the standard process. + */ +public class AsyncTabCompleteEvent extends Event implements Cancellable { -+ private final CommandSender sender; -+ private final String buffer; ++ @NotNull private final CommandSender sender; ++ @NotNull private final String buffer; + private final boolean isCommand; ++ @Nullable + private final Location loc; -+ private List completions; ++ @NotNull private List completions; + private boolean cancelled; + private boolean handled = false; + private boolean fireSyncHandler = true; + -+ public AsyncTabCompleteEvent(CommandSender sender, List completions, String buffer, boolean isCommand, Location loc) { ++ public AsyncTabCompleteEvent(@NotNull CommandSender sender, @NotNull List completions, @NotNull String buffer, boolean isCommand, @Nullable Location loc) { + super(true); + this.sender = sender; + this.completions = completions; @@ -83,6 +86,7 @@ index 00000000..3c51aaf9 + * + * @return the {@link CommandSender} instance + */ ++ @NotNull + public CommandSender getSender() { + return sender; + } @@ -97,6 +101,7 @@ index 00000000..3c51aaf9 + * + * @return a list of offered completions + */ ++ @NotNull + public List getCompletions() { + return completions; + } @@ -111,7 +116,7 @@ index 00000000..3c51aaf9 + * + * @param completions the new completions + */ -+ public void setCompletions(List completions) { ++ public void setCompletions(@NotNull List completions) { + Validate.notNull(completions); + this.completions = new ArrayList<>(completions); + } @@ -121,6 +126,7 @@ index 00000000..3c51aaf9 + * + * @return command buffer, as entered + */ ++ @NotNull + public String getBuffer() { + return buffer; + } @@ -135,6 +141,7 @@ index 00000000..3c51aaf9 + /** + * @return The position looked at by the sender, or null if none + */ ++ @Nullable + public Location getLocation() { + return loc; + } @@ -177,16 +184,18 @@ index 00000000..3c51aaf9 + this.cancelled = cancelled; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java -index a6229839..f0bc3563 100644 +index d1a9956a1..f96c4ba53 100644 --- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java +++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java @@ -1,5 +1,6 @@ @@ -196,21 +205,29 @@ index a6229839..f0bc3563 100644 import java.util.List; import org.apache.commons.lang.Validate; import org.bukkit.command.CommandSender; -@@ -28,6 +29,13 @@ public class TabCompleteEvent extends Event implements Cancellable { +@@ -8,6 +9,7 @@ import org.bukkit.event.Event; + import org.bukkit.event.HandlerList; + import org.bukkit.event.player.PlayerCommandSendEvent; + import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + + /** + * Called when a {@link CommandSender} of any description (ie: player or +@@ -29,6 +31,13 @@ public class TabCompleteEvent extends Event implements Cancellable { private boolean cancelled; - public TabCompleteEvent(CommandSender sender, String buffer, List completions) { + public TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List completions) { + // Paper start + this(sender, buffer, completions, sender instanceof org.bukkit.command.ConsoleCommandSender || buffer.startsWith("/"), null); + } -+ public TabCompleteEvent(CommandSender sender, String buffer, List completions, boolean isCommand, org.bukkit.Location location) { ++ public TabCompleteEvent(@NotNull CommandSender sender, @NotNull String buffer, @NotNull List completions, boolean isCommand, @Nullable org.bukkit.Location location) { + this.isCommand = isCommand; + this.loc = location; + // Paper end Validate.notNull(sender, "sender"); Validate.notNull(buffer, "buffer"); Validate.notNull(completions, "completions"); -@@ -65,14 +73,34 @@ public class TabCompleteEvent extends Event implements Cancellable { +@@ -69,14 +78,35 @@ public class TabCompleteEvent extends Event implements Cancellable { return completions; } @@ -227,6 +244,7 @@ index a6229839..f0bc3563 100644 + /** + * @return The position looked at by the sender, or null if none + */ ++ @Nullable + public org.bukkit.Location getLocation() { + return loc; + } @@ -239,7 +257,7 @@ index a6229839..f0bc3563 100644 + * * @param completions the new completions */ - public void setCompletions(List completions) { + public void setCompletions(@NotNull List completions) { Validate.notNull(completions); - this.completions = completions; + this.completions = new ArrayList<>(completions); // Paper @@ -247,5 +265,5 @@ index a6229839..f0bc3563 100644 @Override -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0074-Display-warning-on-deprecated-recipe-API.patch b/Spigot-API-Patches/0074-Display-warning-on-deprecated-recipe-API.patch index 31cbf21bbb..d5fce9b9fc 100644 --- a/Spigot-API-Patches/0074-Display-warning-on-deprecated-recipe-API.patch +++ b/Spigot-API-Patches/0074-Display-warning-on-deprecated-recipe-API.patch @@ -1,4 +1,4 @@ -From 906da795cc0a27b10fcb9cea756bbc7b8556d9e4 Mon Sep 17 00:00:00 2001 +From fdf1b7fd4ed6b12ec92df144e1961d3e5b198d61 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 9 Dec 2017 12:40:25 -0500 Subject: [PATCH] Display warning on deprecated recipe API @@ -10,29 +10,29 @@ on the players login. Plugin authors need to define a key to keep it consistent between server restarts. diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index 90d6d50c..80af6cf5 100644 +index 77e6ccf5..64a43f42 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -@@ -25,6 +25,7 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -26,6 +26,7 @@ public class ShapedRecipe implements Recipe, Keyed { @Deprecated - public ShapedRecipe(ItemStack result) { + public ShapedRecipe(@NotNull ItemStack result) { this.key = NamespacedKey.randomKey(); + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); this.output = new ItemStack(result); } diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index ea359c54..7347e746 100644 +index a8d5f330..46a398e8 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -@@ -26,6 +26,7 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -27,6 +27,7 @@ public class ShapelessRecipe implements Recipe, Keyed { @Deprecated - public ShapelessRecipe(ItemStack result) { + public ShapelessRecipe(@NotNull ItemStack result) { this.key = NamespacedKey.randomKey(); + new Throwable("Warning: A plugin is creating a recipe using a Deprecated method. This will cause you to receive warnings stating 'Tried to load unrecognized recipe: bukkit:'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); this.output = new ItemStack(result); } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0075-PlayerPickupExperienceEvent.patch b/Spigot-API-Patches/0075-PlayerPickupExperienceEvent.patch index 90a22db14a..dfa42dfe05 100644 --- a/Spigot-API-Patches/0075-PlayerPickupExperienceEvent.patch +++ b/Spigot-API-Patches/0075-PlayerPickupExperienceEvent.patch @@ -1,4 +1,4 @@ -From 0b16ea6c94ad803083f1689c590e516a3d609ef4 Mon Sep 17 00:00:00 2001 +From 0bd98a68ee81d13dcf28e6f6ef85eb63920b46f4 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:00:41 -0500 Subject: [PATCH] PlayerPickupExperienceEvent @@ -7,10 +7,10 @@ Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java new file mode 100644 -index 00000000..f9ef95cd +index 000000000..f7beb22d5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerPickupExperienceEvent.java -@@ -0,0 +1,76 @@ +@@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017 Daniel Ennis (Aikar) MIT License + * @@ -42,14 +42,15 @@ index 00000000..f9ef95cd +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a player is attempting to pick up an experience orb + */ +public class PlayerPickupExperienceEvent extends PlayerEvent implements Cancellable { -+ private final ExperienceOrb experienceOrb; ++ @NotNull private final ExperienceOrb experienceOrb; + -+ public PlayerPickupExperienceEvent(Player player, ExperienceOrb experienceOrb) { ++ public PlayerPickupExperienceEvent(@NotNull Player player, @NotNull ExperienceOrb experienceOrb) { + super(player); + this.experienceOrb = experienceOrb; + } @@ -57,16 +58,19 @@ index 00000000..f9ef95cd + /** + * @return Returns the Orb that the player is picking up + */ ++ @NotNull + public ExperienceOrb getExperienceOrb() { + return experienceOrb; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -88,5 +92,5 @@ index 00000000..f9ef95cd + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0076-ExperienceOrbMergeEvent.patch b/Spigot-API-Patches/0076-ExperienceOrbMergeEvent.patch index c81496c34e..7f0b1dd1f5 100644 --- a/Spigot-API-Patches/0076-ExperienceOrbMergeEvent.patch +++ b/Spigot-API-Patches/0076-ExperienceOrbMergeEvent.patch @@ -1,4 +1,4 @@ -From f25f9e92ad692775de20a8953c170896bfb86cb4 Mon Sep 17 00:00:00 2001 +From 014342436b9d0a522d4948efe3f699fef8b8cc15 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 22:56:24 -0500 Subject: [PATCH] ExperienceOrbMergeEvent @@ -9,10 +9,10 @@ metadata such as spawn reason, or conditionally move data from source to target. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/ExperienceOrbMergeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/ExperienceOrbMergeEvent.java new file mode 100644 -index 00000000..fb5b4b86 +index 000000000..0ce3e3977 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/ExperienceOrbMergeEvent.java -@@ -0,0 +1,82 @@ +@@ -0,0 +1,87 @@ +/* + * Copyright (c) 2017 Daniel Ennis (Aikar) MIT License + * @@ -42,15 +42,16 @@ index 00000000..fb5b4b86 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired anytime the server is about to merge 2 experience orbs into one + */ +public class ExperienceOrbMergeEvent extends EntityEvent implements Cancellable { -+ private final ExperienceOrb mergeTarget; -+ private final ExperienceOrb mergeSource; ++ @NotNull private final ExperienceOrb mergeTarget; ++ @NotNull private final ExperienceOrb mergeSource; + -+ public ExperienceOrbMergeEvent(ExperienceOrb mergeTarget, ExperienceOrb mergeSource) { ++ public ExperienceOrbMergeEvent(@NotNull ExperienceOrb mergeTarget, @NotNull ExperienceOrb mergeSource) { + super(mergeTarget); + this.mergeTarget = mergeTarget; + this.mergeSource = mergeSource; @@ -59,6 +60,7 @@ index 00000000..fb5b4b86 + /** + * @return The orb that will absorb the other experience orb + */ ++ @NotNull + public ExperienceOrb getMergeTarget() { + return mergeTarget; + } @@ -66,16 +68,19 @@ index 00000000..fb5b4b86 + /** + * @return The orb that is subject to being removed and merged into the target orb + */ ++ @NotNull + public ExperienceOrb getMergeSource() { + return mergeSource; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -96,5 +101,5 @@ index 00000000..fb5b4b86 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0077-Ability-to-apply-mending-to-XP-API.patch b/Spigot-API-Patches/0077-Ability-to-apply-mending-to-XP-API.patch index 6625af682c..87bcde4dcc 100644 --- a/Spigot-API-Patches/0077-Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-API-Patches/0077-Ability-to-apply-mending-to-XP-API.patch @@ -1,4 +1,4 @@ -From 7cf615732878ee88a9ae3c84136211222235cd03 Mon Sep 17 00:00:00 2001 +From e86f55218e61959a7851efd9453a5785e1eaef93 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 20 Dec 2017 17:38:07 -0500 Subject: [PATCH] Ability to apply mending to XP API @@ -10,10 +10,10 @@ 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/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5e65657a..c273b9dc 100644 +index 7be6778a..f19b8b99 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -938,12 +938,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM +@@ -946,12 +946,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM */ public void resetPlayerWeather(); @@ -49,5 +49,5 @@ index 5e65657a..c273b9dc 100644 /** * Gives the player the amount of experience levels specified. Levels can -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0078-PreCreatureSpawnEvent.patch b/Spigot-API-Patches/0078-PreCreatureSpawnEvent.patch index dae83f8ce1..93da7d5fab 100644 --- a/Spigot-API-Patches/0078-PreCreatureSpawnEvent.patch +++ b/Spigot-API-Patches/0078-PreCreatureSpawnEvent.patch @@ -1,4 +1,4 @@ -From 000a19b1709aa65092d49ea8a248d252b43f3390 Mon Sep 17 00:00:00 2001 +From 35452d656b653b45dd767d53bae2d6c1e87a81d9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 14 Jan 2018 16:59:43 -0500 Subject: [PATCH] PreCreatureSpawnEvent @@ -16,10 +16,10 @@ See: https://github.com/PaperMC/Paper/issues/917 diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java new file mode 100644 -index 00000000..bac1cef3 +index 000000000..d5edde9cd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java -@@ -0,0 +1,98 @@ +@@ -0,0 +1,104 @@ +package com.destroystokyo.paper.event.entity; + +import com.google.common.base.Preconditions; @@ -29,6 +29,7 @@ index 00000000..bac1cef3 +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.CreatureSpawnEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * WARNING: This event only fires for a limited number of cases, and not for every case that CreatureSpawnEvent does. @@ -40,12 +41,12 @@ index 00000000..bac1cef3 + * Also, Plugins that replace Entity Registrations with their own custom entities might not fire this event. + */ +public class PreCreatureSpawnEvent extends Event implements Cancellable { -+ private final Location location; -+ private final EntityType type; -+ private final CreatureSpawnEvent.SpawnReason reason; ++ @NotNull private final Location location; ++ @NotNull private final EntityType type; ++ @NotNull private final CreatureSpawnEvent.SpawnReason reason; + private boolean shouldAbortSpawn; + -+ public PreCreatureSpawnEvent(Location location, EntityType type, CreatureSpawnEvent.SpawnReason reason) { ++ public PreCreatureSpawnEvent(@NotNull Location location, @NotNull EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason) { + this.location = Preconditions.checkNotNull(location, "Location may not be null").clone(); + this.type = Preconditions.checkNotNull(type, "Type may not be null"); + this.reason = Preconditions.checkNotNull(reason, "Reason may not be null"); @@ -54,6 +55,7 @@ index 00000000..bac1cef3 + /** + * @return The location this creature is being spawned at + */ ++ @NotNull + public Location getSpawnLocation() { + return location; + } @@ -61,6 +63,7 @@ index 00000000..bac1cef3 + /** + * @return The type of creature being spawned + */ ++ @NotNull + public EntityType getType() { + return type; + } @@ -68,6 +71,7 @@ index 00000000..bac1cef3 + /** + * @return Reason this creature is spawning (ie, NATURAL vs SPAWNER) + */ ++ @NotNull + public CreatureSpawnEvent.SpawnReason getReason() { + return reason; + } @@ -91,10 +95,12 @@ index 00000000..bac1cef3 + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -119,5 +125,5 @@ index 00000000..bac1cef3 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0079-PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-API-Patches/0079-PlayerNaturallySpawnCreaturesEvent.patch index c52e759c05..314ec62396 100644 --- a/Spigot-API-Patches/0079-PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-API-Patches/0079-PlayerNaturallySpawnCreaturesEvent.patch @@ -1,4 +1,4 @@ -From 32783783cd18b9019b4bb321c8b41df12e9bfebf Mon Sep 17 00:00:00 2001 +From 1f5cbf18a8beea7d63e03e6c2fb786985f581f03 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 14 Jan 2018 17:31:37 -0500 Subject: [PATCH] PlayerNaturallySpawnCreaturesEvent @@ -10,10 +10,10 @@ Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java new file mode 100644 -index 00000000..7c6953a7 +index 000000000..112a0dbf5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PlayerNaturallySpawnCreaturesEvent.java -@@ -0,0 +1,61 @@ +@@ -0,0 +1,64 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Player; @@ -21,6 +21,7 @@ index 00000000..7c6953a7 +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when the server is calculating what chunks to try to spawn monsters in every Monster Spawn Tick event @@ -28,7 +29,7 @@ index 00000000..7c6953a7 +public class PlayerNaturallySpawnCreaturesEvent extends PlayerEvent implements Cancellable { + private byte radius; + -+ public PlayerNaturallySpawnCreaturesEvent(Player player, byte radius) { ++ public PlayerNaturallySpawnCreaturesEvent(@NotNull Player player, byte radius) { + super(player); + this.radius = radius; + } @@ -49,10 +50,12 @@ index 00000000..7c6953a7 + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -76,5 +79,5 @@ index 00000000..7c6953a7 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0080-Add-setPlayerProfile-API-for-Skulls.patch b/Spigot-API-Patches/0080-Add-setPlayerProfile-API-for-Skulls.patch index 1aa20fc329..9274db95c2 100644 --- a/Spigot-API-Patches/0080-Add-setPlayerProfile-API-for-Skulls.patch +++ b/Spigot-API-Patches/0080-Add-setPlayerProfile-API-for-Skulls.patch @@ -1,4 +1,4 @@ -From 6df1eea3118148d343e2ba943ed0e79e3272e981 Mon Sep 17 00:00:00 2001 +From 907a0b84b6a2bfa31356bf1d72f7a8210be4e612 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 19 Jan 2018 00:29:28 -0500 Subject: [PATCH] Add setPlayerProfile API for Skulls @@ -7,28 +7,27 @@ 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/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java -index 499a153e..3c75341e 100644 +index 6325f583..27675ecd 100644 --- a/src/main/java/org/bukkit/block/Skull.java +++ b/src/main/java/org/bukkit/block/Skull.java -@@ -4,6 +4,8 @@ import org.bukkit.Material; - import org.bukkit.OfflinePlayer; - import org.bukkit.SkullType; - import org.bukkit.block.data.BlockData; -+import com.destroystokyo.paper.profile.PlayerProfile; -+import javax.annotation.Nullable; +@@ -7,6 +7,7 @@ import org.bukkit.block.data.BlockData; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; ++import com.destroystokyo.paper.profile.PlayerProfile; // Paper /** * Represents a captured state of a skull block. -@@ -55,6 +57,20 @@ public interface Skull extends BlockState { +@@ -61,6 +62,20 @@ public interface Skull extends BlockState { */ - public void setOwningPlayer(OfflinePlayer player); + public void setOwningPlayer(@NotNull OfflinePlayer player); + // Paper start + /** + * Sets this skull to use the supplied Player Profile, which can include textures already prefilled. + * @param profile The profile to set this Skull to use, may not be null + */ -+ void setPlayerProfile(PlayerProfile profile); ++ void setPlayerProfile(@NotNull PlayerProfile profile); + + /** + * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link PlayerProfile} @@ -41,23 +40,24 @@ index 499a153e..3c75341e 100644 * Gets the rotation of the skull in the world (or facing direction if this * is a wall mounted skull). diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java -index 15c1dfd9..a458000f 100644 +index 1583764b..43cdc4c6 100644 --- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java -@@ -1,7 +1,10 @@ +@@ -1,9 +1,11 @@ package org.bukkit.inventory.meta; +import com.destroystokyo.paper.profile.PlayerProfile; -+import javax.annotation.Nullable; import org.bukkit.OfflinePlayer; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + /** * Represents a skull that can have an owner. */ -@@ -36,6 +39,20 @@ public interface SkullMeta extends ItemMeta { +@@ -36,6 +38,20 @@ public interface SkullMeta extends ItemMeta { @Deprecated - boolean setOwner(String owner); + boolean setOwner(@Nullable String owner); + // Paper start + /** @@ -77,5 +77,5 @@ index 15c1dfd9..a458000f 100644 * Gets the owner of the skull. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0081-Fill-Profile-Property-Events.patch b/Spigot-API-Patches/0081-Fill-Profile-Property-Events.patch index 1d5718e520..e9a02454be 100644 --- a/Spigot-API-Patches/0081-Fill-Profile-Property-Events.patch +++ b/Spigot-API-Patches/0081-Fill-Profile-Property-Events.patch @@ -1,4 +1,4 @@ -From 18c2f27c07c4ae9d951ecf9a7685a0af1b6433fa Mon Sep 17 00:00:00 2001 +From 53a81651f2f57c8d8b5a104b7d95a5c7287881f7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 2 Jan 2018 00:31:08 -0500 Subject: [PATCH] Fill Profile Property Events @@ -12,10 +12,10 @@ This is useful for implementing a ProfileCache for Player Skulls diff --git a/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java new file mode 100644 -index 00000000..182bd661 +index 000000000..71f36e9ca --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/FillProfileEvent.java -@@ -0,0 +1,72 @@ +@@ -0,0 +1,75 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * @@ -46,16 +46,16 @@ index 00000000..182bd661 +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + -+import javax.annotation.Nonnull; +import java.util.Set; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired once a profiles additional properties (such as textures) has been filled + */ +public class FillProfileEvent extends Event { -+ private final PlayerProfile profile; ++ @NotNull private final PlayerProfile profile; + -+ public FillProfileEvent(@Nonnull PlayerProfile profile) { ++ public FillProfileEvent(@NotNull PlayerProfile profile) { + super(!org.bukkit.Bukkit.isPrimaryThread()); + this.profile = profile; + } @@ -63,7 +63,7 @@ index 00000000..182bd661 + /** + * @return The Profile that had properties filled + */ -+ @Nonnull ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } @@ -74,26 +74,29 @@ index 00000000..182bd661 + * @see PlayerProfile#getProperties() + * @return The new properties on the profile. + */ ++ @NotNull + public Set getProperties() { + return profile.getProperties(); + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java new file mode 100644 -index 00000000..aba0c087 +index 000000000..021bc8631 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/profile/PreFillProfileEvent.java -@@ -0,0 +1,74 @@ +@@ -0,0 +1,77 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * @@ -124,8 +127,8 @@ index 00000000..aba0c087 +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + -+import javax.annotation.Nonnull; +import java.util.Collection; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when the server is requesting to fill in properties of an incomplete profile, such as textures. @@ -133,9 +136,9 @@ index 00000000..aba0c087 + * Allows plugins to pre populate cached properties and avoid a call to the Mojang API + */ +public class PreFillProfileEvent extends Event { -+ private final PlayerProfile profile; ++ @NotNull private final PlayerProfile profile; + -+ public PreFillProfileEvent(PlayerProfile profile) { ++ public PreFillProfileEvent(@NotNull PlayerProfile profile) { + super(!org.bukkit.Bukkit.isPrimaryThread()); + this.profile = profile; + } @@ -143,6 +146,7 @@ index 00000000..aba0c087 + /** + * @return The profile that needs its properties filled + */ ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } @@ -154,20 +158,22 @@ index 00000000..aba0c087 + * @see PlayerProfile#setProperties(Collection) + * @param properties The properties to set/append + */ -+ public void setProperties(@Nonnull Collection properties) { ++ public void setProperties(@NotNull Collection properties) { + profile.setProperties(properties); + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0082-PlayerAdvancementCriterionGrantEvent.patch b/Spigot-API-Patches/0082-PlayerAdvancementCriterionGrantEvent.patch index e267e4199c..3e77e4397b 100644 --- a/Spigot-API-Patches/0082-PlayerAdvancementCriterionGrantEvent.patch +++ b/Spigot-API-Patches/0082-PlayerAdvancementCriterionGrantEvent.patch @@ -1,4 +1,4 @@ -From 96c07697f9a38156b9d1cf552b0796f60ff807b4 Mon Sep 17 00:00:00 2001 +From c53db31449879e3307930215473d83a9e14440f7 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 19 Jan 2018 08:15:14 -0600 Subject: [PATCH] PlayerAdvancementCriterionGrantEvent @@ -6,10 +6,10 @@ Subject: [PATCH] PlayerAdvancementCriterionGrantEvent diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerAdvancementCriterionGrantEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerAdvancementCriterionGrantEvent.java new file mode 100644 -index 00000000..b65ee9e5 +index 000000000..bb8d7c959 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerAdvancementCriterionGrantEvent.java -@@ -0,0 +1,58 @@ +@@ -0,0 +1,63 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.advancement.Advancement; @@ -17,17 +17,18 @@ index 00000000..b65ee9e5 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a player is granted a criteria in an advancement. + */ +public class PlayerAdvancementCriterionGrantEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); -+ private final Advancement advancement; -+ private final String criterion; ++ @NotNull private final Advancement advancement; ++ @NotNull private final String criterion; + private boolean cancel = false; + -+ public PlayerAdvancementCriterionGrantEvent(Player who, Advancement advancement, String criterion) { ++ public PlayerAdvancementCriterionGrantEvent(@NotNull Player who, @NotNull Advancement advancement, @NotNull String criterion) { + super(who); + this.advancement = advancement; + this.criterion = criterion; @@ -38,6 +39,7 @@ index 00000000..b65ee9e5 + * + * @return affected advancement + */ ++ @NotNull + public Advancement getAdvancement() { + return advancement; + } @@ -47,6 +49,7 @@ index 00000000..b65ee9e5 + * + * @return granted criterion + */ ++ @NotNull + public String getCriterion() { + return criterion; + } @@ -59,15 +62,17 @@ index 00000000..b65ee9e5 + this.cancel = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0084-Optimize-Hoppers.patch b/Spigot-API-Patches/0084-Optimize-Hoppers.patch index 1b04c5e3a7..aded0ec200 100644 --- a/Spigot-API-Patches/0084-Optimize-Hoppers.patch +++ b/Spigot-API-Patches/0084-Optimize-Hoppers.patch @@ -1,4 +1,4 @@ -From 05f491b4b41e5682ea37eec688ab9f37d0a4d4e3 Mon Sep 17 00:00:00 2001 +From 881a02abeb1dd87d2aa9ac12483907e236dbeab9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 18 Jan 2018 01:00:27 -0500 Subject: [PATCH] Optimize Hoppers @@ -7,21 +7,21 @@ Adds data about what Item related methods were used in InventoryMoveItem event so that the server can improve the performance of this event. diff --git a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java -index 06ec99ae..b44cc45b 100644 +index 2bb57d23..f0a16d3c 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java -@@ -30,6 +30,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { +@@ -31,6 +31,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { private final Inventory destinationInventory; private ItemStack itemStack; private final boolean didSourceInitiate; + public boolean calledGetItem; // Paper + public boolean calledSetItem; // Paper - public InventoryMoveItemEvent(final Inventory sourceInventory, final ItemStack itemStack, final Inventory destinationInventory, final boolean didSourceInitiate) { + public InventoryMoveItemEvent(@NotNull final Inventory sourceInventory, @NotNull final ItemStack itemStack, @NotNull final Inventory destinationInventory, final boolean didSourceInitiate) { Validate.notNull(itemStack, "ItemStack cannot be null"); -@@ -55,7 +57,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { - * @return ItemStack +@@ -58,7 +60,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { */ + @NotNull public ItemStack getItem() { - return itemStack.clone(); + calledGetItem = true; // Paper - record this method was used for auto detection of mode @@ -29,14 +29,14 @@ index 06ec99ae..b44cc45b 100644 } /** -@@ -67,6 +70,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { +@@ -70,6 +73,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable { */ - public void setItem(ItemStack itemStack) { + public void setItem(@NotNull ItemStack itemStack) { Validate.notNull(itemStack, "ItemStack cannot be null. Cancel the event if you want nothing to be transferred."); + calledSetItem = true; // Paper - record this method was used for auto detection of mode this.itemStack = itemStack.clone(); } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0085-Tameable-getOwnerUniqueId-API.patch b/Spigot-API-Patches/0085-Tameable-getOwnerUniqueId-API.patch index 40040cde60..be7e89e9a1 100644 --- a/Spigot-API-Patches/0085-Tameable-getOwnerUniqueId-API.patch +++ b/Spigot-API-Patches/0085-Tameable-getOwnerUniqueId-API.patch @@ -1,4 +1,4 @@ -From 1cbb7e853c6b79fe56bb48056ef19cbf83e4a85f Mon Sep 17 00:00:00 2001 +From ec25fb2dc8987362a3aa99baf07baa8fd2a79ba9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 24 Feb 2018 00:55:52 -0500 Subject: [PATCH] Tameable#getOwnerUniqueId API @@ -7,10 +7,17 @@ This is faster if all you need is the UUID, as .getOwner() will cause an OfflinePlayer to be loaded from disk. diff --git a/src/main/java/org/bukkit/entity/Tameable.java b/src/main/java/org/bukkit/entity/Tameable.java -index 44497aa3..0987c1e8 100644 +index 0c066bdfc..be436f8df 100644 --- a/src/main/java/org/bukkit/entity/Tameable.java +++ b/src/main/java/org/bukkit/entity/Tameable.java -@@ -23,9 +23,21 @@ public interface Tameable extends Entity { +@@ -1,5 +1,6 @@ + package org.bukkit.entity; + ++import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + public interface Tameable extends Entity { +@@ -25,9 +26,22 @@ public interface Tameable extends Entity { */ public void setTamed(boolean tame); @@ -20,6 +27,7 @@ index 44497aa3..0987c1e8 100644 + * + * @return the owners UUID, or null if not owned + */ ++ @NotNull + public java.util.UUID getOwnerUniqueId(); + // Paper end + @@ -31,7 +39,7 @@ index 44497aa3..0987c1e8 100644 + * * @return the owning AnimalTamer, or null if not owned */ - public AnimalTamer getOwner(); + @Nullable -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0086-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-API-Patches/0086-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index c03d567f01..e752cb511d 100644 --- a/Spigot-API-Patches/0086-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-API-Patches/0086-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -1,4 +1,4 @@ -From 596ebbbd59baec68f0614f1e3d91e04dd5125562 Mon Sep 17 00:00:00 2001 +From fce0f6f5b837d223e55e3a0fd3a4420fc8a4d146 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 18 Mar 2018 11:43:30 -0400 Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent @@ -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/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java -index 1d571889..0c16128e 100644 +index a0909736..6c09ea6c 100644 --- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java +++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java @@ -3,6 +3,8 @@ package org.bukkit.event.player; @@ -17,11 +17,11 @@ index 1d571889..0c16128e 100644 +import org.bukkit.Bukkit; import org.bukkit.event.Event; import org.bukkit.event.HandlerList; - -@@ -25,7 +27,31 @@ public class AsyncPlayerPreLoginEvent extends Event { + import org.jetbrains.annotations.NotNull; +@@ -26,7 +28,32 @@ public class AsyncPlayerPreLoginEvent extends Event { } - public AsyncPlayerPreLoginEvent(final String name, final InetAddress ipAddress, final UUID uniqueId) { + public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) { + // Paper start + this(name, ipAddress, uniqueId, Bukkit.createProfile(uniqueId, name)); + } @@ -31,6 +31,7 @@ index 1d571889..0c16128e 100644 + * Gets the PlayerProfile of the player logging in + * @return The Profile + */ ++ @NotNull + public PlayerProfile getPlayerProfile() { + return profile; + } @@ -39,11 +40,11 @@ index 1d571889..0c16128e 100644 + * Changes the PlayerProfile the player will login as + * @param profile The profile to use + */ -+ public void setPlayerProfile(PlayerProfile profile) { ++ public void setPlayerProfile(@NotNull PlayerProfile profile) { + this.profile = profile; + } + -+ public AsyncPlayerPreLoginEvent(final String name, final InetAddress ipAddress, final UUID uniqueId, PlayerProfile profile) { ++ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) { super(true); + this.profile = profile; + // Paper end @@ -51,5 +52,5 @@ index 1d571889..0c16128e 100644 this.message = ""; this.name = name; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0087-Add-extended-PaperServerListPingEvent.patch b/Spigot-API-Patches/0087-Add-extended-PaperServerListPingEvent.patch index 1c9d5e63a5..a1da6121fb 100644 --- a/Spigot-API-Patches/0087-Add-extended-PaperServerListPingEvent.patch +++ b/Spigot-API-Patches/0087-Add-extended-PaperServerListPingEvent.patch @@ -1,4 +1,4 @@ -From 62f34963ecb11533fab2828dfd058a95235bdb67 Mon Sep 17 00:00:00 2001 +From 0b00d6b950008cb1c68ae0758344a9e270ae766a Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 11 Oct 2017 15:55:38 +0200 Subject: [PATCH] Add extended PaperServerListPingEvent @@ -8,10 +8,10 @@ and allows full control of the response sent to the client. diff --git a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java new file mode 100644 -index 00000000..b2a8476c +index 000000000..0cc5dd573 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java -@@ -0,0 +1,320 @@ +@@ -0,0 +1,323 @@ +package com.destroystokyo.paper.event.server; + +import static java.util.Objects.requireNonNull; @@ -30,8 +30,8 @@ index 00000000..b2a8476c +import java.util.NoSuchElementException; +import java.util.UUID; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Extended version of {@link ServerListPingEvent} that allows full control @@ -39,13 +39,13 @@ index 00000000..b2a8476c + */ +public class PaperServerListPingEvent extends ServerListPingEvent implements Cancellable { + -+ @Nonnull private final StatusClient client; ++ @NotNull private final StatusClient client; + + private int numPlayers; + private boolean hidePlayers; -+ @Nonnull private final List playerSample = new ArrayList<>(); ++ @NotNull private final List playerSample = new ArrayList<>(); + -+ @Nonnull private String version; ++ @NotNull private String version; + private int protocolVersion; + + @Nullable private CachedServerIcon favicon; @@ -55,8 +55,8 @@ index 00000000..b2a8476c + private boolean originalPlayerCount = true; + private Object[] players; + -+ public PaperServerListPingEvent(@Nonnull StatusClient client, String motd, int numPlayers, int maxPlayers, -+ @Nonnull String version, int protocolVersion, @Nullable CachedServerIcon favicon) { ++ public PaperServerListPingEvent(@NotNull StatusClient client, @NotNull String motd, int numPlayers, int maxPlayers, ++ @NotNull String version, int protocolVersion, @Nullable CachedServerIcon favicon) { + super(client.getAddress().getAddress(), motd, numPlayers, maxPlayers); + this.client = client; + this.numPlayers = numPlayers; @@ -70,7 +70,7 @@ index 00000000..b2a8476c + * + * @return The client + */ -+ @Nonnull ++ @NotNull + public StatusClient getClient() { + return this.client; + } @@ -157,7 +157,7 @@ index 00000000..b2a8476c + * + * @return The mutable player sample list + */ -+ @Nonnull ++ @NotNull + public List getPlayerSample() { + return this.playerSample; + } @@ -167,7 +167,7 @@ index 00000000..b2a8476c + * + * @return The server version + */ -+ @Nonnull ++ @NotNull + public String getVersion() { + return version; + } @@ -177,7 +177,7 @@ index 00000000..b2a8476c + * + * @param version The server version + */ -+ public void setVersion(@Nonnull String version) { ++ public void setVersion(@NotNull String version) { + this.version = requireNonNull(version, "version"); + } + @@ -263,7 +263,7 @@ index 00000000..b2a8476c + * the removed player (based on their {@link UUID}). + * + */ -+ @Nonnull ++ @NotNull + @Override + public Iterator iterator() { + if (this.players == null) { @@ -273,11 +273,13 @@ index 00000000..b2a8476c + return new PlayerIterator(); + } + ++ @NotNull + protected Object[] getOnlinePlayers() { + return Bukkit.getOnlinePlayers().toArray(); + } + -+ protected Player getBukkitPlayer(Object player) { ++ @NotNull ++ protected Player getBukkitPlayer(@NotNull Object player) { + return (Player) player; + } + @@ -298,6 +300,7 @@ index 00000000..b2a8476c + return false; + } + ++ @NotNull + @Override + public Player next() { + if (!hasNext()) { @@ -334,7 +337,7 @@ index 00000000..b2a8476c +} diff --git a/src/main/java/com/destroystokyo/paper/network/StatusClient.java b/src/main/java/com/destroystokyo/paper/network/StatusClient.java new file mode 100644 -index 00000000..517d1523 +index 000000000..517d15238 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/StatusClient.java @@ -0,0 +1,13 @@ @@ -352,14 +355,13 @@ index 00000000..517d1523 + +} diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java -index 04804706..44563482 100644 +index 612958a33..bb4f7702c 100644 --- a/src/main/java/org/bukkit/util/CachedServerIcon.java +++ b/src/main/java/org/bukkit/util/CachedServerIcon.java -@@ -14,4 +14,10 @@ import org.bukkit.event.server.ServerListPingEvent; - */ - public interface CachedServerIcon { - public String getData(); // Spigot -+ +@@ -18,4 +18,9 @@ public interface CachedServerIcon { + @Nullable + public String getData(); // Paper + + // Paper start + default boolean isEmpty() { + return getData() == null; @@ -367,5 +369,5 @@ index 04804706..44563482 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0088-Player.setPlayerProfile-API.patch b/Spigot-API-Patches/0088-Player.setPlayerProfile-API.patch index 15be533663..941c654920 100644 --- a/Spigot-API-Patches/0088-Player.setPlayerProfile-API.patch +++ b/Spigot-API-Patches/0088-Player.setPlayerProfile-API.patch @@ -1,4 +1,4 @@ -From efed9414eb7c7ae2509d89bb10a338a0a49347ce Mon Sep 17 00:00:00 2001 +From cf924a9f32433bc44b212dcf3315d73869bbd45b Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 18 Mar 2018 12:28:55 -0400 Subject: [PATCH] Player.setPlayerProfile API @@ -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/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index c273b9dc..5dc04f47 100644 +index c7bc13e7d..06154a5c5 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -3,6 +3,7 @@ package org.bukkit.entity; @@ -15,9 +15,9 @@ index c273b9dc..5dc04f47 100644 import com.destroystokyo.paper.Title; +import com.destroystokyo.paper.profile.PlayerProfile; import org.bukkit.Achievement; - import org.bukkit.ChatColor; import org.bukkit.Effect; -@@ -1732,6 +1733,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + import org.bukkit.GameMode; +@@ -1746,6 +1747,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM * was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED} */ boolean hasResourcePack(); @@ -26,6 +26,7 @@ index c273b9dc..5dc04f47 100644 + * Gets a copy of this players profile + * @return The players profile object + */ ++ @NotNull + PlayerProfile getPlayerProfile(); + + /** @@ -33,10 +34,10 @@ index c273b9dc..5dc04f47 100644 + * to be reregistered to all clients that can currently see this player + * @param profile The new profile to use + */ -+ void setPlayerProfile(PlayerProfile profile); ++ void setPlayerProfile(@NotNull PlayerProfile profile); // Paper end // Spigot start -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0089-getPlayerUniqueId-API.patch b/Spigot-API-Patches/0089-getPlayerUniqueId-API.patch index 77758f8bf0..1449829d98 100644 --- a/Spigot-API-Patches/0089-getPlayerUniqueId-API.patch +++ b/Spigot-API-Patches/0089-getPlayerUniqueId-API.patch @@ -1,4 +1,4 @@ -From e5672f4f22bb0f9012699159f3ea469d020439be Mon Sep 17 00:00:00 2001 +From 5a99ab919ced0b8030d9ffd958fc14ebace28152 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 22 Mar 2018 01:39:28 -0400 Subject: [PATCH] getPlayerUniqueId API @@ -9,10 +9,10 @@ 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/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index 75634a8d..cbabd807 100644 +index 16fa78b86..19fb0e5d2 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -435,6 +435,20 @@ public final class Bukkit { +@@ -451,6 +451,20 @@ public final class Bukkit { return server.getPlayer(id); } @@ -25,7 +25,7 @@ index 75634a8d..cbabd807 100644 + * @return A UUID, or null if that player name is not registered with Minecraft and the server is in online mode + */ + @Nullable -+ public static UUID getPlayerUniqueId(String playerName) { ++ public static UUID getPlayerUniqueId(@NotNull String playerName) { + return server.getPlayerUniqueId(playerName); + } + // Paper end @@ -34,12 +34,12 @@ index 75634a8d..cbabd807 100644 * Gets the plugin manager for interfacing with plugins. * diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 1d1f7784..9c5049cd 100644 +index edbfa3fdc..1df58f72a 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -365,6 +365,18 @@ public interface Server extends PluginMessageRecipient { - */ - public Player getPlayer(UUID id); +@@ -380,6 +380,18 @@ public interface Server extends PluginMessageRecipient { + @Nullable + public Player getPlayer(@NotNull UUID id); + // Paper start + /** @@ -50,12 +50,12 @@ index 1d1f7784..9c5049cd 100644 + * @return A UUID, or null if that player name is not registered with Minecraft and the server is in online mode + */ + @Nullable -+ public UUID getPlayerUniqueId(String playerName); ++ public UUID getPlayerUniqueId(@NotNull String playerName); + // Paper end + /** * Gets the plugin manager for interfacing with plugins. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0091-Add-method-to-open-already-placed-sign.patch b/Spigot-API-Patches/0091-Add-method-to-open-already-placed-sign.patch index bac72ef713..96d5e3bc79 100644 --- a/Spigot-API-Patches/0091-Add-method-to-open-already-placed-sign.patch +++ b/Spigot-API-Patches/0091-Add-method-to-open-already-placed-sign.patch @@ -1,17 +1,17 @@ -From 30c6337b2360b9771076eecc17f04d913e8b9267 Mon Sep 17 00:00:00 2001 +From 43e7d691ff499a8af5b95c032e5149ab518da36d Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 1 Apr 2018 02:28:43 +0300 Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 040562eb..b5ed8447 100644 +index 037e23930..04f0e08fd 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -442,4 +442,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -465,4 +465,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ @Deprecated - public void setShoulderEntityRight(Entity entity); + public void setShoulderEntityRight(@Nullable Entity entity); + + // Paper start - Add method to open already placed sign + /** @@ -19,9 +19,9 @@ index 040562eb..b5ed8447 100644 + * + * @param sign The sign to open + */ -+ void openSign(org.bukkit.block.Sign sign); ++ void openSign(@NotNull org.bukkit.block.Sign sign); + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0092-Add-version-history-to-version-command.patch b/Spigot-API-Patches/0092-Add-version-history-to-version-command.patch index 6e44229a9c..0662a8681a 100644 --- a/Spigot-API-Patches/0092-Add-version-history-to-version-command.patch +++ b/Spigot-API-Patches/0092-Add-version-history-to-version-command.patch @@ -1,4 +1,4 @@ -From 0a63d922250d7a43024aab5ea89b511396cde43a Mon Sep 17 00:00:00 2001 +From 37e05486e349c20d73a9a695c8ddb4f4f2933425 Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Thu, 1 Mar 2018 19:37:52 -0600 Subject: [PATCH] Add version history to version command @@ -6,10 +6,10 @@ Subject: [PATCH] Add version history to version command diff --git a/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java new file mode 100644 -index 00000000..1daaca2f +index 000000000..648b247ef --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/VersionHistoryManager.java -@@ -0,0 +1,143 @@ +@@ -0,0 +1,144 @@ +package com.destroystokyo.paper; + +import com.google.common.base.MoreObjects; @@ -26,8 +26,9 @@ index 00000000..1daaca2f +import java.util.Objects; +import java.util.logging.Level; +import java.util.logging.Logger; -+import javax.annotation.Nullable; +import org.bukkit.Bukkit; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public enum VersionHistoryManager { + INSTANCE; @@ -84,7 +85,7 @@ index 00000000..1daaca2f + } + } + -+ private void writeFile(final Path path) { ++ private void writeFile(@NotNull final Path path) { + try (final BufferedWriter writer = Files.newBufferedWriter( + path, + StandardCharsets.UTF_8, @@ -103,7 +104,7 @@ index 00000000..1daaca2f + return currentData; + } + -+ public class VersionData { ++ public static class VersionData { + private String oldVersion; + + private String currentVersion; @@ -135,7 +136,7 @@ index 00000000..1daaca2f + } + + @Override -+ public boolean equals(Object o) { ++ public boolean equals(@Nullable Object o) { + if (this == o) { + return true; + } @@ -154,10 +155,10 @@ index 00000000..1daaca2f + } +} diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -index f38f6864..5cebb245 100644 +index 8e57aa911..746cedd87 100644 --- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java +++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java -@@ -29,6 +29,7 @@ import org.json.simple.parser.ParseException; +@@ -31,6 +31,7 @@ import org.json.simple.parser.ParseException; // Paper start import java.io.InputStreamReader; import java.net.HttpURLConnection; @@ -165,7 +166,7 @@ index f38f6864..5cebb245 100644 // Paper end public class VersionCommand extends BukkitCommand { -@@ -47,6 +48,7 @@ public class VersionCommand extends BukkitCommand { +@@ -49,6 +50,7 @@ public class VersionCommand extends BukkitCommand { if (args.length == 0) { sender.sendMessage("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")"); @@ -173,7 +174,7 @@ index f38f6864..5cebb245 100644 sendVersion(sender); } else { StringBuilder name = new StringBuilder(); -@@ -83,6 +85,22 @@ public class VersionCommand extends BukkitCommand { +@@ -85,6 +87,22 @@ public class VersionCommand extends BukkitCommand { return true; } @@ -193,9 +194,9 @@ index f38f6864..5cebb245 100644 + } + // Paper end + - private void describeToSender(Plugin plugin, CommandSender sender) { + private void describeToSender(@NotNull Plugin plugin, @NotNull CommandSender sender) { PluginDescriptionFile desc = plugin.getDescription(); sender.sendMessage(ChatColor.GREEN + desc.getName() + ChatColor.WHITE + " version " + ChatColor.GREEN + desc.getVersion()); -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0093-Add-Ban-Methods-to-Player-Objects.patch b/Spigot-API-Patches/0093-Add-Ban-Methods-to-Player-Objects.patch index c6aa974c60..e216c3a3ff 100644 --- a/Spigot-API-Patches/0093-Add-Ban-Methods-to-Player-Objects.patch +++ b/Spigot-API-Patches/0093-Add-Ban-Methods-to-Player-Objects.patch @@ -1,4 +1,4 @@ -From b2247dff46727c6576f4943354996ff552e21791 Mon Sep 17 00:00:00 2001 +From 86cd792a0e247654f4bfc56f712a1b2ea4a05ae6 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Apr 2018 10:28:50 -0400 Subject: [PATCH] Add Ban Methods to Player Objects @@ -8,10 +8,10 @@ Allows a more logical API for banning players. player.banPlayer("Breaking the rules"); diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index d8279071..658eac26 100644 +index cf8a2cb8a..919d1b66a 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java -@@ -39,6 +39,56 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio +@@ -43,6 +43,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * @return true if banned, otherwise false */ public boolean isBanned(); @@ -23,7 +23,8 @@ index d8279071..658eac26 100644 + * @param reason Reason for Ban + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason) { + return banPlayer(reason, null, null); + } + @@ -33,7 +34,8 @@ index d8279071..658eac26 100644 + * @param source Source of the ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason, String source) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable String source) { + return banPlayer(reason, null, source); + } + @@ -43,7 +45,8 @@ index d8279071..658eac26 100644 + * @param expires When to expire the ban + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason, java.util.Date expires) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires) { + return banPlayer(reason, expires, null); + } + @@ -54,10 +57,12 @@ index d8279071..658eac26 100644 + * @param source Source of the ban or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayer(String reason, java.util.Date expires, String source) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) { + return banPlayer(reason, expires, source, true); + } -+ public default BanEntry banPlayer(String reason, java.util.Date expires, String source, boolean kickIfOnline) { ++ @NotNull ++ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source, boolean kickIfOnline) { + BanEntry banEntry = Bukkit.getServer().getBanList(BanList.Type.NAME).addBan(getName(), reason, expires, source); + if (kickIfOnline && isOnline()) { + getPlayer().kickPlayer(reason); @@ -69,10 +74,10 @@ index d8279071..658eac26 100644 /** * Checks if this player is whitelisted or not diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 5dc04f47..ddf226a4 100644 +index 06154a5c5..a840b49d4 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1,10 +1,14 @@ +@@ -1,10 +1,15 @@ package org.bukkit.entity; import java.net.InetSocketAddress; @@ -84,11 +89,12 @@ index 5dc04f47..ddf226a4 100644 +import org.bukkit.BanEntry; +import org.bukkit.BanList; +import org.bukkit.Bukkit; - import org.bukkit.ChatColor; ++import org.bukkit.ChatColor; import org.bukkit.Effect; import org.bukkit.GameMode; -@@ -417,6 +421,139 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - public void sendMap(MapView map); + import org.bukkit.Instrument; +@@ -424,6 +429,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM + public void sendMap(@NotNull MapView map); // Paper start + /** @@ -97,7 +103,9 @@ index 5dc04f47..ddf226a4 100644 + * @param reason Reason for ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason) { ++ // For reference, Bukkit defines this as nullable, while they impl isn't, we'll follow API. ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason) { + return banPlayerFull(reason, null, null); + } + @@ -108,7 +116,8 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason, String source) { ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) { + return banPlayerFull(reason, null, source); + } + @@ -119,7 +128,8 @@ index 5dc04f47..ddf226a4 100644 + * @param expires When to expire the ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason, Date expires) { ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires) { + return banPlayerFull(reason, expires, null); + } + @@ -131,7 +141,8 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of the ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerFull(String reason, Date expires, String source) { ++ @Nullable ++ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires, @Nullable String source) { + banPlayer(reason, expires, source); + return banPlayerIP(reason, expires, source, true); + } @@ -144,7 +155,8 @@ index 5dc04f47..ddf226a4 100644 + * @param kickPlayer Whether or not to kick the player afterwards + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, boolean kickPlayer) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) { + return banPlayerIP(reason, null, null, kickPlayer); + } + @@ -156,7 +168,8 @@ index 5dc04f47..ddf226a4 100644 + * @param kickPlayer Whether or not to kick the player afterwards + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, String source, boolean kickPlayer) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) { + return banPlayerIP(reason, null, source, kickPlayer); + } + @@ -168,7 +181,8 @@ index 5dc04f47..ddf226a4 100644 + * @param kickPlayer Whether or not to kick the player afterwards + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, Date expires, boolean kickPlayer) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, boolean kickPlayer) { + return banPlayerIP(reason, expires, null, kickPlayer); + } + @@ -179,7 +193,8 @@ index 5dc04f47..ddf226a4 100644 + * @param reason Reason for ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason) { + return banPlayerIP(reason, null, null); + } + @@ -190,7 +205,8 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of ban, or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, String source) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) { + return banPlayerIP(reason, null, source); + } + @@ -201,7 +217,8 @@ index 5dc04f47..ddf226a4 100644 + * @param expires When to expire the ban + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, Date expires) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires) { + return banPlayerIP(reason, expires, null); + } + @@ -213,10 +230,22 @@ index 5dc04f47..ddf226a4 100644 + * @param source Source of the banm or null for default + * @return Ban Entry + */ -+ public default BanEntry banPlayerIP(String reason, Date expires, String source) { ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source) { + return banPlayerIP(reason, expires, source, true); + } -+ public default BanEntry banPlayerIP(String reason, Date expires, String source, boolean kickPlayer) { ++ ++ /** ++ * Bans the IP address currently used by the player. ++ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)} ++ * @param reason Reason for Ban ++ * @param expires When to expire the ban ++ * @param source Source of the banm or null for default ++ * @param kickPlayer if the targeted player should be kicked ++ * @return Ban Entry ++ */ ++ @Nullable ++ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer) { + BanEntry banEntry = Bukkit.getServer().getBanList(BanList.Type.IP).addBan(getAddress().getAddress().getHostAddress(), reason, expires, source); + if (kickPlayer && isOnline()) { + getPlayer().kickPlayer(reason); @@ -228,5 +257,5 @@ index 5dc04f47..ddf226a4 100644 /** * Sends an Action Bar message to the client. -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0094-EndermanEscapeEvent.patch b/Spigot-API-Patches/0094-EndermanEscapeEvent.patch index 139393d94f..d38f3d4930 100644 --- a/Spigot-API-Patches/0094-EndermanEscapeEvent.patch +++ b/Spigot-API-Patches/0094-EndermanEscapeEvent.patch @@ -1,4 +1,4 @@ -From 66cc32083b1330586dff52b36c17828d0ed2d6e7 Mon Sep 17 00:00:00 2001 +From 839ae04d99c14516adbd82e7bc0c0d56c05e8795 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 13:14:30 -0400 Subject: [PATCH] EndermanEscapeEvent @@ -9,10 +9,10 @@ You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java new file mode 100644 -index 00000000..0d15a8ab +index 000000000..806112a8b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanEscapeEvent.java -@@ -0,0 +1,82 @@ +@@ -0,0 +1,87 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Enderman; @@ -21,15 +21,17 @@ index 00000000..0d15a8ab +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +public class EndermanEscapeEvent extends EntityEvent implements Cancellable { -+ private final Reason reason; ++ @NotNull private final Reason reason; + -+ public EndermanEscapeEvent(Enderman entity, Reason reason) { ++ public EndermanEscapeEvent(@NotNull Enderman entity, @NotNull Reason reason) { + super(entity); + this.reason = reason; + } + ++ @NotNull + @Override + public Enderman getEntity() { + return (Enderman) super.getEntity(); @@ -38,16 +40,19 @@ index 00000000..0d15a8ab + /** + * @return The reason the enderman is trying to escape + */ ++ @NotNull + public Reason getReason() { + return reason; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -96,5 +101,5 @@ index 00000000..0d15a8ab + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0095-Enderman.teleportRandomly.patch b/Spigot-API-Patches/0095-Enderman.teleportRandomly.patch index 9e493e3222..3c60c66b62 100644 --- a/Spigot-API-Patches/0095-Enderman.teleportRandomly.patch +++ b/Spigot-API-Patches/0095-Enderman.teleportRandomly.patch @@ -1,4 +1,4 @@ -From 1020cf1bb231062418dfebbf41aff92e762a470e Mon Sep 17 00:00:00 2001 +From 9bf60b25592269e84c14ab957c0274f625587ce2 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 13:29:15 -0400 Subject: [PATCH] Enderman.teleportRandomly() @@ -6,10 +6,10 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/org/bukkit/entity/Enderman.java b/src/main/java/org/bukkit/entity/Enderman.java -index edb49a20..1ea289b5 100644 +index bb325d9c..821c690f 100644 --- a/src/main/java/org/bukkit/entity/Enderman.java +++ b/src/main/java/org/bukkit/entity/Enderman.java -@@ -8,6 +8,17 @@ import org.bukkit.material.MaterialData; +@@ -10,6 +10,17 @@ import org.jetbrains.annotations.Nullable; */ public interface Enderman extends Monster { @@ -28,5 +28,5 @@ index edb49a20..1ea289b5 100644 * Gets the id and data of the block that the Enderman is carrying. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0096-Additional-world.getNearbyEntities-API-s.patch b/Spigot-API-Patches/0096-Additional-world.getNearbyEntities-API-s.patch index 21927869a4..d523aab976 100644 --- a/Spigot-API-Patches/0096-Additional-world.getNearbyEntities-API-s.patch +++ b/Spigot-API-Patches/0096-Additional-world.getNearbyEntities-API-s.patch @@ -1,4 +1,4 @@ -From fd36072a3ce6839ef977bedd24f3b459a0933f3d Mon Sep 17 00:00:00 2001 +From 7a42ac94e33e48aa35d35f1457c6cdca12edb8c9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 17:55:28 -0400 Subject: [PATCH] Additional world.getNearbyEntities API's @@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's Provides more methods to get nearby entities, and filter by types and predicates diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index d499e41b..bc6a51d7 100644 +index 84abeb216..0dcdbb59a 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -2,6 +2,8 @@ package org.bukkit; @@ -18,9 +18,9 @@ index d499e41b..bc6a51d7 100644 import java.util.Collection; import java.util.HashMap; import java.util.List; -@@ -483,6 +485,238 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Collection getEntitiesByClasses(Class... classes); +@@ -507,6 +509,256 @@ public interface World extends PluginMessageRecipient, Metadatable { + @NotNull + public Collection getEntitiesByClasses(@NotNull Class... classes); + // Paper start + /** @@ -29,7 +29,8 @@ index d499e41b..bc6a51d7 100644 + * @param radius Radius + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double radius) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double radius) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius); + } + @@ -40,7 +41,8 @@ index d499e41b..bc6a51d7 100644 + * @param yRadius Y Radius + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xzRadius, double yRadius) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius); + } + @@ -52,7 +54,8 @@ index d499e41b..bc6a51d7 100644 + * @param zRadius Z radius + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xRadius, double yRadius, double zRadius) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius); + } + @@ -63,7 +66,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of living entities near location. This will always be a non-null collection + */ -+ public default Collection getNearbyLivingEntities(Location loc, double radius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double radius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius, predicate); + } + @@ -75,7 +79,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of living entities near location. This will always be a non-null collection + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xzRadius, double yRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius, predicate); + } + @@ -88,7 +93,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of living entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyLivingEntities(Location loc, double xRadius, double yRadius, double zRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius, predicate); + } + @@ -98,7 +104,8 @@ index d499e41b..bc6a51d7 100644 + * @param radius X/Y/Z Radius + * @return the collection of living entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double radius) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double radius) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius); + } + @@ -109,7 +116,8 @@ index d499e41b..bc6a51d7 100644 + * @param yRadius Y Radius + * @return the collection of living entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xzRadius, double yRadius) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius); + } + @@ -121,7 +129,8 @@ index d499e41b..bc6a51d7 100644 + * @param zRadius Z Radius + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xRadius, double yRadius, double zRadius) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius); + } + @@ -132,7 +141,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double radius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double radius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius, predicate); + } + @@ -144,7 +154,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xzRadius, double yRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius, predicate); + } + @@ -157,7 +168,8 @@ index d499e41b..bc6a51d7 100644 + * @param predicate a predicate used to filter results + * @return the collection of players near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyPlayers(Location loc, double xRadius, double yRadius, double zRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius, predicate); + } + @@ -169,7 +181,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double radius) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double radius) { + return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, null); + } + @@ -182,7 +195,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xzRadius, double yRadius) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xzRadius, double yRadius) { + return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, null); + } + @@ -196,7 +210,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xRadius, double yRadius, double zRadius) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius) { + return getNearbyEntitiesByType(clazz, loc, xRadius, yRadius, zRadius, null); + } + @@ -209,7 +224,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double radius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double radius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, predicate); + } + @@ -223,7 +239,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xzRadius, double yRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate predicate) { + return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, predicate); + } + @@ -238,7 +255,8 @@ index d499e41b..bc6a51d7 100644 + * @param the entity type + * @return the collection of entities near location. This will always be a non-null collection. + */ -+ public default Collection getNearbyEntitiesByType(Class clazz, Location loc, double xRadius, double yRadius, double zRadius, Predicate predicate) { ++ @NotNull ++ public default Collection getNearbyEntitiesByType(@Nullable Class clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate predicate) { + if (clazz == null) { + clazz = Entity.class; + } @@ -258,5 +276,5 @@ index d499e41b..bc6a51d7 100644 * Get a list of all players in this World * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0097-Location.isChunkLoaded-API.patch b/Spigot-API-Patches/0097-Location.isChunkLoaded-API.patch index ff10370fbd..d3a1a2a2c7 100644 --- a/Spigot-API-Patches/0097-Location.isChunkLoaded-API.patch +++ b/Spigot-API-Patches/0097-Location.isChunkLoaded-API.patch @@ -1,14 +1,14 @@ -From 2b2f63ce1bf3c15f8688b6fb80eed9a83b292114 Mon Sep 17 00:00:00 2001 +From d6c9115f6181f8d5f7a3e9e9633726599d1b384e Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 30 Apr 2018 19:27:31 -0400 Subject: [PATCH] Location.isChunkLoaded() API diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 5c3d42cc..1ddebf3c 100644 +index 6cffda15..a2dfad2f 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -491,6 +491,7 @@ public class Location implements Cloneable, ConfigurationSerializable { +@@ -506,6 +506,7 @@ public class Location implements Cloneable, ConfigurationSerializable { return this; } @@ -17,5 +17,5 @@ index 5c3d42cc..1ddebf3c 100644 public boolean equals(Object obj) { if (obj == null) { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0098-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-API-Patches/0098-Expand-World.spawnParticle-API-and-add-Builder.patch index 48ed47766a..9ab0df8d53 100644 --- a/Spigot-API-Patches/0098-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-API-Patches/0098-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -1,4 +1,4 @@ -From c367daf8d4c29ed21bd88d582dc21bd9abc1c4a7 Mon Sep 17 00:00:00 2001 +From eaaaf19013f78b47c4cf32a9dec4ac0e5c5a5c61 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 29 Aug 2017 23:58:48 -0400 Subject: [PATCH] Expand World.spawnParticle API and add Builder @@ -10,10 +10,10 @@ This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java new file mode 100644 -index 00000000..50b52d6b +index 000000000..06f1602f5 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java -@@ -0,0 +1,416 @@ +@@ -0,0 +1,478 @@ +package com.destroystokyo.paper; + +import com.google.common.collect.Lists; @@ -24,9 +24,10 @@ index 00000000..50b52d6b +import org.bukkit.entity.Player; +import org.bukkit.util.NumberConversions; + -+import javax.annotation.Nullable; +import java.util.Collection; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Helps prepare a particle to be sent to players. @@ -34,6 +35,7 @@ index 00000000..50b52d6b + * Usage of the builder is preferred over the super long {@link World#spawnParticle(Particle, Location, int, double, double, double, double, Object)} API + */ +public class ParticleBuilder { ++ + private Particle particle; + private List receivers; + private Player source; @@ -44,16 +46,17 @@ index 00000000..50b52d6b + private Object data; + private boolean force = true; + -+ public ParticleBuilder(Particle particle) { ++ public ParticleBuilder(@NotNull Particle particle) { + this.particle = particle; + } + + /** -+ * Sends the particle to all receiving players (or all). -+ * This method is safe to use Asynchronously ++ * Sends the particle to all receiving players (or all). This method is safe to use ++ * Asynchronously + * + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder spawn() { + if (this.location == null) { + throw new IllegalStateException("Please specify location for this particle"); @@ -68,16 +71,19 @@ index 00000000..50b52d6b + /** + * @return The particle going to be sent + */ ++ @NotNull + public Particle particle() { + return particle; + } + + /** + * Changes what particle will be sent ++ * + * @param particle The particle + * @return a reference to this object. + */ -+ public ParticleBuilder particle(Particle particle) { ++ @NotNull ++ public ParticleBuilder particle(@NotNull Particle particle) { + this.particle = particle; + return this; + } @@ -93,31 +99,35 @@ index 00000000..50b52d6b + /** + * Example use: + * -+ * builder.receivers(16); -+ * if (builder.hasReceivers()) { -+ * sendParticleAsync(builder); -+ * } ++ * builder.receivers(16); if (builder.hasReceivers()) { sendParticleAsync(builder); } ++ * + * @return If this particle is going to be sent to someone + */ + public boolean hasReceivers() { -+ return (receivers == null && !location.getWorld().getPlayers().isEmpty()) || (receivers != null && !receivers.isEmpty()); ++ return (receivers == null && !location.getWorld().getPlayers().isEmpty()) || ( ++ receivers != null && !receivers.isEmpty()); + } + + /** -+ * Sends this particle to all players in the world. This is rather silly and you should likely not be doing this. ++ * Sends this particle to all players in the world. This is rather silly and you should likely not ++ * be doing this. + * + * Just be a logical person and use receivers by radius or collection. ++ * + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder allPlayers() { -+ this.receivers = null; -+ return this; ++ this.receivers = null; ++ return this; + } + + /** -+ * @param receivers List of players to receive this particle, or null for all players in the world ++ * @param receivers List of players to receive this particle, or null for all players in the ++ * world + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(@Nullable List receivers) { + // Had to keep this as we first made API List<> and not Collection, but removing this may break plugins compiled on older jars + // TODO: deprecate? @@ -126,48 +136,57 @@ index 00000000..50b52d6b + } + + /** -+ * @param receivers List of players to receive this particle, or null for all players in the world ++ * @param receivers List of players to receive this particle, or null for all players in the ++ * world + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(@Nullable Collection receivers) { + this.receivers = receivers != null ? Lists.newArrayList(receivers) : null; + return this; + } + + /** -+ * @param receivers List of players to be receive this particle, or null for all players in the world ++ * @param receivers List of players to be receive this particle, or null for all players in the ++ * world + * @return a reference to this object. + */ -+ public ParticleBuilder receivers(Player... receivers) { ++ @NotNull ++ public ParticleBuilder receivers(@Nullable Player... receivers) { + this.receivers = receivers != null ? Lists.newArrayList(receivers) : null; + return this; + } + + /** -+ * Selects all players within a cuboid selection around the particle location, within the specified bounding box. -+ * If you want a more spherical check, see {@link #receivers(int, boolean)} ++ * Selects all players within a cuboid selection around the particle location, within the ++ * specified bounding box. If you want a more spherical check, see {@link #receivers(int, ++ * boolean)} + * + * @param radius amount to add on all axis + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int radius) { + return receivers(radius, radius); + } + + /** -+ * Selects all players within the specified radius around the particle location. -+ * If byDistance is false, behavior uses cuboid selection the same as {@link #receivers(int, int)} -+ * If byDistance is true, radius is tested by distance in a spherical shape -+ * @param radius amount to add on each axis ++ * Selects all players within the specified radius around the particle location. If byDistance is ++ * false, behavior uses cuboid selection the same as {@link #receivers(int, int)} If byDistance is ++ * true, radius is tested by distance in a spherical shape ++ * ++ * @param radius amount to add on each axis + * @param byDistance true to use a spherical radius, false to use a cuboid + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int radius, boolean byDistance) { + if (!byDistance) { + return receivers(radius, radius, radius); + } else { + this.receivers = Lists.newArrayList(); -+ for (Player nearbyPlayer : location.getWorld().getNearbyPlayers(location, radius, radius, radius)) { ++ for (Player nearbyPlayer : location.getWorld() ++ .getNearbyPlayers(location, radius, radius, radius)) { + Location loc = nearbyPlayer.getLocation(); + double x = NumberConversions.square(location.getX() - loc.getX()); + double y = NumberConversions.square(location.getY() - loc.getY()); @@ -182,34 +201,38 @@ index 00000000..50b52d6b + } + + /** -+ * Selects all players within a cuboid selection around the particle location, within the specified bounding box. -+ * Allows specifying a different Y size than X and Z -+ * If you want a more cylinder check, see {@link #receivers(int, int, boolean)} -+ * If you want a more spherical check, see {@link #receivers(int, boolean)} ++ * Selects all players within a cuboid selection around the particle location, within the ++ * specified bounding box. Allows specifying a different Y size than X and Z If you want a more ++ * cylinder check, see {@link #receivers(int, int, boolean)} If you want a more spherical check, ++ * see {@link #receivers(int, boolean)} + * + * @param xzRadius amount to add on the x/z axis + * @param yRadius amount to add on the y axis + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int xzRadius, int yRadius) { + return receivers(xzRadius, yRadius, xzRadius); + } + + /** -+ * Selects all players within the specified radius around the particle location. -+ * If byDistance is false, behavior uses cuboid selection the same as {@link #receivers(int, int)} -+ * If byDistance is true, radius is tested by distance on the y plane and on the x/z plane, in a cylinder shape. ++ * Selects all players within the specified radius around the particle location. If byDistance is ++ * false, behavior uses cuboid selection the same as {@link #receivers(int, int)} If byDistance is ++ * true, radius is tested by distance on the y plane and on the x/z plane, in a cylinder shape. ++ * + * @param xzRadius amount to add on the x/z axis + * @param yRadius amount to add on the y axis + * @param byDistance true to use a cylinder shape, false to use cuboid + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int xzRadius, int yRadius, boolean byDistance) { + if (!byDistance) { + return receivers(xzRadius, yRadius, xzRadius); + } else { + this.receivers = Lists.newArrayList(); -+ for (Player nearbyPlayer : location.getWorld().getNearbyPlayers(location, xzRadius, yRadius, xzRadius)) { ++ for (Player nearbyPlayer : location.getWorld() ++ .getNearbyPlayers(location, xzRadius, yRadius, xzRadius)) { + Location loc = nearbyPlayer.getLocation(); + if (Math.abs(loc.getY() - this.location.getY()) > yRadius) { + continue; @@ -226,15 +249,16 @@ index 00000000..50b52d6b + } + + /** -+ * Selects all players within a cuboid selection around the particle location, within the specified bounding box. -+ * If you want a more cylinder check, see {@link #receivers(int, int, boolean)} -+ * If you want a more spherical check, see {@link #receivers(int, boolean)} ++ * Selects all players within a cuboid selection around the particle location, within the ++ * specified bounding box. If you want a more cylinder check, see {@link #receivers(int, int, ++ * boolean)} If you want a more spherical check, see {@link #receivers(int, boolean)} + * + * @param xRadius amount to add on the x axis + * @param yRadius amount to add on the y axis + * @param zRadius amount to add on the z axis + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder receivers(int xRadius, int yRadius, int zRadius) { + if (location == null) { + throw new IllegalStateException("Please set location first"); @@ -245,16 +269,19 @@ index 00000000..50b52d6b + /** + * @return The player considered the source of this particle (for Visibility concerns), or null + */ ++ @Nullable + public Player source() { + return source; + } + + /** + * Sets the source of this particle for visibility concerns (Vanish API) ++ * + * @param source The player who is considered the source + * @return a reference to this object. + */ -+ public ParticleBuilder source(Player source) { ++ @NotNull ++ public ParticleBuilder source(@Nullable Player source) { + this.source = source; + return this; + } @@ -262,29 +289,34 @@ index 00000000..50b52d6b + /** + * @return Location of where the particle will spawn + */ ++ @Nullable + public Location location() { + return location; + } + + /** + * Sets the location of where to spawn the particle ++ * + * @param location The location of the particle + * @return a reference to this object. + */ -+ public ParticleBuilder location(Location location) { ++ @NotNull ++ public ParticleBuilder location(@NotNull Location location) { + this.location = location.clone(); + return this; + } + + /** + * Sets the location of where to spawn the particle ++ * + * @param world World to spawn particle in + * @param x X location + * @param y Y location + * @param z Z location + * @return a reference to this object. + */ -+ public ParticleBuilder location(World world, double x, double y, double z) { ++ @NotNull ++ public ParticleBuilder location(@NotNull World world, double x, double y, double z) { + this.location = new Location(world, x, y, z); + return this; + } @@ -298,9 +330,11 @@ index 00000000..50b52d6b + + /** + * Sets the number of particles to spawn ++ * + * @param count Number of particles + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder count(int count) { + this.count = count; + return this; @@ -308,20 +342,25 @@ index 00000000..50b52d6b + + /** + * Particle offset X. Varies by particle on how this is used ++ * + * @return Particle offset X. + */ + public double offsetX() { + return offsetX; + } ++ + /** + * Particle offset Y. Varies by particle on how this is used ++ * + * @return Particle offset Y. + */ + public double offsetY() { + return offsetY; + } ++ + /** + * Particle offset Z. Varies by particle on how this is used ++ * + * @return Particle offset Z. + */ + public double offsetZ() { @@ -330,11 +369,13 @@ index 00000000..50b52d6b + + /** + * Sets the particle offset. Varies by particle on how this is used ++ * + * @param offsetX Particle offset X + * @param offsetY Particle offset Y + * @param offsetZ Particle offset Z + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder offset(double offsetX, double offsetY, double offsetZ) { + this.offsetX = offsetX; + this.offsetY = offsetY; @@ -344,6 +385,7 @@ index 00000000..50b52d6b + + /** + * Gets the Particle extra data. Varies by particle on how this is used ++ * + * @return the extra particle data + */ + public double extra() { @@ -352,9 +394,11 @@ index 00000000..50b52d6b + + /** + * Sets the particle extra data. Varies by particle on how this is used ++ * + * @param extra the extra particle data + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder extra(double extra) { + this.extra = extra; + return this; @@ -362,9 +406,11 @@ index 00000000..50b52d6b + + /** + * Gets the particle custom data. Varies by particle on how this is used ++ * + * @param The Particle data type + * @return the ParticleData for this particle + */ ++ @Nullable + public T data() { + //noinspection unchecked + return (T) data; @@ -372,49 +418,64 @@ index 00000000..50b52d6b + + /** + * Sets the particle custom data. Varies by particle on how this is used ++ * + * @param data The new particle data + * @param The Particle data type + * @return a reference to this object. + */ -+ public ParticleBuilder data(T data) { ++ @NotNull ++ public ParticleBuilder data(@Nullable T data) { + this.data = data; + return this; + } + + /** -+ * Sets whether the particle is forcefully shown to the player. -+ * If forced, the particle will show faraway, as far as the player's view distance allows. -+ * If false, the particle will show according to the client's particle settings. ++ * Sets whether the particle is forcefully shown to the player. If forced, the particle will show ++ * faraway, as far as the player's view distance allows. If false, the particle will show ++ * according to the client's particle settings. + * + * @param force true to force, false for normal + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder force(boolean force) { + this.force = force; + return this; + } + + /** -+ * Sets the particle Color. -+ * Only valid for REDSTONE. ++ * Sets the particle Color. Only valid for REDSTONE. ++ * + * @param color the new particle color + * @return a reference to this object. + */ -+ public ParticleBuilder color(Color color) { ++ @NotNull ++ public ParticleBuilder color(@Nullable Color color) { + return color(color, 1); + } + + /** -+ * Sets the particle Color and size. -+ * Only valid for REDSTONE. ++ * Sets the particle Color and size. Only valid for REDSTONE. ++ * + * @param color the new particle color + * @param size the size of the particle + * @return a reference to this object. + */ -+ public ParticleBuilder color(Color color, float size) { -+ if (particle != Particle.REDSTONE) { ++ @NotNull ++ public ParticleBuilder color(@Nullable Color color, float size) { ++ if (particle != Particle.REDSTONE && color != null) { + throw new IllegalStateException("Color may only be set on REDSTONE"); + } ++ ++ // We don't officially support reusing these objects, but here we go ++ if (color == null) { ++ if (data instanceof Particle.DustOptions) { ++ return data(null); ++ } else { ++ return this; ++ } ++ } ++ + return data(new Particle.DustOptions(color, size)); + } + @@ -426,15 +487,16 @@ index 00000000..50b52d6b + * @param b blue color component + * @return a reference to this object. + */ ++ @NotNull + public ParticleBuilder color(int r, int g, int b) { + return color(Color.fromRGB(r, g, b)); + } +} diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java -index 4d0acaf5..827aa00c 100644 +index 3b2314a94..a919c6d5b 100644 --- a/src/main/java/org/bukkit/Particle.java +++ b/src/main/java/org/bukkit/Particle.java -@@ -82,6 +82,16 @@ public enum Particle { +@@ -84,6 +84,17 @@ public enum Particle { return dataType; } @@ -444,6 +506,7 @@ index 4d0acaf5..827aa00c 100644 + * + * @return a {@link com.destroystokyo.paper.ParticleBuilder} for the particle + */ ++ @NotNull + public com.destroystokyo.paper.ParticleBuilder builder() { + return new com.destroystokyo.paper.ParticleBuilder(this); + } @@ -452,15 +515,15 @@ index 4d0acaf5..827aa00c 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 bc6a51d7..6b7eeeac 100644 +index 0dcdbb59a..bec405feb 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2006,7 +2006,57 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2084,7 +2084,57 @@ public interface World extends PluginMessageRecipient, Metadatable { * the type of this depends on {@link Particle#getDataType()} * @param Type */ -- public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data); -+ public default void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }// Paper start - Expand Particle API +- public void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); ++ public default void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, null, null, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); }// Paper start - Expand Particle API + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be @@ -483,7 +546,7 @@ index bc6a51d7..6b7eeeac 100644 + * the type of this depends on {@link Particle#getDataType()} + * @param Type + */ -+ public default void spawnParticle(Particle particle, List receivers, Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); } ++ public default void spawnParticle(@NotNull Particle particle, @Nullable List receivers, @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) { spawnParticle(particle, receivers, source, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, true); } + /** + * Spawns the particle (the number of times specified by count) + * at the target location. The position of each particle will be @@ -508,12 +571,12 @@ index bc6a51d7..6b7eeeac 100644 + * @param force allows the particle to be seen further away from the player + * and shows to players using any vanilla client particle settings + */ -+ public void spawnParticle(Particle particle, List receivers, Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force); ++ public void spawnParticle(@NotNull Particle particle, @Nullable List receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); + // Paper end + /** * Spawns the particle (the number of times specified by count) -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0099-EndermanAttackPlayerEvent.patch b/Spigot-API-Patches/0099-EndermanAttackPlayerEvent.patch index c1dfd85371..0df5252b7e 100644 --- a/Spigot-API-Patches/0099-EndermanAttackPlayerEvent.patch +++ b/Spigot-API-Patches/0099-EndermanAttackPlayerEvent.patch @@ -1,4 +1,4 @@ -From 75e762447840834a7c3f6e3c48af2136be41b1dc Mon Sep 17 00:00:00 2001 +From 525854c7970c2715c32cb5cd3a961d0471372f16 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 May 2018 20:17:44 -0400 Subject: [PATCH] EndermanAttackPlayerEvent @@ -9,10 +9,10 @@ This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java new file mode 100644 -index 00000000..ab5a7a6b +index 000000000..f530a3d93 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java -@@ -0,0 +1,96 @@ +@@ -0,0 +1,101 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * @@ -45,6 +45,7 @@ index 00000000..ab5a7a6b +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an Enderman determines if it should attack a player or not. @@ -53,9 +54,9 @@ index 00000000..ab5a7a6b + * + */ +public class EndermanAttackPlayerEvent extends EntityEvent implements Cancellable { -+ private final Player player; ++ @NotNull private final Player player; + -+ public EndermanAttackPlayerEvent(Enderman entity, Player player) { ++ public EndermanAttackPlayerEvent(@NotNull Enderman entity, @NotNull Player player) { + super(entity); + this.player = player; + } @@ -65,6 +66,7 @@ index 00000000..ab5a7a6b + * + * @return The enderman considering attacking + */ ++ @NotNull + @Override + public Enderman getEntity() { + return (Enderman) super.getEntity(); @@ -75,16 +77,19 @@ index 00000000..ab5a7a6b + * + * @return The player the Enderman is considering attacking + */ ++ @NotNull + public Player getPlayer() { + return player; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -110,5 +115,5 @@ index 00000000..ab5a7a6b + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0100-Close-Plugin-Class-Loaders-on-Disable.patch b/Spigot-API-Patches/0100-Close-Plugin-Class-Loaders-on-Disable.patch index d45a4b22bb..c18cb69d55 100644 --- a/Spigot-API-Patches/0100-Close-Plugin-Class-Loaders-on-Disable.patch +++ b/Spigot-API-Patches/0100-Close-Plugin-Class-Loaders-on-Disable.patch @@ -1,4 +1,4 @@ -From e6848b857dc953c4ab20b2d1c9697597488abbf5 Mon Sep 17 00:00:00 2001 +From 01b125b0fe0165e700c81c3211f8510da00461a5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 1 May 2018 21:33:35 -0400 Subject: [PATCH] Close Plugin Class Loaders on Disable @@ -7,14 +7,13 @@ This should close more memory leaks from /reload and disabling plugins, by closing the class loader and the jar file. diff --git a/src/main/java/org/bukkit/plugin/PluginLoader.java b/src/main/java/org/bukkit/plugin/PluginLoader.java -index e7981a1d..d34756f1 100644 +index da7839aa9..fbd65e8b0 100644 --- a/src/main/java/org/bukkit/plugin/PluginLoader.java +++ b/src/main/java/org/bukkit/plugin/PluginLoader.java -@@ -73,4 +73,19 @@ public interface PluginLoader { +@@ -78,4 +78,18 @@ public interface PluginLoader { * @param plugin Plugin to disable */ - public void disablePlugin(Plugin plugin); -+ + public void disablePlugin(@NotNull Plugin plugin); + // Paper start - close Classloader on disable + /** + * Disables the specified plugin @@ -25,18 +24,18 @@ index e7981a1d..d34756f1 100644 + * @param closeClassloader if the classloader for the Plugin should be closed + */ + // provide default to allow other PluginLoader implementations to work -+ default public void disablePlugin(Plugin plugin, boolean closeClassloader) { ++ default public void disablePlugin(@NotNull Plugin plugin, boolean closeClassloader) { + disablePlugin(plugin); + } + // Paper end - close Classloader on disable } diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java -index e5638d56..b72d5a9b 100644 +index a468467b4..ba4ed7ed7 100644 --- a/src/main/java/org/bukkit/plugin/PluginManager.java +++ b/src/main/java/org/bukkit/plugin/PluginManager.java -@@ -154,6 +154,18 @@ public interface PluginManager { +@@ -162,6 +162,18 @@ public interface PluginManager { */ - public void disablePlugin(Plugin plugin); + public void disablePlugin(@NotNull Plugin plugin); + // Paper start - close Classloader on disable + /** @@ -47,17 +46,17 @@ index e5638d56..b72d5a9b 100644 + * @param plugin Plugin to disable + * @param closeClassloader if the classloader for the Plugin should be closed + */ -+ public void disablePlugin(Plugin plugin, boolean closeClassloader); ++ public void disablePlugin(@NotNull Plugin plugin, boolean closeClassloader); + // Paper end - close Classloader on disable + /** * Gets a {@link Permission} from its fully qualified name * diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index 5034215a..d925423d 100644 +index 12e17709c..7d4ca43b5 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -@@ -413,17 +413,29 @@ public final class SimplePluginManager implements PluginManager { +@@ -419,17 +419,29 @@ public final class SimplePluginManager implements PluginManager { } } @@ -75,13 +74,12 @@ index 5034215a..d925423d 100644 } } -- public void disablePlugin(final Plugin plugin) { + // Paper start - close Classloader on disable -+ public void disablePlugin(Plugin plugin) { + public void disablePlugin(@NotNull final Plugin plugin) { + disablePlugin(plugin, false); + } + -+ public void disablePlugin(final Plugin plugin, boolean closeClassloader) { ++ public void disablePlugin(@NotNull final Plugin plugin, boolean closeClassloader) { + // Paper end - close Classloader on disable if (plugin.isEnabled()) { try { @@ -90,7 +88,7 @@ index 5034215a..d925423d 100644 } catch (Throwable ex) { handlePluginException("Error occurred (in the plugin loader) while disabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex, plugin); // Paper -@@ -469,7 +481,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -475,7 +487,7 @@ public final class SimplePluginManager implements PluginManager { public void clearPlugins() { synchronized (this) { @@ -100,10 +98,10 @@ index 5034215a..d925423d 100644 lookupNames.clear(); HandlerList.unregisterAll(); diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -index 77207f14..c7782e7d 100644 +index b9bf2124b..095448fe7 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -320,7 +320,7 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -328,7 +328,7 @@ public final class JavaPluginLoader implements PluginLoader { } catch (Throwable ex) { server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex); // Paper start - Disable plugins that fail to load @@ -112,21 +110,20 @@ index 77207f14..c7782e7d 100644 return; // Paper end } -@@ -331,7 +331,13 @@ public final class JavaPluginLoader implements PluginLoader { - } +@@ -340,6 +340,12 @@ public final class JavaPluginLoader implements PluginLoader { } + public void disablePlugin(@NotNull Plugin plugin) { + // Paper start - close Classloader on disable - public void disablePlugin(Plugin plugin) { + disablePlugin(plugin, false); // Retain old behavior unless requested + } + -+ public void disablePlugin(Plugin plugin, boolean closeClassloader) { ++ public void disablePlugin(@NotNull Plugin plugin, boolean closeClassloader) { + // Paper end - close Class Loader on disable Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); if (plugin.isEnabled()) { -@@ -358,6 +364,16 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -366,6 +372,16 @@ public final class JavaPluginLoader implements PluginLoader { for (String name : names) { removeClass(name); } @@ -144,5 +141,5 @@ index 77207f14..c7782e7d 100644 } } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0101-WitchConsumePotionEvent.patch b/Spigot-API-Patches/0101-WitchConsumePotionEvent.patch index 5d3b52001f..e0fd14416b 100644 --- a/Spigot-API-Patches/0101-WitchConsumePotionEvent.patch +++ b/Spigot-API-Patches/0101-WitchConsumePotionEvent.patch @@ -1,4 +1,4 @@ -From ba6dedde58f6f28c09dc1d8226c3e8269b956597 Mon Sep 17 00:00:00 2001 +From d9c3debc9d0a4123e4a6d56fc4b7154b5f2fb1e8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 May 2018 20:26:16 -0400 Subject: [PATCH] WitchConsumePotionEvent @@ -7,10 +7,10 @@ Fires when a witch consumes the potion in their hand diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java new file mode 100644 -index 00000000..79021899 +index 000000000..fbbace36d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java -@@ -0,0 +1,64 @@ +@@ -0,0 +1,70 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Witch; @@ -18,18 +18,21 @@ index 00000000..79021899 +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Fired when a witch consumes the potion in their hand to buff themselves. + */ +public class WitchConsumePotionEvent extends EntityEvent implements Cancellable { -+ private ItemStack potion; ++ @Nullable private ItemStack potion; + -+ public WitchConsumePotionEvent(Witch witch, ItemStack potion) { ++ public WitchConsumePotionEvent(@NotNull Witch witch, @Nullable ItemStack potion) { + super(witch); + this.potion = potion; + } + ++ @NotNull + @Override + public Witch getEntity() { + return (Witch) super.getEntity(); @@ -38,6 +41,7 @@ index 00000000..79021899 + /** + * @return the potion the witch will consume and have the effects applied. + */ ++ @Nullable + public ItemStack getPotion() { + return potion; + } @@ -46,16 +50,18 @@ index 00000000..79021899 + * Sets the potion to be consumed and applied to the witch. + * @param potion The potion + */ -+ public void setPotion(ItemStack potion) { ++ public void setPotion(@Nullable ItemStack potion) { + this.potion = potion != null ? potion.clone() : null; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -77,7 +83,7 @@ index 00000000..79021899 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java new file mode 100644 -index 00000000..6ef6367b +index 000000000..6ef6367b6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java @@ -0,0 +1,33 @@ @@ -115,5 +121,5 @@ index 00000000..6ef6367b + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0102-WitchThrowPotionEvent.patch b/Spigot-API-Patches/0102-WitchThrowPotionEvent.patch index 71e875dc0a..0f6658d17c 100644 --- a/Spigot-API-Patches/0102-WitchThrowPotionEvent.patch +++ b/Spigot-API-Patches/0102-WitchThrowPotionEvent.patch @@ -1,4 +1,4 @@ -From f7201b04e24d4bbf74d326bf78b5edce24be9e0d Mon Sep 17 00:00:00 2001 +From 456f51c1047c446b824766799d6883ab066ee8bb Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 16 May 2018 20:39:09 -0400 Subject: [PATCH] WitchThrowPotionEvent @@ -6,10 +6,10 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java -index 6ef6367b..77487e28 100644 +index 6ef6367b6..688a596aa 100644 --- a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java -@@ -1,13 +1,51 @@ +@@ -1,29 +1,77 @@ package com.destroystokyo.paper.event.entity; +import org.bukkit.entity.LivingEntity; @@ -19,6 +19,8 @@ index 6ef6367b..77487e28 100644 import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; -public class WitchThrowPotionEvent extends Event implements Cancellable { - public WitchThrowPotionEvent() { @@ -26,15 +28,16 @@ index 6ef6367b..77487e28 100644 + * Fired when a witch throws a potion at a player + */ +public class WitchThrowPotionEvent extends EntityEvent implements Cancellable { -+ private final LivingEntity target; -+ private ItemStack potion; ++ @NotNull private final LivingEntity target; ++ @Nullable private ItemStack potion; + -+ public WitchThrowPotionEvent(Witch witch, LivingEntity target, ItemStack potion) { ++ public WitchThrowPotionEvent(@NotNull Witch witch, @NotNull LivingEntity target, @Nullable ItemStack potion) { + super(witch); + this.target = target; + this.potion = potion; } ++ @NotNull + @Override + public Witch getEntity() { + return (Witch) super.getEntity(); @@ -43,6 +46,7 @@ index 6ef6367b..77487e28 100644 + /** + * @return The target of the potion + */ ++ @NotNull + public LivingEntity getTarget() { + return target; + } @@ -50,6 +54,7 @@ index 6ef6367b..77487e28 100644 + /** + * @return The potion the witch will throw at a player + */ ++ @Nullable + public ItemStack getPotion() { + return potion; + } @@ -58,13 +63,21 @@ index 6ef6367b..77487e28 100644 + * Sets the potion to be thrown at a player + * @param potion The potion + */ -+ public void setPotion(ItemStack potion) { ++ public void setPotion(@Nullable ItemStack potion) { + this.potion = potion != null ? potion.clone() : null; + } private static final HandlerList handlers = new HandlerList(); -@@ -21,9 +59,12 @@ public class WitchThrowPotionEvent extends Event implements Cancellable { ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } private boolean cancelled = false; @@ -79,5 +92,5 @@ index 6ef6367b..77487e28 100644 @Override -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0103-Location.toBlockLocation-toCenterLocation.patch b/Spigot-API-Patches/0103-Location.toBlockLocation-toCenterLocation.patch index 43d16f0e33..69ac9268c3 100644 --- a/Spigot-API-Patches/0103-Location.toBlockLocation-toCenterLocation.patch +++ b/Spigot-API-Patches/0103-Location.toBlockLocation-toCenterLocation.patch @@ -1,4 +1,4 @@ -From 316049bab75da64f7cd691eca897200c63ce88b8 Mon Sep 17 00:00:00 2001 +From f518eb3d1040b4b8131c289ceecfe47d04561b21 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 24 May 2018 21:01:13 -0400 Subject: [PATCH] Location.toBlockLocation/toCenterLocation() @@ -6,10 +6,10 @@ Subject: [PATCH] Location.toBlockLocation/toCenterLocation() Convert location objects to their block coordinates, or the center of the block diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 1ddebf3c..916238c4 100644 +index a2dfad2f4..3387fb477 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -492,6 +492,29 @@ public class Location implements Cloneable, ConfigurationSerializable { +@@ -507,6 +507,31 @@ public class Location implements Cloneable, ConfigurationSerializable { } public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper @@ -18,6 +18,7 @@ index 1ddebf3c..916238c4 100644 + /** + * @return A new location where X/Y/Z are on the Block location (integer value of X/Y/Z) + */ ++ @NotNull + public Location toBlockLocation() { + Location blockLoc = clone(); + blockLoc.setX(getBlockX()); @@ -28,6 +29,7 @@ index 1ddebf3c..916238c4 100644 + /** + * @return A new location where X/Y/Z are the center of the block + */ ++ @NotNull + public Location toCenterLocation() { + Location centerLoc = clone(); + centerLoc.setX(getBlockX() + 0.5); @@ -40,5 +42,5 @@ index 1ddebf3c..916238c4 100644 public boolean equals(Object obj) { if (obj == null) { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0104-PotionEffect-clone-methods.patch b/Spigot-API-Patches/0104-PotionEffect-clone-methods.patch index 56bf276e06..686f565c93 100644 --- a/Spigot-API-Patches/0104-PotionEffect-clone-methods.patch +++ b/Spigot-API-Patches/0104-PotionEffect-clone-methods.patch @@ -1,41 +1,47 @@ -From 631b3e9d4a7a908df94994d6d25987747e313a54 Mon Sep 17 00:00:00 2001 +From 8d34f2367c37cd9a2f1e78b4698332157ae7b670 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 3 Jun 2018 04:10:13 -0400 Subject: [PATCH] PotionEffect clone methods diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java -index 86616f1b..efb55d29 100644 +index d57450c95..4125a024e 100644 --- a/src/main/java/org/bukkit/potion/PotionEffect.java +++ b/src/main/java/org/bukkit/potion/PotionEffect.java -@@ -100,6 +100,27 @@ public class PotionEffect implements ConfigurationSerializable { +@@ -103,6 +103,33 @@ public class PotionEffect implements ConfigurationSerializable { this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true))); } + // Paper start -+ public PotionEffect withType(PotionEffectType type) { ++ @NotNull ++ public PotionEffect withType(@NotNull PotionEffectType type) { + return new PotionEffect(type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withDuration(int duration) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withAmplifier(int amplifier) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withAmbient(boolean ambient) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withParticles(boolean particles) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } ++ @NotNull + public PotionEffect withIcon(boolean icon) { + return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon); + } + // Paper end + - private static PotionEffectType getEffectType(Map map) { + @NotNull + private static PotionEffectType getEffectType(@NotNull Map map) { int type = getInt(map, TYPE); - PotionEffectType effect = PotionEffectType.getById(type); -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0105-WitchReadyPotionEvent.patch b/Spigot-API-Patches/0105-WitchReadyPotionEvent.patch index 24f62de279..786436d9d1 100644 --- a/Spigot-API-Patches/0105-WitchReadyPotionEvent.patch +++ b/Spigot-API-Patches/0105-WitchReadyPotionEvent.patch @@ -1,4 +1,4 @@ -From 9a5e469dbad59679c1d69f3642e2e79fad6ec3bc Mon Sep 17 00:00:00 2001 +From c610e708384fe18f6b8c7dfda74ca0f8cc0f344e Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Jun 2018 22:47:08 -0400 Subject: [PATCH] WitchReadyPotionEvent @@ -7,24 +7,25 @@ Control what potion the witch readies to use diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java new file mode 100644 -index 00000000..0e0c6da7 +index 000000000..5351b523d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java -@@ -0,0 +1,74 @@ +@@ -0,0 +1,80 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.Material; +import org.bukkit.entity.Witch; +import org.bukkit.event.Cancellable; -+import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class WitchReadyPotionEvent extends EntityEvent implements Cancellable { + private ItemStack potion; + -+ public WitchReadyPotionEvent(Witch witch, ItemStack potion) { ++ public WitchReadyPotionEvent(@NotNull Witch witch, @Nullable ItemStack potion) { + super(witch); + this.potion = potion; + } @@ -35,7 +36,8 @@ index 00000000..0e0c6da7 + * @param potion the potion to be used + * @return The ItemStack to be used + */ -+ public static ItemStack process(Witch witch, ItemStack potion) { ++ @Nullable ++ public static ItemStack process(@NotNull Witch witch, @Nullable ItemStack potion) { + WitchReadyPotionEvent event = new WitchReadyPotionEvent(witch, potion); + if (!event.callEvent() || event.getPotion() == null) { + return new ItemStack(Material.AIR); @@ -43,6 +45,7 @@ index 00000000..0e0c6da7 + return event.getPotion(); + } + ++ @NotNull + @Override + public Witch getEntity() { + return (Witch) super.getEntity(); @@ -51,6 +54,7 @@ index 00000000..0e0c6da7 + /** + * @return the potion the witch is readying to use + */ ++ @Nullable + public ItemStack getPotion() { + return potion; + } @@ -59,16 +63,18 @@ index 00000000..0e0c6da7 + * Sets the potion the which is going to hold and use + * @param potion The potion + */ -+ public void setPotion(ItemStack potion) { ++ public void setPotion(@Nullable ItemStack potion) { + this.potion = potion != null ? potion.clone() : null; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -86,5 +92,5 @@ index 00000000..0e0c6da7 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0106-ItemStack-getMaxItemUseDuration.patch b/Spigot-API-Patches/0106-ItemStack-getMaxItemUseDuration.patch index 7cb661e4e8..a921ebee72 100644 --- a/Spigot-API-Patches/0106-ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-API-Patches/0106-ItemStack-getMaxItemUseDuration.patch @@ -1,4 +1,4 @@ -From f8b1352c6aaacb5248604cf7e940c98d359f3520 Mon Sep 17 00:00:00 2001 +From 25cbaf39e7634f8faad5ebb998a201df436baa71 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 5 Jun 2018 22:59:50 -0400 Subject: [PATCH] ItemStack#getMaxItemUseDuration @@ -6,10 +6,10 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index c3cb1247..26ab1278 100644 +index b1c02ac0d..1c7bbbcef 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java -@@ -593,5 +593,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { +@@ -607,5 +607,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { public String getI18NDisplayName() { return Bukkit.getServer().getItemFactory().getI18NDisplayName(this); } @@ -24,5 +24,5 @@ index c3cb1247..26ab1278 100644 // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0107-Add-EntityTeleportEndGatewayEvent.patch b/Spigot-API-Patches/0107-Add-EntityTeleportEndGatewayEvent.patch index 6d9e468a3b..bd565f7967 100644 --- a/Spigot-API-Patches/0107-Add-EntityTeleportEndGatewayEvent.patch +++ b/Spigot-API-Patches/0107-Add-EntityTeleportEndGatewayEvent.patch @@ -1,4 +1,4 @@ -From 7995cd5a3d19ab8fee4f03e45373d17359b61e40 Mon Sep 17 00:00:00 2001 +From d21bbfb71595a553f4f6208478832056bc8cb233 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 9 Jun 2018 13:08:21 +0100 Subject: [PATCH] Add EntityTeleportEndGatewayEvent @@ -6,25 +6,26 @@ Subject: [PATCH] Add EntityTeleportEndGatewayEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java new file mode 100644 -index 00000000..80899ecb +index 000000000..bfc69a43c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTeleportEndGatewayEvent.java -@@ -0,0 +1,29 @@ +@@ -0,0 +1,31 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.Location; +import org.bukkit.block.EndGateway; +import org.bukkit.entity.Entity; +import org.bukkit.event.entity.EntityTeleportEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired any time an entity attempts to teleport in an end gateway + */ +public class EntityTeleportEndGatewayEvent extends EntityTeleportEvent { + -+ private final EndGateway gateway; ++ @NotNull private final EndGateway gateway; + -+ public EntityTeleportEndGatewayEvent(Entity what, Location from, Location to, EndGateway gateway) { ++ public EntityTeleportEndGatewayEvent(@NotNull Entity what, @NotNull Location from, @NotNull Location to, @NotNull EndGateway gateway) { + super(what, from, to); + this.gateway = gateway; + } @@ -34,11 +35,12 @@ index 00000000..80899ecb + * + * @return EndGateway used + */ ++ @NotNull + public EndGateway getGateway() { + return gateway; + } + +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0108-Make-shield-blocking-delay-configurable.patch b/Spigot-API-Patches/0108-Make-shield-blocking-delay-configurable.patch index f3cf108303..965805adbf 100644 --- a/Spigot-API-Patches/0108-Make-shield-blocking-delay-configurable.patch +++ b/Spigot-API-Patches/0108-Make-shield-blocking-delay-configurable.patch @@ -1,14 +1,14 @@ -From 4dd104bf502818357031380daeb975cfa20b5a8f Mon Sep 17 00:00:00 2001 +From 56efcbe4b06d13be28be441121dc0745acfb9132 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 16 Jun 2018 01:17:39 -0500 Subject: [PATCH] Make shield blocking delay configurable diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 3f93b70c..99845e67 100644 +index 706d8f52..2fc50705 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -478,5 +478,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -491,5 +491,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @param arrows Number of arrows to stick in this entity */ void setArrowsStuck(int arrows); @@ -29,5 +29,5 @@ index 3f93b70c..99845e67 100644 // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0109-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-API-Patches/0109-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index ca624796f7..69445d39c5 100644 --- a/Spigot-API-Patches/0109-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-API-Patches/0109-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -1,4 +1,4 @@ -From c3d405f0ff5b1c4008276ee3eedc760062e63b2c Mon Sep 17 00:00:00 2001 +From 08658058b274e66ee6da649109aadb0c8094e4ce Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 15 Jun 2013 19:52:04 -0400 Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API @@ -6,32 +6,34 @@ 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 57f6203d4..efde16174 100644 --- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java -@@ -16,9 +16,28 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { +@@ -18,9 +18,30 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable { private Entity projectile; private final float force; private boolean cancelled; + // Paper start + private boolean consumeArrow = true; + private final ItemStack arrowItem; -+ public boolean getConsumeArrow() { -+ return consumeArrow; -+ } + public void setConsumeArrow(boolean consumeArrow) { + this.consumeArrow = consumeArrow; + } ++ public boolean getConsumeArrow() { ++ return consumeArrow; ++ } ++ @NotNull + public ItemStack getArrowItem() { + return arrowItem; + } + + @Deprecated - public EntityShootBowEvent(final LivingEntity shooter, final ItemStack bow, final Projectile projectile, final float force) { + public EntityShootBowEvent(@NotNull final LivingEntity shooter, @Nullable final ItemStack bow, @NotNull final Projectile projectile, final float force) { + this(shooter, bow, new ItemStack(org.bukkit.Material.AIR), projectile, force); + } -+ public EntityShootBowEvent(final LivingEntity shooter, final ItemStack bow, ItemStack arrowItem, final Projectile projectile, final float force) { ++ ++ public EntityShootBowEvent(@NotNull final LivingEntity shooter, @Nullable final ItemStack bow, @NotNull ItemStack arrowItem, @NotNull final Projectile projectile, final float force) { super(shooter); + this.arrowItem = arrowItem; + // Paper end @@ -39,5 +41,5 @@ index f8c91a13..c9eb75aa 100644 this.projectile = projectile; this.force = force; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch b/Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch deleted file mode 100644 index 3e63c2a5a9..0000000000 --- a/Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch +++ /dev/null @@ -1,258 +0,0 @@ -From ba6cfb506e1c9225c1945f2235725143c3694279 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath -Date: Mon, 18 Jun 2018 00:41:46 -0500 -Subject: [PATCH] Add "getNearbyXXX" methods to Location - - -diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 916238c4..162a76e8 100644 ---- a/src/main/java/org/bukkit/Location.java -+++ b/src/main/java/org/bukkit/Location.java -@@ -8,6 +8,15 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; - import org.bukkit.util.NumberConversions; - import org.bukkit.util.Vector; - -+// Paper start -+import java.util.Collection; -+import java.util.Collections; -+import java.util.function.Predicate; -+import org.bukkit.entity.Entity; -+import org.bukkit.entity.LivingEntity; -+import org.bukkit.entity.Player; -+// Paper end -+ - /** - * Represents a 3-dimensional position in a world. - *
-@@ -514,6 +523,228 @@ public class Location implements Cloneable, ConfigurationSerializable { - centerLoc.setZ(getBlockZ() + 0.5); - return centerLoc; - } -+ -+ /** -+ * Returns a list of entities within a bounding box centered around a Location. -+ * -+ * Some implementations may impose artificial restrictions on the size of the search bounding box. -+ * -+ * @param x 1/2 the size of the box along x axis -+ * @param y 1/2 the size of the box along y axis -+ * @param z 1/2 the size of the box along z axis -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntities(double x, double y, double z) { -+ if (world == null) { -+ throw new IllegalArgumentException("Location has no world"); -+ } -+ return world.getNearbyEntities(this, x, y, z); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius X Radius -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double radius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xzRadius, double yRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z radius -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xRadius, double yRadius, double zRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double radius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xzRadius, double yRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of living entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyLivingEntities(double xRadius, double yRadius, double zRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius X/Y/Z Radius -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ -+ public Collection getNearbyPlayers(double radius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xzRadius, double yRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xRadius, double yRadius, double zRadius) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param radius X/Y/Z Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double radius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xzRadius X/Z Radius -+ * @param yRadius Y Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xzRadius, double yRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius, predicate); -+ } -+ -+ /** -+ * Gets nearby players within the specified radius (bounding box) -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @param predicate a predicate used to filter results -+ * @return the collection of players near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyPlayers(double xRadius, double yRadius, double zRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius, predicate); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param radius X/Y/Z radius to search within -+ * @param the entity type -+ * @return the collection of entities of type clazz near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double radius) { -+ return getNearbyEntitiesByType(clazz, radius, radius, radius, null); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box) -+ * @param clazz Type to filter by -+ * @param xzRadius X/Z radius to search within -+ * @param yRadius Y radius to search within -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xzRadius, double yRadius) { -+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xRadius, double yRadius, double zRadius) { -+ return getNearbyEntitiesByType(clazz, xRadius, yRadius, zRadius, null); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param radius X/Y/Z radius to search within -+ * @param predicate a predicate used to filter results -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double radius, Predicate predicate) { -+ return getNearbyEntitiesByType(clazz, radius, radius, radius, predicate); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box) -+ * @param clazz Type to filter by -+ * @param xzRadius X/Z radius to search within -+ * @param yRadius Y radius to search within -+ * @param predicate a predicate used to filter results -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xzRadius, double yRadius, Predicate predicate) { -+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, predicate); -+ } -+ -+ /** -+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) -+ * @param clazz Type to filter by -+ * @param xRadius X Radius -+ * @param yRadius Y Radius -+ * @param zRadius Z Radius -+ * @param predicate a predicate used to filter results -+ * @param the entity type -+ * @return the collection of entities near location. This will always be a non-null collection. -+ */ -+ public Collection getNearbyEntitiesByType(Class clazz, double xRadius, double yRadius, double zRadius, Predicate predicate) { -+ if (world == null) { -+ throw new IllegalArgumentException("Location has no world"); -+ } -+ return world.getNearbyEntitiesByType(clazz, this, xRadius, yRadius, zRadius, predicate); -+ } - // Paper end - @Override - public boolean equals(Object obj) { --- -2.20.1 - diff --git a/Spigot-API-Patches/0111-PlayerReadyArrowEvent.patch b/Spigot-API-Patches/0110-PlayerReadyArrowEvent.patch similarity index 89% rename from Spigot-API-Patches/0111-PlayerReadyArrowEvent.patch rename to Spigot-API-Patches/0110-PlayerReadyArrowEvent.patch index c3e71a4d62..660209ad8b 100644 --- a/Spigot-API-Patches/0111-PlayerReadyArrowEvent.patch +++ b/Spigot-API-Patches/0110-PlayerReadyArrowEvent.patch @@ -1,4 +1,4 @@ -From ce2602fa36527a7d0883ddbbdded16c95f41b919 Mon Sep 17 00:00:00 2001 +From 7d9404735f62f21ff8abdfd04ff311e83f8f4450 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 18 Jun 2018 01:09:27 -0400 Subject: [PATCH] PlayerReadyArrowEvent @@ -8,10 +8,10 @@ Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java new file mode 100644 -index 00000000..6fde1e97 +index 000000000..5d04a22fd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java -@@ -0,0 +1,88 @@ +@@ -0,0 +1,93 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + * @@ -43,15 +43,16 @@ index 00000000..6fde1e97 +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a player is firing a bow and the server is choosing an arrow to use. + */ +public class PlayerReadyArrowEvent extends PlayerEvent implements Cancellable { -+ private final ItemStack bow; -+ private final ItemStack arrow; ++ @NotNull private final ItemStack bow; ++ @NotNull private final ItemStack arrow; + -+ public PlayerReadyArrowEvent(Player player, ItemStack bow, ItemStack arrow) { ++ public PlayerReadyArrowEvent(@NotNull Player player, @NotNull ItemStack bow, @NotNull ItemStack arrow) { + super(player); + this.bow = bow; + this.arrow = arrow; @@ -60,6 +61,7 @@ index 00000000..6fde1e97 + /** + * @return the player is using to fire the arrow + */ ++ @NotNull + public ItemStack getBow() { + return bow; + } @@ -67,16 +69,19 @@ index 00000000..6fde1e97 + /** + * @return the arrow that is attempting to be used + */ ++ @NotNull + public ItemStack getArrow() { + return arrow; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -101,5 +106,5 @@ index 00000000..6fde1e97 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0112-Add-EntityKnockbackByEntityEvent.patch b/Spigot-API-Patches/0111-Add-EntityKnockbackByEntityEvent.patch similarity index 82% rename from Spigot-API-Patches/0112-Add-EntityKnockbackByEntityEvent.patch rename to Spigot-API-Patches/0111-Add-EntityKnockbackByEntityEvent.patch index fe96ba8e09..0f95130b3c 100644 --- a/Spigot-API-Patches/0112-Add-EntityKnockbackByEntityEvent.patch +++ b/Spigot-API-Patches/0111-Add-EntityKnockbackByEntityEvent.patch @@ -1,4 +1,4 @@ -From 5694eae25981fb9647ef73f3945e828166bd2ebf Mon Sep 17 00:00:00 2001 +From acf227fce14d905b08ae26e7dc84a1b5b1d058ce Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Mon, 18 Jun 2018 15:40:39 +0200 Subject: [PATCH] Add EntityKnockbackByEntityEvent @@ -6,10 +6,10 @@ Subject: [PATCH] Add EntityKnockbackByEntityEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java new file mode 100644 -index 00000000..f6ef1162 +index 000000000..9efecabab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java -@@ -0,0 +1,76 @@ +@@ -0,0 +1,82 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Entity; @@ -18,6 +18,7 @@ index 00000000..f6ef1162 +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; +import org.bukkit.util.Vector; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an Entity is knocked back by the hit of another Entity. The acceleration @@ -27,22 +28,24 @@ index 00000000..f6ef1162 +public class EntityKnockbackByEntityEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + -+ private final Entity hitBy; ++ @NotNull private final Entity hitBy; + private final float knockbackStrength; -+ private final Vector acceleration; ++ @NotNull private final Vector acceleration; + private boolean cancelled = false; + -+ public EntityKnockbackByEntityEvent(LivingEntity entity, Entity hitBy, float knockbackStrength, Vector acceleration) { ++ public EntityKnockbackByEntityEvent(@NotNull LivingEntity entity, @NotNull Entity hitBy, float knockbackStrength, @NotNull Vector acceleration) { + super(entity); + this.hitBy = hitBy; + this.knockbackStrength = knockbackStrength; + this.acceleration = acceleration; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -60,6 +63,7 @@ index 00000000..f6ef1162 + /** + * @return the entity which was knocked back + */ ++ @NotNull + @Override + public LivingEntity getEntity() { + return (LivingEntity) super.getEntity(); @@ -75,6 +79,7 @@ index 00000000..f6ef1162 + /** + * @return the Entity which hit + */ ++ @NotNull + public Entity getHitBy() { + return hitBy; + } @@ -82,10 +87,11 @@ index 00000000..f6ef1162 + /** + * @return the acceleration that will be applied + */ ++ @NotNull + public Vector getAcceleration() { + return acceleration; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0113-Expand-Explosions-API.patch b/Spigot-API-Patches/0112-Expand-Explosions-API.patch similarity index 80% rename from Spigot-API-Patches/0113-Expand-Explosions-API.patch rename to Spigot-API-Patches/0112-Expand-Explosions-API.patch index 0f7e576d31..1cb604344d 100644 --- a/Spigot-API-Patches/0113-Expand-Explosions-API.patch +++ b/Spigot-API-Patches/0112-Expand-Explosions-API.patch @@ -1,4 +1,4 @@ -From 91842d1f8cb8b4cb87f7c9c21a1b69445fd4178a Mon Sep 17 00:00:00 2001 +From 131511b623888266c1f263c0a85cd91ab890dff9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 19 Dec 2017 16:24:42 -0500 Subject: [PATCH] Expand Explosions API @@ -6,12 +6,20 @@ 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/Location.java b/src/main/java/org/bukkit/Location.java -index 162a76e8..056a4d6b 100644 +index 3387fb477..56be7e5fa 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -745,6 +745,87 @@ public class Location implements Cloneable, ConfigurationSerializable { - } - return world.getNearbyEntitiesByType(clazz, this, xRadius, yRadius, zRadius, predicate); +@@ -5,6 +5,7 @@ import java.util.Map; + + import org.bukkit.block.Block; + import org.bukkit.configuration.serialization.ConfigurationSerializable; ++import org.bukkit.entity.Entity; // Paper + import org.bukkit.util.NumberConversions; + import org.bukkit.util.Vector; + import org.jetbrains.annotations.NotNull; +@@ -531,6 +532,87 @@ public class Location implements Cloneable, ConfigurationSerializable { + centerLoc.setZ(getBlockZ() + 0.5); + return centerLoc; } + + /** @@ -62,7 +70,7 @@ index 162a76e8..056a4d6b 100644 + * @param power The power of explosion, where 4F is TNT + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, float power) { ++ public boolean createExplosion(@Nullable Entity source, float power) { + return world.createExplosion(source, this, power, true, true); + } + @@ -77,7 +85,7 @@ index 162a76e8..056a4d6b 100644 + * @param setFire Whether or not to set blocks on fire + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, float power, boolean setFire) { ++ public boolean createExplosion(@Nullable Entity source, float power, boolean setFire) { + return world.createExplosion(source, this, power, setFire, true); + } + @@ -91,19 +99,19 @@ index 162a76e8..056a4d6b 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, float power, boolean setFire, boolean breakBlocks) { ++ public boolean createExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) { + return world.createExplosion(source, source.getLocation(), power, setFire, breakBlocks); + } // Paper end @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 6b7eeeac..c73b7065 100644 +index bec405feb..dcc47cde5 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1151,6 +1151,102 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1210,6 +1210,102 @@ public interface World extends PluginMessageRecipient, Metadatable { */ - public boolean createExplosion(Location loc, float power, boolean setFire); + public boolean createExplosion(@NotNull Location loc, float power, boolean setFire); + // Paper start + /** @@ -117,7 +125,7 @@ index 6b7eeeac..c73b7065 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public boolean createExplosion(Entity source, Location loc, float power, boolean setFire, boolean breakBlocks); ++ public boolean createExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire, boolean breakBlocks); + + /** + * Creates explosion at given location with given power and optionally @@ -131,7 +139,7 @@ index 6b7eeeac..c73b7065 100644 + * @param setFire Whether or not to set blocks on fire + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, Location loc, float power, boolean setFire) { ++ public default boolean createExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire) { + return createExplosion(source, loc, power, setFire, true); + } + /** @@ -143,7 +151,7 @@ index 6b7eeeac..c73b7065 100644 + * @param power The power of explosion, where 4F is TNT + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, Location loc, float power) { ++ public default boolean createExplosion(@Nullable Entity source, @NotNull Location loc, float power) { + return createExplosion(source, loc, power, true, true); + } + /** @@ -156,7 +164,7 @@ index 6b7eeeac..c73b7065 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, float power, boolean setFire, boolean breakBlocks) { ++ public default boolean createExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) { + return createExplosion(source, source.getLocation(), power, setFire, breakBlocks); + } + /** @@ -170,7 +178,7 @@ index 6b7eeeac..c73b7065 100644 + * @param setFire Whether or not to set blocks on fire + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, float power, boolean setFire) { ++ public default boolean createExplosion(@NotNull Entity source, float power, boolean setFire) { + return createExplosion(source, source.getLocation(), power, setFire, true); + } + @@ -182,7 +190,7 @@ index 6b7eeeac..c73b7065 100644 + * @param power The power of explosion, where 4F is TNT + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Entity source, float power) { ++ public default boolean createExplosion(@NotNull Entity source, float power) { + return createExplosion(source, source.getLocation(), power, true, true); + } + @@ -196,7 +204,7 @@ index 6b7eeeac..c73b7065 100644 + * @param breakBlocks Whether or not to have blocks be destroyed + * @return false if explosion was canceled, otherwise true + */ -+ public default boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) { ++ public default boolean createExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks) { + return createExplosion(loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks); + } + // Paper end @@ -205,5 +213,5 @@ index 6b7eeeac..c73b7065 100644 * Gets the {@link Environment} type of this world * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0114-ItemStack-API-additions-for-quantity-flags-lore.patch b/Spigot-API-Patches/0113-ItemStack-API-additions-for-quantity-flags-lore.patch similarity index 87% rename from Spigot-API-Patches/0114-ItemStack-API-additions-for-quantity-flags-lore.patch rename to Spigot-API-Patches/0113-ItemStack-API-additions-for-quantity-flags-lore.patch index f90ce4c312..0c671c0f4f 100644 --- a/Spigot-API-Patches/0114-ItemStack-API-additions-for-quantity-flags-lore.patch +++ b/Spigot-API-Patches/0113-ItemStack-API-additions-for-quantity-flags-lore.patch @@ -1,11 +1,11 @@ -From 2cfbdc81fc68ad266dd94d3b9a2c1e6bfd0f64ab Mon Sep 17 00:00:00 2001 +From 639b480d0adabe542928fc67eb429075a4165e3d Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 22 Jun 2018 22:59:18 -0400 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 26ab1278..fb47fc29 100644 +index 1c7bbbcef..845a9255d 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -2,7 +2,9 @@ package org.bukkit.inventory; @@ -18,16 +18,7 @@ index 26ab1278..fb47fc29 100644 import org.apache.commons.lang.Validate; import org.bukkit.Bukkit; -@@ -14,6 +16,8 @@ import org.bukkit.inventory.meta.Damageable; - import org.bukkit.inventory.meta.ItemMeta; - import org.bukkit.material.MaterialData; - -+import javax.annotation.Nullable; -+ - /** - * Represents a stack of items - */ -@@ -601,5 +605,133 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { +@@ -615,5 +617,140 @@ public class ItemStack implements Cloneable, ConfigurationSerializable { // Requires access to NMS return ensureServerConversions().getMaxItemUseDuration(); } @@ -36,6 +27,7 @@ index 26ab1278..fb47fc29 100644 + * Clones the itemstack and returns it a single quantity. + * @return The new itemstack with 1 quantity + */ ++ @NotNull + public ItemStack asOne() { + return asQuantity(1); + } @@ -45,6 +37,7 @@ index 26ab1278..fb47fc29 100644 + * @param qty The quantity of the cloned item + * @return The new itemstack with specified quantity + */ ++ @NotNull + public ItemStack asQuantity(int qty) { + ItemStack clone = clone(); + clone.setAmount(qty); @@ -55,6 +48,7 @@ index 26ab1278..fb47fc29 100644 + * Adds 1 to this itemstack. Will not go over the items max stack size. + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack add() { + return add(1); + } @@ -65,6 +59,7 @@ index 26ab1278..fb47fc29 100644 + * @param qty The amount to add + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack add(int qty) { + setAmount(Math.min(getMaxStackSize(), getAmount() + qty)); + return this; @@ -74,6 +69,7 @@ index 26ab1278..fb47fc29 100644 + * Subtracts 1 to this itemstack. Going to 0 or less will invalidate the item. + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack subtract() { + return subtract(1); + } @@ -84,6 +80,7 @@ index 26ab1278..fb47fc29 100644 + * @param qty The amount to add + * @return The same item (not a clone) + */ ++ @NotNull + public ItemStack subtract(int qty) { + setAmount(Math.max(0, getAmount() - qty)); + return this; @@ -111,7 +108,7 @@ index 26ab1278..fb47fc29 100644 + * + * @param lore the lore that will be set + */ -+ public void setLore(List lore) { ++ public void setLore(@Nullable List lore) { + ItemMeta itemMeta = getItemMeta(); + itemMeta.setLore(lore); + setItemMeta(itemMeta); @@ -122,7 +119,7 @@ index 26ab1278..fb47fc29 100644 + * + * @param itemFlags The hideflags which shouldn't be rendered + */ -+ public void addItemFlags(ItemFlag... itemFlags) { ++ public void addItemFlags(@NotNull ItemFlag... itemFlags) { + ItemMeta itemMeta = getItemMeta(); + itemMeta.addItemFlags(itemFlags); + setItemMeta(itemMeta); @@ -133,7 +130,7 @@ index 26ab1278..fb47fc29 100644 + * + * @param itemFlags Hideflags which should be removed + */ -+ public void removeItemFlags(ItemFlag... itemFlags) { ++ public void removeItemFlags(@NotNull ItemFlag... itemFlags) { + ItemMeta itemMeta = getItemMeta(); + itemMeta.removeItemFlags(itemFlags); + setItemMeta(itemMeta); @@ -144,6 +141,7 @@ index 26ab1278..fb47fc29 100644 + * + * @return A set of all itemFlags set + */ ++ @NotNull + public Set getItemFlags() { + ItemMeta itemMeta = getItemMeta(); + return itemMeta.getItemFlags(); @@ -155,12 +153,12 @@ index 26ab1278..fb47fc29 100644 + * @param flag the flag to check + * @return if it is present + */ -+ public boolean hasItemFlag(ItemFlag flag) { ++ public boolean hasItemFlag(@NotNull ItemFlag flag) { + ItemMeta itemMeta = getItemMeta(); + return itemMeta.hasItemFlag(flag); + } // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0115-LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-API-Patches/0114-LivingEntity-Hand-Raised-Item-Use-API.patch similarity index 90% rename from Spigot-API-Patches/0115-LivingEntity-Hand-Raised-Item-Use-API.patch rename to Spigot-API-Patches/0114-LivingEntity-Hand-Raised-Item-Use-API.patch index 3ecfb33a2d..8ad2f7303a 100644 --- a/Spigot-API-Patches/0115-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-API-Patches/0114-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -1,4 +1,4 @@ -From 9f8e94485f7c514cdc6f021b10bc011277a61d8b Mon Sep 17 00:00:00 2001 +From 73b751f99086d330a0ae7ee23ef86bc7285ce418 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 29 Jun 2018 00:19:19 -0400 Subject: [PATCH] LivingEntity Hand Raised/Item Use API @@ -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/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index 99845e67..e3bc04e1 100644 +index 2fc507052..863d727d0 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java @@ -11,6 +11,7 @@ import org.bukkit.World; @@ -17,7 +17,7 @@ index 99845e67..e3bc04e1 100644 import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.projectiles.ProjectileSource; -@@ -492,5 +493,31 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -505,5 +506,32 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource * @param delay Delay in ticks */ void setShieldBlockingDelay(int delay); @@ -26,6 +26,7 @@ index 99845e67..e3bc04e1 100644 + * Get's the item being actively "used" or consumed. + * @return The item. Will be null if no active item. + */ ++ @Nullable + ItemStack getActiveItem(); + + /** @@ -50,5 +51,5 @@ index 99845e67..e3bc04e1 100644 // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0116-RangedEntity-API.patch b/Spigot-API-Patches/0115-RangedEntity-API.patch similarity index 87% rename from Spigot-API-Patches/0116-RangedEntity-API.patch rename to Spigot-API-Patches/0115-RangedEntity-API.patch index d3ebcab95e..bff91dbdd2 100644 --- a/Spigot-API-Patches/0116-RangedEntity-API.patch +++ b/Spigot-API-Patches/0115-RangedEntity-API.patch @@ -1,4 +1,4 @@ -From bb58ce96ecf6200b0b7be48e8bd89eb6371dd297 Mon Sep 17 00:00:00 2001 +From 1714ba00b49694e8134e075d1efcc2258213de83 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 26 Jun 2018 21:34:40 -0400 Subject: [PATCH] RangedEntity API @@ -8,14 +8,15 @@ 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 00000000..8234de28 +index 000000000..f2e3233a3 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +package com.destroystokyo.paper.entity; + +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mob; ++import org.jetbrains.annotations.NotNull; + +public interface RangedEntity extends Mob { + /** @@ -25,7 +26,7 @@ index 00000000..8234de28 + * @param charge How "charged" the attack is (how far back the bow was pulled for Bow attacks). + * This should be a value between 0 and 1, represented as targetDistance/maxDistance. + */ -+ void rangedAttack(LivingEntity target, float charge); ++ void rangedAttack(@NotNull LivingEntity target, float charge); + + /** + * Sets that the Entity is "charging" up an attack, by raising its hands @@ -43,7 +44,7 @@ index 00000000..8234de28 + } +} diff --git a/src/main/java/org/bukkit/entity/Illusioner.java b/src/main/java/org/bukkit/entity/Illusioner.java -index 7c92c431..14e6c5ee 100644 +index 7c92c431b..14e6c5ee0 100644 --- a/src/main/java/org/bukkit/entity/Illusioner.java +++ b/src/main/java/org/bukkit/entity/Illusioner.java @@ -1,6 +1,10 @@ @@ -59,14 +60,15 @@ index 7c92c431..14e6c5ee 100644 + +} diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java -index 9422d56c..92c30ed5 100644 +index c43854298..d23226ccb 100644 --- a/src/main/java/org/bukkit/entity/Llama.java +++ b/src/main/java/org/bukkit/entity/Llama.java -@@ -1,11 +1,12 @@ +@@ -1,12 +1,13 @@ package org.bukkit.entity; +import com.destroystokyo.paper.entity.RangedEntity; import org.bukkit.inventory.LlamaInventory; + import org.jetbrains.annotations.NotNull; /** * Represents a Llama. @@ -77,14 +79,15 @@ index 9422d56c..92c30ed5 100644 /** * Represents the base color that the llama has. diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java -index e33d00b3..40157bef 100644 +index 2ac30c0f6..d42a4e12c 100644 --- a/src/main/java/org/bukkit/entity/Skeleton.java +++ b/src/main/java/org/bukkit/entity/Skeleton.java -@@ -1,9 +1,11 @@ - package org.bukkit.entity; +@@ -2,11 +2,12 @@ package org.bukkit.entity; + import org.jetbrains.annotations.Contract; + import org.jetbrains.annotations.NotNull; +import com.destroystokyo.paper.entity.RangedEntity; -+ + /** * Represents a Skeleton. */ @@ -94,7 +97,7 @@ index e33d00b3..40157bef 100644 /** * Gets the current type of this skeleton. diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java -index 818efe2a..10f8f6d4 100644 +index 818efe2a4..10f8f6d45 100644 --- a/src/main/java/org/bukkit/entity/Snowman.java +++ b/src/main/java/org/bukkit/entity/Snowman.java @@ -1,9 +1,11 @@ @@ -111,7 +114,7 @@ index 818efe2a..10f8f6d4 100644 /** * Gets whether this snowman is in "derp mode", meaning it is not wearing a diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java -index 9c5dc1f9..4b27f689 100644 +index 9c5dc1f97..4b27f6890 100644 --- a/src/main/java/org/bukkit/entity/Witch.java +++ b/src/main/java/org/bukkit/entity/Witch.java @@ -1,7 +1,9 @@ @@ -126,7 +129,7 @@ index 9c5dc1f9..4b27f689 100644 +public interface Witch extends Monster, RangedEntity { // Paper } diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java -index 3bc332ee..426d3693 100644 +index 3bc332ee7..426d36933 100644 --- a/src/main/java/org/bukkit/entity/Wither.java +++ b/src/main/java/org/bukkit/entity/Wither.java @@ -1,7 +1,9 @@ @@ -141,5 +144,5 @@ index 3bc332ee..426d3693 100644 +public interface Wither extends Monster, Boss, RangedEntity { // Paper } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0117-Add-World.getEntity-UUID-API.patch b/Spigot-API-Patches/0116-Add-World.getEntity-UUID-API.patch similarity index 65% rename from Spigot-API-Patches/0117-Add-World.getEntity-UUID-API.patch rename to Spigot-API-Patches/0116-Add-World.getEntity-UUID-API.patch index ce9c3d9bb2..388355a6ff 100644 --- a/Spigot-API-Patches/0117-Add-World.getEntity-UUID-API.patch +++ b/Spigot-API-Patches/0116-Add-World.getEntity-UUID-API.patch @@ -1,16 +1,16 @@ -From 0ca84ee15c94cc1a2849f7c9476c58c127283221 Mon Sep 17 00:00:00 2001 +From 19a954d1f19d9c3d5211d42c13b11991e61f5359 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 3 Jul 2018 16:07:16 +0200 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 c73b7065..e424ed4e 100644 +index dcc47cde5..5ccd8500d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -741,6 +741,16 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Collection getNearbyEntities(Location location, double x, double y, double z); +@@ -785,6 +785,17 @@ public interface World extends PluginMessageRecipient, Metadatable { + @NotNull + public Collection getNearbyEntities(@NotNull Location location, double x, double y, double z); + // Paper start - getEntity by UUID API + /** @@ -19,12 +19,13 @@ index c73b7065..e424ed4e 100644 + * @param uuid the UUID of the entity + * @return the entity with the given UUID, or null if it isn't found + */ -+ public Entity getEntity(UUID uuid); ++ @Nullable ++ public Entity getEntity(@NotNull UUID uuid); + // Paper end + /** * Returns a list of entities within a bounding box centered around a * Location. -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0118-InventoryCloseEvent-Reason-API.patch b/Spigot-API-Patches/0117-InventoryCloseEvent-Reason-API.patch similarity index 80% rename from Spigot-API-Patches/0118-InventoryCloseEvent-Reason-API.patch rename to Spigot-API-Patches/0117-InventoryCloseEvent-Reason-API.patch index 31aa47305a..b51eeff739 100644 --- a/Spigot-API-Patches/0118-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-API-Patches/0117-InventoryCloseEvent-Reason-API.patch @@ -1,4 +1,4 @@ -From a71408a2ea0e5a1f5e3bc4ce3349f498b0aa78d2 Mon Sep 17 00:00:00 2001 +From 67edac3ee5ed7a4ccc201a7fa1ce0380146edc36 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 3 Jul 2018 21:52:52 -0400 Subject: [PATCH] InventoryCloseEvent Reason API @@ -7,10 +7,10 @@ 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/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index b5ed8447..74f5588e 100644 +index 04f0e08fd..a372c74b8 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -138,6 +138,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -152,6 +152,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ public void closeInventory(); @@ -20,22 +20,23 @@ index b5ed8447..74f5588e 100644 + * + * @param reason why the inventory is closing + */ -+ public void closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason); ++ public void closeInventory(@NotNull org.bukkit.event.inventory.InventoryCloseEvent.Reason reason); + // Paper end + /** * Returns the ItemStack currently in your hand, can be empty. * diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java -index 19889b27..e6e45b93 100644 +index 5861247c1..21ad8888c 100644 --- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java -@@ -11,8 +11,58 @@ import org.bukkit.inventory.InventoryView; +@@ -11,9 +11,60 @@ import org.jetbrains.annotations.NotNull; + */ public class InventoryCloseEvent extends InventoryEvent { private static final HandlerList handlers = new HandlerList(); - + // Paper start + private final Reason reason; ++ @NotNull + public Reason getReason() { + return reason; + } @@ -78,11 +79,12 @@ index 19889b27..e6e45b93 100644 + */ + PLUGIN, + } - public InventoryCloseEvent(InventoryView transaction) { + + public InventoryCloseEvent(@NotNull InventoryView transaction) { + this(transaction, Reason.UNKNOWN); + } + -+ public InventoryCloseEvent(InventoryView transaction, Reason reason) { ++ public InventoryCloseEvent(@NotNull InventoryView transaction, @NotNull Reason reason) { super(transaction); + this.reason = reason; + // Paper end @@ -90,5 +92,5 @@ index 19889b27..e6e45b93 100644 /** -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0119-Entity-getChunk-API.patch b/Spigot-API-Patches/0118-Entity-getChunk-API.patch similarity index 79% rename from Spigot-API-Patches/0119-Entity-getChunk-API.patch rename to Spigot-API-Patches/0118-Entity-getChunk-API.patch index d28cd1866d..2ba5aeef82 100644 --- a/Spigot-API-Patches/0119-Entity-getChunk-API.patch +++ b/Spigot-API-Patches/0118-Entity-getChunk-API.patch @@ -1,4 +1,4 @@ -From 088a1cede4417ff631ad5eb16be9b5a51b552520 Mon Sep 17 00:00:00 2001 +From d25016411d092dd36d7e807178a41c8234563559 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 4 Jul 2018 02:25:48 -0400 Subject: [PATCH] Entity#getChunk API @@ -6,17 +6,18 @@ 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 13de2d74..2dd7a03c 100644 +index 373204d37..a7f81d17d 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -1,5 +1,6 @@ +@@ -1,5 +1,7 @@ package org.bukkit.entity; +import org.bukkit.Chunk; - import org.bukkit.Location; ++import org.bukkit.Location; import org.bukkit.EntityEffect; + import org.bukkit.Location; import org.bukkit.Nameable; -@@ -576,5 +577,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable { +@@ -598,5 +600,13 @@ public interface Entity extends Metadatable, CommandSender, Nameable { * @return True if entity spawned from a mob spawner */ boolean fromMobSpawner(); @@ -26,9 +27,10 @@ index 13de2d74..2dd7a03c 100644 + * + * @return The current, or most recent chunk if the entity is invalid (which may load the chunk) + */ ++ @NotNull + Chunk getChunk(); // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0121-Add-an-asterisk-to-legacy-API-plugins.patch b/Spigot-API-Patches/0119-Add-an-asterisk-to-legacy-API-plugins.patch similarity index 90% rename from Spigot-API-Patches/0121-Add-an-asterisk-to-legacy-API-plugins.patch rename to Spigot-API-Patches/0119-Add-an-asterisk-to-legacy-API-plugins.patch index f35fbeaedd..9adc7aea1f 100644 --- a/Spigot-API-Patches/0121-Add-an-asterisk-to-legacy-API-plugins.patch +++ b/Spigot-API-Patches/0119-Add-an-asterisk-to-legacy-API-plugins.patch @@ -1,4 +1,4 @@ -From 6230eaa152107e64e9b93acba461412d68f368a6 Mon Sep 17 00:00:00 2001 +From 839637a0c0acddcbe5b6089b22ca43c304297616 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 19 Jul 2018 15:07:02 -0500 Subject: [PATCH] Add an asterisk to legacy API plugins @@ -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 a4aabfe7..f462b631 100644 +index a4aabfe7f..f462b631b 100644 --- a/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java @@ -67,4 +67,10 @@ public interface UnsafeValues { @@ -22,10 +22,10 @@ index a4aabfe7..f462b631 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 d4e74d292..6cfd9f3c6 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -@@ -38,7 +38,14 @@ public class PluginsCommand extends BukkitCommand { +@@ -41,7 +41,14 @@ public class PluginsCommand extends BukkitCommand { TreeMap plugins = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { @@ -42,10 +42,10 @@ 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 c7782e7d..39f92d88 100644 +index 095448fe7..e91cb2c78 100644 --- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java -@@ -304,7 +304,14 @@ public final class JavaPluginLoader implements PluginLoader { +@@ -312,7 +312,14 @@ public final class JavaPluginLoader implements PluginLoader { Validate.isTrue(plugin instanceof JavaPlugin, "Plugin is not associated with this PluginLoader"); if (!plugin.isEnabled()) { @@ -62,5 +62,5 @@ index c7782e7d..39f92d88 100644 JavaPlugin jPlugin = (JavaPlugin) plugin; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0122-EnderDragon-Events.patch b/Spigot-API-Patches/0120-EnderDragon-Events.patch similarity index 81% rename from Spigot-API-Patches/0122-EnderDragon-Events.patch rename to Spigot-API-Patches/0120-EnderDragon-Events.patch index 7d9283e01d..701a6d6496 100644 --- a/Spigot-API-Patches/0122-EnderDragon-Events.patch +++ b/Spigot-API-Patches/0120-EnderDragon-Events.patch @@ -1,4 +1,4 @@ -From fb308e1a72dc6e3c0f8c492467f29201a85e0a91 Mon Sep 17 00:00:00 2001 +From 3277130260cb38dff43dc2bd7729a7853200b224 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 01:51:05 -0500 Subject: [PATCH] EnderDragon Events @@ -6,10 +6,10 @@ Subject: [PATCH] EnderDragon Events diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java new file mode 100644 -index 00000000..ef2a8dab +index 000000000..118c7b677 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java -@@ -0,0 +1,72 @@ +@@ -0,0 +1,79 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.AreaEffectCloud; @@ -20,15 +20,17 @@ index 00000000..ef2a8dab +import org.bukkit.event.entity.EntityEvent; + +import java.util.Collection; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Fired when a DragonFireball collides with a block/entity and spawns an AreaEffectCloud + */ +public class EnderDragonFireballHitEvent extends EntityEvent implements Cancellable { -+ private final Collection targets; -+ private final AreaEffectCloud areaEffectCloud; ++ @Nullable private final Collection targets; ++ @NotNull private final AreaEffectCloud areaEffectCloud; + -+ public EnderDragonFireballHitEvent(DragonFireball fireball, Collection targets, AreaEffectCloud areaEffectCloud) { ++ public EnderDragonFireballHitEvent(@NotNull DragonFireball fireball, @Nullable Collection targets, @NotNull AreaEffectCloud areaEffectCloud) { + super(fireball); + this.targets = targets; + this.areaEffectCloud = areaEffectCloud; @@ -37,6 +39,7 @@ index 00000000..ef2a8dab + /** + * The fireball involved in this event + */ ++ @NotNull + @Override + public DragonFireball getEntity() { + return (DragonFireball) super.getEntity(); @@ -49,6 +52,7 @@ index 00000000..ef2a8dab + * + * @return the targets + */ ++ @Nullable + public Collection getTargets() { + return targets; + } @@ -56,16 +60,19 @@ index 00000000..ef2a8dab + /** + * @return The area effect cloud spawned in this collision + */ ++ @NotNull + public AreaEffectCloud getAreaEffectCloud() { + return areaEffectCloud; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -84,10 +91,10 @@ index 00000000..ef2a8dab +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java new file mode 100644 -index 00000000..d8c3ab33 +index 000000000..1915177f4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFlameEvent.java -@@ -0,0 +1,56 @@ +@@ -0,0 +1,61 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.AreaEffectCloud; @@ -95,14 +102,15 @@ index 00000000..d8c3ab33 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an EnderDragon spawns an AreaEffectCloud by shooting flames + */ +public class EnderDragonFlameEvent extends EntityEvent implements Cancellable { -+ private final AreaEffectCloud areaEffectCloud; ++ @NotNull private final AreaEffectCloud areaEffectCloud; + -+ public EnderDragonFlameEvent(EnderDragon enderDragon, AreaEffectCloud areaEffectCloud) { ++ public EnderDragonFlameEvent(@NotNull EnderDragon enderDragon, @NotNull AreaEffectCloud areaEffectCloud) { + super(enderDragon); + this.areaEffectCloud = areaEffectCloud; + } @@ -110,6 +118,7 @@ index 00000000..d8c3ab33 + /** + * The enderdragon involved in this event + */ ++ @NotNull + @Override + public EnderDragon getEntity() { + return (EnderDragon) super.getEntity(); @@ -118,16 +127,19 @@ index 00000000..d8c3ab33 + /** + * @return The area effect cloud spawned in this collision + */ ++ @NotNull + public AreaEffectCloud getAreaEffectCloud() { + return areaEffectCloud; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -146,10 +158,10 @@ index 00000000..d8c3ab33 +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonShootFireballEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonShootFireballEvent.java new file mode 100644 -index 00000000..aa70dda1 +index 000000000..8414bd805 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonShootFireballEvent.java -@@ -0,0 +1,56 @@ +@@ -0,0 +1,61 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.DragonFireball; @@ -157,14 +169,15 @@ index 00000000..aa70dda1 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when an EnderDragon shoots a fireball + */ +public class EnderDragonShootFireballEvent extends EntityEvent implements Cancellable { -+ private final DragonFireball fireball; ++ @NotNull private final DragonFireball fireball; + -+ public EnderDragonShootFireballEvent(EnderDragon entity, DragonFireball fireball) { ++ public EnderDragonShootFireballEvent(@NotNull EnderDragon entity, @NotNull DragonFireball fireball) { + super(entity); + this.fireball = fireball; + } @@ -172,6 +185,7 @@ index 00000000..aa70dda1 + /** + * The enderdragon shooting the fireball + */ ++ @NotNull + @Override + public EnderDragon getEntity() { + return (EnderDragon) super.getEntity(); @@ -180,16 +194,19 @@ index 00000000..aa70dda1 + /** + * @return The fireball being shot + */ ++ @NotNull + public DragonFireball getFireball() { + return fireball; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -207,5 +224,5 @@ index 00000000..aa70dda1 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0120-Vex-getSummoner-API.patch b/Spigot-API-Patches/0120-Vex-getSummoner-API.patch deleted file mode 100644 index 06d8b5b8a7..0000000000 --- a/Spigot-API-Patches/0120-Vex-getSummoner-API.patch +++ /dev/null @@ -1,24 +0,0 @@ -From ed4de91ce14776b268c13b40d31e75e477fb96c5 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Wed, 4 Jul 2018 15:29:21 -0400 -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 6b61c4ab..7b9b21e5 100644 ---- a/src/main/java/org/bukkit/entity/Vex.java -+++ b/src/main/java/org/bukkit/entity/Vex.java -@@ -22,4 +22,9 @@ public interface Vex extends Monster { - * @param charging new state - */ - void setCharging(boolean charging); -+ -+ /** -+ * @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex -+ */ -+ Mob getSummoner(); // Paper - } --- -2.21.0 - diff --git a/Spigot-API-Patches/0123-PlayerLaunchProjectileEvent.patch b/Spigot-API-Patches/0121-PlayerLaunchProjectileEvent.patch similarity index 83% rename from Spigot-API-Patches/0123-PlayerLaunchProjectileEvent.patch rename to Spigot-API-Patches/0121-PlayerLaunchProjectileEvent.patch index 51bd51a191..35855aada1 100644 --- a/Spigot-API-Patches/0123-PlayerLaunchProjectileEvent.patch +++ b/Spigot-API-Patches/0121-PlayerLaunchProjectileEvent.patch @@ -1,4 +1,4 @@ -From bf0b9b976aa75c1a7005cf174094d9ca47bc606e Mon Sep 17 00:00:00 2001 +From 41a26a4f7bcee9d007e63faf6b8eddcea3ddb64d Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 03:10:50 -0500 Subject: [PATCH] PlayerLaunchProjectileEvent @@ -6,10 +6,10 @@ 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..9074b2ede --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLaunchProjectileEvent.java -@@ -0,0 +1,78 @@ +@@ -0,0 +1,83 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Player; @@ -18,18 +18,19 @@ index 00000000..d2b244a4 +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a player shoots a projectile + */ +public class PlayerLaunchProjectileEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); -+ private final Projectile projectile; -+ private final ItemStack itemStack; ++ @NotNull private final Projectile projectile; ++ @NotNull private final ItemStack itemStack; + private boolean consumeItem = true; + private boolean cancelled; + -+ public PlayerLaunchProjectileEvent(Player shooter, ItemStack itemStack, Projectile projectile) { ++ public PlayerLaunchProjectileEvent(@NotNull Player shooter, @NotNull ItemStack itemStack, @NotNull Projectile projectile) { + super(shooter); + this.itemStack = itemStack; + this.projectile = projectile; @@ -40,6 +41,7 @@ index 00000000..d2b244a4 + * + * @return the launched projectile + */ ++ @NotNull + public Projectile getProjectile() { + return projectile; + } @@ -49,6 +51,7 @@ index 00000000..d2b244a4 + * + * @return The ItemStack used + */ ++ @NotNull + public ItemStack getItemStack() { + return itemStack; + } @@ -79,15 +82,17 @@ index 00000000..d2b244a4 + cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0124-PlayerElytraBoostEvent.patch b/Spigot-API-Patches/0122-PlayerElytraBoostEvent.patch similarity index 84% rename from Spigot-API-Patches/0124-PlayerElytraBoostEvent.patch rename to Spigot-API-Patches/0122-PlayerElytraBoostEvent.patch index 17d389b536..9c7c76c0c0 100644 --- a/Spigot-API-Patches/0124-PlayerElytraBoostEvent.patch +++ b/Spigot-API-Patches/0122-PlayerElytraBoostEvent.patch @@ -1,4 +1,4 @@ -From 94b04d1ac897e5e4791b99fa90c08df37f9c6750 Mon Sep 17 00:00:00 2001 +From 512606bd2ea928ab0c900d85440f8107a17fa26f Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 21 Jul 2018 01:59:53 -0500 Subject: [PATCH] PlayerElytraBoostEvent @@ -6,10 +6,10 @@ 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..e9a76a25f --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java -@@ -0,0 +1,80 @@ +@@ -0,0 +1,85 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Firework; @@ -18,6 +18,7 @@ index 00000000..cecb2182 +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; +import org.bukkit.inventory.ItemStack; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a player boosts elytra flight with a firework @@ -25,11 +26,11 @@ index 00000000..cecb2182 +public class PlayerElytraBoostEvent extends PlayerEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; -+ private final ItemStack itemStack; -+ private Firework firework; ++ @NotNull private final ItemStack itemStack; ++ @NotNull private Firework firework; + private boolean consume = true; + -+ public PlayerElytraBoostEvent(Player player, ItemStack itemStack, Firework firework) { ++ public PlayerElytraBoostEvent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull Firework firework) { + super(player); + this.itemStack = itemStack; + this.firework = firework; @@ -40,6 +41,7 @@ index 00000000..cecb2182 + * + * @return ItemStack of firework + */ ++ @NotNull + public ItemStack getItemStack() { + return itemStack; + } @@ -49,6 +51,7 @@ index 00000000..cecb2182 + * + * @return Firework entity + */ ++ @NotNull + public Firework getFirework() { + return firework; + } @@ -71,11 +74,13 @@ index 00000000..cecb2182 + this.consume = consume; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -91,5 +96,5 @@ index 00000000..cecb2182 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0125-EntityTransformedEvent.patch b/Spigot-API-Patches/0123-EntityTransformedEvent.patch similarity index 96% rename from Spigot-API-Patches/0125-EntityTransformedEvent.patch rename to Spigot-API-Patches/0123-EntityTransformedEvent.patch index 3cca58d095..d1e126daee 100644 --- a/Spigot-API-Patches/0125-EntityTransformedEvent.patch +++ b/Spigot-API-Patches/0123-EntityTransformedEvent.patch @@ -1,4 +1,4 @@ -From 2d0638abd370a00a03addda58ca3b8a329b4add1 Mon Sep 17 00:00:00 2001 +From 5b2eff30f6fc1cf8f9794b1599d1d92eb76928d6 Mon Sep 17 00:00:00 2001 From: Anthony MacAllister Date: Thu, 26 Jul 2018 15:28:53 -0400 Subject: [PATCH] EntityTransformedEvent @@ -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..12194f1f +index 000000000..12194f1fc --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java @@ -0,0 +1,92 @@ @@ -103,5 +103,5 @@ index 00000000..12194f1f + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0126-Allow-disabling-armour-stand-ticking.patch b/Spigot-API-Patches/0124-Allow-disabling-armour-stand-ticking.patch similarity index 85% rename from Spigot-API-Patches/0126-Allow-disabling-armour-stand-ticking.patch rename to Spigot-API-Patches/0124-Allow-disabling-armour-stand-ticking.patch index f31a1e925b..e6b6ed0fb8 100644 --- a/Spigot-API-Patches/0126-Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-API-Patches/0124-Allow-disabling-armour-stand-ticking.patch @@ -1,14 +1,14 @@ -From 77f6eac530bd01aeff4c2c3c1ed93d5fef29a09d Mon Sep 17 00:00:00 2001 +From 0a6c99111a7f7d1073d78c96d66f43c7505ccc83 Mon Sep 17 00:00:00 2001 From: kashike Date: Wed, 15 Aug 2018 01:26:03 -0700 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 387d04e5b..492df420b 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java -@@ -275,5 +275,21 @@ public interface ArmorStand extends LivingEntity { +@@ -288,5 +288,21 @@ public interface ArmorStand extends LivingEntity { * @param move {@code true} if this armour stand can move, {@code false} otherwise */ void setCanMove(boolean move); @@ -31,5 +31,5 @@ index 099da6ce..859f166f 100644 // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0127-SkeletonHorse-Additions.patch b/Spigot-API-Patches/0125-SkeletonHorse-Additions.patch similarity index 87% rename from Spigot-API-Patches/0127-SkeletonHorse-Additions.patch rename to Spigot-API-Patches/0125-SkeletonHorse-Additions.patch index 15c31093f3..9cc45ed3df 100644 --- a/Spigot-API-Patches/0127-SkeletonHorse-Additions.patch +++ b/Spigot-API-Patches/0125-SkeletonHorse-Additions.patch @@ -1,4 +1,4 @@ -From f1362aab9af2f1592ae39f6fefc5805426c13468 Mon Sep 17 00:00:00 2001 +From d430d9a48360b597f8c3ce6acd840c1f3cc04222 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 27 Jul 2018 22:36:17 -0500 Subject: [PATCH] SkeletonHorse Additions @@ -6,16 +6,17 @@ 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..d79dbcd68 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SkeletonHorseTrapEvent.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,47 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.SkeletonHorse; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Event called when a player gets close to a skeleton horse and triggers the lightning trap @@ -24,10 +25,11 @@ index 00000000..55bae018 + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + -+ public SkeletonHorseTrapEvent(SkeletonHorse horse) { ++ public SkeletonHorseTrapEvent(@NotNull SkeletonHorse horse) { + super(horse); + } + ++ @NotNull + @Override + public SkeletonHorse getEntity() { + return (SkeletonHorse) super.getEntity(); @@ -43,18 +45,20 @@ index 00000000..55bae018 + this.cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} + 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 @@ -3,4 +3,12 @@ package org.bukkit.entity; @@ -72,5 +76,5 @@ index b2c6b6a8..ba998346 100644 + // Paper end +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0128-Expand-Location-Manipulation-API.patch b/Spigot-API-Patches/0126-Expand-Location-Manipulation-API.patch similarity index 84% rename from Spigot-API-Patches/0128-Expand-Location-Manipulation-API.patch rename to Spigot-API-Patches/0126-Expand-Location-Manipulation-API.patch index 7f2ca8767e..8cecc91dba 100644 --- a/Spigot-API-Patches/0128-Expand-Location-Manipulation-API.patch +++ b/Spigot-API-Patches/0126-Expand-Location-Manipulation-API.patch @@ -1,4 +1,4 @@ -From c2f3378222678178ed336881bfe3efb4cb3c96f5 Mon Sep 17 00:00:00 2001 +From d21ab857b2c8d97c44dd5cacab462cbb0f1ac3a8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 25 Jul 2018 01:36:07 -0400 Subject: [PATCH] Expand Location Manipulation API @@ -6,10 +6,10 @@ 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 56be7e5fa..d38f15142 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -503,6 +503,51 @@ public class Location implements Cloneable, ConfigurationSerializable { +@@ -510,6 +510,54 @@ public class Location implements Cloneable, ConfigurationSerializable { public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper // Paper start @@ -23,6 +23,7 @@ index 056a4d6b..8dcb15fb 100644 + * @param z Z coordinate + * @return self (not cloned) + */ ++ @NotNull + public Location set(double x, double y, double z) { + this.x = x; + this.y = y; @@ -40,7 +41,8 @@ index 056a4d6b..8dcb15fb 100644 + * @param z Z coordinate to add to base + * @return self (not cloned) + */ -+ public Location add(Location base, double x, double y, double z) { ++ @NotNull ++ public Location add(@NotNull Location base, double x, double y, double z) { + return this.set(base.x + x, base.y + y, base.z + z); + } + @@ -54,7 +56,8 @@ index 056a4d6b..8dcb15fb 100644 + * @param z Z coordinate to subtract from base + * @return self (not cloned) + */ -+ public Location subtract(Location base, double x, double y, double z) { ++ @NotNull ++ public Location subtract(@NotNull Location base, double x, double y, double z) { + return this.set(base.x - x, base.y - y, base.z - z); + } + @@ -62,5 +65,5 @@ index 056a4d6b..8dcb15fb 100644 * @return A new location where X/Y/Z are on the Block location (integer value of X/Y/Z) */ -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0129-Expand-ArmorStand-API.patch b/Spigot-API-Patches/0127-Expand-ArmorStand-API.patch similarity index 78% rename from Spigot-API-Patches/0129-Expand-ArmorStand-API.patch rename to Spigot-API-Patches/0127-Expand-ArmorStand-API.patch index 8d4b85b774..49561539a7 100644 --- a/Spigot-API-Patches/0129-Expand-ArmorStand-API.patch +++ b/Spigot-API-Patches/0127-Expand-ArmorStand-API.patch @@ -1,4 +1,4 @@ -From acbc0064ddd9eda092bc7a8685c70f8dce6d7060 Mon Sep 17 00:00:00 2001 +From 468efde93189317e2ae14ff0990e974b6b733f92 Mon Sep 17 00:00:00 2001 From: willies952002 Date: Thu, 26 Jul 2018 02:22:44 -0400 Subject: [PATCH] Expand ArmorStand API @@ -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 492df420b..e7f71e65e 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java @@ -1,5 +1,6 @@ @@ -17,8 +17,8 @@ index 859f166f..eda4873d 100644 +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import org.bukkit.util.EulerAngle; - -@@ -10,7 +11,12 @@ public interface ArmorStand extends LivingEntity { + import org.jetbrains.annotations.NotNull; +@@ -12,8 +13,13 @@ public interface ArmorStand extends LivingEntity { * currently holding * * @return the held item @@ -27,11 +27,12 @@ index 859f166f..eda4873d 100644 + * @see ArmorStand#getItem(EquipmentSlot) + // Paper end */ + @NotNull + @Deprecated // Paper ItemStack getItemInHand(); /** -@@ -18,7 +24,12 @@ public interface ArmorStand extends LivingEntity { +@@ -21,7 +27,12 @@ public interface ArmorStand extends LivingEntity { * holding * * @param item the item to hold @@ -41,10 +42,10 @@ index 859f166f..eda4873d 100644 + // Paper end */ + @Deprecated // Paper - void setItemInHand(ItemStack item); + void setItemInHand(@Nullable ItemStack item); /** -@@ -291,5 +302,69 @@ public interface ArmorStand extends LivingEntity { +@@ -304,5 +315,71 @@ public interface ArmorStand extends LivingEntity { * @param tick {@code true} if this armour stand can tick, {@code false} otherwise */ void setCanTick(final boolean tick); @@ -56,7 +57,8 @@ index 859f166f..eda4873d 100644 + * @param slot the equipment slot to get + * @return the ItemStack in the equipment slot + */ -+ ItemStack getItem(final org.bukkit.inventory.EquipmentSlot slot); ++ @NotNull ++ ItemStack getItem(@NotNull final org.bukkit.inventory.EquipmentSlot slot); + + /** + * Sets the item the armor stand has @@ -65,13 +67,14 @@ index 859f166f..eda4873d 100644 + * @param slot the equipment slot to set + * @param item the item to hold + */ -+ void setItem(final org.bukkit.inventory.EquipmentSlot slot, final ItemStack item); ++ void setItem(@NotNull final org.bukkit.inventory.EquipmentSlot slot, @Nullable final ItemStack item); + + /** + * Get the list of disabled slots + * + * @return list of disabled slots + */ ++ @NotNull + java.util.Set getDisabledSlots(); + + /** @@ -82,7 +85,7 @@ index 859f166f..eda4873d 100644 + * + * @param slots var-arg array of slots to lock + */ -+ void setDisabledSlots(org.bukkit.inventory.EquipmentSlot... slots); ++ void setDisabledSlots(@NotNull org.bukkit.inventory.EquipmentSlot... slots); + + /** + * Disable specific slots, adding them @@ -93,7 +96,7 @@ index 859f166f..eda4873d 100644 + * + * @param slots var-arg array of slots to lock + */ -+ void addDisabledSlots(final org.bukkit.inventory.EquipmentSlot... slots); ++ void addDisabledSlots(@NotNull final org.bukkit.inventory.EquipmentSlot... slots); + + /** + * Remove the given slots from the disabled @@ -103,7 +106,7 @@ index 859f166f..eda4873d 100644 + * + * @param slots var-arg array of slots to unlock + */ -+ void removeDisabledSlots(final org.bukkit.inventory.EquipmentSlot... slots); ++ void removeDisabledSlots(@NotNull final org.bukkit.inventory.EquipmentSlot... slots); + + /** + * Check if a specific slot is disabled @@ -111,9 +114,9 @@ index 859f166f..eda4873d 100644 + * @param slot The slot to check + * @return {@code true} if the slot is disabled, else {@code false}. + */ -+ boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot); ++ boolean isSlotDisabled(@NotNull org.bukkit.inventory.EquipmentSlot slot); // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0130-AnvilDamageEvent.patch b/Spigot-API-Patches/0128-AnvilDamageEvent.patch similarity index 85% rename from Spigot-API-Patches/0130-AnvilDamageEvent.patch rename to Spigot-API-Patches/0128-AnvilDamageEvent.patch index 9036fdc061..94596282a4 100644 --- a/Spigot-API-Patches/0130-AnvilDamageEvent.patch +++ b/Spigot-API-Patches/0128-AnvilDamageEvent.patch @@ -1,4 +1,4 @@ -From 564a139305b90aeb9052d70be7b8fc49e36408d7 Mon Sep 17 00:00:00 2001 +From 8636d3804c388b59ab54bf2274e1db7c6ae2b578 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 20 Jul 2018 23:36:55 -0500 Subject: [PATCH] AnvilDamageEvent @@ -6,10 +6,10 @@ 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..a83c286c1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java -@@ -0,0 +1,139 @@ +@@ -0,0 +1,148 @@ +package com.destroystokyo.paper.event.block; + +import org.bukkit.Material; @@ -19,6 +19,8 @@ index 00000000..fd3c5c02 +import org.bukkit.event.inventory.InventoryEvent; +import org.bukkit.inventory.AnvilInventory; +import org.bukkit.inventory.InventoryView; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Called when an anvil is damaged from being used @@ -28,11 +30,12 @@ index 00000000..fd3c5c02 + private boolean cancel; + private DamageState damageState; + -+ public AnvilDamagedEvent(InventoryView inventory, BlockData blockData) { ++ public AnvilDamagedEvent(@NotNull InventoryView inventory, @NotNull BlockData blockData) { + super(inventory); + this.damageState = DamageState.getState(blockData); + } + ++ @NotNull + @Override + public AnvilInventory getInventory() { + return (AnvilInventory) super.getInventory(); @@ -43,6 +46,7 @@ index 00000000..fd3c5c02 + * + * @return Damage state + */ ++ @NotNull + public DamageState getDamageState() { + return damageState; + } @@ -52,7 +56,7 @@ index 00000000..fd3c5c02 + * + * @param damageState Damage state + */ -+ public void setDamageState(DamageState damageState) { ++ public void setDamageState(@NotNull DamageState damageState) { + this.damageState = damageState; + } + @@ -86,10 +90,12 @@ index 00000000..fd3c5c02 + this.cancel = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -105,7 +111,7 @@ index 00000000..fd3c5c02 + + private Material material; + -+ DamageState(Material material) { ++ DamageState(@NotNull Material material) { + this.material = material; + } + @@ -114,6 +120,7 @@ index 00000000..fd3c5c02 + * + * @return Material + */ ++ @NotNull + public Material getMaterial() { + return material; + } @@ -125,7 +132,8 @@ index 00000000..fd3c5c02 + * @return DamageState + * @throws IllegalArgumentException If non anvil block data is given + */ -+ public static DamageState getState(BlockData blockData) { ++ @NotNull ++ public static DamageState getState(@Nullable BlockData blockData) { + return blockData == null ? BROKEN : getState(blockData.getMaterial()); + } + @@ -136,7 +144,8 @@ index 00000000..fd3c5c02 + * @return DamageState + * @throws IllegalArgumentException If non anvil material is given + */ -+ public static DamageState getState(Material material) { ++ @NotNull ++ public static DamageState getState(@Nullable Material material) { + if (material == null) { + return BROKEN; + } @@ -150,5 +159,5 @@ index 00000000..fd3c5c02 + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0131-Remove-deadlock-risk-in-firing-async-events.patch b/Spigot-API-Patches/0129-Remove-deadlock-risk-in-firing-async-events.patch similarity index 78% rename from Spigot-API-Patches/0131-Remove-deadlock-risk-in-firing-async-events.patch rename to Spigot-API-Patches/0129-Remove-deadlock-risk-in-firing-async-events.patch index 55c3d71a24..ee460e676b 100644 --- a/Spigot-API-Patches/0131-Remove-deadlock-risk-in-firing-async-events.patch +++ b/Spigot-API-Patches/0129-Remove-deadlock-risk-in-firing-async-events.patch @@ -1,4 +1,4 @@ -From 562bc11c9c2f58733eaad70a3428fcf14e0c8cc5 Mon Sep 17 00:00:00 2001 +From 195b69c9c15d04fa20cddb7bff3f4e1e0e883389 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 9 Sep 2018 00:32:05 -0400 Subject: [PATCH] Remove deadlock risk in firing async events @@ -16,37 +16,37 @@ which results in a hard crash. This change removes the synchronize and adds some protection around enable/disable diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -index d925423d..59c70b8a 100644 +index 7d4ca43b5..9ec042fd7 100644 --- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java +++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java -@@ -386,7 +386,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -392,7 +392,7 @@ public final class SimplePluginManager implements PluginManager { * @param plugin Plugin to check * @return true if the plugin is enabled, otherwise false */ -- public boolean isPluginEnabled(Plugin plugin) { -+ public synchronized boolean isPluginEnabled(Plugin plugin) { // Paper - synchronize +- public boolean isPluginEnabled(@Nullable Plugin plugin) { ++ public synchronized boolean isPluginEnabled(@Nullable Plugin plugin) { // Paper - synchronize if ((plugin != null) && (plugins.contains(plugin))) { return plugin.isEnabled(); } else { -@@ -394,7 +394,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -400,7 +400,7 @@ public final class SimplePluginManager implements PluginManager { } } -- public void enablePlugin(final Plugin plugin) { -+ public synchronized void enablePlugin(final Plugin plugin) { // Paper - synchronize +- public void enablePlugin(@NotNull final Plugin plugin) { ++ public synchronized void enablePlugin(@NotNull final Plugin plugin) { // Paper - synchronize if (!plugin.isEnabled()) { List pluginCommands = PluginCommandYamlParser.parse(plugin); -@@ -431,7 +431,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -437,7 +437,7 @@ public final class SimplePluginManager implements PluginManager { disablePlugin(plugin, false); } -- public void disablePlugin(final Plugin plugin, boolean closeClassloader) { -+ public synchronized void disablePlugin(final Plugin plugin, boolean closeClassloader) { // Paper - synchronize +- public void disablePlugin(@NotNull final Plugin plugin, boolean closeClassloader) { ++ public synchronized void disablePlugin(@NotNull final Plugin plugin, boolean closeClassloader) { // Paper - synchronize // Paper end - close Classloader on disable if (plugin.isEnabled()) { try { -@@ -491,6 +491,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -497,6 +497,7 @@ public final class SimplePluginManager implements PluginManager { defaultPerms.get(false).clear(); } } @@ -54,10 +54,10 @@ index d925423d..59c70b8a 100644 /** * Calls an event with the given details. -@@ -500,22 +501,7 @@ public final class SimplePluginManager implements PluginManager { +@@ -506,22 +507,7 @@ public final class SimplePluginManager implements PluginManager { * @param event Event details */ - public void callEvent(Event event) { + public void callEvent(@NotNull Event event) { - if (event.isAsynchronous()) { - if (Thread.holdsLock(this)) { - throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code."); @@ -73,13 +73,13 @@ index d925423d..59c70b8a 100644 - } - } - -- private void fireEvent(Event event) { +- private void fireEvent(@NotNull Event event) { + // Paper - replace callEvent by merging to below method HandlerList handlers = event.getHandlers(); RegisteredListener[] listeners = handlers.getRegisteredListeners(); diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java -index 6b86128e..56308c0c 100644 +index 6b86128e1..56308c0c6 100644 --- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java +++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java @@ -19,7 +19,7 @@ public class PluginManagerTest { @@ -118,5 +118,5 @@ index 6b86128e..56308c0c 100644 @Test public void testAsyncUnlocked() throws InterruptedException { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0132-Add-hand-to-bucket-events.patch b/Spigot-API-Patches/0130-Add-hand-to-bucket-events.patch similarity index 67% rename from Spigot-API-Patches/0132-Add-hand-to-bucket-events.patch rename to Spigot-API-Patches/0130-Add-hand-to-bucket-events.patch index bd3af99eb2..05309688e1 100644 --- a/Spigot-API-Patches/0132-Add-hand-to-bucket-events.patch +++ b/Spigot-API-Patches/0130-Add-hand-to-bucket-events.patch @@ -1,11 +1,11 @@ -From c26a68ca5346089491588eba1c535b4994b93b0c Mon Sep 17 00:00:00 2001 +From 9e361e0c92767cb7d2ad6bb92c87aa209063aaa6 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Thu, 2 Aug 2018 08:44:20 -0500 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 cdf2e2016..5e93f1bbb 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEmptyEvent.java @@ -5,6 +5,7 @@ import org.bukkit.block.Block; @@ -14,23 +14,23 @@ index 8fb121a9..7b9596f3 100644 import org.bukkit.event.HandlerList; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; - /** -@@ -17,6 +18,12 @@ public class PlayerBucketEmptyEvent extends PlayerBucketEvent { +@@ -18,6 +19,12 @@ public class PlayerBucketEmptyEvent extends PlayerBucketEvent { super(who, blockClicked, blockFace, bucket, itemInHand); } + // Paper start - add EquipmentSlot -+ public PlayerBucketEmptyEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand, final EquipmentSlot hand) { ++ public PlayerBucketEmptyEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand, @org.jetbrains.annotations.Nullable final EquipmentSlot hand) { + super(who, blockClicked, blockFace, bucket, itemInHand, hand); + } + // Paper end + + @NotNull @Override 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 d0ccba060..280ca87bb 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketEvent.java @@ -5,6 +5,7 @@ import org.bukkit.block.Block; @@ -39,20 +39,20 @@ index 56584687..3dbe428b 100644 import org.bukkit.event.Cancellable; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; - - /** -@@ -16,13 +17,21 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +@@ -18,13 +19,21 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab private final Block blockClicked; private final BlockFace blockFace; private final Material bucket; + private final EquipmentSlot hand; // Paper - add EquipmentSlot - public PlayerBucketEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand) { + public PlayerBucketEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand) { + // Paper start - add EquipmentSlot + this(who, blockClicked, blockFace, bucket, itemInHand, null); + } + -+ public PlayerBucketEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand, final EquipmentSlot hand) { ++ public PlayerBucketEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand, @Nullable final EquipmentSlot hand) { + // Paper end super(who); this.blockClicked = blockClicked; @@ -63,7 +63,7 @@ index 56584687..3dbe428b 100644 } /** -@@ -70,6 +79,17 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab +@@ -76,6 +85,18 @@ public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellab return blockFace; } @@ -73,6 +73,7 @@ index 56584687..3dbe428b 100644 + * + * @return the hand used + */ ++ @NotNull + public EquipmentSlot getHand() { + return hand; + } @@ -82,7 +83,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 cc1b03eb2..15be7128b 100644 --- a/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java +++ b/src/main/java/org/bukkit/event/player/PlayerBucketFillEvent.java @@ -5,6 +5,7 @@ import org.bukkit.block.Block; @@ -91,21 +92,22 @@ index 94e042a3..884b9240 100644 import org.bukkit.event.HandlerList; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; - /** -@@ -17,6 +18,12 @@ public class PlayerBucketFillEvent extends PlayerBucketEvent { +@@ -18,6 +19,13 @@ public class PlayerBucketFillEvent extends PlayerBucketEvent { super(who, blockClicked, blockFace, bucket, itemInHand); } ++ + // Paper start - add EquipmentSlot -+ public PlayerBucketFillEvent(final Player who, final Block blockClicked, final BlockFace blockFace, final Material bucket, final ItemStack itemInHand, final EquipmentSlot hand) { ++ public PlayerBucketFillEvent(@NotNull final Player who, @NotNull final Block blockClicked, @NotNull final BlockFace blockFace, @NotNull final Material bucket, @NotNull final ItemStack itemInHand, @org.jetbrains.annotations.Nullable final EquipmentSlot hand) { + super(who, blockClicked, blockFace, bucket, itemInHand, hand); + } + // Paper end + + @NotNull @Override public HandlerList getHandlers() { - return handlers; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0133-Add-TNTPrimeEvent.patch b/Spigot-API-Patches/0131-Add-TNTPrimeEvent.patch similarity index 88% rename from Spigot-API-Patches/0133-Add-TNTPrimeEvent.patch rename to Spigot-API-Patches/0131-Add-TNTPrimeEvent.patch index 346ceabdda..50d348b074 100644 --- a/Spigot-API-Patches/0133-Add-TNTPrimeEvent.patch +++ b/Spigot-API-Patches/0131-Add-TNTPrimeEvent.patch @@ -1,4 +1,4 @@ -From d7f11e824bfc6d99d652b20a136ebbb080604d09 Mon Sep 17 00:00:00 2001 +From b92f5c6e30580f47d938aa5e66fa862eb7d84a76 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Sun, 15 Jul 2018 22:17:55 +0300 Subject: [PATCH] Add TNTPrimeEvent @@ -6,10 +6,10 @@ 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..73dabb82c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java -@@ -0,0 +1,108 @@ +@@ -0,0 +1,114 @@ +package com.destroystokyo.paper.event.block; + +import org.bukkit.block.Block; @@ -17,6 +17,8 @@ index 00000000..2ae8826b +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.BlockEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Called when TNT block is about to turn into {@link org.bukkit.entity.TNTPrimed} @@ -29,10 +31,10 @@ index 00000000..2ae8826b +public class TNTPrimeEvent extends BlockEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private PrimeReason reason; -+ private Entity primerEntity; ++ @NotNull private PrimeReason reason; ++ @Nullable private Entity primerEntity; + -+ public TNTPrimeEvent(Block theBlock, PrimeReason reason, Entity primerEntity) { ++ public TNTPrimeEvent(@NotNull Block theBlock, @NotNull PrimeReason reason, @Nullable Entity primerEntity) { + super(theBlock); + this.reason = reason; + this.primerEntity = primerEntity; @@ -43,6 +45,7 @@ index 00000000..2ae8826b + * + * @return Prime reason + */ ++ @NotNull + public PrimeReason getReason() { + return this.reason; + } @@ -56,6 +59,7 @@ index 00000000..2ae8826b + * + * @return The {@link Entity} who primed the TNT + */ ++ @Nullable + public Entity getPrimerEntity() { + return this.primerEntity; + } @@ -80,11 +84,13 @@ index 00000000..2ae8826b + this.cancelled = cancel; + } + ++ @Nullable + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @Nullable + public static HandlerList getHandlerList() { + return handlers; + } @@ -119,5 +125,5 @@ index 00000000..2ae8826b + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0134-Provide-Chunk-Coordinates-as-a-Long-API.patch b/Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch similarity index 84% rename from Spigot-API-Patches/0134-Provide-Chunk-Coordinates-as-a-Long-API.patch rename to Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch index 74663490fc..241008d5ff 100644 --- a/Spigot-API-Patches/0134-Provide-Chunk-Coordinates-as-a-Long-API.patch +++ b/Spigot-API-Patches/0132-Provide-Chunk-Coordinates-as-a-Long-API.patch @@ -1,4 +1,4 @@ -From d79f06b36da5d3fc3aed359bdafd8c15d445488c Mon Sep 17 00:00:00 2001 +From 4b32b217a7ca97b0e6510757c7ab3608edb82ecb Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 4 Aug 2018 19:37:35 -0400 Subject: [PATCH] Provide Chunk Coordinates as a Long API @@ -7,10 +7,10 @@ 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 441ed7ad..33cd0ea0 100644 +index 661ebd1fa..893300a77 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java -@@ -23,6 +23,32 @@ public interface Chunk { +@@ -24,6 +24,32 @@ public interface Chunk { */ int getZ(); @@ -26,7 +26,7 @@ index 441ed7ad..33cd0ea0 100644 + * @param loc Location to get chunk key + * @return Location's chunk coordinates packed into a long + */ -+ static long getChunkKey(Location loc) { ++ static long getChunkKey(@NotNull Location loc) { + return getChunkKey((int) Math.floor(loc.getX()) << 4, (int) Math.floor(loc.getZ()) << 4); + } + @@ -44,12 +44,12 @@ index 441ed7ad..33cd0ea0 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 e424ed4e..807bd7fc 100644 +index 5ccd8500d..c5da4d387 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -139,6 +139,21 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Chunk getChunkAt(Block block); +@@ -149,6 +149,22 @@ public interface World extends PluginMessageRecipient, Metadatable { + @NotNull + public Chunk getChunkAt(@NotNull Block block); + // Paper start + /** @@ -61,6 +61,7 @@ index e424ed4e..807bd7fc 100644 + * @param chunkKey The Chunk Key to look up the chunk by + * @return The chunk at the specified key + */ ++ @NotNull + public default Chunk getChunkAt(long chunkKey) { + return getChunkAt((int) chunkKey, (int) (chunkKey >> 32)); + } @@ -70,5 +71,5 @@ index e424ed4e..807bd7fc 100644 * Checks if the specified {@link Chunk} is loaded * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0135-Async-Chunks-API.patch b/Spigot-API-Patches/0133-Async-Chunks-API.patch similarity index 90% rename from Spigot-API-Patches/0135-Async-Chunks-API.patch rename to Spigot-API-Patches/0133-Async-Chunks-API.patch index 389a08c945..c28e73a1c2 100644 --- a/Spigot-API-Patches/0135-Async-Chunks-API.patch +++ b/Spigot-API-Patches/0133-Async-Chunks-API.patch @@ -1,4 +1,4 @@ -From c56c68eed04866793c411e6dc5eeeabe2f73ace1 Mon Sep 17 00:00:00 2001 +From 81d02f48b1966b4ca49a858fa20de8a8b9f15c0e Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 29 Feb 2016 17:43:33 -0600 Subject: [PATCH] Async Chunks API @@ -8,10 +8,10 @@ Adds API's to load or generate chunks asynchronously. Also adds utility methods to Entity to teleport asynchronously. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 807bd7fc..51cf7fd3 100644 +index c5da4d387..1b0744ed9 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -152,6 +152,352 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -163,6 +163,358 @@ public interface World extends PluginMessageRecipient, Metadatable { public default Chunk getChunkAt(long chunkKey) { return getChunkAt((int) chunkKey, (int) (chunkKey >> 32)); } @@ -33,11 +33,11 @@ index 807bd7fc..51cf7fd3 100644 + */ + @Deprecated + public static interface ChunkLoadCallback extends java.util.function.Consumer { -+ public void onLoad(Chunk chunk); ++ public void onLoad(@NotNull Chunk chunk); + + // backwards compat to old api + @Override -+ default void accept(Chunk chunk) { ++ default void accept(@NotNull Chunk chunk) { + onLoad(chunk); + } + } @@ -62,7 +62,7 @@ index 807bd7fc..51cf7fd3 100644 + * will be executed synchronously + */ + @Deprecated -+ public default void getChunkAtAsync(int x, int z, ChunkLoadCallback cb) { ++ public default void getChunkAtAsync(int x, int z, @NotNull ChunkLoadCallback cb) { + getChunkAtAsync(x, z, true).thenAccept(cb::onLoad); + } + @@ -85,7 +85,7 @@ index 807bd7fc..51cf7fd3 100644 + * will be executed synchronously + */ + @Deprecated -+ public default void getChunkAtAsync(Location loc, ChunkLoadCallback cb) { ++ public default void getChunkAtAsync(@NotNull Location loc, @NotNull ChunkLoadCallback cb) { + getChunkAtAsync(loc, true).thenAccept(cb::onLoad); + } + @@ -108,7 +108,7 @@ index 807bd7fc..51cf7fd3 100644 + * will be executed synchronously + */ + @Deprecated -+ public default void getChunkAtAsync(Block block, ChunkLoadCallback cb) { ++ public default void getChunkAtAsync(@NotNull Block block, @NotNull ChunkLoadCallback cb) { + getChunkAtAsync(block, true).thenAccept(cb::onLoad); + } + @@ -130,7 +130,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(int x, int z, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(int x, int z, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(x, z, true).thenAccept(cb); + } + @@ -153,7 +153,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(int x, int z, boolean gen, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(int x, int z, boolean gen, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(x, z, gen).thenAccept(cb); + } + @@ -174,7 +174,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Location loc, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Location loc, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, true, cb); + } + @@ -196,7 +196,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Location loc, boolean gen, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Location loc, boolean gen, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, gen, cb); + } + @@ -217,7 +217,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Block block, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Block block, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true, cb); + } + @@ -239,7 +239,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param cb Callback to receive the chunk when it is loaded. + * will be executed synchronously + */ -+ public default void getChunkAtAsync(Block block, boolean gen, java.util.function.Consumer cb) { ++ public default void getChunkAtAsync(@NotNull Block block, boolean gen, @NotNull java.util.function.Consumer cb) { + getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen, cb); + } + @@ -258,7 +258,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param loc Location to load the corresponding chunk from + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Location loc) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Location loc) { + return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, true); + } + @@ -278,7 +279,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param gen Should the chunk generate + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Location loc, boolean gen) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Location loc, boolean gen) { + return getChunkAtAsync((int)Math.floor(loc.getX()) >> 4, (int)Math.floor(loc.getZ()) >> 4, gen); + } + @@ -297,7 +299,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param block Block to load the corresponding chunk from + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Block block) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Block block) { + return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, true); + } + @@ -317,7 +320,8 @@ index 807bd7fc..51cf7fd3 100644 + * @param gen Should the chunk generate + * @return Future that will resolve when the chunk is loaded + */ -+ public default java.util.concurrent.CompletableFuture getChunkAtAsync(Block block, boolean gen) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture getChunkAtAsync(@NotNull Block block, boolean gen) { + return getChunkAtAsync(block.getX() >> 4, block.getZ() >> 4, gen); + } + @@ -338,6 +342,7 @@ index 807bd7fc..51cf7fd3 100644 + * @param z Z Coord + * @return Future that will resolve when the chunk is loaded + */ ++ @NotNull + public default java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z) { + return getChunkAtAsync(x, z, true); + } @@ -360,17 +365,18 @@ index 807bd7fc..51cf7fd3 100644 + * @param gen Should we generate a chunk if it doesn't exists or not + * @return Future that will resolve when the chunk is loaded + */ ++ @NotNull + public java.util.concurrent.CompletableFuture getChunkAtAsync(int x, int z, boolean gen); // Paper end /** diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java -index 2dd7a03c..59787c47 100644 +index a7f81d17d..73b75ffda 100644 --- a/src/main/java/org/bukkit/entity/Entity.java +++ b/src/main/java/org/bukkit/entity/Entity.java -@@ -135,6 +135,28 @@ public interface Entity extends Metadatable, CommandSender, Nameable { +@@ -145,6 +145,30 @@ public interface Entity extends Metadatable, CommandSender, Nameable { */ - public boolean teleport(Entity destination, TeleportCause cause); + public boolean teleport(@NotNull Entity destination, @NotNull TeleportCause cause); + // Paper start + /** @@ -378,7 +384,8 @@ index 2dd7a03c..59787c47 100644 + * @param loc Location to teleport to + * @return A future that will be completed with the result of the teleport + */ -+ public default java.util.concurrent.CompletableFuture teleportAsync(Location loc) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture teleportAsync(@NotNull Location loc) { + return teleportAsync(loc, TeleportCause.PLUGIN); + } + /** @@ -387,7 +394,8 @@ index 2dd7a03c..59787c47 100644 + * @param cause Reason for teleport + * @return A future that will be completed with the result of the teleport + */ -+ public default java.util.concurrent.CompletableFuture teleportAsync(Location loc, TeleportCause cause) { ++ @NotNull ++ public default java.util.concurrent.CompletableFuture teleportAsync(@NotNull Location loc, @NotNull TeleportCause cause) { + java.util.concurrent.CompletableFuture future = new java.util.concurrent.CompletableFuture<>(); + loc.getWorld().getChunkAtAsync(loc).thenAccept((chunk) -> future.complete(teleport(loc, cause))); + return future; diff --git a/Spigot-API-Patches/0136-Make-EnderDragon-extend-Mob.patch b/Spigot-API-Patches/0134-Make-EnderDragon-extend-Mob.patch similarity index 79% rename from Spigot-API-Patches/0136-Make-EnderDragon-extend-Mob.patch rename to Spigot-API-Patches/0134-Make-EnderDragon-extend-Mob.patch index f74a3387b2..1d3a58ce15 100644 --- a/Spigot-API-Patches/0136-Make-EnderDragon-extend-Mob.patch +++ b/Spigot-API-Patches/0134-Make-EnderDragon-extend-Mob.patch @@ -1,14 +1,14 @@ -From 6c2530d6ef60109990d1926cf94687fb965322f4 Mon Sep 17 00:00:00 2001 +From 8950d1f9eb04a8dd6dacd77d32c47c26cba3fcbc Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 10 Aug 2018 22:08:34 -0400 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 7170d37a..3ba49208 100644 +index fa13b38d3..e800259a2 100644 --- a/src/main/java/org/bukkit/entity/EnderDragon.java +++ b/src/main/java/org/bukkit/entity/EnderDragon.java -@@ -3,7 +3,7 @@ package org.bukkit.entity; +@@ -5,7 +5,7 @@ import org.jetbrains.annotations.NotNull; /** * Represents an Ender Dragon */ @@ -18,5 +18,5 @@ index 7170d37a..3ba49208 100644 /** * Represents a phase or action that an Ender Dragon can perform. -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0137-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-API-Patches/0135-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch similarity index 82% rename from Spigot-API-Patches/0137-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch rename to Spigot-API-Patches/0135-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index 3b4fd35d3e..fbf216ae79 100644 --- a/Spigot-API-Patches/0137-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-API-Patches/0135-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -1,39 +1,41 @@ -From 5d64bc594253075e2db995ffae4049d83a0ce47b Mon Sep 17 00:00:00 2001 +From 97a4ab01edbd67988b59a667d7faf3e15c12b532 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 15 Aug 2018 01:04:58 -0400 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 33cd0ea0..35407d5e 100644 +index 893300a77..22ff63e52 100644 --- a/src/main/java/org/bukkit/Chunk.java +++ b/src/main/java/org/bukkit/Chunk.java -@@ -93,12 +93,24 @@ public interface Chunk { - */ +@@ -99,13 +99,26 @@ public interface Chunk { + @NotNull Entity[] getEntities(); + // Paper start - /** - * Get a list of all tile entities in the chunk. - * - * @return The tile entities. - */ -- BlockState[] getTileEntities(); ++ /** ++ * Get a list of all tile entities in the chunk. ++ * ++ * @return The tile entities. ++ */ ++ @NotNull + default BlockState[] getTileEntities() { + return getTileEntities(true); + } + -+ /** -+ * Get a list of all tile entities in the chunk. -+ * + /** + * Get a list of all tile entities in the chunk. + * + * @param useSnapshot Take snapshots or direct references -+ * @return The tile entities. -+ */ + * @return The tile entities. + */ + @NotNull +- BlockState[] getTileEntities(); + BlockState[] getTileEntities(boolean useSnapshot); + // Paper end /** * Checks if the chunk is loaded. -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0138-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch b/Spigot-API-Patches/0136-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch similarity index 85% rename from Spigot-API-Patches/0138-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch rename to Spigot-API-Patches/0136-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch index 0c3bd26ac3..b1da3344e5 100644 --- a/Spigot-API-Patches/0138-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch +++ b/Spigot-API-Patches/0136-Don-t-use-snapshots-for-Timings-Tile-Entity-reports.patch @@ -1,14 +1,14 @@ -From a77d163e8cf3a60d91946ea48bc4a3939fb865b2 Mon Sep 17 00:00:00 2001 +From 8561919e77b65a9c40210e7ecf497f5b30e031b3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 15 Aug 2018 01:19:37 -0400 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 28d0954a..7ad9400a 100644 +index 8726bb9a2..21b929f94 100644 --- a/src/main/java/co/aikar/timings/TimingHistory.java +++ b/src/main/java/co/aikar/timings/TimingHistory.java -@@ -118,7 +118,7 @@ public class TimingHistory { +@@ -122,7 +122,7 @@ public class TimingHistory { data.entityCounts.get(entity.getType()).increment(); } @@ -18,5 +18,5 @@ index 28d0954a..7ad9400a 100644 Bukkit.getLogger().warning("Null tileentity detected in chunk at position x: " + chunk.getX() + ", z: " + chunk.getZ()); continue; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0139-Allow-Blocks-to-be-accessed-via-a-long-key.patch b/Spigot-API-Patches/0137-Allow-Blocks-to-be-accessed-via-a-long-key.patch similarity index 84% rename from Spigot-API-Patches/0139-Allow-Blocks-to-be-accessed-via-a-long-key.patch rename to Spigot-API-Patches/0137-Allow-Blocks-to-be-accessed-via-a-long-key.patch index 3810a2e8f3..cf03ca5964 100644 --- a/Spigot-API-Patches/0139-Allow-Blocks-to-be-accessed-via-a-long-key.patch +++ b/Spigot-API-Patches/0137-Allow-Blocks-to-be-accessed-via-a-long-key.patch @@ -1,4 +1,4 @@ -From 52bcd82fc9c739a5d191a3facdefc09304f1c527 Mon Sep 17 00:00:00 2001 +From ac906f73eee22d9eb85008691f819c1e9e0d7bc3 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Tue, 14 Aug 2018 21:42:10 -0700 Subject: [PATCH] Allow Blocks to be accessed via a long key @@ -18,18 +18,10 @@ Y range: [0, 1023] X, Z range: [-67 108 864, 67 108 863] diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 8dcb15fb..7e1ee875 100644 +index d38f15142..d3cff9de8 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -10,7 +10,6 @@ import org.bukkit.util.Vector; - - // Paper start - import java.util.Collection; --import java.util.Collections; - import java.util.function.Predicate; - import org.bukkit.entity.Entity; - import org.bukkit.entity.LivingEntity; -@@ -558,6 +557,18 @@ public class Location implements Cloneable, ConfigurationSerializable { +@@ -569,6 +569,18 @@ public class Location implements Cloneable, ConfigurationSerializable { blockLoc.setZ(getBlockZ()); return blockLoc; } @@ -49,12 +41,12 @@ index 8dcb15fb..7e1ee875 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 61f2cd9a..30204b98 100644 +index 1b0744ed9..158917492 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -75,6 +75,37 @@ public interface World extends PluginMessageRecipient, Metadatable { - */ - public Block getBlockAt(Location location); +@@ -80,6 +80,39 @@ public interface World extends PluginMessageRecipient, Metadatable { + @NotNull + public Block getBlockAt(@NotNull Location location); + // Paper start + /** @@ -65,6 +57,7 @@ index 61f2cd9a..30204b98 100644 + * @see Location#toBlockKey() + * @see Block#getBlockKey() + */ ++ @NotNull + public default Block getBlockAtKey(long key) { + int x = (int) ((key << 37) >> 37); + int y = (int) (key >>> 54); @@ -79,6 +72,7 @@ index 61f2cd9a..30204b98 100644 + * @see Location#toBlockKey() + * @see Block#getBlockKey() + */ ++ @NotNull + public default Location getLocationAtKey(long key) { + int x = (int) ((key << 37) >> 37); + int y = (int) (key >>> 54); @@ -91,10 +85,10 @@ index 61f2cd9a..30204b98 100644 * Gets the y coordinate of the lowest block at this position such that the * block and all blocks above it are transparent for lighting purposes. diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java -index 064acf32..d1a9512a 100644 +index 708288e99..42f31db29 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java -@@ -144,6 +144,33 @@ public interface Block extends Metadatable { +@@ -153,6 +153,33 @@ public interface Block extends Metadatable { */ int getZ(); @@ -129,5 +123,5 @@ index 064acf32..d1a9512a 100644 * Gets the Location of the block * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0140-Slime-Pathfinder-Events.patch b/Spigot-API-Patches/0138-Slime-Pathfinder-Events.patch similarity index 85% rename from Spigot-API-Patches/0140-Slime-Pathfinder-Events.patch rename to Spigot-API-Patches/0138-Slime-Pathfinder-Events.patch index 58f7e1c0db..8618443ca2 100644 --- a/Spigot-API-Patches/0140-Slime-Pathfinder-Events.patch +++ b/Spigot-API-Patches/0138-Slime-Pathfinder-Events.patch @@ -1,4 +1,4 @@ -From 7384fc53c3bf6e6025a819fd016e540863824bd5 Mon Sep 17 00:00:00 2001 +From d8ce298f5b4e64dcf643b8c080c6e47d73c52113 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 24 Aug 2018 08:18:27 -0500 Subject: [PATCH] Slime Pathfinder Events @@ -6,14 +6,15 @@ 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..2638bbd3e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java -@@ -0,0 +1,37 @@ +@@ -0,0 +1,38 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to change it's facing direction. @@ -24,7 +25,7 @@ index 00000000..f5a3ca3b +public class SlimeChangeDirectionEvent extends SlimePathfindEvent implements Cancellable { + private float yaw; + -+ public SlimeChangeDirectionEvent(Slime slime, float yaw) { ++ public SlimeChangeDirectionEvent(@NotNull Slime slime, float yaw) { + super(slime); + this.yaw = yaw; + } @@ -49,16 +50,17 @@ 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..14b67da10 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimePathfindEvent.java -@@ -0,0 +1,49 @@ +@@ -0,0 +1,53 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to start pathfinding. @@ -67,7 +69,7 @@ index 00000000..356bcca8 + * is choosing to start moving. + */ +public class SlimePathfindEvent extends EntityEvent implements Cancellable { -+ public SlimePathfindEvent(Slime slime) { ++ public SlimePathfindEvent(@NotNull Slime slime) { + super(slime); + } + @@ -76,16 +78,19 @@ index 00000000..356bcca8 + * + * @return The Slime that is pathfinding. + */ ++ @NotNull + public Slime getEntity() { + return (Slime) entity; + } + + private static final HandlerList handlers = new HandlerList(); + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -104,14 +109,15 @@ 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..c8dd49d11 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeSwimEvent.java -@@ -0,0 +1,16 @@ +@@ -0,0 +1,17 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to start jumping while swimming in water/lava. @@ -120,21 +126,22 @@ index 00000000..7c99fb53 + * is choosing to start jumping. + */ +public class SlimeSwimEvent extends SlimeWanderEvent implements Cancellable { -+ public SlimeSwimEvent(Slime slime) { ++ public SlimeSwimEvent(@NotNull Slime slime) { + super(slime); + } +} 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..e9ba32799 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeTargetLivingEntityEvent.java -@@ -0,0 +1,29 @@ +@@ -0,0 +1,31 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to change direction to target a LivingEntity. @@ -143,9 +150,9 @@ index 00000000..7c96e326 + * is choosing to start moving. + */ +public class SlimeTargetLivingEntityEvent extends SlimePathfindEvent implements Cancellable { -+ private final LivingEntity target; ++ @NotNull private final LivingEntity target; + -+ public SlimeTargetLivingEntityEvent(Slime slime, LivingEntity target) { ++ public SlimeTargetLivingEntityEvent(@NotNull Slime slime, @NotNull LivingEntity target) { + super(slime); + this.target = target; + } @@ -155,20 +162,22 @@ index 00000000..7c96e326 + * + * @return Targeted entity + */ ++ @NotNull + public LivingEntity getTarget() { + return target; + } +} 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..4683a7237 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeWanderEvent.java -@@ -0,0 +1,16 @@ +@@ -0,0 +1,17 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Slime; +import org.bukkit.event.Cancellable; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Slime decides to start wandering. @@ -177,12 +186,12 @@ index 00000000..e55d208c + * is choosing to start moving. + */ +public class SlimeWanderEvent extends SlimePathfindEvent implements Cancellable { -+ public SlimeWanderEvent(Slime slime) { ++ public SlimeWanderEvent(@NotNull Slime slime) { + super(slime); + } +} diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java -index 1119e26e..c4791f95 100644 +index 1119e26e2..c4791f95d 100644 --- a/src/main/java/org/bukkit/entity/Slime.java +++ b/src/main/java/org/bukkit/entity/Slime.java @@ -14,4 +14,20 @@ public interface Slime extends Mob { @@ -207,5 +216,5 @@ index 1119e26e..c4791f95 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0141-isChunkGenerated-API.patch b/Spigot-API-Patches/0139-isChunkGenerated-API.patch similarity index 77% rename from Spigot-API-Patches/0141-isChunkGenerated-API.patch rename to Spigot-API-Patches/0139-isChunkGenerated-API.patch index 7390c9bf66..c08c2a3c2f 100644 --- a/Spigot-API-Patches/0141-isChunkGenerated-API.patch +++ b/Spigot-API-Patches/0139-isChunkGenerated-API.patch @@ -1,22 +1,21 @@ -From ffe839718dd01ef749ae94c6c14f29d85e2f0a72 Mon Sep 17 00:00:00 2001 +From c8396200e161a36ea877c2f6a355145a24f9b0b0 Mon Sep 17 00:00:00 2001 From: cswhite2000 <18whitechristop@gmail.com> Date: Tue, 21 Aug 2018 19:39:46 -0700 Subject: [PATCH] isChunkGenerated API diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java -index 7e1ee875..9457832b 100644 +index d3cff9de8..0966f5e03 100644 --- a/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java -@@ -9,6 +9,7 @@ import org.bukkit.util.NumberConversions; - import org.bukkit.util.Vector; +@@ -1,5 +1,6 @@ + package org.bukkit; - // Paper start -+import com.google.common.base.Preconditions; - import java.util.Collection; - import java.util.function.Predicate; - import org.bukkit.entity.Entity; -@@ -502,6 +503,15 @@ public class Location implements Cloneable, ConfigurationSerializable { ++import com.google.common.base.Preconditions; // Paper + import java.util.HashMap; + import java.util.Map; + +@@ -510,6 +511,15 @@ public class Location implements Cloneable, ConfigurationSerializable { public boolean isChunkLoaded() { return world.isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper // Paper start @@ -33,10 +32,10 @@ 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 30204b98..60b7f2e3 100644 +index 158917492..6b91635fe 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -184,6 +184,17 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -197,6 +197,17 @@ public interface World extends PluginMessageRecipient, Metadatable { return getChunkAt((int) chunkKey, (int) (chunkKey >> 32)); } @@ -55,5 +54,5 @@ index 30204b98..60b7f2e3 100644 * This is the Legacy API before Java 8 was supported. Java 8 Consumer is provided, * as well as future support -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0142-Add-More-Creeper-API.patch b/Spigot-API-Patches/0140-Add-More-Creeper-API.patch similarity index 89% rename from Spigot-API-Patches/0142-Add-More-Creeper-API.patch rename to Spigot-API-Patches/0140-Add-More-Creeper-API.patch index f9565ae622..c51a476d6a 100644 --- a/Spigot-API-Patches/0142-Add-More-Creeper-API.patch +++ b/Spigot-API-Patches/0140-Add-More-Creeper-API.patch @@ -1,4 +1,4 @@ -From fda59fa4f5a093943b96470845aee44a5ba8387a Mon Sep 17 00:00:00 2001 +From ff30ce1b5f7f61dfc6ad8e26fac0459dc0f7d8b7 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 24 Aug 2018 11:50:16 -0500 Subject: [PATCH] Add More Creeper API @@ -6,16 +6,17 @@ Subject: [PATCH] Add More Creeper API diff --git a/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java new file mode 100644 -index 00000000..3d10bb03 +index 000000000..ff10251b6 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/CreeperIgniteEvent.java -@@ -0,0 +1,50 @@ +@@ -0,0 +1,54 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Creeper; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called when a Creeper is ignite flag is changed (armed/disarmed to explode). @@ -25,11 +26,12 @@ index 00000000..3d10bb03 + private boolean canceled; + private boolean ignited; + -+ public CreeperIgniteEvent(Creeper creeper, boolean ignited) { ++ public CreeperIgniteEvent(@NotNull Creeper creeper, boolean ignited) { + super(creeper); + this.ignited = ignited; + } + ++ @NotNull + @Override + public Creeper getEntity() { + return (Creeper) entity; @@ -51,17 +53,19 @@ index 00000000..3d10bb03 + canceled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/entity/Creeper.java b/src/main/java/org/bukkit/entity/Creeper.java -index f957d836..b9877fb8 100644 +index f957d8368..b9877fb88 100644 --- a/src/main/java/org/bukkit/entity/Creeper.java +++ b/src/main/java/org/bukkit/entity/Creeper.java @@ -50,4 +50,32 @@ public interface Creeper extends Monster { @@ -98,5 +102,5 @@ index f957d836..b9877fb8 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0143-Add-PhantomPreSpawnEvent.patch b/Spigot-API-Patches/0141-Add-PhantomPreSpawnEvent.patch similarity index 70% rename from Spigot-API-Patches/0143-Add-PhantomPreSpawnEvent.patch rename to Spigot-API-Patches/0141-Add-PhantomPreSpawnEvent.patch index c1954171f7..ce8e2f7c2a 100644 --- a/Spigot-API-Patches/0143-Add-PhantomPreSpawnEvent.patch +++ b/Spigot-API-Patches/0141-Add-PhantomPreSpawnEvent.patch @@ -1,4 +1,4 @@ -From 1e8a2a87d4fed943f6c6010a99b12204c0b9fdf3 Mon Sep 17 00:00:00 2001 +From 0061310b705004c430c5723f9a44bcf4b25ef811 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 25 Aug 2018 19:56:42 -0500 Subject: [PATCH] Add PhantomPreSpawnEvent @@ -6,26 +6,27 @@ Subject: [PATCH] Add PhantomPreSpawnEvent diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java new file mode 100644 -index 00000000..303a1ec9 +index 000000000..9022f697a --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java -@@ -0,0 +1,30 @@ +@@ -0,0 +1,31 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.Location; +import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; +import org.bukkit.event.entity.CreatureSpawnEvent; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + -+import javax.annotation.Nullable; + +/** + * Called when a phantom is spawned for an exhausted player + */ +public class PhantomPreSpawnEvent extends PreCreatureSpawnEvent { -+ private final Entity entity; ++ @NotNull private final Entity entity; + -+ public PhantomPreSpawnEvent(Location location, Entity entity, CreatureSpawnEvent.SpawnReason reason) { ++ public PhantomPreSpawnEvent(@NotNull Location location, @NotNull Entity entity, @NotNull CreatureSpawnEvent.SpawnReason reason) { + super(location, EntityType.PHANTOM, reason); + this.entity = entity; + } @@ -41,10 +42,19 @@ index 00000000..303a1ec9 + } +} diff --git a/src/main/java/org/bukkit/entity/Phantom.java b/src/main/java/org/bukkit/entity/Phantom.java -index 1a1044ed..65b703a2 100644 +index 1a1044edc..ed4d417c2 100644 --- a/src/main/java/org/bukkit/entity/Phantom.java +++ b/src/main/java/org/bukkit/entity/Phantom.java -@@ -14,4 +14,13 @@ public interface Phantom extends Flying { +@@ -1,5 +1,8 @@ + package org.bukkit.entity; + ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; ++ + /** + * Represents a phantom. + */ +@@ -14,4 +17,14 @@ public interface Phantom extends Flying { * @param sz The new size of the phantom. */ public void setSize(int sz); @@ -55,9 +65,10 @@ index 1a1044ed..65b703a2 100644 + * + * @return UUID + */ ++ @Nullable + public java.util.UUID getSpawningEntity(); + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0144-Add-source-block-to-BlockPhysicsEvent.patch b/Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch similarity index 77% rename from Spigot-API-Patches/0144-Add-source-block-to-BlockPhysicsEvent.patch rename to Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch index 5f2f1a2fbf..9bad8c8a1b 100644 --- a/Spigot-API-Patches/0144-Add-source-block-to-BlockPhysicsEvent.patch +++ b/Spigot-API-Patches/0142-Add-source-block-to-BlockPhysicsEvent.patch @@ -1,14 +1,14 @@ -From 92f743e9e76007184f2786aa099069484093b076 Mon Sep 17 00:00:00 2001 +From f8d3b059dcc85e1cb314e19265591247f9f2eb2f Mon Sep 17 00:00:00 2001 From: Sotr Date: Thu, 23 Aug 2018 16:14:25 +0800 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 a34359ed..cda896fa 100644 +index 75d4e70f5..a28731dc2 100644 --- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java +++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java -@@ -31,6 +31,13 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { +@@ -32,6 +32,13 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable { private final Block sourceBlock; private boolean cancel = false; @@ -19,9 +19,9 @@ index a34359ed..cda896fa 100644 + } + // Paper end + - public BlockPhysicsEvent(final Block block, final BlockData changed) { + public BlockPhysicsEvent(@NotNull final Block block, @NotNull final BlockData changed) { this(block, changed, block); } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0145-Inventory-removeItemAnySlot.patch b/Spigot-API-Patches/0143-Inventory-removeItemAnySlot.patch similarity index 78% rename from Spigot-API-Patches/0145-Inventory-removeItemAnySlot.patch rename to Spigot-API-Patches/0143-Inventory-removeItemAnySlot.patch index 201b55a3ba..21d6568c32 100644 --- a/Spigot-API-Patches/0145-Inventory-removeItemAnySlot.patch +++ b/Spigot-API-Patches/0143-Inventory-removeItemAnySlot.patch @@ -1,16 +1,16 @@ -From ebaecfd4aee0b13db35408adbfb670c0f1c3856d Mon Sep 17 00:00:00 2001 +From fa6299812f51c7522de971796540aab08c18866a Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 28 Aug 2018 23:04:06 -0400 Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index bab561dc..9d0306c3 100644 +index 36e352917..a358e9014 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -131,6 +131,33 @@ public interface Inventory extends Iterable { - */ - public HashMap removeItem(ItemStack... items) throws IllegalArgumentException; +@@ -138,6 +138,34 @@ public interface Inventory extends Iterable { + @NotNull + public HashMap removeItem(@NotNull ItemStack... items) throws IllegalArgumentException; + // Paper start + /** @@ -36,12 +36,13 @@ index bab561dc..9d0306c3 100644 + * @return A HashMap containing items that couldn't be removed. + * @throws IllegalArgumentException if items is null + */ -+ public HashMap removeItemAnySlot(ItemStack... items) throws IllegalArgumentException; ++ @NotNull ++ public HashMap removeItemAnySlot(@NotNull ItemStack... items) throws IllegalArgumentException; + // Paper end + /** * Returns all ItemStacks from the inventory * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0146-Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-API-Patches/0144-Add-ray-tracing-methods-to-LivingEntity.patch similarity index 84% rename from Spigot-API-Patches/0146-Add-ray-tracing-methods-to-LivingEntity.patch rename to Spigot-API-Patches/0144-Add-ray-tracing-methods-to-LivingEntity.patch index 6fdd019039..347468a402 100644 --- a/Spigot-API-Patches/0146-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-API-Patches/0144-Add-ray-tracing-methods-to-LivingEntity.patch @@ -1,4 +1,4 @@ -From 4f708c4bde046ce0d7b1a503cae15ac7455d4a1a Mon Sep 17 00:00:00 2001 +From e7f98812bb8a4822ac885809ae7daaae761c1c01 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 3 Sep 2018 18:13:53 -0500 Subject: [PATCH] Add ray tracing methods to LivingEntity @@ -6,14 +6,15 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/com/destroystokyo/paper/block/TargetBlockInfo.java b/src/main/java/com/destroystokyo/paper/block/TargetBlockInfo.java new file mode 100644 -index 00000000..fe43d955 +index 000000000..18a96dbb0 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/block/TargetBlockInfo.java -@@ -0,0 +1,50 @@ +@@ -0,0 +1,54 @@ +package com.destroystokyo.paper.block; + +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents information about a targeted block @@ -22,7 +23,7 @@ index 00000000..fe43d955 + private final Block block; + private final BlockFace blockFace; + -+ public TargetBlockInfo(Block block, BlockFace blockFace) { ++ public TargetBlockInfo(@NotNull Block block, @NotNull BlockFace blockFace) { + this.block = block; + this.blockFace = blockFace; + } @@ -32,6 +33,7 @@ index 00000000..fe43d955 + * + * @return Targeted block + */ ++ @NotNull + public Block getBlock() { + return block; + } @@ -41,6 +43,7 @@ index 00000000..fe43d955 + * + * @return Targeted blockface + */ ++ @NotNull + public BlockFace getBlockFace() { + return blockFace; + } @@ -50,6 +53,7 @@ index 00000000..fe43d955 + * + * @return Block relative to targeted block + */ ++ @NotNull + public Block getRelativeBlock() { + return block.getRelative(blockFace); + } @@ -61,12 +65,12 @@ index 00000000..fe43d955 + } +} diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index e3bc04e1..bd47e720 100644 +index 863d727d0..4dec50caf 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -78,6 +78,77 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource - */ - public Block getTargetBlock(Set transparent, int maxDistance); +@@ -81,6 +81,77 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource + @NotNull + public Block getTargetBlock(@Nullable Set transparent, int maxDistance); + // Paper start + /** @@ -90,7 +94,7 @@ index e3bc04e1..bd47e720 100644 + * or null if no block is within maxDistance + */ + @Nullable -+ public Block getTargetBlock(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); ++ public Block getTargetBlock(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); + + /** + * Gets the blockface of that block that the living entity has targeted, ignoring fluids @@ -113,7 +117,7 @@ index e3bc04e1..bd47e720 100644 + * or null if no block is targeted + */ + @Nullable -+ public org.bukkit.block.BlockFace getTargetBlockFace(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); ++ public org.bukkit.block.BlockFace getTargetBlockFace(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); + + /** + * Gets information about the block the living entity has targeted, ignoring fluids @@ -136,12 +140,12 @@ index e3bc04e1..bd47e720 100644 + * or null if no block is targeted + */ + @Nullable -+ public com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); ++ public com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); + // Paper end + /** * Gets the last two blocks along the living entity's line of sight. *

-- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0148-Improve-death-events.patch b/Spigot-API-Patches/0145-Improve-death-events.patch similarity index 87% rename from Spigot-API-Patches/0148-Improve-death-events.patch rename to Spigot-API-Patches/0145-Improve-death-events.patch index 8525084947..fd69da2e63 100644 --- a/Spigot-API-Patches/0148-Improve-death-events.patch +++ b/Spigot-API-Patches/0145-Improve-death-events.patch @@ -1,4 +1,4 @@ -From d41259020da1d0585cab3a286f3828a8be797415 Mon Sep 17 00:00:00 2001 +From 135e46030a87ff3a31b86466e0c12ee0a44dc651 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 21 Aug 2018 01:32:28 +0100 Subject: [PATCH] Improve death events @@ -15,10 +15,15 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java -index ab9e81fd..fef134c6 100644 +index a5984ab06..e19a3df9a 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDeathEvent.java -@@ -8,10 +8,19 @@ import org.bukkit.inventory.ItemStack; +@@ -5,14 +5,24 @@ import org.bukkit.entity.LivingEntity; + import org.bukkit.event.HandlerList; + import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + /** * Thrown whenever a LivingEntity dies */ @@ -31,15 +36,15 @@ index ab9e81fd..fef134c6 100644 + private boolean cancelled; + private double reviveHealth = 0; + private boolean shouldPlayDeathSound; -+ private org.bukkit.Sound deathSound; -+ private org.bukkit.SoundCategory deathSoundCategory; ++ @Nullable private org.bukkit.Sound deathSound; ++ @Nullable private org.bukkit.SoundCategory deathSoundCategory; + private float deathSoundVolume; + private float deathSoundPitch; + // Paper end - public EntityDeathEvent(final LivingEntity entity, final List drops) { + public EntityDeathEvent(@NotNull final LivingEntity entity, @NotNull final List drops) { this(entity, drops, 0); -@@ -69,4 +78,132 @@ public class EntityDeathEvent extends EntityEvent { +@@ -74,4 +84,134 @@ public class EntityDeathEvent extends EntityEvent { public static HandlerList getHandlerList() { return handlers; } @@ -104,6 +109,7 @@ index ab9e81fd..fef134c6 100644 + * + * @return The sound that the entity makes + */ ++ @Nullable + public org.bukkit.Sound getDeathSound() { + return deathSound; + } @@ -113,7 +119,7 @@ index ab9e81fd..fef134c6 100644 + * + * @param sound The sound that the entity should make when dying + */ -+ public void setDeathSound(org.bukkit.Sound sound) { ++ public void setDeathSound(@Nullable org.bukkit.Sound sound) { + deathSound = sound; + } + @@ -122,6 +128,7 @@ index ab9e81fd..fef134c6 100644 + * + * @return The sound category + */ ++ @Nullable + public org.bukkit.SoundCategory getDeathSoundCategory() { + return deathSoundCategory; + } @@ -131,7 +138,7 @@ index ab9e81fd..fef134c6 100644 + * + * @param soundCategory The sound category + */ -+ public void setDeathSoundCategory(org.bukkit.SoundCategory soundCategory) { ++ public void setDeathSoundCategory(@Nullable org.bukkit.SoundCategory soundCategory) { + this.deathSoundCategory = soundCategory; + } + @@ -173,5 +180,5 @@ index ab9e81fd..fef134c6 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0149-Mob-Pathfinding-API.patch b/Spigot-API-Patches/0146-Mob-Pathfinding-API.patch similarity index 86% rename from Spigot-API-Patches/0149-Mob-Pathfinding-API.patch rename to Spigot-API-Patches/0146-Mob-Pathfinding-API.patch index f244a8fbc4..f73fcdeef7 100644 --- a/Spigot-API-Patches/0149-Mob-Pathfinding-API.patch +++ b/Spigot-API-Patches/0146-Mob-Pathfinding-API.patch @@ -1,4 +1,4 @@ -From 67e1e492304b1ca36e9c50796a15c45c19ec0e7c Mon Sep 17 00:00:00 2001 +From c2924c0e572c8bc3f43828719a939aae0ebdc586 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 9 Sep 2018 12:39:06 -0400 Subject: [PATCH] Mob Pathfinding API @@ -13,19 +13,19 @@ You can use EntityPathfindEvent to cancel new pathfinds from overriding your cur diff --git a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java new file mode 100644 -index 00000000..d6953b39 +index 000000000..8b90a9053 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java -@@ -0,0 +1,167 @@ +@@ -0,0 +1,170 @@ +package com.destroystokyo.paper.entity; + +import org.bukkit.Location; +import org.bukkit.entity.LivingEntity; +import org.bukkit.entity.Mob; + -+import javax.annotation.Nonnull; -+import javax.annotation.Nullable; +import java.util.List; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +/** + * Handles pathfinding operations for an Entity @@ -36,6 +36,7 @@ index 00000000..d6953b39 + * + * @return The entity that is controlled by this pathfinder + */ ++ @NotNull + Mob getEntity(); + + /** @@ -52,7 +53,8 @@ index 00000000..d6953b39 + /** + * @return The location the entity is trying to navigate to, or null if there is no destination + */ -+ @Nullable PathResult getCurrentPath(); ++ @Nullable ++ PathResult getCurrentPath(); + + /** + * Calculates a destination for the Entity to navigate to, but does not set it @@ -60,7 +62,7 @@ index 00000000..d6953b39 + * @param loc Location to navigate to + * @return The closest Location the Entity can get to for this navigation, or null if no path could be calculated + */ -+ @Nullable PathResult findPath(Location loc); ++ @Nullable PathResult findPath(@NotNull Location loc); + + /** + * Calculates a destination for the Entity to navigate to to reach the target entity, @@ -75,7 +77,7 @@ index 00000000..d6953b39 + * @param target the Entity to navigate to + * @return The closest Location the Entity can get to for this navigation, or null if no path could be calculated + */ -+ @Nullable PathResult findPath(LivingEntity target); ++ @Nullable PathResult findPath(@NotNull LivingEntity target); + + /** + * Calculates a destination for the Entity to navigate to, and sets it with default speed @@ -83,7 +85,7 @@ index 00000000..d6953b39 + * @param loc Location to navigate to + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull Location loc) { ++ default boolean moveTo(@NotNull Location loc) { + return moveTo(loc, 1); + } + @@ -94,7 +96,7 @@ index 00000000..d6953b39 + * @param speed Speed multiplier to navigate at, where 1 is 'normal' + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull Location loc, double speed) { ++ default boolean moveTo(@NotNull Location loc, double speed) { + PathResult path = findPath(loc); + return path != null && moveTo(path, speed); + } @@ -111,7 +113,7 @@ index 00000000..d6953b39 + * @param target the Entity to navigate to + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull LivingEntity target) { ++ default boolean moveTo(@NotNull LivingEntity target) { + return moveTo(target, 1); + } + @@ -128,7 +130,7 @@ index 00000000..d6953b39 + * @param speed Speed multiplier to navigate at, where 1 is 'normal' + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull LivingEntity target, double speed) { ++ default boolean moveTo(@NotNull LivingEntity target, double speed) { + PathResult path = findPath(target); + return path != null && moveTo(path, speed); + } @@ -140,7 +142,7 @@ index 00000000..d6953b39 + * @param path The Path to start following + * @return If the pathfinding was successfully started + */ -+ default boolean moveTo(@Nonnull PathResult path) { ++ default boolean moveTo(@NotNull PathResult path) { + return moveTo(path, 1); + } + @@ -152,7 +154,7 @@ index 00000000..d6953b39 + * @param speed Speed multiplier to navigate at, where 1 is 'normal' + * @return If the pathfinding was successfully started + */ -+ boolean moveTo(@Nonnull PathResult path, double speed); ++ boolean moveTo(@NotNull PathResult path, double speed); + + /** + * Represents the result of a pathfinding calculation @@ -165,6 +167,7 @@ index 00000000..d6953b39 + * Will return points the entity has already moved past, see {@link #getNextPointIndex()} + * @return List of points + */ ++ @NotNull + List getPoints(); + + /** @@ -185,10 +188,18 @@ index 00000000..d6953b39 + } +} diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index d029d34e..48eddcd3 100644 +index 838440ff8..afdc103fe 100644 --- a/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java -@@ -7,6 +7,14 @@ import org.bukkit.loot.Lootable; +@@ -1,6 +1,7 @@ + package org.bukkit.entity; + + import org.bukkit.loot.Lootable; ++import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; + + /** +@@ -8,6 +9,15 @@ import org.jetbrains.annotations.Nullable; */ public interface Mob extends LivingEntity, Lootable { @@ -197,6 +208,7 @@ index d029d34e..48eddcd3 100644 + * Enables access to control the pathing of an Entity + * @return Pathfinding Manager for this entity + */ ++ @NotNull + com.destroystokyo.paper.entity.Pathfinder getPathfinder(); + // Paper end + @@ -204,5 +216,5 @@ index d029d34e..48eddcd3 100644 * Instructs this Mob to set the specified LivingEntity as its target. *

-- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0150-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch b/Spigot-API-Patches/0147-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch similarity index 89% rename from Spigot-API-Patches/0150-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch rename to Spigot-API-Patches/0147-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch index 84f854bcb2..3082c891ff 100644 --- a/Spigot-API-Patches/0150-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch +++ b/Spigot-API-Patches/0147-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch @@ -1,4 +1,4 @@ -From 54280844e72a78402ba7ce5e7ee5f821a3c1a746 Mon Sep 17 00:00:00 2001 +From bbec13144bdd56b0f6e6eec27c9c5dfc1a16b993 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Wed, 12 Sep 2018 18:53:35 +0300 Subject: [PATCH] Add an API for CanPlaceOn and CanDestroy NBT values @@ -6,12 +6,14 @@ Subject: [PATCH] Add an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/com/destroystokyo/paper/Namespaced.java b/src/main/java/com/destroystokyo/paper/Namespaced.java new file mode 100644 -index 00000000..2baf58b7 +index 000000000..cd1a34b82 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/Namespaced.java -@@ -0,0 +1,36 @@ +@@ -0,0 +1,40 @@ +package com.destroystokyo.paper; + ++import org.jetbrains.annotations.NotNull; ++ +/** + * Represents a namespaced resource, see {@link org.bukkit.NamespacedKey} for single elements + * or {@link com.destroystokyo.paper.NamespacedTag} for a collection of elements @@ -34,6 +36,7 @@ index 00000000..2baf58b7 + * + * @return resource namespace + */ ++ @NotNull + String getNamespace(); + + /** @@ -44,14 +47,15 @@ index 00000000..2baf58b7 + * + * @return resource key + */ ++ @NotNull + String getKey(); +} diff --git a/src/main/java/com/destroystokyo/paper/NamespacedTag.java b/src/main/java/com/destroystokyo/paper/NamespacedTag.java new file mode 100644 -index 00000000..89949827 +index 000000000..28f3fda95 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/NamespacedTag.java -@@ -0,0 +1,138 @@ +@@ -0,0 +1,142 @@ +package com.destroystokyo.paper; + +import com.google.common.base.Preconditions; @@ -59,6 +63,7 @@ index 00000000..89949827 +import java.util.UUID; +import java.util.regex.Pattern; +import org.bukkit.plugin.Plugin; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents a String based key pertaining to a tagged entry. Consists of two components - a namespace @@ -98,7 +103,7 @@ index 00000000..89949827 + * @deprecated should never be used by plugins, for internal use only!! + */ + @Deprecated -+ public NamespacedTag(String namespace, String key) { ++ public NamespacedTag(@NotNull String namespace, @NotNull String key) { + Preconditions.checkArgument(namespace != null && VALID_NAMESPACE.matcher(namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace); + Preconditions.checkArgument(key != null && VALID_KEY.matcher(key).matches(), "Invalid key. Must be [a-z0-9/._-]: %s", key); + @@ -121,7 +126,7 @@ index 00000000..89949827 + * @param plugin the plugin to use for the namespace + * @param key the key to create + */ -+ public NamespacedTag(Plugin plugin, String key) { ++ public NamespacedTag(@NotNull Plugin plugin, @NotNull String key) { + Preconditions.checkArgument(plugin != null, "Plugin cannot be null"); + Preconditions.checkArgument(key != null, "Key cannot be null"); + @@ -136,10 +141,12 @@ index 00000000..89949827 + Preconditions.checkArgument(string.length() < 256, "NamespacedTag must be less than 256 characters (%s)", string); + } + ++ @NotNull + public String getNamespace() { + return namespace; + } + ++ @NotNull + public String getKey() { + return key; + } @@ -186,15 +193,16 @@ index 00000000..89949827 + * @param key the key to use + * @return new key in the Minecraft namespace + */ -+ public static NamespacedTag minecraft(String key) { ++ @NotNull ++ public static NamespacedTag minecraft(@NotNull String key) { + return new NamespacedTag(MINECRAFT, key); + } +} diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java -index fe8d3468..074769c1 100644 +index f5e3929aa..8648e8fb6 100644 --- a/src/main/java/org/bukkit/NamespacedKey.java +++ b/src/main/java/org/bukkit/NamespacedKey.java -@@ -17,7 +17,7 @@ import org.bukkit.plugin.Plugin; +@@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull; * underscores, hyphens, and forward slashes. * */ @@ -203,24 +211,25 @@ index fe8d3468..074769c1 100644 /** * The namespace representing all inbuilt keys. -@@ -81,10 +81,12 @@ public final class NamespacedKey { - Preconditions.checkArgument(string.length() < 256, "NamespacedKey must be less than 256 characters (%s)", string); +@@ -83,11 +83,13 @@ public final class NamespacedKey { } + @NotNull + @Override // Paper public String getNamespace() { return namespace; } + @NotNull + @Override // Paper public String getKey() { return key; } diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -index 4d0351c4..03e3cfd4 100644 +index f2a6755a5..3ed7ea06a 100644 --- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java +++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java -@@ -82,13 +82,13 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { +@@ -86,14 +86,14 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { *

* Plugins should check if hasLore() returns true before * calling this method. @@ -228,6 +237,7 @@ index 4d0351c4..03e3cfd4 100644 + * * @return a list of lore that is set */ + @Nullable List getLore(); /** @@ -236,8 +246,8 @@ index 4d0351c4..03e3cfd4 100644 * Removes lore when given null. * * @param lore the lore that will be set -@@ -119,7 +119,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { - int getEnchantLevel(Enchantment ench); +@@ -124,7 +124,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { + int getEnchantLevel(@NotNull Enchantment ench); /** - * Returns a copy the enchantments in this ItemMeta.
@@ -245,8 +255,8 @@ index 4d0351c4..03e3cfd4 100644 * Returns an empty map if none. * * @return An immutable copy of the enchantments -@@ -363,4 +363,83 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { - +@@ -376,4 +376,86 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable { + @NotNull Spigot spigot(); // Spigot end + // Paper start - Add an API for CanPlaceOn and CanDestroy NBT values @@ -291,6 +301,7 @@ index 4d0351c4..03e3cfd4 100644 + * + * @return Set of {@link com.destroystokyo.paper.Namespaced} + */ ++ @NotNull + Set getDestroyableKeys(); + + /** @@ -298,13 +309,14 @@ index 4d0351c4..03e3cfd4 100644 + * + * @param canDestroy Collection of {@link com.destroystokyo.paper.Namespaced} + */ -+ void setDestroyableKeys(Collection canDestroy); ++ void setDestroyableKeys(@NotNull Collection canDestroy); + + /** + * Gets the collection of namespaced keys that the item can be placed on in {@link org.bukkit.GameMode#ADVENTURE} + * + * @return Set of {@link com.destroystokyo.paper.Namespaced} + */ ++ @NotNull + Set getPlaceableKeys(); + + /** @@ -312,7 +324,8 @@ index 4d0351c4..03e3cfd4 100644 + * + * @param canPlaceOn Collection of {@link com.destroystokyo.paper.Namespaced} + */ -+ void setPlaceableKeys(Collection canPlaceOn); ++ @NotNull ++ void setPlaceableKeys(@NotNull Collection canPlaceOn); + + /** + * Checks for the existence of any keys that the item can be placed on @@ -330,5 +343,5 @@ index 4d0351c4..03e3cfd4 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0147-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-API-Patches/0147-Expose-attack-cooldown-methods-for-Player.patch deleted file mode 100644 index ff3a46ca2f..0000000000 --- a/Spigot-API-Patches/0147-Expose-attack-cooldown-methods-for-Player.patch +++ /dev/null @@ -1,40 +0,0 @@ -From a4efb03d3d60ea69b16af96345a61f3530344373 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath -Date: Tue, 4 Sep 2018 15:01:54 -0500 -Subject: [PATCH] Expose attack cooldown methods for Player - - -diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index ddf226a4..db6bcae5 100644 ---- a/src/main/java/org/bukkit/entity/Player.java -+++ b/src/main/java/org/bukkit/entity/Player.java -@@ -1883,6 +1883,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM - * @param profile The new profile to use - */ - void setPlayerProfile(PlayerProfile profile); -+ -+ /** -+ * Returns the amount of ticks the current cooldown lasts -+ * -+ * @return Amount of ticks cooldown will last -+ */ -+ float getCooldownPeriod(); -+ -+ /** -+ * Returns the percentage of attack power available based on the cooldown (zero to one). -+ * -+ * @param adjustTicks Amount of ticks to add to cooldown counter for this calculation -+ * @return Percentage of attack power available -+ */ -+ float getCooledAttackStrength(float adjustTicks); -+ -+ /** -+ * Reset the cooldown counter to 0, effectively starting the cooldown period. -+ */ -+ void resetCooldown(); - // Paper end - - // Spigot start --- -2.20.1 - diff --git a/Spigot-API-Patches/0151-Performance-Concurrency-Improvements-to-Permissions.patch b/Spigot-API-Patches/0148-Performance-Concurrency-Improvements-to-Permissions.patch similarity index 65% rename from Spigot-API-Patches/0151-Performance-Concurrency-Improvements-to-Permissions.patch rename to Spigot-API-Patches/0148-Performance-Concurrency-Improvements-to-Permissions.patch index 2562fa84d9..ef63091045 100644 --- a/Spigot-API-Patches/0151-Performance-Concurrency-Improvements-to-Permissions.patch +++ b/Spigot-API-Patches/0148-Performance-Concurrency-Improvements-to-Permissions.patch @@ -1,4 +1,4 @@ -From f79f2b0711a8c11eec54d8ea9f92cccaa8ec644e Mon Sep 17 00:00:00 2001 +From 70bd0d4e37da61457d7cf5e738c86df89660c2c7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 13 Sep 2018 20:51:50 -0400 Subject: [PATCH] Performance & Concurrency Improvements to Permissions @@ -18,10 +18,10 @@ Optimized it to simply be a single get call cutting permission map lookups in half. diff --git a/src/main/java/org/bukkit/permissions/PermissibleBase.java b/src/main/java/org/bukkit/permissions/PermissibleBase.java -index d4cb00a8..486f69f8 100644 +index 27c14c0f5..72fff64e0 100644 --- a/src/main/java/org/bukkit/permissions/PermissibleBase.java +++ b/src/main/java/org/bukkit/permissions/PermissibleBase.java -@@ -68,8 +68,11 @@ public class PermissibleBase implements Permissible { +@@ -70,8 +70,11 @@ public class PermissibleBase implements Permissible { String name = inName.toLowerCase(java.util.Locale.ENGLISH); @@ -35,7 +35,7 @@ index d4cb00a8..486f69f8 100644 } else { Permission perm = Bukkit.getServer().getPluginManager().getPermission(name); -@@ -88,13 +91,16 @@ public class PermissibleBase implements Permissible { +@@ -90,14 +93,17 @@ public class PermissibleBase implements Permissible { String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH); @@ -50,30 +50,31 @@ index d4cb00a8..486f69f8 100644 return perm.getDefault().getValue(isOp()); } -- public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { // Paper - synchronized + @NotNull +- public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) { // Paper - synchronized if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); } else if (plugin == null) { -@@ -111,7 +117,7 @@ public class PermissibleBase implements Permissible { - return result; +@@ -115,7 +121,7 @@ public class PermissibleBase implements Permissible { } -- public PermissionAttachment addAttachment(Plugin plugin) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin) { // Paper - synchronized + @NotNull +- public PermissionAttachment addAttachment(@NotNull Plugin plugin) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin) { // Paper - synchronized if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); } else if (!plugin.isEnabled()) { -@@ -126,7 +132,7 @@ public class PermissibleBase implements Permissible { +@@ -130,7 +136,7 @@ public class PermissibleBase implements Permissible { return result; } -- public void removeAttachment(PermissionAttachment attachment) { -+ public synchronized void removeAttachment(PermissionAttachment attachment) { // Paper - synchronized +- public void removeAttachment(@NotNull PermissionAttachment attachment) { ++ public synchronized void removeAttachment(@NotNull PermissionAttachment attachment) { // Paper - synchronized if (attachment == null) { throw new IllegalArgumentException("Attachment cannot be null"); } -@@ -145,7 +151,7 @@ public class PermissibleBase implements Permissible { +@@ -149,7 +155,7 @@ public class PermissibleBase implements Permissible { } } @@ -82,33 +83,33 @@ index d4cb00a8..486f69f8 100644 clearPermissions(); Set defaults = Bukkit.getServer().getPluginManager().getDefaultPermissions(isOp()); Bukkit.getServer().getPluginManager().subscribeToDefaultPerms(isOp(), parent); -@@ -192,7 +198,7 @@ public class PermissibleBase implements Permissible { - } +@@ -197,7 +203,7 @@ public class PermissibleBase implements Permissible { } -- public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { // Paper - synchronized + @Nullable +- public PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) { // Paper if (name == null) { throw new IllegalArgumentException("Permission name cannot be null"); } else if (plugin == null) { -@@ -210,7 +216,7 @@ public class PermissibleBase implements Permissible { - return result; +@@ -216,7 +222,7 @@ public class PermissibleBase implements Permissible { } -- public PermissionAttachment addAttachment(Plugin plugin, int ticks) { -+ public synchronized PermissionAttachment addAttachment(Plugin plugin, int ticks) { // Paper - synchronized + @Nullable +- public PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) { ++ public synchronized PermissionAttachment addAttachment(@NotNull Plugin plugin, int ticks) { // Paper - synchronized if (plugin == null) { throw new IllegalArgumentException("Plugin cannot be null"); } else if (!plugin.isEnabled()) { -@@ -228,7 +234,7 @@ public class PermissibleBase implements Permissible { - } +@@ -235,7 +241,7 @@ public class PermissibleBase implements Permissible { } + @NotNull - public Set getEffectivePermissions() { + public synchronized Set getEffectivePermissions() { // Paper - synchronized return new HashSet(permissions.values()); } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0152-Add-ItemStackRecipeChoice-Draft-API.patch b/Spigot-API-Patches/0149-Add-ItemStackRecipeChoice-Draft-API.patch similarity index 95% rename from Spigot-API-Patches/0152-Add-ItemStackRecipeChoice-Draft-API.patch rename to Spigot-API-Patches/0149-Add-ItemStackRecipeChoice-Draft-API.patch index 689b2cf944..a34cacfcb7 100644 --- a/Spigot-API-Patches/0152-Add-ItemStackRecipeChoice-Draft-API.patch +++ b/Spigot-API-Patches/0149-Add-ItemStackRecipeChoice-Draft-API.patch @@ -1,4 +1,4 @@ -From fbfa236c0d69828e0334e11eba3dcafa725baa09 Mon Sep 17 00:00:00 2001 +From 28da2c2e4131200abea38d1655801de42bff18ed Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 13 Sep 2018 21:39:26 -0400 Subject: [PATCH] Add ItemStackRecipeChoice Draft API @@ -9,7 +9,7 @@ Allows creating recipes that must match isSimilar to full item stack. diff --git a/src/main/java/com/destroystokyo/paper/inventory/ItemStackRecipeChoice.java b/src/main/java/com/destroystokyo/paper/inventory/ItemStackRecipeChoice.java new file mode 100644 -index 00000000..43e6576b +index 000000000..43e6576b1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/inventory/ItemStackRecipeChoice.java @@ -0,0 +1,51 @@ @@ -65,5 +65,5 @@ index 00000000..43e6576b + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0153-Implement-furnace-cook-speed-multiplier-API.patch b/Spigot-API-Patches/0150-Implement-furnace-cook-speed-multiplier-API.patch similarity index 86% rename from Spigot-API-Patches/0153-Implement-furnace-cook-speed-multiplier-API.patch rename to Spigot-API-Patches/0150-Implement-furnace-cook-speed-multiplier-API.patch index da9c930897..426dd78fe8 100644 --- a/Spigot-API-Patches/0153-Implement-furnace-cook-speed-multiplier-API.patch +++ b/Spigot-API-Patches/0150-Implement-furnace-cook-speed-multiplier-API.patch @@ -1,4 +1,4 @@ -From 6b713fe8147f53ef6b2e75dec0abff2f8f7a0b0a Mon Sep 17 00:00:00 2001 +From 4894cb1a997439c5dedc66114a55483e169ecd6e Mon Sep 17 00:00:00 2001 From: Tassu Date: Thu, 13 Sep 2018 08:45:01 +0300 Subject: [PATCH] Implement furnace cook speed multiplier API @@ -6,10 +6,10 @@ Subject: [PATCH] Implement furnace cook speed multiplier API Signed-off-by: Tassu diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java -index fb82104b..3df8dc6d 100644 +index db3d22fa9..97b25dbd9 100644 --- a/src/main/java/org/bukkit/block/Furnace.java +++ b/src/main/java/org/bukkit/block/Furnace.java -@@ -61,6 +61,26 @@ public interface Furnace extends Container, Nameable { +@@ -62,6 +62,26 @@ public interface Furnace extends Container, Nameable { */ public void setCookTimeTotal(int cookTimeTotal); @@ -33,9 +33,9 @@ index fb82104b..3df8dc6d 100644 + public void setCookSpeedMultiplier(double multiplier); + // Paper end + + @NotNull @Override public FurnaceInventory getInventory(); - -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0154-PreSpawnerSpawnEvent.patch b/Spigot-API-Patches/0151-PreSpawnerSpawnEvent.patch similarity index 80% rename from Spigot-API-Patches/0154-PreSpawnerSpawnEvent.patch rename to Spigot-API-Patches/0151-PreSpawnerSpawnEvent.patch index e6acd0dd64..7c5950c30c 100644 --- a/Spigot-API-Patches/0154-PreSpawnerSpawnEvent.patch +++ b/Spigot-API-Patches/0151-PreSpawnerSpawnEvent.patch @@ -1,4 +1,4 @@ -From ee6aedc0ee7297256b3da0dcb2d1b3237617a0a1 Mon Sep 17 00:00:00 2001 +From c0ac9162f275d12dc0fcd47237528f9b124917a9 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 18 Sep 2018 23:50:10 +0100 Subject: [PATCH] PreSpawnerSpawnEvent @@ -10,10 +10,10 @@ spawners. diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java new file mode 100644 -index 00000000..d7221210 +index 000000000..48cff0635 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/PreSpawnerSpawnEvent.java -@@ -0,0 +1,27 @@ +@@ -0,0 +1,29 @@ +package com.destroystokyo.paper.event.entity; + + @@ -21,6 +21,7 @@ index 00000000..d7221210 +import org.bukkit.Location; +import org.bukkit.entity.EntityType; +import org.bukkit.event.entity.CreatureSpawnEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Called before an entity is spawned into a world by a spawner. @@ -30,17 +31,18 @@ index 00000000..d7221210 + */ + +public class PreSpawnerSpawnEvent extends PreCreatureSpawnEvent { -+ private final Location spawnerLocation; ++ @NotNull private final Location spawnerLocation; + -+ public PreSpawnerSpawnEvent(Location location, EntityType type, Location spawnerLocation) { ++ public PreSpawnerSpawnEvent(@NotNull Location location, @NotNull EntityType type, @NotNull Location spawnerLocation) { + super(location, type, CreatureSpawnEvent.SpawnReason.SPAWNER); + this.spawnerLocation = Preconditions.checkNotNull(spawnerLocation, "Spawner location may not be null"); + } + ++ @NotNull + public Location getSpawnerLocation() { + return spawnerLocation; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0155-Remove-Precondition-on-name-for-AttributeModifier.patch b/Spigot-API-Patches/0152-Remove-Precondition-on-name-for-AttributeModifier.patch similarity index 74% rename from Spigot-API-Patches/0155-Remove-Precondition-on-name-for-AttributeModifier.patch rename to Spigot-API-Patches/0152-Remove-Precondition-on-name-for-AttributeModifier.patch index 10b8146cd0..5b33203664 100644 --- a/Spigot-API-Patches/0155-Remove-Precondition-on-name-for-AttributeModifier.patch +++ b/Spigot-API-Patches/0152-Remove-Precondition-on-name-for-AttributeModifier.patch @@ -1,4 +1,4 @@ -From bb7da65c28eea714e3653bc1d9620e474fd92a9c Mon Sep 17 00:00:00 2001 +From 7c6a5a037b4afb0148ae12995168cf93a4ef452c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 22 Sep 2018 18:41:01 -0400 Subject: [PATCH] Remove Precondition on name for AttributeModifier @@ -6,12 +6,12 @@ Subject: [PATCH] Remove Precondition on name for AttributeModifier Vanilla allows empty names diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java -index 2bc9878f..0943eee4 100644 +index a97631474..f0dff145a 100644 --- a/src/main/java/org/bukkit/attribute/AttributeModifier.java +++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java -@@ -30,10 +30,10 @@ public class AttributeModifier implements ConfigurationSerializable { +@@ -32,10 +32,10 @@ public class AttributeModifier implements ConfigurationSerializable { - public AttributeModifier(UUID uuid, String name, double amount, Operation operation, EquipmentSlot slot) { + public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation, @Nullable EquipmentSlot slot) { Validate.notNull(uuid, "UUID cannot be null"); - Validate.notEmpty(name, "Name cannot be empty"); + //Validate.notEmpty(name, "Name cannot be empty"); // Paper @@ -23,5 +23,5 @@ index 2bc9878f..0943eee4 100644 this.operation = operation; this.slot = slot; -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0156-Material-API-additions.patch b/Spigot-API-Patches/0153-Material-API-additions.patch similarity index 81% rename from Spigot-API-Patches/0156-Material-API-additions.patch rename to Spigot-API-Patches/0153-Material-API-additions.patch index b85a50975d..b8aa334a81 100644 --- a/Spigot-API-Patches/0156-Material-API-additions.patch +++ b/Spigot-API-Patches/0153-Material-API-additions.patch @@ -1,14 +1,14 @@ -From e154dc606756149a2ec4d372ca3fcc02763636be Mon Sep 17 00:00:00 2001 +From 515426e99ead7041a586709f651b989c9a2c0c61 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 6 Oct 2018 21:14:29 -0400 Subject: [PATCH] Material API additions diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 387a0d7c..df5b0d38 100644 +index 6120955b1..c628a9349 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -72,6 +72,7 @@ import org.bukkit.material.MaterialData; +@@ -74,6 +74,7 @@ import org.jetbrains.annotations.Nullable; /** * An enum of all material IDs accepted by the official server and client */ @@ -16,7 +16,7 @@ index 387a0d7c..df5b0d38 100644 public enum Material implements Keyed { // ACACIA_BOAT(27326, 1), -@@ -2984,6 +2985,22 @@ public enum Material implements Keyed { +@@ -2986,6 +2987,22 @@ public enum Material implements Keyed { } } @@ -40,5 +40,5 @@ index 387a0d7c..df5b0d38 100644 * Do not use for any reason. * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0157-Add-Material-Tags.patch b/Spigot-API-Patches/0154-Add-Material-Tags.patch similarity index 89% rename from Spigot-API-Patches/0157-Add-Material-Tags.patch rename to Spigot-API-Patches/0154-Add-Material-Tags.patch index 960b43e514..7f088abc1e 100644 --- a/Spigot-API-Patches/0157-Add-Material-Tags.patch +++ b/Spigot-API-Patches/0154-Add-Material-Tags.patch @@ -1,4 +1,4 @@ -From c8d9c0624134b2d375f716b574d60c806367a650 Mon Sep 17 00:00:00 2001 +From bbddcaa72ff76ccf45773d20438a0c9982205e9c Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 17 Jul 2018 01:27:15 -0400 Subject: [PATCH] Add Material Tags @@ -8,10 +8,10 @@ are related to each other by a trait. diff --git a/src/main/java/com/destroystokyo/paper/MaterialSetTag.java b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java new file mode 100644 -index 00000000..b036c374 +index 000000000..c91ea2a06 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialSetTag.java -@@ -0,0 +1,171 @@ +@@ -0,0 +1,190 @@ +/* + * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License + */ @@ -33,6 +33,8 @@ index 00000000..b036c374 +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; ++import org.jetbrains.annotations.NotNull; ++import org.jetbrains.annotations.Nullable; + +public class MaterialSetTag implements Tag { + @@ -43,7 +45,7 @@ index 00000000..b036c374 + * @deprecated Use NamespacedKey version of constructor + */ + @Deprecated -+ public MaterialSetTag(Predicate filter) { ++ public MaterialSetTag(@NotNull Predicate filter) { + this(null, Stream.of(Material.values()).filter(filter).collect(Collectors.toList())); + } + @@ -51,7 +53,7 @@ index 00000000..b036c374 + * @deprecated Use NamespacedKey version of constructor + */ + @Deprecated -+ public MaterialSetTag(Collection materials) { ++ public MaterialSetTag(@NotNull Collection materials) { + this(null, materials); + } + @@ -59,123 +61,140 @@ index 00000000..b036c374 + * @deprecated Use NamespacedKey version of constructor + */ + @Deprecated -+ public MaterialSetTag(Material... materials) { ++ public MaterialSetTag(@NotNull Material... materials) { + this(null, materials); + } + -+ public MaterialSetTag(NamespacedKey key, Predicate filter) { ++ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Predicate filter) { + this(key, Stream.of(Material.values()).filter(filter).collect(Collectors.toList())); + } + -+ public MaterialSetTag(NamespacedKey key, Material... materials) { ++ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Material... materials) { + this(key, Lists.newArrayList(materials)); + } + -+ public MaterialSetTag(NamespacedKey key, Collection materials) { ++ public MaterialSetTag(@Nullable NamespacedKey key, @NotNull Collection materials) { + this.key = key != null ? key : NamespacedKey.randomKey(); + this.materials = Sets.newEnumSet(materials, Material.class); + } + ++ @NotNull + @Override + public NamespacedKey getKey() { + return key; + } + -+ public MaterialSetTag add(Tag... tags) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Tag... tags) { + for (Tag tag : tags) { + add(tag.getValues()); + } + return this; + } + -+ public MaterialSetTag add(MaterialSetTag... tags) { ++ @NotNull ++ public MaterialSetTag add(@NotNull MaterialSetTag... tags) { + for (Tag tag : tags) { + add(tag.getValues()); + } + return this; + } + -+ public MaterialSetTag add(Material... material) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Material... material) { + this.materials.addAll(Lists.newArrayList(material)); + return this; + } + -+ public MaterialSetTag add(Collection materials) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Collection materials) { + this.materials.addAll(materials); + return this; + } + -+ public MaterialSetTag contains(String with) { -+ return add(mat -> mat.name().contains(with)); } ++ @NotNull ++ public MaterialSetTag contains(@NotNull String with) { ++ return add(mat -> mat.name().contains(with)); ++ } + -+ public MaterialSetTag endsWith(String with) { ++ @NotNull ++ public MaterialSetTag endsWith(@NotNull String with) { + return add(mat -> mat.name().endsWith(with)); + } + + -+ public MaterialSetTag startsWith(String with) { ++ @NotNull ++ public MaterialSetTag startsWith(@NotNull String with) { + return add(mat -> mat.name().startsWith(with)); + } -+ -+ public MaterialSetTag add(Predicate filter) { ++ @NotNull ++ public MaterialSetTag add(@NotNull Predicate filter) { + add(Stream.of(Material.values()).filter(((Predicate) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList())); + return this; + } + -+ public MaterialSetTag not(MaterialSetTag tags) { ++ @NotNull ++ public MaterialSetTag not(@NotNull MaterialSetTag tags) { + not(tags.getValues()); + return this; + } + -+ public MaterialSetTag not(Material... material) { ++ @NotNull ++ public MaterialSetTag not(@NotNull Material... material) { + this.materials.removeAll(Lists.newArrayList(material)); + return this; + } + -+ public MaterialSetTag not(Collection materials) { ++ @NotNull ++ public MaterialSetTag not(@NotNull Collection materials) { + this.materials.removeAll(materials); + return this; + } + -+ public MaterialSetTag not(Predicate filter) { ++ @NotNull ++ public MaterialSetTag not(@NotNull Predicate filter) { + not(Stream.of(Material.values()).filter(((Predicate) Material::isLegacy).negate()).filter(filter).collect(Collectors.toList())); + return this; + } + -+ public MaterialSetTag notEndsWith(String with) { ++ @NotNull ++ public MaterialSetTag notEndsWith(@NotNull String with) { + return not(mat -> mat.name().endsWith(with)); + } + + -+ public MaterialSetTag notStartsWith(String with) { ++ @NotNull ++ public MaterialSetTag notStartsWith(@NotNull String with) { + return not(mat -> mat.name().startsWith(with)); + } + ++ @NotNull + public Set getValues() { + return this.materials; + } + -+ public boolean isTagged(BlockData block) { ++ public boolean isTagged(@NotNull BlockData block) { + return isTagged(block.getMaterial()); + } + -+ public boolean isTagged(BlockState block) { ++ public boolean isTagged(@NotNull BlockState block) { + return isTagged(block.getType()); + } + -+ public boolean isTagged(Block block) { ++ public boolean isTagged(@NotNull Block block) { + return isTagged(block.getType()); + } + -+ public boolean isTagged(ItemStack item) { ++ public boolean isTagged(@NotNull ItemStack item) { + return isTagged(item.getType()); + } + -+ public boolean isTagged(Material material) { ++ public boolean isTagged(@NotNull Material material) { + return this.materials.contains(material); + } + -+ public MaterialSetTag ensureSize(String label, int size) { ++ @NotNull ++ public MaterialSetTag ensureSize(@NotNull String label, int size) { + long actual = this.materials.stream().filter(((Predicate) Material::isLegacy).negate()).count(); + if (size != actual) { + throw new IllegalStateException(label + " - Expected " + size + " materials, got " + actual); @@ -185,7 +204,7 @@ index 00000000..b036c374 +} diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java new file mode 100644 -index 00000000..660191c2 +index 000000000..660191c24 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java @@ -0,0 +1,382 @@ @@ -573,7 +592,7 @@ index 00000000..660191c2 +} diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java new file mode 100644 -index 00000000..328c5147 +index 000000000..328c51471 --- /dev/null +++ b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java @@ -0,0 +1,25 @@ @@ -603,7 +622,7 @@ index 00000000..328c5147 + } +} diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java -index 2d840320..613675c3 100644 +index 2d8403206..613675c3b 100644 --- a/src/test/java/org/bukkit/TestServer.java +++ b/src/test/java/org/bukkit/TestServer.java @@ -30,6 +30,16 @@ public class TestServer implements InvocationHandler { @@ -624,5 +643,5 @@ index 2d840320..613675c3 100644 Server.class.getMethod("getPluginManager"), new MethodHandler() { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0158-Allow-setting-the-vex-s-summoner.patch b/Spigot-API-Patches/0155-Allow-setting-the-vex-s-summoner.patch similarity index 62% rename from Spigot-API-Patches/0158-Allow-setting-the-vex-s-summoner.patch rename to Spigot-API-Patches/0155-Allow-setting-the-vex-s-summoner.patch index 6d0fdada8a..156bb47e3b 100644 --- a/Spigot-API-Patches/0158-Allow-setting-the-vex-s-summoner.patch +++ b/Spigot-API-Patches/0155-Allow-setting-the-vex-s-summoner.patch @@ -1,33 +1,41 @@ -From 6772c9bcb0f4cad1a8f63120a2b266bd1b129a46 Mon Sep 17 00:00:00 2001 +From 09b1a9e70d255773b6a9f16d41b15f1a4256a596 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 6 Oct 2018 21:47:09 -0500 Subject: [PATCH] Allow setting the vex's summoner diff --git a/src/main/java/org/bukkit/entity/Vex.java b/src/main/java/org/bukkit/entity/Vex.java -index 7b9b21e5..23a15f8f 100644 +index 6b61c4ab7..c34a3ea7b 100644 --- a/src/main/java/org/bukkit/entity/Vex.java +++ b/src/main/java/org/bukkit/entity/Vex.java -@@ -23,8 +23,19 @@ public interface Vex extends Monster { +@@ -1,5 +1,7 @@ + package org.bukkit.entity; + ++import org.jetbrains.annotations.Nullable; ++ + /** + * Represents a Vex. + */ +@@ -22,4 +24,21 @@ public interface Vex extends Monster { + * @param charging new state */ void setCharging(boolean charging); - ++ + // Paper start - /** -- * @return What Entity (most likely an Evoker, but not guaranteed) summoned this Vex ++ /** + * Get the Mob that summoned this vex + * + * @return Mob that summoned this vex + */ ++ @Nullable + Mob getSummoner(); + + /** + * Set the summoner of this vex + * + * @param summoner New summoner - */ -- Mob getSummoner(); // Paper -+ void setSummoner(Mob summoner); ++ */ ++ void setSummoner(@Nullable Mob summoner); + // Paper end } -- diff --git a/Spigot-API-Patches/0159-Add-LivingEntity-getTargetEntity.patch b/Spigot-API-Patches/0156-Add-LivingEntity-getTargetEntity.patch similarity index 86% rename from Spigot-API-Patches/0159-Add-LivingEntity-getTargetEntity.patch rename to Spigot-API-Patches/0156-Add-LivingEntity-getTargetEntity.patch index 610d042645..14840030e1 100644 --- a/Spigot-API-Patches/0159-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-API-Patches/0156-Add-LivingEntity-getTargetEntity.patch @@ -1,4 +1,4 @@ -From 5b16902a69bb432dfb8d97274e555db0a4b4593e Mon Sep 17 00:00:00 2001 +From 6fa603fb50284943a6142bb69261ad2c830ec573 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 22 Sep 2018 00:32:53 -0500 Subject: [PATCH] Add LivingEntity#getTargetEntity @@ -6,14 +6,15 @@ Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/com/destroystokyo/paper/entity/TargetEntityInfo.java b/src/main/java/com/destroystokyo/paper/entity/TargetEntityInfo.java new file mode 100644 -index 00000000..5df8eed2 +index 000000000..f52644fab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/TargetEntityInfo.java -@@ -0,0 +1,35 @@ +@@ -0,0 +1,38 @@ +package com.destroystokyo.paper.entity; + +import org.bukkit.entity.Entity; +import org.bukkit.util.Vector; ++import org.jetbrains.annotations.NotNull; + +/** + * Represents information about a targeted entity @@ -22,7 +23,7 @@ index 00000000..5df8eed2 + private final Entity entity; + private final Vector hitVec; + -+ public TargetEntityInfo(Entity entity, Vector hitVec) { ++ public TargetEntityInfo(@NotNull Entity entity, @NotNull Vector hitVec) { + this.entity = entity; + this.hitVec = hitVec; + } @@ -32,6 +33,7 @@ index 00000000..5df8eed2 + * + * @return Targeted entity + */ ++ @NotNull + public Entity getEntity() { + return entity; + } @@ -41,18 +43,19 @@ index 00000000..5df8eed2 + * + * @return Targeted position + */ ++ @NotNull + public Vector getHitVector() { + return hitVec; + } +} diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java -index bd47e720..34a8fe3f 100644 +index 4dec50caf..956d68867 100644 --- a/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java -@@ -147,6 +147,50 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource +@@ -150,6 +150,50 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource */ @Nullable - public com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); + public com.destroystokyo.paper.block.TargetBlockInfo getTargetBlockInfo(int maxDistance, @NotNull com.destroystokyo.paper.block.TargetBlockInfo.FluidMode fluidMode); + + /** + * Gets information about the entity being targeted @@ -101,5 +104,5 @@ index bd47e720..34a8fe3f 100644 /** -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0160-Add-sun-related-API.patch b/Spigot-API-Patches/0157-Add-sun-related-API.patch similarity index 77% rename from Spigot-API-Patches/0160-Add-sun-related-API.patch rename to Spigot-API-Patches/0157-Add-sun-related-API.patch index 69ad69ea5d..11580bafd9 100644 --- a/Spigot-API-Patches/0160-Add-sun-related-API.patch +++ b/Spigot-API-Patches/0157-Add-sun-related-API.patch @@ -1,14 +1,14 @@ -From c8019b1cd152eef680b20214289460008c9e6ebc Mon Sep 17 00:00:00 2001 +From e335fe35e65c3d2a72b29e1b289261bbaebf205f Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 Oct 2018 00:54:15 -0500 Subject: [PATCH] Add sun related API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 60b7f2e3..5df75830 100644 +index 6b91635fe..3d8ff98a8 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1449,6 +1449,16 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1518,6 +1518,16 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public void setFullTime(long time); @@ -26,12 +26,12 @@ index 60b7f2e3..5df75830 100644 * Returns whether the world has an ongoing storm. * diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java -index 48eddcd3..1b108a4a 100644 +index afdc103fe..784db447d 100644 --- a/src/main/java/org/bukkit/entity/Mob.java +++ b/src/main/java/org/bukkit/entity/Mob.java -@@ -13,6 +13,13 @@ public interface Mob extends LivingEntity, Lootable { - * @return Pathfinding Manager for this entity +@@ -16,6 +16,13 @@ public interface Mob extends LivingEntity, Lootable { */ + @NotNull com.destroystokyo.paper.entity.Pathfinder getPathfinder(); + + /** @@ -44,5 +44,5 @@ index 48eddcd3..1b108a4a 100644 /** -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0161-Here-s-Johnny.patch b/Spigot-API-Patches/0158-Here-s-Johnny.patch similarity index 93% rename from Spigot-API-Patches/0161-Here-s-Johnny.patch rename to Spigot-API-Patches/0158-Here-s-Johnny.patch index a393d45c31..a96974e6c2 100644 --- a/Spigot-API-Patches/0161-Here-s-Johnny.patch +++ b/Spigot-API-Patches/0158-Here-s-Johnny.patch @@ -1,11 +1,11 @@ -From 4e522467653f5c36e8d56ecacc4761df3aaffa32 Mon Sep 17 00:00:00 2001 +From 3b65f3403373f14a5e09ef83dc71bdf9ed3b634b Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 12 Oct 2018 01:37:16 -0500 Subject: [PATCH] Here's Johnny! diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java -index b8ea68a8..c5d9e76a 100644 +index b8ea68a8f..c5d9e76a6 100644 --- a/src/main/java/org/bukkit/entity/Vindicator.java +++ b/src/main/java/org/bukkit/entity/Vindicator.java @@ -3,4 +3,30 @@ package org.bukkit.entity; @@ -41,5 +41,5 @@ index b8ea68a8..c5d9e76a 100644 + // Paper end +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0162-Turtle-API.patch b/Spigot-API-Patches/0159-Turtle-API.patch similarity index 86% rename from Spigot-API-Patches/0162-Turtle-API.patch rename to Spigot-API-Patches/0159-Turtle-API.patch index 29d113cb87..e3c2d98c25 100644 --- a/Spigot-API-Patches/0162-Turtle-API.patch +++ b/Spigot-API-Patches/0159-Turtle-API.patch @@ -1,4 +1,4 @@ -From 75a0af25d86a09f7d0595a74b0e8fa36bc31cefc Mon Sep 17 00:00:00 2001 +From 6db595ca8a00176a0c80b9099899814b82387532 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 28 Sep 2018 17:08:09 -0500 Subject: [PATCH] Turtle API @@ -6,16 +6,17 @@ Subject: [PATCH] Turtle API diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java new file mode 100644 -index 00000000..11248ee9 +index 000000000..021356d15 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleGoHomeEvent.java -@@ -0,0 +1,45 @@ +@@ -0,0 +1,49 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.entity.Turtle; +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Turtle decides to go home @@ -24,7 +25,7 @@ index 00000000..11248ee9 + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; + -+ public TurtleGoHomeEvent(Turtle turtle) { ++ public TurtleGoHomeEvent(@NotNull Turtle turtle) { + super(turtle); + } + @@ -33,6 +34,7 @@ index 00000000..11248ee9 + * + * @return The turtle + */ ++ @NotNull + public Turtle getEntity() { + return (Turtle) entity; + } @@ -47,20 +49,22 @@ index 00000000..11248ee9 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java new file mode 100644 -index 00000000..7cb00f78 +index 000000000..a315c5185 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleLayEggEvent.java -@@ -0,0 +1,81 @@ +@@ -0,0 +1,87 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.Location; @@ -68,6 +72,7 @@ index 00000000..7cb00f78 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Turtle lays eggs @@ -75,10 +80,11 @@ index 00000000..7cb00f78 +public class TurtleLayEggEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; ++ @NotNull + private final Location location; + private int eggCount; + -+ public TurtleLayEggEvent(Turtle turtle, Location location, int eggCount) { ++ public TurtleLayEggEvent(@NotNull Turtle turtle, @NotNull Location location, int eggCount) { + super(turtle); + this.location = location; + this.eggCount = eggCount; @@ -89,6 +95,7 @@ index 00000000..7cb00f78 + * + * @return The turtle + */ ++ @NotNull + public Turtle getEntity() { + return (Turtle) entity; + } @@ -98,6 +105,7 @@ index 00000000..7cb00f78 + * + * @return Location of eggs + */ ++ @NotNull + public Location getLocation() { + return location; + } @@ -134,20 +142,22 @@ index 00000000..7cb00f78 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java new file mode 100644 -index 00000000..5d53ee08 +index 000000000..abeb24fcc --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/entity/TurtleStartDiggingEvent.java -@@ -0,0 +1,57 @@ +@@ -0,0 +1,62 @@ +package com.destroystokyo.paper.event.entity; + +import org.bukkit.Location; @@ -155,6 +165,7 @@ index 00000000..5d53ee08 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.entity.EntityEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired when a Turtle starts digging to lay eggs @@ -162,9 +173,9 @@ index 00000000..5d53ee08 +public class TurtleStartDiggingEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled = false; -+ private final Location location; ++ @NotNull private final Location location; + -+ public TurtleStartDiggingEvent(Turtle turtle, Location location) { ++ public TurtleStartDiggingEvent(@NotNull Turtle turtle, @NotNull Location location) { + super(turtle); + this.location = location; + } @@ -174,6 +185,7 @@ index 00000000..5d53ee08 + * + * @return The turtle + */ ++ @NotNull + public Turtle getEntity() { + return (Turtle) entity; + } @@ -183,6 +195,7 @@ index 00000000..5d53ee08 + * + * @return Location where digging + */ ++ @NotNull + public Location getLocation() { + return location; + } @@ -197,22 +210,25 @@ index 00000000..5d53ee08 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} diff --git a/src/main/java/org/bukkit/entity/Turtle.java b/src/main/java/org/bukkit/entity/Turtle.java -index 0a4cd299..e547eead 100644 +index 0a4cd2993..5375ea140 100644 --- a/src/main/java/org/bukkit/entity/Turtle.java +++ b/src/main/java/org/bukkit/entity/Turtle.java -@@ -1,6 +1,53 @@ +@@ -1,6 +1,55 @@ package org.bukkit.entity; +import org.bukkit.Location; ++import org.jetbrains.annotations.NotNull; + /** * Represents a turtle. @@ -226,6 +242,7 @@ index 0a4cd299..e547eead 100644 + * + * @return Home location + */ ++ @NotNull + Location getHome(); + + /** @@ -233,7 +250,7 @@ index 0a4cd299..e547eead 100644 + * + * @param location Home location + */ -+ void setHome(Location location); ++ void setHome(@NotNull Location location); + + /** + * Check if turtle is currently pathfinding to it's home @@ -265,5 +282,5 @@ index 0a4cd299..e547eead 100644 + // Paper end +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0163-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-API-Patches/0160-Implement-getters-and-setters-for-EntityItem-owner-a.patch similarity index 80% rename from Spigot-API-Patches/0163-Implement-getters-and-setters-for-EntityItem-owner-a.patch rename to Spigot-API-Patches/0160-Implement-getters-and-setters-for-EntityItem-owner-a.patch index 21c13693ae..0b0275aa39 100644 --- a/Spigot-API-Patches/0163-Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-API-Patches/0160-Implement-getters-and-setters-for-EntityItem-owner-a.patch @@ -1,4 +1,4 @@ -From 3de2f2a6f5cb2f4170ad57b5d3e777eb01dcc498 Mon Sep 17 00:00:00 2001 +From 780eced4ecaac2ce7ce8917c2ee853267a7cf5ab Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 6 Oct 2018 20:54:13 -0500 Subject: [PATCH] Implement getters and setters for EntityItem owner and @@ -6,22 +6,21 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java -index 2e98e4f9..8049b36c 100644 +index cb9e9f369..a15f70ff4 100644 --- a/src/main/java/org/bukkit/entity/Item.java +++ b/src/main/java/org/bukkit/entity/Item.java -@@ -2,6 +2,11 @@ package org.bukkit.entity; - - import org.bukkit.inventory.ItemStack; +@@ -4,6 +4,10 @@ import org.bukkit.inventory.ItemStack; + import org.jetbrains.annotations.NotNull; + import org.jetbrains.annotations.Nullable; +// Paper start -+import javax.annotation.Nullable; +import java.util.UUID; +// Paper end + /** - * Represents an Item. + * Represents a dropped item. */ -@@ -49,5 +54,35 @@ public interface Item extends Entity { +@@ -52,5 +56,35 @@ public interface Item extends Entity { * @param canMobPickup True to allow non-player entity pickup */ public void setCanMobPickup(boolean canMobPickup); @@ -58,5 +57,5 @@ index 2e98e4f9..8049b36c 100644 // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0164-Add-spectator-target-events.patch b/Spigot-API-Patches/0161-Add-spectator-target-events.patch similarity index 83% rename from Spigot-API-Patches/0164-Add-spectator-target-events.patch rename to Spigot-API-Patches/0161-Add-spectator-target-events.patch index 5b5a7cdb75..aa00ffd4f6 100644 --- a/Spigot-API-Patches/0164-Add-spectator-target-events.patch +++ b/Spigot-API-Patches/0161-Add-spectator-target-events.patch @@ -1,4 +1,4 @@ -From 19c3c18e12483a2c261ede1825cd2408bf3ee3b5 Mon Sep 17 00:00:00 2001 +From e8268de43dc2e72d6643eb0ba83d6e625e0f6c32 Mon Sep 17 00:00:00 2001 From: Caleb Bassham Date: Fri, 28 Sep 2018 02:30:56 -0500 Subject: [PATCH] Add spectator target events @@ -8,10 +8,10 @@ Subject: [PATCH] Add spectator target events diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerStartSpectatingEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerStartSpectatingEntityEvent.java new file mode 100644 -index 00000000..d3b7cc27 +index 000000000..b8ec7ef2d --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerStartSpectatingEntityEvent.java -@@ -0,0 +1,62 @@ +@@ -0,0 +1,67 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Entity; @@ -19,6 +19,7 @@ index 00000000..d3b7cc27 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Triggered when a player starts spectating an entity in spectator mode. @@ -27,10 +28,10 @@ index 00000000..d3b7cc27 + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private final Entity currentSpectatorTarget; -+ private final Entity newSpectatorTarget; ++ @NotNull private final Entity currentSpectatorTarget; ++ @NotNull private final Entity newSpectatorTarget; + -+ public PlayerStartSpectatingEntityEvent(Player player, Entity currentSpectatorTarget, Entity newSpectatorTarget) { ++ public PlayerStartSpectatingEntityEvent(@NotNull Player player, @NotNull Entity currentSpectatorTarget, @NotNull Entity newSpectatorTarget) { + super(player); + this.currentSpectatorTarget = currentSpectatorTarget; + this.newSpectatorTarget = newSpectatorTarget; @@ -41,6 +42,7 @@ index 00000000..d3b7cc27 + * + * @return The entity the player is currently spectating (before they start spectating the new target). + */ ++ @NotNull + public Entity getCurrentSpectatorTarget() { + return currentSpectatorTarget; + } @@ -50,6 +52,7 @@ index 00000000..d3b7cc27 + * + * @return The entity the player is now going to be spectating. + */ ++ @NotNull + public Entity getNewSpectatorTarget() { + return newSpectatorTarget; + } @@ -64,11 +67,13 @@ index 00000000..d3b7cc27 + this.cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } @@ -76,10 +81,10 @@ index 00000000..d3b7cc27 + diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerStopSpectatingEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerStopSpectatingEntityEvent.java new file mode 100644 -index 00000000..ce23caaf +index 000000000..693d119ab --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerStopSpectatingEntityEvent.java -@@ -0,0 +1,50 @@ +@@ -0,0 +1,54 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.entity.Entity; @@ -87,6 +92,7 @@ index 00000000..ce23caaf +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.player.PlayerEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Triggered when a player stops spectating an entity in spectator mode. @@ -95,9 +101,9 @@ index 00000000..ce23caaf + + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; -+ private final Entity spectatorTarget; ++ @NotNull private final Entity spectatorTarget; + -+ public PlayerStopSpectatingEntityEvent(Player player, Entity spectatorTarget) { ++ public PlayerStopSpectatingEntityEvent(@NotNull Player player, @NotNull Entity spectatorTarget) { + super(player); + this.spectatorTarget = spectatorTarget; + } @@ -107,6 +113,7 @@ index 00000000..ce23caaf + * + * @return The entity the player is currently spectating (before they will stop). + */ ++ @NotNull + public Entity getSpectatorTarget() { + return spectatorTarget; + } @@ -121,15 +128,17 @@ index 00000000..ce23caaf + this.cancelled = cancel; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0165-Add-more-Witch-API.patch b/Spigot-API-Patches/0162-Add-more-Witch-API.patch similarity index 86% rename from Spigot-API-Patches/0165-Add-more-Witch-API.patch rename to Spigot-API-Patches/0162-Add-more-Witch-API.patch index c26badf933..02f086d575 100644 --- a/Spigot-API-Patches/0165-Add-more-Witch-API.patch +++ b/Spigot-API-Patches/0162-Add-more-Witch-API.patch @@ -1,20 +1,20 @@ -From e2fce2bde4ea1d8fc5335c5de982d933d770f5b1 Mon Sep 17 00:00:00 2001 +From 3365caed03fea3f98a35b79d1a6bf10b23f652dc Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 12 Oct 2018 03:47:26 -0500 Subject: [PATCH] Add more Witch API diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java -index 4b27f689..64ec8409 100644 +index 4b27f6890..1828b2ced 100644 --- a/src/main/java/org/bukkit/entity/Witch.java +++ b/src/main/java/org/bukkit/entity/Witch.java -@@ -2,8 +2,42 @@ package org.bukkit.entity; +@@ -2,8 +2,43 @@ package org.bukkit.entity; import com.destroystokyo.paper.entity.RangedEntity; +// Paper start +import org.bukkit.inventory.ItemStack; -+import javax.annotation.Nullable; ++import org.jetbrains.annotations.Nullable; +// Paper end + /** @@ -42,6 +42,7 @@ index 4b27f689..64ec8409 100644 + * + * @return The potion the witch is drinking + */ ++ @Nullable + ItemStack getDrinkingPotion(); + + /** @@ -53,5 +54,5 @@ index 4b27f689..64ec8409 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0166-Make-the-default-permission-message-configurable.patch b/Spigot-API-Patches/0163-Make-the-default-permission-message-configurable.patch similarity index 84% rename from Spigot-API-Patches/0166-Make-the-default-permission-message-configurable.patch rename to Spigot-API-Patches/0163-Make-the-default-permission-message-configurable.patch index 165bba0ec5..a82786ba67 100644 --- a/Spigot-API-Patches/0166-Make-the-default-permission-message-configurable.patch +++ b/Spigot-API-Patches/0163-Make-the-default-permission-message-configurable.patch @@ -1,14 +1,14 @@ -From bc3c78864ba112943c7d86ca3759deb413bef261 Mon Sep 17 00:00:00 2001 +From d719713cdce6b07c8370daba53b6d8d7f1558722 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 18 Nov 2018 19:44:54 +0000 Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java -index cbabd807..2ab73439 100644 +index 19fb0e5d2..6b0a09067 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java -@@ -1510,6 +1510,14 @@ public final class Bukkit { +@@ -1589,6 +1589,15 @@ public final class Bukkit { return server.suggestPlayerNamesWhenNullTabCompletions(); } @@ -16,6 +16,7 @@ index cbabd807..2ab73439 100644 + * + * @return the default no permission message used on the server + */ ++ @NotNull + public static String getPermissionMessage() { + return server.getPermissionMessage(); + } @@ -24,10 +25,10 @@ index cbabd807..2ab73439 100644 * Creates a PlayerProfile for the specified uuid, with name as null * @param uuid UUID to create profile for diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java -index 9c5049cd..7c7725a7 100644 +index 1df58f72a..66d22ba79 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java -@@ -1308,6 +1308,12 @@ public interface Server extends PluginMessageRecipient { +@@ -1392,6 +1392,13 @@ public interface Server extends PluginMessageRecipient { */ boolean suggestPlayerNamesWhenNullTabCompletions(); @@ -35,16 +36,17 @@ index 9c5049cd..7c7725a7 100644 + * + * @return the default no permission message used on the server + */ ++ @NotNull + String getPermissionMessage(); + /** * Creates a PlayerProfile for the specified uuid, with name as null * @param uuid UUID to create profile for diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java -index db7f4428..77171cd1 100644 +index 01ea1ca67..de016865f 100644 --- a/src/main/java/org/bukkit/command/Command.java +++ b/src/main/java/org/bukkit/command/Command.java -@@ -180,7 +180,7 @@ public abstract class Command { +@@ -187,7 +187,7 @@ public abstract class Command { } if (permissionMessage == null) { @@ -54,5 +56,5 @@ index db7f4428..77171cd1 100644 for (String line : permissionMessage.replace("", permission).split("\n")) { target.sendMessage(line); -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0167-Support-cancellation-supression-of-EntityDismount-Ve.patch b/Spigot-API-Patches/0164-Support-cancellation-supression-of-EntityDismount-Ve.patch similarity index 77% rename from Spigot-API-Patches/0167-Support-cancellation-supression-of-EntityDismount-Ve.patch rename to Spigot-API-Patches/0164-Support-cancellation-supression-of-EntityDismount-Ve.patch index 6e0ad3897e..eecc8841ef 100644 --- a/Spigot-API-Patches/0167-Support-cancellation-supression-of-EntityDismount-Ve.patch +++ b/Spigot-API-Patches/0164-Support-cancellation-supression-of-EntityDismount-Ve.patch @@ -1,4 +1,4 @@ -From 1484d7420d942becf9541480ff5a77dbc5a4e0e7 Mon Sep 17 00:00:00 2001 +From 4e2017501e66dc245fbf331a39e74e195f1ca38a Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 18 Nov 2018 15:53:43 +0000 Subject: [PATCH] Support cancellation supression of EntityDismount/VehicleExit @@ -21,30 +21,30 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java -index 364451b5..b3269db2 100644 +index 69c9e499a..f0c0bae56 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java +++ b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java -@@ -12,10 +12,18 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable { +@@ -13,10 +13,18 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean cancelled; private final LivingEntity exited; + private final boolean isCancellable; // Paper -- public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) { -+ public VehicleExitEvent(Vehicle vehicle, LivingEntity exited, boolean isCancellable) { // Paper +- public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited) { ++ public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited, boolean isCancellable) { // Paper super(vehicle); this.exited = exited; + // Paper start + this.isCancellable = isCancellable; + } + -+ public VehicleExitEvent(final Vehicle vehicle, final LivingEntity exited) { ++ public VehicleExitEvent(@NotNull final Vehicle vehicle, @NotNull final LivingEntity exited) { + this(vehicle, exited, true); + // Paper end } /** -@@ -32,9 +40,18 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable { +@@ -34,9 +42,18 @@ public class VehicleExitEvent extends VehicleEvent implements Cancellable { } public void setCancelled(boolean cancel) { @@ -60,26 +60,26 @@ index 364451b5..b3269db2 100644 + // paper end + } + + @NotNull @Override public HandlerList getHandlers() { - return handlers; diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -index 4110d3bb..555899ef 100644 +index a473b2c6e..a5b4aed52 100644 --- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java +++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -@@ -15,11 +15,20 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable +@@ -16,11 +16,20 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable private static final HandlerList handlers = new HandlerList(); private boolean cancelled; private final Entity dismounted; + private final boolean isCancellable; // Paper - public EntityDismountEvent(Entity what, Entity dismounted) + public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) { + // Paper start + this(what, dismounted, true); + } + -+ public EntityDismountEvent(Entity what, Entity dismounted, boolean isCancellable) ++ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) + { + // Paper end super( what ); @@ -87,8 +87,8 @@ index 4110d3bb..555899ef 100644 + this.isCancellable = isCancellable; // Paper } - public Entity getDismounted() -@@ -36,9 +45,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable + @NotNull +@@ -38,9 +47,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable @Override public void setCancelled(boolean cancel) { @@ -104,9 +104,9 @@ index 4110d3bb..555899ef 100644 + // Paper end + } + + @NotNull @Override public HandlerList getHandlers() - { -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0168-Add-more-Zombie-API.patch b/Spigot-API-Patches/0165-Add-more-Zombie-API.patch similarity index 90% rename from Spigot-API-Patches/0168-Add-more-Zombie-API.patch rename to Spigot-API-Patches/0165-Add-more-Zombie-API.patch index 02287b310f..eafb1bbe5b 100644 --- a/Spigot-API-Patches/0168-Add-more-Zombie-API.patch +++ b/Spigot-API-Patches/0165-Add-more-Zombie-API.patch @@ -1,14 +1,14 @@ -From f432f757bef12b2fe5fa0100e812a3f6433c891c Mon Sep 17 00:00:00 2001 +From cf45e86b812cf3bd808c94d8c44bfc5e7497c2ea Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 Oct 2018 04:29:51 -0500 Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java -index 48034198..615dd990 100644 +index ee2e70c67..74d6529a1 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java -@@ -79,4 +79,55 @@ public interface Zombie extends Monster { +@@ -86,4 +86,55 @@ public interface Zombie extends Monster { * @param time new conversion time */ void setConversionTime(int time); @@ -65,5 +65,5 @@ index 48034198..615dd990 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0169-Change-the-reserved-channel-check-to-be-sensible.patch b/Spigot-API-Patches/0166-Change-the-reserved-channel-check-to-be-sensible.patch similarity index 82% rename from Spigot-API-Patches/0169-Change-the-reserved-channel-check-to-be-sensible.patch rename to Spigot-API-Patches/0166-Change-the-reserved-channel-check-to-be-sensible.patch index fef861c5bb..5fdde57bc8 100644 --- a/Spigot-API-Patches/0169-Change-the-reserved-channel-check-to-be-sensible.patch +++ b/Spigot-API-Patches/0166-Change-the-reserved-channel-check-to-be-sensible.patch @@ -1,24 +1,24 @@ -From 4cc75cfb9c7d1963c112c51c58fd0e5e6f2afcb0 Mon Sep 17 00:00:00 2001 +From af85993179d88c676d2fa478cd9c4756947700cd Mon Sep 17 00:00:00 2001 From: DoNotSpamPls <7570108+DoNotSpamPls@users.noreply.github.com> Date: Tue, 23 Oct 2018 19:32:55 +0300 Subject: [PATCH] Change the reserved channel check to be sensible diff --git a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java -index f21cae72..865028d3 100644 +index 8227b375e..cc750eb3e 100644 --- a/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java +++ b/src/main/java/org/bukkit/plugin/messaging/StandardMessenger.java -@@ -170,7 +170,7 @@ public class StandardMessenger implements Messenger { - public boolean isReservedChannel(String channel) { +@@ -171,7 +171,7 @@ public class StandardMessenger implements Messenger { + public boolean isReservedChannel(@NotNull String channel) { channel = validateAndCorrectChannel(channel); - return channel.contains("minecraft") && !channel.equals("minecraft:brand"); + return channel.equals("minecraft:register") || channel.equals("minecraft:unregister"); // Paper } - public void registerOutgoingPluginChannel(Plugin plugin, String channel) { + public void registerOutgoingPluginChannel(@NotNull Plugin plugin, @NotNull String channel) { diff --git a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java -index c15fa003..31ff2f61 100644 +index c15fa0039..31ff2f61d 100644 --- a/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java +++ b/src/test/java/org/bukkit/plugin/messaging/StandardMessengerTest.java @@ -25,8 +25,8 @@ public class StandardMessengerTest { @@ -33,5 +33,5 @@ index c15fa003..31ff2f61 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0170-Add-PlayerConnectionCloseEvent.patch b/Spigot-API-Patches/0167-Add-PlayerConnectionCloseEvent.patch similarity index 89% rename from Spigot-API-Patches/0170-Add-PlayerConnectionCloseEvent.patch rename to Spigot-API-Patches/0167-Add-PlayerConnectionCloseEvent.patch index 54a932d350..520c0f3803 100644 --- a/Spigot-API-Patches/0170-Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-API-Patches/0167-Add-PlayerConnectionCloseEvent.patch @@ -1,4 +1,4 @@ -From b3c5a341cc4f504868ebc181f2396dd4b4db4d03 Mon Sep 17 00:00:00 2001 +From a6886e4d276b22e0ec55a6550ca6a853371df5e1 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 7 Oct 2018 12:05:06 -0700 Subject: [PATCH] Add PlayerConnectionCloseEvent @@ -35,10 +35,10 @@ is undefined. diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java new file mode 100644 -index 00000000..80896bbf +index 000000000..12c1c6fe9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerConnectionCloseEvent.java -@@ -0,0 +1,89 @@ +@@ -0,0 +1,95 @@ +package com.destroystokyo.paper.event.player; + +import org.bukkit.event.Event; @@ -46,6 +46,7 @@ index 00000000..80896bbf + +import java.net.InetAddress; +import java.util.UUID; ++import org.jetbrains.annotations.NotNull; + +/** + *

@@ -87,11 +88,11 @@ index 00000000..80896bbf + + private static final HandlerList HANDLERS = new HandlerList(); + -+ private final UUID playerUniqueId; -+ private final String playerName; -+ private final InetAddress ipAddress; ++ @NotNull private final UUID playerUniqueId; ++ @NotNull private final String playerName; ++ @NotNull private final InetAddress ipAddress; + -+ public PlayerConnectionCloseEvent(final UUID playerUniqueId, final String playerName, final InetAddress ipAddress, final boolean async) { ++ public PlayerConnectionCloseEvent(@NotNull final UUID playerUniqueId, @NotNull final String playerName, @NotNull final InetAddress ipAddress, final boolean async) { + super(async); + this.playerUniqueId = playerUniqueId; + this.playerName = playerName; @@ -101,6 +102,7 @@ index 00000000..80896bbf + /** + * Returns the {@code UUID} of the player disconnecting. + */ ++ @NotNull + public UUID getPlayerUniqueId() { + return this.playerUniqueId; + } @@ -108,6 +110,7 @@ index 00000000..80896bbf + /** + * Returns the name of the player disconnecting. + */ ++ @NotNull + public String getPlayerName() { + return this.playerName; + } @@ -115,19 +118,22 @@ index 00000000..80896bbf + /** + * Returns the player's IP address. + */ ++ @NotNull + public InetAddress getIpAddress() { + return this.ipAddress; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return HANDLERS; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return HANDLERS; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0171-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-API-Patches/0168-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 90% rename from Spigot-API-Patches/0171-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to Spigot-API-Patches/0168-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index 917f8c1396..7e4d37f0ef 100644 --- a/Spigot-API-Patches/0171-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-API-Patches/0168-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -1,4 +1,4 @@ -From 3eddb9b4bba48acf8e104d0df6fe67cb5be7167d Mon Sep 17 00:00:00 2001 +From d1d6e116f40122181478b2577a8de5f1e484a344 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Jan 2019 00:31:12 -0600 Subject: [PATCH] Add APIs to replace OfflinePlayer#getLastPlayed @@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java -index 658eac26..335d3803 100644 +index 919d1b66a..30195c045 100644 --- a/src/main/java/org/bukkit/OfflinePlayer.java +++ b/src/main/java/org/bukkit/OfflinePlayer.java -@@ -135,7 +135,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio +@@ -145,7 +145,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio * UTC. * * @return Date of last log-in for this player, or 0 @@ -29,8 +29,8 @@ index 658eac26..335d3803 100644 public long getLastPlayed(); /** -@@ -153,4 +155,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio - */ +@@ -164,4 +166,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio + @Nullable public Location getBedSpawnLocation(); + // Paper start @@ -61,5 +61,5 @@ index 658eac26..335d3803 100644 + } -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0172-BlockDestroyEvent.patch b/Spigot-API-Patches/0169-BlockDestroyEvent.patch similarity index 90% rename from Spigot-API-Patches/0172-BlockDestroyEvent.patch rename to Spigot-API-Patches/0169-BlockDestroyEvent.patch index a0479d2c52..b020b1d9ff 100644 --- a/Spigot-API-Patches/0172-BlockDestroyEvent.patch +++ b/Spigot-API-Patches/0169-BlockDestroyEvent.patch @@ -1,4 +1,4 @@ -From b893b69e6c29a4b590d43c8b10d04b5a303f1b9d Mon Sep 17 00:00:00 2001 +From e0e3f70a6b3bd804ad5eee80d9cd98bd68c04e10 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 6 Feb 2019 00:19:33 -0500 Subject: [PATCH] BlockDestroyEvent @@ -12,10 +12,10 @@ This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java new file mode 100644 -index 00000000..a6247718 +index 000000000..3aee12f1c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/block/BlockDestroyEvent.java -@@ -0,0 +1,88 @@ +@@ -0,0 +1,92 @@ +package com.destroystokyo.paper.event.block; + +import org.bukkit.block.Block; @@ -23,6 +23,7 @@ index 00000000..a6247718 +import org.bukkit.event.Cancellable; +import org.bukkit.event.HandlerList; +import org.bukkit.event.block.BlockEvent; ++import org.jetbrains.annotations.NotNull; + +/** + * Fired anytime the server intends to 'destroy' a block through some triggering reason. @@ -39,13 +40,13 @@ index 00000000..a6247718 + + private static final HandlerList handlers = new HandlerList(); + -+ private final BlockData newState; ++ @NotNull private final BlockData newState; + private final boolean willDrop; + private boolean playEffect; + + private boolean cancelled = false; + -+ public BlockDestroyEvent(Block block, BlockData newState, boolean willDrop) { ++ public BlockDestroyEvent(@NotNull Block block, @NotNull BlockData newState, boolean willDrop) { + super(block); + this.newState = newState; + this.willDrop = willDrop; @@ -54,6 +55,7 @@ index 00000000..a6247718 + /** + * @return The new state of this block (Air, or a Fluid type) + */ ++ @NotNull + public BlockData getNewState() { + return newState; + } @@ -96,14 +98,16 @@ index 00000000..a6247718 + cancelled = cancel; + } + ++ @NotNull + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } +} -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0173-Add-ItemStack-Recipe-API-helper-methods.patch b/Spigot-API-Patches/0170-Add-ItemStack-Recipe-API-helper-methods.patch similarity index 68% rename from Spigot-API-Patches/0173-Add-ItemStack-Recipe-API-helper-methods.patch rename to Spigot-API-Patches/0170-Add-ItemStack-Recipe-API-helper-methods.patch index e51bba0925..4e9a8655c7 100644 --- a/Spigot-API-Patches/0173-Add-ItemStack-Recipe-API-helper-methods.patch +++ b/Spigot-API-Patches/0170-Add-ItemStack-Recipe-API-helper-methods.patch @@ -1,4 +1,4 @@ -From d04f42f8268047da4b892c77ddb9f534a302bb44 Mon Sep 17 00:00:00 2001 +From 6f20f63b0dbe9562c28f5332c0e8920e476b1bea Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 28 Jan 2014 19:13:57 -0500 Subject: [PATCH] Add ItemStack Recipe API helper methods @@ -6,15 +6,16 @@ Subject: [PATCH] Add ItemStack Recipe API helper methods Allows using ExactChoice Recipes with easier methodss diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -index 80af6cf5..3eae5a55 100644 +index 64a43f426..76b2dd7cb 100644 --- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java -@@ -139,6 +139,12 @@ public class ShapedRecipe implements Recipe, Keyed { +@@ -145,6 +145,13 @@ public class ShapedRecipe implements Recipe, Keyed { return this; } + // Paper start -+ public ShapedRecipe setIngredient(char key, ItemStack item) { ++ @NotNull ++ public ShapedRecipe setIngredient(char key, @NotNull ItemStack item) { + return setIngredient(key, new RecipeChoice.ExactChoice(item)); + } + // Paper end @@ -23,28 +24,35 @@ index 80af6cf5..3eae5a55 100644 * Get a copy of the ingredients map. * diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -index 7347e746..4de38b33 100644 +index 46a398e88..818bf2936 100644 --- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java +++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java -@@ -128,6 +128,33 @@ public class ShapelessRecipe implements Recipe, Keyed { +@@ -143,6 +143,40 @@ public class ShapelessRecipe implements Recipe, Keyed { return this; } + // Paper start -+ public ShapelessRecipe addIngredient(ItemStack item) { ++ @NotNull ++ public ShapelessRecipe addIngredient(@NotNull ItemStack item) { + return addIngredient(1, item); + } -+ public ShapelessRecipe addIngredient(int count, ItemStack item) { ++ ++ @NotNull ++ public ShapelessRecipe addIngredient(int count, @NotNull ItemStack item) { + Validate.isTrue(ingredients.size() + count <= 9, "Shapeless recipes cannot have more than 9 ingredients"); + while (count-- > 0) { + ingredients.add(new RecipeChoice.ExactChoice(item)); + } + return this; + } -+ public ShapelessRecipe removeIngredient(ItemStack item) { ++ ++ @NotNull ++ public ShapelessRecipe removeIngredient(@NotNull ItemStack item) { + return removeIngredient(1, item); + } -+ public ShapelessRecipe removeIngredient(int count, ItemStack item) { ++ ++ @NotNull ++ public ShapelessRecipe removeIngredient(int count, @NotNull ItemStack item) { + Iterator iterator = ingredients.iterator(); + while (count > 0 && iterator.hasNext()) { + ItemStack stack = iterator.next().getItemStack(); @@ -57,9 +65,9 @@ index 7347e746..4de38b33 100644 + } + // Paper end + - public ShapelessRecipe addIngredient(RecipeChoice ingredient) { - Validate.isTrue(ingredients.size() + 1 <= 9, "Shapeless recipes cannot have more than 9 ingredients"); - + /** + * Removes an ingredient from the list. + * -- -2.20.1 +2.21.0 diff --git a/Spigot-API-Patches/0174-Add-WhitelistToggleEvent.patch b/Spigot-API-Patches/0171-Add-WhitelistToggleEvent.patch similarity index 87% rename from Spigot-API-Patches/0174-Add-WhitelistToggleEvent.patch rename to Spigot-API-Patches/0171-Add-WhitelistToggleEvent.patch index d750f3e3e9..955c892b12 100644 --- a/Spigot-API-Patches/0174-Add-WhitelistToggleEvent.patch +++ b/Spigot-API-Patches/0171-Add-WhitelistToggleEvent.patch @@ -1,4 +1,4 @@ -From 747fc969fefd90f81fb2ad1eb1153da08fe8fc42 Mon Sep 17 00:00:00 2001 +From 99653d40030fd8ca61c0d491e1ff7cc256b39fea Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Wed, 13 Mar 2019 20:04:43 +0200 Subject: [PATCH] Add WhitelistToggleEvent @@ -6,14 +6,15 @@ Subject: [PATCH] Add WhitelistToggleEvent diff --git a/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java b/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java new file mode 100644 -index 00000000..e7b785e7 +index 000000000..fdd5eedb2 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/WhitelistToggleEvent.java -@@ -0,0 +1,37 @@ +@@ -0,0 +1,40 @@ +package com.destroystokyo.paper.event.server; + +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; ++import org.jetbrains.annotations.NotNull; + +/** + * This event is fired when whitelist is toggled @@ -38,11 +39,13 @@ index 00000000..e7b785e7 + return enabled; + } + ++ @NotNull + @Override + public HandlerList getHandlers() { + return handlers; + } + ++ @NotNull + public static HandlerList getHandlerList() { + return handlers; + } diff --git a/Spigot-API-Patches/0172-Annotation-Test-changes.patch b/Spigot-API-Patches/0172-Annotation-Test-changes.patch new file mode 100644 index 0000000000..b73c6f08d3 --- /dev/null +++ b/Spigot-API-Patches/0172-Annotation-Test-changes.patch @@ -0,0 +1,32 @@ +From 7666930425ecce25ad85f2a146efbf0db678c9e6 Mon Sep 17 00:00:00 2001 +From: Shane Freeder +Date: Sun, 17 Mar 2019 23:04:30 +0000 +Subject: [PATCH] Annotation Test changes + + +diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java +index dfd6e137c..596f28076 100644 +--- a/src/test/java/org/bukkit/AnnotationTest.java ++++ b/src/test/java/org/bukkit/AnnotationTest.java +@@ -40,7 +40,17 @@ public class AnnotationTest { + "org/bukkit/util/io/Wrapper", + "org/bukkit/plugin/java/PluginClassLoader", + // Generic functional interface +- "org/bukkit/util/Consumer" ++ "org/bukkit/util/Consumer", ++ // Paper start ++ // Timings history is broken in terms of nullability due to guavas Function defining that the param is NonNull ++ "co/aikar/timings/TimingHistory$2", ++ "co/aikar/timings/TimingHistory$2$1", ++ "co/aikar/timings/TimingHistory$2$1$1", ++ "co/aikar/timings/TimingHistory$2$1$2", ++ "co/aikar/timings/TimingHistory$3", ++ "co/aikar/timings/TimingHistory$4", ++ "co/aikar/timings/TimingHistoryEntry$1" ++ // Paper end + }; + + @Test +-- +2.21.0 + diff --git a/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch index 0cfe5b17ff..20aa396a07 100644 --- a/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch +++ b/Spigot-Server-Patches/0106-Implement-PlayerLocaleChangeEvent.patch @@ -1,11 +1,11 @@ -From c85f208a89a8a4d141c258f74610f8fc815ca3d3 Mon Sep 17 00:00:00 2001 +From 14480770961d8973ac54265353f75e7928261ebd Mon Sep 17 00:00:00 2001 From: Isaac Moore Date: Tue, 19 Apr 2016 14:09:31 -0500 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 3bd93ada9..8b7a79b65 100644 +index 2665faa6c..7ed9903a8 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -33,7 +33,7 @@ import org.bukkit.inventory.MainHand; @@ -17,7 +17,7 @@ index 3bd93ada9..8b7a79b65 100644 public PlayerConnection playerConnection; public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; -@@ -1260,13 +1260,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1266,13 +1266,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), getMainHand() == EnumMainHand.LEFT ? MainHand.LEFT : MainHand.RIGHT); this.server.server.getPluginManager().callEvent(event); } @@ -40,7 +40,7 @@ index 3bd93ada9..8b7a79b65 100644 this.ct = packetplayinsettings.e(); this.getDataWatcher().set(EntityPlayer.bx, (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 40f31dd53..4398737cd 100644 +index bd95e1778..f3f3e81b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1716,8 +1716,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -66,5 +66,5 @@ index 40f31dd53..4398737cd 100644 @Override -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0128-Re-track-players-that-dismount-from-other-players.patch b/Spigot-Server-Patches/0128-Re-track-players-that-dismount-from-other-players.patch index 357809cd13..1b05b6ddef 100644 --- a/Spigot-Server-Patches/0128-Re-track-players-that-dismount-from-other-players.patch +++ b/Spigot-Server-Patches/0128-Re-track-players-that-dismount-from-other-players.patch @@ -1,14 +1,14 @@ -From b70b6f04bb1093dd3642d0571707c4fd0d7488d5 Mon Sep 17 00:00:00 2001 +From 12a58c9dfac40299305c3eaf1d0f525235885786 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sun, 31 Jul 2016 16:33:03 -0500 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 aad5a3527..749e41aed 100644 +index 7ed9903a8..621e79bc5 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -754,6 +754,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -760,6 +760,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (entity1 != entity && this.playerConnection != null) { this.playerConnection.a(this.locX, this.locY, this.locZ, this.yaw, this.pitch); } @@ -23,5 +23,5 @@ index aad5a3527..749e41aed 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0147-Optimise-removeQueue.patch b/Spigot-Server-Patches/0147-Optimise-removeQueue.patch index 71d205d645..64ab07495f 100644 --- a/Spigot-Server-Patches/0147-Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/0147-Optimise-removeQueue.patch @@ -1,11 +1,11 @@ -From 04cc3fc57dc45648a2ddaa6f7097a6630a4101bc Mon Sep 17 00:00:00 2001 +From f89c7debb7c660439d856aca963f8056cf86404f Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Fri, 25 Nov 2016 13:22:40 +0000 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 ca715c138..3ee1d270f 100644 +index fcb5f590d..6b9bbc77c 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -4,7 +4,9 @@ import com.google.common.collect.Lists; @@ -50,7 +50,7 @@ index ca715c138..3ee1d270f 100644 this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(aint)); } -@@ -1147,7 +1156,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1153,7 +1162,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.lastHealthSent = -1.0F; this.lastFoodSent = -1; // this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit @@ -67,5 +67,5 @@ index ca715c138..3ee1d270f 100644 this.cC = entityplayer.cC; this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0158-Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/0158-Properly-fix-item-duplication-bug.patch index c19deb39de..dd628ae024 100644 --- a/Spigot-Server-Patches/0158-Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/0158-Properly-fix-item-duplication-bug.patch @@ -1,4 +1,4 @@ -From 6cffdbfde8f8b4ad03f751ee44f3f96d2b37bea4 Mon Sep 17 00:00:00 2001 +From 0969b16e0064457cc8c7abbf1791395950c057e4 Mon Sep 17 00:00:00 2001 From: Alfie Cleveland Date: Tue, 27 Dec 2016 01:57:57 +0000 Subject: [PATCH] Properly fix item duplication bug @@ -6,10 +6,10 @@ 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 3ee1d270f..55f4ab93e 100644 +index 6b9bbc77c..e4e1d999e 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1561,7 +1561,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1567,7 +1567,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override protected boolean isFrozen() { @@ -19,7 +19,7 @@ index 3ee1d270f..55f4ab93e 100644 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 849573864..a04bfded1 100644 +index 677d6466d..9157c3f0d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2500,7 +2500,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -32,5 +32,5 @@ index 849573864..a04bfded1 100644 // CraftBukkit end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0185-Shoulder-Entities-Release-API.patch b/Spigot-Server-Patches/0185-Shoulder-Entities-Release-API.patch index 472898cee1..6efed2ede4 100644 --- a/Spigot-Server-Patches/0185-Shoulder-Entities-Release-API.patch +++ b/Spigot-Server-Patches/0185-Shoulder-Entities-Release-API.patch @@ -1,14 +1,14 @@ -From db0638e9bb0ec9b8e16480de4ddc1cc01c3691f6 Mon Sep 17 00:00:00 2001 +From 0af2354c40db7b7aa736fbc1fa4e89279393efb7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 17 Jun 2017 15:18:30 -0400 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 7f05017949..e4d2c4fcf2 100644 +index 23e7cdfe8..298012f37 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1827,21 +1827,48 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1831,21 +1831,48 @@ public abstract class EntityHuman extends EntityLiving { } // CraftBukkit end } @@ -62,7 +62,7 @@ index 7f05017949..e4d2c4fcf2 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 e5f782e6f1..af51b3def5 100644 +index 79d125567..d5dbc4ca8 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -556,6 +556,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -99,5 +99,5 @@ index e5f782e6f1..af51b3def5 100644 public boolean discoverRecipe(NamespacedKey recipe) { return discoverRecipes(Arrays.asList(recipe)) != 0; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0206-Add-PlayerJumpEvent.patch b/Spigot-Server-Patches/0206-Add-PlayerJumpEvent.patch index 09ef9d3250..ce6a7c8049 100644 --- a/Spigot-Server-Patches/0206-Add-PlayerJumpEvent.patch +++ b/Spigot-Server-Patches/0206-Add-PlayerJumpEvent.patch @@ -1,14 +1,14 @@ -From 9648a3f9d323da9bf5f811180338f2de075a4af9 Mon Sep 17 00:00:00 2001 +From 32d2aecb6802eb91b01223ca9bf0b4460cab3c3c Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 28 Sep 2017 17:21:44 -0400 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 e4d2c4fcf2..3acd9cdba5 100644 +index 298012f37..bfae875eb 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1479,6 +1479,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1483,6 +1483,7 @@ public abstract class EntityHuman extends EntityLiving { return 0; } @@ -17,7 +17,7 @@ index e4d2c4fcf2..3acd9cdba5 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 877598a543..8cd898a946 100644 +index 0b6a6cf73..d2d1ce35b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -58,6 +58,8 @@ import org.bukkit.inventory.CraftingInventory; @@ -66,5 +66,5 @@ index 877598a543..8cd898a946 100644 this.player.move(EnumMoveType.PLAYER, d7, d8, d9); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0280-InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/0280-InventoryCloseEvent-Reason-API.patch index 92787d9944..a2a81d048c 100644 --- a/Spigot-Server-Patches/0280-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/0280-InventoryCloseEvent-Reason-API.patch @@ -1,4 +1,4 @@ -From c80cb650d92bb7c8994aa0edc393a2a48302402c Mon Sep 17 00:00:00 2001 +From 9045427bfbc7fb6cc77450ae8182d52cf4fce381 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 3 Jul 2018 21:56:23 -0400 Subject: [PATCH] InventoryCloseEvent Reason API @@ -29,7 +29,7 @@ index 6150b56e0..3ca579e38 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index e06f03e80..59f108e49 100644 +index d4618d644..cc1bc01b1 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -158,7 +158,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -56,7 +56,7 @@ index e06f03e80..59f108e49 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 55f4ab93e..13409c041 100644 +index e4e1d999e..dc72538de 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -344,7 +344,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -77,7 +77,7 @@ index 55f4ab93e..13409c041 100644 this.setSpectatorTarget(this); // Remove spectated target // CraftBukkit end -@@ -867,7 +867,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -873,7 +873,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.a((new ChatMessage("container.spectatorCantOpen", new Object[0])).a(EnumChatFormat.RED), true); } else { if (this.activeContainer != this.defaultContainer) { @@ -86,7 +86,7 @@ index 55f4ab93e..13409c041 100644 } if (iinventory instanceof ITileInventory) { -@@ -940,7 +940,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -946,7 +946,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit end if (this.activeContainer != this.defaultContainer) { @@ -95,7 +95,7 @@ index 55f4ab93e..13409c041 100644 } this.nextContainerCounter(); -@@ -1005,7 +1005,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1011,7 +1011,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } public void closeInventory() { @@ -110,7 +110,7 @@ index 55f4ab93e..13409c041 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1fdffcfb0..adc57a374 100644 +index ca5665137..38c784e75 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2016,7 +2016,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -136,7 +136,7 @@ index 96eff10ff..ddaa73e83 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 b82aa903c..a2bf6b046 100644 +index 9b19dce9b..cb7697f80 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -513,8 +513,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -155,7 +155,7 @@ index b82aa903c..a2bf6b046 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 0753a0f26..ce58cfc11 100644 +index e8450a565..29eeb3e29 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -738,7 +738,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -193,5 +193,5 @@ index e75c188b5..167a3baec 100644 human.activeContainer.transferTo(human.defaultContainer, human.getBukkitEntity()); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0345-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/0344-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch similarity index 93% rename from Spigot-Server-Patches/0345-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch rename to Spigot-Server-Patches/0344-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch index 5184579e58..4e48da9437 100644 --- a/Spigot-Server-Patches/0345-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch +++ b/Spigot-Server-Patches/0344-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch @@ -1,4 +1,4 @@ -From 4b0795a055270606df155a99de16e1d81edb3295 Mon Sep 17 00:00:00 2001 +From 874d71db6ba9406d83c07e4f6cd40bbf504d316d Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 2 Sep 2018 19:34:33 -0700 Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted @@ -19,5 +19,5 @@ index 2c4465fff..95fe3a91b 100644 public boolean isChunkLoaded(Chunk chunk) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0344-fix-newlines-in-spigot-tab-list-API.patch b/Spigot-Server-Patches/0344-fix-newlines-in-spigot-tab-list-API.patch deleted file mode 100644 index 37d83394f8..0000000000 --- a/Spigot-Server-Patches/0344-fix-newlines-in-spigot-tab-list-API.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 6f777644facfe0beaca514e3f9993ce98b6cc5a0 Mon Sep 17 00:00:00 2001 -From: Shane Freeder -Date: Sat, 1 Sep 2018 11:29:52 +0100 -Subject: [PATCH] fix newlines in spigot tab list API - -Spigots implementation around the header/footer strips newlines from the -header/footer, this patch allows the tab list header/footer to retain newlines. - -diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ce58cfc11..143779dfc 100644 ---- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -368,20 +368,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { - - @Override - public void setPlayerListHeader(String header) { -- this.playerListHeader = CraftChatMessage.fromStringOrNull(header); -+ this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API - updatePlayerListHeaderFooter(); - } - - @Override - public void setPlayerListFooter(String footer) { -- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer); -+ this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API - updatePlayerListHeaderFooter(); - } - - @Override - public void setPlayerListHeaderFooter(String header, String footer) { -- this.playerListHeader = CraftChatMessage.fromStringOrNull(header); -- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer); -+ this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API -+ this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API - updatePlayerListHeaderFooter(); - } - -diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index a067e39d5..5e20a9a61 100644 ---- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -@@ -143,7 +143,13 @@ public final class CraftChatMessage { - } - - public static IChatBaseComponent fromStringOrNull(String message) { -- return (message == null || message.isEmpty()) ? null : fromString(message)[0]; -+ // Paper start - fix up spigot tab API -+ return fromStringOrNull(message, false); -+ } -+ -+ public static IChatBaseComponent fromStringOrNull(String message, boolean keepNewlines) { -+ return (message == null || message.isEmpty()) ? null : fromString(message, keepNewlines)[0]; -+ // Paper end - fix up spigot tab API - } - - public static IChatBaseComponent[] fromString(String message) { --- -2.20.1 - diff --git a/Spigot-Server-Patches/0346-Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-Server-Patches/0345-Add-ray-tracing-methods-to-LivingEntity.patch similarity index 97% rename from Spigot-Server-Patches/0346-Add-ray-tracing-methods-to-LivingEntity.patch rename to Spigot-Server-Patches/0345-Add-ray-tracing-methods-to-LivingEntity.patch index e7d58e7c21..c43ca78fbb 100644 --- a/Spigot-Server-Patches/0346-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-Server-Patches/0345-Add-ray-tracing-methods-to-LivingEntity.patch @@ -1,11 +1,11 @@ -From c92076cfeac6a93fbf9cb8d37f811714b15a9fec Mon Sep 17 00:00:00 2001 +From e5e454ca90c90bf05dcccb7e9364b85f37ac9b9c Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Mon, 3 Sep 2018 18:20:03 -0500 Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index d94f5e609..381f19144 100644 +index 18b5ecbc6..10d95d306 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -2817,6 +2817,22 @@ public abstract class EntityLiving extends Entity { @@ -60,5 +60,5 @@ index 52834b6da..eeab59379 100644 return getLineOfSight(transparent, maxDistance, 2); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0347-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/0346-Expose-attack-cooldown-methods-for-Player.patch similarity index 90% rename from Spigot-Server-Patches/0347-Expose-attack-cooldown-methods-for-Player.patch rename to Spigot-Server-Patches/0346-Expose-attack-cooldown-methods-for-Player.patch index 5203d036c4..190e26c9de 100644 --- a/Spigot-Server-Patches/0347-Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/0346-Expose-attack-cooldown-methods-for-Player.patch @@ -1,14 +1,14 @@ -From 342a5254b431144db71c70b82c0c687899b2016d Mon Sep 17 00:00:00 2001 +From 184c1493b6316c0341e9323c6fca358f62c2fdc8 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Tue, 4 Sep 2018 15:02:00 -0500 Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 59f108e49..82684dd68 100644 +index cc1bc01b1..4bbf57752 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2057,14 +2057,17 @@ public abstract class EntityHuman extends EntityLiving { +@@ -2061,14 +2061,17 @@ public abstract class EntityHuman extends EntityLiving { this.datawatcher.set(EntityHuman.bA, nbttagcompound); } @@ -27,7 +27,7 @@ index 59f108e49..82684dd68 100644 this.aH = 0; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 143779dfc..07b9545e7 100644 +index 29eeb3e29..7a5d0176b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1892,6 +1892,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -52,5 +52,5 @@ index 143779dfc..07b9545e7 100644 private final Player.Spigot spigot = new Player.Spigot() { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0348-Improve-death-events.patch b/Spigot-Server-Patches/0347-Improve-death-events.patch similarity index 98% rename from Spigot-Server-Patches/0348-Improve-death-events.patch rename to Spigot-Server-Patches/0347-Improve-death-events.patch index d1d8f73c47..95bd717b8a 100644 --- a/Spigot-Server-Patches/0348-Improve-death-events.patch +++ b/Spigot-Server-Patches/0347-Improve-death-events.patch @@ -1,4 +1,4 @@ -From f05d395c6e8180d13072d112c53de2e40b5cbc7a Mon Sep 17 00:00:00 2001 +From 4cc6a61a3e7c1967dc72e8cb4c5f551029bc3efd Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 21 Aug 2018 01:39:35 +0100 Subject: [PATCH] Improve death events @@ -15,7 +15,7 @@ items and experience which is otherwise only properly possible by using internal code. diff --git a/src/main/java/net/minecraft/server/CombatTracker.java b/src/main/java/net/minecraft/server/CombatTracker.java -index bbd5e2b2..19750cee 100644 +index bbd5e2b2a..19750ceed 100644 --- a/src/main/java/net/minecraft/server/CombatTracker.java +++ b/src/main/java/net/minecraft/server/CombatTracker.java @@ -175,6 +175,7 @@ public class CombatTracker { @@ -27,7 +27,7 @@ index bbd5e2b2..19750cee 100644 int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c29d7eeb..acd89649 100644 +index c29d7eeb0..acd89649c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1553,6 +1553,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -55,7 +55,7 @@ index c29d7eeb..acd89649 100644 return SoundCategory.NEUTRAL; } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 2c54e3e3..a5cc5e28 100644 +index 2c54e3e34..a5cc5e284 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java @@ -659,7 +659,8 @@ public class EntityArmorStand extends EntityLiving { @@ -69,7 +69,7 @@ index 2c54e3e3..a5cc5e28 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 10d95d30..f48ddbc6 100644 +index 10d95d306..f48ddbc68 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -76,14 +76,14 @@ public abstract class EntityLiving extends Entity { @@ -206,7 +206,7 @@ index 10d95d30..f48ddbc6 100644 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 13409c04..b01fffbd 100644 +index dc72538de..62feadc8a 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -72,6 +72,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -257,7 +257,7 @@ index 13409c04..b01fffbd 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 17fab031..ee8219e3 100644 +index 17fab031b..ee8219e3b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java @@ -674,6 +674,22 @@ public enum CraftSound { @@ -284,7 +284,7 @@ index 17fab031..ee8219e3 100644 this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 07b9545e..a2eae5d1 100644 +index 7a5d0176b..da54a4529 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1686,7 +1686,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -305,7 +305,7 @@ index 07b9545e..a2eae5d1 100644 public void injectScaledMaxHealth(Collection collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 93da4c72..054ebc82 100644 +index 93da4c726..054ebc82b 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -600,9 +600,16 @@ public class CraftEventFactory { @@ -374,5 +374,5 @@ index 93da4c72..054ebc82 100644 * Server methods */ -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0349-Allow-chests-to-be-placed-with-NBT-data.patch b/Spigot-Server-Patches/0348-Allow-chests-to-be-placed-with-NBT-data.patch similarity index 92% rename from Spigot-Server-Patches/0349-Allow-chests-to-be-placed-with-NBT-data.patch rename to Spigot-Server-Patches/0348-Allow-chests-to-be-placed-with-NBT-data.patch index 42df72a475..c96fb8fcd4 100644 --- a/Spigot-Server-Patches/0349-Allow-chests-to-be-placed-with-NBT-data.patch +++ b/Spigot-Server-Patches/0348-Allow-chests-to-be-placed-with-NBT-data.patch @@ -1,11 +1,11 @@ -From e8a80b8dec63ed62949d118e9f74763ab0371910 Mon Sep 17 00:00:00 2001 +From 8b32a559c1f6f2b988e2bddbe3220bf5cbeb6df2 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 8 Sep 2018 18:43:31 -0500 Subject: [PATCH] Allow chests to be placed with NBT data diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 914da48a..7827f692 100644 +index 914da48a2..7827f692a 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -232,6 +232,15 @@ public final class ItemStack { @@ -25,7 +25,7 @@ index 914da48a..7827f692 100644 for (BlockState blockstate : blocks) { blockstate.update(true, false); diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index c46b761c..2e0f782f 100644 +index c46b761cc..2e0f782f6 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -305,7 +305,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic @@ -38,5 +38,5 @@ index c46b761c..2e0f782f 100644 // CraftBukkit end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0350-Mob-Pathfinding-API.patch b/Spigot-Server-Patches/0349-Mob-Pathfinding-API.patch similarity index 97% rename from Spigot-Server-Patches/0350-Mob-Pathfinding-API.patch rename to Spigot-Server-Patches/0349-Mob-Pathfinding-API.patch index be437c1928..194af9afc1 100644 --- a/Spigot-Server-Patches/0350-Mob-Pathfinding-API.patch +++ b/Spigot-Server-Patches/0349-Mob-Pathfinding-API.patch @@ -1,4 +1,4 @@ -From 04eb4f00597dc827d2f0456d57cd3aa05c8209a2 Mon Sep 17 00:00:00 2001 +From d45341eada2fdac81b627263e0f9a4b7c2b7bc10 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 9 Sep 2018 13:30:00 -0400 Subject: [PATCH] Mob Pathfinding API @@ -7,7 +7,7 @@ Implements Pathfinding API for mobs diff --git a/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java new file mode 100644 -index 00000000..ed3d86dd +index 000000000..ed3d86ddd --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/PaperPathfinder.java @@ -0,0 +1,113 @@ @@ -125,7 +125,7 @@ index 00000000..ed3d86dd + } +} diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index c55aadb5..cac0ce2a 100644 +index c55aadb53..cac0ce2a3 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -69,7 +69,7 @@ public abstract class NavigationAbstract { @@ -173,7 +173,7 @@ index c55aadb5..cac0ce2a 100644 this.pathfindFailures = 0; this.lastFailure = 0; // Paper - Pathfinding optimizations this.c = null; diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java -index 31fc1fbc..5cf7f3bf 100644 +index 31fc1fbc6..5cf7f3bf1 100644 --- a/src/main/java/net/minecraft/server/PathEntity.java +++ b/src/main/java/net/minecraft/server/PathEntity.java @@ -4,12 +4,13 @@ import javax.annotation.Nullable; @@ -212,7 +212,7 @@ index 31fc1fbc..5cf7f3bf 100644 return new Vec3D((double) pathpoint.a, (double) pathpoint.b, (double) pathpoint.c); diff --git a/src/main/java/net/minecraft/server/PathPoint.java b/src/main/java/net/minecraft/server/PathPoint.java -index 78ed0028..0dd6e46d 100644 +index 78ed00286..0dd6e46d1 100644 --- a/src/main/java/net/minecraft/server/PathPoint.java +++ b/src/main/java/net/minecraft/server/PathPoint.java @@ -2,9 +2,9 @@ package net.minecraft.server; @@ -229,7 +229,7 @@ index 78ed0028..0dd6e46d 100644 public int d = -1; public float e; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 5bf1cd06..53c2d154 100644 +index 5bf1cd06f..53c2d154e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -12,8 +12,11 @@ import org.bukkit.loot.LootTable; @@ -245,5 +245,5 @@ index 5bf1cd06..53c2d154 100644 public void setTarget(LivingEntity target) { EntityInsentient entity = getHandle(); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0351-Prevent-chunk-loading-from-Fluid-Flowing.patch b/Spigot-Server-Patches/0350-Prevent-chunk-loading-from-Fluid-Flowing.patch similarity index 97% rename from Spigot-Server-Patches/0351-Prevent-chunk-loading-from-Fluid-Flowing.patch rename to Spigot-Server-Patches/0350-Prevent-chunk-loading-from-Fluid-Flowing.patch index 43e6a58e01..18fe0f83bf 100644 --- a/Spigot-Server-Patches/0351-Prevent-chunk-loading-from-Fluid-Flowing.patch +++ b/Spigot-Server-Patches/0350-Prevent-chunk-loading-from-Fluid-Flowing.patch @@ -1,11 +1,11 @@ -From e47fdafef79250649c2397bbae1ac496f5c21339 Mon Sep 17 00:00:00 2001 +From 544f74d213fdc5149acc86228ad5cac0427f3789 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 10 Sep 2018 23:36:16 -0400 Subject: [PATCH] Prevent chunk loading from Fluid Flowing diff --git a/src/main/java/net/minecraft/server/FluidTypeFlowing.java b/src/main/java/net/minecraft/server/FluidTypeFlowing.java -index 28edf37d..bbffeae3 100644 +index 28edf37d0..bbffeae3d 100644 --- a/src/main/java/net/minecraft/server/FluidTypeFlowing.java +++ b/src/main/java/net/minecraft/server/FluidTypeFlowing.java @@ -185,7 +185,8 @@ public abstract class FluidTypeFlowing extends FluidType { @@ -76,5 +76,5 @@ index 28edf37d..bbffeae3 100644 Fluid fluid = (Fluid) pair.getSecond(); Fluid fluid1 = this.a(iworldreader, blockposition1, iblockdata1); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0352-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/0351-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch similarity index 99% rename from Spigot-Server-Patches/0352-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch rename to Spigot-Server-Patches/0351-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 0c22a84e23..3dfdfec4d1 100644 --- a/Spigot-Server-Patches/0352-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/Spigot-Server-Patches/0351-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -1,11 +1,11 @@ -From 5f03d3715663e41e0f125b390d049597ae3f9b03 Mon Sep 17 00:00:00 2001 +From 125c1ae05584e68ca0228f4a29f26a54371a5820 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Wed, 12 Sep 2018 18:53:55 +0300 Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java -index 8e839028..f5293658 100644 +index 8e8390282..f52936581 100644 --- a/src/main/java/net/minecraft/server/ArgumentBlock.java +++ b/src/main/java/net/minecraft/server/ArgumentBlock.java @@ -43,7 +43,7 @@ public class ArgumentBlock { @@ -32,7 +32,7 @@ index 8e839028..f5293658 100644 this.s = this::l; if (this.i.canRead() && this.i.peek() == '#') { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index eaf4cd11..be2e736e 100644 +index eaf4cd11c..be2e736eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -81,6 +81,12 @@ import javax.annotation.Nullable; @@ -412,5 +412,5 @@ index eaf4cd11..be2e736e 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0353-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/Spigot-Server-Patches/0352-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch similarity index 96% rename from Spigot-Server-Patches/0353-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch rename to Spigot-Server-Patches/0352-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch index 51575c0d94..d2625c5961 100644 --- a/Spigot-Server-Patches/0353-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch +++ b/Spigot-Server-Patches/0352-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch @@ -1,11 +1,11 @@ -From f8791854c3591f360b7a0504758a4d085d1421d1 Mon Sep 17 00:00:00 2001 +From 03753fce4c12f59e44a7565653c930538db64908 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 10 Sep 2018 23:56:36 -0400 Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java -index 2b15aa6c..3ca32123 100644 +index 2b15aa6c9..3ca32123b 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java @@ -12,11 +12,13 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { @@ -53,7 +53,7 @@ index 2b15aa6c..3ca32123 100644 return block == this.f && iworldreader.getType(blockposition.up()).isAir() && iworldreader.getType(blockposition.up(2)).isAir(); } diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java -index e58fdee8..f2c4048c 100644 +index e58fdee8b..f2c4048c2 100644 --- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java +++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java @@ -87,6 +87,7 @@ public class RandomPositionGenerator { @@ -74,7 +74,7 @@ index e58fdee8..f2c4048c 100644 } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9edcf025..9bfc5db3 100644 +index 9edcf0257..9bfc5db39 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -764,7 +764,17 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -96,5 +96,5 @@ index 9edcf025..9bfc5db3 100644 if (blockposition.isInvalidYLocation()) { // Paper return FluidTypes.EMPTY.i(); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0354-Prevent-mob-spawning-from-loading-generating-chunks.patch b/Spigot-Server-Patches/0353-Prevent-mob-spawning-from-loading-generating-chunks.patch similarity index 95% rename from Spigot-Server-Patches/0354-Prevent-mob-spawning-from-loading-generating-chunks.patch rename to Spigot-Server-Patches/0353-Prevent-mob-spawning-from-loading-generating-chunks.patch index d84cd9d0f1..40806e6dbc 100644 --- a/Spigot-Server-Patches/0354-Prevent-mob-spawning-from-loading-generating-chunks.patch +++ b/Spigot-Server-Patches/0353-Prevent-mob-spawning-from-loading-generating-chunks.patch @@ -1,4 +1,4 @@ -From 3a21e15af95e705091cba51e225bef7976099f53 Mon Sep 17 00:00:00 2001 +From 0fc15178f4b4df4561c69c969471de117ec11d88 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 12 Sep 2018 21:12:57 -0400 Subject: [PATCH] Prevent mob spawning from loading/generating chunks @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks also prevents if out of world border bounds diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index bfbe4d3e..e2bf17f4 100644 +index bfbe4d3e3..e2bf17f44 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -129,9 +129,9 @@ public final class SpawnerCreature { @@ -31,5 +31,5 @@ index bfbe4d3e..e2bf17f4 100644 if (entitypositiontypes_surface != null && a(entitypositiontypes_surface, worldserver, blockposition_mutableblockposition, biomebase_biomemeta.b)) { EntityInsentient entityinsentient; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0355-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/Spigot-Server-Patches/0354-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch similarity index 95% rename from Spigot-Server-Patches/0355-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch rename to Spigot-Server-Patches/0354-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch index 41e1617cb5..d29cdf1475 100644 --- a/Spigot-Server-Patches/0355-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch +++ b/Spigot-Server-Patches/0354-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch @@ -1,4 +1,4 @@ -From 4539ea74a006aca6d91f2ede339b6ef5ccd0ebc1 Mon Sep 17 00:00:00 2001 +From aa754d6ca5dce33051ca97a2665268bbf49b1ce9 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 12 Sep 2018 21:47:01 -0400 Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning Uses an EnumMap as well as a Set paired List for O(1) contains calls. diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index c399bdec..3496d423 100644 +index c399bdecc..3496d4236 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java @@ -120,7 +120,7 @@ public abstract class BiomeBase { @@ -67,5 +67,5 @@ index c399bdec..3496d423 100644 @Nullable -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0356-Optimize-and-Fix-ExpiringMap-Issues.patch b/Spigot-Server-Patches/0355-Optimize-and-Fix-ExpiringMap-Issues.patch similarity index 98% rename from Spigot-Server-Patches/0356-Optimize-and-Fix-ExpiringMap-Issues.patch rename to Spigot-Server-Patches/0355-Optimize-and-Fix-ExpiringMap-Issues.patch index 1ba54769fa..027389b98d 100644 --- a/Spigot-Server-Patches/0356-Optimize-and-Fix-ExpiringMap-Issues.patch +++ b/Spigot-Server-Patches/0355-Optimize-and-Fix-ExpiringMap-Issues.patch @@ -1,4 +1,4 @@ -From e77fa35159c7442a3db6d0d2720d79251f546ab5 Mon Sep 17 00:00:00 2001 +From eac13d2ed91683f10ee47dec5283046be299e0f5 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sun, 16 Sep 2018 00:00:16 -0400 Subject: [PATCH] Optimize and Fix ExpiringMap Issues @@ -14,7 +14,7 @@ manipulation, and instead to run clean once per tick per active expiring map. diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -index a2376844..835a2aae 100644 +index a23768441..835a2aae4 100644 --- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java @@ -142,13 +142,13 @@ public abstract class ChunkGeneratorAbstract implem @@ -34,7 +34,7 @@ index a2376844..835a2aae 100644 } diff --git a/src/main/java/net/minecraft/server/ExpiringMap.java b/src/main/java/net/minecraft/server/ExpiringMap.java -index bd363647..bf609513 100644 +index bd3636479..bf6095137 100644 --- a/src/main/java/net/minecraft/server/ExpiringMap.java +++ b/src/main/java/net/minecraft/server/ExpiringMap.java @@ -2,87 +2,211 @@ package net.minecraft.server; @@ -290,7 +290,7 @@ index bd363647..bf609513 100644 + */ // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 38c0201a..ae271a57 100644 +index 38c0201ac..ae271a57f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -150,6 +150,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -310,7 +310,7 @@ index 38c0201a..ae271a57 100644 co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 4cca6566..9c917370 100644 +index 4cca65666..9c917370a 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -144,7 +144,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator Date: Thu, 13 Sep 2018 08:45:21 +0300 Subject: [PATCH] Implement furnace cook speed multiplier API @@ -6,7 +6,7 @@ Subject: [PATCH] Implement furnace cook speed multiplier API Signed-off-by: Tassu diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 5b6ccfa9..bfbd35bb 100644 +index 5b6ccfa9f..bfbd35bbe 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -9,6 +9,7 @@ import java.util.Map.Entry; @@ -57,7 +57,7 @@ index 5b6ccfa9..bfbd35bb 100644 this.cookTimeTotal = this.s(); this.burn(irecipe); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java -index c2eea8ce..429c780e 100644 +index c2eea8ce0..429c780ec 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java @@ -84,4 +84,18 @@ public class CraftFurnace extends CraftContainer implements F @@ -80,5 +80,5 @@ index c2eea8ce..429c780e 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0358-Support-Overriding-World-Seeds.patch b/Spigot-Server-Patches/0357-Support-Overriding-World-Seeds.patch similarity index 96% rename from Spigot-Server-Patches/0358-Support-Overriding-World-Seeds.patch rename to Spigot-Server-Patches/0357-Support-Overriding-World-Seeds.patch index 559df129dd..a0a81ba150 100644 --- a/Spigot-Server-Patches/0358-Support-Overriding-World-Seeds.patch +++ b/Spigot-Server-Patches/0357-Support-Overriding-World-Seeds.patch @@ -1,4 +1,4 @@ -From 92271a7287dabd8017118bb3613b9f3cd72bf056 Mon Sep 17 00:00:00 2001 +From f2d7d60de5fc9f1c38b570c3133fde69af05fb6d Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 17 Sep 2018 23:05:31 -0400 Subject: [PATCH] Support Overriding World Seeds @@ -15,7 +15,7 @@ This seed will end up being saved to the world data file, so it is a permanent change in that it won't go back if you remove it from paper.yml diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 6bd59a88..359c538f 100644 +index 6bd59a886..359c538f3 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -11,6 +11,7 @@ import java.lang.reflect.Modifier; @@ -59,7 +59,7 @@ index 6bd59a88..359c538f 100644 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ae271a57..4543ac8f 100644 +index ae271a57f..4543ac8f1 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -345,7 +345,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -72,7 +72,7 @@ index ae271a57..4543ac8f 100644 if (j == 0) { diff --git a/src/main/java/net/minecraft/server/WorldData.java b/src/main/java/net/minecraft/server/WorldData.java -index 8458dc17..b5fb9529 100644 +index 8458dc17d..b5fb95293 100644 --- a/src/main/java/net/minecraft/server/WorldData.java +++ b/src/main/java/net/minecraft/server/WorldData.java @@ -110,7 +110,7 @@ public class WorldData { @@ -85,7 +85,7 @@ index 8458dc17..b5fb9529 100644 String s = nbttagcompound.getString("generatorName"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 81e27949..6cea317d 100644 +index 81e27949d..6cea317d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -989,7 +989,7 @@ public final class CraftServer implements Server { @@ -98,5 +98,5 @@ index 81e27949..6cea317d 100644 if (parsedSettings.isJsonObject()) { worldSettings.setGeneratorSettings(parsedSettings.getAsJsonObject()); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0359-Optimize-Server-World-Map.patch b/Spigot-Server-Patches/0358-Optimize-Server-World-Map.patch similarity index 98% rename from Spigot-Server-Patches/0359-Optimize-Server-World-Map.patch rename to Spigot-Server-Patches/0358-Optimize-Server-World-Map.patch index 9569fe04a9..6351512ee2 100644 --- a/Spigot-Server-Patches/0359-Optimize-Server-World-Map.patch +++ b/Spigot-Server-Patches/0358-Optimize-Server-World-Map.patch @@ -1,4 +1,4 @@ -From 99aed7981b3c903e0eb2ed8f30cf6841f790bd35 Mon Sep 17 00:00:00 2001 +From 95829d064a601441f7c7f13d845608e5d00bb1f3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 17 Sep 2018 23:37:31 -0400 Subject: [PATCH] Optimize Server World Map @@ -21,7 +21,7 @@ known NMS used methods, but we can add more if naughty plugins are found later. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldMap.java b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java new file mode 100644 -index 00000000..af9e4455 +index 000000000..af9e4455c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/PaperWorldMap.java @@ -0,0 +1,191 @@ @@ -217,7 +217,7 @@ index 00000000..af9e4455 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 4543ac8f..d2ee4e57 100644 +index 4543ac8f1..d2ee4e578 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -82,7 +82,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -239,5 +239,5 @@ index 4543ac8f..d2ee4e57 100644 } // CraftBukkit end -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0360-PreSpawnerSpawnEvent.patch b/Spigot-Server-Patches/0359-PreSpawnerSpawnEvent.patch similarity index 93% rename from Spigot-Server-Patches/0360-PreSpawnerSpawnEvent.patch rename to Spigot-Server-Patches/0359-PreSpawnerSpawnEvent.patch index 6361688826..1d62dbdc70 100644 --- a/Spigot-Server-Patches/0360-PreSpawnerSpawnEvent.patch +++ b/Spigot-Server-Patches/0359-PreSpawnerSpawnEvent.patch @@ -1,4 +1,4 @@ -From 6677b8f49c32012202a9c7a81ff49b75005af42d Mon Sep 17 00:00:00 2001 +From 522598e29ee35ab64a9c62aafcb78a57a202a8bb Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Tue, 18 Sep 2018 23:53:23 +0100 Subject: [PATCH] PreSpawnerSpawnEvent @@ -9,7 +9,7 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for spawners. diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index eca3f85a..b2d2de7f 100644 +index eca3f85ad..b2d2de7f8 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -102,11 +102,11 @@ public abstract class MobSpawnerAbstract { @@ -28,5 +28,5 @@ index eca3f85a..b2d2de7f 100644 if (!event.callEvent()) { flag = true; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0361-Catch-JsonParseException-in-Entity-and-TE-names.patch b/Spigot-Server-Patches/0360-Catch-JsonParseException-in-Entity-and-TE-names.patch similarity index 95% rename from Spigot-Server-Patches/0361-Catch-JsonParseException-in-Entity-and-TE-names.patch rename to Spigot-Server-Patches/0360-Catch-JsonParseException-in-Entity-and-TE-names.patch index cf2a91c01d..80fce5ffa7 100644 --- a/Spigot-Server-Patches/0361-Catch-JsonParseException-in-Entity-and-TE-names.patch +++ b/Spigot-Server-Patches/0360-Catch-JsonParseException-in-Entity-and-TE-names.patch @@ -1,4 +1,4 @@ -From c3a96e4a3c00ed9609639b3137f6a99f24ffed98 Mon Sep 17 00:00:00 2001 +From a474fdc7768a5473ece227a6c037f4a2b552c01d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Sat, 22 Sep 2018 15:56:59 -0400 Subject: [PATCH] Catch JsonParseException in Entity and TE names @@ -13,7 +13,7 @@ Shulkers) may need to be changed in order for it to re-save properly No more crashing though. diff --git a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java -index e38a0d48..a245df1d 100644 +index e38a0d488..a245df1dc 100644 --- a/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java +++ b/src/main/java/net/minecraft/server/CommandBlockListenerAbstract.java @@ -56,7 +56,7 @@ public abstract class CommandBlockListenerAbstract implements ICommandListener { @@ -26,7 +26,7 @@ index e38a0d48..a245df1d 100644 if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) { diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index acd89649..49ddb971 100644 +index acd89649c..49ddb9715 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1742,7 +1742,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -39,7 +39,7 @@ index acd89649..49ddb971 100644 this.setCustomNameVisible(nbttagcompound.getBoolean("CustomNameVisible")); diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 0ef5ad11..f70f5899 100644 +index 0ef5ad116..f70f5899f 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java @@ -339,4 +339,19 @@ public final class MCUtil { @@ -63,7 +63,7 @@ index 0ef5ad11..f70f5899 100644 + } } diff --git a/src/main/java/net/minecraft/server/TileEntityBanner.java b/src/main/java/net/minecraft/server/TileEntityBanner.java -index 7d9e0837..dfee7332 100644 +index 7d9e0837d..dfee7332e 100644 --- a/src/main/java/net/minecraft/server/TileEntityBanner.java +++ b/src/main/java/net/minecraft/server/TileEntityBanner.java @@ -74,7 +74,7 @@ public class TileEntityBanner extends TileEntity implements INamableTileEntity { @@ -76,7 +76,7 @@ index 7d9e0837..dfee7332 100644 if (this.hasWorld()) { diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java -index a106a783..ff8a5926 100644 +index a106a783e..ff8a5926e 100644 --- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java @@ -236,7 +236,7 @@ public class TileEntityBrewingStand extends TileEntityContainer implements IWorl @@ -89,7 +89,7 @@ index a106a783..ff8a5926 100644 this.fuelLevel = nbttagcompound.getByte("Fuel"); diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index 2e0f782f..77c01294 100644 +index 2e0f782f6..77c012946 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -83,7 +83,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic @@ -102,7 +102,7 @@ index 2e0f782f..77c01294 100644 } diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java -index ddd2e0eb..21bd156e 100644 +index ddd2e0eb0..21bd156e9 100644 --- a/src/main/java/net/minecraft/server/TileEntityDispenser.java +++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java @@ -107,7 +107,7 @@ public class TileEntityDispenser extends TileEntityLootable { @@ -115,7 +115,7 @@ index ddd2e0eb..21bd156e 100644 } diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index bfbd35bb..538ca9bb 100644 +index bfbd35bbe..538ca9bbb 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -217,7 +217,7 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInve @@ -128,7 +128,7 @@ index bfbd35bb..538ca9bb 100644 // Paper start - cook speed API diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index 7303a6fd..544dde42 100644 +index 7303a6fdd..544dde428 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -60,7 +60,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @@ -141,7 +141,7 @@ index 7303a6fd..544dde42 100644 this.f = nbttagcompound.getInt("TransferCooldown"); diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java -index fedba2e1..296b8dd5 100644 +index fedba2e1f..296b8dd56 100644 --- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java +++ b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java @@ -249,7 +249,7 @@ public class TileEntityShulkerBox extends TileEntityLootable implements IWorldIn @@ -154,5 +154,5 @@ index fedba2e1..296b8dd5 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0362-Avoid-dimension-id-collisions.patch b/Spigot-Server-Patches/0361-Avoid-dimension-id-collisions.patch similarity index 90% rename from Spigot-Server-Patches/0362-Avoid-dimension-id-collisions.patch rename to Spigot-Server-Patches/0361-Avoid-dimension-id-collisions.patch index 395fb85ee7..10a3cd07e3 100644 --- a/Spigot-Server-Patches/0362-Avoid-dimension-id-collisions.patch +++ b/Spigot-Server-Patches/0361-Avoid-dimension-id-collisions.patch @@ -1,4 +1,4 @@ -From 67ed56157ed7757e00c1b6e66d1c51970d5b0e4a Mon Sep 17 00:00:00 2001 +From b7eb941955ef61c16f5422f60400d65fa60dbdd6 Mon Sep 17 00:00:00 2001 From: Brokkonaut Date: Tue, 25 Sep 2018 06:53:43 +0200 Subject: [PATCH] Avoid dimension id collisions @@ -8,7 +8,7 @@ we would reuse an existing dimension id, if some other dimension was unloaded before. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6cea317d..fac42f8e 100644 +index 6cea317d5..fac42f8e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -975,7 +975,7 @@ public final class CraftServer implements Server { @@ -21,5 +21,5 @@ index 6cea317d..fac42f8e 100644 dimension++; break; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0363-Honor-EntityAgeable.ageLock.patch b/Spigot-Server-Patches/0362-Honor-EntityAgeable.ageLock.patch similarity index 85% rename from Spigot-Server-Patches/0363-Honor-EntityAgeable.ageLock.patch rename to Spigot-Server-Patches/0362-Honor-EntityAgeable.ageLock.patch index f3a9b15f45..df1fae8036 100644 --- a/Spigot-Server-Patches/0363-Honor-EntityAgeable.ageLock.patch +++ b/Spigot-Server-Patches/0362-Honor-EntityAgeable.ageLock.patch @@ -1,11 +1,11 @@ -From f23346c138dc50657cb7342f8a71f557e12fc581 Mon Sep 17 00:00:00 2001 +From 9f6bf5a9f952475fc29bfe8fec7208732e0ae2b6 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 23 Sep 2018 20:59:53 -0500 Subject: [PATCH] Honor EntityAgeable.ageLock diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java -index 2af1ac70..aa54e380 100644 +index 2af1ac702..aa54e380e 100644 --- a/src/main/java/net/minecraft/server/EntityAgeable.java +++ b/src/main/java/net/minecraft/server/EntityAgeable.java @@ -82,6 +82,7 @@ public abstract class EntityAgeable extends EntityCreature { @@ -17,5 +17,5 @@ index 2af1ac70..aa54e380 100644 int k = j; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0364-Async-Chunk-Loading-and-Generation.patch b/Spigot-Server-Patches/0363-Async-Chunk-Loading-and-Generation.patch similarity index 99% rename from Spigot-Server-Patches/0364-Async-Chunk-Loading-and-Generation.patch rename to Spigot-Server-Patches/0363-Async-Chunk-Loading-and-Generation.patch index 16cc3e4c72..4bfdf78799 100644 --- a/Spigot-Server-Patches/0364-Async-Chunk-Loading-and-Generation.patch +++ b/Spigot-Server-Patches/0363-Async-Chunk-Loading-and-Generation.patch @@ -1,4 +1,4 @@ -From 9864f7559ec6beef68f585618d990862853de7dd Mon Sep 17 00:00:00 2001 +From 16ac299068f1e64f24ff8e93f4952865b7c89c22 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 16:55:04 -0400 Subject: [PATCH] Async Chunk Loading and Generation @@ -43,7 +43,7 @@ reading or writing to the chunk will be safe, so plugins still should not be touching chunks asynchronously! diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 359c538f..94252008 100644 +index 359c538f3..942520088 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -376,4 +376,57 @@ public class PaperConfig { @@ -106,7 +106,7 @@ index 359c538f..94252008 100644 } diff --git a/src/main/java/com/destroystokyo/paper/util/PriorityQueuedExecutor.java b/src/main/java/com/destroystokyo/paper/util/PriorityQueuedExecutor.java new file mode 100644 -index 00000000..8f18c286 +index 000000000..8f18c2869 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/PriorityQueuedExecutor.java @@ -0,0 +1,347 @@ @@ -458,7 +458,7 @@ index 00000000..8f18c286 + +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 9f28d777..fb00e7a9 100644 +index 9f28d7775..fb00e7a9c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -190,6 +190,7 @@ public class Chunk implements IChunkAccess { @@ -470,7 +470,7 @@ index 9f28d777..fb00e7a9 100644 Iterator iterator = protochunk.s().iterator(); diff --git a/src/main/java/net/minecraft/server/ChunkMap.java b/src/main/java/net/minecraft/server/ChunkMap.java -index 2021c0d0..154ab09e 100644 +index 2021c0d02..154ab09e0 100644 --- a/src/main/java/net/minecraft/server/ChunkMap.java +++ b/src/main/java/net/minecraft/server/ChunkMap.java @@ -14,9 +14,17 @@ public class ChunkMap extends Long2ObjectOpenHashMap { @@ -562,7 +562,7 @@ index 2021c0d0..154ab09e 100644 public void putAll(Map map) { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 186cfda7..781e0687 100644 +index 186cfda7e..781e06877 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -33,12 +33,12 @@ public class ChunkProviderServer implements IChunkProvider { @@ -713,7 +713,7 @@ index 186cfda7..781e0687 100644 } diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index d938eb37..51df075b 100644 +index d938eb374..51df075b4 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -119,7 +119,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { @@ -740,7 +740,7 @@ index d938eb37..51df075b 100644 completion = new Supplier() { public NBTTagCompound get() { diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 2af07ae5..9c6844d4 100644 +index 2af07ae59..9c6844d44 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -25,7 +25,17 @@ public class ChunkSection { @@ -762,7 +762,7 @@ index 2af07ae5..9c6844d4 100644 public IBlockData getType(int i, int j, int k) { return (IBlockData) this.blockIds.a(i, j, k); diff --git a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java -index d3898599..8f061f5c 100644 +index d3898599f..8f061f5ca 100644 --- a/src/main/java/net/minecraft/server/ChunkTaskScheduler.java +++ b/src/main/java/net/minecraft/server/ChunkTaskScheduler.java @@ -17,13 +17,14 @@ public class ChunkTaskScheduler extends Scheduler map) { diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index 454903a0..dcbcb655 100644 +index 454903a0e..dcbcb655c 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -3,7 +3,7 @@ package net.minecraft.server; @@ -921,7 +921,7 @@ index 454903a0..dcbcb655 100644 // Paper start - Anti-Xray - Support default methods diff --git a/src/main/java/net/minecraft/server/DefinedStructureManager.java b/src/main/java/net/minecraft/server/DefinedStructureManager.java -index f5a6387f..f4568509 100644 +index f5a6387f2..f45685099 100644 --- a/src/main/java/net/minecraft/server/DefinedStructureManager.java +++ b/src/main/java/net/minecraft/server/DefinedStructureManager.java @@ -21,7 +21,7 @@ import org.apache.logging.log4j.Logger; @@ -934,7 +934,7 @@ index f5a6387f..f4568509 100644 private final MinecraftServer d; private final java.nio.file.Path e; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 49ddb971..ec54a77e 100644 +index 49ddb9715..ec54a77e6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -207,7 +207,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -947,7 +947,7 @@ index 49ddb971..ec54a77e 100644 this.aJ = Sets.newHashSet(); this.aL = new double[] { 0.0D, 0.0D, 0.0D}; diff --git a/src/main/java/net/minecraft/server/IChunkLoader.java b/src/main/java/net/minecraft/server/IChunkLoader.java -index 4698ee99..dfb45cc4 100644 +index 4698ee99f..dfb45cc4e 100644 --- a/src/main/java/net/minecraft/server/IChunkLoader.java +++ b/src/main/java/net/minecraft/server/IChunkLoader.java @@ -6,6 +6,8 @@ import javax.annotation.Nullable; @@ -960,7 +960,7 @@ index 4698ee99..dfb45cc4 100644 Chunk a(GeneratorAccess generatoraccess, int i, int j, Consumer consumer) throws IOException; diff --git a/src/main/java/net/minecraft/server/MathHelper.java b/src/main/java/net/minecraft/server/MathHelper.java -index 8bb2593a..67bb2895 100644 +index 8bb2593aa..67bb28954 100644 --- a/src/main/java/net/minecraft/server/MathHelper.java +++ b/src/main/java/net/minecraft/server/MathHelper.java @@ -7,7 +7,7 @@ import java.util.function.IntPredicate; @@ -981,7 +981,7 @@ index 8bb2593a..67bb2895 100644 f %= 360.0F; if (f >= 180.0F) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d2ee4e57..236fbafe 100644 +index d2ee4e578..236fbafeb 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -499,6 +499,7 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -1071,7 +1071,7 @@ index d2ee4e57..236fbafe 100644 i = SystemUtils.getMonotonicNanos(); diff --git a/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java b/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java new file mode 100644 -index 00000000..851756d6 +index 000000000..851756d65 --- /dev/null +++ b/src/main/java/net/minecraft/server/PaperAsyncChunkProvider.java @@ -0,0 +1,658 @@ @@ -1734,7 +1734,7 @@ index 00000000..851756d6 + +} diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 240f5906..e4cf8548 100644 +index 240f59066..e4cf8548d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -22,6 +22,52 @@ public class PlayerChunk { @@ -1832,7 +1832,7 @@ index 240f5906..e4cf8548 100644 } } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 679488a3..b7dda8e2 100644 +index 679488a3c..b7dda8e28 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -25,10 +25,10 @@ public class PlayerChunkMap { @@ -1892,7 +1892,7 @@ index 679488a3..b7dda8e2 100644 private void e() { diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java -index de6dd4fe..da6df06d 100644 +index de6dd4fed..da6df06d8 100644 --- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java @@ -34,7 +34,7 @@ public class RegionLimitedWorldAccess implements GeneratorAccess { @@ -1905,7 +1905,7 @@ index de6dd4fe..da6df06d 100644 this.m = world.getChunkProvider().getChunkGenerator().getSettings(); this.i = world.getSeaLevel(); diff --git a/src/main/java/net/minecraft/server/SchedulerBatch.java b/src/main/java/net/minecraft/server/SchedulerBatch.java -index 8e909d9c..f214a74a 100644 +index 8e909d9ca..f214a74a2 100644 --- a/src/main/java/net/minecraft/server/SchedulerBatch.java +++ b/src/main/java/net/minecraft/server/SchedulerBatch.java @@ -10,6 +10,7 @@ public class SchedulerBatch, R> { @@ -1960,7 +1960,7 @@ index 8e909d9c..f214a74a 100644 } } diff --git a/src/main/java/net/minecraft/server/StructurePiece.java b/src/main/java/net/minecraft/server/StructurePiece.java -index d9def713..945a005e 100644 +index d9def7135..945a005e9 100644 --- a/src/main/java/net/minecraft/server/StructurePiece.java +++ b/src/main/java/net/minecraft/server/StructurePiece.java @@ -16,7 +16,7 @@ public abstract class StructurePiece { @@ -1995,7 +1995,7 @@ index d9def713..945a005e 100644 } diff --git a/src/main/java/net/minecraft/server/StructureStart.java b/src/main/java/net/minecraft/server/StructureStart.java -index 284e9671..8b08efe1 100644 +index 284e96710..8b08efe1f 100644 --- a/src/main/java/net/minecraft/server/StructureStart.java +++ b/src/main/java/net/minecraft/server/StructureStart.java @@ -7,7 +7,7 @@ import java.util.Random; @@ -2056,7 +2056,7 @@ index 284e9671..8b08efe1 100644 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9bfc5db3..2224eeab 100644 +index 9bfc5db39..2224eeab2 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -41,7 +41,7 @@ import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -2153,7 +2153,7 @@ index 9bfc5db3..2224eeab 100644 if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) { diff --git a/src/main/java/net/minecraft/server/WorldGenStronghold.java b/src/main/java/net/minecraft/server/WorldGenStronghold.java -index 69d8a25b..d0eaa9e9 100644 +index 69d8a25bd..d0eaa9e9f 100644 --- a/src/main/java/net/minecraft/server/WorldGenStronghold.java +++ b/src/main/java/net/minecraft/server/WorldGenStronghold.java @@ -10,23 +10,28 @@ import javax.annotation.Nullable; @@ -2306,7 +2306,7 @@ index 69d8a25b..d0eaa9e9 100644 } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0ff3fe03..9b5509dc 100644 +index 0ff3fe03d..9b5509dce 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -714,7 +714,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -2319,7 +2319,7 @@ index 0ff3fe03..9b5509dc 100644 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index fac42f8e..59b1628e 100644 +index fac42f8e5..59b1628e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1021,8 +1021,12 @@ public final class CraftServer implements Server { @@ -2347,7 +2347,7 @@ index fac42f8e..59b1628e 100644 } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 95fe3a91..b5a87cfa 100644 +index 95fe3a91b..b5a87cfaf 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -163,6 +163,16 @@ public class CraftWorld implements World { @@ -2385,7 +2385,7 @@ index 95fe3a91..b5a87cfa 100644 if (isChunkLoaded(chunkCoordX + x, chunkCoordZ + z)) { unloadChunk(chunkCoordX + x, chunkCoordZ + z); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 054ebc82..2e0b4de8 100644 +index 054ebc82b..2e0b4de83 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -82,6 +82,7 @@ public class CraftEventFactory { @@ -2447,7 +2447,7 @@ index 054ebc82..2e0b4de8 100644 if (!event.isCancelled()) { diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java -index 9c917370..a299092a 100644 +index 9c917370a..a299092a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CustomChunkGenerator.java @@ -21,6 +21,7 @@ public class CustomChunkGenerator extends InternalChunkGenerator Date: Thu, 27 Sep 2018 00:08:31 -0400 Subject: [PATCH] Ignore Dimension NBT field in Entity data @@ -14,7 +14,7 @@ DimensionManager set to the world it is being placed into. This fixes corrupt entities breaking chunk saving in custom worlds. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index ec54a77e..235061e5 100644 +index ec54a77e6..235061e57 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1729,7 +1729,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -27,5 +27,5 @@ index ec54a77e..235061e5 100644 this.invulnerable = nbttagcompound.getBoolean("Invulnerable"); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0366-Optimize-Light-Recalculations.patch b/Spigot-Server-Patches/0365-Optimize-Light-Recalculations.patch similarity index 95% rename from Spigot-Server-Patches/0366-Optimize-Light-Recalculations.patch rename to Spigot-Server-Patches/0365-Optimize-Light-Recalculations.patch index 14273386a7..38d73c44be 100644 --- a/Spigot-Server-Patches/0366-Optimize-Light-Recalculations.patch +++ b/Spigot-Server-Patches/0365-Optimize-Light-Recalculations.patch @@ -1,4 +1,4 @@ -From 67fe79d4d74bde2b956929fe8a6cdaa004941068 Mon Sep 17 00:00:00 2001 +From c5c8ec25c00ac3bbda8b6ee3fdfdd372b8bbac38 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 28 Sep 2018 20:46:29 -0400 Subject: [PATCH] Optimize Light Recalculations @@ -14,7 +14,7 @@ Also optimizes to not repeatedly look up the same chunk for light lookups. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index e0420405..0b54b7d7 100644 +index e04204055..0b54b7d78 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -523,6 +523,11 @@ public class PaperWorldConfig { @@ -30,7 +30,7 @@ index e0420405..0b54b7d7 100644 public boolean asynchronous; public EngineMode engineMode; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index fb00e7a9..fdf062b8 100644 +index fb00e7a9c..fdf062b8b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -353,7 +353,7 @@ public class Chunk implements IChunkAccess { @@ -52,7 +52,7 @@ index fb00e7a9..fdf062b8 100644 int i1 = iblockdata.b(this.world, blockposition); int j1 = iblockdata1.b(this.world, blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2224eeab..57de5f48 100644 +index 2224eeab2..57de5f48a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -591,8 +591,9 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -80,5 +80,5 @@ index 2224eeab..57de5f48 100644 // CraftBukkit end return false; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0367-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch b/Spigot-Server-Patches/0366-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch similarity index 94% rename from Spigot-Server-Patches/0367-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch rename to Spigot-Server-Patches/0366-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch index 0d349c1c70..979eb9a53d 100644 --- a/Spigot-Server-Patches/0367-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch +++ b/Spigot-Server-Patches/0366-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch @@ -1,4 +1,4 @@ -From 6723dd0a77f187b859456ff1883d09c1808a5d70 Mon Sep 17 00:00:00 2001 +From 4345f180fd5a8c0b232e82e5c8d59342602a8c4f Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 28 Sep 2018 21:49:53 -0400 Subject: [PATCH] Fix issues with entity loss due to unloaded chunks @@ -18,7 +18,7 @@ This change ensures the chunks are always loaded when entities are added to the world, or a valid entity moves between chunks. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 57de5f48..2e48ea9d 100644 +index 57de5f48a..2e48ea9d8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1081,7 +1081,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -40,5 +40,5 @@ index 57de5f48..2e48ea9d 100644 } else { this.getChunkAt(i, k).a(entity); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0368-Don-t-recheck-type-after-setting-a-block.patch b/Spigot-Server-Patches/0367-Don-t-recheck-type-after-setting-a-block.patch similarity index 92% rename from Spigot-Server-Patches/0368-Don-t-recheck-type-after-setting-a-block.patch rename to Spigot-Server-Patches/0367-Don-t-recheck-type-after-setting-a-block.patch index 33ca3d8749..5b3cc2c51a 100644 --- a/Spigot-Server-Patches/0368-Don-t-recheck-type-after-setting-a-block.patch +++ b/Spigot-Server-Patches/0367-Don-t-recheck-type-after-setting-a-block.patch @@ -1,4 +1,4 @@ -From e8663937dae1f009fa3239bc11bf399907acb416 Mon Sep 17 00:00:00 2001 +From c74d9072387dce3b2e4ba0406bb087da22b97176 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 28 Sep 2018 22:27:33 -0400 Subject: [PATCH] Don't recheck type after setting a block @@ -16,7 +16,7 @@ be having data corruption issues anyways. This provides a small boost to all setType calls. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index fdf062b8..d848a97b 100644 +index fdf062b8b..d848a97bd 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -558,7 +558,7 @@ public class Chunk implements IChunkAccess { @@ -29,5 +29,5 @@ index fdf062b8..d848a97b 100644 } else { if (flag1) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0369-Fix-Sending-Chunks-to-Client.patch b/Spigot-Server-Patches/0368-Fix-Sending-Chunks-to-Client.patch similarity index 94% rename from Spigot-Server-Patches/0369-Fix-Sending-Chunks-to-Client.patch rename to Spigot-Server-Patches/0368-Fix-Sending-Chunks-to-Client.patch index 6ac57f2220..a95e58bb3a 100644 --- a/Spigot-Server-Patches/0369-Fix-Sending-Chunks-to-Client.patch +++ b/Spigot-Server-Patches/0368-Fix-Sending-Chunks-to-Client.patch @@ -1,4 +1,4 @@ -From 1185ba108dd399f393c33d77e62614a88b47f7c2 Mon Sep 17 00:00:00 2001 +From 18286af8e0396d079dd3aac05c304cd29cc68de1 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 29 Sep 2018 01:18:16 -0400 Subject: [PATCH] Fix Sending Chunks to Client @@ -14,7 +14,7 @@ This fix always sends chunks to the client, and simply updates the client anytime post processing is triggered with the new chunk data. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index d848a97b..2bcbf890 100644 +index d848a97bd..2bcbf8902 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1189,7 +1189,7 @@ public class Chunk implements IChunkAccess { @@ -41,7 +41,7 @@ index d848a97b..2bcbf890 100644 } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index e4cf8548..ac5d1580 100644 +index e4cf8548d..ac5d15809 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java @@ -20,7 +20,7 @@ public class PlayerChunk { @@ -62,5 +62,5 @@ index e4cf8548..ac5d1580 100644 if (this.done) { return true; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0370-Configurable-connection-throttle-kick-message.patch b/Spigot-Server-Patches/0369-Configurable-connection-throttle-kick-message.patch similarity index 94% rename from Spigot-Server-Patches/0370-Configurable-connection-throttle-kick-message.patch rename to Spigot-Server-Patches/0369-Configurable-connection-throttle-kick-message.patch index b9f6615a13..bcd82fc8e0 100644 --- a/Spigot-Server-Patches/0370-Configurable-connection-throttle-kick-message.patch +++ b/Spigot-Server-Patches/0369-Configurable-connection-throttle-kick-message.patch @@ -1,11 +1,11 @@ -From 23a156f8cf3e5bafb9b227d7399826a89c280485 Mon Sep 17 00:00:00 2001 +From d08710d4257ab8f3b8c7089140c1de1f877382eb Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 2 Oct 2018 09:57:50 +0100 Subject: [PATCH] Configurable connection throttle kick message diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 94252008..7f9845d9 100644 +index 942520088..7f9845d92 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -296,6 +296,11 @@ public class PaperConfig { @@ -21,7 +21,7 @@ index 94252008..7f9845d9 100644 private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index e732d55f..2c594b43 100644 +index e732d55f9..2c594b437 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -37,7 +37,7 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -34,5 +34,5 @@ index e732d55f..2c594b43 100644 this.b.close(chatmessage); return; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0371-Fix-FileIOThread-concurrency-issues.patch b/Spigot-Server-Patches/0370-Fix-FileIOThread-concurrency-issues.patch similarity index 93% rename from Spigot-Server-Patches/0371-Fix-FileIOThread-concurrency-issues.patch rename to Spigot-Server-Patches/0370-Fix-FileIOThread-concurrency-issues.patch index 4a47aa5c0c..f38ca8eb37 100644 --- a/Spigot-Server-Patches/0371-Fix-FileIOThread-concurrency-issues.patch +++ b/Spigot-Server-Patches/0370-Fix-FileIOThread-concurrency-issues.patch @@ -1,4 +1,4 @@ -From 64d408a45a717c918eaa13eb35dfdd18749b4f3f Mon Sep 17 00:00:00 2001 +From 4f4907cd5fd6564da326c5abb2f2816007b4059c Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 3 Oct 2018 19:04:53 +0100 Subject: [PATCH] Fix FileIOThread concurrency issues @@ -9,7 +9,7 @@ issues when this counter is updated from multiple threads, potentially causing these counters to desync due to the unsafe volatile update diff --git a/src/main/java/net/minecraft/server/FileIOThread.java b/src/main/java/net/minecraft/server/FileIOThread.java -index 3c688f54..57062460 100644 +index 3c688f546..570624600 100644 --- a/src/main/java/net/minecraft/server/FileIOThread.java +++ b/src/main/java/net/minecraft/server/FileIOThread.java @@ -10,7 +10,7 @@ public class FileIOThread implements Runnable { @@ -31,5 +31,5 @@ index 3c688f54..57062460 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0372-Hook-into-CB-plugin-rewrites.patch b/Spigot-Server-Patches/0371-Hook-into-CB-plugin-rewrites.patch similarity index 98% rename from Spigot-Server-Patches/0372-Hook-into-CB-plugin-rewrites.patch rename to Spigot-Server-Patches/0371-Hook-into-CB-plugin-rewrites.patch index e6650646da..236ba558ae 100644 --- a/Spigot-Server-Patches/0372-Hook-into-CB-plugin-rewrites.patch +++ b/Spigot-Server-Patches/0371-Hook-into-CB-plugin-rewrites.patch @@ -1,4 +1,4 @@ -From 81fbf50c8d0955b62922dc6bec23b07ecb7f7a82 Mon Sep 17 00:00:00 2001 +From e763015c2f584525e1da87691ebf9570ba516d69 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 3 Oct 2018 20:09:18 -0400 Subject: [PATCH] Hook into CB plugin rewrites @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 632df227..b6632322 100644 +index 632df2270..b66323220 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -6,7 +6,9 @@ import java.io.FileOutputStream; @@ -187,5 +187,5 @@ index 632df227..b6632322 100644 { if ( owner.equals( "org/bukkit/Material" ) ) -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0373-Allow-setting-the-vex-s-summoner.patch b/Spigot-Server-Patches/0372-Allow-setting-the-vex-s-summoner.patch similarity index 90% rename from Spigot-Server-Patches/0373-Allow-setting-the-vex-s-summoner.patch rename to Spigot-Server-Patches/0372-Allow-setting-the-vex-s-summoner.patch index 09cabcbdb0..8ef6d5304e 100644 --- a/Spigot-Server-Patches/0373-Allow-setting-the-vex-s-summoner.patch +++ b/Spigot-Server-Patches/0372-Allow-setting-the-vex-s-summoner.patch @@ -1,11 +1,11 @@ -From 7e894443dba510006b373b213ec731f1fedd0b62 Mon Sep 17 00:00:00 2001 +From 22634d13454d06024532e4b44f68af7d216ba742 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 6 Oct 2018 21:47:44 -0500 Subject: [PATCH] Allow setting the vex's summoner diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index c3864b86..589b13f4 100644 +index c3864b869..589b13f4e 100644 --- a/src/main/java/net/minecraft/server/EntityVex.java +++ b/src/main/java/net/minecraft/server/EntityVex.java @@ -127,6 +127,7 @@ public class EntityVex extends EntityMonster { @@ -17,7 +17,7 @@ index c3864b86..589b13f4 100644 this.b = entityinsentient; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java -index c96a5df8..b09da64c 100644 +index c96a5df80..b09da64c3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java @@ -23,6 +23,10 @@ public class CraftVex extends CraftMonster implements Vex { @@ -32,5 +32,5 @@ index c96a5df8..b09da64c 100644 @Override -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0374-Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/0373-Add-LivingEntity-getTargetEntity.patch similarity index 97% rename from Spigot-Server-Patches/0374-Add-LivingEntity-getTargetEntity.patch rename to Spigot-Server-Patches/0373-Add-LivingEntity-getTargetEntity.patch index e64baabe6d..c8ef330471 100644 --- a/Spigot-Server-Patches/0374-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-Server-Patches/0373-Add-LivingEntity-getTargetEntity.patch @@ -1,11 +1,11 @@ -From 6a11280367803c2734c81a10614fc312848d9a65 Mon Sep 17 00:00:00 2001 +From 028f2d7f254b02f2344c8ac875dbbdd531c151cd Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 22 Sep 2018 00:33:08 -0500 Subject: [PATCH] Add LivingEntity#getTargetEntity diff --git a/src/main/java/net/minecraft/server/AxisAlignedBB.java b/src/main/java/net/minecraft/server/AxisAlignedBB.java -index 1c0b783e..dad1ff73 100644 +index 1c0b783e8..dad1ff737 100644 --- a/src/main/java/net/minecraft/server/AxisAlignedBB.java +++ b/src/main/java/net/minecraft/server/AxisAlignedBB.java @@ -95,6 +95,7 @@ public class AxisAlignedBB { @@ -46,7 +46,7 @@ index 1c0b783e..dad1ff73 100644 public MovingObjectPosition b(Vec3D vec3d, Vec3D vec3d1) { return this.a(vec3d, vec3d1, (BlockPosition) null); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 235061e5..a8271457 100644 +index 235061e57..a82714574 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -1533,6 +1533,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -71,7 +71,7 @@ index 235061e5..a8271457 100644 return this.d(this.pitch, this.yaw); } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index f48ddbc6..1023505d 100644 +index f48ddbc68..1023505d1 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -3,6 +3,8 @@ package net.minecraft.server; @@ -130,7 +130,7 @@ index f48ddbc6..1023505d 100644 public int getShieldBlockingDelay() { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index f6916fd4..71f08d53 100644 +index f6916fd45..71f08d53c 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -19,6 +19,7 @@ public final class IEntitySelector { @@ -142,7 +142,7 @@ index f6916fd4..71f08d53 100644 return !(entity instanceof EntityHuman) || !((EntityHuman) entity).isSpectator(); }; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index eeab5937..d6a4bc64 100644 +index eeab59379..d6a4bc64a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -186,6 +186,33 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @@ -180,5 +180,5 @@ index eeab5937..d6a4bc64 100644 public List getLastTwoTargetBlocks(Set transparent, int maxDistance) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0375-Add-sun-related-API.patch b/Spigot-Server-Patches/0374-Add-sun-related-API.patch similarity index 91% rename from Spigot-Server-Patches/0375-Add-sun-related-API.patch rename to Spigot-Server-Patches/0374-Add-sun-related-API.patch index 0ef93a01c4..e00c349aa3 100644 --- a/Spigot-Server-Patches/0375-Add-sun-related-API.patch +++ b/Spigot-Server-Patches/0374-Add-sun-related-API.patch @@ -1,11 +1,11 @@ -From a345370612d8ad6ee6aa975fbc3db18140d6bca8 Mon Sep 17 00:00:00 2001 +From 87d1c7a76330cf12eb0bd67b160961f2d4355ac2 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 Oct 2018 00:54:21 -0500 Subject: [PATCH] Add sun related API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index ee507837..3059682a 100644 +index ee5078370..3059682a4 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -1287,6 +1287,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -17,7 +17,7 @@ index ee507837..3059682a 100644 if (this.world.L() && !this.world.isClientSide) { float f = this.az(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2e48ea9d..a21de9b3 100644 +index 2e48ea9d8..a21de9b3d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -829,6 +829,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -29,7 +29,7 @@ index 2e48ea9d..a21de9b3 100644 return this.G < 4; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index b5a87cfa..e33135ad 100644 +index b5a87cfaf..e33135ada 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -538,6 +538,12 @@ public class CraftWorld implements World { @@ -46,7 +46,7 @@ index b5a87cfa..e33135ad 100644 return createExplosion(x, y, z, power, false, true); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java -index 53c2d154..40a42994 100644 +index 53c2d154e..40a429942 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMob.java @@ -68,4 +68,10 @@ public abstract class CraftMob extends CraftLivingEntity implements Mob { @@ -61,5 +61,5 @@ index 53c2d154..40a42994 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0376-Check-Drowned-for-Villager-Aggression-Config.patch b/Spigot-Server-Patches/0375-Check-Drowned-for-Villager-Aggression-Config.patch similarity index 92% rename from Spigot-Server-Patches/0376-Check-Drowned-for-Villager-Aggression-Config.patch rename to Spigot-Server-Patches/0375-Check-Drowned-for-Villager-Aggression-Config.patch index 885a58280d..631f1f5ed7 100644 --- a/Spigot-Server-Patches/0376-Check-Drowned-for-Villager-Aggression-Config.patch +++ b/Spigot-Server-Patches/0375-Check-Drowned-for-Villager-Aggression-Config.patch @@ -1,11 +1,11 @@ -From f58f52b643f0bec4dd78717763661725135e78ab Mon Sep 17 00:00:00 2001 +From 2a79b79c6f44abaf6cca0c254bfc014dfe80fc2c Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Wed, 10 Oct 2018 21:22:44 -0500 Subject: [PATCH] Check Drowned for Villager Aggression Config diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index b861c623..0e2b5ee7 100644 +index b861c623c..0e2b5ee74 100644 --- a/src/main/java/net/minecraft/server/EntityDrowned.java +++ b/src/main/java/net/minecraft/server/EntityDrowned.java @@ -28,7 +28,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { @@ -18,5 +18,5 @@ index b861c623..0e2b5ee7 100644 this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bC)); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0377-Here-s-Johnny.patch b/Spigot-Server-Patches/0376-Here-s-Johnny.patch similarity index 91% rename from Spigot-Server-Patches/0377-Here-s-Johnny.patch rename to Spigot-Server-Patches/0376-Here-s-Johnny.patch index 58fa849154..dc767a5924 100644 --- a/Spigot-Server-Patches/0377-Here-s-Johnny.patch +++ b/Spigot-Server-Patches/0376-Here-s-Johnny.patch @@ -1,11 +1,11 @@ -From efe8887222bbaa943dbb8911f8e6f122c14b4231 Mon Sep 17 00:00:00 2001 +From 9f55006a73e6cebd575002ed48f7fbf820a52a35 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 12 Oct 2018 01:37:22 -0500 Subject: [PATCH] Here's Johnny! diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index 96d0651e..4bbb4817 100644 +index 96d0651e9..4bbb4817b 100644 --- a/src/main/java/net/minecraft/server/EntityVindicator.java +++ b/src/main/java/net/minecraft/server/EntityVindicator.java @@ -5,7 +5,7 @@ import javax.annotation.Nullable; @@ -18,7 +18,7 @@ index 96d0651e..4bbb4817 100644 return entity instanceof EntityLiving && ((EntityLiving) entity).df(); }; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java -index 951d4792..5ff957ce 100644 +index 951d47929..5ff957ced 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVindicator.java @@ -25,4 +25,14 @@ public class CraftVindicator extends CraftIllager implements Vindicator { @@ -37,5 +37,5 @@ index 951d4792..5ff957ce 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0378-Turtle-API.patch b/Spigot-Server-Patches/0377-Turtle-API.patch similarity index 97% rename from Spigot-Server-Patches/0378-Turtle-API.patch rename to Spigot-Server-Patches/0377-Turtle-API.patch index de90844cf7..4161ef876c 100644 --- a/Spigot-Server-Patches/0378-Turtle-API.patch +++ b/Spigot-Server-Patches/0377-Turtle-API.patch @@ -1,11 +1,11 @@ -From f31db13e73d14dafe62daec6f5e40913d7e6d67f Mon Sep 17 00:00:00 2001 +From 840d10f8cefb7f0fb445240ec43d5a39bcf895f3 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 29 Sep 2018 16:08:23 -0500 Subject: [PATCH] Turtle API diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index b016e0ae..a533e0eb 100644 +index b016e0ae7..a533e0eb5 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -27,51 +27,63 @@ public class EntityTurtle extends EntityAnimal { @@ -103,7 +103,7 @@ index b016e0ae..a533e0eb 100644 public void c() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java -index 123a2c75..8edcf7af 100644 +index 123a2c75c..8edcf7af6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java @@ -1,6 +1,8 @@ @@ -153,5 +153,5 @@ index 123a2c75..8edcf7af 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0379-Limit-lightning-strike-effect-distance.patch b/Spigot-Server-Patches/0378-Limit-lightning-strike-effect-distance.patch similarity index 96% rename from Spigot-Server-Patches/0379-Limit-lightning-strike-effect-distance.patch rename to Spigot-Server-Patches/0378-Limit-lightning-strike-effect-distance.patch index aac7462fed..836810557e 100644 --- a/Spigot-Server-Patches/0379-Limit-lightning-strike-effect-distance.patch +++ b/Spigot-Server-Patches/0378-Limit-lightning-strike-effect-distance.patch @@ -1,11 +1,11 @@ -From 964e75e95495b3a5bf17b16e75cd28cf33973c6b Mon Sep 17 00:00:00 2001 +From d05e9f6ac6e00c2ecdbcba37bde6f575f4e18d4c Mon Sep 17 00:00:00 2001 From: Trigary Date: Fri, 14 Sep 2018 17:42:08 +0200 Subject: [PATCH] Limit lightning strike effect distance diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 0b54b7d7..d723868f 100644 +index 0b54b7d78..d723868fc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -237,6 +237,28 @@ public class PaperWorldConfig { @@ -38,7 +38,7 @@ index 0b54b7d7..d723868f 100644 public boolean firePhysicsEventForRedstone = false; private void firePhysicsEventForRedstone() { diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java -index 7781babf..50f62000 100644 +index 7781babf5..50f620009 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java @@ -60,6 +60,17 @@ public class EntityLightning extends EntityWeather { @@ -69,7 +69,7 @@ index 7781babf..50f62000 100644 --this.lifeTicks; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 9b5509dc..409b5074 100644 +index 9b5509dce..409b50744 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -1064,7 +1064,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -82,5 +82,5 @@ index 9b5509dc..409b5074 100644 } else { return false; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0380-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/0379-Implement-getters-and-setters-for-EntityItem-owner-a.patch similarity index 94% rename from Spigot-Server-Patches/0380-Implement-getters-and-setters-for-EntityItem-owner-a.patch rename to Spigot-Server-Patches/0379-Implement-getters-and-setters-for-EntityItem-owner-a.patch index f1d1adc667..9dc54a3e86 100644 --- a/Spigot-Server-Patches/0380-Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-Server-Patches/0379-Implement-getters-and-setters-for-EntityItem-owner-a.patch @@ -1,4 +1,4 @@ -From 91d24825a64315344a24600d6cd738657e1e434a Mon Sep 17 00:00:00 2001 +From 6f31765d9967bba38cd09911a54b48a701dba5b4 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sat, 6 Oct 2018 20:54:23 -0500 Subject: [PATCH] Implement getters and setters for EntityItem owner and @@ -6,7 +6,7 @@ Subject: [PATCH] Implement getters and setters for EntityItem owner and diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 6752d0b8..03fee65e 100644 +index 6752d0b8c..03fee65e4 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -411,20 +411,22 @@ public class EntityItem extends Entity { @@ -37,7 +37,7 @@ index 6752d0b8..03fee65e 100644 this.f = uuid; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java -index 6036592f..4128ba4c 100644 +index 6036592f7..4128ba4c0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItem.java @@ -9,6 +9,11 @@ import org.bukkit.inventory.ItemStack; @@ -78,5 +78,5 @@ index 6036592f..4128ba4c 100644 @Override -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0381-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/Spigot-Server-Patches/0380-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch similarity index 94% rename from Spigot-Server-Patches/0381-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch rename to Spigot-Server-Patches/0380-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch index d0aa291244..2b26e347a7 100644 --- a/Spigot-Server-Patches/0381-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch +++ b/Spigot-Server-Patches/0380-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch @@ -1,4 +1,4 @@ -From da643cd82cac0e15987a55314c547a9b521e66df Mon Sep 17 00:00:00 2001 +From f68336ea1c40cf143abe86158e6e6db2beafd268 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 17 Oct 2018 19:17:27 -0400 Subject: [PATCH] MC-50319: Check other worlds for shooter of projectiles @@ -11,7 +11,7 @@ If the projectile fails to find the shooter in the current world, check other worlds. diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 62b5b6ec..60ab1c75 100644 +index 62b5b6ece..60ab1c751 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -250,11 +250,21 @@ public abstract class EntityProjectile extends Entity implements IProjectile { @@ -38,5 +38,5 @@ index 62b5b6ec..60ab1c75 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0382-Call-player-spectator-target-events.patch b/Spigot-Server-Patches/0381-Call-player-spectator-target-events.patch similarity index 94% rename from Spigot-Server-Patches/0382-Call-player-spectator-target-events.patch rename to Spigot-Server-Patches/0381-Call-player-spectator-target-events.patch index 3dca147030..bace84ec84 100644 --- a/Spigot-Server-Patches/0382-Call-player-spectator-target-events.patch +++ b/Spigot-Server-Patches/0381-Call-player-spectator-target-events.patch @@ -1,11 +1,11 @@ -From 5dc59a29f82965dee60bcb9abb87b7ed4f23f836 Mon Sep 17 00:00:00 2001 +From a854a7b5588062bada57d6f473da1caafcaf14f2 Mon Sep 17 00:00:00 2001 From: Caleb Bassham Date: Fri, 28 Sep 2018 02:32:19 -0500 Subject: [PATCH] Call player spectator target events diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b01fffbd..5757e128 100644 +index 62feadc8a..f1b7353cf 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -59,7 +59,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -17,7 +17,7 @@ index b01fffbd..5757e128 100644 public boolean worldChangeInvuln; private boolean cx; private void setHasSeenCredits(boolean has) { this.cx = has; } // Paper - OBFHELPER private final RecipeBookServer recipeBook; -@@ -1384,15 +1384,35 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1390,15 +1390,35 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity); } @@ -59,5 +59,5 @@ index b01fffbd..5757e128 100644 protected void E() { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0383-Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/0382-Add-Velocity-IP-Forwarding-Support.patch similarity index 97% rename from Spigot-Server-Patches/0383-Add-Velocity-IP-Forwarding-Support.patch rename to Spigot-Server-Patches/0382-Add-Velocity-IP-Forwarding-Support.patch index 87a3997077..40009807c5 100644 --- a/Spigot-Server-Patches/0383-Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/0382-Add-Velocity-IP-Forwarding-Support.patch @@ -1,4 +1,4 @@ -From 467f615bb7164bb81908ae9b7feef88292c52d5f Mon Sep 17 00:00:00 2001 +From 1271279035cd2cdca7f5692aab1430f19cda31a2 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 8 Oct 2018 14:36:14 -0400 Subject: [PATCH] Add Velocity IP Forwarding Support @@ -14,7 +14,7 @@ forwarding, and is integrated into the Minecraft login process by using the 1.13 login plugin message packet. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 7f9845d9..52ce8f89 100644 +index 7f9845d92..52ce8f89e 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -8,6 +8,7 @@ import java.io.IOException; @@ -55,7 +55,7 @@ index 7f9845d9..52ce8f89 100644 } diff --git a/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java new file mode 100644 -index 00000000..fdd8708f +index 000000000..fdd8708f9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/proxy/VelocityProxy.java @@ -0,0 +1,67 @@ @@ -127,7 +127,7 @@ index 00000000..fdd8708f + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index c5801122..ca76f2a3 100644 +index c5801122d..ca76f2a38 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -42,6 +42,7 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -203,7 +203,7 @@ index c5801122..ca76f2a3 100644 } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 4c111047..c5369791 100644 +index 4c1110479..c53697914 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -46,7 +46,7 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -216,7 +216,7 @@ index 4c111047..c5369791 100644 public java.util.UUID spoofedUUID; public com.mojang.authlib.properties.Property[] spoofedProfile; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index b95836d4..621aad15 100644 +index b95836d44..621aad150 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -140,6 +140,7 @@ public class PacketDataSerializer extends ByteBuf { @@ -244,7 +244,7 @@ index b95836d4..621aad15 100644 int j = this.g(); diff --git a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java -index bdac03da..430445cc 100644 +index bdac03da4..430445cc6 100644 --- a/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java +++ b/src/main/java/net/minecraft/server/PacketLoginInCustomPayload.java @@ -4,8 +4,8 @@ import java.io.IOException; @@ -259,7 +259,7 @@ index bdac03da..430445cc 100644 public PacketLoginInCustomPayload() {} diff --git a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java -index 345843a7..23c96f44 100644 +index 345843a7f..23c96f44b 100644 --- a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java +++ b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java @@ -10,6 +10,14 @@ public class PacketLoginOutCustomPayload implements Packet Date: Fri, 12 Oct 2018 14:10:46 -0500 Subject: [PATCH] Add more Witch API diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index feedfc9d..955e0e19 100644 +index feedfc9d9..955e0e19b 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -1,5 +1,11 @@ @@ -94,7 +94,7 @@ index feedfc9d..955e0e19 100644 f = super.applyMagicModifier(damagesource, f); if (damagesource.getEntity() == this) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -index f25998eb..ac465bda 100644 +index f25998eb6..ac465bda2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java @@ -6,6 +6,13 @@ import org.bukkit.craftbukkit.CraftServer; @@ -136,5 +136,5 @@ index f25998eb..ac465bda 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0385-Fix-MC-93764.patch b/Spigot-Server-Patches/0384-Fix-MC-93764.patch similarity index 85% rename from Spigot-Server-Patches/0385-Fix-MC-93764.patch rename to Spigot-Server-Patches/0384-Fix-MC-93764.patch index 0323d6c897..16346de8a9 100644 --- a/Spigot-Server-Patches/0385-Fix-MC-93764.patch +++ b/Spigot-Server-Patches/0384-Fix-MC-93764.patch @@ -1,11 +1,11 @@ -From 689c5710c054a01ef2b94aa916f0788a448244d8 Mon Sep 17 00:00:00 2001 +From fdb341d9208fc88c45afdfa5ea676af314893617 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 19 Oct 2018 19:38:45 -0500 Subject: [PATCH] Fix MC-93764 diff --git a/src/main/java/net/minecraft/server/WorldProviderTheEnd.java b/src/main/java/net/minecraft/server/WorldProviderTheEnd.java -index 99191f09..4d692b7e 100644 +index 99191f09f..4d692b7e0 100644 --- a/src/main/java/net/minecraft/server/WorldProviderTheEnd.java +++ b/src/main/java/net/minecraft/server/WorldProviderTheEnd.java @@ -27,7 +27,7 @@ public class WorldProviderTheEnd extends WorldProvider { @@ -18,5 +18,5 @@ index 99191f09..4d692b7e 100644 public boolean canRespawn() { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0386-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0385-Add-option-to-prevent-players-from-moving-into-unloa.patch similarity index 97% rename from Spigot-Server-Patches/0386-Add-option-to-prevent-players-from-moving-into-unloa.patch rename to Spigot-Server-Patches/0385-Add-option-to-prevent-players-from-moving-into-unloa.patch index 8e18fb6991..bb6add2d36 100644 --- a/Spigot-Server-Patches/0386-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/Spigot-Server-Patches/0385-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -1,4 +1,4 @@ -From b18e2bb9c66322379e66f7658d2b879fd4470b55 Mon Sep 17 00:00:00 2001 +From 8d6a0c67d91465646f20d6bcea39849f4c83fd6a Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Mon, 22 Oct 2018 17:34:10 +0200 Subject: [PATCH] Add option to prevent players from moving into unloaded @@ -6,7 +6,7 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index d723868f..8210b22e 100644 +index d723868fc..8210b22eb 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -579,4 +579,9 @@ public class PaperWorldConfig { @@ -20,7 +20,7 @@ index d723868f..8210b22e 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 7e285c62..0ee9e709 100644 +index 7e285c629..0ee9e7095 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -341,6 +341,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -64,5 +64,5 @@ index 7e285c62..0ee9e709 100644 float f2 = this.player.dc() ? 300.0F : 100.0F; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0387-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0386-Reset-players-airTicks-on-respawn.patch similarity index 84% rename from Spigot-Server-Patches/0387-Reset-players-airTicks-on-respawn.patch rename to Spigot-Server-Patches/0386-Reset-players-airTicks-on-respawn.patch index 886e6436c6..2f3babed73 100644 --- a/Spigot-Server-Patches/0387-Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/0386-Reset-players-airTicks-on-respawn.patch @@ -1,11 +1,11 @@ -From a51a1e8f3442825faba94829f3253ca68967ca3a Mon Sep 17 00:00:00 2001 +From fcfc45227ee51e5c988f5317120013076e086631 Mon Sep 17 00:00:00 2001 From: GreenMeanie Date: Sat, 20 Oct 2018 22:34:02 -0400 Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a8271457..28ec879e 100644 +index a82714574..28ec879ed 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2332,7 +2332,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -18,10 +18,10 @@ index a8271457..28ec879e 100644 } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 5757e128..005bcaac 100644 +index f1b7353cf..5b1bbc772 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1627,6 +1627,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1633,6 +1633,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } this.setHealth(this.getMaxHealth()); @@ -30,5 +30,5 @@ index 5757e128..005bcaac 100644 this.fallDistance = 0; this.foodData = new FoodMetaData(this); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0388-Strip-private-area-unicode-characters-from-signs.patch b/Spigot-Server-Patches/0387-Strip-private-area-unicode-characters-from-signs.patch similarity index 97% rename from Spigot-Server-Patches/0388-Strip-private-area-unicode-characters-from-signs.patch rename to Spigot-Server-Patches/0387-Strip-private-area-unicode-characters-from-signs.patch index 54ab608ad6..747a27ff22 100644 --- a/Spigot-Server-Patches/0388-Strip-private-area-unicode-characters-from-signs.patch +++ b/Spigot-Server-Patches/0387-Strip-private-area-unicode-characters-from-signs.patch @@ -1,4 +1,4 @@ -From b93a22d934dc36cee0c69eb86367c1d6826f772c Mon Sep 17 00:00:00 2001 +From 05a05086b51e934ef63f0a8b023ca80453bb563d Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 23 Oct 2018 20:53:43 -0400 Subject: [PATCH] Strip private area unicode characters from signs @@ -20,7 +20,7 @@ think of no reason to use it. Fixes GH-1571 diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 458d1561..c2bcbbba 100644 +index 458d1561d..c2bcbbbab 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -11,6 +11,11 @@ public class TileEntitySign extends TileEntity implements ICommandListener { @@ -89,5 +89,5 @@ index 458d1561..c2bcbbba 100644 public void a(int i, IChatBaseComponent ichatbasecomponent) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0389-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/Spigot-Server-Patches/0388-Don-t-sleep-after-profile-lookups-if-not-needed.patch similarity index 93% rename from Spigot-Server-Patches/0389-Don-t-sleep-after-profile-lookups-if-not-needed.patch rename to Spigot-Server-Patches/0388-Don-t-sleep-after-profile-lookups-if-not-needed.patch index 2825621d81..631168ef14 100644 --- a/Spigot-Server-Patches/0389-Don-t-sleep-after-profile-lookups-if-not-needed.patch +++ b/Spigot-Server-Patches/0388-Don-t-sleep-after-profile-lookups-if-not-needed.patch @@ -1,4 +1,4 @@ -From f46b0e7d8d151fd7f1156829d00dbc7d58d204e1 Mon Sep 17 00:00:00 2001 +From 554f78b8d61e076ba2b6c38ac250f0259e6e0e0b Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 23 Oct 2018 20:25:05 -0400 Subject: [PATCH] Don't sleep after profile lookups if not needed @@ -7,7 +7,7 @@ Mojang was sleeping even if we had no more requests to go after the current one finished, resulting in 100ms lost per profile lookup diff --git a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java -index 71e48e87..23f1447c 100644 +index 71e48e87b..23f1447cf 100644 --- a/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java +++ b/src/main/java/com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java @@ -42,6 +42,7 @@ public class YggdrasilGameProfileRepository implements GameProfileRepository { @@ -32,5 +32,5 @@ index 71e48e87..23f1447c 100644 try { Thread.sleep(DELAY_BETWEEN_PAGES); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0390-Use-more-reasonable-thread-count-default-for-bootstr.patch b/Spigot-Server-Patches/0389-Use-more-reasonable-thread-count-default-for-bootstr.patch similarity index 91% rename from Spigot-Server-Patches/0390-Use-more-reasonable-thread-count-default-for-bootstr.patch rename to Spigot-Server-Patches/0389-Use-more-reasonable-thread-count-default-for-bootstr.patch index e0be02557b..5e122b1f13 100644 --- a/Spigot-Server-Patches/0390-Use-more-reasonable-thread-count-default-for-bootstr.patch +++ b/Spigot-Server-Patches/0389-Use-more-reasonable-thread-count-default-for-bootstr.patch @@ -1,11 +1,11 @@ -From 87856a6b665214907ca3a7d4a45bd0e00785703c Mon Sep 17 00:00:00 2001 +From c385874bb1a911ae87a08c3ecaafacae1667abb8 Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 23 Oct 2018 23:14:38 -0400 Subject: [PATCH] Use more reasonable thread count default for bootstrap diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java -index ee40bccf..db9af361 100644 +index ee40bccf6..db9af361d 100644 --- a/src/main/java/net/minecraft/server/DataConverterRegistry.java +++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java @@ -21,7 +21,7 @@ public class DataConverterRegistry { @@ -18,5 +18,5 @@ index ee40bccf..db9af361 100644 pool.shutdown(); return fixer; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0391-Use-EntityTypes-for-living-entities.patch b/Spigot-Server-Patches/0390-Use-EntityTypes-for-living-entities.patch similarity index 97% rename from Spigot-Server-Patches/0391-Use-EntityTypes-for-living-entities.patch rename to Spigot-Server-Patches/0390-Use-EntityTypes-for-living-entities.patch index 71ddb4c69c..3718cc5591 100644 --- a/Spigot-Server-Patches/0391-Use-EntityTypes-for-living-entities.patch +++ b/Spigot-Server-Patches/0390-Use-EntityTypes-for-living-entities.patch @@ -1,11 +1,11 @@ -From d804016b6f60b86fd06c78582a48032d311722ff Mon Sep 17 00:00:00 2001 +From 0638effa3977ba91ac7ad81d2b770152e70239fe Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Thu, 4 Oct 2018 10:08:02 -0500 Subject: [PATCH] Use EntityTypes for living entities diff --git a/src/main/java/net/minecraft/server/BlockMonsterEggs.java b/src/main/java/net/minecraft/server/BlockMonsterEggs.java -index 5a0cc6d0..d385f647 100644 +index 5a0cc6d05..d385f647e 100644 --- a/src/main/java/net/minecraft/server/BlockMonsterEggs.java +++ b/src/main/java/net/minecraft/server/BlockMonsterEggs.java @@ -35,7 +35,7 @@ public class BlockMonsterEggs extends Block { @@ -18,7 +18,7 @@ index 5a0cc6d0..d385f647 100644 entitysilverfish.setPositionRotation((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F); world.addEntity(entitysilverfish, SpawnReason.SILVERFISH_BLOCK); // CraftBukkit - add SpawnReason diff --git a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java -index 75622fbd..26536998 100644 +index 75622fbdf..265369984 100644 --- a/src/main/java/net/minecraft/server/BlockPumpkinCarved.java +++ b/src/main/java/net/minecraft/server/BlockPumpkinCarved.java @@ -52,7 +52,7 @@ public class BlockPumpkinCarved extends BlockFacingHorizontal { @@ -40,7 +40,7 @@ index 75622fbd..26536998 100644 entityirongolem.setPlayerCreated(true); entityirongolem.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.05D, (double) blockposition2.getZ() + 0.5D, 0.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/BlockTurtleEgg.java b/src/main/java/net/minecraft/server/BlockTurtleEgg.java -index 0f0872c1..1c1bf85a 100644 +index 0f0872c1e..1c1bf85a0 100644 --- a/src/main/java/net/minecraft/server/BlockTurtleEgg.java +++ b/src/main/java/net/minecraft/server/BlockTurtleEgg.java @@ -94,7 +94,7 @@ public class BlockTurtleEgg extends Block { @@ -53,7 +53,7 @@ index 0f0872c1..1c1bf85a 100644 entityturtle.setAgeRaw(-24000); entityturtle.g(blockposition); diff --git a/src/main/java/net/minecraft/server/BlockWitherSkull.java b/src/main/java/net/minecraft/server/BlockWitherSkull.java -index 93bf32dc..e6063bb4 100644 +index 93bf32dc1..e6063bb46 100644 --- a/src/main/java/net/minecraft/server/BlockWitherSkull.java +++ b/src/main/java/net/minecraft/server/BlockWitherSkull.java @@ -52,7 +52,7 @@ public class BlockWitherSkull extends BlockSkull { @@ -66,7 +66,7 @@ index 93bf32dc..e6063bb4 100644 entitywither.setPositionRotation((double) blockposition2.getX() + 0.5D, (double) blockposition2.getY() + 0.55D, (double) blockposition2.getZ() + 0.5D, shapedetector_shapedetectorcollection.getFacing().k() == EnumDirection.EnumAxis.X ? 0.0F : 90.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java -index aad7ce93..09eabf12 100644 +index aad7ce93f..09eabf123 100644 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java @@ -412,7 +412,7 @@ public class EnderDragonBattle { @@ -79,7 +79,7 @@ index aad7ce93..09eabf12 100644 entityenderdragon.getDragonControllerManager().setControllerPhase(DragonControllerPhase.HOLDING_PATTERN); entityenderdragon.setPositionRotation(0.0D, 128.0D, 0.0D, this.d.random.nextFloat() * 360.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java -index ee159e0a..070a9e7b 100644 +index ee159e0a8..070a9e7b1 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -96,7 +96,7 @@ public class EntityChicken extends EntityAnimal { @@ -92,7 +92,7 @@ index ee159e0a..070a9e7b 100644 public boolean f(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 5874d299..cc53e915 100644 +index 5874d2993..cc53e915d 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -88,7 +88,7 @@ public class EntityCow extends EntityAnimal { @@ -105,7 +105,7 @@ index 5874d299..cc53e915 100644 public float getHeadHeight() { diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java -index 961afa5c..a372f650 100644 +index 961afa5c4..a372f6508 100644 --- a/src/main/java/net/minecraft/server/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java @@ -74,7 +74,7 @@ public class EntityEnderPearl extends EntityProjectile { @@ -118,7 +118,7 @@ index 961afa5c..a372f650 100644 entityendermite.setPlayerSpawned(true); entityendermite.setPositionRotation(entityliving.locX, entityliving.locY, entityliving.locZ, entityliving.yaw, entityliving.pitch); diff --git a/src/main/java/net/minecraft/server/EntityEvoker.java b/src/main/java/net/minecraft/server/EntityEvoker.java -index 963b6fbb..fc20bbe2 100644 +index 963b6fbb9..fc20bbe27 100644 --- a/src/main/java/net/minecraft/server/EntityEvoker.java +++ b/src/main/java/net/minecraft/server/EntityEvoker.java @@ -188,8 +188,7 @@ public class EntityEvoker extends EntityIllagerWizard { @@ -132,7 +132,7 @@ index 963b6fbb..fc20bbe2 100644 entityvex.prepare(EntityEvoker.this.world.getDamageScaler(blockposition), (GroupDataEntity) null, (NBTTagCompound) null); entityvex.a((EntityInsentient) EntityEvoker.this); diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java -index 4e8a97c5..1b9425f3 100644 +index 4e8a97c55..1b9425f3e 100644 --- a/src/main/java/net/minecraft/server/EntityHorse.java +++ b/src/main/java/net/minecraft/server/EntityHorse.java @@ -208,11 +208,11 @@ public class EntityHorse extends EntityHorseAbstract { @@ -150,7 +150,7 @@ index 4e8a97c5..1b9425f3 100644 int j; diff --git a/src/main/java/net/minecraft/server/EntityHorseDonkey.java b/src/main/java/net/minecraft/server/EntityHorseDonkey.java -index 72eed22e..65c40e72 100644 +index 72eed22eb..65c40e72b 100644 --- a/src/main/java/net/minecraft/server/EntityHorseDonkey.java +++ b/src/main/java/net/minecraft/server/EntityHorseDonkey.java @@ -33,7 +33,7 @@ public class EntityHorseDonkey extends EntityHorseChestedAbstract { @@ -163,7 +163,7 @@ index 72eed22e..65c40e72 100644 this.a(entityageable, (EntityHorseAbstract) object); return (EntityAgeable) object; diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index eae2b266..0a092acd 100644 +index eae2b2665..0a092acdf 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -134,7 +134,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { @@ -176,7 +176,7 @@ index eae2b266..0a092acd 100644 public boolean a(EntityHuman entityhuman, EnumHand enumhand) { diff --git a/src/main/java/net/minecraft/server/EntityHorseZombie.java b/src/main/java/net/minecraft/server/EntityHorseZombie.java -index c23bc72f..a1873f55 100644 +index c23bc72fc..a1873f557 100644 --- a/src/main/java/net/minecraft/server/EntityHorseZombie.java +++ b/src/main/java/net/minecraft/server/EntityHorseZombie.java @@ -41,7 +41,7 @@ public class EntityHorseZombie extends EntityHorseAbstract { @@ -189,7 +189,7 @@ index c23bc72f..a1873f55 100644 public boolean a(EntityHuman entityhuman, EnumHand enumhand) { diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 5e197687..82a32c61 100644 +index 5e1976871..82a32c61e 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -285,7 +285,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn @@ -202,7 +202,7 @@ index 5e197687..82a32c61 100644 this.a(entityageable, (EntityHorseAbstract) entityllama); EntityLlama entityllama1 = (EntityLlama) entityageable; diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index dde9f1e6..638dbe97 100644 +index dde9f1e61..638dbe978 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java @@ -40,7 +40,7 @@ public class EntityMushroomCow extends EntityCow { @@ -224,7 +224,7 @@ index dde9f1e6..638dbe97 100644 @Nullable diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index ba074c10..13c84bda 100644 +index ba074c10c..13c84bda8 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -154,7 +154,7 @@ public class EntityOcelot extends EntityTameableAnimal { @@ -246,7 +246,7 @@ index ba074c10..13c84bda 100644 entityocelot.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityocelot.setAgeRaw(-24000); diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 9dc2d8be..d1689dc3 100644 +index 9dc2d8be2..d1689dc33 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -153,7 +153,7 @@ public class EntityPig extends EntityAnimal { @@ -268,7 +268,7 @@ index 9dc2d8be..d1689dc3 100644 public boolean f(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/EntityPolarBear.java b/src/main/java/net/minecraft/server/EntityPolarBear.java -index a02020d5..dbb534c9 100644 +index a02020d5f..dbb534c9c 100644 --- a/src/main/java/net/minecraft/server/EntityPolarBear.java +++ b/src/main/java/net/minecraft/server/EntityPolarBear.java @@ -18,7 +18,7 @@ public class EntityPolarBear extends EntityAnimal { @@ -281,7 +281,7 @@ index a02020d5..dbb534c9 100644 public boolean f(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/EntityRabbit.java b/src/main/java/net/minecraft/server/EntityRabbit.java -index e545b1c9..d6bac06a 100644 +index e545b1c9b..d6bac06a7 100644 --- a/src/main/java/net/minecraft/server/EntityRabbit.java +++ b/src/main/java/net/minecraft/server/EntityRabbit.java @@ -251,7 +251,7 @@ public class EntityRabbit extends EntityAnimal { @@ -294,7 +294,7 @@ index e545b1c9..d6bac06a 100644 if (this.random.nextInt(20) != 0) { diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java -index f7a25c14..c35d1eef 100644 +index f7a25c148..c35d1eef4 100644 --- a/src/main/java/net/minecraft/server/EntitySheep.java +++ b/src/main/java/net/minecraft/server/EntitySheep.java @@ -247,7 +247,7 @@ public class EntitySheep extends EntityAnimal { @@ -307,7 +307,7 @@ index f7a25c14..c35d1eef 100644 entitysheep1.setColor(this.a((EntityAnimal) this, (EntityAnimal) entitysheep)); return entitysheep1; diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java -index a42b8d55..9ef1c9ba 100644 +index a42b8d554..9ef1c9baf 100644 --- a/src/main/java/net/minecraft/server/EntitySpider.java +++ b/src/main/java/net/minecraft/server/EntitySpider.java @@ -111,7 +111,7 @@ public class EntitySpider extends EntityMonster { @@ -320,7 +320,7 @@ index a42b8d55..9ef1c9ba 100644 entityskeleton.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index a533e0eb..270b9508 100644 +index a533e0eb5..270b95082 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -218,7 +218,7 @@ public class EntityTurtle extends EntityAnimal { @@ -333,7 +333,7 @@ index a533e0eb..270b9508 100644 public boolean f(ItemStack itemstack) { diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index d74bfa12..24ca3511 100644 +index d74bfa120..24ca35119 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -269,6 +269,7 @@ public class EntityTypes { @@ -345,7 +345,7 @@ index d74bfa12..24ca3511 100644 public T a(World world) { return this.aT.apply(world); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index f01e776f..40b3ffd8 100644 +index f01e776fe..40b3ffd8c 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -592,7 +592,7 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { @@ -367,7 +367,7 @@ index f01e776f..40b3ffd8 100644 // Paper start if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 4f1696d0..46d8e0a1 100644 +index 4f1696d01..46d8e0a1f 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -342,7 +342,7 @@ public class EntityWolf extends EntityTameableAnimal { @@ -380,7 +380,7 @@ index 4f1696d0..46d8e0a1 100644 if (uuid != null) { diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 7998b80c..81cc0c3b 100644 +index 7998b80c1..81cc0c3b3 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -208,7 +208,7 @@ public class EntityZombie extends EntityMonster { @@ -420,7 +420,7 @@ index 7998b80c..81cc0c3b 100644 entitychicken1.setPositionRotation(this.locX, this.locY, this.locZ, this.yaw, 0.0F); entitychicken1.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/EntityZombieHusk.java b/src/main/java/net/minecraft/server/EntityZombieHusk.java -index 85d40296..0cca7b6d 100644 +index 85d402965..0cca7b6d5 100644 --- a/src/main/java/net/minecraft/server/EntityZombieHusk.java +++ b/src/main/java/net/minecraft/server/EntityZombieHusk.java @@ -54,7 +54,7 @@ public class EntityZombieHusk extends EntityZombie { @@ -433,7 +433,7 @@ index 85d40296..0cca7b6d 100644 } diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 86e5fbcd..fb96743a 100644 +index 86e5fbcda..fb96743af 100644 --- a/src/main/java/net/minecraft/server/EntityZombieVillager.java +++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java @@ -118,7 +118,7 @@ public class EntityZombieVillager extends EntityZombie { @@ -446,7 +446,7 @@ index 86e5fbcd..fb96743a 100644 entityvillager.u(this); entityvillager.setProfession(this.getProfession()); diff --git a/src/main/java/net/minecraft/server/ItemArmorStand.java b/src/main/java/net/minecraft/server/ItemArmorStand.java -index 576b3c56..4dd0e39e 100644 +index 576b3c565..4dd0e39ec 100644 --- a/src/main/java/net/minecraft/server/ItemArmorStand.java +++ b/src/main/java/net/minecraft/server/ItemArmorStand.java @@ -34,7 +34,7 @@ public class ItemArmorStand extends Item { @@ -459,7 +459,7 @@ index 576b3c56..4dd0e39e 100644 entityarmorstand.setPositionRotation(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F); diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -index 5ddf66ee..bb7e072e 100644 +index 5ddf66eef..bb7e072ee 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java @@ -59,7 +59,7 @@ public class MobSpawnerPhantom { @@ -472,7 +472,7 @@ index 5ddf66ee..bb7e072e 100644 entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F); groupdataentity = entityphantom.prepare(difficultydamagescaler, groupdataentity, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java -index d4fdcbdf..887e4461 100644 +index d4fdcbdfd..887e4461f 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java @@ -36,7 +36,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { @@ -494,7 +494,7 @@ index d4fdcbdf..887e4461 100644 entityskeleton.prepare(difficultydamagescaler, (GroupDataEntity) null, (NBTTagCompound) null); entityskeleton.setPosition(entityhorseabstract.locX, entityhorseabstract.locY, entityhorseabstract.locZ); diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java -index 0ac1fb53..509d62f6 100644 +index 0ac1fb53a..509d62f6b 100644 --- a/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java @@ -134,7 +134,7 @@ public class VillageSiege { @@ -507,7 +507,7 @@ index 0ac1fb53..509d62f6 100644 } catch (Exception exception) { exception.printStackTrace(); diff --git a/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java b/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java -index 94b21693..0a223cfe 100644 +index 94b21693e..0a223cfe5 100644 --- a/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenEndCityPieces.java @@ -270,7 +270,7 @@ public class WorldGenEndCityPieces { @@ -520,7 +520,7 @@ index 94b21693..0a223cfe 100644 entityshulker.setPosition((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D); entityshulker.g(blockposition); diff --git a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java -index 2def56b0..abeb4aa0 100644 +index 2def56b06..abeb4aa02 100644 --- a/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenFeatureOceanRuinPieces.java @@ -154,8 +154,7 @@ public class WorldGenFeatureOceanRuinPieces { @@ -534,7 +534,7 @@ index 2def56b0..abeb4aa0 100644 entitydrowned.setPositionRotation(blockposition, 0.0F, 0.0F); entitydrowned.prepare(generatoraccess.getDamageScaler(blockposition), (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java -index 0e7aed09..493a86e1 100644 +index 0e7aed09d..493a86e1b 100644 --- a/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenMonumentPieces.java @@ -1800,7 +1800,7 @@ public class WorldGenMonumentPieces { @@ -556,7 +556,7 @@ index 0e7aed09..493a86e1 100644 entityguardianelder.heal(entityguardianelder.getMaxHealth()); entityguardianelder.setPositionRotation((double) l + 0.5D, (double) i1, (double) j1 + 0.5D, 0.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java -index 5fa2987d..967e33b3 100644 +index 5fa2987d2..967e33b3d 100644 --- a/src/main/java/net/minecraft/server/WorldGenVillagePieces.java +++ b/src/main/java/net/minecraft/server/WorldGenVillagePieces.java @@ -1640,7 +1640,7 @@ public class WorldGenVillagePieces { @@ -578,7 +578,7 @@ index 5fa2987d..967e33b3 100644 entityvillager.setPositionRotation((double) j1 + 0.5D, (double) k1, (double) l1 + 0.5D, 0.0F, 0.0F); entityvillager.setProfession(this.c(i1, generatoraccess.m().nextInt(6))); diff --git a/src/main/java/net/minecraft/server/WorldGenWitchHut.java b/src/main/java/net/minecraft/server/WorldGenWitchHut.java -index efb0379c..3d8193c4 100644 +index efb0379ce..3d8193c47 100644 --- a/src/main/java/net/minecraft/server/WorldGenWitchHut.java +++ b/src/main/java/net/minecraft/server/WorldGenWitchHut.java @@ -81,7 +81,7 @@ public class WorldGenWitchHut extends WorldGenScatteredPiece { @@ -591,7 +591,7 @@ index efb0379c..3d8193c4 100644 entitywitch.di(); entitywitch.setPositionRotation((double) j + 0.5D, (double) i, (double) k + 0.5D, 0.0F, 0.0F); diff --git a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java -index 11010d8e..4eb746eb 100644 +index 11010d8e1..4eb746ebb 100644 --- a/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java +++ b/src/main/java/net/minecraft/server/WorldGenWoodlandMansionPieces.java @@ -23,14 +23,14 @@ public class WorldGenWoodlandMansionPieces { @@ -639,7 +639,7 @@ index 11010d8e..4eb746eb 100644 entityvindicator.setPositionRotation(blockposition, 0.0F, 0.0F); entityvindicator.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityvindicator)), (GroupDataEntity) null, (NBTTagCompound) null); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 409b5074..a4fc1e5e 100644 +index 409b50744..a4fc1e5e2 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -494,7 +494,7 @@ public class WorldServer extends World implements IAsyncTaskHandler { @@ -652,7 +652,7 @@ index 409b5074..a4fc1e5e 100644 entityhorseskeleton.s(true); entityhorseskeleton.setAgeRaw(0); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e33135ad..6ed7c935 100644 +index e33135ada..6ed7c9355 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1181,153 +1181,153 @@ public class CraftWorld implements World { @@ -868,5 +868,5 @@ index e33135ad..6ed7c935 100644 if (entity != null) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0392-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch b/Spigot-Server-Patches/0391-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch similarity index 94% rename from Spigot-Server-Patches/0392-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch rename to Spigot-Server-Patches/0391-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch index 2cf3e8e1c1..02e75b53fa 100644 --- a/Spigot-Server-Patches/0392-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch +++ b/Spigot-Server-Patches/0391-MC-136865-Use-valid-item-for-enchantment-checks-on-b.patch @@ -1,4 +1,4 @@ -From 5e5eb3fcdf13fe6484491baa13164746571d89a6 Mon Sep 17 00:00:00 2001 +From e8113ca713464a138cb8e324be1f40a5b5d18657 Mon Sep 17 00:00:00 2001 From: MisterVector Date: Thu, 1 Nov 2018 14:50:05 -0700 Subject: [PATCH] MC-136865: Use valid item for enchantment checks on block @@ -13,7 +13,7 @@ keep the clone of the item used to a non empty value so it represents the item used. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index 22378b6b..5e595b62 100644 +index 22378b6bc..5e595b62e 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -380,10 +380,11 @@ public class PlayerInteractManager { @@ -30,5 +30,5 @@ index 22378b6b..5e595b62 100644 iblockdata.getBlock().a(this.world, this.player, blockposition, iblockdata, tileentity, itemstack2); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0393-Optimize-World-Time-Updates.patch b/Spigot-Server-Patches/0392-Optimize-World-Time-Updates.patch similarity index 96% rename from Spigot-Server-Patches/0393-Optimize-World-Time-Updates.patch rename to Spigot-Server-Patches/0392-Optimize-World-Time-Updates.patch index 760eb00682..f6db99c86b 100644 --- a/Spigot-Server-Patches/0393-Optimize-World-Time-Updates.patch +++ b/Spigot-Server-Patches/0392-Optimize-World-Time-Updates.patch @@ -1,4 +1,4 @@ -From c554c1968e681a6b36e813959a81f9c6c734a5cb Mon Sep 17 00:00:00 2001 +From d3414568c39ff5340ce00d38075c63ef00c50313 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 2 Nov 2018 23:11:51 -0400 Subject: [PATCH] Optimize World Time Updates @@ -8,7 +8,7 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 236fbafe..ce39ea09 100644 +index 236fbafeb..ce39ea09e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1033,12 +1033,24 @@ public abstract class MinecraftServer implements IAsyncTaskHandler, IMojangStati @@ -41,5 +41,5 @@ index 236fbafe..ce39ea09 100644 // WorldServer worldserver; // CraftBukkit - dropped down -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0394-Restore-custom-InventoryHolder-support.patch b/Spigot-Server-Patches/0393-Restore-custom-InventoryHolder-support.patch similarity index 94% rename from Spigot-Server-Patches/0394-Restore-custom-InventoryHolder-support.patch rename to Spigot-Server-Patches/0393-Restore-custom-InventoryHolder-support.patch index 00afe37fa4..24ca51a7b4 100644 --- a/Spigot-Server-Patches/0394-Restore-custom-InventoryHolder-support.patch +++ b/Spigot-Server-Patches/0393-Restore-custom-InventoryHolder-support.patch @@ -1,4 +1,4 @@ -From 76b10ad2dce9ec6efcbd94243ffb1fbbdf9adc85 Mon Sep 17 00:00:00 2001 +From 6c68ae69a20f9f6fbc4e03543a3ff2a46019ccba Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 5 Nov 2018 04:23:51 +0000 Subject: [PATCH] Restore custom InventoryHolder support @@ -17,7 +17,7 @@ will always work as intended in the past, those without will create implementati based inventories. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java -index 23389743..d25928e0 100644 +index 23389743d..d25928e09 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/util/CraftInventoryCreator.java @@ -31,10 +31,20 @@ public final class CraftInventoryCreator { @@ -42,5 +42,5 @@ index 23389743..d25928e0 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0395-Use-Vanilla-Minecart-Speeds.patch b/Spigot-Server-Patches/0394-Use-Vanilla-Minecart-Speeds.patch similarity index 91% rename from Spigot-Server-Patches/0395-Use-Vanilla-Minecart-Speeds.patch rename to Spigot-Server-Patches/0394-Use-Vanilla-Minecart-Speeds.patch index b16809a0b0..c46fba5528 100644 --- a/Spigot-Server-Patches/0395-Use-Vanilla-Minecart-Speeds.patch +++ b/Spigot-Server-Patches/0394-Use-Vanilla-Minecart-Speeds.patch @@ -1,4 +1,4 @@ -From a130515ba85f62fbb8cc581ea3fd8139da8430c7 Mon Sep 17 00:00:00 2001 +From cccd965a231f6bb88ef265299a2242f222b3be12 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 8 Nov 2018 21:33:09 -0500 Subject: [PATCH] Use Vanilla Minecart Speeds @@ -6,7 +6,7 @@ Subject: [PATCH] Use Vanilla Minecart Speeds CraftBukkit changed the values on flying speed, restore back to vanilla diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index 95b4c0eb..f83a695a 100644 +index 95b4c0eb1..f83a695a1 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -37,9 +37,9 @@ public abstract class EntityMinecartAbstract extends Entity implements INamableT @@ -23,5 +23,5 @@ index 95b4c0eb..f83a695a 100644 // CraftBukkit end -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0396-Fix-SpongeAbsortEvent-handling.patch b/Spigot-Server-Patches/0395-Fix-SpongeAbsortEvent-handling.patch similarity index 93% rename from Spigot-Server-Patches/0396-Fix-SpongeAbsortEvent-handling.patch rename to Spigot-Server-Patches/0395-Fix-SpongeAbsortEvent-handling.patch index 076146ec62..8c38555be0 100644 --- a/Spigot-Server-Patches/0396-Fix-SpongeAbsortEvent-handling.patch +++ b/Spigot-Server-Patches/0395-Fix-SpongeAbsortEvent-handling.patch @@ -1,4 +1,4 @@ -From 6c4b270839f7a4b59c48cd84928a85e1a6c15695 Mon Sep 17 00:00:00 2001 +From 0be5964d2811cef78db25e17d8dd2792c6f45c6e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 10 Nov 2018 05:15:21 +0000 Subject: [PATCH] Fix SpongeAbsortEvent handling @@ -6,7 +6,7 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling Only process drops when the block is actually going to be removed diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java -index cbc8e8d1..cda6f2b7 100644 +index cbc8e8d13..cda6f2b73 100644 --- a/src/main/java/net/minecraft/server/BlockSponge.java +++ b/src/main/java/net/minecraft/server/BlockSponge.java @@ -106,7 +106,11 @@ public class BlockSponge extends Block { @@ -28,7 +28,7 @@ index cbc8e8d1..cda6f2b7 100644 } + diff --git a/src/main/java/net/minecraft/server/IBlockData.java b/src/main/java/net/minecraft/server/IBlockData.java -index 08a5acb0..aa354769 100644 +index 08a5acb0a..aa3547690 100644 --- a/src/main/java/net/minecraft/server/IBlockData.java +++ b/src/main/java/net/minecraft/server/IBlockData.java @@ -236,6 +236,7 @@ public interface IBlockData extends IBlockDataHolder { @@ -40,5 +40,5 @@ index 08a5acb0..aa354769 100644 this.dropNaturally(world, blockposition, 1.0F, i); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0397-Don-t-allow-digging-into-unloaded-chunks.patch b/Spigot-Server-Patches/0396-Don-t-allow-digging-into-unloaded-chunks.patch similarity index 91% rename from Spigot-Server-Patches/0397-Don-t-allow-digging-into-unloaded-chunks.patch rename to Spigot-Server-Patches/0396-Don-t-allow-digging-into-unloaded-chunks.patch index 3c581db744..ecde3fd346 100644 --- a/Spigot-Server-Patches/0397-Don-t-allow-digging-into-unloaded-chunks.patch +++ b/Spigot-Server-Patches/0396-Don-t-allow-digging-into-unloaded-chunks.patch @@ -1,11 +1,11 @@ -From 7b25dc439325f8f5273f38afeddd4856c0c8194e Mon Sep 17 00:00:00 2001 +From 2dd901e48989d8ad4ce19b66416e1f7e9159c661 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 11 Nov 2018 21:01:09 +0000 Subject: [PATCH] Don't allow digging into unloaded chunks diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0ee9e709..1d6f70a7 100644 +index 0ee9e7095..1d6f70a72 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -1223,6 +1223,11 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -21,5 +21,5 @@ index 0ee9e709..1d6f70a7 100644 double d1 = this.player.locY - ((double) blockposition.getY() + 0.5D) + 1.5D; double d2 = this.player.locZ - ((double) blockposition.getZ() + 0.5D); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0398-Optimize-redstone-algorithm.patch b/Spigot-Server-Patches/0397-Optimize-redstone-algorithm.patch similarity index 99% rename from Spigot-Server-Patches/0398-Optimize-redstone-algorithm.patch rename to Spigot-Server-Patches/0397-Optimize-redstone-algorithm.patch index a40fa85c55..4d166976ee 100644 --- a/Spigot-Server-Patches/0398-Optimize-redstone-algorithm.patch +++ b/Spigot-Server-Patches/0397-Optimize-redstone-algorithm.patch @@ -1,4 +1,4 @@ -From f42cfde4103ab62abd56d5119612ddd3e2f3291f Mon Sep 17 00:00:00 2001 +From 1c19a7882b65906c0ee80a39fdcb8d745898581b Mon Sep 17 00:00:00 2001 From: theosib Date: Thu, 27 Sep 2018 01:43:35 -0600 Subject: [PATCH] Optimize redstone algorithm @@ -19,7 +19,7 @@ Aside from making the obvious class/function renames and obfhelpers I didn't nee Just added Bukkit's event system and took a few liberties with dead code and comment misspellings. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 8210b22e..f259c4e5 100644 +index 8210b22eb..f259c4e51 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -584,4 +584,14 @@ public class PaperWorldConfig { @@ -39,7 +39,7 @@ index 8210b22e..f259c4e5 100644 } diff --git a/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java new file mode 100644 -index 00000000..21d9d6d7 +index 000000000..21d9d6d7e --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/util/RedstoneWireTurbo.java @@ -0,0 +1,910 @@ @@ -954,7 +954,7 @@ index 00000000..21d9d6d7 + } +} diff --git a/src/main/java/net/minecraft/server/BlockRedstoneWire.java b/src/main/java/net/minecraft/server/BlockRedstoneWire.java -index 48c79568..a09aa694 100644 +index 48c79568f..a09aa6944 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneWire.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneWire.java @@ -1,5 +1,7 @@ @@ -1122,7 +1122,7 @@ index 48c79568..a09aa694 100644 iblockdata.a(world, blockposition, 0); world.setAir(blockposition); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a21de9b3..2f12e35a 100644 +index a21de9b3d..2f12e35ac 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -648,6 +648,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -1142,5 +1142,5 @@ index a21de9b3..2f12e35a 100644 int i = 0; EnumDirection[] aenumdirection = World.a; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0399-force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/0398-force-entity-dismount-during-teleportation.patch similarity index 95% rename from Spigot-Server-Patches/0399-force-entity-dismount-during-teleportation.patch rename to Spigot-Server-Patches/0398-force-entity-dismount-during-teleportation.patch index 576f860295..49aa843c62 100644 --- a/Spigot-Server-Patches/0399-force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/0398-force-entity-dismount-during-teleportation.patch @@ -1,4 +1,4 @@ -From 9729bd4721244ce9519ce25bc63af432fee3fe9f Mon Sep 17 00:00:00 2001 +From d2dfc530ddc68fc0d31d867ca56f81dd09c6a57e Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Thu, 15 Nov 2018 13:38:37 +0000 Subject: [PATCH] force entity dismount during teleportation @@ -20,7 +20,7 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 28ec879e..5aa26d9e 100644 +index 28ec879ed..5aa26d9ee 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -2094,12 +2094,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @@ -72,7 +72,7 @@ index 28ec879e..5aa26d9e 100644 if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 82684dd6..dab958a0 100644 +index 4bbf57752..f5d9b4abc 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -991,8 +991,11 @@ public abstract class EntityHuman extends EntityLiving { @@ -90,7 +90,7 @@ index 82684dd6..dab958a0 100644 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1023505d..d134d0fa 100644 +index 1023505d1..d134d0fae 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -2479,10 +2479,13 @@ public abstract class EntityLiving extends Entity { @@ -110,10 +110,10 @@ index 1023505d..d134d0fa 100644 this.A(entity); } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 005bcaac..0ea31156 100644 +index 5b1bbc772..57c6455bd 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -778,10 +778,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -784,10 +784,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } @@ -130,5 +130,5 @@ index 005bcaac..0ea31156 100644 if (entity1 != entity && this.playerConnection != null) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0400-Book-Size-Limits.patch b/Spigot-Server-Patches/0399-Book-Size-Limits.patch similarity index 96% rename from Spigot-Server-Patches/0400-Book-Size-Limits.patch rename to Spigot-Server-Patches/0399-Book-Size-Limits.patch index 1d83d1aedb..e27ff4acb2 100644 --- a/Spigot-Server-Patches/0400-Book-Size-Limits.patch +++ b/Spigot-Server-Patches/0399-Book-Size-Limits.patch @@ -1,4 +1,4 @@ -From 0f336ac592dd58b868083c3df5685bcd6c18987d Mon Sep 17 00:00:00 2001 +From 6b2db9f703e6829eabec505bd796b51c0656f475 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 16 Nov 2018 23:08:50 -0500 Subject: [PATCH] Book Size Limits @@ -6,7 +6,7 @@ Subject: [PATCH] Book Size Limits Puts some limits on the size of books. diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 52ce8f89..07f0b452 100644 +index 52ce8f89e..07f0b4529 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -449,4 +449,11 @@ public class PaperConfig { @@ -22,7 +22,7 @@ index 52ce8f89..07f0b452 100644 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1d6f70a7..391ecc9d 100644 +index 1d6f70a72..391ecc9db 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -12,6 +12,8 @@ import java.util.Collections; @@ -78,5 +78,5 @@ index 1d6f70a7..391ecc9d 100644 PlayerConnectionUtils.ensureMainThread(packetplayinbedit, this, this.player.getWorldServer()); if (this.lastBookTick + 20 > MinecraftServer.currentTick) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0401-Make-the-default-permission-message-configurable.patch b/Spigot-Server-Patches/0400-Make-the-default-permission-message-configurable.patch similarity index 94% rename from Spigot-Server-Patches/0401-Make-the-default-permission-message-configurable.patch rename to Spigot-Server-Patches/0400-Make-the-default-permission-message-configurable.patch index c6b3e80ccd..20228d00bd 100644 --- a/Spigot-Server-Patches/0401-Make-the-default-permission-message-configurable.patch +++ b/Spigot-Server-Patches/0400-Make-the-default-permission-message-configurable.patch @@ -1,11 +1,11 @@ -From 5feea119a8368e851a297c38131e05c398307d9a Mon Sep 17 00:00:00 2001 +From 75cff715a223289dada2f0a9ca73c603ac0cf5fb Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sun, 18 Nov 2018 19:49:56 +0000 Subject: [PATCH] Make the default permission message configurable diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 07f0b452..a7673dd4 100644 +index 07f0b4529..a7673dd49 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -21,6 +21,7 @@ import java.util.regex.Pattern; @@ -29,7 +29,7 @@ index 07f0b452..a7673dd4 100644 private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 59b1628e..8d26f8d5 100644 +index 59b1628e5..8d26f8d52 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2187,6 +2187,10 @@ public final class CraftServer implements Server { @@ -44,5 +44,5 @@ index 59b1628e..8d26f8d5 100644 return createProfile(uuid, null); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0402-Add-more-Zombie-API.patch b/Spigot-Server-Patches/0401-Add-more-Zombie-API.patch similarity index 97% rename from Spigot-Server-Patches/0402-Add-more-Zombie-API.patch rename to Spigot-Server-Patches/0401-Add-more-Zombie-API.patch index 018fcf702d..150a924332 100644 --- a/Spigot-Server-Patches/0402-Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/0401-Add-more-Zombie-API.patch @@ -1,11 +1,11 @@ -From 6c6b0e3d43a49dcea567c108ec81ef4de18212e9 Mon Sep 17 00:00:00 2001 +From 96d2d95d063b97c649af6c0d861325cd3ef6ce37 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Sun, 7 Oct 2018 04:29:59 -0500 Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 81cc0c3b..24bc3e0f 100644 +index 81cc0c3b3..24bc3e0f0 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -21,8 +21,8 @@ public class EntityZombie extends EntityMonster { @@ -105,7 +105,7 @@ index 81cc0c3b..24bc3e0f 100644 public void b(EntityLiving entityliving) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -index e93ecb07..c516d347 100644 +index e93ecb076..c516d3475 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java @@ -77,4 +77,34 @@ public class CraftZombie extends CraftMonster implements Zombie { @@ -144,5 +144,5 @@ index e93ecb07..c516d347 100644 + // Paper end } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0403-limit-the-range-at-which-we-ll-consider-an-attackabl.patch b/Spigot-Server-Patches/0402-limit-the-range-at-which-we-ll-consider-an-attackabl.patch similarity index 94% rename from Spigot-Server-Patches/0403-limit-the-range-at-which-we-ll-consider-an-attackabl.patch rename to Spigot-Server-Patches/0402-limit-the-range-at-which-we-ll-consider-an-attackabl.patch index 99877ff1ab..5950a12504 100644 --- a/Spigot-Server-Patches/0403-limit-the-range-at-which-we-ll-consider-an-attackabl.patch +++ b/Spigot-Server-Patches/0402-limit-the-range-at-which-we-ll-consider-an-attackabl.patch @@ -1,4 +1,4 @@ -From 8b6f31ea522b02770ab4dfd2719b3827b605a8cd Mon Sep 17 00:00:00 2001 +From 17b199cbe6c42c99fdc5d64fe6261ae8e770029a Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 13 Nov 2018 14:01:00 +0000 Subject: [PATCH] limit the range at which we'll consider an attackable target @@ -12,7 +12,7 @@ decrease when set, allowing us to skip further checks earlier on when looking for an attackable entity diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2f12e35a..a7f6288f 100644 +index 2f12e35ac..a7f6288f5 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -2729,8 +2729,13 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -31,5 +31,5 @@ index 2f12e35a..a7f6288f 100644 if (entityhuman1.isSneaking()) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0404-Prevent-rayTrace-from-loading-chunks.patch b/Spigot-Server-Patches/0403-Prevent-rayTrace-from-loading-chunks.patch similarity index 94% rename from Spigot-Server-Patches/0404-Prevent-rayTrace-from-loading-chunks.patch rename to Spigot-Server-Patches/0403-Prevent-rayTrace-from-loading-chunks.patch index 06ab5203c1..a759a5aa9f 100644 --- a/Spigot-Server-Patches/0404-Prevent-rayTrace-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0403-Prevent-rayTrace-from-loading-chunks.patch @@ -1,4 +1,4 @@ -From 70985e124c4778d3199a21d56f0c98bb5ab307c4 Mon Sep 17 00:00:00 2001 +From a90d63af76870844060df4d7adeb642655193543 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 26 Nov 2018 19:21:58 -0500 Subject: [PATCH] Prevent rayTrace from loading chunks @@ -7,7 +7,7 @@ ray tracing into an unloaded chunk should be treated as a miss this saves a ton of lag for when AI tries to raytrace near unloaded chunks. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a7f6288f..380ef602 100644 +index a7f6288f5..380ef602e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -860,7 +860,8 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -31,5 +31,5 @@ index a7f6288f..380ef602 100644 if (!flag || iblockdata1.getMaterial() == Material.PORTAL || !iblockdata1.getCollisionShape(this, blockposition).isEmpty()) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0405-Handle-Large-Packets-disconnecting-client.patch b/Spigot-Server-Patches/0404-Handle-Large-Packets-disconnecting-client.patch similarity index 95% rename from Spigot-Server-Patches/0405-Handle-Large-Packets-disconnecting-client.patch rename to Spigot-Server-Patches/0404-Handle-Large-Packets-disconnecting-client.patch index ef47593b6c..7a618206eb 100644 --- a/Spigot-Server-Patches/0405-Handle-Large-Packets-disconnecting-client.patch +++ b/Spigot-Server-Patches/0404-Handle-Large-Packets-disconnecting-client.patch @@ -1,4 +1,4 @@ -From 0323e6a88a6d0a0d92693e8cf00c635e536ac512 Mon Sep 17 00:00:00 2001 +From e02ea5dc0c5d1a2b42f9f8cffef5a18c42a860cf Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 27 Nov 2018 21:18:06 -0500 Subject: [PATCH] Handle Large Packets disconnecting client @@ -7,7 +7,7 @@ If a players inventory is too big to send in a single packet, split the inventory set into multiple packets instead. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index c5369791..0b8796d0 100644 +index c53697914..0b8796d0a 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -99,6 +99,15 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -27,7 +27,7 @@ index c5369791..0b8796d0 100644 NetworkManager.g.debug("Skipping packet due to errors", throwable.getCause()); } else { diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java -index 601d4d0f..2d8e6a2f 100644 +index 601d4d0fa..2d8e6a2f4 100644 --- a/src/main/java/net/minecraft/server/Packet.java +++ b/src/main/java/net/minecraft/server/Packet.java @@ -10,6 +10,12 @@ public interface Packet { @@ -44,7 +44,7 @@ index 601d4d0f..2d8e6a2f 100644 return false; } diff --git a/src/main/java/net/minecraft/server/PacketEncoder.java b/src/main/java/net/minecraft/server/PacketEncoder.java -index 2aa805ee..4f7bc186 100644 +index 2aa805eef..4f7bc186a 100644 --- a/src/main/java/net/minecraft/server/PacketEncoder.java +++ b/src/main/java/net/minecraft/server/PacketEncoder.java @@ -49,7 +49,31 @@ public class PacketEncoder extends MessageToByteEncoder> { @@ -80,7 +80,7 @@ index 2aa805ee..4f7bc186 100644 + // Paper end } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 8e35d14f..4a57e8a3 100644 +index 8e35d14f9..4a57e8a3e 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -76,7 +76,7 @@ public class PacketPlayOutMapChunk implements Packet { @@ -93,7 +93,7 @@ index 8e35d14f..4a57e8a3 100644 } else { this.d = new byte[i]; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java -index 706d8438..c0d8f8b4 100644 +index 706d84385..c0d8f8b42 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java @@ -9,6 +9,15 @@ public class PacketPlayOutWindowItems implements Packet { @@ -113,5 +113,5 @@ index 706d8438..c0d8f8b4 100644 public PacketPlayOutWindowItems(int i, NonNullList nonnulllist) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0406-Lazy-init-world-storage-in-CraftOfflinePlayer.patch b/Spigot-Server-Patches/0405-Lazy-init-world-storage-in-CraftOfflinePlayer.patch similarity index 96% rename from Spigot-Server-Patches/0406-Lazy-init-world-storage-in-CraftOfflinePlayer.patch rename to Spigot-Server-Patches/0405-Lazy-init-world-storage-in-CraftOfflinePlayer.patch index 068526c15e..973ae38c01 100644 --- a/Spigot-Server-Patches/0406-Lazy-init-world-storage-in-CraftOfflinePlayer.patch +++ b/Spigot-Server-Patches/0405-Lazy-init-world-storage-in-CraftOfflinePlayer.patch @@ -1,4 +1,4 @@ -From 86a46ae01d4ae97262d5678047e236ab948cb106 Mon Sep 17 00:00:00 2001 +From 994cf40747a9e207fdd94aad8888ef6704045198 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Tue, 11 Dec 2018 22:25:07 -0500 Subject: [PATCH] Lazy init world storage in CraftOfflinePlayer @@ -8,7 +8,7 @@ worlds loaded. This is typically a rare occurrence but probably one that should be covered as best we can. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 698cfb91..fbdb2df2 100644 +index 698cfb918..fbdb2df27 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -27,12 +27,12 @@ import org.bukkit.plugin.Plugin; @@ -61,5 +61,5 @@ index 698cfb91..fbdb2df2 100644 public long getFirstPlayed() { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0407-Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/0406-Add-PlayerConnectionCloseEvent.patch similarity index 97% rename from Spigot-Server-Patches/0407-Add-PlayerConnectionCloseEvent.patch rename to Spigot-Server-Patches/0406-Add-PlayerConnectionCloseEvent.patch index 9a0c635ca8..950923a59c 100644 --- a/Spigot-Server-Patches/0407-Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-Server-Patches/0406-Add-PlayerConnectionCloseEvent.patch @@ -1,4 +1,4 @@ -From 8f211cdb5fcaae0d42f7464b0ff0a642337aab21 Mon Sep 17 00:00:00 2001 +From 24f5b7a6aefbb3db250009eff45ec749fc9457df Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 7 Oct 2018 12:05:28 -0700 Subject: [PATCH] Add PlayerConnectionCloseEvent @@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent is undefined. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index ca76f2a3..dfe7a029 100644 +index ca76f2a38..dfe7a029f 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -35,9 +35,9 @@ public class LoginListener implements PacketLoginInListener, ITickable { @@ -50,7 +50,7 @@ index ca76f2a3..dfe7a029 100644 private SecretKey loginKey; private EntityPlayer l; diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 0b8796d0..55363723 100644 +index 0b8796d0a..553637239 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -16,6 +16,7 @@ import io.netty.handler.timeout.TimeoutException; @@ -89,5 +89,5 @@ index 0b8796d0..55363723 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0408-Prevent-Enderman-from-loading-chunks.patch b/Spigot-Server-Patches/0407-Prevent-Enderman-from-loading-chunks.patch similarity index 95% rename from Spigot-Server-Patches/0408-Prevent-Enderman-from-loading-chunks.patch rename to Spigot-Server-Patches/0407-Prevent-Enderman-from-loading-chunks.patch index 006e823808..cb733dc3f0 100644 --- a/Spigot-Server-Patches/0408-Prevent-Enderman-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0407-Prevent-Enderman-from-loading-chunks.patch @@ -1,11 +1,11 @@ -From ce7e4637f27da1e8842baef63d3743f80ef9b1a1 Mon Sep 17 00:00:00 2001 +From 6e420f53cfbd29e6ff63ef1def9976425e0c3bb1 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Tue, 18 Dec 2018 02:15:08 +0000 Subject: [PATCH] Prevent Enderman from loading chunks diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index e4aba0e0..94504044 100644 +index e4aba0e0a..945040442 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -297,7 +297,8 @@ public class EntityEnderman extends EntityMonster { @@ -29,5 +29,5 @@ index e4aba0e0..94504044 100644 IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320 -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0409-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-Server-Patches/0408-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch similarity index 96% rename from Spigot-Server-Patches/0409-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch rename to Spigot-Server-Patches/0408-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index e627203992..3fe11267f5 100644 --- a/Spigot-Server-Patches/0409-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-Server-Patches/0408-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -1,4 +1,4 @@ -From 9f3265e5ab66c6f819666f59e6c29e313f2d0497 Mon Sep 17 00:00:00 2001 +From e344f4a68112289fab009b0f283508be9ef66f44 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 2 Jan 2019 00:35:43 -0600 Subject: [PATCH] Add APIs to replace OfflinePlayer#getLastPlayed @@ -16,7 +16,7 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0ea31156..de17da99 100644 +index 57c6455bd..541461275 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -72,6 +72,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -28,7 +28,7 @@ index 0ea31156..de17da99 100644 public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index ec760325..135d25ab 100644 +index ec760325b..135d25abd 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -95,6 +95,7 @@ public abstract class PlayerList { @@ -40,7 +40,7 @@ index ec760325..135d25ab 100644 UserCache usercache = this.server.getUserCache(); GameProfile gameprofile1 = usercache.a(gameprofile.getId()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index fbdb2df2..e1973c5d 100644 +index fbdb2df27..e1973c5d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -245,6 +245,61 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -106,7 +106,7 @@ index fbdb2df2..e1973c5d 100644 NBTTagCompound data = getData(); if (data == null) return null; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index a2eae5d1..36a38713 100644 +index da54a4529..8e0cac8df 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -132,6 +132,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -163,5 +163,5 @@ index a2eae5d1..36a38713 100644 @Override -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0410-Fix-PlayerEditBookEvent.patch b/Spigot-Server-Patches/0409-Fix-PlayerEditBookEvent.patch similarity index 94% rename from Spigot-Server-Patches/0410-Fix-PlayerEditBookEvent.patch rename to Spigot-Server-Patches/0409-Fix-PlayerEditBookEvent.patch index dc1c0a7698..47e3217297 100644 --- a/Spigot-Server-Patches/0410-Fix-PlayerEditBookEvent.patch +++ b/Spigot-Server-Patches/0409-Fix-PlayerEditBookEvent.patch @@ -1,4 +1,4 @@ -From f55270f77166a5a22352bfe2364c8c2bc156ad8d Mon Sep 17 00:00:00 2001 +From ac58c1ed400f8cb8d0dc74074eb068e200d6cbe8 Mon Sep 17 00:00:00 2001 From: Michael Himing Date: Sun, 16 Dec 2018 13:07:33 +1100 Subject: [PATCH] Fix PlayerEditBookEvent @@ -10,7 +10,7 @@ it impossible to properly cancel the event or modify the book meta cancelled writing diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 391ecc9d..04344a37 100644 +index 391ecc9db..04344a371 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -823,10 +823,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -31,5 +31,5 @@ index 391ecc9d..04344a37 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0411-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/Spigot-Server-Patches/0410-Workaround-for-vehicle-tracking-issue-on-disconnect.patch similarity index 83% rename from Spigot-Server-Patches/0411-Workaround-for-vehicle-tracking-issue-on-disconnect.patch rename to Spigot-Server-Patches/0410-Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 9ac0e957ca..78a8e9fa8a 100644 --- a/Spigot-Server-Patches/0411-Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/Spigot-Server-Patches/0410-Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -1,14 +1,14 @@ -From 300e021f95d237beddc589d1fe7aa83d1e958535 Mon Sep 17 00:00:00 2001 +From 2270e5fa23896ccfba6b8360bde4f3ae0074f0d3 Mon Sep 17 00:00:00 2001 From: connorhartley Date: Mon, 7 Jan 2019 14:43:48 -0600 Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index de17da99..010749dd 100644 +index 541461275..1d3730083 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1113,6 +1113,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1119,6 +1119,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void n() { this.cB = true; this.ejectPassengers(); @@ -23,5 +23,5 @@ index de17da99..010749dd 100644 this.a(true, false, false); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0412-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch b/Spigot-Server-Patches/0411-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch similarity index 96% rename from Spigot-Server-Patches/0412-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch rename to Spigot-Server-Patches/0411-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch index 9a818f33ea..ad9cb6baf2 100644 --- a/Spigot-Server-Patches/0412-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch +++ b/Spigot-Server-Patches/0411-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch @@ -1,4 +1,4 @@ -From 8c6ffec131b77b19ec381452242db50ad460cd70 Mon Sep 17 00:00:00 2001 +From e4bda78c8414c9b20781efd737759ffdf756af48 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 31 Jan 2019 16:33:36 -0500 Subject: [PATCH] Fire BlockPistonRetractEvent for all empty pistons @@ -24,7 +24,7 @@ Instead we opt to remove the check entirely so that the event fires for all piston types. diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java -index dbe0ff33..0109484e 100644 +index dbe0ff33a..0109484e0 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java @@ -118,7 +118,7 @@ public class BlockPiston extends BlockDirectional { @@ -46,5 +46,5 @@ index dbe0ff33..0109484e 100644 // CraftBukkit end world.playBlockAction(blockposition, this, b0, enumdirection.a()); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0413-Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/0412-Block-Entity-remove-from-being-called-on-Players.patch similarity index 92% rename from Spigot-Server-Patches/0413-Block-Entity-remove-from-being-called-on-Players.patch rename to Spigot-Server-Patches/0412-Block-Entity-remove-from-being-called-on-Players.patch index 251da2ca02..b347524c6b 100644 --- a/Spigot-Server-Patches/0413-Block-Entity-remove-from-being-called-on-Players.patch +++ b/Spigot-Server-Patches/0412-Block-Entity-remove-from-being-called-on-Players.patch @@ -1,4 +1,4 @@ -From 466b0863b8230009ca37f7d3a0d02e8b1dc71566 Mon Sep 17 00:00:00 2001 +From 35eb0a4b325bbdb3f7a1d53f39d438e65cfb2011 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 4 Feb 2019 23:33:24 -0500 Subject: [PATCH] Block Entity#remove from being called on Players @@ -12,7 +12,7 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 36a38713..fbe34290 100644 +index 8e0cac8df..76d5eaa7f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1937,6 +1937,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -32,5 +32,5 @@ index 36a38713..fbe34290 100644 // Spigot start -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0414-Allow-Saving-of-Oversized-Chunks.patch b/Spigot-Server-Patches/0413-Allow-Saving-of-Oversized-Chunks.patch similarity index 99% rename from Spigot-Server-Patches/0414-Allow-Saving-of-Oversized-Chunks.patch rename to Spigot-Server-Patches/0413-Allow-Saving-of-Oversized-Chunks.patch index 60ee6c7b3c..d578e2f483 100644 --- a/Spigot-Server-Patches/0414-Allow-Saving-of-Oversized-Chunks.patch +++ b/Spigot-Server-Patches/0413-Allow-Saving-of-Oversized-Chunks.patch @@ -1,4 +1,4 @@ -From 2c4cb0c82dc28e856e188a2c3e93fb070a485fda Mon Sep 17 00:00:00 2001 +From 26c2e34845483bb962e6b7415e571e00c8849842 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 15 Feb 2019 01:08:19 -0500 Subject: [PATCH] Allow Saving of Oversized Chunks @@ -31,7 +31,7 @@ this fix, as the data will remain in the oversized file. Once the server returns to a jar with this fix, the data will be restored. diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -index 12268f87..e1f7e06a 100644 +index 12268f87b..e1f7e06ab 100644 --- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java @@ -39,6 +39,7 @@ public class NBTCompressedStreamTools { @@ -51,7 +51,7 @@ index 12268f87..e1f7e06a 100644 a((NBTBase) nbttagcompound, dataoutput); } diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index c2051158..d148ce49 100644 +index c20511588..d148ce497 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java @@ -78,6 +78,7 @@ public class RegionFile { @@ -256,7 +256,7 @@ index c2051158..d148ce49 100644 } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 8c8b7cba..a17e76d8 100644 +index 8c8b7cbab..a17e76d83 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java @@ -16,6 +16,7 @@ public class RegionFileCache { @@ -427,5 +427,5 @@ index 8c8b7cba..a17e76d8 100644 laste = null; break; // Paper } catch (Exception exception) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0415-BlockDestroyEvent.patch b/Spigot-Server-Patches/0414-BlockDestroyEvent.patch similarity index 95% rename from Spigot-Server-Patches/0415-BlockDestroyEvent.patch rename to Spigot-Server-Patches/0414-BlockDestroyEvent.patch index ee9fb895d6..ae41c3dbf3 100644 --- a/Spigot-Server-Patches/0415-BlockDestroyEvent.patch +++ b/Spigot-Server-Patches/0414-BlockDestroyEvent.patch @@ -1,4 +1,4 @@ -From f2edbe0285f08b5623efbae8bc50d5b52522edd7 Mon Sep 17 00:00:00 2001 +From 2ca9c446682f9983713744f955af985a4e0190d3 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 6 Feb 2019 00:20:33 -0500 Subject: [PATCH] BlockDestroyEvent @@ -11,7 +11,7 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 380ef602..4d3f8843 100644 +index 380ef602e..4d3f88431 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -548,8 +548,20 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc @@ -37,5 +37,5 @@ index 380ef602..4d3f8843 100644 iblockdata.a(this, blockposition, 0); } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0416-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch b/Spigot-Server-Patches/0415-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch similarity index 96% rename from Spigot-Server-Patches/0416-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch rename to Spigot-Server-Patches/0415-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch index ec4003dddf..4a50f2a5c1 100644 --- a/Spigot-Server-Patches/0416-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch +++ b/Spigot-Server-Patches/0415-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch @@ -1,4 +1,4 @@ -From 7cfd3117c43b0ff0f82aa7b0947a9b75ce47b07b Mon Sep 17 00:00:00 2001 +From 0e0b416232c64de39fe9e7ccb0e0c70fdea72a19 Mon Sep 17 00:00:00 2001 From: Aikar Date: Fri, 18 Jan 2019 00:08:15 -0500 Subject: [PATCH] Fix Custom Shapeless Custom Crafting Recipes @@ -10,7 +10,7 @@ This made the Bukkit RecipeChoice API not work for Shapeless. This reimplements vanilla logic using the same test logic as Shaped diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java -index 819b4ac2..ea4083a4 100644 +index 819b4ac2d..ea4083a45 100644 --- a/src/main/java/net/minecraft/server/ShapelessRecipes.java +++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java @@ -62,18 +62,47 @@ public class ShapelessRecipes implements IRecipe { @@ -66,5 +66,5 @@ index 819b4ac2..ea4083a4 100644 } -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0417-Fix-sign-edit-memory-leak.patch b/Spigot-Server-Patches/0416-Fix-sign-edit-memory-leak.patch similarity index 94% rename from Spigot-Server-Patches/0417-Fix-sign-edit-memory-leak.patch rename to Spigot-Server-Patches/0416-Fix-sign-edit-memory-leak.patch index 668c2d7d9d..29d8cb4f26 100644 --- a/Spigot-Server-Patches/0417-Fix-sign-edit-memory-leak.patch +++ b/Spigot-Server-Patches/0416-Fix-sign-edit-memory-leak.patch @@ -1,4 +1,4 @@ -From 4d4298e12cc6f2f1e7e58ac64b26e6ec723503a2 Mon Sep 17 00:00:00 2001 +From babca63b4e7b4a3b90912973359014d69d5238b7 Mon Sep 17 00:00:00 2001 From: Aikar Date: Thu, 28 Feb 2019 00:15:28 -0500 Subject: [PATCH] Fix sign edit memory leak @@ -6,7 +6,7 @@ Subject: [PATCH] Fix sign edit memory leak when a player edits a sign, a reference to their Entity is never cleand up. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 04344a37..5c58b853 100644 +index 04344a371..5c58b8538 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -2527,7 +2527,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -19,7 +19,7 @@ index 04344a37..5c58b853 100644 this.sendPacket(tileentity.getUpdatePacket()); // CraftBukkit return; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index c2bcbbba..fdb77131 100644 +index c2bcbbbab..fdb771317 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -14,6 +14,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { @@ -43,5 +43,5 @@ index c2bcbbba..fdb77131 100644 public EntityHuman e() { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0418-Limit-Client-Sign-length-more.patch b/Spigot-Server-Patches/0417-Limit-Client-Sign-length-more.patch similarity index 96% rename from Spigot-Server-Patches/0418-Limit-Client-Sign-length-more.patch rename to Spigot-Server-Patches/0417-Limit-Client-Sign-length-more.patch index ac5085cd08..d879d2d22a 100644 --- a/Spigot-Server-Patches/0418-Limit-Client-Sign-length-more.patch +++ b/Spigot-Server-Patches/0417-Limit-Client-Sign-length-more.patch @@ -1,4 +1,4 @@ -From d10abc45cb7482b5377a1e0f378215977efc8209 Mon Sep 17 00:00:00 2001 +From 8cc36c92535383739aa5fb7a5d57c7854f5ef38f Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 27 Feb 2019 22:18:40 -0500 Subject: [PATCH] Limit Client Sign length more @@ -22,7 +22,7 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 5c58b853..dc8c20ef 100644 +index 5c58b8538..dc8c20efb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -104,6 +104,7 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -50,5 +50,5 @@ index 5c58b853..dc8c20ef 100644 } SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(x, y, z), this.server.getPlayer(this.player), lines); -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0419-Don-t-check-ConvertSigns-boolean-every-sign-save.patch b/Spigot-Server-Patches/0418-Don-t-check-ConvertSigns-boolean-every-sign-save.patch similarity index 92% rename from Spigot-Server-Patches/0419-Don-t-check-ConvertSigns-boolean-every-sign-save.patch rename to Spigot-Server-Patches/0418-Don-t-check-ConvertSigns-boolean-every-sign-save.patch index 6b4771c959..355cf71d6a 100644 --- a/Spigot-Server-Patches/0419-Don-t-check-ConvertSigns-boolean-every-sign-save.patch +++ b/Spigot-Server-Patches/0418-Don-t-check-ConvertSigns-boolean-every-sign-save.patch @@ -1,4 +1,4 @@ -From 1f818762158d6badca6d6cd055d1efa8ffc0e876 Mon Sep 17 00:00:00 2001 +From 9bdbd0618a195a535e814fb8fd4a57dea6e98aab Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 2 Mar 2019 11:11:29 -0500 Subject: [PATCH] Don't check ConvertSigns boolean every sign save @@ -7,7 +7,7 @@ property lookups arent super cheap. they synchronize, validate and check security managers. diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index fdb77131..d0a91f67 100644 +index fdb771317..d0a91f675 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -15,6 +15,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { @@ -28,5 +28,5 @@ index fdb77131..d0a91f67 100644 } // CraftBukkit end -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0420-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch b/Spigot-Server-Patches/0419-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch similarity index 95% rename from Spigot-Server-Patches/0420-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch rename to Spigot-Server-Patches/0419-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch index d19b3472bd..3918076213 100644 --- a/Spigot-Server-Patches/0420-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch +++ b/Spigot-Server-Patches/0419-Handle-Excessive-Signs-in-Chunks-creating-too-large-.patch @@ -1,4 +1,4 @@ -From 62791340e3b5e08d359390dc92047e6667728c45 Mon Sep 17 00:00:00 2001 +From ca740a7103a7674d27106edb8e6a7a0a8eaff361 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 2 Mar 2019 14:55:01 -0500 Subject: [PATCH] Handle Excessive Signs in Chunks creating too large of @@ -11,7 +11,7 @@ Use -DPaper.excessiveSignsLimit=500 to configure that limit, or -1 to disable the limit and let your players be abused. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 55363723..30f646e4 100644 +index 553637239..30f646e42 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -221,6 +221,15 @@ public class NetworkManager extends SimpleChannelInboundHandler> { @@ -31,7 +31,7 @@ index 55363723..30f646e4 100644 // Paper start - Async-Anti-Xray - Stop dispatching further packets and return false if the peeked packet is a chunk packet which is not ready diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java -index 2d8e6a2f..8d0965a0 100644 +index 2d8e6a2f4..8d0965a05 100644 --- a/src/main/java/net/minecraft/server/Packet.java +++ b/src/main/java/net/minecraft/server/Packet.java @@ -11,6 +11,7 @@ public interface Packet { @@ -43,7 +43,7 @@ index 2d8e6a2f..8d0965a0 100644 return false; } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 4a57e8a3..eb54bdb6 100644 +index 4a57e8a3e..eb54bdb64 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -23,6 +23,13 @@ public class PacketPlayOutMapChunk implements Packet { @@ -85,5 +85,5 @@ index 4a57e8a3..eb54bdb6 100644 if (tileentity instanceof TileEntitySkull) { TileEntitySkull.sanitizeTileEntityUUID(nbttagcompound); } // Paper -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0421-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch b/Spigot-Server-Patches/0420-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch similarity index 95% rename from Spigot-Server-Patches/0421-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch rename to Spigot-Server-Patches/0420-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch index c42581097e..7b20c83216 100644 --- a/Spigot-Server-Patches/0421-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch +++ b/Spigot-Server-Patches/0420-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch @@ -1,4 +1,4 @@ -From aaab09b32f6984e9b5a28f9ce2f46f86fcca86d6 Mon Sep 17 00:00:00 2001 +From 3df95a31c5dd7127572ac377b9328425075db463 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 2 Mar 2019 16:12:35 -0500 Subject: [PATCH] MC-145260: Fix Whitelist On/Off inconsistency @@ -11,7 +11,7 @@ everything to the Whitelist object. https://github.com/PaperMC/Paper/issues/1880 diff --git a/src/main/java/net/minecraft/server/JsonList.java b/src/main/java/net/minecraft/server/JsonList.java -index b7cde4d4..949039f8 100644 +index b7cde4d41..949039f89 100644 --- a/src/main/java/net/minecraft/server/JsonList.java +++ b/src/main/java/net/minecraft/server/JsonList.java @@ -64,6 +64,7 @@ public class JsonList> { @@ -23,7 +23,7 @@ index b7cde4d4..949039f8 100644 this.e = flag; } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 135d25ab..408c382d 100644 +index 135d25abd..408c382d2 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -63,7 +63,7 @@ public abstract class PlayerList { @@ -62,5 +62,5 @@ index 135d25ab..408c382d 100644 public List b(String s) { -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0422-Set-Zombie-last-tick-at-start-of-drowning-process.patch b/Spigot-Server-Patches/0421-Set-Zombie-last-tick-at-start-of-drowning-process.patch similarity index 88% rename from Spigot-Server-Patches/0422-Set-Zombie-last-tick-at-start-of-drowning-process.patch rename to Spigot-Server-Patches/0421-Set-Zombie-last-tick-at-start-of-drowning-process.patch index 48ec034315..5441ecbeab 100644 --- a/Spigot-Server-Patches/0422-Set-Zombie-last-tick-at-start-of-drowning-process.patch +++ b/Spigot-Server-Patches/0421-Set-Zombie-last-tick-at-start-of-drowning-process.patch @@ -1,4 +1,4 @@ -From 8dd3f66179bdef2f4bf29b6dfba38a71207ea8bc Mon Sep 17 00:00:00 2001 +From 75ba6e0812c6d2849241fa2dd5957d46cbf8d3c0 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Mon, 4 Mar 2019 02:23:28 -0500 Subject: [PATCH] Set Zombie last tick at start of drowning process @@ -6,7 +6,7 @@ Subject: [PATCH] Set Zombie last tick at start of drowning process Fixes GH-1887 diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 24bc3e0f..bf2bed00 100644 +index 24bc3e0f0..bf2bed002 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -175,6 +175,7 @@ public class EntityZombie extends EntityMonster { @@ -18,5 +18,5 @@ index 24bc3e0f..bf2bed00 100644 } else { this.bI = -1; -- -2.20.1 +2.21.0 diff --git a/Spigot-Server-Patches/0423-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/Spigot-Server-Patches/0422-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch similarity index 86% rename from Spigot-Server-Patches/0423-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch rename to Spigot-Server-Patches/0422-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index 958d11ec11..be23b32966 100644 --- a/Spigot-Server-Patches/0423-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/Spigot-Server-Patches/0422-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -1,11 +1,11 @@ -From 9182ec0d1784fc22fe61c3f1498378c4421f0621 Mon Sep 17 00:00:00 2001 +From 513424d0a7b3f23173003091ab2047aced0bd016 Mon Sep 17 00:00:00 2001 From: Mark Vainomaa Date: Wed, 13 Mar 2019 20:08:09 +0200 Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 408c382d..b1630137 100644 +index 408c382d2..b1630137e 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1329,6 +1329,7 @@ public abstract class PlayerList { @@ -17,5 +17,5 @@ index 408c382d..b1630137 100644 } -- -2.20.1 +2.21.0 diff --git a/work/Bukkit b/work/Bukkit index f802d0a571..9a6a1de31b 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit f802d0a5711b4497c7d1c92108a18b34482f5fc2 +Subproject commit 9a6a1de31bef4b0e54195d5b14f2915c4f90f87f diff --git a/work/CraftBukkit b/work/CraftBukkit index 77ca7ca07b..8d8475fc46 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 77ca7ca07bbc0d73699addd51eba032916b57f6b +Subproject commit 8d8475fc46dad8fb40f4261b5ae4f382a4fd02b7 diff --git a/work/Spigot b/work/Spigot index 3cb9dcb53e..cf694d87c1 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 3cb9dcb53e1a5e8c6c199abf8213f1092e3628f8 +Subproject commit cf694d87c16991fd93ca48fa1343072f468423ff