Compare commits

..
Author SHA1 Message Date
Jason Penilla bbc57469ab skip printStackTrace when finding caller 2023-11-05 17:27:00 -07:00
Jason Penilla f9e368621d Override more PrintStream methods in SysoutCatcher 2023-11-05 16:48:35 -07:00
Shane Freeder 4675152f49 Don't leave the NearbyPlayers tracker in an entirely busted state on double-add detection 2023-11-05 22:15:38 +00:00
Jason Penilla 274e54ba58 Bump tiny-remapper for Java 21 support (#9902) 2023-11-04 20:33:04 -07:00
Layla Silbernberg / LadySilver47 8cafc07297 Added missing enchantables to material tags (#9888) 2023-11-05 00:37:51 +01:00
Tamion e289accb03 Add more API to LingeringPotionSplashEvent (#9901)
* Add createAreaEffectCloud API

* Add missing NotNull

* Add missing Paper comments

* Better solution

* Better naming

* New patch and rename

* rename patch
2023-11-04 16:24:06 -07:00
NonSwag 2553f30153 fix secure profile with proxy online mode (#9700) 2023-11-05 00:12:47 +01:00
booky10 75d04e9b04 Broadcast take item packets with collector as source (#9884)
This fixes players (which can't view the collector) seeing item pickups with themselves as the target.
2023-11-04 15:16:55 -07:00
TonytheMacaroni 23860da6c2 Add predicate for block when raytracing (#9691)
* Add predicate for block data when raytracing blocks

* Match based on block, instead of block data

* Use instanceof instead of casting

* Use Position instead of Location, add overload for rayTraceEntities

* Implement requested changes

* Invert predicate

* Cleanup
2023-11-04 15:00:51 -07:00
TrollyLoki 8a3980c60b Add API to get the collision shape of a block before it's placed (#9821)
* Add API to get the collision shape of a block before it's placed

* Tweak API documentation

* Clarify behavior

* Rebase

* Rebase
2023-11-04 16:32:10 -05:00
Jake Potrebic 0cdce89d59 Fix a bunch of stuff with player spawn locations (#9887)
If a playerdata doesn't contain a valid, loaded world, reset
to the main world spawn point
2023-11-04 14:11:55 -07:00
powercas_gamer 15a0de2eef Make Team extend ForwardingAudience (#9852) 2023-11-04 21:50:56 +01:00
booky10 43c343228e Add entity API for getting the combined gene of a Panda (#9891) 2023-11-04 21:28:23 +01:00
Tamion bffb08c2f9 Deprecate Player#boostElytra (#9899)
The Paper method was chosen for deprecation because it was more
restrictive in that it has an isGliding check.
2023-11-04 13:20:13 -07:00
Jake Potrebic 6592fed511 Use a server impl for hopper event to track get/setItem calls (#9905)
* Use a server impl for hopper event to track getItem/setItem calls

* Rebase

* Comments
2023-11-04 12:58:40 -07:00
Warrior aa6c4c11e5 Include packet class name in packet encoding error messages (#9907) 2023-11-04 12:34:34 -07:00
booky10 f78d7ce8ff Remove "fix-curing-zombie-villager-discount" exploit option (#9895) 2023-11-04 20:20:01 +01:00
Lulu13022002 44057da467 Remove duplicate water-sensitivity damage for unaware mobs (#9908) 2023-11-04 12:10:27 -07:00
Warrior 230682d51b Add raw iron & raw copper blocks to anti xray defaults (#7622) 2023-11-04 15:07:48 +00:00
TomTom 487109fddc Readd 0414 use distance map to optimise entity tracker (#9868) 2023-11-03 14:05:57 +00:00
Nassim Jahnke 8493340be4 Add another slot sanity check 2023-11-03 14:49:55 +10:00
Md5Lukas 0b218903a8 Fix villager infection chance not being handled properly (#9897) 2023-11-01 14:59:00 -07:00
Jake Potrebic 1865625d95 Fix NPE when no valid world is found on legacy Players (#9885) 2023-10-29 15:33:32 +00:00
booky10 5bb30ce95b Fix entity camera not being reset when cancelling spectating start/stop events (#9883) 2023-10-29 01:45:07 +01:00
Shane Freeder 3e4eaf2188 [ci skip] Fix module derp 2023-10-29 01:32:13 +01:00
Shane Freeder 415d7081d2 [ci skip] Fix author in last patch 2023-10-29 00:58:15 +01:00
GeroandOwen1212055 a81a384303 Implement Velocity VarInt optimizations (#8418)
---------

Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
2023-10-28 19:56:47 -04:00
booky10 5bdfb29ba1 Add player idle duration API (#9833)
* Add player idle duration API

Implements API for getting, setting and resetting a player's idle duration.

* Remove idle duration setter

* Rebase
2023-10-28 19:25:46 -04:00
caramel c6fac381ed fix UnsafeValues#loadAdvancement doesn't recalculate position (#9846) 2023-10-28 16:13:33 -07:00
Kenox 8b1ac39e89 Fix warden spawn reason from DEFAULT to NATURAL (#8744) 2023-10-28 19:10:31 -04:00
caramel 52849f6da6 Cleanup disable explosion knockback patch (#9858) 2023-10-28 15:50:26 -07:00
Tamion b1faa5d5f4 Fix PotionAPI ignores icon flag (#9864)
* fix PotionAPI ignores icon flag

* also fix CraftPotionUtil#toBukkit

* also CraftPotionUtil#fromBukkit

* use CraftPotionUtil
2023-10-28 15:39:47 -07:00
Warrior b3cac042c1 Fix crash when version_history.json is empty (#9871) 2023-10-28 15:24:54 -07:00
SplotyCode 29350674b3 Fix null item in sendEquipmentChange (#9869) 2023-10-28 15:15:20 -07:00
Jake Potrebic 8cf2503804 Updated Upstream (Bukkit/CraftBukkit) (#9876)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
19830133 PR-925: Add hit entity/block to events extending ProjectileHitEvent

CraftBukkit Changes:
5a72c3c04 SPIGOT-7510: Try to fix broken reflection usage of plugins
6fa69f235 PR-1281: Add hit entity/block to events extending ProjectileHitEvent
224f733ac Fix NPE introduced in #f4d977e
2023-10-28 15:02:13 -07:00
Lulu13022002 996d529fb3 Resend entity using the bundle packet (#9853) 2023-10-27 15:48:13 +02:00
Jason Penilla b974a6b6f3 Update paperweight to 1.5.9 (#9872) 2023-10-26 16:34:58 -07:00
Jake Potrebic acc6d012b0 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9861) 2023-10-26 14:56:40 -07:00
Jason c1ac98328c Fix log level of advancement debug message (#9860) 2023-10-23 19:07:44 +02:00
Jake Potrebic 90fe0d58a5 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9825)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
897a0a23 SPIGOT-5753: Back PotionType by a minecraft registry
255b2aa1 SPIGOT-7080: Add World#locateNearestBiome
ff984826 Remove javadoc.io doc links

CraftBukkit Changes:
71b0135cc SPIGOT-5753: Back PotionType by a minecraft registry
a6bcb8489 SPIGOT-7080: Add World#locateNearestBiome
ad0e57434 SPIGOT-7502: CraftMetaItem - cannot deserialize BlockStateTag
b3efca57a SPIGOT-6400: Use Mockito instead of InvocationHandler
38c599f9d PR-1272: Only allow one entity in CraftItem instead of two
f065271ac SPIGOT-7498: ChunkSnapshot.getBlockEmittedLight() gets 64 blocks upper in Overworld

Spigot Changes:
e0e223fe Remove javadoc.io doc links
2023-10-22 20:12:00 +01:00
Shane Freeder 489bff9bbd Temp fix for serialisable blockdata 2023-10-22 19:56:25 +01:00
MiniDigger | Martin 71a1787f6c [ci skip] cleanup some ATs (#9840) 2023-10-21 17:17:55 -07:00
Lulu13022002 3a5c6f8cee Fix NPE in SculkBloomEvent world access (#9857) 2023-10-21 13:20:24 -07:00
Brokkonaut a3e4d1aa36 Don't check if we can see non-visible entities 2023-10-21 20:53:33 +01:00
Spottedleaf 4b0bc74c90 Initialise default nibble arrays in ChunkAccess directly
When ChunkAccess was converted to an abstract class some versions
ago, the code to initialise nibble arrays should have been moved.
However, the code was not moved and so now mods constructing their
own implementations of ChunkAccess would not have the nibble arrays
initialised.

This is ported to Paper from Starlight to keep the code base in sync,
not because it fixes anything known.
2023-10-16 18:57:45 -07:00
Spottedleaf 00331d943e Fix mushrooms not generating in swamps
During feature generation, light data is not initialised and
will always return 15 in Starlight. Vanilla can possibly return
0 if partially initialised, which allows some mushroom blocks to
generate.

In general, the brightness value from the light engine should not
be used until the chunk is ready. To emulate Vanilla behavior better,
we return 0 as the brightness during world gen unless the target
chunk is finished lighting.

The regular light retrieval outside of WorldGenRegion remains
the same, as behaviorally chunks not lit should be at max
skylight and zero block light.
2023-10-16 18:52:28 -07:00
Spottedleaf 2f4281e2b4 Remove unused skyLightSources
There is no point in initialising the sources in Starlight,
as we do not use them. Additionally, they are not saved to
disk so we do not need them.

Maintaining and initialising them is not a negligible cost,
which is why they are being removed.
2023-10-16 18:49:41 -07:00
caramel e57af7d01e sync netty version with vanilla (#9842) 2023-10-15 15:41:17 +01:00
caramel 44ee1cd05e fix recipe packet limiter (#9841) 2023-10-15 15:11:15 +01:00
Md5Lukas 852c1c236d Add additional tags to ItemMeta obfuscation filtering (#9665) 2023-10-14 23:41:15 +02:00
Md5Lukas 3e1c5e3eb0 Add BlockData setter for FallingBlock (#9829) 2023-10-14 22:46:31 +02:00
Jakub Zacek e4d184f39d Replace bukkit Consumers with java consumers (#9836) 2023-10-14 22:43:32 +02:00
froobynooby 3e9d2ac5f2 Don't call options events on login (#9834)
* Don't call options events on login

* Merge changes into client options API patch
2023-10-14 11:32:00 -07:00
SplotyCode f613437019 Fix CraftPlayerProfile#setId regression (#9822) 2023-10-12 01:20:25 +00:00
Jake Potrebic 2f5bb7e306 add predicate recipe choice only for potion mixes (#9486) 2023-10-10 16:07:21 -07:00
Tamion 1a4778d260 Fix PlayerSwapHandItemsEvent NPE when a hand set to null (#9763)
* Fix PlayerSwapHandItemsEvent throwing exception when mainhand or offhand set to null

* use fully qualified import

* Use ItemStack#empty() instead of new ItemStack

* Add NotNull annotation to getters

* Add missing Paper comments
2023-10-10 15:38:25 -07:00
caramel 5509610db5 Fix UnsafeValues#loadAdvancement (#9753) 2023-10-10 15:19:00 -07:00
Jake Potrebic 7e5dd92f9f fix flat bedrock world config (#9728) 2023-10-10 14:43:10 -07:00
TrollyLoki 69ce9276e4 Make setVelocity method of Fireballs change the travel direction to an arbitrary vector (#9815) 2023-10-10 23:09:45 +02:00
Xander de Keijzer 72f7945e77 Fix painting loosing art on face change (#9798) 2023-10-10 22:24:35 +02:00
Jake Potrebic e87240b674 Fixes for loot tables (#9818) 2023-10-10 10:35:49 -07:00
Jason a2ba45239c Update paperweight to 1.5.8 (#9814) 2023-10-09 18:04:26 -07:00
Spottedleaf 99b735c1ac Make EntityLookup#get use read lock for entity maps
On Folia, this map is modified by multiple threads and iterating
it may throw errors, for example using the /kill command or any
other command that uses an entity selector.
2023-10-09 10:02:37 -07:00
Warrior a702a083cd Move clientBrandName over to ServerPlayer (#9809) 2023-10-08 12:07:48 +02:00
powercas_gamer adb4fb4bd3 [ci skip] update mappings link (#9801) 2023-10-07 11:54:43 +02:00
Bjarne Koll 29a0209575 Properly check water block when random ticking ice (#9804)
Readds a lost update to the shared mutable state in the random block
ticking optimisation.
2023-10-06 21:34:00 +01:00
Jason 08c0b488b9 [ci skip] update paperweight to 1.5.7 & re-enable filterpatches (#9799) 2023-10-06 08:58:09 -07:00
Nassim Jahnke cfe311d7a5 Fix item effects conversion if no tag is present
Fixes #9796
2023-10-05 16:03:26 +10:00
Nassim Jahnke 431e6418ab Fixup player profile getters and constructor to expected nullability (#9770) 2023-10-05 05:31:24 +00:00
Warrior 02cfaa8ff8 Fix mobs not spawning when using an older config (#9793) 2023-10-04 10:08:47 -07:00
Shane Freeder 5eec4ec3bf Quick tweaks to logical flow of getMapData 2023-10-04 16:25:26 +01:00
booky10 f36bb59739 Fix entity data not updated for firework attached to entity (#9783) 2023-10-03 18:29:44 -07:00
Jake Potrebic 6573d9555d update configurate (#9230) 2023-10-03 18:06:23 -07:00
Nassim Jahnke 9d21a88218 Fix tests 2023-10-04 07:58:30 +10:00
Nassim Jahnke bb1c0dd6fa Implement tracking range y setting 2023-10-03 22:19:39 +10:00
Nassim Jahnke f6969b6374 Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
09b1c123 PR-916: Add more lightning API
c085f3de PR-859: Add Entity#getTrackedBy

CraftBukkit Changes:
1bf30a4e9 SPIGOT-7495: Spawning bee entity in asynchronous BlockPopulator causes IllegalStateException - Accessing LegacyRandomSource from multiple threads
476c5bccd PR-1267: Add more lightning API
40d5e6c02 PR-1190: Add Entity#getTrackedBy
40d41acc1 SPIGOT-7491: Downgrade bundled SQLite to be updated next release
44b31da38 PR-1264: Load Bukkit class before creating Registry item
dc45a6738 SPIGOT-7496: Failure to load datapacks with multiple identical predicates
f508657d6 Fix decompile error affecting javac
ef7a4743d PR-1265: Ensure UTF-8 used in new test resource

Spigot Changes:
224dad51 Rebuild patches
2023-10-03 22:00:24 +10:00
Lulu13022002 38376f43a0 Some jd fixes (#9781) 2023-10-01 00:20:51 +00:00
Nassim Jahnke c4ba28a21a Don't throw when removing unplaced player in NearbyPlayers 2023-09-30 15:37:00 +10:00
Nassim Jahnke 0f69290f07 [ci skip] Fix typo (important) 2023-09-29 13:20:32 +10:00
Nassim Jahnke 4cdbb0c86c Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
044d4ee9 SPIGOT-7283, SPIGOT-7318: Add AsyncStructureGenerateEvent and BlockState cloning
57b73d57 PR-913: Deprecate Projectile#doesBounce() and #setBounce()
43373c44 PR-904: Update FeatureFlag for 1.20.2
a7bbbf0c PR-911: Expand DataPack API with 1.20.2 pack version methods
0341e3a0 SPIGOT-7489: Add TeleportDuration to Display Entity
bcd8d2aa PR-912: Update Minecraft Wiki URLs

CraftBukkit Changes:
99aafc222 Increase outdated build delay
dab849f08 SPIGOT-7283, SPIGOT-7318: Add AsyncStructureGenerateEvent and BlockState cloning
041b29ae3 Upgrade specialsource-maven-plugin
851a32cff PR-1263: Remove unused implementation of AbstractProjectile#doesBounce() and #setBounce()
251af0da3 PR-1261: Expand DataPack API with 1.20.2 pack version methods
46e4ba627 Upgrade specialsource-maven-plugin
df3738a24 SPIGOT-7489: Add TeleportDuration to Display Entity
8d0fea457 PR-1262: Update Minecraft Wiki URLs
e62905aab SPIGOT-7490: Fix entity equipment updates

Spigot Changes:
a0f3d486 Rebuild patches
2023-09-29 13:05:28 +10:00
Jake Potrebic 1765917a6f Fix creating the reverse map for loot table keys (#9766) 2023-09-28 16:29:34 -07:00
Spottedleaf fe54a13b13 Properly call overloaded super onDisconnect
Since the method is overloaded, the call to super (which is changed
to call the overloaded method) without the additional parameters
will result in recursion.
2023-09-26 13:16:24 -07:00
Spottedleaf b3b961f9d5 Fire PlayerConnectionCloseEvent for configuration packet listener
If the player moves to the configuration stage, we also need
to fire the event.
2023-09-26 09:20:17 -07:00
Spottedleaf c207429b21 Fix VoxelShape#isFullBlock() for non-single AABB types
The correct logic to implement NOT_SAME with Shapes#block()
is to test whether any shape data exists outside of [0.0, 1.0]
and to test whether the shape is completely filled from 0.0 to 1.0
on all axis. This can be implemented by checking whether the
bounds represent the full block and whether everything within
the bounds is filled.
2023-09-26 09:16:11 -07:00
Jake PotrebicandJason Penilla 298c47857b Fix tests that broke during the junit 5 update (#9757)
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
2023-09-25 09:05:05 +10:00
Shane Freeder 3cf03fc31a Fix/update wiki (#9758) 2023-09-25 09:02:46 +10:00
Shane Freeder 5cbce366b2 Handle new brand payload type 2023-09-24 19:48:29 +01:00
Warrior 5923b7d085 Fix missing map initialize event call & missing map id assignment (#9756) 2023-09-24 19:17:29 +01:00
Nassim Jahnke e284bb1215 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fb23cbb3 Define surefire plugin version
d022084a Define ordering for MetadataStoreTest
99a7f6f0 PR-910: Match generic max absorption attribute name style with the rest
c7390d71 PR-909: Update tests to JUnit 5

CraftBukkit Changes:
f0661c351 PR-1230: Move unstructured PDC NBT serialisation to SNBT
452fcb599 PR-1256: Update tests to JUnit 5
2023-09-24 18:25:25 +10:00
Spottedleaf 7a00758b1b Rebuild patches 2023-09-23 23:41:38 -07:00
Spottedleaf 11138a770e Re-add remove streams for Brain AI patch 2023-09-23 23:40:49 -07:00
Spottedleaf 8b9e3dcd9e Optimise nearby player retrieval
Instead of searching/testing every player online on the server,
we can instead use the nearby player tracking system to reduce
the number of tests per search.
2023-09-23 23:40:49 -07:00
Nassim Jahnke 866d2d9f4a Use correct ClientboundLevelChunkWithLightPacket constructor in later patch 2023-09-24 16:29:07 +10:00
Jake Potrebic 025c5d7a28 rebuild patches 2023-09-23 22:35:37 -07:00
Jake Potrebic ea56138b30 Fix some issues 2023-09-23 22:33:49 -07:00
Spottedleaf 5dca26ce54 Fix race condition on UpgradeData.BlockFixers class init
The CHUNKY_FIXERS field is modified during the constructors
of the BlockFixers, but the code that uses CHUNKY_FIXERS does
not properly ensure that BlockFixers has been initialised before
using it, leading to a possible race condition where instances of
BlockFixers are accessed before they have initialised correctly.

We can force the class to initialise fully before accessing the
field by calling any method on the class, and for convenience
we use values().
2023-09-23 22:31:43 -07:00
Spottedleaf 84556f3cda Add lag compensation for breaking blocks 2023-09-23 22:31:42 -07:00
Spottedleaf 38dc3b25d8 Optimise chunk tick iteration
When per-player mob spawning is enabled we do not need to randomly
shuffle the chunk list. Additionally, we can use the NearbyPlayers
class to quickly retrieve nearby players instead of possible
searching all players on the server.
2023-09-23 22:31:00 -07:00
Nassim Jahnke 8d922746d9 Drop no longer needed patch 2023-09-24 13:09:52 +10:00
Nassim Jahnke 2ec643a53c Readd anti xray and oversized block entity patches 2023-09-24 12:35:16 +10:00
Noah van der Aa 6be43952eb Migrate paper log ips option to new server.properties option 2023-09-23 23:21:21 +02:00
Jason Penilla 9624451ffd Add missing kick event cause 2023-09-23 08:50:32 -07:00
Lulu13022002 b561a12078 Fix SuspiciousStewMeta 2023-09-23 16:41:51 +02:00
Lulu13022002 9c126fd2a9 fix test 2023-09-23 13:38:46 +02:00
Owen1212055 38b7565d9e Remove Spigot Bug Fix for MC-109346 2023-09-23 01:51:40 -04:00
Owen1212055 8b512e3466 Support Paper ip address config + add missing logs 2023-09-23 01:50:13 -04:00
Nassim Jahnke 9df2066642 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
dfe1fb48 PR-906: Add missing MinecraftExperimental annotation to Bundles
825ab30d PR-905: Add missing MapCursor.Type and update documentation
e03d10e6 PR-903: Make BARRIER Waterlogged
1961ead6 PR-898: Use Java Consumer instead of Bukkit Consumer

CraftBukkit Changes:
f71a799f0 Make BARRIER Waterlogged
172f76a45 Upgrade specialsource-maven-plugin
f0702775c SPIGOT-7486: Alternate approach to null profile names
069495671 SPIGOT-7485: Allow air entity items since required for Vanilla logic
5dfd33dc2 SPIGOT-7484: Cancelling PlayerEditBookEvent does not update client's book contents
02d490788 PR-1250: Standardize and centralize Bukkit / Minecraft registry conversion
9024a09b9 PR-1251: Use Java Consumer instead of Bukkit Consumer
6d4b25bf1 Increase diff stability
2023-09-23 12:21:59 +10:00
Nassim Jahnke 4c17176c77 Update foojay resolver convention plugin 2023-09-23 11:46:31 +10:00
Nassim Jahnke a353f4d207 Readd network optimization patch 2023-09-23 11:45:34 +10:00
Spottedleaf a50d7c340b Make sure to maintain the players sent to set for ChunkHolder
Required for proper block/light updates to clients
2023-09-22 17:07:02 -07:00
Nassim Jahnke 02807238c4 Fix chat processing 2023-09-23 09:58:19 +10:00
Nassim Jahnke d23c4a50e6 Fix local attribute setting 2023-09-23 09:42:59 +10:00
Nassim Jahnke b3ec8bd8ae Revert "re-add distance map patch"
This reverts commit 81c5901c67.
2023-09-23 09:38:10 +10:00
Jake Potrebic 81c5901c67 re-add distance map patch 2023-09-22 16:26:10 -07:00
Jake Potrebic 47aeab84ad fixup display slots patch (#9746) 2023-09-22 16:07:33 -07:00
Jake Potrebic 915bb9220e Fixup advancement patch (#9745) 2023-09-22 16:03:34 -07:00
Spottedleaf 6af97e11b6 Port patches from folia dev/optimisations 2023-09-22 15:56:00 -07:00
Spottedleaf d259503c92 Fix recursion with pathfind entity event
With the function overload, need to pass the entity
through to the super call
2023-09-22 15:39:00 -07:00
Spottedleaf ea01aa335a Add some patches, fix compile 2023-09-22 15:33:14 -07:00
Spottedleaf e88856dd75 Chunk system patch 2023-09-22 13:13:57 -07:00
Jason Penilla 896aa8b54a Rebuild patches 2023-09-22 10:59:56 -07:00
Jason Penilla ead3ddba32 Move unapplied patches so ATs import 2023-09-22 10:57:45 -07:00
MiniDigger | Martin 603c33df06 some more compile fixes 2023-09-22 19:43:52 +02:00
MiniDigger | Martin 1ebaffacf5 some compile fixes 2023-09-22 19:31:02 +02:00
Noah van der Aa f4d8a64094 more more more more more more more more more more more work: passing the torch 2023-09-22 19:26:54 +02:00
Lulu13022002 63a1b0c137 some compile issues 2023-09-22 19:25:18 +02:00
Lulu13022002 a91e19f1df more work
all server patches done (almost)
2023-09-22 18:59:52 +02:00
Lulu13022002 8baf510f92 some work 2023-09-22 18:11:35 +02:00
Noah van der Aa ac7e4ad35e more more more more more more more more more more more work: passing the torch 2023-09-22 17:51:48 +02:00
Noah van der Aa 3aa8e7ef3f more more more more more more more more more more work 2023-09-22 17:35:51 +02:00
Noah van der Aa 4875ee4814 more more more more more more more more more work 2023-09-22 17:24:59 +02:00
Noah van der Aa 32d9c6684b more more more more more more more more work 2023-09-22 17:08:04 +02:00
Noah van der Aa 772fb3e385 more more more more more more more work
can't let lynx inflate his commit count too much
2023-09-22 16:59:18 +02:00
Bjarne Koll 2617c927a0 More work work work work work work work work work 2023-09-22 16:42:56 +02:00
Bjarne Koll e5bd562d28 Work here, work there, work for everyone 2023-09-22 16:35:40 +02:00
Bjarne Koll 452009bbde Working hard on messing with leafs patches 2023-09-22 16:20:09 +02:00
Bjarne Koll 574bc968d3 More work 2023-09-22 15:47:26 +02:00
Bjarne Koll 95a31de306 More work work work 2023-09-22 15:33:37 +02:00
Bjarne Koll af1090259a Fix PaperAdvancementDisplay 2023-09-22 15:19:33 +02:00
Bjarne Koll 74094edf08 More more more (more ??) more work 2023-09-22 15:15:57 +02:00
Bjarne Koll 662b6c5ca8 Port sidebar slots patch 2023-09-22 14:33:54 +02:00
Bjarne Koll 79fef73926 More work work work 2023-09-22 14:22:24 +02:00
Bjarne Koll 00d82983bd Missing paper comment 2023-09-22 13:42:04 +02:00
Bjarne Koll 2cb3a1a3dc Fix leave message in common packet listener 2023-09-22 13:39:00 +02:00
Noah van der Aa fc84aee124 more more more more more more work 2023-09-22 09:24:44 +02:00
Jake Potrebic 2cee84193c and some more 2023-09-21 22:41:27 -07:00
Jake Potrebic a62835bbb1 almost halfway done with server patches 2023-09-21 21:40:51 -07:00
Jake Potrebic 24fd5aea0c and some more patches 2023-09-21 21:05:18 -07:00
Jake Potrebic 2bc818efd4 some more patches 2023-09-21 20:29:51 -07:00
Jake Potrebic 78a003ee89 work and compile errors 2023-09-21 20:17:35 -07:00
Jake Potrebic 7b29d1f4c5 even more work 2023-09-21 19:17:21 -07:00
Jake Potrebic ef6a41195d some more work 2023-09-21 15:26:51 -07:00
Jake Potrebic a27262375c some work 2023-09-21 15:01:00 -07:00
Noah van der Aa c60dd35989 more more more more more work 2023-09-21 23:09:04 +02:00
Noah van der Aa 7ebfdd5e6d more more more more work 2023-09-21 22:35:39 +02:00
Noah van der Aa 91671751e7 more more more work 2023-09-21 22:14:58 +02:00
Noah van der Aa 20253f478f more more work 2023-09-21 21:54:46 +02:00
Noah van der Aa 2b72b74a36 more work 2023-09-21 21:00:11 +02:00
Noah van der Aa b6e46e90cd rebuild old indexes, first work 2023-09-21 19:39:51 +02:00
Noah van der Aa 6267e26420 So it begins... 2023-09-21 19:18:04 +02:00
Jake Potrebic 773dd72446 Updated Upstream (Bukkit/CraftBukkit) (#9739)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
69c7ce23 PR-990: Use Mockito instead of InvocationHandler for test mocking
997de31d PR-893: Add a stream method to Registry to make it easier to use and to avoid unnecessary wrapping
6a8ce581 Fix malformed javadoc in previous commit
26c74f6d PR-890: Add more Sculk API (bloom, shriek, bloom event)
aa067abf PR-895: Load GameEvent and MusicInstrument from registry

CraftBukkit Changes:
78796c9de Add support for Java 21
ddc9a2dad SPIGOT-7475: Don't fire SculkBloomEvent during world generation
caee2311a PR-1245: Add a stream method to Registry to make it easier to use and to avoid unnecessary wrapping
de421cf56 PR-1242: Add more Sculk API (bloom, shriek, bloom event)
00f5a80fb PR-1252: Fix error when generating a tree in water
10219df3a PR-1248: Load GameEvent and MusicInstrument from registry
2023-09-21 18:48:55 +02:00
Lulu13022002 3fd1502717 Add missing deprecation (#8886) 2023-09-21 10:35:38 +02:00
Jake Potrebic 1b1c23010a Add missing InventoryHolders to inventories (#7400) 2023-09-17 19:16:48 -07:00
The456 581b683931 Fix spigot's Forced-Stats (#9663) 2023-09-17 03:27:56 +02:00
Warrior a856073368 Fix two beacon bugs (#9675) 2023-09-16 17:36:10 -07:00
Jake Potrebic ba0e1f54b9 Fix sapling observer detection and grow event (#9654) 2023-09-16 16:53:21 -07:00
Jake Potrebic 3cec9c985f [ci skip] Add missing javadoc links (#9497) 2023-09-17 01:35:39 +02:00
Lulu13022002andJake Potrebic d8af99a82c Fix silent equipment change for mobs (#9677)
* Fix silent equipment change for mobs

* rebased and added test to make sure all overrides are added

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2023-09-16 16:27:11 -07:00
SoSeDiK 064fb50cc1 Cleanup old async commands patch (#8895) 2023-09-17 00:54:33 +02:00
Warrior 06a741d713 Fix leashed pets teleporting to owner when loaded (#9686) 2023-09-16 15:16:44 -07:00
Warrior e312ebb1bd Add DISPLAY tracking range type (#9668) 2023-09-17 00:02:58 +02:00
WarriorandJake Potrebic ede9c06814 Fix Projectile#setOwner(null) not clearing owner (#9715)
* Fix Projectile#setOwner(null) not clearing owner

* rebased and merged into mentioned patch

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2023-09-16 14:37:38 -07:00
thelooter 0c8e84c20d Enforce sign line nullability when setting line with Adventure Method (#9689) 2023-09-16 23:18:51 +02:00
AeltumnandJake Potrebic deb92c2129 Add ItemStack#isEmpty and related methods (#9664)
* Add new patches

* Change from an EMPTY static var to a static method since ItemStack is mutable

* Properly set nullability of return value

* Move annotation changes to different patch

* Send the Kotlin code back to where it came from

* rebased

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2023-09-16 14:18:09 -07:00
MiniDigger | Martin 83cfeb1b37 Improve java version check (#9692) 2023-09-16 23:06:36 +02:00
Jake Potrebic 99b311de54 [ci skip] Clarify where furnace-related events are called (#8753) 2023-09-16 13:55:40 -07:00
Jake Potrebic eb60bffa98 Create raw chat type as resource file instead of in source (#9226)
Sets up the ability to load new or modified resource files into Paper.

Updates paperweight to 1.5.6

This should work with all run configs, like runDev, runShadow, runReobf as well as correctly build jars for production.
2023-09-15 11:03:42 -07:00
Warrior 29d1c7b602 Call BlockRedstoneEvents for lecterns (#9721) 2023-09-14 23:17:53 +02:00
leguan 7145f41b6e compression level change with config option (#9711) 2023-09-14 13:11:19 +02:00
TreemanKing 6378792a99 Add Barrel to LootableBlockInventory (#9687) 2023-09-14 13:04:36 +02:00
Duckulus e68fd7162a Add missing Piglin Dancing API (#8894) 2023-09-14 12:54:43 +02:00
Lulu13022002 eea0c649ca Swap some nullable annotations (#9696) 2023-09-14 12:44:12 +02:00
Warrior 1c15111f08 Add missing particle javadocs (#9716) 2023-09-14 12:09:09 +10:00
Nassim Jahnke 517f8fbbac Fix line of sight distance check 2023-09-12 09:56:24 +10:00
Spottedleaf fb06829845 Optimise multiple block updates occurring in the same chunk
We can avoid multiple ticket additions for the same ChunkTasks
instance. This will help in situations where significant number of
block updates occur for the same chunk in the same tick, such as
water draining.
2023-09-11 07:15:18 -07:00
violetc c9cd94f3c6 Fix fixItemsMergingThroughWalls check (#9707) 2023-09-11 14:46:02 +10:00
Nassim Jahnke e2b197132d Add missing slot sanity checks for container clicks 2023-09-11 12:03:35 +10:00
Nassim JahnkeandPaul Sauve 72e87abc2d Strip raytracing for EntityLiving#hasLineOfSight
Co-authored-by: Paul Sauve <paul@technove.co>
2023-09-10 12:28:03 +10:00
Joe 33bec7f20a Copy NBT in legacy dragon fight converter 2023-09-06 18:33:31 -07:00
Joe 471f4de9c4 Copy NBT in upgrade data neighbor ticks 2023-09-06 18:30:02 -07:00
Lulu13022002 39953cf08d Take in account waterlogged blocks for scaffolding (#9676) 2023-09-04 17:52:27 +02:00
Md5Lukas b4e3b3d1dd Allow non-op players to execute the click event callback (#9652) 2023-08-28 13:21:13 +02:00
Noah van der Aa b8edb0e130 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9648)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
6b34da8f SPIGOT-7467: Add getAddress to RemoteConsoleCommandSender

CraftBukkit Changes:
db4ba2897 SPIGOT-7467: Add getAddress to RemoteConsoleCommandSender
4f7ff4dec PR-1246: Add missing AbstractTestingBase to tests which need them
f70a7b68d SPIGOT-7465, MC-264979: Fresh installations print NoSuchFileException for server.properties
8ef7afef6 PR-1240: Call BlockGrowEvent for vines that are growing on additional sides of an existing vine block

Spigot Changes:
d2eba2c8 Rebuild patches
2023-08-28 13:05:48 +02:00
Martijn 0c0a480d82 Do crystal-portal proximity check before entity lookup (#9611) 2023-08-26 13:23:31 -07:00
Lulu13022002 0e622c79fa Add sniffer egg api (#9288) 2023-08-26 22:12:46 +02:00
Jake Potrebic 7d13b7066c Add titleOverride to InventoryOpenEvent (#7540) 2023-08-26 12:28:42 -07:00
Jake Potrebic 6813244fb0 Fix/improve destroy speed API (#9645)
further improvements could be a method that takes in an entity
to account for effects
2023-08-25 10:57:11 -07:00
Nassim Jahnke 6f30f08b20 Readd old BlockDamageEvent constructor 2023-08-25 10:19:55 +10:00
Jake Potrebic e552bebca1 Fix inventory desync (#9640) 2023-08-24 16:53:02 -07:00
Aeltumn 0c8882f7f9 Add OfflinePlayer#isConnected (#9642) 2023-08-24 21:44:31 +10:00
Jake Potrebic b45ecc93c1 [ci skip] clear out test plugin 2023-08-23 10:05:08 -07:00
Jake Potrebic b8a0049207 Fix exact choice recipe book clicks (#7822) 2023-08-23 08:20:32 -07:00
Warrior 7a1863ed78 Limit setBurnTime to valid short values (#9623) 2023-08-23 20:54:34 +10:00
Jake Potrebic a751001ed1 [ci skip] Refactor context records for easier expansion (#9589) 2023-08-23 13:34:57 +10:00
Martijn fcc5f232f9 Optimize nearest structure border iteration (#9638) 2023-08-23 11:53:42 +10:00
The456 9cbad8ebbf Expose Hand during BlockCanBuildEvent (#9636) 2023-08-23 10:41:30 +10:00
Bjarne Koll 3716832282 Prevent overfilled bundles from duplicating items (#9633)
Bundles compute the amount to remove from an item based on the formula
(64 - currentWeight) / itemWeight. An overfilled bundle however, with a
currentWeight of > 64 ends up with a negative removal amount for the
item.

This can cause duplication issues on craftbukkit inventory
implementations as they do currently not gracefully handle negative
removal amounts in their remove methods.
2023-08-22 11:57:44 +02:00
Lulu13022002 a712766995 Allow custom damage for trident (#8132) 2023-08-22 16:20:38 +10:00
Lulu13022002 7386a13642 Fix endgateway teleportation offset (#9517) 2023-08-22 16:03:15 +10:00
Jake Potrebic 9395aa6079 Improve performance of mass crafts (#9603) 2023-08-22 15:54:28 +10:00
Rodney 0c7385b569 Add PlayerPickItemEvent (#5590) 2023-08-22 15:22:05 +10:00
SoSeDiK 27d39cac4f Properly clone custom nbt tags inside ItemMeta (#7849) 2023-08-22 14:59:31 +10:00
Jake Potrebic fed9042390 More DragonBattle API (#5655) 2023-08-22 14:08:43 +10:00
Joo200 e3f29f4345 MerchantRecipe: add copy constructor (#8703) 2023-08-22 13:48:25 +10:00
aerulion b29ecd4c22 Expose clicked BlockFace during BlockDamageEvent (#9632) 2023-08-22 13:07:18 +10:00
SoSeDiK 2be57c6943 Expand Pose API (#8781) 2023-08-22 13:05:47 +10:00
caramel 97b9c4a2a4 Fix NPE on Boat#getStatus (#9115) 2023-08-22 12:57:54 +10:00
Jake Potrebic 35ef0537be [ci skip] update editorconfig and gitattributes (#9608) 2023-08-22 12:16:03 +10:00
Bjarne Koll 281855c877 Remove unused lag-compensate-block-breaking option (#9635)
Removes the unused lag-compensate-block-breaking option from the paper
configuration file as the patch using it has been dropped in 1.19.
2023-08-21 22:08:25 +10:00
Nassim Jahnke af6142eab3 [ci skip] Update Gradle wrapper 2023-08-21 19:16:46 +10:00
Corey Shupe 00a68b1efe Player listing API (#8782) 2023-08-21 18:51:31 +10:00
ruViolence 7232506c22 Add entity tracker min Y distance config option (#9406) 2023-08-21 18:05:49 +10:00
Jake Potrebic 1b96c64620 Improve cancelling PreCreatureSpawnEvent with per player mob spawns (#9400) 2023-08-21 17:44:47 +10:00
Yannick Lamprecht 5bf82aa136 Add cancellability to PlayerTrackEntityEvent (#8605) 2023-08-21 17:38:55 +10:00
TonytheMacaroni 88891c37b1 Add Entity Coordinate and Rotation API (#9461) 2023-08-21 17:35:05 +10:00
Will FPandNassim Jahnke 1259b93ba6 Fixed CraftItemStack/CraftItemMeta enchantment level inconsistency (#8792)
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
2023-08-21 17:31:52 +10:00
Trevor Bedson 990765bd08 Fire entity death event for ender dragon (#9495) 2023-08-21 17:06:21 +10:00
Nassim Jahnke 45ba65283f [ci skip] Rebuild patches 2023-08-21 14:51:19 +10:00
Gero f43a19c275 Fix CME in CraftPersistentDataTypeRegistry (#6701) 2023-08-21 14:50:21 +10:00
EpicPlayerA10 d928dda91d Don't tab-complete namespaced commands if send-namespaced is false (#9366) 2023-08-21 14:50:11 +10:00
galacticwarrior9 bd67b83fd0 Determine lava and water fluid explosion resistance by their block explosion resistance (#9482) 2023-08-21 14:50:02 +10:00
Gameoholic ed8401c748 Fix rotation for spawning display entities (#9552) 2023-08-21 14:49:53 +10:00
EpicPlayerA10 5b34a09ed0 Add option to disable chorus plant and mushroom block updates (#9442) 2023-08-21 14:49:38 +10:00
Md5Lukas 67a1a8caf8 Fix Inventory#getLocation not working for the composter (#9596) 2023-08-21 14:49:29 +10:00
Jake Potrebic d12916255a Properly handle BlockBreakEvent#isDropItems (#8936)
Setting whether a block break dropped items controlled
far more than just whether blocks dropped, like stat increases
food consumption, turtle egg count decreases, ice to water
conversions and beehive releases
2023-08-20 20:49:20 -07:00
Jake Potrebic 666a2147a7 [ci skip] rebuild patches 2023-08-20 14:28:49 -07:00
Jake Potrebic 2bd6ba2c63 Deprecate and replace methods using deprecated StructureType (#8643) 2023-08-20 10:30:45 -07:00
Jake Potrebic fd4f0c7741 API for an entity's scoreboard name (#9462)
Was obtainable through different methods, but you had to use different
methods depending on the implementation of Entity you were working with.
2023-08-20 09:06:09 -07:00
Nassim Jahnke eb8f2bb2a1 Fix unknown entity interaction clicked position getter if null 2023-08-19 12:01:06 +10:00
Martijn 307d05bba8 Count down radius-aware dependency tree node parents (#9600) 2023-08-18 12:02:20 +10:00
Jamie ea1f33cf9a Delete patch to fix PaperMC/Paper#9612 (#9621) 2023-08-17 15:51:34 -05:00
Nassim Jahnke 73af2d4cea Add clicked position to PlayerUseUnknownEntityEvent (#9604) 2023-08-16 17:58:07 +10:00
Bjarne Koll 47b805fdf1 Don't let player loot if reloot time is disabled (#9615)
If the reloot time is disabled while reloot is restricted, the player
should not be able to reloot. The previous logic was incorrect and
allowed players to reloot explicitly when the reloot time was disabled.
2023-08-15 21:08:00 -07:00
Warrior 6520ca1c47 Fix main thread priority being lowered (#9488) 2023-08-15 19:37:17 +02:00
Jake Potrebic a73ed9572e Updated Upstream (CraftBukkit/Spigot) (#9598)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
b76ceb4f5 PR-1235: Move EntityType return to base Entity class
e795d7490 SPIGOT-7458: Exception when Entity CommandSender executes Vanilla command
46c7fc3b1 SPIGOT-7452: Player#openSign cannot edit
d91e5aa0b SPIGOT-7447: Rewrite --forceUpgrade to minimise diff and properly handle CraftBukkit world layout
921ae06d6 Revert "SPIGOT-7447: Fix --forceUpgrade"

Spigot Changes:
94e187b5 Rebuild patches
3bce7935 SPIGOT-7091: Update bungeecord-chat
2023-08-13 16:32:51 -07:00
Jake Potrebic 93829bba5a Account for dimension type in portal void damage check (#9602) 2023-08-13 13:30:48 -07:00
Nassim Jahnke 23c44c2b8d [ci skip] Update README 2023-08-13 10:36:26 +10:00
Warrior 02338e5069 Fix DEFAULT getEntitySpawnReason for /summon (#9480) 2023-08-13 01:57:13 +02:00
Nacioszeczek 1dfdbef42b SculkCatalyst bloom API (#9466) 2023-08-13 01:31:32 +02:00
Jake Potrebic 2df309bd49 Bandaid fix for Effect (#9548)
Effect or LevelEvent needs to be replaced
but ideally after the enum PR has been merged
upstream. Until then, this test and these fixes
should address all the known issues with them
2023-08-12 15:19:34 -07:00
Noah van der Aa 29aaf7bc24 Fix custom statistic criteria creation (#9595) 2023-08-12 23:50:21 +02:00
Jake Potrebic 20a71c58d3 Add restrict-player-reloot-time config (#7652) 2023-08-12 14:26:47 -07:00
3b4839ee32 Fix players are invisible after using setPlayerProfile (#9143)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
2023-08-12 16:10:09 +02:00
Warrior 3c41f8f0b3 Cache map ids on item frames (#9584) 2023-08-12 23:33:24 +10:00
Warrior 9bc70e6888 Make the cursor limit option apply to banners (#9554) 2023-08-10 15:22:40 +02:00
Spottedleaf 4179b8f3fa Remove UpgradeData neighbour ticks outside of range
The lists are only supposed to contain ticks for the 1 radius
neighbours of the chunk.
2023-08-09 14:05:57 -07:00
Florian Schmidt 98c567fe6f Use correct seed on api world load (#9541) 2023-08-08 16:35:15 -07:00
Warrior a2002a76b8 Fix wild wolves not considering bones interesting (#9579) 2023-08-08 16:15:01 -07:00
Jake Potrebic 93cf3eb832 Respect randomizeData on more entities when spawning (#9483) 2023-08-08 16:07:59 -07:00
Warrior 9ffccd6430 Use correct source for mushroom block spread event (#9587) 2023-08-08 15:51:58 -07:00
Nassim Jahnke 408a9050ba Don't put entities removed during the portal exit event into an invalid state 2023-08-08 17:48:55 +10:00
Nassim Jahnke ef2b574c6a Clone location in PlayerFailMoveEvent getters 2023-08-08 13:00:17 +10:00
Moulberry 5274ad672b Add and implement PlayerFailMoveEvent (#9535) 2023-08-08 12:51:09 +10:00
Jake Potrebic d6d2b6f4e5 Only capture actual tree growth (#6464) 2023-08-05 19:33:18 -07:00
Phillipp GlanzandYannick Lamprecht 8fe8ca6658 Add clickable version on version command (#9347)
Co-authored-by: Yannick Lamprecht <1420893+yannicklamprecht@users.noreply.github.com>
2023-08-06 03:26:13 +02:00
Jake Potrebic 31358d5e48 API for updating recipes on clients (#6463) 2023-08-05 18:11:22 -07:00
Bjarne KollandJake Potrebic 508a295b44 Only erase allay memory on non-item targets (#9570)
* Only erase allay memory on non-item targets

Spigot incorrectly instanceOf checks the EntityTargetEvent#getTarget
against the internal ItemEntity type and removes the nearest wanted item
memory if said instanceOf check fails, (which is always the case)
causing allays to behave differently as they constantly loose their
target item.

This commit fixes the faulty behaviour by instance performing a check
against the CraftItem type.

* Reduce diff

* fix typo

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2023-08-05 17:31:10 -07:00
Jake Potrebic 2fa8efce9b Updated Upstream (Bukkit/CraftBukkit) (#9485)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
82af5dc6 SPIGOT-7396: Add PlayerSignOpenEvent
3f0281ca SPIGOT-7063, PR-763: Add DragonBattle#initiateRespawn with custom EnderCrystals
f83c8df4 PR-873: Add PlayerRecipeBookClickEvent
14560d39 SPIGOT-7435: Add TeleportCause#EXIT_BED
2cc6db92 SPIGOT-7422, PR-887: Add API to set sherds on decorated pots
36022f02 PR-883: Add ItemFactory#getSpawnEgg
12eb5c46 PR-881: Update Scoreboard Javadocs, remove explicit exception throwing
f6d8d44a PR-882: Add modern time API methods to ban API
21a7b710 Upgrade some Maven plugins to reduce warnings
11fd1225 PR-886: Deprecate the SmithingRecipe constructor as it now does nothing
dbd1761d SPIGOT-7406: Improve documentation for getDragonBattle

CraftBukkit Changes:
d548daac2 SPIGOT-7446: BlockState#update not updating a spawner's type to null
70e0bc050 SPIGOT-7447: Fix --forceUpgrade
6752f1d63 SPIGOT-7396: Add PlayerSignOpenEvent
847b4cad5 SPIGOT-7063, PR-1071: Add DragonBattle#initiateRespawn with custom EnderCrystals
c335a555f PR-1212: Add PlayerRecipeBookClickEvent
4be756ecb SPIGOT-7445: Fix opening smithing inventory
db70bd6ed SPIGOT-7441: Fix issue placing certain items in creative/op
f7fa6d993 SPIGOT-7435: Add TeleportCause#EXIT_BED
b435e8e8d SPIGOT-7349: Player#setDisplayName not working when message/format unmodified
a2fafdd1d PR-1232: Re-add fix for player rotation
7cf863de1 PR-1233: Remove some old MC bug fixes now fixed in vanilla
08ec344ad Fix ChunkGenerator#generateCaves never being called
5daeb502a SPIGOT-7422, PR-1228: Add API to set sherds on decorated pots
52faa6b32 PR-1224: Add ItemFactory#getSpawnEgg
01cae71b7 SPIGOT-7429: Fix LEFT_CLICK_AIR not working for passable entities and spectators
a94277a18 PR-1223: Remove non-existent scoreboard display name/prefix/suffix limits
36b107660 PR-1225: Add modern time API methods to ban API
59ead25bc Upgrade some Maven plugins to reduce warnings
202fc5c4e Increase outdated build delay
ce545de57 SPIGOT-7398: TextDisplay#setInterpolationDuration incorrectly updates the line width

Spigot Changes:
b41c46db Rebuild patches
3374045a SPIGOT-7431: Fix EntityMountEvent returning opposite entities
0ca4eb66 Rebuild patches
2023-08-05 17:21:59 -07:00
GameoholicandJake Potrebic 69a801305d [ci skip] Fix inventorycloseevent javadocs (#9533)
* Add InventoryCloseEvent safety doc comment, similar to InventoryClickEvent

* Fix inventorycloseevent javadocs

* Fix InventoryCloseEvent and InventoryClickEvent javadocs

* remove extra +

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2023-08-05 12:58:38 -07:00
Jake Potrebic 2c55dd86ff Expand use of strict advancement dim check (#9545) 2023-08-05 12:26:28 -07:00
Emily 13c9d3c423 Bump net.kyori:ansi to 1.0.3 (#9575) 2023-08-04 14:54:25 -07:00
Jake Potrebic 81619a652e Fix treasure map config default (#9572) 2023-08-04 08:52:22 -07:00
Emilia Kond f402f89a67 Bump net.kyori.ansi to 1.0.2 (#9546) 2023-07-29 12:59:46 +10:00
Jake Potrebic 6c7e3c5193 [ci skip] Clarify viewers set mutability in chat events (#9525) 2023-07-28 15:14:19 -07:00
Jake Potrebic 7d1cc6d409 Add Translatable interface to MusicInstrument (#9538) 2023-07-28 15:06:27 -07:00
Jake Potrebic a40e48f3fd Add cause to PlayerOpenSignEvent (#9441)
Also fire the event for plugin-opened signs
2023-07-26 17:25:14 +01:00
Spottedleaf 1837f6c677 Prevent entity removals if the entity slices is receiving status updates
If an entity is removed while updating an entity slice, then the
iteration over the entity slice's entities could throw a cryptic
exception. Instead, it is better to prevent the entity removal
with a useful log message.

Fixes https://github.com/PaperMC/Paper/issues/9464
2023-07-25 07:21:45 -07:00
Owen b14979e352 Remove isRemoved skip on .discard() (#9520) 2023-07-24 19:04:40 +10:00
powercas_gamer aa93dcfdce feat: add minimessage tag resolvers overload to CommandSender#sendMessage (#9505) 2023-07-23 01:46:40 -04:00
Sage 42830546f3 Add player whitelist events (#9209) 2023-07-23 00:38:53 -04:00
JLitewski e19177a2c3 Rewrote Amethyst logic to throw both BlockGrowEvent and BlockSpreadEvent (#9217)
With this patch, it is now possible to further control what plugins can do with Amethyst Blocks.
You can prevent Budding Amethyst blocks from creating shards with the BlockSreadEvent, and
when shards grow, it can be prevented with BlockGrowEvent
2023-07-22 23:54:02 -04:00
Jake Potrebic 2c54b3949f Don't support hex in book title and author (#9493) 2023-07-22 23:40:52 -04:00
Astralchroma d8b8f61961 Configurable Region Compression Format (#8505) 2023-07-22 20:13:48 -04:00
Owen 383f0ed924 Remove sign ticking (#9478)
Minecraft now ticks signs in order to validate the playerWhoMayEdit field. This is a horrible idea, as this means that even waxed signs are ticked for essentially no reason. This moves the logic lazily onto the getter.
2023-07-22 17:00:50 -04:00
Jake Potrebic 24d690fe7e Fix hopper not marking source inv as changed (#9070) 2023-07-22 13:48:23 -07:00
Golfing7 46a36d3b28 Make ExperienceOrb entities call EntitySpawnEvent (#9197) 2023-07-22 16:19:50 -04:00
Roman Alexander 2f8d9db58c Pathfinder hasPath should check if path is done. (#9231) 2023-07-22 16:04:19 -04:00
Infynyty b1334b5105 Mark Player.sendSignChange as deprecated (#9382) 2023-07-22 21:38:40 +02:00
Jake Potrebic c016e039a5 Fix unbreakable flint and steel consumed when igniting creepers (#9509) 2023-07-19 09:16:39 -07:00
Bjarne Koll 40adc2345b [ci skip] Fix incorrect javadoc in JarLibrary (#9513) 2023-07-19 12:51:58 +01:00
Moulberry c793bd93be Allow LEFT_CLICK_AIR in 3.0->4.5 range of entity (#9211) 2023-07-16 17:58:25 +02:00
Jake PotrebicandBillyGalbreath b533905cc3 fix 2 vanilla issues (#8940)
Fix sheeps eating grass outside ticking chunks
Fix itemframe drops dropping in correct location

Co-authored-by: BillyGalbreath <blake.galbreath@gmail.com>
2023-07-15 16:28:28 -04:00
Jason fe780d041e Add back accidentally dropped Wandering Trader patch (#9492) 2023-07-14 16:23:33 -07:00
Jake Potrebic de3f149185 Fix possible NPE on painting creation (#9391) 2023-07-13 17:22:15 -07:00
Jake Potrebic 22ed60c101 Fix BanList API (#9450) 2023-07-13 14:43:45 -07:00
Jake Potrebic aefb73c234 Add Owner UUID api for AreaEffectCloud (#9364) 2023-07-13 17:26:42 -04:00
Owen ece4fd3597 Suppress Item Meta Validation Checks (#9331)
Stops item meta from aggressively throwing exceptions.
2023-07-13 16:59:49 -04:00
Jake Potrebic 836586d59b Fix missing item types in SlotType for armor change event (#9379)
Also added 2 parameterized tests to make sure this doesn't happen
again.
2023-07-13 13:09:26 -07:00
Owen 92bc19b049 Fix missing item interaction cancelling case (#9427)
Properly cancels brushes now
2023-07-13 15:48:46 -04:00
Lulu13022002 1f8ca77bb6 Prevent desync for poi and pistons (#9270) 2023-07-13 15:22:05 -04:00
Jake Potrebic a60eeb85f5 Fix mob breaking doors not spawning particles (#9443)
This is a vanilla issue reported as MC-263999
2023-07-13 12:11:27 -07:00
Pedro a3c760e6af Handle block state in EntityDamageByBlockEvent (#9396) 2023-07-12 12:12:12 -07:00
Nassim Jahnke f9473d9928 [ci skip] Add gradle wrapper validation action 2023-07-11 23:25:02 +02:00
Jake Potrebic b3dc7a3b4b fix item meta for tadpole buckets (#9473) 2023-07-11 11:52:11 -07:00
chickeneer 805fdd83b3 Add deprecations to SignSide string methods (#9467) 2023-07-11 09:58:08 -07:00
Warrior 6b325cd6a9 Array backed synched entity data (#9460) 2023-07-10 15:27:50 +02:00
Jake Potrebic 5de0f8ac48 Add Sign#getInteractableSideFor (#9388) 2023-07-08 11:04:19 +02:00
Jake Potrebic e105354330 Fix incorrect new blockdata in EntityChangeBlockEvent (#9445)
Also fixes EntityBreakDoorEvent not having the correct 'to' block data

Also standardizes how to handle EntityChangeBlockEvent before a removeBlock or destroyBlock
call. Always use 'state.getFluidState().createLegacyBlock()' to get the new state instead of
just using the 'air' state.
2023-07-07 10:25:36 -07:00
Jake Potrebic d7d3f6371e [ci skip] Use Nullable annotation for Entity source (#9435) 2023-07-06 20:38:46 -07:00
Spottedleaf 48ea66e97f Optimize player lookups for beacons
For larger ranges, it's better to iterate over the player list
than the entity slices.
2023-07-06 20:18:33 -07:00
Shane Freeder dadd8b5a7c Don't allow for supporting block checks to load chunks
I cannot test this due to lack of hardware (took 30 minutes getting paper
updated and loaded into IJ on this machine...), however, this is the easiest
patch for now. Ideally, some form of distance check would probably be added to
improve invalidation of this cache.
2023-07-06 02:55:19 +01:00
Lulu13022002 12c970097d Fix ThrownEggHatchEvent#setHatching (#9448) 2023-07-05 09:46:12 +02:00
Nassim Jahnke c0936a71bd Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9440)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
01aa02eb PR-858: Add LivingEntity#playHurtAnimation()
9421320f PR-884: Refinements to new ban API for improved compatibility and correctness
37a60b45 SPIGOT-6455, SPIGOT-7030, PR-750: Improve ban API
4eeb174b All smithing inventories are now the new smithing inventory
f2bb168e PR-880: Add methods to get/set FallingBlock CancelDrop
e7a807fa PR-879: Add Player#sendHealthUpdate()
692b8e96 SPIGOT-7370: Remove float value conversion in plugin.yml
2d033390 SPIGOT-7403: Add direct API for waxed signs
16a08373 PR-876: Add missing Raider API and 'no action ticks'

CraftBukkit Changes:
b60a95c8c PR-1189: Add LivingEntity#playHurtAnimation()
95c335c63 PR-1226: Fix VehicleEnterEvent not being called for certain entities
0a0fc3bee PR-1227: Refinements to new ban API for improved compatibility and correctness
0d0b1e5dc Revert bad change to PathfinderGoalSit causing all cats to sit
648196070 SPIGOT-6455, SPIGOT-7030, PR-1054: Improve ban API
31fe848d6 All smithing inventories are now the new smithing inventory
9a919a143 SPIGOT-7416: SmithItemEvent not firing in Smithing Table
9f64f0d22 PR-1221: Add methods to get/set FallingBlock CancelDrop
3be9ac171 PR-1220: Add Player#sendHealthUpdate()
c1279f775 PR-1209: Clean up various patches
c432e4397 Fix Raider#setCelebrating() implementation
504d96665 SPIGOT-7403: Add direct API for waxed signs
c68c1f1b3 PR-1216: Add missing Raider API and 'no action ticks'
85b89c3dd Increase outdated build delay

Spigot Changes:
9ebce8af Rebuild patches
64b565e6 Rebuild patches
2023-07-04 10:22:56 +02:00
Lulu13022002andJake Potrebic 4356758b64 Call missing BlockDispenseEvents (#8518)
* Call missing BlockDispenseEvent

* Avoid duplicate event

* Show a single item for event

* Move glowstone refill event

* rebased

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2023-07-02 16:12:07 -07:00
Jason 171ba7ccf3 Move Log4j plugins to own source set (#9428) 2023-07-01 22:00:46 -07:00
Jake Potrebic e16fefb443 [ci skip] add 'accepted' to Done project category (#9429) 2023-07-01 10:24:58 +02:00
Jake Potrebic f2c1e1366a Fix default permission for xp command (#9419) 2023-06-30 15:02:25 -07:00
Boy0000 fead63e2ea Add option to disable NoteBlock and Tripwire updates (#9368) 2023-06-30 16:11:52 +02:00
Nassim Jahnke 225c95025b Hotfix double entity removal making entity scheduler retire call
The assumption that the setRemoved method will never be called more than once is flawed, considering even vanilla code seems to indicate it might happen. Especially with plugins, throwing an exception is not something reasonably maintainable across all the places it *could* happen.
If it is called a second time after already having been removed due to changing dimensions, that's definitely bad, so no extra check for that
Fixes #9420
2023-06-29 17:41:32 +02:00
Jake Potrebic 437e8da700 Improve command function perm level checks (#9411) 2023-06-28 23:18:28 -07:00
Jake Potrebic 2c9c5e4662 Fix replenishable container entities save/load existing contents (#9417) 2023-06-28 11:06:47 -07:00
Pedro 82cd69fcf4 [ci skip] Update Repo style and change project url in README (#9407) 2023-06-28 10:23:05 +02:00
Jake Potrebic e4b40ddc22 Fix entity selectors while spectating (#9402) 2023-06-27 14:46:27 -07:00
Jake Potrebic 8582999344 Deprecate duplicate chat completion methods (#9401) 2023-06-27 10:18:59 +02:00
Lulu13022002 cf0f013f53 Avoid duplicate death event call for armorstands (#9223)
* Avoid duplicate death event call for armorstands

* restore vanilla behavior (emit the game event etc...)
2023-06-26 21:22:49 -07:00
Redned 7103f813bc Only tick item frames if players can see it (#9377)
In the event that an item frame cannot be seen by any players, ticking the item frame every tick is unnecessary. This can be a very hot section of the entity tracker when lots of item frames are present on a server, so this reduces the logic which speeds it up.
2023-06-27 00:26:29 +01:00
Bit 3f6c4b07ac Add event for player editing sign (#9300)
Addresses https://github.com/PaperMC/Paper/issues/9293
2023-06-26 23:35:32 +01:00
Nassim Jahnke 990be1691b Iterate over entity array copy for entity scheduler 2023-06-26 18:41:08 +02:00
powercas_gamer e8bec64217 Fix ugly java logger format for paper plugin dependency loader (#9395) 2023-06-25 09:57:45 +02:00
Owen b34d4ecd2e Fix cycle on paper plugin toString (#9392) 2023-06-24 22:37:38 +01:00
Owen aea9cdd37d Fix interact event call override (#9387) 2023-06-23 11:03:43 -05:00
Molean 206dd3af05 Fix incorrect phantom spawning entity (#9385) 2023-06-23 12:50:29 +02:00
Samir b1696788d6 ratelimited packet is logged to console on kick (#9292) 2023-06-21 14:36:14 +01:00
Redned c613877e54 Fix incorrect crafting result amount for fireworks (#9322)
Although vanilla does not specifically call this method anywhere, this fixes a bug where the result using the Bukkit API returns the wrong amount.
2023-06-21 14:11:50 +01:00
Owen 3756f5bbf5 Properly Cancel Usable Items (#9225)
This fixes the bug causing canceling PlayerInteractEvent to cause items to continue to be used despite being canceled on the server.

For example, items being consumed but never finishing, shields being put up, etc.
The underlying issue of this is that the client modifies their synced data values, and so we have to (forcibly) resend
them in order for the client to reset their using item state.
2023-06-18 18:33:15 -04:00
Nassim Jahnke 1f5bec71f3 Pull Folia API take two 2023-06-18 22:46:52 +02:00
Nassim Jahnke b1fe756b73 Revert "Move some Folia API to Paper for easy compat (#9360)"
This reverts commit d6d4c78e7d.
2023-06-18 21:47:17 +02:00
Nassim Jahnke d6d4c78e7d Move some Folia API to Paper for easy compat (#9360) 2023-06-18 20:02:59 +02:00
Shane Freeder 976b95c74c Temp: Pre-init PlayerChunkLoaderData in order to prepopulate the BFS lookup cache because potatos (Closes #9338) 2023-06-18 13:49:22 +01:00
Nassim Jahnke 275173e538 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
0c5d8709 SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends
255c4fdb SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot

CraftBukkit Changes:
b6b514b7e SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends
fcff84de9 SPIGOT-7399: Revert null check in CraftMetaItem#safelyAdd
44a4b5649 SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot
676969d01 SPIGOT-7389: Handle setting null items in ChiseledBookshelf Inventory
2023-06-18 13:18:11 +02:00
Jake Potrebic 873533b129 Add method to remove all active potion effects (#9361)
* Add method to remove all active potion effects

* use clear instead of removeAll
2023-06-17 21:10:13 -07:00
Riley Park faf9a65b62 Disable BukkitMirrorTest 2023-06-17 14:20:46 -07:00
Jake Potrebic 072b78a713 Add trail ruins structure set seed in spigot config (#9327)
Also adds a server test to ensure the defaults match and that a seed
exists for each structure set
2023-06-17 12:12:23 -07:00
Jake Potrebic 3a0373901e Add method to get ungenerated chunk from long key (#9254)
Also added a missing deprecation for a location block key method
2023-06-17 11:43:08 -07:00
Jake Potrebic c1ea5502d4 Remove more outdated config settings (#9358) 2023-06-17 11:25:22 -07:00
Jake Potrebic 38856661c0 Remove stacktrace on exception from reading server.properties (#9296) 2023-06-16 19:27:45 -07:00
Spottedleaf a226f44b45 Copy itemstack when sanitizing for datawatcher items
Since the packet is broadcasted for players, it means that
the packet will be sent to multiple players. In this case,
modifying the data results in a possible race condition
where a CME may occur as the packet will be serialized on
many different netty IO threads.
2023-06-16 10:27:59 -07:00
Spottedleaf f5551380b3 Make sure to post process chunks before they are sent to players
Some TEs need to be post processed after generation to be sent
properly (chests)
2023-06-16 10:25:26 -07:00
Spottedleaf 3f237e869a Fix IntegerUtil#getDivisorNumbers
Use unsigned mod operation for initialization of anc

Also includes
- https://github.com/PaperMC/DataConverter/commit/5a0cefb45e246ef36901fb62448571edd82e7296
- https://github.com/PaperMC/Starlight/commit/acc8ed9634bbe27ec68e8842e420948bfa9707e7
2023-06-16 09:05:36 -07:00
powercas_gamer 02e3b5a91a chore(api): add missing javadoc urls (#9355) 2023-06-16 16:34:49 +01:00
OllieandBjarne Koll 17966ddb8e Update the server logo (#9264)
Co-authored-by: Bjarne Koll <lynxplay101@gmail.com>
2023-06-16 16:20:31 +01:00
Lulu13022002 f6139de06c Fix sniffer removeExploredLocation and javadoc (#9311) 2023-06-16 14:33:25 +01:00
Nassim Jahnke 81834ac54a Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
be1f3344 SPIGOT-7326: Add ClickType#isMouseClick()

CraftBukkit Changes:
3b557627c Fix Player#setScoreboard() checking incorrect state
9a21b0b89 SPIGOT-7393: Fix new tile entities not loading Bukkit's PersistentDataContainer

Spigot Changes:
c62f4bd9 Rebuild patches
2023-06-16 13:32:29 +02:00
Phillipp Glanz fa674f3d35 Don't enforce icanhasbukkit default if alias block exists (#9334) 2023-06-16 12:02:43 +01:00
Jake Potrebic b134eb406a Fix incorrect annotation on BrushableBlock#getItem (#9345) 2023-06-16 11:58:09 +01:00
Jake Potrebic 41e6f20420 Updated Upstream (Bukkit/CraftBukkit) (#9342)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
fdff0cd4 PR-869: Add Enderman#teleport and Enderman#teleportTowards
dfd86ee7 Improve sendSignChange and related documentation
beced2b2 PR-867: Add Player#sendBlockUpdate to send tile entity updates

CraftBukkit Changes:
ad6d0cffb SPIGOT-7394: Fix another issue with sendSignChange
66c5ce4c7 SPIGOT-7391: Preserve vanilla sign json where not modified by event
ae3824f94 PR-1204: Add Enderman#teleport and Enderman#teleportTowards
5863a2eae Fix sendSignChange not working
4a7eadc97 PR-1201: Add Player#sendBlockUpdate to send tile entity updates
789324e30 Work around issue placing decorated pots
2023-06-16 11:28:31 +01:00
Jason f7b386ddc7 Use ANSI serializer for console completion descriptions (#9351) 2023-06-15 10:11:09 -07:00
Jake Potrebic 8bc0574fb8 Bump kyori's ansi to fix color bleed (#9346) 2023-06-15 09:24:01 -07:00
Jake Potrebic bae6096aa2 Re-add dropped patch during 1.20 update (#9344) 2023-06-14 17:52:28 -07:00
Bjarne Koll 837cc25c51 Call BlockEntity#load in new child types (#9340)
BlockEntity#load is responsible for loading the pdc data for block
entities. Some of the new block entities added by mojang do not call
their super method, preventing paper from loading the PDC, which
leads to a loss of data.

This commit adds the super calls to prevent this.
2023-06-14 13:06:50 +02:00
powercas_gamer 62262d73d2 [ci skip] mention adventure in chatcolor deprecation message (#9336)
* mention adventure in chatcolor deprecation message

* expand text

* americans
2023-06-13 20:48:41 -07:00
Jason 2e363c73ba 1.20.1 (#9333) 2023-06-13 09:10:07 +02:00
Jake Potrebic c287e921a9 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9301) 2023-06-12 16:51:45 -07:00
Jason Penilla b48e2e352e Fix dev bundle generation 2023-06-12 16:44:07 -07:00
Emilia Kond 2d09115b3a Use net.kyori.ansi for console logging (#9313)
Uses the new ANSIComponentSerializer introduced in Adventure 4.14.0 to
serialize components when logging them via the ComponentLogger, or when
sending messages to the console.

This replaces the old solution which uses legacy jank and custom color
conversions, with a new library that handles the conversion and config
2023-06-12 15:00:12 -07:00
Bjarne Koll 87dfff4cfa Implement BossBarViewer on Player (#9332)
* Implement BossBarViewer on Player

Author: Riley Park <rileysebastianpark@gmail.com>

* Implement BossBar#viewers
2023-06-12 14:43:39 -07:00
Jake Potrebic de19eb8c4a fix incorrectly updated move vector checking patch (#9328) 2023-06-12 11:26:43 -07:00
Jake Potrebic f8cfdd4ba9 Fix SmithingInventory helper slot methods for 1.20 (#9325) 2023-06-12 19:04:53 +02:00
Lulu13022002 eb0693fff7 Fix EntityDeathEvent cancellation (#9323) 2023-06-12 19:03:51 +02:00
Bjarne Koll f4dfdcbb5b Fix sendSignChange0's usage of SignText (#9310) 2023-06-11 22:53:28 +02:00
Jake Potrebic 3722877c3c correctly hide players from entity argument suggestions (#9245) 2023-06-10 18:15:43 -07:00
Lulu13022002 e2e874f549 Add back the source uuid on exp orb for animals breeding (#9289) 2023-06-10 18:01:10 -07:00
Spottedleaf bc3496ea58 Fix incorrect collision shape for hopper item suck
It shouldn't cost too much more to check the correct shape,
provided that it is cached and we use the overall AABB
to collect possible entities to check against.

The issues with the old check code is that it will use two
getEntitiesOfClass calls plus the addition of streams
_and_ the toAabbs() logic on VoxelShape. The new code
caches toAabbs, uses one getEntitiesOfClass call, and
does not use streams. Then compared to 1.12, we are
only performing two additional AABB checks per item.
2023-06-10 13:42:03 -07:00
Spottedleaf 3d06377b24 Allow double removal from player chunk loader
Unlike Folia, players may be incorrectly be double-removed

Fixes https://github.com/PaperMC/Paper/issues/9299
2023-06-10 08:27:23 -07:00
Owen 2ffb704efa Don't use event to get block position (#9295) 2023-06-10 02:13:42 -04:00
Jake Potrebic dc30ee591d Properly remove the experimental smithing inventory type (#9290) 2023-06-09 20:50:00 +02:00
Jake Potrebic 0284b272d3 Add API for waxed signs (#9291) 2023-06-09 20:32:20 +02:00
Lulu13022002 648c000fb2 Add pitcher plant api (#9286) 2023-06-09 14:23:38 +02:00
Bjarne Koll 4b5f84712b Minimise EntityFertilizeEggEvent and add sniffer (#9280) 2023-06-09 09:01:08 +02:00
Jake Potrebic 4e3febbfe0 fix missing trigger entity for xp orb from breeding 2023-06-08 23:52:18 -07:00
Jake Potrebic f9fc44ff9f add side to PlayerSignCommandPreprocessEvent 2023-06-08 22:57:24 -07:00
Jake Potrebic 9ebf75d894 fix some more 1.20 tracking issues 2023-06-08 22:45:45 -07:00
Jake Potrebic c9e125f62a Fix setListenerRange for calibrated sculk sensors 2023-06-08 22:35:56 -07:00
Jason Penilla 9ada4bd7af Prevent the rcon thread from attempting connections after shutdown 2023-06-08 22:25:23 -07:00
Jake Potrebic ea9fdc393c Ignore inline definitions of trim material & pattern 2023-06-08 21:53:37 -07:00
Jake Potrebic 0d969f0a1b comment out update logic from build.gradle.kts 2023-06-08 21:31:56 -07:00
Jake Potrebic 82c64790f4 Add back Anti-Xray patch (#9283) 2023-06-08 21:29:58 -07:00
Owen1212055 e829a9d8f3 Fix javadoc 2023-06-08 22:53:42 -04:00
Owen1212055 6d74ad155f Finish tests & bad calls 2023-06-08 22:51:31 -04:00
Jake Potrebic 03c3587e2e fix not editable sign after openSign 2023-06-08 19:45:58 -07:00
Owen ccb194bbbb Move block farther away for Player#setRotation (#8514) 2023-06-08 22:37:59 -04:00
Lulu13022002 3621d76d8f Fix collision between AABB and a dot (#8733) 2023-06-08 22:17:32 -04:00
Lulu13022002 21f2d158c4 Avoid duplicate poi entries from the first section (#9235) 2023-06-08 22:14:30 -04:00
Jake Potrebic c9eb393d18 Updated Upstream (Bukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
657df461 PR-686: Add missing trim patterns added in 1.20
2023-06-08 19:10:05 -07:00
Spottedleaf 04509f0234 Fix crash relating to "Already sent chunk"
Forgot to update the distandce field in the single user area map
on update, and additionally used the wrong radius (introduced
last commit) for the broadcast map
2023-06-08 18:00:46 -07:00
Spottedleaf 8ce5219e07 Fix inconsistent chunk sending with vanilla
Vanilla now loads the proper number of chunks for sending
to players. So, we can finally match their behavior after
all these years.
2023-06-08 17:45:54 -07:00
Jake Potrebic e325e37268 add missing call to EntityInsideBlockEvent 2023-06-08 17:34:35 -07:00
Jake Potrebic 59060aaec3 fix some failing tests 2023-06-08 17:26:05 -07:00
Owen1212055 9d428792c4 Fix breaking pots throwing exception 2023-06-08 20:24:12 -04:00
Jason Penilla aed9ef0788 Update adventure 2023-06-08 17:22:51 -07:00
Jake Potrebic 318a08c1db add missing block entity type to CraftBlockStates 2023-06-08 17:04:46 -07:00
Jake Potrebic a0a2e7287c fix sculk npe 2023-06-08 16:56:02 -07:00
Spottedleaf c1def9d852 Updated Upstream (CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
fd92f1e65 SPIGOT-7378: Add BlockDropItemEvent for Suspicious Sand & Gravel drops
cb1b69d13 SPIGOT-7377: Server sends player list twice

Spigot Changes:
16cfc987 Rebuild patches
2023-06-08 16:47:58 -07:00
Spottedleaf 57a592466d Fix boot errors
Thanks kennytv
2023-06-08 16:44:34 -07:00
Spottedleaf efb4197a1b Fix final compilation issues 2023-06-08 16:35:02 -07:00
Spottedleaf 902691b636 Apply last patch 2023-06-08 16:21:20 -07:00
Spottedleaf 619d7c93d8 Add in some patches 2023-06-08 16:12:34 -07:00
Spottedleaf cc491a396e Finish updating chunk system patch
Add in locking changes from folia, plus fix some diffs.
I'm sure it'll be error-free.
2023-06-08 16:04:53 -07:00
Jake Potrebic 3fe0e32495 more compile fixes 2023-06-08 14:13:43 -07:00
Jake Potrebic f0aea8123e more compile fixes 2023-06-08 13:56:13 -07:00
Jake Potrebic 0a9e232f48 fix some more compile issues 2023-06-08 12:35:20 -07:00
Jake Potrebic 7002799587 fix FullChunkAccess enum move (#9281) 2023-06-08 12:22:12 -07:00
Jake Potrebic 37e689f367 fix more compile errors 2023-06-08 12:00:58 -07:00
Owen1212055 034edecc37 cleanup some descriptions + optimize hoppers patch 2023-06-08 14:10:23 -04:00
Jake Potrebic b4ae928db9 add some more patches back 2023-06-08 10:48:28 -07:00
Jake Potrebic 870dafe358 add 1 more networking patch and add comments to dropped patches 2023-06-08 10:25:32 -07:00
Jake Potrebic 1a0280ccc0 apply a couple network patches 2023-06-08 09:09:43 -07:00
Jake Potrebic f80338725e fix defaulting join-classpath to true for plugin deps 2023-06-08 06:50:41 -07:00
Nassim Jahnke a6628220d3 Update test plugin 2023-06-08 15:42:13 +02:00
Nassim Jahnke ad4eb2ec7d Fix bad fixup 2023-06-08 15:27:41 +02:00
Nassim Jahnke 4af62f6d1d Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
2d009e64 Update SnakeYAML javadoc link
b4fd213c Switch Player#updateInventory deprecation for internal API annotation

CraftBukkit Changes:
f3b2b2210 SPIGOT-7376: Exception with getBlockData when hasBlockData is false
725545630 SPIGOT-7375: Fix crash breeding certain entities
b9873b0d4 Update Brigadier version with fix
68b320562 SPIGOT-7266: Found typo in CraftBukkit package
98b4d2ff8 SPIGOT-7372, SPIGOT-7373: Signs can't be edited, issues with SignChangeEvent
5f7bd4d78 SPIGOT-7371: Sign does not open edit text on placement
b4cf99d24 SPIGOT-7371: Fix editing signs with API
a2b6c2744 PR-1200: Implement open sign by side
a345bb940 SPIGOT-7368: Downgrade SpecialSource version

Spigot Changes:
723951c3 Rebuild patches
b655c57d Drop old collision API deprecated since 1.9.4
55b0fed4 Rebuild patches
2023-06-08 15:25:35 +02:00
Noah van der Aa 0cc83ea9b6 1.20: Remove Experimental API status where upstream forgot (#9271) 2023-06-08 15:04:43 +02:00
Bjarne Koll 2873869bb1 Drop manual isEditable copy in CraftSign
Signs no longer have a specific isEdiable state, the entire API in this
regard needs updating/deprecation. The boolean field is completely gone,
replaced by a uuid (which will need a new setEditingPlayer(UUID) method
on the Sign interface), and the current upstream implementation of
setEdiable simply flips the is_waxed state.

This patch is hence not needed as it neither allows editing (which will
be redone in a later patch) nor is required to copy the is_waxed boolean
flag as it lives in the signs compound tag and is covered by applyTo.
2023-06-08 11:35:39 +02:00
Bjarne Koll 1c12701691 Update fluid chunk loading patch 2023-06-08 11:18:51 +02:00
Bjarne Koll d5682d77c3 Minimize strict-advancement-dimension-checks.patch 2023-06-08 10:53:00 +02:00
Owen1212055 aa1c25c88d vine boom sound 2023-06-08 04:47:19 -04:00
Owen1212055 bab0b3a7c3 YOU get patches 2023-06-08 04:08:08 -04:00
Owen1212055 b05cd80334 Fix scuffed patches 2023-06-08 03:57:42 -04:00
Owen1212055 605e66c5de re-patched 2023-06-08 03:40:45 -04:00
Owen1212055 91b45c49ce Patched 2023-06-08 03:20:03 -04:00
Owen1212055 6d118492b6 Some chunk patches 2023-06-08 02:31:22 -04:00
Spottedleaf 74ad522fc5 Rebase chunk patches 2023-06-07 22:26:06 -07:00
Spottedleaf 819facd7c4 rewrite chunk system checkpoint 2023-06-07 22:26:06 -07:00
Spottedleaf 0c4a1c4496 Clean rebuild
Add to gradle build so that this is automatically done
throughout the update
2023-06-07 22:26:06 -07:00
Jake Potrebic de18bb96e8 actually update to 1.20 2023-06-07 20:33:11 -07:00
Jake Potrebic 20aaebbd47 update reobf-mappings-patch.tiny 2023-06-07 20:30:34 -07:00
Jake Potrebic 13ab8b77d3 signing off for now 2023-06-07 19:12:38 -07:00
Jake Potrebic 47c5d82017 some more stuffs 2023-06-07 19:04:01 -07:00
Jake Potrebic 1eba407610 finished some more patches 2023-06-07 18:13:54 -07:00
Jake Potrebic 236eabd751 some more patches 2023-06-07 17:54:54 -07:00
Jake Potrebic c13b259ff2 fix compile errors 2023-06-07 17:30:05 -07:00
Jake Potrebic ac1a626493 45 more patches 2023-06-07 16:56:33 -07:00
Jake Potrebic 0ca9f14d58 finish some more patches 2023-06-07 16:44:11 -07:00
Noah van der Aa b1a2378144 1.20: Fix a bunch of compile issues (#9273) 2023-06-07 16:21:20 -07:00
Jake Potrebic f0889559f3 even moaaar patches 2023-06-07 16:20:26 -07:00
Jake Potrebic c31a22c563 even moar patches 2023-06-07 15:58:10 -07:00
Jake Potrebic 44e22b45a5 more patches 2023-06-07 15:41:25 -07:00
Jake Potrebic 0b8147f68e fix a bunch of compile errors 2023-06-07 15:28:06 -07:00
Jake Potrebic 8f7a7ec440 more work and compile fixes 2023-06-07 15:12:41 -07:00
Jake Potrebic e09a44e169 fix some compile issues 2023-06-07 14:46:56 -07:00
Nassim Jahnke 3c8e176265 Some compile fixes 2023-06-07 23:37:08 +02:00
Nassim Jahnke 838d8afd76 More more more more more more more more work 2023-06-07 23:18:26 +02:00
Nassim Jahnke c1f313b273 More more more more more more more work 2023-06-07 22:41:26 +02:00
Nassim Jahnke 7f384988cd More more more more more more work 2023-06-07 22:19:14 +02:00
Nassim Jahnke 3fed7289ed More more more more more work 2023-06-07 21:54:11 +02:00
Noah van der Aa 94aa4b518a Fix API compile issues (#9269) 2023-06-07 21:47:39 +02:00
Nassim Jahnke 0ed49782c5 More more more more work 2023-06-07 21:37:42 +02:00
Nassim Jahnke 474a02835d More more more work 2023-06-07 21:21:43 +02:00
Nassim Jahnke 01f5831171 More more work 2023-06-07 20:49:17 +02:00
Nassim Jahnke 197786ead0 More more work 2023-06-07 20:31:32 +02:00
Nassim Jahnke c1bbde4bc6 Let's hope this is fine 2023-06-07 20:08:03 +02:00
Nassim Jahnke 3fbb00319f More work 2023-06-07 19:18:05 +02:00
Nassim Jahnke 965cf53cd5 Start working on 1.20 2023-06-07 19:06:55 +02:00
Owen bc4a6647c9 Paper Plugins Dependency Format Update (#9160)
* Rework dependency management (WIP)

* Revert "Rework dependency management (WIP)"

This reverts commit e046cd59c68743dc00303b1ab42317bf474abd6a.

* Correctly add soft dependencies to the dependency tree for classloading resolution

* Add support for new dependency config format

* Rebase

* swap load order meaning

* Dependencies should be required by default
2023-06-07 08:41:25 -07:00
Jake Potrebic 175a774247 [ci skip] Use a separate interface for bootstrapping (#9267) 2023-06-07 08:29:28 -07:00
Jake Potrebic 14cfd64d2d Schedule several things for removal in 1.21 (#9041) 2023-06-07 15:47:32 +02:00
Nassim Jahnke d8e07590e3 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
5dbedae1 PR-864: Fix Registry#match() failing namespaced inputs
49256865 PR-863: Fix boolean PersistentDataType
9f15450b SPIGOT-7195, SPIGOT-7197: Add DataPack API
ebef5b6a Disable InterfaceIsType Checkstyle check
01d577f5 Slight tweak to boolean PersistentDataType javadoc
d2b99e56 PR-857: Add boolean PersistentDataType

CraftBukkit Changes:
2270366cd PR-1196: Test Registry instances more thoroughly
863dacb7a PR-1191: Do not start on pre-release Java 17
1f2dd8e12 SPIGOT-7362: Properly handle null in CraftBlock#blockFaceToNotch()
dbc70bed5 SPIGOT-7195, SPIGOT-7197: Add DataPack API
2023-06-06 11:09:19 +02:00
Malfrador 956062a5d5 Add transient modifiers (#9244)
This allows adding modifiers as transient. Transient modifiers don't get saved with the NBT data.
Vanilla itself uses transient modifiers for speed modifications like sprinting or powder snow. This just exposes it in the API.
2023-06-05 13:15:18 -04:00
Jake Potrebic d8d3bd70b0 [ci skip] Add missing deprecations for legacy MaterialData api (#9253) 2023-06-03 11:09:43 -07:00
Jake Potrebic 8a18fc55ab [ci skip] add 'needs triage' label to invalid on issue close (#9252) 2023-06-03 10:43:38 -07:00
Jake Potrebic bacbf86ed2 Fixes and additions to projectile API (#9237) 2023-05-31 19:43:51 -07:00
Jake Potrebic 2eda177116 Expand PlayerItemMendEvent (#7382) 2023-05-31 16:58:25 -07:00
Jake Potrebic ea0b63992c Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9228)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
4727d326 Don't let Sign extend SignSide, mark API as experimental
9b29bdcc PR-845: Add preliminary support for multi sided signs

CraftBukkit Changes:
b346a5f6d PR-1170: Add preliminary support for multi sided signs
86c816189 Update SQLite version
d9324b4bc Fix addition of custom smithing trim / transform recipes

Spigot Changes:
7d7b241e Rebuild patches
2023-05-31 16:36:57 -07:00
Jake Potrebic fa8fa1ce08 Fix playing adventure sounds on World/Server (#8077) 2023-05-30 18:36:16 -07:00
Lulu13022002 0f91091ccc Re-implement the compost events (#9192) 2023-05-30 18:07:04 -07:00
Spottedleaf f9f90791e4 Pull a few Folia patches 2023-05-27 20:34:33 +02:00
Nassim Jahnke 90a0835f43 Fix incremental player saving patch 2023-05-27 20:14:04 +02:00
Lulu13022002 bcd8dc2c11 Use the spigot config for mangrove propagule / torchflower growth (#8597) 2023-05-15 14:25:38 -04:00
Lulu13022002 b6817605ce Fix note block sound property on player heads (#9158) 2023-05-15 13:32:26 -04:00
Warrior a61b4845f2 Fix MC-224454 (#9195) 2023-05-15 11:33:15 -04:00
Warrior 4ba5aacc37 More accurate isInOpenWater impl (#9194) 2023-05-15 11:21:57 -04:00
Lulu13022002 5b66d33a77 Call EntityChangeBlockEvent for frogs egg (#9213) 2023-05-15 12:56:12 +02:00
Owen f8603a46a8 Avoid Lazy Initialization for Enum Fields (#9210) 2023-05-14 20:46:17 -04:00
Noah van der Aa 57fdc668fa Undeprecate Server#getMap (#9185)
The only way to get a map is via its id, which is not a magic value. This implementation isn't going to be changing anytime soon, so it should be undeprecated.
2023-05-14 20:23:57 -04:00
Jake Potrebic ab7bc3fb34 Remove javadoc that doesn't apply to Paper (#9206) 2023-05-14 19:20:43 -04:00
booky10 9daa019d6c Added wither vanilla invulnerability API (#9124) 2023-05-12 15:24:50 -05:00
Redned 1edfefdef8 Add option to flush region files on save (#9149) 2023-05-12 15:07:24 -05:00
Nassim Jahnke efd47e3a68 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9188)
* Updated Upstream (Bukkit/CraftBukkit/Spigot)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
2fcba9b2 SPIGOT-7347: Add missing documentation and details to ShapedRecipe
c278419d PR-854: Move getHighestBlockYAt methods from World to RegionAccessor
201399fb PR-853: Add API for directly setting Display transformation matrices
ecfa559a PR-849: Add InventoryView#setTitle
653d7edb SPIGOT-519: Add TNTPrimeEvent
22fccc09 PR-846: Add method to get chunk load level
a070a52c PR-844: Add methods to convert Vector to and from JOML vectors
cc7111fe PR-276: Add accessors to Wither's invulnerability ticks
777d24e9 SPIGOT-7209: Accessors and events for player's exp cooldown
ccb2d01b SPIGOT-6308: Deprecate the location name property of map items
cd04a31b PR-780: Add PlayerSpawnChangeEvent
7d1f5b64 SPIGOT-6780: Improve documentation for World#spawnFallingBlock
5696668a SPIGOT-6885: Add test and easier to debug code for reference in yaml configuration comments
2e13cff7 PR-589: Expand the FishHook API
2c7d3da5 PR-279: Minor edits to various Javadocs

CraftBukkit Changes:
01b2e1af4 SPIGOT-7346: Disallow players from executing commands after disconnecting
7fe5ee022 PR-1186: Move getHighestBlockYAt methods from World to RegionAccessor
bcc85ef67 PR-1185: Add API for directly setting Display transformation matrices
a7cfc778f PR-1176: Add InventoryView#setTitle
563d42226 SPIGOT-519: Add TNTPrimeEvent
ccbc6abca Add test for Chunk.LoadLevel mirroring
2926e0513 PR-1171: Add method to get chunk load level
63cad7f84 PR-375: Add accessors to Wither's invulnerability ticks
bfd8b1ac8 SPIGOT-7209: Accessors and events for player's exp cooldown
f92a41c39 PR-1181: Consolidate Location conversion code
10f866759 SPIGOT-6308: Deprecate the location name property of map items
82f7b658a PR-1095: Add PlayerSpawnChangeEvent
b421af7e4 PR-808: Expand the FishHook API
598ad7b3f Increase outdated build delay

Spigot Changes:
d1bd3bd2 Rebuild patches
e4265cc8 SPIGOT-7297: Entity Tracking Range option for Display entities

* Work around javac bug

* Call PlayerSpawnChangeEvent

* Updated Upstream (Bukkit/CraftBukkit/Spigot)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
2fcba9b2 SPIGOT-7347: Add missing documentation and details to ShapedRecipe
c278419d PR-854: Move getHighestBlockYAt methods from World to RegionAccessor
201399fb PR-853: Add API for directly setting Display transformation matrices

CraftBukkit Changes:
01b2e1af4 SPIGOT-7346: Disallow players from executing commands after disconnecting
7fe5ee022 PR-1186: Move getHighestBlockYAt methods from World to RegionAccessor
bcc85ef67 PR-1185: Add API for directly setting Display transformation matrices

Spigot Changes:
7da74dae Rebuild patches
2023-05-12 13:10:08 +02:00
Warrior 688409279f Fix lightning being able to hit spectators (#9193) 2023-05-08 16:17:00 +02:00
Bjarne Koll 1d4c7806ff Fix BlockPosition#offset(double,double,double) (#9190) 2023-05-07 14:14:34 +02:00
Nassim Jahnke 813d0399f9 Make sure the player didn't disconnect when processing commands 2023-05-06 17:10:22 +02:00
Lulu13022002 9846d0d89e Fix some NPE for EntityCompostItemEvent (#9169) 2023-05-03 12:07:51 +01:00
Pedro 83da4b6101 Fix DamageSource for Falling Blocks (#9175) 2023-05-03 11:50:59 +01:00
Spottedleaf 4f9575eed8 Break redstone on top of trap doors early
This logic hooks into the neighbour update which should be invoked
as a result of redstone powering the trap door.
2023-05-01 18:32:30 -07:00
Lukas AltandShane Freeder bcec5b11e6 Fixed large packet handling (#9147)
Co-authored-by: Shane Freeder <theboyetronic@gmail.com>
2023-04-27 19:50:14 +01:00
GodOfPro f4ce997a42 Add Mob Experience reward API (#9122) 2023-04-27 19:49:19 +01:00
Jason 2cccbbe1f4 [ci skip] Update Gradle plugins and wrapper (#9140) 2023-04-26 10:07:13 -07:00
Owen 936205beae Disable allowListing before received from client (#9167) 2023-04-23 21:24:12 -04:00
Owen 5c4671a9bf Fix LegacyPluginLoader dependency registration (#9165) 2023-04-23 02:55:10 +01:00
Owen 8e3009e0db Resolve Plugin Dependency Issues, Improve PluginLoading Compat, Small Loading Issues (#9129) 2023-04-22 12:44:40 -05:00
Jakub Zacek f7717c3712 Fix server ignoring fallback for translatable components (#9134) 2023-04-20 08:05:41 +01:00
Emily beed22d336 Undo making JavaPlugin#logger field public (#9125) 2023-04-19 16:46:09 +01:00
Luke Chambers dd216c1f09 Fix Inconsistencies with Paper Plugin Names (#9098) 2023-04-16 11:49:13 -05:00
Jake Potrebic 6d2121efde Removes some references to deprecated methods/types (#9043) 2023-04-15 18:13:59 -07:00
Warrior 23a443eeaa Fix demo flag not enabling demo mode (#9103) 2023-04-15 18:30:23 -05:00
Shane Freeder 8d040fad9b Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
465c4964 PR-843: Add damage methods to FallingBlock
46ba7c9f SPIGOT-7335: Fix typo in TextDisplay#TextAlignment enum name

CraftBukkit Changes:
818582f40 PR-1169: Add damage methods to FallingBlock
15a3eac66 SPIGOT-7335: Fix typo in TextDisplay#TextAlignment enum name
f01fb4979 SPIGOT-7336: Fix typo in internal method name
2023-04-14 00:52:42 +01:00
Matt Artist bd35d605e8 [ci-skip] Fix missing closing quote (#9126) 2023-04-11 17:57:56 -07:00
DungeonDev e338793603 Optimize hoppers by not trying to merge full items. (#9110)
This can skip many very expensive call to ItemStack.tagMatches.
Makes canMergeItems return false for merging into ItemStacks that are already full.
2023-04-11 15:35:54 +02:00
Jake Potrebic 5ffdff8822 Fix a couple of bed bugs (#9112) 2023-04-10 15:12:22 -07:00
Shane Freeder e811927394 Revert "Resolve Plugin Dependency Issues, Improve PluginLoading Compat, Small Loading Issues (#9068)"
This reverts commit f8d2f823db.
2023-04-10 11:25:04 +01:00
Redned 8be7a60b76 Fix getBrightness and getRawBrightness throwing exception in BlockStateListPopulator (#9111) 2023-04-10 10:06:49 +02:00
caramel ab72b123ec Update Adventure to 4.13.1 (#9113) 2023-04-10 10:06:38 +02:00
Nassim Jahnke 058d7c1aa3 Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
13eb4146 SPIGOT-5217, SPIGOT-6183: Add RespawnReason to PlayerRespawnEvent

CraftBukkit Changes:
5ee3419b7 SPIGOT-5217, SPIGOT-6183: Add RespawnReason to PlayerRespawnEvent

Spigot Changes:
514cf03a Rebuild patches and add RespawnReason.PLUGIN to Player#respawn
2023-04-10 10:03:36 +02:00
Shane Freeder b626528da0 Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
de5ba402 PR-848: Mark get/setCatType methods deprecated in addition to the enum

CraftBukkit Changes:
50ee87fbc SPIGOT-7333: Correctly handle null in ColorableArmorMeta#setColor()
790be710b SPIGOT-7332: Persistent Data Container of Chunk not saving on stop or restart.
2023-04-09 23:38:03 +01:00
Owen f8d2f823db Resolve Plugin Dependency Issues, Improve PluginLoading Compat, Small Loading Issues (#9068) 2023-04-09 23:28:30 +01:00
Jake Potrebic 6a7fef0e4a Allow entity effect changes off the main thread for worldgen (#8942)
* Allow entity effect modification off the main thread for worldgen

* squash all async catcher patches
2023-04-09 11:38:32 -07:00
Jake Potrebic f8c01122e6 [ci skip] add missing labels to project status map (#9106) 2023-04-09 09:00:43 +02:00
Shane Freeder 9cda28480e Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
aeb62aa3 Remove obsolete documentation from ArmorMeta#setTrim

CraftBukkit Changes:
cb6f3c028 PR-1173: Change CraftMinecartTNT to public for consistency
2023-04-09 01:13:38 +01:00
Jake Potrebic b5ce6e3dc5 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9104)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
eb4b416d PR-822: Add experimental armor trim API
33498e1d PR-831: Add a standard of annotations for Minecraft experimental things and API

CraftBukkit Changes:
19de3550d SPIGOT-7315: Bed placement duplicates crops if cancelled
1eb88374e PR-1147: Add experimental armor trim API
c4c0bb0e9 Show clean error for invalidly configured server.properties options
3ae90697f Fix UUID not being updated when changing world of MapView
e43000601 PR-1164, MC-227255, MC-253819: Fix rotation of beehives and bells

Spigot Changes:
d2fdfe39 Rebuild patches
2023-04-09 01:00:50 +01:00
Jake Potrebic 29b17a892d Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9088)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
5efeb7bd Also update compiler version
c13b867a Update some Maven plugin versions
deb28d9f PR-837: Add more bell API
e938d62a PR-819: Allow Player#sendBlockDamage() to specify a source entity
0e75532c PR-818: Add more Guardian API, particularly for its laser
a10155aa PR-839: Add BlockData#rotate and BlockData#mirror
77e690b4 PR-836: Add missing API for explosive minecarts
60722059 PR-832: Allow getting chunks without generating them and optimize chunk data request for ungenerated chunks
0a2c4b4b PR-834: Add Player#sendHurtAnimation()

CraftBukkit Changes:
be8682aa8 Also update compiler version
08e305f5b Update some Maven plugin versions
187bdd463 PR-1160: Add more bell API
2f8e5bc7c PR-1145: Allow Player#sendBlockDamage() to specify a source entity
bcbb61b36 PR-1144: Add more Guardian API, particularly for its laser
722ddff6d PR-1162: Add BlockData#rotate and BlockData#mirror
80998277c PR-1159: Add missing API for explosive minecarts
1fddefce1 PR-1155: Allow getting chunks without generating them and optimize chunk data request for ungenerated chunks
20e8a486f PR-1157: Add Player#sendHurtAnimation()

Spigot Changes:
b31949f2 Rebuild patches
2023-04-07 19:39:13 +01:00
Jake Potrebic ad6c14c62e Fix unknown cmd msg for mc namespaced cmds (#9059) 2023-04-06 19:27:41 -05:00
Alex e9f6e7ae8a Properly resync player on Player#setPlayerProfile (#9080)
Currently breaking are potion effects and the XP bar, both are now being resent to make the client know about them again.
2023-04-06 18:21:33 -05:00
Shane FreederandOwen1212055 f5677aa472 Fix TPS command output (#9091)
* Fix TPS command output

* Cleanup + rebase

---------

Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
2023-04-06 18:08:44 -05:00
Lulu13022002 3c8c22323f Fix some broken block place logic (#9094)
- The dispensed shulker will not play the place sound (due to its logic been removed)
- The hanging sign text editor cannot be cancelled using the BlockPlaceEvent (not consistent with the other regular signs)
- The jukebox logic hasn't been synced with the RecordItem
2023-04-06 17:39:32 -05:00
Jake Potrebic dab4864a11 [ci skip] add workflow for auto-managing issue board (#8958)
* add workflow for auto-managing issue board

* make concurrency depend on the issue number

* generate token in the action
2023-04-06 14:19:06 -07:00
Warrior 9b77660f07 Port airplane's use array for gamerule storage patch (#9087) 2023-04-06 14:18:45 +02:00
Shane Freeder 9367e6e6b3 Prevent GameEvents being fired from unloaded chunks 2023-04-06 12:42:10 +01:00
BlockyTheDev e6ef1bae88 [ci skip] Update download urls (#9100) 2023-04-04 17:06:59 -07:00
Harry Devane 497b91939c Fix ignoreCancelled having no effect on events registered by direct EventExecutor (#9099) 2023-04-04 22:40:31 +01:00
Lulu13022002 641dafd0a8 Cleanup some patches (#9093) 2023-04-04 11:47:16 +02:00
Shane Freeder 08491449ae Do not send expired keys to players on login (#9090)
This patch will prevent sending expired keys to players when logging into a server, while the client does have some grace period to prevent issues, if a key has expired beyond the grace period, connecting clients will be disconnected from the server upon join. The client should update keys before this key even expires, and a new key will be broadcasted out if we somehow actually get one.
2023-04-03 10:45:02 +01:00
Jake Potrebic 9893e2b734 Deprecate ChatColor (#9069)
All API that uses it is deprecated
2023-04-02 11:53:29 -07:00
elmital 1d2fe64da8 fix: null SpawnReason for new player (#9015) 2023-04-02 13:37:53 -05:00
Cody 50e683de14 Added a config option for ticking markers (#9034) 2023-04-02 13:21:13 -05:00
Jake Potrebic dc08c74cb3 Remove duplicate animate packet for records (#8600) 2023-04-02 13:05:30 -05:00
Owen 5fb3ab0109 Allow non player entities in scoreboards by default (#9082)
This in general caused much more confusion than needed, and in general, made rather negligible performance gains on collision.
2023-04-02 12:53:11 -05:00
Fejby 1704bf782e [ci skip] Edit Paper download link in README (#9077) 2023-03-31 18:25:50 +02:00
powercas_gamer 7a96bf2095 Make debug dump file names consistent (#9075) 2023-03-31 13:17:57 +02:00
Shane Freeder 11ab383e4f Don't use plugin-profiling to enable timings
The paper config has taken precidence over this for a long time
with 0 complaints, and now it's tripping the deprecation warning,
even if timings is disabled in the paper config.
2023-03-31 05:47:59 +01:00
Lulu13022002 06fdc02537 [ci skip] Correct upstream/paper javadoc (#8286) 2023-03-30 21:09:13 -07:00
Nassim Jahnke bf92f3e4db Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
9153f77e PR-841: Remove incorrect ClickType.CONTROL_DROP from ClickType#isShiftClick
bceda6ab PR-840: Adjust annotations in Display entity interface
a6b85ac3 PR-835: Add Jukebox#hasRecord() and #startPlaying(), clarify #setRecord()

CraftBukkit Changes:
e142fb9fd SPIGOT-7188: ChunkSnapshot biome y coordinate doesn't match chunk biome y coord
eff1743b9 SPIGOT-7313: More accurately edit data on Jukeboxes
2023-03-30 15:40:15 +02:00
Riley Park cbcdfd03e7 Make other link in deprecation message clickable too 2023-03-29 19:35:26 -07:00
Jake Potrebic ef5fa90932 Fix crash relating to bad recipes in furnace-like tile entities (#9011) 2023-03-30 03:29:38 +01:00
Riley Park a13759afcc Turn deprecation message into a Component to be used in the command at a later date 2023-03-29 19:15:21 -07:00
Riley Park 32875b429a 8948: Nag when timings is enabled or a plugin creates a new Timing 2023-03-29 12:30:37 -07:00
Jake Potrebic 5c78e77da5 Fix api checking banned ips (#9026) 2023-03-27 20:23:34 -07:00
Nassim Jahnke 9940019ff8 Deprecate public Timings classes for removal (#8949) 2023-03-27 19:58:46 -07:00
Ryan ce2a36dbd6 Fix PluginMeta#getDisplayName (#9038)
* fix plugin versioning

* fix properly

* fix version command

* ngl idk where my logic was behind this
2023-03-27 19:56:09 -07:00
Jason bd62f2c2dd Fix chat messages being logged without formatting to console (#9058) 2023-03-27 10:19:23 -07:00
Jake Potrebic fbf74ba0ac Updated Upstream (CraftBukkit) (#9053)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
f92c94517 SPIGOT-7310: PlayerToggleSneakEvent is not called when a player sneaks while riding an entity
b5714184d SPIGOT-7316: Cancelling EntityUnmountEvent does not stop the all effects of the unmounting
e237f8c88 SPIGOT-7312: Entity#setVisibleByDefault on player causes skin reset on this player client
2023-03-26 13:29:41 -07:00
Jake Potrebic a622ebacd4 Fix beehives generating from using bonemeal (#9052) 2023-03-26 12:07:32 -07:00
Emily d5abb94e69 Expose Path to jar file in PluginProviderContext (#9030)
* Expose Path to jar file in PluginProviderContext

* rename accessor, reword jd
2023-03-24 23:30:48 -07:00
Jake Potrebic 38be4f873b Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9018)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
2c64d8c4 SPIGOT-7309: Add API for jukebox inventories
a6d7e4ca PR-826: Add Sniffer API

CraftBukkit Changes:
93813509b SPIGOT-7309: Add API for jukebox inventories
2d5209e8d PR-1153: Handle teleport reason in spreadplayers command
f5b61387e SPIGOT-7308: Fix NullPointerException when calling Jukebox#setRecord()
388d458a6 SPIGOT-7306: Fix reset of coords in default teleportTo in EntityPlayer
40b87e1af PR-1150: Add Sniffer API and handle EntityItemDropEvent

Spigot Changes:
6ad4b93c SPIGOT-7298: Fix debug stick always permission left click toggle
2023-03-24 13:38:40 -07:00
Jake Potrebic a0f548f5ec Don't warn for deprecated PrepareGrindstoneEvent (#9036) 2023-03-24 13:19:17 -07:00
Jake Potrebic 23b0ef524a [ci skip] rebuild patches 2023-03-23 14:57:03 -07:00
Riley Park 9087a644a3 chore: cleanup annotations in api adventure patch 2023-03-23 10:51:08 -07:00
Nassim Jahnke 92f872c146 Fix bad diff in wandering trader spawn rate patch from .4 update 2023-03-23 14:35:17 +01:00
Jake Potrebic e8b82590d0 [ci skip] Properly document firing of Entity/BlockExplodeEvent (#9014) 2023-03-20 02:11:23 -07:00
Jake Potrebic 7af4cd3647 Updated Upstream (Bukkit/CraftBukkit) (#9013)
* Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
150a2861 PR-827: Add BlockData#getPlacementMaterial
58c9c8ce SPIGOT-7301: Prevent creating non-openable inventories
3741079b PR-824: Expand upon PotionEffect API to better accommodate infinite durations

CraftBukkit Changes:
e5a7921f0 PR-1149: Add BlockData#getPlacementMaterial
58504fa61 SPIGOT-7302: Fix more issues with EntityDamageByEntity - Fix Projectile damage by dispenser - Fix cases where only exists a direct entity damager
48394703d Increase outdated build delay

* Improve docs for BlockData#getPlacementMaterial
2023-03-20 01:47:10 -07:00
Jake Potrebic c7520ec49d Use class loggers without the fqn for non-debug logging (#9012) 2023-03-20 09:23:52 +01:00
JOO200 ff603cb76d adventure: make calls with generic component lists more usable (#9008)
This should allow the usage of ItemStack#lore and other methods with a List<TextComponent>
2023-03-20 09:18:06 +01:00
Jake Potrebic 7929540ba3 update paperclip to 3.0.3 2023-03-19 22:18:33 -07:00
Jake Potrebic 83948f6f59 Fire reload event after everything has been reloaded (#9003)
This event is going to be more important very shortly (hopefully)
2023-03-19 12:28:28 -07:00
2413 changed files with 117490 additions and 94907 deletions

No files matched your search

+19
View File
@@ -4,6 +4,10 @@ end_of_line=lf
insert_final_newline=true
indent_style=space
indent_size=4
ij_any_block_comment_add_space = false
ij_any_block_comment_at_first_column = false
ij_any_line_comment_at_first_column = false
ij_any_line_comment_add_space = true
[*.tiny]
indent_style=tab
@@ -16,3 +20,18 @@ indent_size=2
[*.patch]
trim_trailing_whitespace=false
[*.java]
ij_continuation_indent_size = 4
ij_java_class_count_to_use_import_on_demand = 999999
ij_java_insert_inner_class_imports = false
ij_java_names_count_to_use_import_on_demand = 999999
ij_java_imports_layout = *,|,$*
ij_java_generate_final_locals = true
ij_java_generate_final_parameters = true
[test-plugin/**/*.java]
ij_java_use_fq_class_names = false
[Paper-Server/src/main/resources/data/**/*.json]
indent_size = 2
+1 -1
View File
@@ -1,4 +1,4 @@
* text=auto
* text=auto eol=lf
*.sh text eol=lf
gradlew text eol=lf
@@ -68,7 +68,7 @@ body:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads).
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. You searched for and ensured there isn't already an open issue regarding this.
3. Your version of Minecraft is supported by Paper.
@@ -79,6 +79,6 @@ body:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads).
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. You searched for and ensured there isn't already an open issue regarding this.
3. Your version of Minecraft is supported by Paper.
@@ -68,7 +68,7 @@ body:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads).
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. Your version of Minecraft is supported by Paper.
If your server crash log contains `DO NOT REPORT THIS TO PAPER`, please ask in our
+4 -1
View File
@@ -26,10 +26,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: JDK ${{ matrix.java }}
uses: actions/setup-java@v3.6.0
uses: actions/setup-java@v3.11.0
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
+78
View File
@@ -0,0 +1,78 @@
name: Update Projects
on:
issues:
types:
- labeled
- unlabeled
- closed
- reopened
jobs:
bugs:
if: "github.event_name == 'issues' && contains(github.event.*.labels.*.name, 'type: bug')"
concurrency:
group: update-bugs-project-${{ github.event.issue.number }}
cancel-in-progress: true
runs-on: ubuntu-latest
steps:
- name: "authenticate"
id: "authenticate"
uses: "tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92" # v1
with:
app_id: "${{ secrets.PROJECTS_APP_ID }}"
installation_id: "36153445"
private_key: "${{ secrets.PROJECTS_PRIVATE_KEY }}"
- uses: PaperMC/update-projects-action@v0.2.0
name: Update open issue
if: github.event.issue.state == 'open'
with:
github-token: "${{ steps.authenticate.outputs.token }}"
project-url: https://github.com/orgs/PaperMC/projects/5/views/2
column-field: Status
label-to-column-map: |
{
"status: needs triage": "🕑 Needs Triage",
"status: accepted": "✅ Accepted",
"status: unlikely": "✅ Accepted",
"status: in progress": "Needs Work",
"status: rebase required": "Needs Work",
"status: blocked": "Needs Work",
"status: defer upstream": "Needs Work",
"status: input wanted": "Needs Work",
"we must go deeper": "Needs Work",
"has rough edges": "Needs Work",
"status: waiting on reporter": "⌛ Waiting for Reporter",
"resolution: works-as-intended": "Invalid",
"resolution: invalid": "Invalid",
"resolution: wontfix": "Invalid",
"resolution: duplicate": "Invalid",
"resolution: cannot reproduce": "Invalid",
"resolution: unsupported": "Invalid",
"resolution: incomplete": "Invalid",
"resolution: superseded": "Invalid"
}
- uses: PaperMC/update-projects-action@v0.2.0
name: Update closed issue
if: github.event.issue.state == 'closed'
with:
github-token: "${{ steps.authenticate.outputs.token }}"
project-url: https://github.com/orgs/PaperMC/projects/5/views/2
column-field: Status
clear-on-no-match: false
# include "status: needs triage" below to catch any closed issues without setting a resolution
label-to-column-map: |
{
"status: accepted": "Done",
"status: needs triage": "Invalid",
"resolution: works-as-intended": "Invalid",
"resolution: invalid": "Invalid",
"resolution: wontfix": "Invalid",
"resolution: duplicate": "Invalid",
"resolution: cannot reproduce": "Invalid",
"resolution: unsupported": "Invalid",
"resolution: incomplete": "Invalid",
"resolution: superseded": "Invalid"
}
+1 -1
View File
@@ -478,4 +478,4 @@ everything like usual.
> in Windows like described here:
> <https://docs.microsoft.com/en-us/windows/wsl/filesystems#view-your-current-directory-in-windows-file-explorer>
[MappingViewer]: https://nms.screamingsandals.org/
[MappingViewer]: https://mappings.cephx.dev/
+8
View File
@@ -55,4 +55,12 @@ TheFruxz <cedricspitzer@outlook.de>
Kieran Wallbanks <kieran.wallbanks@gmail.com>
Denery <dorofeevij@gmail.com>
Jakubk15 <jakubk15@protonmail.com>
Redned <redned235@gmail.com>
Luke Chambers <consolelogluke@gmail.com>
Emily <emilia.lopezf.1999@gmail.com>
dawon <dawon@dawon.eu>
Ollie <69084614+olijeffers0n@users.noreply.github.com>
Oliwier Miodun <naczs@blueflow.pl>
aerulion <aerulion@gmail.com>
Lukas Planz <lukas.planz@web.de>
```
+18 -19
View File
@@ -4,48 +4,47 @@ Paper [![Paper Build Status](https://img.shields.io/github/actions/workflow/stat
[![Open Collective](https://img.shields.io/opencollective/all/papermc?label=OpenCollective%20Sponsors)](https://opencollective.com/papermc)
===========
High-performance Spigot fork that aims to fix gameplay and mechanics inconsistencies.
The most widely used, high-performance Minecraft server that aims to fix gameplay and mechanics inconsistencies.
**Support and Project Discussion:**
- [Our forums](https://forums.papermc.io/), [Discord](https://discord.gg/papermc), or [IRC](https://webchat.esper.net/?channels=paper)
- [Our forums](https://forums.papermc.io/), [Discord](https://discord.gg/papermc), or [IRC](https://webchat.esper.net/?channels=paper)
How To (Server Admins)
------
Paperclip is a jar file that you can download and run just like a normal jar file.
Download Paper from our [downloads page](https://papermc.io/downloads).
Download Paper from our [downloads page](https://papermc.io/downloads/paper).
Run the Paperclip jar directly from your server. Just like old times
* Documentation on using Paper: [docs.papermc.io](https://docs.papermc.io)
* For a sneak peek at upcoming features, [see here](https://github.com/PaperMC/Paper/projects)
* Documentation on using Paper: [docs.papermc.io](https://docs.papermc.io)
* For a sneak peek at upcoming features, [see here](https://github.com/PaperMC/Paper/projects)
How To (Plugin Developers)
------
* See our API patches [here](patches/api)
* See upcoming, pending, and recently added API [here](https://github.com/PaperMC/Paper/projects/6)
* Paper API javadocs here: [papermc.io/javadocs](https://papermc.io/javadocs/)
* Maven Repo (for paper-api):
* See our API patches [here](patches/api)
* See upcoming, pending, and recently added API [here](https://github.com/orgs/PaperMC/projects/2/views/4)
* Paper API javadocs here: [papermc.io/javadocs](https://papermc.io/javadocs/)
#### Repository (for paper-api)
##### Maven
```xml
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
```
* Artifact Information:
```xml
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.19.4-R0.1-SNAPSHOT</version>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
**Or alternatively, with Gradle:**
* Repository:
```
##### Gradle
```kotlin
repositories {
maven {
@@ -54,7 +53,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT")
}
java {
@@ -76,9 +75,9 @@ See [Contributing](CONTRIBUTING.md)
Support Us
------
First of all, thank you for considering helping out, we really appreciate that!
First of all, thank you for considering helping out, we really appreciate that!
PaperMC has various recurring expenses, mostly related to infrastructure. Paper uses [Open Collective](https://opencollective.com/) via the [Open Source Collective fiscal host](https://opencollective.com/opensource) to manage expenses. Open Collective allows us to be extremely transparent, so you can always see how your donations are used. You can read more about financially supporting PaperMC [on our website](https://papermc.io/sponsors).
PaperMC has various recurring expenses, mostly related to infrastructure. Paper uses [Open Collective](https://opencollective.com/) via the [Open Source Collective fiscal host](https://opencollective.com/opensource) to manage expenses. Open Collective allows us to be extremely transparent, so you can always see how your donations are used. You can read more about financially supporting PaperMC [on our website](https://papermc.io/sponsors).
You can find our collective [here](https://opencollective.com/papermc), or you can donate via GitHub Sponsors [here](https://github.com/sponsors/PaperMC), which will also go towards the collective.
+4
View File
@@ -8,4 +8,8 @@
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
# To import minecraft data files, like the default chat type, use `mc_data` as the prefix:
# mc_data chat_type/chat.json
# mc_data dimension_type/overworld.json
#
+4
View File
@@ -12,3 +12,7 @@ public net.minecraft.server.MinecraftServer doRunTask(Lnet/minecraft/server/Tick
# AT remap issue? todo 1.18
public net.minecraft.world.level.dimension.end.EndDragonFight findExitPortal()Lnet/minecraft/world/level/block/state/pattern/BlockPattern$BlockPatternMatch;
public net.minecraft.nbt.TagParser readArrayTag()Lnet/minecraft/nbt/Tag;
# TODO 1.20 remapSpigotAt.at doesn't remap the return type for this method for some reason
public net/minecraft/world/entity/Display$TextDisplay getText()Lnet/minecraft/network/chat/Component;
public net/minecraft/world/entity/Display$BlockDisplay getBlockState()Lnet/minecraft/world/level/block/state/BlockState;
+3 -10
View File
@@ -14,22 +14,15 @@ tiny 2 0 mojang+yarn spigot
# CraftBukkit changes type
c net/minecraft/server/level/ServerLevel net/minecraft/server/level/WorldServer
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData J
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData K
c net/minecraft/world/level/chunk/LevelChunk net/minecraft/world/level/chunk/Chunk
f Lnet/minecraft/server/level/ServerLevel; level q
f Lnet/minecraft/server/level/ServerLevel; level r
# See mappings-patch.tiny
c net/minecraft/server/level/ChunkMap net/minecraft/server/level/PlayerChunkMap
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager G
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager F
# Paper changes type
c net/minecraft/core/MappedRegistry net/minecraft/core/RegistryMaterials
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId e
# upstream makes a bunch of methods public that cause accidental overrides now
c net/minecraft/world/entity/Display net/minecraft/world/entity/Display
m ()I getInterpolationDelay getInterpolationDelay_
m (I)V setInterpolationDelay setInterpolationDelay_
m (I)V setInterpolationDuration setInterpolationDuration_
+12 -7
View File
@@ -4,8 +4,8 @@ import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.0" apply false
id("io.papermc.paperweight.core") version "1.5.3"
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.core") version "1.5.9"
}
allprojects {
@@ -61,11 +61,11 @@ repositories {
}
dependencies {
paramMappings("net.fabricmc:yarn:1.19.4+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
paramMappings("net.fabricmc:yarn:1.20.2+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.8.10:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6")
paperclip("io.papermc:paperclip:3.0.2")
paperclip("io.papermc:paperclip:3.0.3")
}
paperweight {
@@ -131,10 +131,15 @@ allprojects {
}
}
// Uncomment while updating for a new Minecraft version
/*
tasks.collectAtsFromPatches {
// Uncomment while updating for a new Minecraft version
// extraPatchDir.set(layout.projectDirectory.dir("patches/unapplied/server"))
extraPatchDir.set(layout.projectDirectory.dir("patches/unapplied/server"))
}
tasks.withType<io.papermc.paperweight.tasks.RebuildGitPatches> {
filterPatches.set(false)
}
*/
tasks.register("printMinecraftVersion") {
doLast {
+2 -2
View File
@@ -1,6 +1,6 @@
group=io.papermc.paper
version=1.19.4-R0.1-SNAPSHOT
mcVersion=1.19.4
version=1.20.2-R0.1-SNAPSHOT
mcVersion=1.20.2
org.gradle.caching=true
org.gradle.parallel=true
Binary file not shown.
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+10 -5
View File
@@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
@@ -197,6 +198,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
@@ -27,10 +27,10 @@ index 11038da2e071699d6561a331565db0c8d7850d0e..317acfec5894101294a55abff6181943
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..17e8858e01d80c422947f507e9d77b7532788752
index 0000000000000000000000000000000000000000..41e77b687df6480adf8f5e21daad105dab208df2
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,82 @@
@@ -0,0 +1,91 @@
+plugins {
+ `java-library`
+ `maven-publish`
@@ -41,26 +41,30 @@ index 0000000000000000000000000000000000000000..17e8858e01d80c422947f507e9d77b75
+ withJavadocJar()
+}
+
+val annotationsVersion = "24.0.1"
+val bungeeCordChatVersion = "1.20-R0.1"
+
+dependencies {
+ // api dependencies are listed transitively to API consumers
+ api("com.google.guava:guava:31.1-jre")
+ api("com.google.code.gson:gson:2.10")
+ api("net.md-5:bungeecord-chat:1.16-R0.4")
+ api("org.yaml:snakeyaml:1.33")
+ api("com.google.guava:guava:32.1.2-jre")
+ api("com.google.code.gson:gson:2.10.1")
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion")
+ api("org.yaml:snakeyaml:2.2")
+ api("org.joml:joml:1.10.5")
+
+ compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
+
+ val annotations = "org.jetbrains:annotations-java5:23.0.0"
+ val annotations = "org.jetbrains:annotations-java5:$annotationsVersion"
+ compileOnly(annotations)
+ testCompileOnly(annotations)
+
+ testImplementation("org.apache.commons:commons-lang3:3.12.0")
+ testImplementation("junit:junit:4.13.2")
+ testImplementation("org.hamcrest:hamcrest-library:1.3")
+ testImplementation("org.ow2.asm:asm-tree:9.4")
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
+ testImplementation("org.hamcrest:hamcrest:2.2")
+ testImplementation("org.mockito:mockito-core:5.5.0")
+ testImplementation("org.ow2.asm:asm-tree:9.5")
+}
+
+configure<PublishingExtension> {
@@ -96,11 +100,12 @@ index 0000000000000000000000000000000000000000..17e8858e01d80c422947f507e9d77b75
+ options.use()
+ options.isDocFilesSubDirs = true
+ options.links(
+ "https://guava.dev/releases/31.0.1-jre/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/1.33/",
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ "https://guava.dev/releases/32.1.2-jre/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/",
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/",
+ )
+ options.tags("apiNote:a:API Note:")
+
+ // workaround for https://github.com/gradle/gradle/issues/4046
+ inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
@@ -113,12 +118,16 @@ index 0000000000000000000000000000000000000000..17e8858e01d80c422947f507e9d77b75
+ }
+ }
+}
+
+tasks.test {
+ useJUnitPlatform()
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 829ebece9d376cbade1422c58759540054fbedbe..0000000000000000000000000000000000000000
index a464312b63bb62d196d6ec2d55ffcdc85ae4da67..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,261 +0,0 @@
@@ -1,278 +0,0 @@
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@@ -126,7 +135,7 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.19.4-R0.1-SNAPSHOT</version>
- <version>1.20.2-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
@@ -156,14 +165,14 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>31.1-jre</version>
- <version>32.1.2-jre</version>
- <scope>compile</scope>
- </dependency>
- <!-- bundled with Minecraft, should be kept in sync -->
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.10</version>
- <version>2.10.1</version>
- <scope>compile</scope>
- </dependency>
- <!-- bundled with Minecraft, should be kept in sync -->
@@ -176,14 +185,14 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <dependency>
- <groupId>net.md-5</groupId>
- <artifactId>bungeecord-chat</artifactId>
- <version>1.16-R0.4</version>
- <version>1.20-R0.1</version>
- <type>jar</type>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>1.33</version>
- <version>2.2</version>
- <scope>compile</scope>
- </dependency>
- <!-- not part of the API proper -->
@@ -209,26 +218,32 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <dependency>
- <groupId>org.jetbrains</groupId>
- <artifactId>annotations-java5</artifactId>
- <version>23.0.0</version>
- <version>24.0.1</version>
- <scope>provided</scope>
- </dependency>
- <!-- testing -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.13.2</version>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <version>5.10.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.hamcrest</groupId>
- <artifactId>hamcrest-library</artifactId>
- <version>1.3</version>
- <artifactId>hamcrest</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>5.5.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-tree</artifactId>
- <version>9.4</version>
- <version>9.5</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
@@ -238,7 +253,7 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <plugin>
- <groupId>net.md-5</groupId>
- <artifactId>scriptus</artifactId>
- <version>0.4.1</version>
- <version>0.5.0</version>
- <executions>
- <execution>
- <phase>initialize</phase>
@@ -251,23 +266,25 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.10.1</version>
- <version>3.11.0</version>
- <configuration>
- <!-- we use the Eclipse compiler as it doesn't need a JDK -->
- <compilerId>eclipse</compilerId>
- <!-- default changed with version 3.11.0 -->
- <showWarnings>false</showWarnings>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-eclipse</artifactId>
- <version>2.12.0</version>
- <version>2.13.0</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.2.2</version>
- <version>3.3.0</version>
- <configuration>
- <archive>
- <manifest>
@@ -282,7 +299,7 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>3.4.1</version>
- <version>3.5.0</version>
- <executions>
- <execution>
- <phase>package</phase>
@@ -309,16 +326,25 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>3.4.0</version>
- <version>3.5.0</version>
- <configuration>
- <links>
- <link>https://guava.dev/releases/31.0.1-jre/api/docs/</link>
- <link>https://javadoc.io/doc/org.yaml/snakeyaml/1.30/</link>
- <link>https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/</link>
- <link>https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/</link>
- <link>https://guava.dev/releases/31.1-jre/api/docs/</link>
- </links>
- <tags>
- <tag>
- <name>apiNote</name>
- <placement>a</placement>
- <head>API Note:</head>
- </tag>
- </tags>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>3.1.0</version>
- </plugin>
- </plugins>
- </build>
-
@@ -333,7 +359,7 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>3.1.2</version>
- <version>3.3.0</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
@@ -358,7 +384,7 @@ index 829ebece9d376cbade1422c58759540054fbedbe..00000000000000000000000000000000
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>animal-sniffer-maven-plugin</artifactId>
- <version>1.21</version>
- <version>1.23</version>
- <executions>
- <execution>
- <phase>process-classes</phase>
+22 -17
View File
@@ -5,12 +5,12 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index 17e8858e01d80c422947f507e9d77b7532788752..82444d3b95881702910369ec5694dd9f327ad81a 100644
index 41e77b687df6480adf8f5e21daad105dab208df2..d86ee6acb78d249424c5df98a851178c0f62eec1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,15 +15,27 @@ dependencies {
api("net.md-5:bungeecord-chat:1.16-R0.4")
api("org.yaml:snakeyaml:1.33")
@@ -18,15 +18,27 @@ dependencies {
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion")
api("org.yaml:snakeyaml:2.2")
api("org.joml:joml:1.10.5")
+ // Paper start
+ api("com.googlecode.json-simple:json-simple:1.1.1") {
@@ -23,8 +23,8 @@ index 17e8858e01d80c422947f507e9d77b7532788752..82444d3b95881702910369ec5694dd9f
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
+ compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper
- val annotations = "org.jetbrains:annotations-java5:23.0.0"
+ val annotations = "org.jetbrains:annotations:23.0.0" // Paper - we don't want Java 5 annotations...
- val annotations = "org.jetbrains:annotations-java5:$annotationsVersion"
+ val annotations = "org.jetbrains:annotations:$annotationsVersion" // Paper - we don't want Java 5 annotations...
compileOnly(annotations)
testCompileOnly(annotations)
@@ -35,20 +35,25 @@ index 17e8858e01d80c422947f507e9d77b7532788752..82444d3b95881702910369ec5694dd9f
+ // Paper end
+
testImplementation("org.apache.commons:commons-lang3:3.12.0")
testImplementation("junit:junit:4.13.2")
testImplementation("org.hamcrest:hamcrest-library:1.3")
@@ -65,7 +77,7 @@ tasks.withType<Javadoc> {
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.hamcrest:hamcrest:2.2")
@@ -69,8 +81,12 @@ tasks.withType<Javadoc> {
options.links(
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.33/",
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
"https://guava.dev/releases/32.1.2-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/",
+ // Paper start - add missing javadoc links
+ "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
+ // Paper end
)
options.tags("apiNote:a:API Note:")
@@ -80,3 +92,14 @@ tasks.withType<Javadoc> {
}
}
@@ -89,3 +105,14 @@ tasks.withType<Javadoc> {
tasks.test {
useJUnitPlatform()
}
+
+// Paper start
+63 -326
View File
@@ -3,54 +3,31 @@ From: Shane Freeder <theboyetronic@gmail.com>
Date: Sun, 17 Mar 2019 23:04:30 +0000
Subject: [PATCH] Test changes
- convert to mockito for mocking of types
- Allow use of TYPE_USE annotations
- Ignore package-private methods for nullability annotations
- Add excludes for classes which don't pass
- Disable stupid BukkitMirrorTest
Co-authored-by: Riley Park <rileysebastianpark@gmail.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 82444d3b95881702910369ec5694dd9f327ad81a..c06eda648d8626c86afb2140d6a583ddf82f295c 100644
index d86ee6acb78d249424c5df98a851178c0f62eec1..75bfb0ab8049ebbb52240abf661d469de5526767 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -35,6 +35,7 @@ dependencies {
compileOnlyApi(checkerQual)
testCompileOnly(checkerQual)
// Paper end
+ testImplementation("org.mockito:mockito-core:4.9.0") // Paper - add mockito
@@ -106,6 +106,12 @@ tasks.test {
useJUnitPlatform()
}
testImplementation("org.apache.commons:commons-lang3:3.12.0")
testImplementation("junit:junit:4.13.2")
diff --git a/src/test/java/io/papermc/paper/testing/EmptyRegistry.java b/src/test/java/io/papermc/paper/testing/EmptyRegistry.java
new file mode 100644
index 0000000000000000000000000000000000000000..ba9ddce87a9f385e729a5c2cf7c5eec120e388a7
--- /dev/null
+++ b/src/test/java/io/papermc/paper/testing/EmptyRegistry.java
@@ -0,0 +1,23 @@
+package io.papermc.paper.testing;
+
+import java.util.Collections;
+import java.util.Iterator;
+import org.bukkit.Keyed;
+import org.bukkit.NamespacedKey;
+import org.bukkit.Registry;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public record EmptyRegistry() implements Registry<Keyed> {
+
+ @NotNull
+ @Override
+ public Iterator<Keyed> iterator() {
+ return Collections.emptyIterator();
+ }
+
+ @Override
+ public @Nullable Keyed get(@NotNull final NamespacedKey key) {
+ return null;
+ }
+// Paper start - compile tests with -parameters for better junit parameterized test names
+tasks.compileTestJava {
+ options.compilerArgs.add("-parameters")
+}
+// Paper end
+
// Paper start
val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
diff --git a/src/test/java/io/papermc/paper/testing/EmptyTag.java b/src/test/java/io/papermc/paper/testing/EmptyTag.java
new file mode 100644
index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f559ebc18
@@ -88,65 +65,26 @@ index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f
+ return Collections.emptySet();
+ }
+}
diff --git a/src/test/java/io/papermc/paper/testing/TestServer.java b/src/test/java/io/papermc/paper/testing/TestServer.java
new file mode 100644
index 0000000000000000000000000000000000000000..756acf231b1b076b08046d86992ba7ce7f62a94f
--- /dev/null
+++ b/src/test/java/io/papermc/paper/testing/TestServer.java
@@ -0,0 +1,48 @@
+package io.papermc.paper.testing;
+
+import java.util.logging.Logger;
+import org.bukkit.Bukkit;
+import org.bukkit.NamespacedKey;
+import org.bukkit.Server;
+import org.bukkit.command.SimpleCommandMap;
+import org.bukkit.plugin.PluginManager;
+import org.bukkit.plugin.SimplePluginManager;
+
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+public final class TestServer {
+
+ @SuppressWarnings("removal")
+ public static void setup() {
+ //noinspection ConstantValue
+ if (Bukkit.getServer() != null) {
+ return;
+ }
+
+ final Server dummyServer = mock(Server.class);
+
+ final Logger logger = Logger.getLogger(TestServer.class.getCanonicalName());
+ when(dummyServer.getLogger()).thenReturn(logger);
+ when(dummyServer.getName()).thenReturn(TestServer.class.getSimpleName());
+ when(dummyServer.getVersion()).thenReturn("Version_" + TestServer.class.getPackage().getImplementationVersion());
+ when(dummyServer.getBukkitVersion()).thenReturn("BukkitVersion_" + TestServer.class.getPackage().getImplementationVersion());
+
+
+ final Thread currentThread = Thread.currentThread();
+ when(dummyServer.isPrimaryThread()).thenAnswer(ignored -> Thread.currentThread().equals(currentThread));
+
+ when(dummyServer.getTag(anyString(), any(NamespacedKey.class), any())).thenAnswer(ignored -> new EmptyTag());
+
+ final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer));
+ when(dummyServer.getPluginManager()).thenReturn(pluginManager);
+
+ when(dummyServer.getRegistry(any())).thenAnswer(ignored -> new EmptyRegistry());
+ when(dummyServer.getScoreboardCriteria(anyString())).thenReturn(null);
+
+ Bukkit.setServer(dummyServer);
+ }
+
+}
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c84891b8b0fd 100644
index 64e7aef6220097edefdff3b98a771b988365930d..abadff47166722fdc756afdbc6ac7242b6bd4fb0 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
@@ -40,7 +40,17 @@ public class AnnotationTest {
@@ -29,7 +29,13 @@ public class AnnotationTest {
"Lorg/jetbrains/annotations/Nullable;",
"Lorg/jetbrains/annotations/NotNull;",
"Lorg/jetbrains/annotations/Contract;",
- "Lorg/bukkit/UndefinedNullability;"
+ "Lorg/bukkit/UndefinedNullability;",
+ // Paper start
+ "Lorg/checkerframework/checker/nullness/qual/MonotonicNonNull;",
+ "Lorg/checkerframework/checker/nullness/qual/NonNull;",
+ "Lorg/checkerframework/checker/nullness/qual/Nullable;",
+ "Lorg/checkerframework/checker/nullness/qual/PolyNull;",
+ // Paper end
};
private static final String[] EXCLUDED_CLASSES = {
@@ -40,7 +46,17 @@ public class AnnotationTest {
"org/bukkit/util/io/Wrapper",
"org/bukkit/plugin/java/PluginClassLoader",
// Generic functional interface
@@ -165,7 +103,7 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
};
@Test
@@ -67,14 +77,40 @@ public class AnnotationTest {
@@ -67,14 +83,40 @@ public class AnnotationTest {
}
if (mustBeAnnotated(Type.getReturnType(method.desc)) && !isWellAnnotated(method.invisibleAnnotations)) {
@@ -176,7 +114,7 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
+ } else if (method.invisibleTypeAnnotations != null) {
+ dance: for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : method.invisibleTypeAnnotations) {
+ final org.objectweb.asm.TypeReference ref = new org.objectweb.asm.TypeReference(invisibleTypeAnnotation.typeRef);
+ if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_RETURN && java.util.Arrays.binarySearch(ACCEPTED_ANNOTATIONS, invisibleTypeAnnotation.desc) >= 0) {
+ if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_RETURN && java.util.Arrays.asList(ACCEPTED_ANNOTATIONS).contains(invisibleTypeAnnotation.desc)) {
+ warn = false;
+ break dance; // cha cha real smooth
+ }
@@ -197,7 +135,7 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
+ if (method.invisibleTypeAnnotations != null) {
+ for (final org.objectweb.asm.tree.TypeAnnotationNode invisibleTypeAnnotation : method.invisibleTypeAnnotations) {
+ final org.objectweb.asm.TypeReference ref = new org.objectweb.asm.TypeReference(invisibleTypeAnnotation.typeRef);
+ if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_FORMAL_PARAMETER && ref.getTypeParameterIndex() == i && java.util.Arrays.binarySearch(ACCEPTED_ANNOTATIONS, invisibleTypeAnnotation.desc) >= 0) {
+ if (ref.getSort() == org.objectweb.asm.TypeReference.METHOD_FORMAL_PARAMETER && ref.getTypeParameterIndex() == i && java.util.Arrays.asList(ACCEPTED_ANNOTATIONS).contains(invisibleTypeAnnotation.desc)) {
+ continue dancing;
+ }
+ }
@@ -206,7 +144,7 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
ParameterNode paramNode = parameters == null ? null : parameters.get(i);
String paramName = paramNode == null ? null : paramNode.name;
@@ -91,13 +127,18 @@ public class AnnotationTest {
@@ -91,13 +133,18 @@ public class AnnotationTest {
Collections.sort(errors);
@@ -224,12 +162,12 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
+ builder.append("\t").append(message).append("\n");
}
- Assert.fail("There " + errors.size() + " are missing annotation(s)");
+ Assert.fail(builder.toString());
- fail("There " + errors.size() + " are missing annotation(s)");
+ fail(builder.toString());
}
private static void collectClasses(@NotNull File from, @NotNull Map<String, ClassNode> to) throws IOException {
@@ -140,6 +181,11 @@ public class AnnotationTest {
@@ -140,6 +187,11 @@ public class AnnotationTest {
// Exceptions are excluded
return false;
}
@@ -241,7 +179,7 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
for (String excludedClass : EXCLUDED_CLASSES) {
if (excludedClass.equals(clazz.name)) {
@@ -152,7 +198,7 @@ public class AnnotationTest {
@@ -152,7 +204,7 @@ public class AnnotationTest {
private static boolean isMethodIncluded(@NotNull ClassNode clazz, @NotNull MethodNode method, @NotNull Map<String, ClassNode> allClasses) {
// Exclude private, synthetic and deprecated methods
@@ -250,7 +188,7 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
return false;
}
@@ -170,11 +216,30 @@ public class AnnotationTest {
@@ -170,11 +222,30 @@ public class AnnotationTest {
if ("<init>".equals(method.name) && isAnonymous(clazz)) {
return false;
}
@@ -282,232 +220,31 @@ index 4ac3dd977e75cd8464163351d306e037ee32cb48..8f35cda0d67ec66646c6096a5bf1c848
if (annotations == null) {
return false;
}
diff --git a/src/test/java/org/bukkit/TestServer.java b/src/test/java/org/bukkit/TestServer.java
deleted file mode 100644
index 701a17c10f31cd345238a3c568264178ce372faa..0000000000000000000000000000000000000000
--- a/src/test/java/org/bukkit/TestServer.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.bukkit;
-
-import com.google.common.collect.ImmutableMap;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.logging.Logger;
-import org.bukkit.command.SimpleCommandMap;
-import org.bukkit.plugin.PluginManager;
-import org.bukkit.plugin.SimplePluginManager;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-
-public final class TestServer implements InvocationHandler {
- private static interface MethodHandler {
- Object handle(TestServer server, Object[] args);
- }
-
- private static final Map<Method, MethodHandler> methods;
-
- static {
- try {
- ImmutableMap.Builder<Method, MethodHandler> methodMap = ImmutableMap.builder();
- methodMap.put(
- Server.class.getMethod("isPrimaryThread"),
- new MethodHandler() {
- @Override
- public Object handle(TestServer server, Object[] args) {
- return Thread.currentThread().equals(server.creatingThread);
- }
- }
- );
- methodMap.put(
- Server.class.getMethod("getPluginManager"),
- new MethodHandler() {
- @Override
- public Object handle(TestServer server, Object[] args) {
- return server.pluginManager;
- }
- }
- );
- methodMap.put(
- Server.class.getMethod("getLogger"),
- new MethodHandler() {
- final Logger logger = Logger.getLogger(TestServer.class.getCanonicalName());
- @Override
- public Object handle(TestServer server, Object[] args) {
- return logger;
- }
- }
- );
- methodMap.put(
- Server.class.getMethod("getName"),
- new MethodHandler() {
- @Override
- public Object handle(TestServer server, Object[] args) {
- return TestServer.class.getSimpleName();
- }
- }
- );
- methodMap.put(
- Server.class.getMethod("getVersion"),
- new MethodHandler() {
- @Override
- public Object handle(TestServer server, Object[] args) {
- return "Version_" + TestServer.class.getPackage().getImplementationVersion();
- }
- }
- );
- methodMap.put(
- Server.class.getMethod("getBukkitVersion"),
- new MethodHandler() {
- @Override
- public Object handle(TestServer server, Object[] args) {
- return "BukkitVersion_" + TestServer.class.getPackage().getImplementationVersion();
- }
- }
- );
- methodMap.put(
- Server.class.getMethod("getRegistry", Class.class),
- new MethodHandler() {
- @Override
- public Object handle(TestServer server, Object[] args) {
- return new Registry() {
- @NotNull
- @Override
- public Iterator iterator() {
- return null;
- }
-
- @Nullable
- @Override
- public Keyed get(@NotNull NamespacedKey key) {
- return null;
- }
- };
- }
- }
- );
- methodMap.put(
- Server.class.getMethod("getScoreboardCriteria", String.class),
- new MethodHandler() {
- @Override
- public Object handle(TestServer server, Object[] args) {
- // Does not need to return anything. Exists solely to test CriteriaTest which has static init fields
- return null;
- }
- }
- );
- methods = methodMap.build();
-
- TestServer server = new TestServer();
- Server instance = Proxy.getProxyClass(Server.class.getClassLoader(), Server.class).asSubclass(Server.class).getConstructor(InvocationHandler.class).newInstance(server);
- Bukkit.setServer(instance);
- server.pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance));
- } catch (Throwable t) {
- throw new Error(t);
- }
- }
-
- private Thread creatingThread = Thread.currentThread();
- private PluginManager pluginManager;
- private TestServer() {};
-
- public static Server getInstance() {
- return Bukkit.getServer();
- }
-
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) {
- MethodHandler handler = methods.get(method);
- if (handler != null) {
- return handler.handle(this, args);
- }
- throw new UnsupportedOperationException(String.valueOf(method));
- }
-}
diff --git a/src/test/java/org/bukkit/TestWorld.java b/src/test/java/org/bukkit/TestWorld.java
index ab34f1199921d415fa2ca6e281a8125c9e6d7173..f64d024f5bbf9482aaddb56597b23b04c66f21bf 100644
--- a/src/test/java/org/bukkit/TestWorld.java
+++ b/src/test/java/org/bukkit/TestWorld.java
@@ -18,7 +18,7 @@ public final class TestWorld implements InvocationHandler {
diff --git a/src/test/java/org/bukkit/BukkitMirrorTest.java b/src/test/java/org/bukkit/BukkitMirrorTest.java
index 89ca06ebecdaadd5dfc7bc74473ca15ad36f6eff..5974ceea58940e1799f3589eac0e39b925a42c3b 100644
--- a/src/test/java/org/bukkit/BukkitMirrorTest.java
+++ b/src/test/java/org/bukkit/BukkitMirrorTest.java
@@ -9,6 +9,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
static {
try {
- TestServer.getInstance();
+ io.papermc.paper.testing.TestServer.setup(); // Paper
+@org.junit.jupiter.api.Disabled // Paper
public class BukkitMirrorTest {
ImmutableMap.Builder<Method, MethodHandler> methodMap = ImmutableMap.builder();
methodMap.put(
diff --git a/src/test/java/org/bukkit/event/SyntheticEventTest.java b/src/test/java/org/bukkit/event/SyntheticEventTest.java
index d402cb59f508205ebe9ee450594826b04cecb90b..09886568ae6167141b463b6262565fa212af3385 100644
--- a/src/test/java/org/bukkit/event/SyntheticEventTest.java
+++ b/src/test/java/org/bukkit/event/SyntheticEventTest.java
@@ -1,6 +1,5 @@
package org.bukkit.event;
public static Stream<Arguments> data() {
diff --git a/src/test/java/org/bukkit/support/TestServer.java b/src/test/java/org/bukkit/support/TestServer.java
index 79173d6ed844f1e640e3aa745a9b560ec5e6a2bc..73ec679ac0d1f398b417bd174b47f9af93351e27 100644
--- a/src/test/java/org/bukkit/support/TestServer.java
+++ b/src/test/java/org/bukkit/support/TestServer.java
@@ -61,6 +61,11 @@ public final class TestServer {
UnsafeValues unsafeValues = mock(withSettings().stubOnly());
when(instance.getUnsafe()).thenReturn(unsafeValues);
-import org.bukkit.TestServer;
import org.bukkit.plugin.PluginLoader;
import org.bukkit.plugin.SimplePluginManager;
import org.bukkit.plugin.TestPlugin;
@@ -12,14 +11,15 @@ public class SyntheticEventTest {
@SuppressWarnings("deprecation")
@Test
public void test() {
- final JavaPluginLoader loader = new JavaPluginLoader(TestServer.getInstance());
+ io.papermc.paper.testing.TestServer.setup(); // Paper
+ final JavaPluginLoader loader = new JavaPluginLoader(org.bukkit.Bukkit.getServer()); // Paper
TestPlugin plugin = new TestPlugin(getClass().getName()) {
@Override
public PluginLoader getPluginLoader() {
return loader;
}
};
- SimplePluginManager pluginManager = new SimplePluginManager(TestServer.getInstance(), null);
+ SimplePluginManager pluginManager = new SimplePluginManager(org.bukkit.Bukkit.getServer(), null); // Paper
TestEvent event = new TestEvent(false);
Impl impl = new Impl();
diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java
index f188cd4f3b07027c30d41f1162db77a506b7b6bb..c46ed2acb82db814d660459b705dd49e6d44240f 100644
--- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java
+++ b/src/test/java/org/bukkit/plugin/PluginManagerTest.java
@@ -2,7 +2,6 @@ package org.bukkit.plugin;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
-import org.bukkit.TestServer;
import org.bukkit.event.Event;
import org.bukkit.event.TestEvent;
import org.bukkit.permissions.Permission;
@@ -14,7 +13,7 @@ public class PluginManagerTest {
volatile Object value = null;
+ // Paper start - testing changes
+ when(instance.getTag(anyString(), any(NamespacedKey.class), any())).thenAnswer(ignored -> new io.papermc.paper.testing.EmptyTag());
+ when(instance.getScoreboardCriteria(anyString())).thenReturn(null);
+ // Paper end - testing changes
+
Bukkit.setServer(instance);
}
- private static final PluginManager pm = TestServer.getInstance().getPluginManager();
+ private static final PluginManager pm = org.bukkit.Bukkit.getServer().getPluginManager(); // Paper
private final MutableObject store = new MutableObject();
diff --git a/src/test/java/org/bukkit/scoreboard/CriteriaTest.java b/src/test/java/org/bukkit/scoreboard/CriteriaTest.java
index eb94b6f4d58cd9f66b07791c57af7e359992e28c..a93f28e2f987a36e2c7e4f7d31506b750bdb222b 100644
--- a/src/test/java/org/bukkit/scoreboard/CriteriaTest.java
+++ b/src/test/java/org/bukkit/scoreboard/CriteriaTest.java
@@ -2,7 +2,6 @@ package org.bukkit.scoreboard;
import org.bukkit.Material;
import org.bukkit.Statistic;
-import org.bukkit.TestServer;
import org.bukkit.entity.EntityType;
import org.junit.Assert;
import org.junit.Test;
@@ -11,7 +10,7 @@ public class CriteriaTest {
@Test
public void testStatistic() {
- TestServer.getInstance();
+ io.papermc.paper.testing.TestServer.setup(); // Paper
Assert.assertThrows(IllegalArgumentException.class, () -> Criteria.statistic(Statistic.AVIATE_ONE_CM, Material.STONE)); // Generic statistic with block
Assert.assertThrows(IllegalArgumentException.class, () -> Criteria.statistic(Statistic.AVIATE_ONE_CM, EntityType.CREEPER)); // Generic statistic with entity type
@@ -6,10 +6,10 @@ Subject: [PATCH] Add FastUtil to Bukkit
Doesn't expose to plugins, just allows Paper-API to use it for optimization
diff --git a/build.gradle.kts b/build.gradle.kts
index c06eda648d8626c86afb2140d6a583ddf82f295c..464a209dbf52ebdfa287a553778a37c382a5405c 100644
index 75bfb0ab8049ebbb52240abf661d469de5526767..ecba866b84bc5f86a442bf220ab24ed8706aadf9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -19,6 +19,7 @@ dependencies {
@@ -22,6 +22,7 @@ dependencies {
api("com.googlecode.json-simple:json-simple:1.1.1") {
isTransitive = false // includes junit
}
File diff suppressed because it is too large. Load diff
@@ -6,10 +6,10 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index 23b1e7600d2507be60cb8543773b91f4851afb4f..d95b3d504ddc9ed76fc86cd45fa922d68e597827 100644
index 2377d476aee8c88d26ca715fdb756dc97749aac8..0c6e0bb90fe5ea29c467323a179a47ec122ba0f6 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -40,6 +40,9 @@ dependencies {
@@ -42,6 +42,9 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
+135 -84
View File
@@ -5,18 +5,26 @@ Subject: [PATCH] Paper Plugins
diff --git a/build.gradle.kts b/build.gradle.kts
index bb1f3b3d5a22ca391f4362e5d4cf016e7e9be0e3..f900b73c52971fe682171e7f99246afdb8b080f3 100644
index 0c6e0bb90fe5ea29c467323a179a47ec122ba0f6..145f6209a984e74da2d2de03cf725c06c77ef8da 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -45,7 +45,7 @@ dependencies {
@@ -47,7 +47,7 @@ dependencies {
implementation("org.ow2.asm:asm-commons:9.4")
// Paper end
- compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
+ api("org.apache.maven:maven-resolver-provider:3.8.5") // Paper, expose
+ api("org.apache.maven:maven-resolver-provider:3.8.5")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
compileOnly("com.google.code.findbugs:jsr305:1.3.9") // Paper
@@ -118,6 +118,7 @@ tasks.withType<Javadoc> {
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
// Paper end
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
)
options.tags("apiNote:a:API Note:")
diff --git a/src/main/java/io/papermc/paper/plugin/PermissionManager.java b/src/main/java/io/papermc/paper/plugin/PermissionManager.java
new file mode 100644
index 0000000000000000000000000000000000000000..cdbc93b317b3bab47bf6552c29cfbb2c27846933
@@ -194,9 +202,29 @@ index 0000000000000000000000000000000000000000..cdbc93b317b3bab47bf6552c29cfbb2c
+ void clearPermissions();
+
+}
diff --git a/src/main/java/io/papermc/paper/plugin/bootstrap/BootstrapContext.java b/src/main/java/io/papermc/paper/plugin/bootstrap/BootstrapContext.java
new file mode 100644
index 0000000000000000000000000000000000000000..08f2050356acaf74e3210416760e3873c2dafd2c
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/bootstrap/BootstrapContext.java
@@ -0,0 +1,14 @@
+package io.papermc.paper.plugin.bootstrap;
+
+import org.jetbrains.annotations.ApiStatus;
+
+/**
+ * Represents the context provided to a {@link PluginBootstrap} during both the bootstrapping and plugin
+ * instantiation logic.
+ * A boostrap context may be used to access data or logic usually provided to {@link org.bukkit.plugin.Plugin} instances
+ * like the plugin's configuration or logger during the plugins bootstrap.
+ */
+@ApiStatus.Experimental
+@ApiStatus.NonExtendable
+public interface BootstrapContext extends PluginProviderContext {
+}
diff --git a/src/main/java/io/papermc/paper/plugin/bootstrap/PluginBootstrap.java b/src/main/java/io/papermc/paper/plugin/bootstrap/PluginBootstrap.java
new file mode 100644
index 0000000000000000000000000000000000000000..ea84b11e8682e73fcd563fec65e76b707546a99e
index 0000000000000000000000000000000000000000..288c078da3d3ca78d02caa4e3565ac7cf89f9f9f
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/bootstrap/PluginBootstrap.java
@@ -0,0 +1,41 @@
@@ -226,7 +254,7 @@ index 0000000000000000000000000000000000000000..ea84b11e8682e73fcd563fec65e76b70
+ *
+ * @param context the server provided context
+ */
+ void bootstrap(@NotNull PluginProviderContext context);
+ void bootstrap(@NotNull BootstrapContext context);
+
+ /**
+ * Called by the server to instantiate your main class.
@@ -243,10 +271,10 @@ index 0000000000000000000000000000000000000000..ea84b11e8682e73fcd563fec65e76b70
+}
diff --git a/src/main/java/io/papermc/paper/plugin/bootstrap/PluginProviderContext.java b/src/main/java/io/papermc/paper/plugin/bootstrap/PluginProviderContext.java
new file mode 100644
index 0000000000000000000000000000000000000000..8be416f01055d94b474ecc425fc0bec69a814815
index 0000000000000000000000000000000000000000..2c14693155de3654d5ca011c63e13e4a1abf2080
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/bootstrap/PluginProviderContext.java
@@ -0,0 +1,44 @@
@@ -0,0 +1,52 @@
+package io.papermc.paper.plugin.bootstrap;
+
+import io.papermc.paper.plugin.configuration.PluginMeta;
@@ -258,7 +286,7 @@ index 0000000000000000000000000000000000000000..8be416f01055d94b474ecc425fc0bec6
+
+/**
+ * Represents the context provided to a {@link PluginBootstrap} during both the bootstrapping and plugin
+ * instanciation logic.
+ * instantiation logic.
+ * A boostrap context may be used to access data or logic usually provided to {@link org.bukkit.plugin.Plugin} instances
+ * like the plugin's configuration or logger during the plugins bootstrap.
+ */
@@ -290,6 +318,14 @@ index 0000000000000000000000000000000000000000..8be416f01055d94b474ecc425fc0bec6
+ @NotNull
+ ComponentLogger getLogger();
+
+ /**
+ * Provides the path to the originating source of the plugin, such as the plugin's JAR file.
+ *
+ * @return the previously described path
+ */
+ @NotNull
+ Path getPluginSource();
+
+}
diff --git a/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java b/src/main/java/io/papermc/paper/plugin/configuration/PluginMeta.java
new file mode 100644
@@ -675,7 +711,7 @@ index 0000000000000000000000000000000000000000..0546fa1e9dcd7155086a8650806a8c08
+}
diff --git a/src/main/java/io/papermc/paper/plugin/loader/library/impl/JarLibrary.java b/src/main/java/io/papermc/paper/plugin/loader/library/impl/JarLibrary.java
new file mode 100644
index 0000000000000000000000000000000000000000..3327595d154700890c862a2ced5eff93da4bd634
index 0000000000000000000000000000000000000000..e3da0d67cab01e1233dccde1a12ff25961ee79fb
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/loader/library/impl/JarLibrary.java
@@ -0,0 +1,45 @@
@@ -700,7 +736,7 @@ index 0000000000000000000000000000000000000000..3327595d154700890c862a2ced5eff93
+ * resulting in a jar library that provides the jar at {@code libs/custom-library-1.24.jar} to the plugins classloader
+ * at runtime.
+ * <p>
+ * The jar library implementation will error if file exists at the specified path.
+ * The jar library implementation will error if the file does not exist at the specified path.
+ */
+public class JarLibrary implements ClassPathLibrary {
+
@@ -726,7 +762,7 @@ index 0000000000000000000000000000000000000000..3327595d154700890c862a2ced5eff93
+}
diff --git a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
new file mode 100644
index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5fa5b9141
index 0000000000000000000000000000000000000000..9af07d168beadaa77e4965819200eeb94fe3e092
--- /dev/null
+++ b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
@@ -0,0 +1,132 @@
@@ -756,12 +792,12 @@ index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5
+import org.eclipse.aether.transfer.TransferEvent;
+import org.eclipse.aether.transport.http.HttpTransporterFactory;
+import org.jetbrains.annotations.NotNull;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * The maven library resolver acts as a resolver for yet to be resolved jar libraries that may be pulled from a
@@ -782,7 +818,7 @@ index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5
+ */
+public class MavenLibraryResolver implements ClassPathLibrary {
+
+ private static final Logger logger = Logger.getLogger("MavenLibraryResolver");
+ private static final Logger logger = LoggerFactory.getLogger("MavenLibraryResolver");
+
+ private final RepositorySystem repository;
+ private final DefaultRepositorySystemSession session;
@@ -810,7 +846,7 @@ index 0000000000000000000000000000000000000000..e3e902a708a760be167cb1bba8e845c5
+ this.session.setTransferListener(new AbstractTransferListener() {
+ @Override
+ public void transferInitiated(@NotNull TransferEvent event) throws TransferCancelledException {
+ logger.log(Level.INFO, "Downloading {0}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
+ logger.info("Downloading {}", event.getResource().getRepositoryUrl() + event.getResource().getResourceName());
+ }
+ });
+ this.session.setReadOnly();
@@ -1310,13 +1346,13 @@ index 0000000000000000000000000000000000000000..6bf3d212a6156ad9ab0e82d1ca0a04f8
+
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 876072a6c91bd02c9c7de53556419b8e1ac48f27..dc9a4f12d9f05a3ae7c9f1c7648123e4b3dfd115 100644
index a3ee6f2f588bc9c87e49378359f450820b9af1b9..0743592273cc1c5f4ab6935349941bf25b438448 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -96,4 +96,14 @@ public interface UnsafeValues {
String getTranslationKey(EntityType entityType);
String getTranslationKey(ItemStack itemStack);
@@ -109,4 +109,14 @@ public interface UnsafeValues {
* @return an internal potion data
*/
PotionType.InternalPotionData getInternalPotionData(NamespacedKey key);
+
+ // Paper start
+ @Deprecated(forRemoval = true)
@@ -1354,6 +1390,18 @@ index e195e74c48c69047aa825b75fad95419c505b41f..53f28c9e6843991486a576d41b6641c1
register("bukkit", new TimingsCommand("timings"));
}
diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
index bcb576a4271b1ec7b1cfe6f83cf161b7d89ed2e5..4d849e1283fdf6b0872a0f2183964cc93748c116 100644
--- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java
@@ -9,6 +9,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.NotNull;
+@Deprecated(forRemoval = true) // Paper
public class PluginsCommand extends BukkitCommand {
public PluginsCommand(@NotNull String name) {
super(name);
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index b37938745f916b5f0111b07b1a1c97527f026e9d..8c76716249e44ed8bf6be94c1f5c7b6d9bb35be2 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
@@ -1401,10 +1449,10 @@ index 94f8ceb965cecb5669a84a0ec61c0f706c2a2673..e773db6da357ad210eb24d4c389af2dc
}
}
diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
index 77a380537b338fdd0aa2f6777ff775056cc6b221..028805bcdb1d2bb0d11387db165b7376579e5f60 100644
index f48bdeb628a82416d93f84a0a10141447482bf83..c0691a849831f99268fdcb7b0f471f80a1a2a70e 100644
--- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
+++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
@@ -195,7 +195,7 @@ import org.yaml.snakeyaml.nodes.Tag;
@@ -198,7 +198,7 @@ import org.yaml.snakeyaml.representer.Representer;
* inferno.burningdeaths: true
*</pre></blockquote>
*/
@@ -1413,7 +1461,7 @@ index 77a380537b338fdd0aa2f6777ff775056cc6b221..028805bcdb1d2bb0d11387db165b7376
private static final Pattern VALID_NAME = Pattern.compile("^[A-Za-z0-9 _.-]+$");
private static final ThreadLocal<Yaml> YAML = new ThreadLocal<Yaml>() {
@Override
@@ -255,6 +255,70 @@ public final class PluginDescriptionFile {
@@ -259,6 +259,70 @@ public final class PluginDescriptionFile {
private Set<PluginAwareness> awareness = ImmutableSet.of();
private String apiVersion = null;
private List<String> libraries = ImmutableList.of();
@@ -1536,7 +1584,7 @@ index 41e26451fe12d8e6e0ef73c85731b24b4e3f200c..03213fde8315384ec56c16031cfc606a
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..f64a90241ce7f73e111e6b5ac6ff87cd93583c0e 100644
index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e7666711998eb4e 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -43,6 +43,8 @@ import org.jetbrains.annotations.Nullable;
@@ -1677,7 +1725,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..f64a90241ce7f73e111e6b5ac6ff87cd
Preconditions.checkArgument(priority != null, "Priority cannot be null");
Preconditions.checkArgument(executor != null, "Executor cannot be null");
Preconditions.checkArgument(plugin != null, "Plugin cannot be null");
+ if (true) {this.paperPluginManager.registerEvent(event, listener, priority, executor, plugin); return;} // Paper
+ if (true) {this.paperPluginManager.registerEvent(event, listener, priority, executor, plugin, ignoreCancelled); return;} // Paper
if (!plugin.isEnabled()) {
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
@@ -1842,10 +1890,10 @@ index a80251eff75430863b37db1c131e22593f3fcd5e..310c4041963a3f1e0a26e39a6da12a9b
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b5eafb38f 100644
index ee100b7ad89ce1eccef0c3bc55885cd78aadd1ec..f594913e6b94f77b26a4a758c447a42d8a25b6ff 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -38,6 +38,7 @@ public abstract class JavaPlugin extends PluginBase {
@@ -40,6 +40,7 @@ public abstract class JavaPlugin extends PluginBase {
private Server server = null;
private File file = null;
private PluginDescriptionFile description = null;
@@ -1853,7 +1901,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
private File dataFolder = null;
private ClassLoader classLoader = null;
private boolean naggable = true;
@@ -46,13 +47,16 @@ public abstract class JavaPlugin extends PluginBase {
@@ -48,13 +49,16 @@ public abstract class JavaPlugin extends PluginBase {
private PluginLogger logger = null;
public JavaPlugin() {
@@ -1874,7 +1922,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
protected JavaPlugin(@NotNull final JavaPluginLoader loader, @NotNull final PluginDescriptionFile description, @NotNull final File dataFolder, @NotNull final File file) {
final ClassLoader classLoader = this.getClass().getClassLoader();
if (classLoader instanceof PluginClassLoader) {
@@ -77,9 +81,12 @@ public abstract class JavaPlugin extends PluginBase {
@@ -79,9 +83,12 @@ public abstract class JavaPlugin extends PluginBase {
* Gets the associated PluginLoader responsible for this plugin
*
* @return PluginLoader that controls this plugin
@@ -1887,7 +1935,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
public final PluginLoader getPluginLoader() {
return loader;
}
@@ -120,13 +127,20 @@ public abstract class JavaPlugin extends PluginBase {
@@ -122,13 +129,20 @@ public abstract class JavaPlugin extends PluginBase {
* Returns the plugin.yaml file containing the details for this plugin
*
* @return Contents of the plugin.yaml file
@@ -1900,7 +1948,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
return description;
}
+ @Nullable
+ @NotNull
+ public final io.papermc.paper.plugin.configuration.PluginMeta getPluginMeta() {
+ return this.pluginMeta;
+ }
@@ -1908,7 +1956,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
@NotNull
@Override
public FileConfiguration getConfig() {
@@ -256,7 +270,8 @@ public abstract class JavaPlugin extends PluginBase {
@@ -258,7 +272,8 @@ public abstract class JavaPlugin extends PluginBase {
*
* @param enabled true if enabled, otherwise false
*/
@@ -1918,7 +1966,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
if (isEnabled != enabled) {
isEnabled = enabled;
@@ -268,9 +283,18 @@ public abstract class JavaPlugin extends PluginBase {
@@ -270,9 +285,18 @@ public abstract class JavaPlugin extends PluginBase {
}
}
@@ -1940,7 +1988,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
this.server = server;
this.file = file;
this.description = description;
@@ -278,6 +302,7 @@ public abstract class JavaPlugin extends PluginBase {
@@ -280,6 +304,7 @@ public abstract class JavaPlugin extends PluginBase {
this.classLoader = classLoader;
this.configFile = new File(dataFolder, "config.yml");
this.logger = new PluginLogger(this);
@@ -1948,7 +1996,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
}
/**
@@ -394,10 +419,10 @@ public abstract class JavaPlugin extends PluginBase {
@@ -396,10 +421,10 @@ public abstract class JavaPlugin extends PluginBase {
throw new IllegalArgumentException(clazz + " does not extend " + JavaPlugin.class);
}
final ClassLoader cl = clazz.getClassLoader();
@@ -1962,7 +2010,7 @@ index 669a70faa95d0d6525a731d73499ed6fb0b48320..c9cf9d361a1289aba383718733a2098b
if (plugin == null) {
throw new IllegalStateException("Cannot get plugin for " + clazz + " from a static initializer");
}
@@ -420,10 +445,10 @@ public abstract class JavaPlugin extends PluginBase {
@@ -422,10 +447,10 @@ public abstract class JavaPlugin extends PluginBase {
public static JavaPlugin getProvidingPlugin(@NotNull Class<?> clazz) {
Preconditions.checkArgument(clazz != null, "Null class cannot have a plugin");
final ClassLoader cl = clazz.getClassLoader();
@@ -2040,10 +2088,10 @@ index 6d634b0ea813ccb19f1562a7d0e5a59cea4eab21..e4b6f278a811acbb0070e311c5c3bdaf
}
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fdadf45bdc 100644
index 64a294aeb6fb548794708b38c3707f9dd882b2ff..74b6581a97a092c44a0876e7981ff8a8e6153100 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -29,7 +29,8 @@ import org.jetbrains.annotations.Nullable;
@@ -31,7 +31,8 @@ import org.jetbrains.annotations.Nullable;
/**
* A ClassLoader for plugins, to allow shared classes across multiple plugins
*/
@@ -2053,7 +2101,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
private final JavaPluginLoader loader;
private final Map<String, Class<?>> classes = new ConcurrentHashMap<String, Class<?>>();
private final PluginDescriptionFile description;
@@ -43,24 +44,32 @@ final class PluginClassLoader extends URLClassLoader {
@@ -45,24 +46,32 @@ final class PluginClassLoader extends URLClassLoader {
private JavaPlugin pluginInit;
private IllegalStateException pluginState;
private final Set<String> seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>());
@@ -2082,15 +2130,15 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
this.url = file.toURI().toURL();
this.libraryLoader = libraryLoader;
+
+ // Paper start
+ this.dependencyContext = dependencyContext;
+ this.classLoaderGroup = io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage.instance().registerSpigotGroup(this);
+ // Paper end
+
Class<?> jarClass;
try {
Class<?> jarClass;
try {
@@ -94,6 +103,27 @@ final class PluginClassLoader extends URLClassLoader {
jarClass = Class.forName(description.getMain(), true, this);
@@ -107,6 +116,27 @@ final class PluginClassLoader extends URLClassLoader {
return findResources(name);
}
@@ -2118,7 +2166,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
return loadClass0(name, resolve, true, true);
@@ -119,26 +149,11 @@ final class PluginClassLoader extends URLClassLoader {
@@ -132,26 +162,11 @@ final class PluginClassLoader extends URLClassLoader {
if (checkGlobal) {
// This ignores the libraries of other plugins, unless they are transitive dependencies.
@@ -2147,7 +2195,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
return result;
}
@@ -167,7 +182,7 @@ final class PluginClassLoader extends URLClassLoader {
@@ -180,7 +195,7 @@ final class PluginClassLoader extends URLClassLoader {
throw new ClassNotFoundException(name, ex);
}
@@ -2156,7 +2204,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
int dot = name.lastIndexOf('.');
if (dot != -1) {
@@ -197,8 +212,8 @@ final class PluginClassLoader extends URLClassLoader {
@@ -210,8 +225,8 @@ final class PluginClassLoader extends URLClassLoader {
result = super.findClass(name);
}
@@ -2166,7 +2214,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
}
return result;
@@ -207,6 +222,12 @@ final class PluginClassLoader extends URLClassLoader {
@@ -220,6 +235,12 @@ final class PluginClassLoader extends URLClassLoader {
@Override
public void close() throws IOException {
try {
@@ -2179,7 +2227,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
super.close();
} finally {
jar.close();
@@ -218,7 +239,7 @@ final class PluginClassLoader extends URLClassLoader {
@@ -231,7 +252,7 @@ final class PluginClassLoader extends URLClassLoader {
return classes.values();
}
@@ -2188,7 +2236,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
Preconditions.checkArgument(javaPlugin != null, "Initializing plugin cannot be null");
Preconditions.checkArgument(javaPlugin.getClass().getClassLoader() == this, "Cannot initialize plugin outside of this class loader");
if (this.plugin != null || this.pluginInit != null) {
@@ -228,6 +249,38 @@ final class PluginClassLoader extends URLClassLoader {
@@ -241,6 +262,38 @@ final class PluginClassLoader extends URLClassLoader {
pluginState = new IllegalStateException("Initial initialization");
this.pluginInit = javaPlugin;
@@ -2228,48 +2276,35 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
+
+ // Paper end
}
diff --git a/src/test/java/io/papermc/paper/testing/TestServer.java b/src/test/java/io/papermc/paper/testing/TestServer.java
index 756acf231b1b076b08046d86992ba7ce7f62a94f..52d27d977b9df0bdf02b33ed0aaa3b4db0a04cb4 100644
--- a/src/test/java/io/papermc/paper/testing/TestServer.java
+++ b/src/test/java/io/papermc/paper/testing/TestServer.java
@@ -36,9 +36,6 @@ public final class TestServer {
when(dummyServer.getTag(anyString(), any(NamespacedKey.class), any())).thenAnswer(ignored -> new EmptyTag());
- final PluginManager pluginManager = new SimplePluginManager(dummyServer, new SimpleCommandMap(dummyServer));
- when(dummyServer.getPluginManager()).thenReturn(pluginManager);
-
when(dummyServer.getRegistry(any())).thenAnswer(ignored -> new EmptyRegistry());
when(dummyServer.getScoreboardCriteria(anyString())).thenReturn(null);
diff --git a/src/test/java/org/bukkit/event/SyntheticEventTest.java b/src/test/java/org/bukkit/event/SyntheticEventTest.java
deleted file mode 100644
index 09886568ae6167141b463b6262565fa212af3385..0000000000000000000000000000000000000000
index 40a086f2883c4419d2bf0bd44285f7c55562ba3e..0000000000000000000000000000000000000000
--- a/src/test/java/org/bukkit/event/SyntheticEventTest.java
+++ /dev/null
@@ -1,48 +0,0 @@
@@ -1,49 +0,0 @@
-package org.bukkit.event;
-
-import static org.junit.jupiter.api.Assertions.*;
-import org.bukkit.Bukkit;
-import org.bukkit.plugin.PluginLoader;
-import org.bukkit.plugin.SimplePluginManager;
-import org.bukkit.plugin.TestPlugin;
-import org.bukkit.plugin.java.JavaPluginLoader;
-import org.junit.Assert;
-import org.junit.Test;
-import org.bukkit.support.AbstractTestingBase;
-import org.junit.jupiter.api.Test;
-
-public class SyntheticEventTest {
-public class SyntheticEventTest extends AbstractTestingBase {
- @SuppressWarnings("deprecation")
- @Test
- public void test() {
- io.papermc.paper.testing.TestServer.setup(); // Paper
- final JavaPluginLoader loader = new JavaPluginLoader(org.bukkit.Bukkit.getServer()); // Paper
- final JavaPluginLoader loader = new JavaPluginLoader(Bukkit.getServer());
- TestPlugin plugin = new TestPlugin(getClass().getName()) {
- @Override
- public PluginLoader getPluginLoader() {
- return loader;
- }
- };
- SimplePluginManager pluginManager = new SimplePluginManager(org.bukkit.Bukkit.getServer(), null); // Paper
- SimplePluginManager pluginManager = new SimplePluginManager(Bukkit.getServer(), null);
-
- TestEvent event = new TestEvent(false);
- Impl impl = new Impl();
@@ -2277,7 +2312,7 @@ index 09886568ae6167141b463b6262565fa212af3385..00000000000000000000000000000000
- pluginManager.registerEvents(impl, plugin);
- pluginManager.callEvent(event);
-
- Assert.assertEquals(1, impl.callCount);
- assertEquals(1, impl.callCount);
- }
-
- public abstract static class Base<E extends Event> implements Listener {
@@ -2298,26 +2333,28 @@ index 09886568ae6167141b463b6262565fa212af3385..00000000000000000000000000000000
-}
diff --git a/src/test/java/org/bukkit/plugin/PluginManagerTest.java b/src/test/java/org/bukkit/plugin/PluginManagerTest.java
deleted file mode 100644
index c46ed2acb82db814d660459b705dd49e6d44240f..0000000000000000000000000000000000000000
index 03b08e47e91e8b56c1992fcd749a62eb9e7d4d68..0000000000000000000000000000000000000000
--- a/src/test/java/org/bukkit/plugin/PluginManagerTest.java
+++ /dev/null
@@ -1,183 +0,0 @@
@@ -1,185 +0,0 @@
-package org.bukkit.plugin;
-
-import static org.bukkit.support.MatcherAssert.*;
-import static org.hamcrest.Matchers.*;
-import static org.junit.Assert.*;
-import org.bukkit.Bukkit;
-import org.bukkit.event.Event;
-import org.bukkit.event.TestEvent;
-import org.bukkit.permissions.Permission;
-import org.junit.After;
-import org.junit.Test;
-import org.bukkit.support.AbstractTestingBase;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.Test;
-
-public class PluginManagerTest {
-public class PluginManagerTest extends AbstractTestingBase {
- private class MutableObject {
- volatile Object value = null;
- }
-
- private static final PluginManager pm = org.bukkit.Bukkit.getServer().getPluginManager(); // Paper
- private static final PluginManager pm = Bukkit.getServer().getPluginManager();
-
- private final MutableObject store = new MutableObject();
-
@@ -2466,20 +2503,20 @@ index c46ed2acb82db814d660459b705dd49e6d44240f..00000000000000000000000000000000
- private void testRemovePermissionByName(final String name) {
- final Permission perm = new Permission(name);
- pm.addPermission(perm);
- assertThat("Permission \"" + name + "\" was not added", pm.getPermission(name), is(perm));
- assertThat(pm.getPermission(name), is(perm), "Permission \"" + name + "\" was not added");
- pm.removePermission(name);
- assertThat("Permission \"" + name + "\" was not removed", pm.getPermission(name), is(nullValue()));
- assertThat(pm.getPermission(name), is(nullValue()), "Permission \"" + name + "\" was not removed");
- }
-
- private void testRemovePermissionByPermission(final String name) {
- final Permission perm = new Permission(name);
- pm.addPermission(perm);
- assertThat("Permission \"" + name + "\" was not added", pm.getPermission(name), is(perm));
- assertThat(pm.getPermission(name), is(perm), "Permission \"" + name + "\" was not added");
- pm.removePermission(perm);
- assertThat("Permission \"" + name + "\" was not removed", pm.getPermission(name), is(nullValue()));
- assertThat(pm.getPermission(name), is(nullValue()), "Permission \"" + name + "\" was not removed");
- }
-
- @After
- @AfterEach
- public void tearDown() {
- pm.clearPlugins();
- assertThat(pm.getPermissions(), is(empty()));
@@ -2502,3 +2539,17 @@ index a8be3e23e3e280ad301d9530de50028515612966..43b58e920e739bb949ac0673e9ef73ba
@Override
public FileConfiguration getConfig() {
diff --git a/src/test/java/org/bukkit/support/TestServer.java b/src/test/java/org/bukkit/support/TestServer.java
index 73ec679ac0d1f398b417bd174b47f9af93351e27..b208150297a23c0b4acb79135416809718f5650e 100644
--- a/src/test/java/org/bukkit/support/TestServer.java
+++ b/src/test/java/org/bukkit/support/TestServer.java
@@ -25,8 +25,7 @@ public final class TestServer {
Thread creatingThread = Thread.currentThread();
when(instance.isPrimaryThread()).then(mock -> Thread.currentThread().equals(creatingThread));
- PluginManager pluginManager = new SimplePluginManager(instance, new SimpleCommandMap(instance));
- when(instance.getPluginManager()).thenReturn(pluginManager);
+ // Paper - remove plugin manager for Paper Plugins
Logger logger = Logger.getLogger(TestServer.class.getCanonicalName());
when(instance.getLogger()).thenReturn(logger);
+18 -6
View File
@@ -6,7 +6,7 @@ Subject: [PATCH] Add Position
diff --git a/src/main/java/io/papermc/paper/math/BlockPosition.java b/src/main/java/io/papermc/paper/math/BlockPosition.java
new file mode 100644
index 0000000000000000000000000000000000000000..f164d32cfbd5bfd84f3067a149d34bb1185a7e00
index 0000000000000000000000000000000000000000..f0fdabce4af640da2a406412e67020761ded3ac1
--- /dev/null
+++ b/src/main/java/io/papermc/paper/math/BlockPosition.java
@@ -0,0 +1,98 @@
@@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..f164d32cfbd5bfd84f3067a149d34bb1
+
+ @Override
+ default @NotNull FinePosition offset(double x, double y, double z) {
+ return new FinePositionImpl(this.blockX() + z, this.blockY() + y, this.blockZ() + z);
+ return new FinePositionImpl(this.blockX() + x, this.blockY() + y, this.blockZ() + z);
+ }
+
+ /**
@@ -192,10 +192,10 @@ index 0000000000000000000000000000000000000000..93476aaf8d21efb5a30b6d2cc2eeda81
+}
diff --git a/src/main/java/io/papermc/paper/math/Position.java b/src/main/java/io/papermc/paper/math/Position.java
new file mode 100644
index 0000000000000000000000000000000000000000..300da713dcc303b340efad70efe57facf5422964
index 0000000000000000000000000000000000000000..26bc5a0fa67855af87c8fd4cd8229b4d9f242740
--- /dev/null
+++ b/src/main/java/io/papermc/paper/math/Position.java
@@ -0,0 +1,184 @@
@@ -0,0 +1,191 @@
+package io.papermc.paper.math;
+
+import org.bukkit.Location;
@@ -273,6 +273,13 @@ index 0000000000000000000000000000000000000000..300da713dcc303b340efad70efe57fac
+ boolean isFine();
+
+ /**
+ * Checks if each component of this position is finite.
+ */
+ default boolean isFinite() {
+ return Double.isFinite(this.x()) && Double.isFinite(this.y()) && Double.isFinite(this.z());
+ }
+
+ /**
+ * Returns a position offset by the specified amounts.
+ *
+ * @param x x value to offset
@@ -381,7 +388,7 @@ index 0000000000000000000000000000000000000000..300da713dcc303b340efad70efe57fac
+ }
+}
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 7c4db051472fb6a6c6d24092dc6f75487356690a..3b99f359f556e6f2c341d55fa69b7462e69b6546 100644
index 7c4db051472fb6a6c6d24092dc6f75487356690a..85c342fc50f2fe0ce9a1b3980df9e088c3dea92d 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.Nullable;
@@ -393,7 +400,7 @@ index 7c4db051472fb6a6c6d24092dc6f75487356690a..3b99f359f556e6f2c341d55fa69b7462
private Reference<World> world;
private double x;
private double y;
@@ -706,4 +706,26 @@ public class Location implements Cloneable, ConfigurationSerializable {
@@ -706,4 +706,31 @@ public class Location implements Cloneable, ConfigurationSerializable {
}
return pitch;
}
@@ -415,6 +422,11 @@ index 7c4db051472fb6a6c6d24092dc6f75487356690a..3b99f359f556e6f2c341d55fa69b7462
+ }
+
+ @Override
+ public boolean isFinite() {
+ return io.papermc.paper.math.FinePosition.super.isFinite() && Float.isFinite(this.getYaw()) && Float.isFinite(this.getPitch());
+ }
+
+ @Override
+ public @NotNull Location toLocation(@NotNull World world) {
+ return new Location(world, this.x(), this.y(), this.z(), this.getYaw(), this.getPitch());
+ }
+109 -41
View File
@@ -8,10 +8,10 @@ expose isRunning
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 0000000000000000000000000000000000000000..43b85ce3a6c27a2f92c67d62bee7484c2652b72a
index 0000000000000000000000000000000000000000..36b8fe86335df851f9c85d6bb2a91368b4d945d1
--- /dev/null
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
@@ -0,0 +1,85 @@
@@ -0,0 +1,86 @@
+package co.aikar.timings;
+
+import static co.aikar.timings.TimingsManager.*;
@@ -19,6 +19,7 @@ index 0000000000000000000000000000000000000000..43b85ce3a6c27a2f92c67d62bee7484c
+import org.bukkit.Bukkit;
+import org.jetbrains.annotations.NotNull;
+
+@Deprecated(forRemoval = true)
+public class FullServerTickHandler extends TimingHandler {
+ private static final TimingIdentifier IDENTITY = new TimingIdentifier("Minecraft", "Full Server Tick", null);
+ final TimingData minuteData;
@@ -99,10 +100,10 @@ index 0000000000000000000000000000000000000000..43b85ce3a6c27a2f92c67d62bee7484c
+}
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 0000000000000000000000000000000000000000..9b45ce887b9172f30302b83fe24b99b76b16dac3
index 0000000000000000000000000000000000000000..81671cf40feeed2844ee8d92348d48062aaf2c46
--- /dev/null
+++ b/src/main/java/co/aikar/timings/NullTimingHandler.java
@@ -0,0 +1,68 @@
@@ -0,0 +1,69 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -131,6 +132,7 @@ index 0000000000000000000000000000000000000000..9b45ce887b9172f30302b83fe24b99b7
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@Deprecated(forRemoval = true)
+public final class NullTimingHandler implements Timing {
+ public static final Timing NULL = new NullTimingHandler();
+ @NotNull
@@ -173,10 +175,10 @@ index 0000000000000000000000000000000000000000..9b45ce887b9172f30302b83fe24b99b7
+}
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 0000000000000000000000000000000000000000..4e6e1b8e8aeb07e34536941d2cbfc25e5cfa6c27
index 0000000000000000000000000000000000000000..be275c25664e0c76123371c6c8fac601f87fa492
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimedEventExecutor.java
@@ -0,0 +1,83 @@
@@ -0,0 +1,84 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -213,6 +215,7 @@ index 0000000000000000000000000000000000000000..4e6e1b8e8aeb07e34536941d2cbfc25e
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@Deprecated(forRemoval = true)
+public class TimedEventExecutor implements EventExecutor {
+
+ private final EventExecutor executor;
@@ -262,10 +265,10 @@ index 0000000000000000000000000000000000000000..4e6e1b8e8aeb07e34536941d2cbfc25e
+}
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 0000000000000000000000000000000000000000..a21e5ead5024fd0058c5e3302d8201dd249d32bc
index 0000000000000000000000000000000000000000..7514fad26f955329f8bf17ff17db75f0c8301ee5
--- /dev/null
+++ b/src/main/java/co/aikar/timings/Timing.java
@@ -0,0 +1,83 @@
@@ -0,0 +1,86 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -296,7 +299,10 @@ index 0000000000000000000000000000000000000000..a21e5ead5024fd0058c5e3302d8201dd
+
+/**
+ * Provides an ability to time sections of code within the Minecraft Server
+ *
+ * @deprecated Timings will likely be replaced with Spark in the future
+ */
+@Deprecated(forRemoval = true)
+public interface Timing extends AutoCloseable {
+ /**
+ * Starts timing the execution until {@link #stopTiming()} is called.
@@ -711,10 +717,10 @@ index 0000000000000000000000000000000000000000..199789d56d22fcb1b77ebd56805cc28a
+}
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 0000000000000000000000000000000000000000..ddaed81275fcc12d1671b668697acf318e96888b
index 0000000000000000000000000000000000000000..eb9d58f8852e732a1284beeaf542989301d21b1c
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
@@ -0,0 +1,354 @@
@@ -0,0 +1,355 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -767,6 +773,7 @@ index 0000000000000000000000000000000000000000..ddaed81275fcc12d1671b668697acf31
+import static co.aikar.timings.TimingsManager.MINUTE_REPORTS;
+import static co.aikar.util.JSONUtil.*;
+
+@Deprecated(forRemoval = true)
+@SuppressWarnings({"deprecation", "SuppressionAnnotation", "Convert2Lambda", "Anonymous2MethodRef"})
+public class TimingHistory {
+ public static long lastMinuteTime;
@@ -1257,10 +1264,10 @@ index 0000000000000000000000000000000000000000..df142a89b8c43acb81eb383eac0ef048
+}
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 0000000000000000000000000000000000000000..dd72a34eaa4bedd9ea0b92eaa79091b00eb4dd09
index 0000000000000000000000000000000000000000..9812d668ad945aba486fbf6d5bf83c4292cb5d03
--- /dev/null
+++ b/src/main/java/co/aikar/timings/Timings.java
@@ -0,0 +1,295 @@
@@ -0,0 +1,337 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -1289,6 +1296,10 @@ index 0000000000000000000000000000000000000000..dd72a34eaa4bedd9ea0b92eaa79091b0
+import com.google.common.base.Preconditions;
+import com.google.common.collect.EvictingQueue;
+import com.google.common.collect.Lists;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.event.ClickEvent;
+import net.kyori.adventure.text.format.TextColor;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+import org.bukkit.Bukkit;
+import org.bukkit.command.CommandSender;
+import org.bukkit.plugin.Plugin;
@@ -1299,6 +1310,10 @@ index 0000000000000000000000000000000000000000..dd72a34eaa4bedd9ea0b92eaa79091b0
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @deprecated Timings will likely be replaced with Spark in the future
+ */
+@Deprecated(forRemoval = true)
+@SuppressWarnings({"UnusedDeclaration", "WeakerAccess", "SameParameterValue"})
+public final class Timings {
+
@@ -1309,6 +1324,7 @@ index 0000000000000000000000000000000000000000..dd72a34eaa4bedd9ea0b92eaa79091b0
+ static boolean verboseEnabled = false;
+ private static int historyInterval = -1;
+ private static int historyLength = -1;
+ private static boolean warnedAboutDeprecationOnEnable;
+
+ private Timings() {}
+
@@ -1343,6 +1359,7 @@ index 0000000000000000000000000000000000000000..dd72a34eaa4bedd9ea0b92eaa79091b0
+ @NotNull
+ public static Timing of(@NotNull Plugin plugin, @NotNull String name, @Nullable Timing groupHandler) {
+ Preconditions.checkNotNull(plugin, "Plugin can not be null");
+ Bukkit.getLogger().warning(String.format("Plugin '%s' is creating timing '%s' - this is deprecated behavior, please report it to the authors: %s", plugin.getName(), name, String.join(", ", plugin.getDescription().getAuthors())));
+ return TimingsManager.getHandler(plugin.getName(), name, groupHandler);
+ }
+
@@ -1399,9 +1416,40 @@ index 0000000000000000000000000000000000000000..dd72a34eaa4bedd9ea0b92eaa79091b0
+ */
+ public static void setTimingsEnabled(boolean enabled) {
+ timingsEnabled = enabled;
+ warnAboutDeprecationOnEnable();
+ reset();
+ }
+
+ private static void warnAboutDeprecationOnEnable() {
+ if (timingsEnabled && !warnedAboutDeprecationOnEnable) {
+ Bukkit.getLogger().warning(PlainTextComponentSerializer.plainText().serialize(deprecationMessage()));
+ warnedAboutDeprecationOnEnable = true;
+ }
+ }
+
+ public static Component deprecationMessage() {
+ return Component.text()
+ .color(TextColor.color(0xf3ef91))
+ .append(Component.text("[!] The timings profiler has been enabled but has been scheduled for removal from Paper in the future."))
+ .append(Component.newline())
+ .append(
+ Component.text(" We recommend installing the spark profiler as a replacement: ")
+ .append(
+ Component.text()
+ .content("https://spark.lucko.me/")
+ .clickEvent(ClickEvent.openUrl("https://spark.lucko.me/")))
+ )
+ .append(Component.newline())
+ .append(
+ Component.text(" For more information please visit: ")
+ .append(
+ Component.text()
+ .content("https://github.com/PaperMC/Paper/issues/8948")
+ .clickEvent(ClickEvent.openUrl("https://github.com/PaperMC/Paper/issues/8948")))
+ )
+ .build();
+ }
+
+ /**
+ * <p>Sets whether or not the Timings should monitor at Verbose level.</p>
+ *
@@ -1556,12 +1604,13 @@ index 0000000000000000000000000000000000000000..dd72a34eaa4bedd9ea0b92eaa79091b0
+ 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 0000000000000000000000000000000000000000..3132dc98d26c54c5e46162e53aaed195d7335c8d
index 0000000000000000000000000000000000000000..e801e79fa57c44b2e5d359647c920f88064826f1
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
@@ -0,0 +1,120 @@
@@ -0,0 +1,124 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -1601,6 +1650,7 @@ index 0000000000000000000000000000000000000000..3132dc98d26c54c5e46162e53aaed195
+import static net.kyori.adventure.text.Component.text;
+
+
+@Deprecated(forRemoval = true)
+public class TimingsCommand extends BukkitCommand {
+ private static final List<String> TIMINGS_SUBCOMMANDS = ImmutableList.of("report", "reset", "on", "off", "paste", "verbon", "verboff");
+ private long lastResetAttempt = 0;
@@ -1617,6 +1667,9 @@ index 0000000000000000000000000000000000000000..3132dc98d26c54c5e46162e53aaed195
+ if (!testPermission(sender)) {
+ return true;
+ }
+ if (false) {
+ sender.sendMessage(Timings.deprecationMessage());
+ }
+ if (args.length < 1) {
+ sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED));
+ return true;
@@ -1684,10 +1737,10 @@ index 0000000000000000000000000000000000000000..3132dc98d26c54c5e46162e53aaed195
+}
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 0000000000000000000000000000000000000000..a92925d41110226f7fda055b71ce7be60eedd038
index 0000000000000000000000000000000000000000..5e1558ca3ffeeaf2645fa003965474a442d650bf
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsManager.java
@@ -0,0 +1,188 @@
@@ -0,0 +1,192 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -1729,6 +1782,10 @@ index 0000000000000000000000000000000000000000..a92925d41110226f7fda055b71ce7be6
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * @deprecated Timings will likely be replaced with Spark in the future
+ */
+@Deprecated(forRemoval = true)
+public final class TimingsManager {
+ static final Map<TimingIdentifier, TimingHandler> TIMING_MAP = LoadingMap.of(
+ new ConcurrentHashMap<>(4096, .5F), TimingHandler::new
@@ -1878,10 +1935,10 @@ index 0000000000000000000000000000000000000000..a92925d41110226f7fda055b71ce7be6
+}
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 0000000000000000000000000000000000000000..34f4c02c3bdbe571a7efb1f8c61d8924b0c81268
index 0000000000000000000000000000000000000000..3af5b8ea795311582044c712de50d29412024b77
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -0,0 +1,86 @@
@@ -0,0 +1,87 @@
+package co.aikar.timings;
+
+import com.google.common.base.Preconditions;
@@ -1896,6 +1953,7 @@ index 0000000000000000000000000000000000000000..34f4c02c3bdbe571a7efb1f8c61d8924
+
+import java.util.List;
+
+@Deprecated(forRemoval = true)
+@SuppressWarnings("WeakerAccess")
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
+ private final List<CommandSender> senders;
@@ -2029,10 +2087,10 @@ index 0000000000000000000000000000000000000000..632c4961515f5052551f841cfa840e60
+}
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 0000000000000000000000000000000000000000..eff63c371c39e21a5a9cb5af8c2dcf78a60dd52b
index 0000000000000000000000000000000000000000..dae84243804b4b076cafb3e1b29bdcf614efc93f
--- /dev/null
+++ b/src/main/java/co/aikar/util/Counter.java
@@ -0,0 +1,38 @@
@@ -0,0 +1,39 @@
+package co.aikar.util;
+
+import com.google.common.collect.ForwardingMap;
@@ -2042,6 +2100,7 @@ index 0000000000000000000000000000000000000000..eff63c371c39e21a5a9cb5af8c2dcf78
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@Deprecated(forRemoval = true)
+public class Counter <T> extends ForwardingMap<T, Long> {
+ private final Map<T, Long> counts = new HashMap<>();
+
@@ -2073,10 +2132,10 @@ index 0000000000000000000000000000000000000000..eff63c371c39e21a5a9cb5af8c2dcf78
+}
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 0000000000000000000000000000000000000000..190bf0598442c89c2a1c93ad7c8c1a29797304ae
index 0000000000000000000000000000000000000000..c105a1429ca58b37be265708ec345e00f0d43ed8
--- /dev/null
+++ b/src/main/java/co/aikar/util/JSONUtil.java
@@ -0,0 +1,140 @@
@@ -0,0 +1,141 @@
+package co.aikar.util;
+
+import com.google.common.base.Function;
@@ -2096,6 +2155,7 @@ index 0000000000000000000000000000000000000000..190bf0598442c89c2a1c93ad7c8c1a29
+ * Provides Utility methods that assist with generating JSON Objects
+ */
+@SuppressWarnings({"rawtypes", "SuppressionAnnotation"})
+@Deprecated(forRemoval = true)
+public final class JSONUtil {
+ private JSONUtil() {}
+
@@ -2219,10 +2279,10 @@ index 0000000000000000000000000000000000000000..190bf0598442c89c2a1c93ad7c8c1a29
+}
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 0000000000000000000000000000000000000000..63a899c7dbdb69daa4876a2ce2a7dfb734b5af9d
index 0000000000000000000000000000000000000000..5753b9bce89db2ac378ec41f1b61907cc2e23335
--- /dev/null
+++ b/src/main/java/co/aikar/util/LoadingIntMap.java
@@ -0,0 +1,76 @@
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
+ *
@@ -2251,6 +2311,7 @@ index 0000000000000000000000000000000000000000..63a899c7dbdb69daa4876a2ce2a7dfb7
+ *
+ * @param <V> Value
+ */
+@Deprecated(forRemoval = true)
+public class LoadingIntMap<V> extends Int2ObjectOpenHashMap<V> {
+ private final Function<Integer, V> loader;
+
@@ -2301,10 +2362,10 @@ index 0000000000000000000000000000000000000000..63a899c7dbdb69daa4876a2ce2a7dfb7
+}
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 0000000000000000000000000000000000000000..aedbb03321886cb267879d7994653e447b485f6a
index 0000000000000000000000000000000000000000..1786eeb5cbeaad75602c9c5649bbcd9b2af5cf81
--- /dev/null
+++ b/src/main/java/co/aikar/util/LoadingMap.java
@@ -0,0 +1,368 @@
@@ -0,0 +1,369 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -2357,6 +2418,7 @@ index 0000000000000000000000000000000000000000..aedbb03321886cb267879d7994653e44
+ * @param <K> Key
+ * @param <V> Value
+ */
+@Deprecated(forRemoval = true)
+public class LoadingMap <K, V> extends AbstractMap<K, V> {
+ private final Map<K, V> backingMap;
+ private final java.util.function.Function<K, V> loader;
@@ -2675,10 +2737,10 @@ index 0000000000000000000000000000000000000000..aedbb03321886cb267879d7994653e44
+}
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 0000000000000000000000000000000000000000..5989ee21297935651b0edd44b8239e655eaef1d9
index 0000000000000000000000000000000000000000..3e61a926620a67daec3af54b72a1b911eaef2ed4
--- /dev/null
+++ b/src/main/java/co/aikar/util/MRUMapCache.java
@@ -0,0 +1,111 @@
@@ -0,0 +1,112 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -2717,6 +2779,7 @@ index 0000000000000000000000000000000000000000..5989ee21297935651b0edd44b8239e65
+ * @param <K> Key Type of the Map
+ * @param <V> Value Type of the Map
+ */
+@Deprecated(forRemoval = true)
+public class MRUMapCache<K, V> extends AbstractMap<K, V> {
+ final Map<K, V> backingMap;
+ Object cacheKey;
@@ -2791,10 +2854,10 @@ index 0000000000000000000000000000000000000000..5989ee21297935651b0edd44b8239e65
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 0084898567e8bb74fa271b65b56523a5c26d387c..e24589a4cb42b0163e4a1455b8b11d7130b5cd41 100644
index b7bc68c5d0dbb41c089f59b7db51342d45d1fc74..8d101352f72fc7fa21e0ba68039c79ce2fb92eb9 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -802,7 +802,6 @@ public final class Bukkit {
@@ -833,7 +833,6 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
@@ -2803,10 +2866,10 @@ index 0084898567e8bb74fa271b65b56523a5c26d387c..e24589a4cb42b0163e4a1455b8b11d71
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 892e03189957b0072827be4fd485dd98352334e8..ac087402c90dad4b3c499fcf8507e50e9099cea5 100644
index e3602c6703b29ffec17ef7806c9deb3eead8a112..3e642d8a0294f7290c3d4310813e6e8a467810e7 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1768,6 +1768,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1835,6 +1835,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2834,10 +2897,10 @@ index 892e03189957b0072827be4fd485dd98352334e8..ac087402c90dad4b3c499fcf8507e50e
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index dc9a4f12d9f05a3ae7c9f1c7648123e4b3dfd115..daf3ac72cae4d19c0273058dc6a1e1afe9a47f77 100644
index 0743592273cc1c5f4ab6935349941bf25b438448..659405d84b5a61618576e930805da5cd3a054b4c 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -33,6 +33,7 @@ public interface UnsafeValues {
@@ -36,6 +36,7 @@ public interface UnsafeValues {
net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException;
// Paper end
@@ -2845,7 +2908,7 @@ index dc9a4f12d9f05a3ae7c9f1c7648123e4b3dfd115..daf3ac72cae4d19c0273058dc6a1e1af
Material toLegacy(Material material);
Material fromLegacy(Material material);
@@ -106,4 +107,12 @@ public interface UnsafeValues {
@@ -119,4 +120,12 @@ public interface UnsafeValues {
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
}
// Paper end
@@ -2886,7 +2949,7 @@ index 0000000000000000000000000000000000000000..f9a00aecca5ec41b460bf41dfe1c6969
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index caa29be46e8541b69ec47c181eb3320d6515b544..6fd341482d5250ad814e870360e40b52427f799a 100644
index 75759131bd94b672bec4cd8e271ebff1ad391cba..5cfd88eec9bf02e83d77b6fce1a5c14b7687f48b 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 {
@@ -3392,10 +3455,10 @@ index 516d7fc7812aac343782861d0d567f54aa578c2a..00000000000000000000000000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index baf0887ec941533f8007f2c7f7ab78f16b45bd74..8d8a540c844e5365eed75a87db197a8fd4249bcd 100644
index e5a54a2f35d83f8c7a5f2b6512b86481aa7f9f51..c54d478035f7782074c00f870d41da8283fec538 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2077,7 +2077,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2346,7 +2346,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -3403,6 +3466,11 @@ index baf0887ec941533f8007f2c7f7ab78f16b45bd74..8d8a540c844e5365eed75a87db197a8f
+ }
+
+ // Paper start
+ /**
+ * @return the player's ping
+ * @deprecated use {@link Player#getPing()}
+ */
+ @Deprecated
+ public int getPing() {
+ throw new UnsupportedOperationException( "Not supported yet." );
}
@@ -3411,7 +3479,7 @@ index baf0887ec941533f8007f2c7f7ab78f16b45bd74..8d8a540c844e5365eed75a87db197a8f
@NotNull
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index f64a90241ce7f73e111e6b5ac6ff87cd93583c0e..f13dcbe448111b24b36105d25527ba87ccc9334e 100644
index 77f9ebbe675cf1b6a17e98d98e7666711998eb4e..63389474a2b3f0e283b42e7004aa6a94904a3d17 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -368,7 +368,6 @@ public final class SimplePluginManager implements PluginManager {
@@ -3538,7 +3606,7 @@ index 5ca863b3692b2e1b58e7fb4d82f554a92cc4f01e..612958a331575d1da2715531ebdf6b11
+
+}
diff --git a/src/main/java/org/spigotmc/CustomTimingsHandler.java b/src/main/java/org/spigotmc/CustomTimingsHandler.java
index 44badfedcc3fdc26bdc293b85d8c781d6f659faa..123647bb10fc89508437d7a0bd3fd31d58ee7c82 100644
index 44badfedcc3fdc26bdc293b85d8c781d6f659faa..12946bd55fcf7c40d39081779a7fa30049ee6165 100644
--- a/src/main/java/org/spigotmc/CustomTimingsHandler.java
+++ b/src/main/java/org/spigotmc/CustomTimingsHandler.java
@@ -1,137 +1,67 @@
@@ -3604,7 +3672,7 @@ index 44badfedcc3fdc26bdc293b85d8c781d6f659faa..123647bb10fc89508437d7a0bd3fd31d
- private long totalTime = 0;
- private long curTickTotal = 0;
- private long violations = 0;
+@Deprecated
+@Deprecated(forRemoval = true)
+public final class CustomTimingsHandler {
+ private final Timing handler;
@@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index e24589a4cb42b0163e4a1455b8b11d7130b5cd41..71a09ed2b9863d2d339967f41ab6373ec27429d3 100644
index 8d101352f72fc7fa21e0ba68039c79ce2fb92eb9..b5bdefc93d8614b5efbfd6e4c975275b9b53868c 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -76,6 +76,20 @@ public final class Bukkit {
@@ -78,6 +78,20 @@ public final class Bukkit {
return server;
}
@@ -32,10 +32,10 @@ index e24589a4cb42b0163e4a1455b8b11d7130b5cd41..71a09ed2b9863d2d339967f41ab6373e
* Attempts to set the {@link Server} singleton.
* <p>
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index ac087402c90dad4b3c499fcf8507e50e9099cea5..a4f8035b40eebff8afe01788781128b04247f28c 100644
index 3e642d8a0294f7290c3d4310813e6e8a467810e7..d4d87ce99ad757733a0f2dd1a02eb79f4ee7972f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -61,6 +61,18 @@ import org.jetbrains.annotations.Nullable;
@@ -63,6 +63,18 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
@@ -55,7 +55,7 @@ index ac087402c90dad4b3c499fcf8507e50e9099cea5..a4f8035b40eebff8afe01788781128b0
* Used for all administrative messages, such as an operator using a
* command.
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index f13dcbe448111b24b36105d25527ba87ccc9334e..3fcb73a0fc2daaeb76dd4c6757afce52c5b3118b 100644
index 63389474a2b3f0e283b42e7004aa6a94904a3d17..974ff7116b294473ec450757e8a9341540f43dcd 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -116,9 +116,22 @@ public final class SimplePluginManager implements PluginManager {
@@ -5,10 +5,10 @@ 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 8d8a540c844e5365eed75a87db197a8fd4249bcd..4ddea8d71723db4326459c96324a817c70492261 100644
index c54d478035f7782074c00f870d41da8283fec538..f21183cd5491b09e4543839252aed1ea10ddf849 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1916,6 +1916,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2198,6 +2198,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public String getLocale();
+4 -4
View File
@@ -5,10 +5,10 @@ Subject: [PATCH] Add getTPS method
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 71a09ed2b9863d2d339967f41ab6373ec27429d3..397f57f0ab4844fb88c60681bf6e6e3db8a98945 100644
index b5bdefc93d8614b5efbfd6e4c975275b9b53868c..67ef3471a5ded760950459db5e65d20ca18af967 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1891,6 +1891,17 @@ public final class Bukkit {
@@ -1964,6 +1964,17 @@ public final class Bukkit {
return server.getEntity(uuid);
}
@@ -27,10 +27,10 @@ index 71a09ed2b9863d2d339967f41ab6373ec27429d3..397f57f0ab4844fb88c60681bf6e6e3d
* 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 a4f8035b40eebff8afe01788781128b04247f28c..3f3531e208472a0e76f76e2b1a08a699527cef8f 100644
index d4d87ce99ad757733a0f2dd1a02eb79f4ee7972f..3b273e3ef2160ea3e436cabdfc4b33f605ab82c6 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1605,6 +1605,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1672,6 +1672,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
Entity getEntity(@NotNull UUID uuid);
+50 -27
View File
@@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c7
+ }
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index daf3ac72cae4d19c0273058dc6a1e1afe9a47f77..24fad8e59a3a5a174d24505cedda2a3fd52115b1 100644
index 659405d84b5a61618576e930805da5cd3a054b4c..4604392831d19a789e4906cf1a5f0197105fd6f2 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -114,5 +114,12 @@ public interface UnsafeValues {
@@ -127,5 +127,12 @@ public interface UnsafeValues {
* @return name
*/
String getTimingsServerName();
@@ -73,21 +73,24 @@ index daf3ac72cae4d19c0273058dc6a1e1afe9a47f77..24fad8e59a3a5a174d24505cedda2a3f
// Paper end
}
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c2f46935f 100644
index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b437cf212a63aa96a9492db8d01d5d37061aee23 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -1,5 +1,6 @@
package org.bukkit.command.defaults;
+import com.destroystokyo.paper.util.VersionFetcher; // Paper - version supplier
import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
@@ -26,6 +27,15 @@ import org.bukkit.util.StringUtil;
@@ -24,8 +24,25 @@ import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
+// Paper start - version command 2.0
+import com.destroystokyo.paper.util.VersionFetcher;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.event.ClickEvent;
+import net.kyori.adventure.text.format.TextDecoration;
+import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
+// Paper end - version command 2.0
public class VersionCommand extends BukkitCommand {
+ private VersionFetcher versionFetcher;
+ private VersionFetcher versionFetcher; // Paper - version command 2.0
+ private VersionFetcher getVersionFetcher() { // lazy load because unsafe isn't available at command registration
+ if (versionFetcher == null) {
+ versionFetcher = Bukkit.getUnsafe().getVersionFetcher();
@@ -99,7 +102,7 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
public VersionCommand(@NotNull String name) {
super(name);
@@ -40,7 +50,7 @@ public class VersionCommand extends BukkitCommand {
@@ -40,7 +57,7 @@ public class VersionCommand extends BukkitCommand {
if (!testPermission(sender)) return true;
if (args.length == 0) {
@@ -108,12 +111,32 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
sendVersion(sender);
} else {
StringBuilder name = new StringBuilder();
@@ -146,14 +156,14 @@ public class VersionCommand extends BukkitCommand {
@@ -79,8 +96,17 @@ public class VersionCommand extends BukkitCommand {
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());
-
+ // Paper start - version command 2.0
+ sender.sendMessage(
+ Component.text()
+ .append(Component.text(desc.getName(), NamedTextColor.GREEN))
+ .append(Component.text(" version "))
+ .append(Component.text(desc.getVersion(), NamedTextColor.GREEN)
+ .hoverEvent(Component.text("Click to copy to clipboard", NamedTextColor.WHITE))
+ .clickEvent(ClickEvent.copyToClipboard(desc.getVersion()))
+ )
+ );
+ // Paper end - version command 2.0
if (desc.getDescription() != null) {
sender.sendMessage(desc.getDescription());
}
@@ -146,14 +172,14 @@ public class VersionCommand extends BukkitCommand {
private final ReentrantLock versionLock = new ReentrantLock();
private boolean hasVersion = false;
- private String versionMessage = null;
+ private net.kyori.adventure.text.Component versionMessage = null; // Paper
+ private Component versionMessage = null; // Paper
private final Set<CommandSender> versionWaiters = new HashSet<CommandSender>();
private boolean versionTaskStarted = false;
private long lastCheck = 0;
@@ -125,22 +148,22 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
lastCheck = System.currentTimeMillis();
hasVersion = false;
} else {
@@ -168,7 +178,7 @@ public class VersionCommand extends BukkitCommand {
@@ -168,7 +194,7 @@ public class VersionCommand extends BukkitCommand {
return;
}
versionWaiters.add(sender);
- sender.sendMessage("Checking version, please wait...");
+ sender.sendMessage(net.kyori.adventure.text.Component.text("Checking version, please wait...", net.kyori.adventure.text.format.NamedTextColor.WHITE, net.kyori.adventure.text.format.TextDecoration.ITALIC)); // Paper
+ sender.sendMessage(Component.text("Checking version, please wait...", NamedTextColor.WHITE, TextDecoration.ITALIC)); // Paper
if (!versionTaskStarted) {
versionTaskStarted = true;
new Thread(new Runnable() {
@@ -186,6 +196,13 @@ public class VersionCommand extends BukkitCommand {
@@ -186,6 +212,13 @@ public class VersionCommand extends BukkitCommand {
private void obtainVersion() {
String version = Bukkit.getVersion();
+ // Paper start
+ if (version.startsWith("null")) { // running from ide?
+ setVersionMessage(net.kyori.adventure.text.Component.text("Unknown version, custom build?", net.kyori.adventure.text.format.NamedTextColor.YELLOW));
+ setVersionMessage(Component.text("Unknown version, custom build?", NamedTextColor.YELLOW));
+ return;
+ }
+ setVersionMessage(getVersionFetcher().getVersionMessage(version));
@@ -148,7 +171,7 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
if (version == null) version = "Custom";
String[] parts = version.substring(0, version.indexOf(' ')).split("-");
if (parts.length == 4) {
@@ -215,11 +232,24 @@ public class VersionCommand extends BukkitCommand {
@@ -215,11 +248,24 @@ public class VersionCommand extends BukkitCommand {
} else {
setVersionMessage("Unknown version, custom build?");
}
@@ -158,18 +181,18 @@ index 04b4fb6859df0221f8f9f92c5a7ac2dda1073355..b50f614806f4634960d383e8a33f094c
- private void setVersionMessage(@NotNull String msg) {
+ // Paper start
+ private void setVersionMessage(final @NotNull net.kyori.adventure.text.Component msg) {
+ private void setVersionMessage(final @NotNull Component msg) {
lastCheck = System.currentTimeMillis();
- versionMessage = msg;
+ final net.kyori.adventure.text.Component message = net.kyori.adventure.text.TextComponent.ofChildren(
+ net.kyori.adventure.text.Component.text("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")", net.kyori.adventure.text.format.NamedTextColor.WHITE),
+ net.kyori.adventure.text.Component.newline(),
+ final Component message = Component.textOfChildren(
+ Component.text("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")", NamedTextColor.WHITE),
+ Component.newline(),
+ msg
+ );
+ this.versionMessage = net.kyori.adventure.text.Component.text()
+ this.versionMessage = Component.text()
+ .append(message)
+ .hoverEvent(net.kyori.adventure.text.Component.text("Click to copy to clipboard", net.kyori.adventure.text.format.NamedTextColor.WHITE))
+ .clickEvent(net.kyori.adventure.text.event.ClickEvent.copyToClipboard(net.kyori.adventure.text.serializer.plain.PlainComponentSerializer.plain().serialize(message)))
+ .hoverEvent(Component.text("Click to copy to clipboard", NamedTextColor.WHITE))
+ .clickEvent(ClickEvent.copyToClipboard(PlainTextComponentSerializer.plainText().serialize(message)))
+ .build();
+ // Paper end
versionLock.lock();
+7 -7
View File
@@ -5,10 +5,10 @@ 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 0a539af95e1bd331cec241403a15e4e6dbf6d996..1b0b365905d4e7f77d3f792797816eeb35d31c69 100644
index 121cd27185269339babae1757a604fbb5aabc869..63137429779d06fafb162f1bfb823d5149b3c58a 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -724,5 +724,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -739,5 +739,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.customName())));
}
@@ -25,15 +25,15 @@ index 0a539af95e1bd331cec241403a15e4e6dbf6d996..1b0b365905d4e7f77d3f792797816eeb
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index 64f9d3fd870d65afd2ee9a85625b149163eee144..14cb0d770561151570ab4399ca5facff43076819 100644
index d96fd494b523491fcf1ac54d164351fd487f65d6..ae1ce2ee2deb82f3f4144ec54b3ba119b437c5e9 100644
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
@@ -54,4 +54,15 @@ public interface FallingBlock extends Entity {
* @param hurtEntities whether entities will be damaged by this block.
@@ -126,4 +126,15 @@ public interface FallingBlock extends Entity {
* @param damage the max damage to set. Must be >= 0
*/
void setHurtEntities(boolean hurtEntities);
void setMaxDamage(int damage);
+
+ /**
+ /**
+ * Gets the source block location of the FallingBlock
+ *
+ * @return the source block location the FallingBlock was spawned from
@@ -6,22 +6,23 @@ Subject: [PATCH] Add PlayerLocaleChangeEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..29dd763a99ce7c6ecb176b9fb346a400369d48a0
index 0000000000000000000000000000000000000000..bb7baa91fd4ba763fd8ce216bc9043c5e2c4b7b7
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerLocaleChangeEvent.java
@@ -0,0 +1,50 @@
@@ -0,0 +1,51 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.jetbrains.annotations.ApiStatus;
+
+/**
+ * Called when the locale of the player is changed.
+ *
+ * @deprecated Replaced by {@link org.bukkit.event.player.PlayerLocaleChangeEvent} upstream
+ */
+@Deprecated
+@Deprecated(forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.21")
+public class PlayerLocaleChangeEvent extends PlayerEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private final String oldLocale;
+4 -4
View File
@@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances.
Also add send/no-tick view distance to World.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index ed57cd69d88504b78782271c9a3d423a29471674..8a6a548314eef8d486be908e38e3a4562f26bdb4 100644
index 1403d28bf9124e3c4cd741dfda06400318e8a0a0..3559115d09b57acf5c2853b811862e5131f2a625 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2698,6 +2698,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2663,6 +2663,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
int getSimulationDistance();
// Spigot end
@@ -75,10 +75,10 @@ index ed57cd69d88504b78782271c9a3d423a29471674..8a6a548314eef8d486be908e38e3a456
public class Spigot {
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 4ddea8d71723db4326459c96324a817c70492261..a8310063973bb18502d561903b78149a6fda4939 100644
index f21183cd5491b09e4543839252aed1ea10ddf849..f9b9e0269b3a9402c5be1c1c2007956415ff708a 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1930,6 +1930,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2212,6 +2212,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param affects Whether the player can affect mob spawning
*/
public void setAffectsSpawning(boolean affects);
@@ -7,21 +7,22 @@ For modifying a player's initial spawn location as they join the server
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..626e97bbcaa19d55475a0fc8770412d437af2733
index 0000000000000000000000000000000000000000..febd384b43560d7d55c96bda5b0701a27fc9e18e
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerInitialSpawnEvent.java
@@ -0,0 +1,17 @@
@@ -0,0 +1,18 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.spigotmc.event.player.PlayerSpawnLocationEvent;
+
+/**
+ * @deprecated Use {@link PlayerSpawnLocationEvent}, Duplicate API
+ */
+@Deprecated
+@Deprecated(forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.21")
+public class PlayerInitialSpawnEvent extends PlayerSpawnLocationEvent {
+
+ public PlayerInitialSpawnEvent(@NotNull Player who, @NotNull Location spawnLocation) {
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 397f57f0ab4844fb88c60681bf6e6e3db8a98945..1035ce181415a19f8d6460f70d3d900e3f7017d3 100644
index 67ef3471a5ded760950459db5e65d20ca18af967..b53e94d79862d66165bbcd2a79b82770398a7f3e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2092,6 +2092,19 @@ public final class Bukkit {
@@ -2165,6 +2165,19 @@ public final class Bukkit {
return server.getUnsafe();
}
@@ -29,10 +29,10 @@ index 397f57f0ab4844fb88c60681bf6e6e3db8a98945..1035ce181415a19f8d6460f70d3d900e
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 3f3531e208472a0e76f76e2b1a08a699527cef8f..6a7b91af3e738613cf79c13e2844efe9a2efd254 100644
index 3b273e3ef2160ea3e436cabdfc4b33f605ab82c6..124e88e512d24b6ff7ace3cf7d5a6adf4c2bb40d 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1615,6 +1615,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1682,6 +1682,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public double[] getTPS();
// Paper end
@@ -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 1035ce181415a19f8d6460f70d3d900e3f7017d3..316146305465b68b703e898206745de94ad5350f 100644
index b53e94d79862d66165bbcd2a79b82770398a7f3e..9417030074fccdd9113bf75eb8f17f74b9a9118b 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -379,6 +379,30 @@ public final class Bukkit {
@@ -410,6 +410,30 @@ public final class Bukkit {
return server.broadcastMessage(message);
}
@@ -41,10 +41,10 @@ index 1035ce181415a19f8d6460f70d3d900e3f7017d3..316146305465b68b703e898206745de9
* 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 6a7b91af3e738613cf79c13e2844efe9a2efd254..bef555b3de44fed312b45a5d5cd811b18fda88c8 100644
index 124e88e512d24b6ff7ace3cf7d5a6adf4c2bb40d..ccc825a2ea43bb84a5a08dff00c4d8ec27e4e95a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -312,6 +312,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -345,6 +345,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Deprecated // Paper
public int broadcastMessage(@NotNull String message);
@@ -76,10 +76,10 @@ index 6a7b91af3e738613cf79c13e2844efe9a2efd254..bef555b3de44fed312b45a5d5cd811b1
* 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 a8310063973bb18502d561903b78149a6fda4939..a2c813d6d94ae2a87278d92445635ae8dd3ab00a 100644
index f9b9e0269b3a9402c5be1c1c2007956415ff708a..284bb156c4430a9a8afce0a7dffa96722b8c29cc 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -813,6 +813,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1041,6 +1041,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendMap(@NotNull MapView map);
@@ -120,5 +120,5 @@ index a8310063973bb18502d561903b78149a6fda4939..a2c813d6d94ae2a87278d92445635ae8
+ // Paper end
+
/**
* Add custom chat completion suggestions shown to the player while typing a
* message.
* Send a hurt animation. This fakes incoming damage towards the player from
* the given yaw relative to the player's direction.
@@ -322,7 +322,7 @@ index 0000000000000000000000000000000000000000..be3f92e3c6bcefe8b78da701b7512127
+}
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 0000000000000000000000000000000000000000..89e132525cfae0ce979e37b3e2793df781e47227
index 0000000000000000000000000000000000000000..2faef4cb358ec65e32a6aba6426f0dd7ddf90d2a
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/exception/ServerPluginMessageException.java
@@ -0,0 +1,64 @@
@@ -364,7 +364,7 @@ index 0000000000000000000000000000000000000000..89e132525cfae0ce979e37b3e2793df7
+ }
+
+ /**
+ * Gets the channel to which the error occurred from recieving data from
+ * Gets the channel to which the error occurred from receiving data from
+ *
+ * @return exception channel
+ */
@@ -493,7 +493,7 @@ index 4205649948a9e2a72f64c3f007112245abac6d50..b3b32ce429edbf1ed040354dbe28ab86
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 3fcb73a0fc2daaeb76dd4c6757afce52c5b3118b..2b8308989fce7f8a16907f8711b362e671fdbfb6 100644
index 974ff7116b294473ec450757e8a9341540f43dcd..fc2dae69165776d08274e34a69962cc70445f411 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -515,7 +515,8 @@ public final class SimplePluginManager implements PluginManager {
@@ -5,7 +5,7 @@ Subject: [PATCH] Add BaseComponent sendMessage methods to CommandSender
diff --git a/src/main/java/org/bukkit/command/CommandSender.java b/src/main/java/org/bukkit/command/CommandSender.java
index 5e7f8822a17459583d9950dc09e3888f492bfd87..d0e1fbb58c5ce71bf2b8d9db9aa3c1b4ca797435 100644
index 70fec73328227725f519af845ecbdce8be2fa4e2..04e7cd0e4e2d0eb38fb2862ce6688a4470f30d6b 100644
--- a/src/main/java/org/bukkit/command/CommandSender.java
+++ b/src/main/java/org/bukkit/command/CommandSender.java
@@ -1,6 +1,9 @@
@@ -18,7 +18,7 @@ index 5e7f8822a17459583d9950dc09e3888f492bfd87..d0e1fbb58c5ce71bf2b8d9db9aa3c1b4
import org.bukkit.Server;
import org.bukkit.permissions.Permissible;
import org.jetbrains.annotations.NotNull;
@@ -145,5 +148,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe
@@ -168,5 +171,33 @@ public interface CommandSender extends net.kyori.adventure.audience.Audience, Pe
default void sendPlainMessage(final @NotNull String message) {
this.sendMessage(net.kyori.adventure.text.Component.text(message));
}
@@ -432,10 +432,10 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a2c813d6d94ae2a87278d92445635ae8dd3ab00a..3e2b8c1ae51404352adccc9ad108982173306ee9 100644
index 284bb156c4430a9a8afce0a7dffa96722b8c29cc..d5746291dd0cfc32591482945040e992ad1efb8e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -847,6 +847,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1075,6 +1075,131 @@ 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);
}
@@ -7,7 +7,7 @@ Upstream added methods for this so the original methods
are now deprecated
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 2b816f0e6bdb912ceeff82c0043272b3970fe243..9977bb3cb5a66c84db816f8e4597db1c053f77c8 100644
index 7c82644de3c438f45476ac02ce2c51c6fdbd543a..390bb294d09389877937ee2c6c3f346e65dfb178 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -215,12 +215,26 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -38,7 +38,7 @@ index 2b816f0e6bdb912ceeff82c0043272b3970fe243..9977bb3cb5a66c84db816f8e4597db1c
/**
* Returns the living entity's current maximum no damage ticks.
@@ -689,4 +703,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -722,4 +736,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @return Whether the entity is invisible
*/
public boolean isInvisible();
@@ -5,10 +5,10 @@ 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 3e2b8c1ae51404352adccc9ad108982173306ee9..cdc67b2c6770119ada67033b388befa607bd46db 100644
index d5746291dd0cfc32591482945040e992ad1efb8e..e12d28143a213abdc0552a15e82cacecc414ca26 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1394,7 +1394,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1655,7 +1655,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.
@@ -18,7 +18,7 @@ index 3e2b8c1ae51404352adccc9ad108982173306ee9..cdc67b2c6770119ada67033b388befa6
public void setResourcePack(@NotNull String url);
/**
@@ -2210,6 +2212,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2502,6 +2504,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.displayName())));
}
@@ -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 316146305465b68b703e898206745de94ad5350f..6311d7ef36b3c6922c73695c353c561c507f2128 100644
index 9417030074fccdd9113bf75eb8f17f74b9a9118b..9003a603b6bf82a7b6f04fa027cdc889cf7c274f 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2127,6 +2127,13 @@ public final class Bukkit {
@@ -2200,6 +2200,13 @@ public final class Bukkit {
public static org.bukkit.command.CommandMap getCommandMap() {
return server.getCommandMap();
}
@@ -24,10 +24,10 @@ index 316146305465b68b703e898206745de94ad5350f..6311d7ef36b3c6922c73695c353c561c
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index bef555b3de44fed312b45a5d5cd811b18fda88c8..994f494fe7cace5c88738858def4051788391a3c 100644
index ccc825a2ea43bb84a5a08dff00c4d8ec27e4e95a..45e628f6c47945ce008d8436e3b13325bb5084d8 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1876,4 +1876,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1943,4 +1943,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
Spigot spigot();
// Spigot end
@@ -3,56 +3,96 @@ From: Jedediah Smith <jedediah@silencegreys.com>
Date: Sat, 2 Apr 2016 05:08:36 -0400
Subject: [PATCH] Add PlayerUseUnknownEntityEvent
Adds the PlayerUseUnknownEntityEvent to be used by plugins dealing with
virtual entities/entities that are not actually known to the server.
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
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 0000000000000000000000000000000000000000..09cfdf48ead8f03f3497646537292174241b0868
index 0000000000000000000000000000000000000000..a7228e248e3d8eb2e9f011dfe2c7dd9f3f48000f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
@@ -0,0 +1,46 @@
@@ -0,0 +1,82 @@
+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.bukkit.util.Vector;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Represents an event that is called when a player right-clicks an unknown entity.
+ * Useful for plugins dealing with virtual entities (entities that don't actually spawned on the server).
+ * <br>
+ * This event may be called multiple times per interaction with different interaction hands
+ * and with or without the clicked position.
+ */
+public class PlayerUseUnknownEntityEvent extends PlayerEvent {
+
+ private static final HandlerList handlers = new HandlerList();
+ private static final HandlerList HANDLERS = new HandlerList();
+ private final int entityId;
+ private final boolean attack;
+ @NotNull private final EquipmentSlot hand;
+ private final @NotNull EquipmentSlot hand;
+ private final @Nullable Vector clickedPosition;
+
+ public PlayerUseUnknownEntityEvent(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand) {
+ public PlayerUseUnknownEntityEvent(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand, @Nullable Vector clickedPosition) {
+ super(who);
+ this.entityId = entityId;
+ this.attack = attack;
+ this.hand = hand;
+ this.clickedPosition = clickedPosition;
+ }
+
+ /**
+ * Returns the entity id of the unknown entity that was interacted with.
+ *
+ * @return the entity id of the entity that was interacted with
+ */
+ public int getEntityId() {
+ return this.entityId;
+ }
+
+ /**
+ * Returns whether the interaction was an attack.
+ *
+ * @return true if the player is attacking the entity, false if the player is interacting with the entity
+ */
+ public boolean isAttack() {
+ return this.attack;
+ }
+
+ @NotNull
+ public EquipmentSlot getHand() {
+ /**
+ * Returns the hand used to perform this interaction.
+ *
+ * @return the hand used to interact
+ */
+ public @NotNull EquipmentSlot getHand() {
+ return this.hand;
+ }
+
+ /**
+ * Returns the position relative to the entity that was clicked, or null if not available.
+ * See {@link org.bukkit.event.player.PlayerInteractAtEntityEvent} for more details.
+ *
+ * @return the position relative to the entity that was clicked, or null if not available
+ * @see org.bukkit.event.player.PlayerInteractAtEntityEvent
+ */
+ public @Nullable Vector getClickedRelativePosition() {
+ return this.clickedPosition != null ? this.clickedPosition.clone() : null;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ return HANDLERS;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLERS;
+ }
+}
+21 -2
View File
@@ -58,10 +58,10 @@ index 0000000000000000000000000000000000000000..b387894fe8001edb41ad2ad2b70ebabe
+}
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 0000000000000000000000000000000000000000..97815eeb231cf0706b34fa47a4f7d1bb786305b4
index 0000000000000000000000000000000000000000..2b01a50b6e18856f4c9e28340a7a111cae646a0a
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/loottable/LootableInventory.java
@@ -0,0 +1,116 @@
@@ -0,0 +1,125 @@
+package com.destroystokyo.paper.loottable;
+
+import org.bukkit.entity.Player;
@@ -106,6 +106,15 @@ index 0000000000000000000000000000000000000000..97815eeb231cf0706b34fa47a4f7d1bb
+ }
+
+ /**
+ * Checks if this player can loot this block. Takes into account the "restrict player reloot" settings
+ *
+ * @param player the player to check
+ *
+ * @return Whether this player can loot this block
+ */
+ boolean canPlayerLoot(@NotNull UUID player);
+
+ /**
+ * Has this player ever looted this block
+ * @param player The player to check
+ * @return Whether or not this player has looted this block
@@ -229,6 +238,16 @@ index 0000000000000000000000000000000000000000..fd184f13f5e8ee5cf829fff4f44696e1
+ cancelled = cancel;
+ }
+}
diff --git a/src/main/java/org/bukkit/block/Barrel.java b/src/main/java/org/bukkit/block/Barrel.java
index aa1bb7a1a1c94b0b029bb60026efbc7f55584dd7..d3789b2b7dd71d7c1872a0d84698d35a1884101b 100644
--- a/src/main/java/org/bukkit/block/Barrel.java
+++ b/src/main/java/org/bukkit/block/Barrel.java
@@ -5,4 +5,4 @@ import org.bukkit.loot.Lootable;
/**
* Represents a captured state of a Barrel.
*/
-public interface Barrel extends Container, Lootable, Lidded { }
+public interface Barrel extends Container, com.destroystokyo.paper.loottable.LootableBlockInventory, Lidded { } // Paper
diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java
index b451191312e4fb19f2131c2d0a0c0337953f6c7c..db6affbc78106b2d93b41953b624a0bca0ca1d72 100644
--- a/src/main/java/org/bukkit/block/Chest.java
@@ -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 6311d7ef36b3c6922c73695c353c561c507f2128..a314ff1363cb527fa7e1b366f9191939e9c7ca6e 100644
index 9003a603b6bf82a7b6f04fa027cdc889cf7c274f..297f7befdac5c45efb1c9f432c49696814f513ab 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2134,6 +2134,15 @@ public final class Bukkit {
@@ -2207,6 +2207,15 @@ public final class Bukkit {
public static void reloadPermissions() {
server.reloadPermissions();
}
@@ -26,10 +26,10 @@ index 6311d7ef36b3c6922c73695c353c561c507f2128..a314ff1363cb527fa7e1b366f9191939
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 994f494fe7cace5c88738858def4051788391a3c..610475aff60b7f19c4bedb932985c736fb890684 100644
index 45e628f6c47945ce008d8436e3b13325bb5084d8..d80e9a6770c565c2cdb6bea6ad14969a6a6d0dad 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1878,4 +1878,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1945,4 +1945,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
// Spigot end
void reloadPermissions(); // Paper
@@ -5,10 +5,10 @@ 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 cdc67b2c6770119ada67033b388befa607bd46db..0fdaf416960ace84fbe9b9c461641efbb8b631a4 100644
index e12d28143a213abdc0552a15e82cacecc414ca26..3954f40b23536fec495585a8b14e82d092d62e39 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -814,6 +814,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1042,6 +1042,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@@ -48,7 +48,7 @@ index cdc67b2c6770119ada67033b388befa607bd46db..0fdaf416960ace84fbe9b9c461641efb
/**
* Sends the component to the player
*
@@ -841,9 +874,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1069,9 +1102,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
*
@@ -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 8a6a548314eef8d486be908e38e3a4562f26bdb4..749d3de7dad480965be536938733d72bdfc2995b 100644
index 3559115d09b57acf5c2853b811862e5131f2a625..dbb799aed5bbb80edd2428b63d3fce15cf2e2f05 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -45,6 +45,33 @@ import org.jetbrains.annotations.Nullable;
@@ -47,6 +47,33 @@ import org.jetbrains.annotations.Nullable;
*/
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, Keyed, net.kyori.adventure.audience.ForwardingAudience { // Paper
@@ -5,7 +5,7 @@ Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check
diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java
index b1c08a7fc5856bcc29ee64d0a87b95a8ac940ddc..0f2f17f0a443ec5087b3373293b23f663be9dbe1 100644
index b1c08a7fc5856bcc29ee64d0a87b95a8ac940ddc..3ab5700b0b13fbfbf7c5b0b2c4a90bcc1e0a2d9c 100644
--- a/src/main/java/org/bukkit/WorldBorder.java
+++ b/src/main/java/org/bukkit/WorldBorder.java
@@ -162,4 +162,18 @@ public interface WorldBorder {
@@ -21,7 +21,7 @@ index b1c08a7fc5856bcc29ee64d0a87b95a8ac940ddc..0f2f17f0a443ec5087b3373293b23f66
+ * @return true if the location is within the bounds of this border, false otherwise.
+ * @deprecated use {@link #isInside(Location)} for an upstream compatible replacement
+ */
+ @Deprecated
+ @Deprecated(forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.21")
+ public default boolean isInBounds(@NotNull Location location) {
+ return this.isInside(location);
+ }
@@ -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 a314ff1363cb527fa7e1b366f9191939e9c7ca6e..d3d8c5ac59cee2ec24e91223e0c994016a4f9752 100644
index 297f7befdac5c45efb1c9f432c49696814f513ab..add298a1a0b6f6dbd72fe9e8f87794d193760fb7 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2143,6 +2143,16 @@ public final class Bukkit {
@@ -2216,6 +2216,16 @@ public final class Bukkit {
public static boolean reloadCommandAliases() {
return server.reloadCommandAliases();
}
@@ -27,10 +27,10 @@ index a314ff1363cb527fa7e1b366f9191939e9c7ca6e..d3d8c5ac59cee2ec24e91223e0c99401
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 610475aff60b7f19c4bedb932985c736fb890684..a8d3addae5b0ed261d6a27052ad4e54970de597c 100644
index d80e9a6770c565c2cdb6bea6ad14969a6a6d0dad..22d508a6c80d7e19352bceb57009fdbcb16bc723 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1880,4 +1880,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1947,4 +1947,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
void reloadPermissions(); // Paper
boolean reloadCommandAliases(); // Paper
@@ -46,7 +46,7 @@ index 610475aff60b7f19c4bedb932985c736fb890684..a8d3addae5b0ed261d6a27052ad4e549
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 6fd341482d5250ad814e870360e40b52427f799a..a26df5f6341d22ecd5e71da59b8f091848e627ad 100644
index 5cfd88eec9bf02e83d77b6fce1a5c14b7687f48b..1c6205cc667bbec8f6aca479f13b3e9cfcd63ab2 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -99,7 +99,7 @@ public abstract class Command {
+795 -14
View File
@@ -3,13 +3,56 @@ From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 10 Jun 2017 16:59:40 -0500
Subject: [PATCH] Fix upstream javadocs
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/BanList.java b/src/main/java/org/bukkit/BanList.java
index a04cde615f8c4bc593f8d9f8f6f1438008aaa707..548f6d28c28d74bed8b58ee82875909354afe132 100644
--- a/src/main/java/org/bukkit/BanList.java
+++ b/src/main/java/org/bukkit/BanList.java
@@ -38,6 +38,9 @@ public interface BanList<T> {
/**
* Gets a {@link BanEntry} by target.
+ * <p>
+ * Bans by name for ban type {@link Type#NAME NAME} are no longer supported and this method will return
+ * null when trying to request them. The replacement is bans by UUID.
*
* @param target entry parameter to search for
* @return the corresponding entry, or null if none found
@@ -59,6 +62,9 @@ public interface BanList<T> {
/**
* Adds a ban to this list. If a previous ban exists, this will
* update the previous entry.
+ * <p>
+ * Bans by name for ban type {@link Type#NAME NAME} are no longer supported and this method will return
+ * null when trying to request them. The replacement is bans by UUID.
*
* @param target the target of the ban
* @param reason reason for the ban, null indicates implementation default
@@ -139,6 +145,9 @@ public interface BanList<T> {
/**
* Gets if a {@link BanEntry} exists for the target, indicating an active
* ban status.
+ * <p>
+ * Bans by name for ban type {@link Type#NAME NAME} are no longer supported.
+ * The replacement is bans by UUID.
*
* @param target the target to find
* @return true if a {@link BanEntry} exists for the target, indicating an
@@ -161,6 +170,9 @@ public interface BanList<T> {
/**
* Removes the specified target from this list, therefore indicating a
* "not banned" status.
+ * <p>
+ * Bans by name for ban type {@link Type#NAME NAME} are no longer supported.
+ * The replacement is bans by UUID.
*
* @param target the target to remove from this list
*/
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index d3d8c5ac59cee2ec24e91223e0c994016a4f9752..82757d3013e01a6bfbb685929955d3e7dad8508c 100644
index add298a1a0b6f6dbd72fe9e8f87794d193760fb7..b21f90f291a087b6282cd7b55e0075a01729f0ba 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1334,6 +1334,8 @@ public final class Bukkit {
@@ -1388,6 +1388,8 @@ public final class Bukkit {
/**
* Gets every player that has ever played on this server.
@@ -31,11 +74,50 @@ index 0cf808356a1a5c6fc4bcf97a694ed9beb80a776a..dc765dea47a9a1c1520fb16ddb24f814
* @param z Z-coordinate (0-15)
* @return temperature at given coordinate
*/
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
index 02de62c083ceaa466c80cb732e8304b8cc3f07f8..7c2b1eff41dd43fda84d84e76c05bbbf37c186b8 100644
--- a/src/main/java/org/bukkit/RegionAccessor.java
+++ b/src/main/java/org/bukkit/RegionAccessor.java
@@ -158,7 +158,7 @@ public interface RegionAccessor {
* Creates a tree at the given {@link Location}
*
* @param location Location to spawn the tree
- * @param random Random to use to generated the tree
+ * @param random Random to use to generate the tree
* @param type Type of the tree to create
* @return true if the tree was created successfully, otherwise false
*/
@@ -170,14 +170,14 @@ public interface RegionAccessor {
* The provided consumer gets called for every block which gets changed
* as a result of the tree generation. When the consumer gets called no
* modifications to the world are done yet. Which means, that calling
- * {@link #getBlockState(Location)} in the consumer while return the state
+ * {@link #getBlockState(Location)} in the consumer will return the state
* of the block before the generation.
* <p>
* Modifications done to the {@link BlockState} in the consumer are respected,
* which means that it is not necessary to call {@link BlockState#update()}
*
* @param location Location to spawn the tree
- * @param random Random to use to generated the tree
+ * @param random Random to use to generate the tree
* @param type Type of the tree to create
* @param stateConsumer The consumer which should get called for every block which gets changed
* @return true if the tree was created successfully, otherwise false
@@ -197,7 +197,7 @@ public interface RegionAccessor {
* If it returns {@code false} the block won't get set in the world.
*
* @param location Location to spawn the tree
- * @param random Random to use to generated the tree
+ * @param random Random to use to generate the tree
* @param type Type of the tree to create
* @param statePredicate The predicate which should get used to test if a block should be set or not.
* @return true if the tree was created successfully, otherwise false
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index a8d3addae5b0ed261d6a27052ad4e54970de597c..3485db7548e93242f99977a236eb3bcebedfb964 100644
index 22d508a6c80d7e19352bceb57009fdbcb16bc723..3c1862b9a9293155f756615b5bd23cc810a6df5e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -510,13 +510,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -543,13 +543,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* </ul>
* <p>
* <b>Note:</b> If set to 0, {@link SpawnCategory} mobs spawning will be disabled.
@@ -50,7 +132,7 @@ index a8d3addae5b0ed261d6a27052ad4e54970de597c..3485db7548e93242f99977a236eb3bce
*/
public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory);
@@ -1129,6 +1126,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1181,6 +1178,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
/**
* Gets every player that has ever played on this server.
@@ -59,6 +141,37 @@ index a8d3addae5b0ed261d6a27052ad4e54970de597c..3485db7548e93242f99977a236eb3bce
*
* @return an array containing all previous players
*/
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index dbb799aed5bbb80edd2428b63d3fce15cf2e2f05..609e4908ed21f69b9e813500e702bbe784bff00c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2577,7 +2577,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Find the closest nearby structure of a given {@link StructureType}.
* Finding unexplored structures can, and will, block if the world is
- * looking in chunks that gave not generated yet. This can lead to the world
+ * looking in chunks that have not generated yet. This can lead to the world
* temporarily freezing while locating an unexplored structure.
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
@@ -2611,7 +2611,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Find the closest nearby structure of a given {@link StructureType}.
* Finding unexplored structures can, and will, block if the world is
- * looking in chunks that gave not generated yet. This can lead to the world
+ * looking in chunks that have not generated yet. This can lead to the world
* temporarily freezing while locating an unexplored structure.
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
@@ -2644,7 +2644,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Find the closest nearby structure of a given {@link Structure}. Finding
* unexplored structures can, and will, block if the world is looking in
- * chunks that gave not generated yet. This can lead to the world
+ * chunks that have not generated yet. This can lead to the world
* temporarily freezing while locating an unexplored structure.
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
diff --git a/src/main/java/org/bukkit/block/Bed.java b/src/main/java/org/bukkit/block/Bed.java
index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888ed56e79e 100644
--- a/src/main/java/org/bukkit/block/Bed.java
@@ -89,6 +202,93 @@ index f9bd74f9ce6bd6650726e5a993f9b6e292cdc74d..f4c37ce1fe7aac3dde8485ee51fc8888
+ void setColor(@org.bukkit.UndefinedNullability("not supported") org.bukkit.DyeColor color);
+// Paper end
+}
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index f8e12868f2e629cdf4784f0157fdb2f8e7b01f99..870ad6cd930653e6248abcc0fce94ffafbe9ebde 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -357,7 +357,7 @@ public interface Block extends Metadatable, Translatable {
* Gets the temperature of this block.
* <p>
* If the raw biome temperature without adjusting for height effects is
- * required then please use {@link World#getTemperature(int, int)}.
+ * required then please use {@link World#getTemperature(int, int, int)}.
*
* @return Temperature of this block
*/
diff --git a/src/main/java/org/bukkit/block/data/BlockData.java b/src/main/java/org/bukkit/block/data/BlockData.java
index 2e2232956f626669005cfdfd6550aa8ee29fc1ab..869fa47a13fbcb128228963bf53cc72da4499a01 100644
--- a/src/main/java/org/bukkit/block/data/BlockData.java
+++ b/src/main/java/org/bukkit/block/data/BlockData.java
@@ -215,7 +215,7 @@ public interface BlockData extends Cloneable {
* {@link Material#REDSTONE_WIRE} -> {@link Material#REDSTONE}
* {@link Material#CARROTS} -> {@link Material#CARROT}
* </pre>
- * @return placement material
+ * @return placement material or {@link Material#AIR} if it doesn't have one
*/
@NotNull
Material getPlacementMaterial();
diff --git a/src/main/java/org/bukkit/block/data/FaceAttachable.java b/src/main/java/org/bukkit/block/data/FaceAttachable.java
index 9599e1237b9717ddbf84c3738bf6c1293e8b3c54..950266b4bb0a2fabeb9539c5676ed58f0b0fe620 100644
--- a/src/main/java/org/bukkit/block/data/FaceAttachable.java
+++ b/src/main/java/org/bukkit/block/data/FaceAttachable.java
@@ -38,7 +38,7 @@ public interface FaceAttachable extends BlockData {
*/
WALL,
/**
- * The switch is mounted to the ceiling and pointing dowanrds.
+ * The switch is mounted to the ceiling and pointing downwards.
*/
CEILING;
}
diff --git a/src/main/java/org/bukkit/block/data/type/CommandBlock.java b/src/main/java/org/bukkit/block/data/type/CommandBlock.java
index 9a7122c907308e4e0a4d0eab815df16899503c19..3b1dab4c1c38477fbe651382f37fdb042ce67cd1 100644
--- a/src/main/java/org/bukkit/block/data/type/CommandBlock.java
+++ b/src/main/java/org/bukkit/block/data/type/CommandBlock.java
@@ -4,7 +4,7 @@ import org.bukkit.block.data.Directional;
/**
* 'conditional' denotes whether this command block is conditional or not, i.e.
- * will only execute if the preceeding command block also executed successfully.
+ * will only execute if the preceding command block also executed successfully.
*/
public interface CommandBlock extends Directional {
diff --git a/src/main/java/org/bukkit/block/data/type/Gate.java b/src/main/java/org/bukkit/block/data/type/Gate.java
index 494f97d47b52bc99b13748c1b57730fbd37d8f51..ebc98607b93294847f95e793304bc5d2528de2a3 100644
--- a/src/main/java/org/bukkit/block/data/type/Gate.java
+++ b/src/main/java/org/bukkit/block/data/type/Gate.java
@@ -5,7 +5,7 @@ import org.bukkit.block.data.Openable;
import org.bukkit.block.data.Powerable;
/**
- * 'in_wall" indicates if the fence gate is attached to a wall, and if true the
+ * 'in_wall' indicates if the fence gate is attached to a wall, and if true the
* texture is lowered by a small amount to blend in better.
*/
public interface Gate extends Directional, Openable, Powerable {
diff --git a/src/main/java/org/bukkit/block/data/type/Switch.java b/src/main/java/org/bukkit/block/data/type/Switch.java
index be06f8db02ca41d5cc3a5dc02951ad27e3cc8f9d..d91a07c7bcb36b3810bb2db89afef1eefd89253d 100644
--- a/src/main/java/org/bukkit/block/data/type/Switch.java
+++ b/src/main/java/org/bukkit/block/data/type/Switch.java
@@ -21,7 +21,7 @@ public interface Switch extends Directional, FaceAttachable, Powerable {
* Sets the value of the 'face' property.
*
* @param face the new 'face' value
- * @deprecated use {@link #getAttachedFace()}
+ * @deprecated use {@link #setAttachedFace(AttachedFace)}
*/
@Deprecated
void setFace(@NotNull Face face);
@@ -42,7 +42,7 @@ public interface Switch extends Directional, FaceAttachable, Powerable {
*/
WALL,
/**
- * The switch is mounted to the ceiling and pointing dowanrds.
+ * The switch is mounted to the ceiling and pointing downwards.
*/
CEILING;
}
diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java
index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c47609c05 100644
--- a/src/main/java/org/bukkit/entity/ArmorStand.java
@@ -102,6 +302,32 @@ index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c
+ org.bukkit.inventory.@NotNull EntityEquipment getEquipment();
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java
index 8eb0cf31b1ce6d714a14cf65bbb117ff163ae2f3..8e57082e8b19a2fd9625816c2ea4a90d41f78ca5 100644
--- a/src/main/java/org/bukkit/entity/Arrow.java
+++ b/src/main/java/org/bukkit/entity/Arrow.java
@@ -93,7 +93,7 @@ public interface Arrow extends AbstractArrow {
* Removes a custom potion effect from this arrow.
*
* @param type the potion effect type to remove
- * @return true if the an effect was removed as a result of this call
+ * @return true if the effect was removed as a result of this call
* @throws IllegalArgumentException if this operation would leave the Arrow
* in a state with no Custom Effects and PotionType.UNCRAFTABLE
*/
diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java
index 1e56aef9188487d3e9c737e85025f601ab359a72..92cd35c87bad578c2b714761c93a5b72ebf4bc9e 100644
--- a/src/main/java/org/bukkit/entity/EnderDragon.java
+++ b/src/main/java/org/bukkit/entity/EnderDragon.java
@@ -30,7 +30,7 @@ public interface EnderDragon extends ComplexLivingEntity, Boss, Mob, Enemy {
*/
FLY_TO_PORTAL,
/**
- * The dragon will land on on the portal. If the dragon is not near
+ * The dragon will land on the portal. If the dragon is not near
* the portal, it will fly to it before mounting.
*/
LAND_ON_PORTAL,
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 09936f3a2376a46721bbc8365c989581c2a789ef..3845a726adbd0e75d7bf2aeeb6da8cb571d51a8f 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -118,6 +344,19 @@ index 09936f3a2376a46721bbc8365c989581c2a789ef..3845a726adbd0e75d7bf2aeeb6da8cb5
/**
* Returns the name of this player
*
diff --git a/src/main/java/org/bukkit/entity/ItemFrame.java b/src/main/java/org/bukkit/entity/ItemFrame.java
index b688b3856cb3068a539fcecfbfa113f8ab4160a9..c275b881cbd11307a6dcc7190d7a7d4063000ad8 100644
--- a/src/main/java/org/bukkit/entity/ItemFrame.java
+++ b/src/main/java/org/bukkit/entity/ItemFrame.java
@@ -75,7 +75,7 @@ public interface ItemFrame extends Hanging {
public void setRotation(@NotNull Rotation rotation) throws IllegalArgumentException;
/**
- * Returns whether the item frame is be visible or not.
+ * Returns whether the item frame is visible or not.
*
* @return whether the item frame is visible or not
*/
diff --git a/src/main/java/org/bukkit/entity/Mob.java b/src/main/java/org/bukkit/entity/Mob.java
index 2926fa6071bc7640cc10280b5c3962b0ce7686f1..4f63988848443aff55619bc12ef12c925642a3f9 100644
--- a/src/main/java/org/bukkit/entity/Mob.java
@@ -133,11 +372,24 @@ index 2926fa6071bc7640cc10280b5c3962b0ce7686f1..4f63988848443aff55619bc12ef12c92
/**
* Instructs this Mob to set the specified LivingEntity as its target.
* <p>
diff --git a/src/main/java/org/bukkit/entity/PigZombie.java b/src/main/java/org/bukkit/entity/PigZombie.java
index ae9eaaa8e38e1d9dfc459926c7fc51ddb89de84a..b2ec535bb1b0ce0c114ddd7638b90218b05cd835 100644
--- a/src/main/java/org/bukkit/entity/PigZombie.java
+++ b/src/main/java/org/bukkit/entity/PigZombie.java
@@ -44,8 +44,6 @@ public interface PigZombie extends Zombie {
/**
* <b>Not applicable to this entity</b>
- *
- * @return UnsuppotedOperationException
*/
@Override
public int getConversionTime();
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0fdaf416960ace84fbe9b9c461641efbb8b631a4..1017db005f8c7a095911f5dd0dbe37d9fc239c95 100644
index 3954f40b23536fec495585a8b14e82d092d62e39..264c6bdeb2f1f0d937e4356d761a3264a1c4d58a 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -310,15 +310,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -431,15 +431,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Saves the players current location, health, inventory, motion, and
@@ -157,7 +409,16 @@ index 0fdaf416960ace84fbe9b9c461641efbb8b631a4..1017db005f8c7a095911f5dd0dbe37d9
* <p>
* Note: This will overwrite the players current inventory, health,
* motion, etc, with the state from the saved dat file.
@@ -831,7 +831,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -674,7 +674,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Plays an effect to just this player.
*
- * @param <T> the data based based on the type of the effect
+ * @param <T> the data based on the type of the effect
* @param loc the location to play the effect at
* @param effect the {@link Effect}
* @param data a data bit needed for some effects
@@ -1059,7 +1059,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* Use supplied alternative character to the section symbol to represent legacy color codes.
*
@@ -166,6 +427,24 @@ index 0fdaf416960ace84fbe9b9c461641efbb8b631a4..1017db005f8c7a095911f5dd0dbe37d9
* @param message The message to send
* @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
*/
@@ -1525,7 +1525,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Allows this player to see a player that was previously hidden. If
- * another another plugin had hidden the player too, then the player will
+ * another plugin had hidden the player too, then the player will
* remain hidden until the other plugin calls this method too.
*
* @param plugin Plugin that wants to show the player
@@ -1554,7 +1554,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Allows this player to see an entity that was previously hidden. If
- * another another plugin had hidden the entity too, then the entity will
+ * another plugin had hidden the entity too, then the entity will
* remain hidden until the other plugin calls this method too.
*
* @param plugin Plugin that wants to show the entity
diff --git a/src/main/java/org/bukkit/entity/Slime.java b/src/main/java/org/bukkit/entity/Slime.java
index a5ad3250cebfeb302c58e0bfd6db1295913c927e..bfac874840cf1f36afba16ae4d176c5821a68cfb 100644
--- a/src/main/java/org/bukkit/entity/Slime.java
@@ -187,11 +466,106 @@ index a5ad3250cebfeb302c58e0bfd6db1295913c927e..bfac874840cf1f36afba16ae4d176c58
* @param sz The new size of the slime.
*/
public void setSize(int sz);
diff --git a/src/main/java/org/bukkit/entity/Sniffer.java b/src/main/java/org/bukkit/entity/Sniffer.java
index af5110b4160979c39cc1e5de6fa3bd7957b21403..15a0a733b0e5804655b5957cbf20831290d52a08 100644
--- a/src/main/java/org/bukkit/entity/Sniffer.java
+++ b/src/main/java/org/bukkit/entity/Sniffer.java
@@ -12,8 +12,6 @@ public interface Sniffer extends Animals {
/**
* Gets the locations explored by the sniffer.
- * <br>
- * <b>Note:</b> the returned locations use sniffer's current world.
*
* @return a collection of locations
*/
@@ -22,9 +20,6 @@ public interface Sniffer extends Animals {
/**
* Remove a location of the explored locations.
- * <br>
- * <b>Note:</b> the location must be in the sniffer's current world for this
- * method to have any effect.
*
* @param location the location to remove
* @see #getExploredLocations()
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index 6bf3af3ed81b66f61e53105d3591165ea74dba0e..a91400cd8bb4c72d1f3200a17f6de025540fe09d 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -202,7 +202,7 @@ public interface Villager extends AbstractVillager {
*/
NITWIT,
/**
- * Sheperd profession. Wears a brown robe. Shepherds primarily trade for
+ * Shepherd profession. Wears a brown robe. Shepherds primarily trade for
* wool items, and shears.
*/
SHEPHERD,
diff --git a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
index 44f7f6939a27b9a0a796d91eac4b7c97ec90a643..641c71ab66bd2499b35cf3c1d533fd105d096e10 100644
--- a/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockExplodeEvent.java
@@ -7,7 +7,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
- * Called when a block explodes
+ * Called when a block explodes interacting with blocks. The
+ * event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
+ * is disabled as no block interaction will occur.
*/
public class BlockExplodeEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
index be0a2d1f234d8265d98e54e518a994957b1f3ab7..4e3c406ba883aae553e8d69b6b719b872cd6096c 100644
--- a/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockPlaceEvent.java
@@ -114,7 +114,7 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
/**
* Gets the value whether the player would be allowed to build here.
- * Defaults to spawn if the server was going to stop them (such as, the
+ * Defaults to false if the server was going to stop them (such as, the
* player is in Spawn). Note that this is an entirely different check
* than BLOCK_CANBUILD, as this refers to a player, not universe-physics
* rule like cactus on dirt.
diff --git a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
index 2ff1b1308571d8f8056d3359e8a8ba4a589c3726..e9a6e5be5f33a342f7e5c496f0f1c64b2f302ace 100644
--- a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
+++ b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
@@ -80,7 +80,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
/**
* Get a list of available {@link EnchantmentOffer} for the player. You can
* modify the values to change the available offers for the player. An offer
- * may be null, if there isn't a enchantment offer at a specific slot. There
+ * may be null, if there isn't an enchantment offer at a specific slot. There
* are 3 slots in the enchantment table available to modify.
*
* @return list of available enchantment offers
diff --git a/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java b/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java
index a37febd0d4dd5b733e9ee72628fdf9395fec4367..9cee218b9ee14688356f16b1f58512186286e7e9 100644
--- a/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java
+++ b/src/main/java/org/bukkit/event/entity/AreaEffectCloudApplyEvent.java
@@ -8,7 +8,7 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
- * Called when a lingering potion applies it's effects. Happens
+ * Called when a lingering potion applies its effects. Happens
* once every 5 ticks
*/
public class AreaEffectCloudApplyEvent extends EntityEvent implements Cancellable {
diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
index e9de00e9e434d36117a672fa9fbfc7c52f284b67..9a06487e0f76cd7765e6f900b7458a3cf0aa44e7 100644
index e9de00e9e434d36117a672fa9fbfc7c52f284b67..4065432c884324b107d04f4ccd486085b0c440e7 100644
--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
@@ -158,7 +158,8 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
@@ -154,11 +154,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
*/
DROWNED,
/**
- * When an cow is spawned by shearing a mushroom cow
+ * When a cow is spawned by shearing a mushroom cow
*/
SHEARED,
/**
@@ -201,6 +575,69 @@ index e9de00e9e434d36117a672fa9fbfc7c52f284b67..9a06487e0f76cd7765e6f900b7458a3c
*/
EXPLOSION,
/**
diff --git a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
index 10d0e18dfd423b108fe381e8142867eb10399359..099efafa14c10910e4ed04abb1823f0c1a96b6a6 100644
--- a/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityExplodeEvent.java
@@ -9,7 +9,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
- * Called when an entity explodes
+ * Called when an entity explodes interacting with blocks. The
+ * event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
+ * is disabled as no block interaction will occur.
*/
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java b/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java
index c866df03d66dd8724e12c7353da4cf144c70b2c8..94ee5a3354722aa5d825da727b7b7071fdc6bacc 100644
--- a/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityPickupItemEvent.java
@@ -7,7 +7,7 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
- * Thrown when a entity picks an item up from the ground
+ * Thrown when an entity picks an item up from the ground
*/
public class EntityPickupItemEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
index 327876e0ad7dcfeb71d9d22afe1c04bcd71c3bf9..71d664dd89995f088c47d17b38547d530319470c 100644
--- a/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityPlaceEvent.java
@@ -11,7 +11,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
- * Triggered when a entity is created in the world by a player "placing" an item
+ * Triggered when an entity is created in the world by a player "placing" an item
* on a block.
* <br>
* Note that this event is currently only fired for four specific placements:
diff --git a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
index 01c5e8b71338fbb4b1605e45bf2a2e705188f6b5..c9f395064656dd0126410eb3c6e197baa450c063 100644
--- a/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityPotionEffectEvent.java
@@ -133,7 +133,7 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
public enum Action {
/**
- * When the potion effect is added because the entity didn't have it's
+ * When the potion effect is added because the entity didn't have its
* type.
*/
ADDED,
@@ -238,7 +238,7 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
*/
SPIDER_SPAWN,
/**
- * When the entity gets effects from a totem item saving it's life.
+ * When the entity gets effects from a totem item saving its life.
*/
TOTEM,
/**
diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
index d51d2ec1d04d9ea8a25a70d0d856f2355ebfcb4a..7ecff9fcee19fc94be784474fea620e5dd434731 100644
--- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
@@ -214,6 +651,19 @@ index d51d2ec1d04d9ea8a25a70d0d856f2355ebfcb4a..7ecff9fcee19fc94be784474fea620e5
*/
EATING,
/**
diff --git a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java
index dee186e99463a56394bbc2039d1e763d109125b9..c6e4d69eecd2789b1d78fe99fe590932e9758ba1 100644
--- a/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityTargetEvent.java
@@ -156,7 +156,7 @@ public class EntityTargetEvent extends EntityEvent implements Cancellable {
FOLLOW_LEADER,
/**
* When another entity tempts this entity by having a desired item such
- * as wheat in it's hand.
+ * as wheat in its hand.
*/
TEMPT,
/**
diff --git a/src/main/java/org/bukkit/event/entity/PiglinBarterEvent.java b/src/main/java/org/bukkit/event/entity/PiglinBarterEvent.java
index c17ff41a688b2cbd877cda25d4ec033ac8ef5524..bd67b7cba78b9bbdd82a5a40048e658a979e3108 100644
--- a/src/main/java/org/bukkit/event/entity/PiglinBarterEvent.java
@@ -228,8 +678,195 @@ index c17ff41a688b2cbd877cda25d4ec033ac8ef5524..bd67b7cba78b9bbdd82a5a40048e658a
*/
public class PiglinBarterEvent extends EntityEvent implements Cancellable {
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java
index bc71bc2d3ace0d19d730c09f05f9e0655bcee8f5..24077da8e6a7937f66eafc6779206055cf82e8d2 100644
--- a/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceBurnEvent.java
@@ -8,7 +8,9 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
- * Called when an ItemStack is successfully burned as fuel in a furnace.
+ * Called when an ItemStack is successfully burned as fuel in a furnace-like block such as a
+ * {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker}, or
+ * {@link org.bukkit.block.BlastFurnace}.
*/
public class FurnaceBurnEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
index 020739697a0b535cad0b15b574f77cdabbdfa3eb..a965b6a78073c5da86ad671752eff4a270029420 100644
--- a/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceExtractEvent.java
@@ -7,7 +7,9 @@ import org.bukkit.event.block.BlockExpEvent;
import org.jetbrains.annotations.NotNull;
/**
- * This event is called when a player takes items out of the furnace
+ * This event is called when a player takes items out of a furnace-like block such as a
+ * {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker}, or
+ * {@link org.bukkit.block.BlastFurnace}.
*/
public class FurnaceExtractEvent extends BlockExpEvent {
private final Player player;
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java
index 066e7dd9a34d35c8b643a5efcf95d6a5ef47c7ee..f8f9b08a0bd82a2667ae4e0c99dae9103f0db3f0 100644
--- a/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceSmeltEvent.java
@@ -6,7 +6,9 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
- * Called when an ItemStack is successfully smelted in a furnace.
+ * Called when an ItemStack is successfully smelted in a furnace-like block
+ * such as a {@link org.bukkit.block.Furnace}, {@link org.bukkit.block.Smoker},
+ * or {@link org.bukkit.block.BlastFurnace}.
*/
public class FurnaceSmeltEvent extends BlockCookEvent {
diff --git a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
index 1440c6115520d692faf75455df35b92aa8734491..0808e7aeffb69160913344de5b5e21d5e857f1d6 100644
--- a/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/FurnaceStartSmeltEvent.java
@@ -8,7 +8,10 @@ import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
/**
- * Called when a Furnace starts smelting.
+ * Called when any of the furnace-like blocks start smelting.
+ * <p>
+ * Furnace-like blocks are {@link org.bukkit.block.Furnace},
+ * {@link org.bukkit.block.Smoker}, and {@link org.bukkit.block.BlastFurnace}.
*/
public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
index 79797a2be7fb139d528116d34d13e51d39b96e56..fe58058f9b5d29388d48115cc81dc48ab08c58c1 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
@@ -19,9 +19,10 @@ import org.jetbrains.annotations.Nullable;
* Because InventoryClickEvent occurs within a modification of the Inventory,
* not all Inventory related methods are safe to use.
* <p>
- * The following should never be invoked by an EventHandler for
- * InventoryClickEvent using the HumanEntity or InventoryView associated with
- * this event:
+ * Methods that change the view a player is looking at should never be invoked
+ * by an EventHandler for InventoryClickEvent using the HumanEntity or
+ * InventoryView associated with this event.
+ * Examples of these include:
* <ul>
* <li>{@link HumanEntity#closeInventory()}
* <li>{@link HumanEntity#openInventory(Inventory)}
@@ -92,7 +93,7 @@ public class InventoryClickEvent extends InventoryInteractEvent {
/**
* Gets the ItemStack currently in the clicked slot.
*
- * @return the item in the clicked
+ * @return the item in the clicked slot
*/
@Nullable
public ItemStack getCurrentItem() {
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
index 5861247c1b8ee4fe2736fd5098e05a2ca9ab78ea..c0cc82d98348e8aae3cb56bafb2fcb590b03094f 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
@@ -7,7 +7,26 @@ import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
/**
- * Represents a player related inventory event
+ * This event is called when a player closes an inventory.
+ * <p>
+ * Because InventoryCloseEvent occurs within a modification of the Inventory,
+ * not all Inventory related methods are safe to use.
+ * <p>
+ * Methods that change the view a player is looking at should never be invoked
+ * by an EventHandler for InventoryCloseEvent using the HumanEntity or
+ * InventoryView associated with this event.
+ * Examples of these include:
+ * <ul>
+ * <li>{@link HumanEntity#closeInventory()}
+ * <li>{@link HumanEntity#openInventory(org.bukkit.inventory.Inventory)}
+ * <li>{@link HumanEntity#openWorkbench(org.bukkit.Location, boolean)}
+ * <li>{@link HumanEntity#openEnchanting(org.bukkit.Location, boolean)}
+ * <li>{@link InventoryView#close()}
+ * </ul>
+ * To invoke one of these methods, schedule a task using
+ * {@link org.bukkit.scheduler.BukkitScheduler#runTask(org.bukkit.plugin.Plugin, Runnable)}, which will run the task
+ * on the next tick. Also be aware that this is not an exhaustive list, and
+ * other methods could potentially create issues as well.
*/
public class InventoryCloseEvent extends InventoryEvent {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
index 9013d043503d175004ad276799e5935b7fa59dc4..ceae092eb782698803c6c3df41267dde20ba62b2 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryOpenEvent.java
@@ -7,7 +7,7 @@ import org.bukkit.inventory.InventoryView;
import org.jetbrains.annotations.NotNull;
/**
- * Represents a player related inventory event
+ * Called when a player opens an inventory
*/
public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java b/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java
index 6782024735a885ba0b1b4dba4a576740c1410366..8977f7609431c3c46324a82de84d4a32f4b71c57 100644
--- a/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/PrepareAnvilEvent.java
@@ -24,6 +24,20 @@ public class PrepareAnvilEvent extends PrepareInventoryResultEvent {
return (AnvilInventory) super.getInventory();
}
+ /**
+ * {@inheritDoc}
+ *
+ * <p>
+ * Note: by default custom recipes in anvil are disabled
+ * you should define a repair cost on the anvil inventory
+ * greater or equals to zero in order to allow that.
+ *
+ * @param result result item
+ */
+ public void setResult(@Nullable ItemStack result) {
+ super.setResult(result);
+ }
+
@NotNull
@Override
public HandlerList getHandlers() {
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
index 4c2102a11c3d682d98f0db4ccafa35231e66bcdd..ca238af544764273b9cd4cf3587e8632031c9ede 100644
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
@@ -5,8 +5,9 @@ import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
/**
- * Called when a player takes action on a resource pack request sent via
- * {@link Player#setResourcePack(java.lang.String)}.
+ * Called when a player takes action on a resource pack request.
+ * @see Player#setResourcePack(String, String)
+ * @see Player#setResourcePack(String, String, boolean)
*/
public class PlayerResourcePackStatusEvent extends PlayerEvent {
diff --git a/src/main/java/org/bukkit/generator/ChunkGenerator.java b/src/main/java/org/bukkit/generator/ChunkGenerator.java
index 0cc6e29a5af28e95f87f415d6b2424d4622a6f34..c0b749a5bbf4980d01fed74768bb61909b579cb9 100644
--- a/src/main/java/org/bukkit/generator/ChunkGenerator.java
+++ b/src/main/java/org/bukkit/generator/ChunkGenerator.java
@@ -627,7 +627,7 @@ public abstract class ChunkGenerator {
* Get the biome at x, y, z within chunk being generated
*
* @param x the x location in the chunk from 0-15 inclusive
- * @param y the y location in the chunk from minimum (inclusive) -
+ * @param y the y location in the chunk from minHeight (inclusive) -
* maxHeight (exclusive)
* @param z the z location in the chunk from 0-15 inclusive
* @return Biome value
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
index d5b50a4a954fed35d37f03f1a277cc173ca106df..a91fa5386afd7a1137adb921ad5adb798604772f 100644
index d5b50a4a954fed35d37f03f1a277cc173ca106df..c69904f3ee7f3a41d6cebcd401abf8385dfbf868 100644
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
+++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java
@@ -37,9 +37,23 @@ public interface EntityEquipment {
@@ -319,9 +956,9 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..a91fa5386afd7a1137adb921ad5adb79
+ * <pre>{@code
+ * EntityEquipment equipment = entity.getEquipment();
+ * if (equipment instanceof PlayerInventory) {
+ * equipment.getItemInHand(); // will return a mirror
+ * equipment.getHelmet(); // will return a mirror
+ * } else {
+ * equipment.getItemInHand(); // will return a copy
+ * equipment.getHelmet(); // will return a copy
+ * }
+ * }</pre>
*
@@ -486,3 +1123,147 @@ index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..5461f7fa75f5a065bb333b4a113640b5
*
* @return the currently held item
* @see #getItemInMainHand()
diff --git a/src/main/java/org/bukkit/inventory/ShapedRecipe.java b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
index 05f1acaac3a49c42f6cf544adb3ffec267c72700..9f9c67e935940833bbfe58e6bfa398e6c86980d5 100644
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
@@ -24,8 +24,6 @@ public class ShapedRecipe extends CraftingRecipe {
* @param result The item you want the recipe to create.
* @see ShapedRecipe#shape(String...)
* @see ShapedRecipe#setIngredient(char, Material)
- * @see ShapedRecipe#setIngredient(char, Material, int)
- * @see ShapedRecipe#setIngredient(char, MaterialData)
* @see ShapedRecipe#setIngredient(char, RecipeChoice)
* @deprecated Recipes must have keys. Use {@link #ShapedRecipe(NamespacedKey, ItemStack)}
* instead.
@@ -44,8 +42,6 @@ public class ShapedRecipe extends CraftingRecipe {
* @param result The item you want the recipe to create.
* @see ShapedRecipe#shape(String...)
* @see ShapedRecipe#setIngredient(char, Material)
- * @see ShapedRecipe#setIngredient(char, Material, int)
- * @see ShapedRecipe#setIngredient(char, MaterialData)
* @see ShapedRecipe#setIngredient(char, RecipeChoice)
*/
public ShapedRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
index 3d50775da447175b2a94ed9056ef36aa1e69c2eb..03839302c94adc3175d0a88065cd230257ffd20d 100644
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
@@ -30,11 +30,8 @@ public class ShapelessRecipe extends CraftingRecipe {
* @param key the unique recipe key
* @param result The item you want the recipe to create.
* @see ShapelessRecipe#addIngredient(Material)
- * @see ShapelessRecipe#addIngredient(MaterialData)
- * @see ShapelessRecipe#addIngredient(Material,int)
* @see ShapelessRecipe#addIngredient(int,Material)
- * @see ShapelessRecipe#addIngredient(int,MaterialData)
- * @see ShapelessRecipe#addIngredient(int,Material,int)
+ * @see ShapelessRecipe#addIngredient(RecipeChoice)
*/
public ShapelessRecipe(@NotNull NamespacedKey key, @NotNull ItemStack result) {
super(key, result);
@@ -174,7 +171,7 @@ public class ShapelessRecipe extends CraftingRecipe {
/**
* Removes multiple instances of an ingredient from the list. If there are
- * less instances then specified, all will be removed. Only removes exact
+ * fewer instances than specified, all will be removed. Only removes exact
* matches, with a data value of 0.
*
* @param count The number of copies to remove.
diff --git a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
index 07c3dff4d6190ef388d9c1e1c36f67f00a3e8e66..597a18a767b68b47e81454b7d44613c7178c1366 100644
--- a/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
+++ b/src/main/java/org/bukkit/inventory/StonecuttingRecipe.java
@@ -28,7 +28,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
}
/**
- * Create a cooking recipe to craft the specified ItemStack.
+ * Create a Stonecutting recipe to craft the specified ItemStack.
*
* @param key The unique recipe key
* @param result The item you want the recipe to create.
@@ -42,7 +42,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
}
/**
- * Sets the input of this cooking recipe.
+ * Sets the input of this Stonecutting recipe.
*
* @param input The input material.
* @return The changed recipe, so you can chain calls.
@@ -64,7 +64,7 @@ public class StonecuttingRecipe implements Recipe, Keyed {
}
/**
- * Sets the input of this cooking recipe.
+ * Sets the input of this Stonecutting recipe.
*
* @param input The input choice.
* @return The changed recipe, so you can chain calls.
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index d7fab2b856f6dfec4f9225c1bdb4254b238d98a4..9d40e6a5ce7adc377934cfc5ce663b5d9cb2e4dc 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -306,7 +306,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
/**
* Return an immutable copy of all {@link Attribute}s and their
* {@link AttributeModifier}s for a given {@link EquipmentSlot}.<br>
- * Any {@link AttributeModifier} that does have have a given
+ * Any {@link AttributeModifier} that does have a given
* {@link EquipmentSlot} will be returned. This is because
* AttributeModifiers without a slot are active in any slot.<br>
* If there are no attributes set for the given slot, an empty map
diff --git a/src/main/java/org/bukkit/scoreboard/Objective.java b/src/main/java/org/bukkit/scoreboard/Objective.java
index 22b1dc5fd4d453161a5ee520072f8e8f955b3a80..a625bcab8e77b05b3341a52c708fae1542b7e3d5 100644
--- a/src/main/java/org/bukkit/scoreboard/Objective.java
+++ b/src/main/java/org/bukkit/scoreboard/Objective.java
@@ -86,7 +86,7 @@ public interface Objective {
*
* @return true if scores are modifiable
* @throws IllegalStateException if this objective has been unregistered
- * @see Criterias#HEALTH
+ * @see Criteria#HEALTH
*/
boolean isModifiable();
diff --git a/src/main/java/org/bukkit/scoreboard/Team.java b/src/main/java/org/bukkit/scoreboard/Team.java
index 52e8be769d2e9b69e9833bc9a7fe39afd10c5095..4d2b8e10263802432dfeac72666487f9547cd2c5 100644
--- a/src/main/java/org/bukkit/scoreboard/Team.java
+++ b/src/main/java/org/bukkit/scoreboard/Team.java
@@ -265,7 +265,7 @@ public interface Team extends net.kyori.adventure.audience.ForwardingAudience {
* Gets the Set of entries on the team
*
* @return entries on the team
- * @throws IllegalStateException if this entries has been unregistered
+ * @throws IllegalStateException if this team has been unregistered
*/
@NotNull
Set<String> getEntries();
diff --git a/src/main/java/org/bukkit/util/BoundingBox.java b/src/main/java/org/bukkit/util/BoundingBox.java
index 9883983c33fcff0f4c1e23867adafa436e2ed96f..5017b73bcec0d4d5256d89db14201c03829dc981 100644
--- a/src/main/java/org/bukkit/util/BoundingBox.java
+++ b/src/main/java/org/bukkit/util/BoundingBox.java
@@ -358,7 +358,7 @@ public class BoundingBox implements Cloneable, ConfigurationSerializable {
* <p>
* Negative values will shrink the bounding box in the corresponding
* direction. Shrinking will be limited to the point where the affected
- * opposite faces would meet if the they shrank at uniform speeds.
+ * opposite faces would meet if they shrank at uniform speeds.
*
* @param negativeX the amount of expansion in the negative x direction
* @param negativeY the amount of expansion in the negative y direction
diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java
index 612958a331575d1da2715531ebdf6b1168f2e860..9a7768d41270714d4a1c89b4dcb436cc66f57545 100644
--- a/src/main/java/org/bukkit/util/CachedServerIcon.java
+++ b/src/main/java/org/bukkit/util/CachedServerIcon.java
@@ -5,7 +5,7 @@ import org.bukkit.event.server.ServerListPingEvent;
import org.jetbrains.annotations.Nullable;
/**
- * This is a cached version of a server-icon. It's internal representation
+ * This is a cached version of a server-icon. Its internal representation
* and implementation is undefined.
*
* @see Server#getServerIcon()
@@ -321,10 +321,10 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 82757d3013e01a6bfbb685929955d3e7dad8508c..a6a792babe69712594c18f49542feb30ff591810 100644
index b21f90f291a087b6282cd7b55e0075a01729f0ba..dcd539220e5a2bda41f27101ea4c0ece146e1d0d 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2155,6 +2155,83 @@ public final class Bukkit {
@@ -2228,6 +2228,83 @@ public final class Bukkit {
public static boolean suggestPlayerNamesWhenNullTabCompletions() {
return server.suggestPlayerNamesWhenNullTabCompletions();
}
@@ -409,10 +409,10 @@ index 82757d3013e01a6bfbb685929955d3e7dad8508c..a6a792babe69712594c18f49542feb30
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 3485db7548e93242f99977a236eb3bcebedfb964..bf1102b4481b8c9b9c4f5ba0c561556b75fea077 100644
index 3c1862b9a9293155f756615b5bd23cc810a6df5e..016cee903c7179baf711984503d1d0793d40c5c5 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1888,5 +1888,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1955,5 +1955,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return true if player names should be suggested
*/
boolean suggestPlayerNamesWhenNullTabCompletions();
+2 -2
View File
@@ -5,10 +5,10 @@ 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 1b0b365905d4e7f77d3f792797816eeb35d31c69..c10e19e06f0c4e33b2c5a4a1446b151f818e92db 100644
index 63137429779d06fafb162f1bfb823d5149b3c58a..4319dbac54b4cce95ad7479d5bd141a2b12ab7ae 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -734,5 +734,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -749,5 +749,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@Nullable
Location getOrigin();
@@ -8,17 +8,18 @@ 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 af4a7ce37eb10bab06eadb6583c7894b3ec55ae6..159e5a908b35b84b7fabc36581e093d9aa4c4b67 100644
index 30770d03044da684aa8c79ca74796050c319f6be..f0025ba978f4bdf1e6bab7d30466fc950bb2a13b 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -178,5 +178,19 @@ public interface ItemFactory {
*/
@@ -192,4 +192,20 @@ public interface ItemFactory {
@NotNull
net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack);
// Paper end - Adventure
+
+ // Paper start - add getI18NDisplayName
+ /**
+ * Gets the Display name as seen in the Client.
+ * Currently the server only supports the English language. To override this,
+ * Currently, the server only supports the English language. To override this,
+ * You must replace the language file embedded in the server jar.
+ *
+ * @param item Item to return Display name of
@@ -29,14 +30,14 @@ index af4a7ce37eb10bab06eadb6583c7894b3ec55ae6..159e5a908b35b84b7fabc36581e093d9
+ @Nullable
+ @Deprecated
+ String getI18NDisplayName(@Nullable ItemStack item);
// Paper end
+ // Paper end - add getI18NDisplayName
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 9da047582e9648d84875b6d3c136960bbb97b70e..87f7942082ad943a97058f58c09ea2fe9caf5bfe 100644
index 9d327f0832c40d4a8d212346284274f6cf78834f..09a36df6edce2a283df80c67d5ef62da7ff73555 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -618,5 +618,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
public @NotNull net.kyori.adventure.text.Component displayName() {
public net.kyori.adventure.text.@NotNull Component displayName() {
return Bukkit.getServer().getItemFactory().displayName(this);
}
+
@@ -7,29 +7,30 @@ 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 159e5a908b35b84b7fabc36581e093d9aa4c4b67..66ffc658dba85942f179760dc6c50258e24ab903 100644
index f0025ba978f4bdf1e6bab7d30466fc950bb2a13b..d641a8293f3acd465d5fdde8507046647cb6c568 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -192,5 +192,17 @@ public interface ItemFactory {
@Nullable
@@ -208,4 +208,18 @@ public interface ItemFactory {
@Deprecated
String getI18NDisplayName(@Nullable ItemStack item);
// Paper end - add getI18NDisplayName
+
+ // Paper start - ensure server conversions API
+ /**
+ * Minecraft updates are converting simple item stacks into more complex NBT oriented Item Stacks.
+ * Minecraft's updates are converting simple item stacks into more complex NBT oriented Item Stacks.
+ *
+ * Use this method to to ensure any desired data conversions are processed.
+ * Use this method to ensure any desired data conversions are processed.
+ * The input itemstack will not be the same as the returned itemstack.
+ *
+ * @param item The item to process conversions on
+ * @return A potentially Data Converted ItemStack
+ * @return A potentially Data-Converted-ItemStack
+ */
+ @NotNull
+ ItemStack ensureServerConversions(@NotNull ItemStack item);
// Paper end
+ // Paper end - ensure server conversions API
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 87f7942082ad943a97058f58c09ea2fe9caf5bfe..9d32283ee612a50b8a2bfe5151f42c9f181ede4c 100644
index 09a36df6edce2a283df80c67d5ef62da7ff73555..a8faa4c1881bae4d47d901388a78b991d138b518 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -537,7 +537,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -48,7 +49,7 @@ index 87f7942082ad943a97058f58c09ea2fe9caf5bfe..9d32283ee612a50b8a2bfe5151f42c9f
+ /**
+ * Minecraft updates are converting simple item stacks into more complex NBT oriented Item Stacks.
+ *
+ * Use this method to to ensure any desired data conversions are processed.
+ * Use this method to ensure any desired data conversions are processed.
+ * The input itemstack will not be the same as the returned itemstack.
+ *
+ * @return A potentially Data Converted ItemStack
@@ -5,10 +5,10 @@ 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 9977bb3cb5a66c84db816f8e4597db1c053f77c8..ccd8f36c8450bab9f609bb220b5270394960580e 100644
index 390bb294d09389877937ee2c6c3f346e65dfb178..6a9df4ec0eee205bcd37de9c4d04a6c67eb21644 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -295,6 +295,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -319,6 +319,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@Nullable
public Player getKiller();
@@ -14,18 +14,36 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction.
diff --git a/build.gradle.kts b/build.gradle.kts
index 9d6e604c7667985dc8107a5df9d36c53e8006326..1de2f8f345a287d93aad106dd13472a7837ec805 100644
index 145f6209a984e74da2d2de03cf725c06c77ef8da..639651972fddce4dff63a0f0a7e566a15b9e2dd6 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -40,6 +40,8 @@ dependencies {
@@ -11,6 +11,8 @@ java {
val annotationsVersion = "24.0.1"
val bungeeCordChatVersion = "1.20-R0.1"
val adventureVersion = "4.14.0"
+val slf4jVersion = "1.8.0-beta4"
+val log4jVersion = "2.17.1"
val apiAndDocs: Configuration by configurations.creating {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -42,6 +44,8 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
+ api("org.apache.logging.log4j:log4j-api:2.17.1")
+ api("org.slf4j:slf4j-api:1.8.0-beta4")
+ api("org.apache.logging.log4j:log4j-api:$log4jVersion")
+ api("org.slf4j:slf4j-api:$slf4jVersion")
implementation("org.ow2.asm:asm:9.4")
implementation("org.ow2.asm:asm-commons:9.4")
@@ -117,6 +121,8 @@ tasks.withType<Javadoc> {
"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
// Paper end
"https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
)
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 8c76716249e44ed8bf6be94c1f5c7b6d9bb35be2..4eb639fbb46a0848be207149ea433455550fae1c 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
@@ -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 c9cf9d361a1289aba383718733a2098b5eafb38f..71c8d2345eef6895edb8d210553ec3cddd9c76d0 100644
index f594913e6b94f77b26a4a758c447a42d8a25b6ff..7cd9f98c042dc2bb80876af35c755f81bef34651 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -44,7 +44,7 @@ public abstract class JavaPlugin extends PluginBase {
@@ -46,7 +46,7 @@ public abstract class JavaPlugin extends PluginBase {
private boolean naggable = true;
private FileConfiguration newConfig = null;
private File configFile = null;
@@ -29,7 +29,7 @@ index c9cf9d361a1289aba383718733a2098b5eafb38f..71c8d2345eef6895edb8d210553ec3cd
public JavaPlugin() {
// Paper start
@@ -301,8 +301,8 @@ public abstract class JavaPlugin extends PluginBase {
@@ -303,8 +303,8 @@ public abstract class JavaPlugin extends PluginBase {
this.dataFolder = dataFolder;
this.classLoader = classLoader;
this.configFile = new File(dataFolder, "config.yml");
@@ -67,49 +67,49 @@ index 0000000000000000000000000000000000000000..087ee57fe5485bc760fadd45a176d4d9
+
+}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
index 71c8d2345eef6895edb8d210553ec3cddd9c76d0..6d31f3a2569ae9c522a5e6cddd38ac8f252f1bfe 100644
index 7cd9f98c042dc2bb80876af35c755f81bef34651..5cd236965de12392d8c7aa81307c0ff1cc8673b1 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPlugin.java
@@ -44,7 +44,7 @@ public abstract class JavaPlugin extends PluginBase {
private boolean naggable = true;
private FileConfiguration newConfig = null;
private File configFile = null;
- private Logger logger = null; // Paper - PluginLogger -> Logger
+ public Logger logger = null; // Paper - PluginLogger -> Logger, public
public JavaPlugin() {
// Paper start
@@ -302,7 +302,11 @@ public abstract class JavaPlugin extends PluginBase {
@@ -291,10 +291,10 @@ public abstract class JavaPlugin extends PluginBase {
.orElseThrow();
}
public final void init(@NotNull PluginLoader loader, @NotNull Server server, @NotNull PluginDescriptionFile description, @NotNull File dataFolder, @NotNull File file, @NotNull ClassLoader classLoader) {
- init(server, description, dataFolder, file, classLoader, description);
+ init(server, description, dataFolder, file, classLoader, description, com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(description));
this.pluginMeta = description;
}
- public final void init(@NotNull Server server, @NotNull PluginDescriptionFile description, @NotNull File dataFolder, @NotNull File file, @NotNull ClassLoader classLoader, @Nullable io.papermc.paper.plugin.configuration.PluginMeta configuration) {
+ public final void init(@NotNull Server server, @NotNull PluginDescriptionFile description, @NotNull File dataFolder, @NotNull File file, @NotNull ClassLoader classLoader, @Nullable io.papermc.paper.plugin.configuration.PluginMeta configuration, @NotNull Logger logger) {
// Paper end
this.loader = DummyPluginLoaderImplHolder.INSTANCE; // Paper
this.server = server;
@@ -304,7 +304,7 @@ public abstract class JavaPlugin extends PluginBase {
this.classLoader = classLoader;
this.configFile = new File(dataFolder, "config.yml");
this.pluginMeta = configuration; // Paper
- this.logger = Logger.getLogger(description.getPrefix() != null ? description.getPrefix() : description.getName()); // Paper - Handle plugin prefix in implementation
+ // Paper start
+ if (this.logger == null) {
+ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(this.description);
+ }
+ // Paper end
+ this.logger = logger; // Paper
}
/**
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 2d2fa6ce5200eb5c75a733f9f54f400113cc22b0..5c5aadc15c8198e0e79b4ac0f043a45720aef002 100644
index 74b6581a97a092c44a0876e7981ff8a8e6153100..d6d3e1332e51adc5611543b2a6689efa5921a9f2 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -65,7 +65,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -67,6 +67,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
this.url = file.toURI().toURL();
this.libraryLoader = libraryLoader;
-
+ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(description); // Paper - Register logger early
// Paper start
this.dependencyContext = dependencyContext;
this.classLoaderGroup = io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage.instance().registerSpigotGroup(this);
@@ -249,6 +249,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -262,7 +263,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
pluginState = new IllegalStateException("Initial initialization");
this.pluginInit = javaPlugin;
+ javaPlugin.logger = this.logger; // Paper - set logger
javaPlugin.init(null, org.bukkit.Bukkit.getServer(), description, dataFolder, file, this); // Paper
- javaPlugin.init(null, org.bukkit.Bukkit.getServer(), description, dataFolder, file, this); // Paper
+ javaPlugin.init(org.bukkit.Bukkit.getServer(), description, dataFolder, file, this, description, this.logger); // Paper
}
// Paper start
@@ -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 0000000000000000000000000000000000000000..e406ce639a2e88b78f82f25e71678a669d0a958b
index 0000000000000000000000000000000000000000..57521010ff0574f1bbc96727948a6185fd37e9ee
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerArmorChangeEvent.java
@@ -0,0 +1,137 @@
@@ -0,0 +1,139 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.Material;
@@ -22,6 +22,7 @@ index 0000000000000000000000000000000000000000..e406ce639a2e88b78f82f25e71678a66
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@@ -36,10 +37,11 @@ index 0000000000000000000000000000000000000000..e406ce639a2e88b78f82f25e71678a66
+ private static final HandlerList HANDLERS = new HandlerList();
+
+ @NotNull private final SlotType slotType;
+ @Nullable private final ItemStack oldItem;
+ @Nullable private final ItemStack newItem;
+ @NotNull private final ItemStack oldItem;
+ @NotNull private final ItemStack newItem;
+
+ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @Nullable ItemStack oldItem, @Nullable ItemStack newItem) {
+ @ApiStatus.Internal
+ public PlayerArmorChangeEvent(@NotNull Player player, @NotNull SlotType slotType, @NotNull ItemStack oldItem, @NotNull ItemStack newItem) {
+ super(player);
+ this.slotType = slotType;
+ this.oldItem = oldItem;
@@ -61,7 +63,7 @@ index 0000000000000000000000000000000000000000..e406ce639a2e88b78f82f25e71678a66
+ *
+ * @return old item
+ */
+ @Nullable
+ @NotNull
+ public ItemStack getOldItem() {
+ return this.oldItem;
+ }
@@ -71,7 +73,7 @@ index 0000000000000000000000000000000000000000..e406ce639a2e88b78f82f25e71678a66
+ *
+ * @return new item
+ */
+ @Nullable
+ @NotNull
+ public ItemStack getNewItem() {
+ return this.newItem;
+ }
@@ -93,7 +95,7 @@ index 0000000000000000000000000000000000000000..e406ce639a2e88b78f82f25e71678a66
+ }
+
+ public enum SlotType {
+ HEAD(NETHERITE_HELMET, DIAMOND_HELMET, GOLDEN_HELMET, IRON_HELMET, CHAINMAIL_HELMET, LEATHER_HELMET, CARVED_PUMPKIN, PLAYER_HEAD, SKELETON_SKULL, ZOMBIE_HEAD, CREEPER_HEAD, WITHER_SKELETON_SKULL, TURTLE_HELMET),
+ HEAD(NETHERITE_HELMET, DIAMOND_HELMET, GOLDEN_HELMET, IRON_HELMET, CHAINMAIL_HELMET, LEATHER_HELMET, CARVED_PUMPKIN, PLAYER_HEAD, SKELETON_SKULL, ZOMBIE_HEAD, CREEPER_HEAD, WITHER_SKELETON_SKULL, TURTLE_HELMET, DRAGON_HEAD, PIGLIN_HEAD),
+ CHEST(NETHERITE_CHESTPLATE, DIAMOND_CHESTPLATE, GOLDEN_CHESTPLATE, IRON_CHESTPLATE, CHAINMAIL_CHESTPLATE, LEATHER_CHESTPLATE, ELYTRA),
+ LEGS(NETHERITE_LEGGINGS, DIAMOND_LEGGINGS, GOLDEN_LEGGINGS, IRON_LEGGINGS, CHAINMAIL_LEGGINGS, LEATHER_LEGGINGS),
+ FEET(NETHERITE_BOOTS, DIAMOND_BOOTS, GOLDEN_BOOTS, IRON_BOOTS, CHAINMAIL_BOOTS, LEATHER_BOOTS);
@@ -137,10 +139,10 @@ index 0000000000000000000000000000000000000000..e406ce639a2e88b78f82f25e71678a66
+ }
+
+ /**
+ * Gets whether or not this material can be equipped to a slot
+ * Gets whether this material can be equipped to a slot
+ *
+ * @param material material to check
+ * @return whether or not this material can be equipped
+ * @return whether this material can be equipped
+ */
+ public static boolean isEquipable(@NotNull Material material) {
+ return getByMaterial(material) != null;
@@ -9,7 +9,7 @@ on the real tile entity.
This is useful for where performance is needed
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index f8e12868f2e629cdf4784f0157fdb2f8e7b01f99..61ce341daec63392f040b70cd12662379b2f1ebd 100644
index 870ad6cd930653e6248abcc0fce94ffafbe9ebde..9f4d383ea3d6b26d16b8b77ca4c29d2d839ad6dd 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -272,6 +272,16 @@ public interface Block extends Metadatable, Translatable {
+1 -1
View File
@@ -578,7 +578,7 @@ index 270e6d8ad4358baa256cee5f16cff281f063ce3b..4a3451af454295ac3e1b688e6665cad9
@Override
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 9825db30d42701aad5d9970bbb989fbff0142fb1..2cb81e6d253d70388da15c9d07b630277d486c70 100644
index abadff47166722fdc756afdbc6ac7242b6bd4fb0..88f1ca89fa640a686231b8eec87e70419b2d73ef 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
@@ -48,6 +48,8 @@ public class AnnotationTest {
@@ -57,15 +57,15 @@ index 0000000000000000000000000000000000000000..7b2af1bd72dfbcf4e962a982940fc49b
+
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 1017db005f8c7a095911f5dd0dbe37d9fc239c95..2f2cce2a8b4b26fbe85da10f55f7313112b05435 100644
index 264c6bdeb2f1f0d937e4356d761a3264a1c4d58a..f9239eae50b86f54f0cd8c604d2ba9468fc5f33b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -39,7 +39,7 @@ import org.jetbrains.annotations.Nullable;
@@ -51,7 +51,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a player, connected or not
*/
-public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified { // Paper
+public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, com.destroystokyo.paper.network.NetworkClient { // Paper
-public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer { // Paper
+public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginMessageRecipient, net.kyori.adventure.identity.Identified, net.kyori.adventure.bossbar.BossBarViewer, com.destroystokyo.paper.network.NetworkClient { // Paper
// Paper start
@Override
@@ -10,26 +10,26 @@ 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 e57e600283702dd7fc60fa3baa1e1cc1b8574873..7be830ea0a3b24c5cdfb8e6ab62cb2ee506a4026 100644
index 9f9c67e935940833bbfe58e6bfa398e6c86980d5..71e494177473c62449aafda1699b26a0c4c81a68 100644
--- a/src/main/java/org/bukkit/inventory/ShapedRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapedRecipe.java
@@ -26,6 +26,7 @@ public class ShapedRecipe implements Recipe, Keyed {
@@ -31,6 +31,7 @@ public class ShapedRecipe extends CraftingRecipe {
@Deprecated
public ShapedRecipe(@NotNull ItemStack result) {
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR 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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace();
this.output = new ItemStack(result);
super(NamespacedKey.randomKey(), result);
+ 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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
}
/**
diff --git a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
index df4c52f1f0be2409c7506b09167bd58b5602fa7a..62675962d1b7882b953d2618aed1f363c046e97d 100644
index 03839302c94adc3175d0a88065cd230257ffd20d..d6e38c7ccfe3b6e85eafb611da20b1a29fb74d97 100644
--- a/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
+++ b/src/main/java/org/bukkit/inventory/ShapelessRecipe.java
@@ -27,6 +27,7 @@ public class ShapelessRecipe implements Recipe, Keyed {
@@ -20,6 +20,7 @@ public class ShapelessRecipe extends CraftingRecipe {
@Deprecated
public ShapelessRecipe(@NotNull ItemStack result) {
Preconditions.checkArgument(result.getType() != Material.AIR, "Recipe must have non-AIR 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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace();
this.output = new ItemStack(result);
super(NamespacedKey.randomKey(), result);
+ 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:<ID>'. Please ask the author to give their recipe a static key using NamespacedKey.").printStackTrace(); // Paper
}
/**
@@ -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 2f2cce2a8b4b26fbe85da10f55f7313112b05435..af92443e50b66e526d382c820e1b2e27c6e1b461 100644
index f9239eae50b86f54f0cd8c604d2ba9468fc5f33b..9dca8fc727b727063d9ca50fdd8f6452173a5cd4 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1128,12 +1128,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1368,6 +1368,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void resetPlayerWeather();
@@ -27,6 +27,9 @@ index 2f2cce2a8b4b26fbe85da10f55f7313112b05435..af92443e50b66e526d382c820e1b2e27
+ giveExp(amount, false);
+ }
/**
* Gets the player's cooldown between picking up experience orbs.
*
@@ -1393,8 +1402,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Gives the player the amount of experience specified.
*
* @param amount Exp amount to give
+2 -2
View File
@@ -16,7 +16,7 @@ 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 0000000000000000000000000000000000000000..02e421b0bb4ce3529ef1c4d34ec8a0c0345cce57
index 0000000000000000000000000000000000000000..8b48759bf6f4fcef0847d9a2461993e3f2fdc9aa
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java
@@ -0,0 +1,105 @@
@@ -117,7 +117,7 @@ index 0000000000000000000000000000000000000000..02e421b0bb4ce3529ef1c4d34ec8a0c0
+ }
+
+ /**
+ * Cancelling this event is more effecient than cancelling CreatureSpawnEvent
+ * Cancelling this event is more efficient than cancelling CreatureSpawnEvent
+ * @param cancel true if you wish to cancel this event, and abort the spawn of this creature
+ */
+ @Override
@@ -7,7 +7,7 @@ This allows you to create already filled textures on Skulls to avoid texture loo
which commonly cause rate limit issues with Mojang API
diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java
index 8d4093a413ca14a1c4c24a2a1b74c1d574943ffa..c7502a3913cf14e66559c21489d6f2205f3eb06a 100644
index b39128bb0ca2d4fe7a254193236c60fb5bfaa7da..5135b8e6028e6926e2711e2dd6ce68b76f468fd7 100644
--- a/src/main/java/org/bukkit/block/Skull.java
+++ b/src/main/java/org/bukkit/block/Skull.java
@@ -63,6 +63,20 @@ public interface Skull extends TileState {
+2 -22
View File
@@ -3,37 +3,17 @@ From: Aikar <aikar@aikar.co>
Date: Thu, 18 Jan 2018 01:00:27 -0500
Subject: [PATCH] Optimize Hoppers
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 919cc993e3cb1c14e2a3aebf90e6cc0fa6fbc17f..95e51bcf5dfd27cc9012d7542c4ed1bceca29626 100644
index 919cc993e3cb1c14e2a3aebf90e6cc0fa6fbc17f..0161b8a94c7e8774fec3ed9c36d9c37221525928 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryMoveItemEvent.java
@@ -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(@NotNull final Inventory sourceInventory, @NotNull final ItemStack itemStack, @NotNull final Inventory destinationInventory, final boolean didSourceInitiate) {
Preconditions.checkArgument(itemStack != null, "ItemStack cannot be null");
@@ -58,7 +60,8 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
@@ -58,7 +58,7 @@ 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
+ return itemStack; // Paper - Removed clone, handled better in Server
}
/**
@@ -70,6 +73,7 @@ public class InventoryMoveItemEvent extends Event implements Cancellable {
*/
public void setItem(@NotNull ItemStack itemStack) {
Preconditions.checkArgument(itemStack != null, "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();
}
@@ -366,7 +366,7 @@ index 0000000000000000000000000000000000000000..517d15238ed117f38bbd39f570874014
+
+}
diff --git a/src/main/java/org/bukkit/util/CachedServerIcon.java b/src/main/java/org/bukkit/util/CachedServerIcon.java
index 612958a331575d1da2715531ebdf6b1168f2e860..bb4f7702ced0baf0670a7a21d48ad528b7249361 100644
index 9a7768d41270714d4a1c89b4dcb436cc66f57545..b74b21a1ac7798e847b6d34ff45026e1c9cfed14 100644
--- a/src/main/java/org/bukkit/util/CachedServerIcon.java
+++ b/src/main/java/org/bukkit/util/CachedServerIcon.java
@@ -18,4 +18,9 @@ public interface CachedServerIcon {
@@ -6,10 +6,10 @@ 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/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index a6a792babe69712594c18f49542feb30ff591810..ec1af46667d8590ea218370249286f86652f3ac4 100644
index dcd539220e5a2bda41f27101ea4c0ece146e1d0d..f5358612884aae8d0686f3ff98ccee567a746f16 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1199,8 +1199,10 @@ public final class Bukkit {
@@ -1230,8 +1230,10 @@ public final class Bukkit {
* @return the new PlayerProfile
* @throws IllegalArgumentException if both the unique id is
* <code>null</code> and the name is <code>null</code> or blank
@@ -20,7 +20,7 @@ index a6a792babe69712594c18f49542feb30ff591810..ec1af46667d8590ea218370249286f86
public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) {
return server.createPlayerProfile(uniqueId, name);
}
@@ -1211,8 +1213,10 @@ public final class Bukkit {
@@ -1242,8 +1244,10 @@ public final class Bukkit {
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
@@ -31,7 +31,7 @@ index a6a792babe69712594c18f49542feb30ff591810..ec1af46667d8590ea218370249286f86
public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) {
return server.createPlayerProfile(uniqueId);
}
@@ -1224,8 +1228,10 @@ public final class Bukkit {
@@ -1255,8 +1259,10 @@ public final class Bukkit {
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
@@ -43,10 +43,10 @@ index a6a792babe69712594c18f49542feb30ff591810..ec1af46667d8590ea218370249286f86
return server.createPlayerProfile(name);
}
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index c5eed3234a8c04bfa9d707685746fc2b40ec8bfc..3ba8ff1a41ac9fd96fd4dec5cbe0f714fef93022 100644
index bec480aff819e09220b52175cab0cb6d68ae68c6..12349910297a75c00e64f6ccc7981aeeeb43ecd3 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -50,7 +50,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -59,7 +59,7 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* @return the player's profile
*/
@NotNull
@@ -54,12 +54,12 @@ index c5eed3234a8c04bfa9d707685746fc2b40ec8bfc..3ba8ff1a41ac9fd96fd4dec5cbe0f714
+ com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile(); // Paper
/**
* Checks if this player is banned or not
* Checks if this player has had their profile banned.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index bf1102b4481b8c9b9c4f5ba0c561556b75fea077..8539bac19bf9ba1a66689a9af90e088a03f9c152 100644
index 016cee903c7179baf711984503d1d0793d40c5c5..064edd612885b2ea4b35001a864503b568c53987 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1017,8 +1017,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1050,8 +1050,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the new PlayerProfile
* @throws IllegalArgumentException if both the unique id is
* <code>null</code> and the name is <code>null</code> or blank
@@ -70,7 +70,7 @@ index bf1102b4481b8c9b9c4f5ba0c561556b75fea077..8539bac19bf9ba1a66689a9af90e088a
PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name);
/**
@@ -1027,8 +1029,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1060,8 +1062,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
@@ -81,7 +81,7 @@ index bf1102b4481b8c9b9c4f5ba0c561556b75fea077..8539bac19bf9ba1a66689a9af90e088a
PlayerProfile createPlayerProfile(@NotNull UUID uniqueId);
/**
@@ -1038,8 +1042,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1071,8 +1075,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
@@ -93,10 +93,10 @@ index bf1102b4481b8c9b9c4f5ba0c561556b75fea077..8539bac19bf9ba1a66689a9af90e088a
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index af92443e50b66e526d382c820e1b2e27c6e1b461..95163d95b80f245712839af4c03e0df721809117 100644
index 9dca8fc727b727063d9ca50fdd8f6452173a5cd4..ccd80734cf5641455fd9d9b63238739987e225da 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2386,6 +2386,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2678,6 +2678,24 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
*/
boolean hasResourcePack();
@@ -110,7 +110,11 @@ index af92443e50b66e526d382c820e1b2e27c6e1b461..95163d95b80f245712839af4c03e0df7
+
+ /**
+ * Changes the PlayerProfile for this player. This will cause this player
+ * to be reregistered to all clients that can currently see this player
+ * to be reregistered to all clients that can currently see this player.
+ *
+ * After executing this method, the player {@link java.util.UUID} won't
+ * be swapped, only their name and gameprofile properties.
+ *
+ * @param profile The new profile to use
+ */
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
+4 -4
View File
@@ -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 ec1af46667d8590ea218370249286f86652f3ac4..aa4217c87756cffe774aaa2d390217b9056c4b95 100644
index f5358612884aae8d0686f3ff98ccee567a746f16..a6f9336f27cb4a7aed0c01cde417d2287e393929 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -657,6 +657,20 @@ public final class Bukkit {
@@ -688,6 +688,20 @@ public final class Bukkit {
return server.getPlayer(id);
}
@@ -34,10 +34,10 @@ index ec1af46667d8590ea218370249286f86652f3ac4..aa4217c87756cffe774aaa2d390217b9
* 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 8539bac19bf9ba1a66689a9af90e088a03f9c152..c46cae77e6a1d3f01b08ff03407eb1a564d000de 100644
index 064edd612885b2ea4b35001a864503b568c53987..dfbccef8dd67195d588112989a9ffecb712a9fe9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -559,6 +559,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -592,6 +592,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
public Player getPlayer(@NotNull UUID id);
@@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index abdca9fe5acc90f167219eb769ece66c35682bb1..9715a9d36187e2eecfeab1a05087d27c28b8690e 100644
index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f463c2234 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -500,6 +500,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -500,6 +500,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
@Deprecated
public void setShoulderEntityRight(@Nullable Entity entity);
@@ -17,17 +17,29 @@ index abdca9fe5acc90f167219eb769ece66c35682bb1..9715a9d36187e2eecfeab1a05087d27c
+ * Opens an editor window for the specified sign
+ *
+ * @param sign The sign to open
+ * @deprecated use {@link #openSign(org.bukkit.block.Sign, org.bukkit.block.sign.Side)}
+ */
+ void openSign(@NotNull org.bukkit.block.Sign sign);
+ @Deprecated
+ default void openSign(@NotNull org.bukkit.block.Sign sign) {
+ this.openSign(sign, org.bukkit.block.sign.Side.FRONT);
+ }
+
+ /**
+ * Opens an editor window for the specified sign
+ *
+ * @param sign The sign to open
+ * @param side The side of the sign to open
+ */
+ void openSign(org.bukkit.block.@NotNull Sign sign, org.bukkit.block.sign.@NotNull Side side);
+ // Paper end
/**
* Make the entity drop the item in their hand.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 95163d95b80f245712839af4c03e0df721809117..3a9dd66d8f30c04342180097d8de44933304b88c 100644
index ccd80734cf5641455fd9d9b63238739987e225da..bca4794a67c369b0bb882e56f489ed952488b2c5 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2241,7 +2241,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2523,10 +2523,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Open a Sign for editing by the Player.
*
@@ -35,4 +47,9 @@ index 95163d95b80f245712839af4c03e0df721809117..3a9dd66d8f30c04342180097d8de4493
+ * The Sign must be in the same world as the player.
*
* @param sign The sign to edit
+ * @deprecated use {@link #openSign(Sign, Side)}
*/
+ @Deprecated
public void openSign(@NotNull Sign sign);
/**
@@ -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 3ba8ff1a41ac9fd96fd4dec5cbe0f714fef93022..b39ed4eb2e7d9e40805e201d77973877481db8fd 100644
index 12349910297a75c00e64f6ccc7981aeeeb43ecd3..8f2f3e0ac5266f571b62a754921422bb07d61984 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -58,6 +58,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -67,6 +67,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* @return true if banned, otherwise false
*/
public boolean isBanned();
@@ -72,12 +72,12 @@ index 3ba8ff1a41ac9fd96fd4dec5cbe0f714fef93022..b39ed4eb2e7d9e40805e201d77973877
+ // Paper end
/**
* Checks if this player is whitelisted or not
* Adds this user to the {@link ProfileBanList}. If a previous ban exists, this will
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 3a9dd66d8f30c04342180097d8de44933304b88c..c43cf2bdf24de153d16017e50d9b5723218e3d44 100644
index bca4794a67c369b0bb882e56f489ed952488b2c5..a851ec4d350ce442eb01385d21ca75e695cf09d2 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -814,6 +814,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1042,6 +1042,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@@ -211,7 +211,7 @@ index 3a9dd66d8f30c04342180097d8de44933304b88c..c43cf2bdf24de153d16017e50d9b5723
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.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 source Source of the ban or null for default
+ * @return Ban Entry
+ */
+ @Nullable
@@ -224,7 +224,7 @@ index 3a9dd66d8f30c04342180097d8de44933304b88c..c43cf2bdf24de153d16017e50d9b5723
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.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 source Source of the ban or null for default
+ * @param kickPlayer if the targeted player should be kicked
+ * @return Ban Entry
+ */
@@ -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 bb325d9c802e33431530bbccdcf5de5839e5fe68..821c690f8a32918bdb284ffec4af98f411f76ccc 100644
index 0a03dc437973888ba57ba00fec47193fee38b5a9..605af1a9fc48602643aec57dd14e8c4ab657a0bc 100644
--- a/src/main/java/org/bukkit/entity/Enderman.java
+++ b/src/main/java/org/bukkit/entity/Enderman.java
@@ -10,6 +10,17 @@ import org.jetbrains.annotations.Nullable;
@@ -11,6 +11,17 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Enderman extends Monster {
@@ -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 749d3de7dad480965be536938733d72bdfc2995b..dad7de7246741d6f3f2a444cf0b88f396302a8af 100644
index 609e4908ed21f69b9e813500e702bbe784bff00c..7a6caf93606203198369030a295f1edbffde3c31 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1,6 +1,9 @@
@@ -19,7 +19,7 @@ index 749d3de7dad480965be536938733d72bdfc2995b..dad7de7246741d6f3f2a444cf0b88f39
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -657,6 +660,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -625,6 +628,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes);
@@ -276,17 +276,3 @@ index 749d3de7dad480965be536938733d72bdfc2995b..dad7de7246741d6f3f2a444cf0b88f39
/**
* Get a list of all players in this World
*
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index c30b44ff26f8f253902754452a0816f07c7fd035..9acf1fb404ccf9b3bc06a448c3099ca2e838facf 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -42,8 +42,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
return profile;
}
- /**
- * Changes the PlayerProfile the player will login as
+ /* * Changes the PlayerProfile the player will login as
* @param profile The profile to use
*/
public void setPlayerProfile(@NotNull PlayerProfile profile) {
@@ -500,11 +500,11 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 0ca7955003eea0556a04a54056152ec27d93a9ee..93244e6d940891f1297d4a26a80ba155af306071 100644
index e2adb9901cc92ede9d44ca9939c6a54d4762eb4b..81bd12c8addcee754c71e5e030c729c7e096fb4c 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -163,6 +163,17 @@ public enum Particle {
return dataType;
@@ -194,6 +194,18 @@ public enum Particle implements Keyed {
return key;
}
+ // Paper start - Particle API expansion
@@ -518,14 +518,15 @@ index 0ca7955003eea0556a04a54056152ec27d93a9ee..93244e6d940891f1297d4a26a80ba155
+ return new com.destroystokyo.paper.ParticleBuilder(this);
+ }
+ // Paper end
+
/**
* 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 dad7de7246741d6f3f2a444cf0b88f396302a8af..ae102dddda30ff0e15f70bdb17385c8d9d4b9a08 100644
index 7a6caf93606203198369030a295f1edbffde3c31..3e7385d21380abcd40649045e4666cf4bed32195 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2812,7 +2812,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2777,7 +2777,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
*/
@@ -5,10 +5,10 @@ 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 1f0faf16071f0be44c87248582ba173e51aafb52..24e36cdf580da885ac64002673a786b9c5a3f787 100644
index 88f720aba13961b08e54b3fd35dbaabc5dd9a4c2..037af5fd6d71a526c0e6620f2db0cd6df9625261 100644
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
@@ -101,6 +101,33 @@ public class PotionEffect implements ConfigurationSerializable {
@@ -107,6 +107,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)));
}
@@ -41,4 +41,4 @@ index 1f0faf16071f0be44c87248582ba173e51aafb52..24e36cdf580da885ac64002673a786b9
+
@NotNull
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
int type = getInt(map, TYPE);
PotionEffectType effect;
+2 -2
View File
@@ -7,7 +7,7 @@ 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 0000000000000000000000000000000000000000..5351b523defa054ba56ae3fb591029283ca7510d
index 0000000000000000000000000000000000000000..57f93af14acc6346c5a343e05fe8f5d44d6adbc6
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
@@ -0,0 +1,80 @@
@@ -31,7 +31,7 @@ index 0000000000000000000000000000000000000000..5351b523defa054ba56ae3fb59102928
+ }
+
+ /**
+ * Fires thee event, returning the desired potion, or air of cancelled
+ * Fires the event, returning the desired potion, or air of cancelled
+ * @param witch the witch whom is readying to use a potion
+ * @param potion the potion to be used
+ * @return The ItemStack to be used
@@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 9d32283ee612a50b8a2bfe5151f42c9f181ede4c..53d99d214652ae1636f28a179a5b66edc0f8f229 100644
index a8faa4c1881bae4d47d901388a78b991d138b518..b85eb71ff5d198d6270cbe07da0de3ed27fa72d5 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -646,5 +646,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -5,10 +5,10 @@ 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 ccd8f36c8450bab9f609bb220b5270394960580e..2bfeebe26f32d2e931dc483714d30430deeb9b04 100644
index 6a9df4ec0eee205bcd37de9c4d04a6c67eb21644..b470d86c00be238a430e64d349a247e2740cfeec 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -731,5 +731,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -764,5 +764,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
@Deprecated
void setArrowsStuck(int arrows);
+7 -5
View File
@@ -6,7 +6,7 @@ Subject: [PATCH] Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location.
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 6693e3d8dc2519facb12db981a6b6325faa095bf..5a6b33c6d9a68affdbd02c13fdb0854e011e327d 100644
index 6693e3d8dc2519facb12db981a6b6325faa095bf..b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -7,6 +7,7 @@ import java.util.HashMap;
@@ -17,10 +17,11 @@ index 6693e3d8dc2519facb12db981a6b6325faa095bf..5a6b33c6d9a68affdbd02c13fdb0854e
import org.bukkit.util.NumberConversions;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
@@ -568,6 +569,87 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
@@ -568,6 +569,89 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
return centerLoc;
}
+ // Paper start - Expand Explosions API
+ /**
+ * Creates explosion at this location with given power
+ *
@@ -98,18 +99,19 @@ index 6693e3d8dc2519facb12db981a6b6325faa095bf..5a6b33c6d9a68affdbd02c13fdb0854e
+ * @param breakBlocks Whether or not to have blocks be destroyed
+ * @return false if explosion was canceled, otherwise true
+ */
+ public boolean createExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) {
+ public boolean createExplosion(@Nullable Entity source, float power, boolean setFire, boolean breakBlocks) {
+ return this.getWorld().createExplosion(source, this, power, setFire, breakBlocks);
+ }
+ // Paper end - Expand Explosions API
+
/**
* Returns a list of entities within a bounding box centered around a Location.
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index ae102dddda30ff0e15f70bdb17385c8d9d4b9a08..adf743334f4e69ebca8045df70800f67bcd7d98f 100644
index 3e7385d21380abcd40649045e4666cf4bed32195..266ed71b79d32f9b812be322563c247051ccd9d0 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1424,6 +1424,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -1392,6 +1392,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire);
@@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 53d99d214652ae1636f28a179a5b66edc0f8f229..a70de962712c14cb895708e89ad3811041728935 100644
index b85eb71ff5d198d6270cbe07da0de3ed27fa72d5..83a0631a80db156ace1d977df71d5fc653b70bb6 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -3,6 +3,7 @@ package org.bukkit.inventory;
@@ -139,7 +139,7 @@ index 53d99d214652ae1636f28a179a5b66edc0f8f229..a70de962712c14cb895708e89ad38110
+ *
+ * @param lore the lore that will be set
+ */
+ public void lore(@Nullable List<net.kyori.adventure.text.Component> lore) {
+ public void lore(@Nullable List<? extends net.kyori.adventure.text.Component> lore) {
+ ItemMeta itemMeta = getItemMeta();
+ if (itemMeta == null) {
+ throw new IllegalStateException("Cannot set lore on " + getType());
@@ -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/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 9715a9d36187e2eecfeab1a05087d27c28b8690e..12068d14af5731494a839b87b67ed3cc26bf8f36 100644
index b3aa3dc6aa5afbc36cc86741b4cba56f463c2234..9e012c3c0671e5d0e55c243fdb4e14057038c153 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -328,7 +328,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -20,10 +20,10 @@ index 9715a9d36187e2eecfeab1a05087d27c28b8690e..12068d14af5731494a839b87b67ed3cc
public ItemStack getItemInUse();
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 2bfeebe26f32d2e931dc483714d30430deeb9b04..17e5d2e2acdae23d8ea3b3b1a89f62e8be7b81a8 100644
index b470d86c00be238a430e64d349a247e2740cfeec..97d0f82041a229e85217a7e575bf003eddc31b70 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -745,5 +745,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -778,5 +778,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param delay Delay in ticks
*/
void setShieldBlockingDelay(int delay);
+1 -1
View File
@@ -169,7 +169,7 @@ index 0ebd54df0bb072df25a6ebcf137a39829cf71bf9..6618f2129e108c0a6cd15f6d0e864260
/**
* Gets whether the witch is drinking a potion
diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java
index 225c65a20a3e33dfb14e108a36f2f4bc60f7920c..b86f0196e6eb8070830f63a94f732522c2a6c2f1 100644
index b3a5d7a91e483b9fd569dd3c8cec989498a50104..87a814f63c3f35be35bfa210c9248ad211c0dd8f 100644
--- a/src/main/java/org/bukkit/entity/Wither.java
+++ b/src/main/java/org/bukkit/entity/Wither.java
@@ -6,7 +6,7 @@ import org.jetbrains.annotations.Nullable;
@@ -5,10 +5,10 @@ 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 adf743334f4e69ebca8045df70800f67bcd7d98f..e0caac06b7f5459faefbbd5a6a3486dbb6bfa9ba 100644
index 266ed71b79d32f9b812be322563c247051ccd9d0..ffe6c8be86fc93d39e256a89e5016e3025afbe5c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -944,6 +944,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -912,6 +912,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z);
@@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 12068d14af5731494a839b87b67ed3cc26bf8f36..3b184a66d1aebe4501fbdfd78ddf7a4ef5378f9f 100644
index 9e012c3c0671e5d0e55c243fdb4e14057038c153..d44c5a3fda0b159dc541246cb2fca8427cb38243 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -179,6 +179,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -27,10 +27,10 @@ index 12068d14af5731494a839b87b67ed3cc26bf8f36..3b184a66d1aebe4501fbdfd78ddf7a4e
* 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 5861247c1b8ee4fe2736fd5098e05a2ca9ab78ea..21ad8888c0e403bfc63518502577d651c02dda05 100644
index c0cc82d98348e8aae3cb56bafb2fcb590b03094f..4db0a07db156c61867644f50c185e63b695e2462 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
@@ -11,9 +11,60 @@ import org.jetbrains.annotations.NotNull;
@@ -30,9 +30,60 @@ import org.jetbrains.annotations.NotNull;
*/
public class InventoryCloseEvent extends InventoryEvent {
private static final HandlerList handlers = new HandlerList();
+2 -2
View File
@@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API
Get the chunk the entity is currently registered to
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index c10e19e06f0c4e33b2c5a4a1446b151f818e92db..13e0316b2446c1d10b2ff3582b948265de21bfef 100644
index 4319dbac54b4cce95ad7479d5bd141a2b12ab7ae..5fc085f785719933eef7ab1b3cf173579c64739b 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -3,6 +3,7 @@ package org.bukkit.entity;
@@ -17,7 +17,7 @@ index c10e19e06f0c4e33b2c5a4a1446b151f818e92db..13e0316b2446c1d10b2ff3582b948265
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Nameable;
@@ -741,5 +742,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -756,5 +757,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return True if entity spawned from a mob spawner
*/
boolean fromMobSpawner();
+21 -23
View File
@@ -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 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483f43da385
index 0000000000000000000000000000000000000000..615bc4c973ff371d87f996e981207fc15b70275b
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EnderDragonFireballHitEvent.java
@@ -0,0 +1,79 @@
@@ -0,0 +1,77 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.entity.AreaEffectCloud;
@@ -20,17 +20,21 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
+import org.bukkit.event.entity.EntityEvent;
+
+import java.util.Collection;
+import org.jetbrains.annotations.ApiStatus;
+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 {
+ @Nullable private final Collection<LivingEntity> targets;
+ @NotNull private final AreaEffectCloud areaEffectCloud;
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ public EnderDragonFireballHitEvent(@NotNull DragonFireball fireball, @Nullable Collection<LivingEntity> targets, @NotNull AreaEffectCloud areaEffectCloud) {
+ @NotNull private final Collection<LivingEntity> targets;
+ @NotNull private final AreaEffectCloud areaEffectCloud;
+ private boolean cancelled = false;
+
+ @ApiStatus.Internal
+ public EnderDragonFireballHitEvent(@NotNull DragonFireball fireball, @NotNull Collection<LivingEntity> targets, @NotNull AreaEffectCloud areaEffectCloud) {
+ super(fireball);
+ this.targets = targets;
+ this.areaEffectCloud = areaEffectCloud;
@@ -48,11 +52,9 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
+ /**
+ * The living entities hit by fireball
+ *
+ * May be null if no entities were hit
+ *
+ * @return the targets
+ */
+ @Nullable
+ @NotNull
+ public Collection<LivingEntity> getTargets() {
+ return targets;
+ }
@@ -65,20 +67,6 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
+ return areaEffectCloud;
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ private boolean cancelled = false;
+
+ @Override
+ public boolean isCancelled() {
+ return cancelled;
@@ -88,6 +76,16 @@ index 0000000000000000000000000000000000000000..118c7b6772a52c250649af2a9286f483
+ public void setCancelled(boolean cancel) {
+ cancelled = cancel;
+ }
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}
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
@@ -6,10 +6,10 @@ 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 0000000000000000000000000000000000000000..12194f1fc7f03ca6785904b6187b3dfd03b16461
index 0000000000000000000000000000000000000000..c6802ca6acad1b841c01284eef0a601774486f55
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityTransformedEvent.java
@@ -0,0 +1,92 @@
@@ -0,0 +1,93 @@
+package com.destroystokyo.paper.event.entity;
+
+
@@ -18,6 +18,7 @@ index 0000000000000000000000000000000000000000..12194f1fc7f03ca6785904b6187b3dfd
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.bukkit.event.entity.EntityTransformEvent;
+import org.jetbrains.annotations.ApiStatus;
+
+/**
+ * Fired when an entity transforms into another entity
@@ -25,7 +26,7 @@ index 0000000000000000000000000000000000000000..12194f1fc7f03ca6785904b6187b3dfd
+ * If the event is cancelled, the entity will not transform
+ * @deprecated Bukkit has added {@link EntityTransformEvent}, you should start using that
+ */
+@Deprecated
+@Deprecated(forRemoval = true) @ApiStatus.ScheduledForRemoval(inVersion = "1.21")
+public class EntityTransformedEvent extends EntityEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
@@ -6,7 +6,7 @@ Subject: [PATCH] Expand Location Manipulation API
Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z);
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 5a6b33c6d9a68affdbd02c13fdb0854e011e327d..943c3364f6b931fe11f9a6099504590b2da34657 100644
index b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde..aa6821aa33d3c579a139bd7c0378253c43b3754a 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -546,6 +546,54 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
+11 -8
View File
@@ -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 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95ce90b9dee
index 0000000000000000000000000000000000000000..aa5c3690fb898a7560a9551df91588a0cdc69fe2
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/block/AnvilDamagedEvent.java
@@ -0,0 +1,148 @@
@@ -0,0 +1,151 @@
+package com.destroystokyo.paper.event.block;
+
+import org.bukkit.Material;
@@ -19,6 +19,7 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c
+import org.bukkit.event.inventory.InventoryEvent;
+import org.bukkit.inventory.AnvilInventory;
+import org.bukkit.inventory.InventoryView;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@@ -26,11 +27,13 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c
+ * Called when an anvil is damaged from being used
+ */
+public class AnvilDamagedEvent extends InventoryEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private boolean cancel;
+ private DamageState damageState;
+
+ public AnvilDamagedEvent(@NotNull InventoryView inventory, @NotNull BlockData blockData) {
+ @ApiStatus.Internal
+ public AnvilDamagedEvent(@NotNull InventoryView inventory, @Nullable BlockData blockData) {
+ super(inventory);
+ this.damageState = DamageState.getState(blockData);
+ }
@@ -92,12 +95,12 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ return HANDLER_LIST;
+ }
+
+ /**
@@ -109,7 +112,7 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c
+ DAMAGED(Material.DAMAGED_ANVIL),
+ BROKEN(Material.AIR);
+
+ private Material material;
+ private final Material material;
+
+ DamageState(@NotNull Material material) {
+ this.material = material;
@@ -154,7 +157,7 @@ index 0000000000000000000000000000000000000000..a83c286c1c11af25fc4d16af7a42b95c
+ return state;
+ }
+ }
+ throw new IllegalArgumentException("Material not an anvil");
+ throw new IllegalArgumentException("Material is not an anvil state");
+ }
+ }
+}
+4 -2
View File
@@ -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 0000000000000000000000000000000000000000..73dabb82c7fbea3f0cccade0a2944b11a80ede06
index 0000000000000000000000000000000000000000..9d7221583454dc922b20af6c233897c0b2ec47da
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java
@@ -0,0 +1,114 @@
@@ -0,0 +1,116 @@
+package com.destroystokyo.paper.event.block;
+
+import org.bukkit.block.Block;
@@ -27,7 +27,9 @@ index 0000000000000000000000000000000000000000..73dabb82c7fbea3f0cccade0a2944b11
+ * the TNT block as-is
+ *
+ * @author Mark Vainomaa
+ * @deprecated use {@link org.bukkit.event.block.TNTPrimeEvent}
+ */
+@Deprecated(forRemoval = true)
+public class TNTPrimeEvent extends BlockEvent implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean cancelled;
@@ -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 a33379e6df0577ea149be473a647258a3bda99f1..fa14c276309fc113d5fda38dfdda1d6ee25b8787 100644
index efbfed855248cff8b4bdbfc181d3e82058df4749..766d643f0fe79660942fdad25e39e488e9379419 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -29,6 +29,32 @@ public interface Chunk extends PersistentDataHolder {
@@ -33,6 +33,32 @@ public interface Chunk extends PersistentDataHolder {
*/
int getZ();
@@ -44,17 +44,17 @@ index a33379e6df0577ea149be473a647258a3bda99f1..fa14c276309fc113d5fda38dfdda1d6e
* 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 e0caac06b7f5459faefbbd5a6a3486dbb6bfa9ba..7d6c923ea603a3193865e6a34b41617ac7016d19 100644
index ffe6c8be86fc93d39e256a89e5016e3025afbe5c..315ecb5dc0f33edfef893ead1297c8165d292250 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -212,6 +212,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -180,6 +180,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Chunk getChunkAt(@NotNull Block block);
+ // Paper start
+ // Paper start - chunk long key API
+ /**
+ * Gets the chunk at the specified chunk key, which is the X and Z packed into a long.
+ *
+ * <p>
+ * See {@link Chunk#getChunkKey()} for easy access to the key, or you may calculate it as:
+ * long chunkKey = (long) chunkX &amp; 0xffffffffL | ((long) chunkZ &amp; 0xffffffffL) &gt;&gt; 32;
+ *
@@ -62,10 +62,25 @@ index e0caac06b7f5459faefbbd5a6a3486dbb6bfa9ba..7d6c923ea603a3193865e6a34b41617a
+ * @return The chunk at the specified key
+ */
+ @NotNull
+ public default Chunk getChunkAt(long chunkKey) {
+ return getChunkAt((int) chunkKey, (int) (chunkKey >> 32));
+ default Chunk getChunkAt(long chunkKey) {
+ return getChunkAt(chunkKey, true);
+ }
+ // Paper end
+
+ /**
+ * Gets the chunk at the specified chunk key, which is the X and Z packed into a long.
+ * <p>
+ * See {@link Chunk#getChunkKey()} for easy access to the key, or you may calculate it as:
+ * long chunkKey = (long) chunkX &amp; 0xffffffffL | ((long) chunkZ &amp; 0xffffffffL) &gt;&gt; 32;
+ *
+ * @param chunkKey The Chunk Key to look up the chunk by
+ * @param generate Whether the chunk should be fully generated or not
+ * @return The chunk at the specified key
+ */
+ @NotNull
+ default Chunk getChunkAt(long chunkKey, boolean generate) {
+ return getChunkAt((int) chunkKey, (int) (chunkKey >> 32), generate);
+ }
+ // Paper end - chunk long key API
+
/**
* Checks if the specified {@link Chunk} is loaded
@@ -5,10 +5,10 @@ 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 fa14c276309fc113d5fda38dfdda1d6ee25b8787..eccc357cabd8317afc5666c3347936d50eb34015 100644
index 766d643f0fe79660942fdad25e39e488e9379419..4418c41f75e9a190dd77abdd6048b0a4fb2a57ed 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -118,7 +118,30 @@ public interface Chunk extends PersistentDataHolder {
@@ -122,7 +122,30 @@ public interface Chunk extends PersistentDataHolder {
* @return The tile entities.
*/
@NotNull
@@ -39,4 +39,4 @@ index fa14c276309fc113d5fda38dfdda1d6ee25b8787..eccc357cabd8317afc5666c3347936d5
+ // Paper end
/**
* Checks if the chunk is loaded.
* Checks if the chunk is fully generated.
@@ -5,10 +5,10 @@ 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 ddaed81275fcc12d1671b668697acf318e96888b..203cda0f9a4dea4f28a21ea9ee8db7a7369842e3 100644
index eb9d58f8852e732a1284beeaf542989301d21b1c..02e88db63be2d5e31da6b65157ba7b971b1f10f3 100644
--- a/src/main/java/co/aikar/timings/TimingHistory.java
+++ b/src/main/java/co/aikar/timings/TimingHistory.java
@@ -119,7 +119,7 @@ public class TimingHistory {
@@ -120,7 +120,7 @@ public class TimingHistory {
data.entityCounts.get(entity.getType()).increment();
}
@@ -18,7 +18,7 @@ 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 943c3364f6b931fe11f9a6099504590b2da34657..16a604b6315daff228c827fe02b1234cca3e884d 100644
index aa6821aa33d3c579a139bd7c0378253c43b3754a..6e6e65c40813ccce618fa7a3df2c0030aa0a3bbe 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -15,7 +15,6 @@ import org.jetbrains.annotations.Nullable;
@@ -50,10 +50,10 @@ index 943c3364f6b931fe11f9a6099504590b2da34657..16a604b6315daff228c827fe02b1234c
* @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 7d6c923ea603a3193865e6a34b41617ac7016d19..00651d5486f1de886df7a4a01aaf272ceb0fa82a 100644
index 315ecb5dc0f33edfef893ead1297c8165d292250..ad5afa7a05636cee82b517c673d281f0f4e38644 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -95,6 +95,40 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -97,6 +97,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Block getBlockAt(@NotNull Location location);
@@ -83,6 +83,7 @@ index 7d6c923ea603a3193865e6a34b41617ac7016d19..00651d5486f1de886df7a4a01aaf272c
+ * @see Block#getBlockKey(int, int, int)
+ */
+ @NotNull
+ @Deprecated
+ public default Location getLocationAtKey(long key) {
+ int x = Block.getBlockKeyX(key);
+ int y = Block.getBlockKeyY(key);
@@ -92,10 +93,10 @@ index 7d6c923ea603a3193865e6a34b41617ac7016d19..00651d5486f1de886df7a4a01aaf272c
+ // Paper end
+
/**
* Gets the highest non-empty (impassable) coordinate at the given
* coordinates.
* Gets the highest non-empty (impassable) block at the given coordinates.
*
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index 61ce341daec63392f040b70cd12662379b2f1ebd..0be73b2f45c9aab6e73bcb7a76136ec6e2428163 100644
index 9f4d383ea3d6b26d16b8b77ca4c29d2d839ad6dd..78f6cc1a8a8de05aec6f551f8a5f425944f0ffa3 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -156,6 +156,82 @@ public interface Block extends Metadatable, Translatable {
@@ -6,7 +6,7 @@ Subject: [PATCH] Slime Pathfinder Events
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..2638bbd3e1392b3d8640be58163f6eb2789dee4a
index 0000000000000000000000000000000000000000..473fbded8ab534308f2c0bd0b87512fcce5c9e58
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/SlimeChangeDirectionEvent.java
@@ -0,0 +1,38 @@
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..2638bbd3e1392b3d8640be58163f6eb2
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired when a Slime decides to change it's facing direction.
+ * Fired when a Slime decides to change its facing direction.
+ * <p>
+ * This event does not fire for the entity's actual movement. Only when it
+ * is choosing to change direction.
@@ -6,16 +6,17 @@ 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 0000000000000000000000000000000000000000..9022f697ab244df43074e48c9150f39d44217531
index 0000000000000000000000000000000000000000..d8f3f1c354331bc5e6fc1d9aa013476baf2daf05
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/PhantomPreSpawnEvent.java
@@ -0,0 +1,31 @@
@@ -0,0 +1,33 @@
+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.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@@ -26,6 +27,7 @@ index 0000000000000000000000000000000000000000..9022f697ab244df43074e48c9150f39d
+public class PhantomPreSpawnEvent extends PreCreatureSpawnEvent {
+ @NotNull private final Entity entity;
+
+ @ApiStatus.Internal
+ public PhantomPreSpawnEvent(@NotNull Location location, @NotNull Entity entity, @NotNull CreatureSpawnEvent.SpawnReason reason) {
+ super(location, EntityType.PHANTOM, reason);
+ this.entity = entity;
@@ -36,7 +38,7 @@ index 0000000000000000000000000000000000000000..9022f697ab244df43074e48c9150f39d
+ *
+ * @return Entity
+ */
+ @Nullable
+ @NotNull
+ public Entity getSpawningEntity() {
+ return entity;
+ }
+11 -9
View File
@@ -5,7 +5,7 @@ Subject: [PATCH] isChunkGenerated API
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 16a604b6315daff228c827fe02b1234cca3e884d..20978b269a7757a561d6b872cc77898b44bbd272 100644
index 6e6e65c40813ccce618fa7a3df2c0030aa0a3bbe..8508aa2c6fb7c9f41f3d185f5228c86dd3b8b627 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -3,6 +3,7 @@ package org.bukkit;
@@ -34,14 +34,14 @@ index 16a604b6315daff228c827fe02b1234cca3e884d..20978b269a7757a561d6b872cc77898b
/**
* 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 00651d5486f1de886df7a4a01aaf272ceb0fa82a..8075ff77eddb971a0a73dad3c9b809131b5db343 100644
index ad5afa7a05636cee82b517c673d281f0f4e38644..880ff5ee1237096ac2da115b665dc663c677e57b 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -260,6 +260,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
public default Chunk getChunkAt(long chunkKey) {
return getChunkAt((int) chunkKey, (int) (chunkKey >> 32));
@@ -246,6 +246,19 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
+
// Paper end - chunk long key API
+ // Paper start - isChunkGenerated API
+ /**
+ * Checks if a {@link Chunk} has been generated at the specified chunk key,
+ * which is the X and Z packed into a long.
@@ -49,9 +49,11 @@ index 00651d5486f1de886df7a4a01aaf272ceb0fa82a..8075ff77eddb971a0a73dad3c9b80913
+ * @param chunkKey The Chunk Key to look up the chunk by
+ * @return true if the chunk has been generated, otherwise false
+ */
+ public default boolean isChunkGenerated(long chunkKey) {
+ default boolean isChunkGenerated(long chunkKey) {
+ return isChunkGenerated((int) chunkKey, (int) (chunkKey >> 32));
+ }
// Paper end
+ // Paper end - isChunkGenerated API
+
/**
* Checks if the specified {@link Chunk} is loaded
*
+22 -22
View File
@@ -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 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937b70cf27d 100644
index 880ff5ee1237096ac2da115b665dc663c677e57b..fc6b99e4f37179b15254bf0b398b1a800de1b73f 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -969,6 +969,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -955,6 +955,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
return nearby;
}
@@ -56,8 +56,8 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * on the main Server Thread.
+ *
+ * @deprecated Use either the Future or the Consumer based methods
+ * @param x Chunk X-coordinate of the chunk - (world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - (world coordinate / 16)
+ * @param x Chunk X-coordinate of the chunk - floor(world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - floor(world coordinate / 16)
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
@@ -134,8 +134,8 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The {@link java.util.function.Consumer} will always be executed synchronously
+ * on the main Server Thread.
+ *
+ * @param x Chunk X-coordinate of the chunk - (world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - (world coordinate / 16)
+ * @param x Chunk X-coordinate of the chunk - floor(world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - floor(world coordinate / 16)
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
@@ -159,9 +159,9 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The {@link java.util.function.Consumer} will always be executed synchronously
+ * on the main Server Thread.
+ *
+ * @param x Chunk X-coordinate of the chunk - (world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - (world coordinate / 16)
+ * @param gen Should we generate a chunk if it doesn't exists or not
+ * @param x Chunk X-coordinate of the chunk - floor(world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - floor(world coordinate / 16)
+ * @param gen Should we generate a chunk if it doesn't exist or not
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
@@ -207,7 +207,7 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * on the main Server Thread.
+ *
+ * @param loc Location of the chunk
+ * @param gen Should the chunk generate
+ * @param gen Should the chunk generate if it doesn't exist
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
@@ -250,7 +250,7 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * on the main Server Thread.
+ *
+ * @param block Block to get the containing chunk from
+ * @param gen Should the chunk generate
+ * @param gen Should the chunk generate if it doesn't exist
+ * @param cb Callback to receive the chunk when it is loaded.
+ * will be executed synchronously
+ */
@@ -291,7 +291,7 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The future will always be executed synchronously
+ * on the main Server Thread.
+ * @param loc Location to load the corresponding chunk from
+ * @param gen Should the chunk generate
+ * @param gen Should the chunk generate if it doesn't exist
+ * @return Future that will resolve when the chunk is loaded
+ */
+ @NotNull
@@ -332,7 +332,7 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The future will always be executed synchronously
+ * on the main Server Thread.
+ * @param block Block to load the corresponding chunk from
+ * @param gen Should the chunk generate
+ * @param gen Should the chunk generate if it doesn't exist
+ * @return Future that will resolve when the chunk is loaded
+ */
+ @NotNull
@@ -353,8 +353,8 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The future will always be executed synchronously
+ * on the main Server Thread.
+ *
+ * @param x X Coord
+ * @param z Z Coord
+ * @param x Chunk X-coordinate of the chunk - floor(world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - floor(world coordinate / 16)
+ * @return Future that will resolve when the chunk is loaded
+ */
+ @NotNull
@@ -375,9 +375,9 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The future will always be executed synchronously
+ * on the main Server Thread.
+ *
+ * @param x Chunk X-coordinate of the chunk - (world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - (world coordinate / 16)
+ * @param gen Should we generate a chunk if it doesn't exists or not
+ * @param x Chunk X-coordinate of the chunk - floor(world coordinate / 16)
+ * @param z Chunk Z-coordinate of the chunk - floor(world coordinate / 16)
+ * @param gen Should we generate a chunk if it doesn't exist or not
+ * @return Future that will resolve when the chunk is loaded
+ */
+ @NotNull
@@ -418,7 +418,7 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The future will always be executed synchronously
+ * on the main Server Thread.
+ * @param loc Location to load the corresponding chunk from
+ * @param gen Should the chunk generate
+ * @param gen Should the chunk generate if it doesn't exist
+ * @return Future that will resolve when the chunk is loaded
+ */
+ @NotNull
@@ -459,7 +459,7 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
+ * The future will always be executed synchronously
+ * on the main Server Thread.
+ * @param block Block to load the corresponding chunk from
+ * @param gen Should the chunk generate
+ * @param gen Should the chunk generate if it doesn't exist
+ * @return Future that will resolve when the chunk is loaded
+ */
+ @NotNull
@@ -495,10 +495,10 @@ index 8075ff77eddb971a0a73dad3c9b809131b5db343..12c1731cd3e7138b30a509bf1c6de937
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 13e0316b2446c1d10b2ff3582b948265de21bfef..6fb14175962ec9730e4b70330481ec21d2c87da5 100644
index 5fc085f785719933eef7ab1b3cf173579c64739b..711d95bfafac0d415895023bdaac4059395667ab 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -164,6 +164,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -165,6 +165,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
public boolean teleport(@NotNull Entity destination, @NotNull TeleportCause cause);
Loaded 100 of 2413 files, more files were not shown because too many files have changed in this diff. Show more