170 Commits

Author SHA1 Message Date
52fb02fa2e Fix New Features
All checks were successful
SteamWarCI Build successful
2025-06-26 22:45:52 +02:00
5751108142 Fix New Features
All checks were successful
SteamWarCI Build successful
2025-06-26 22:41:12 +02:00
ad42e22284 Merge remote-tracking branch 'upstream/main' 2025-06-26 22:39:23 +02:00
e3a46b30d9 Merge remote-tracking branch 'upstream/main' 2025-06-26 22:38:27 +02:00
bd79e20c66 [ci skip] PluginManager#getPlugin and PluginManager#isPluginEnabled are case-insensitive (#12723) 2025-06-26 21:17:20 +02:00
35b2c6ece4 Use dropped item for stats info (#12747)
We are already using the dropped stack to determine the type, we
might as well also use it for the count, given that plugins can already
mutate the type, might as well let them mess with the amount.
2025-06-26 19:44:29 +01:00
e382e6872c Fix 0 yield on explosion events
Fixes #12745

That cooked is mildly cooked and should be fixed differently, e.g. a custom loot context param, but reverting the recent change in this line works for now
2025-06-26 16:58:05 +02:00
4e1a2555be Update try catch for command handling
Fixes #12729
2025-06-25 22:42:38 +02:00
7ec3174a33 Jump out of experimental phase 2025-06-25 22:14:31 +02:00
c9e89f49b0 Expose arrow velocity in EntityShootBowEvent for mobs (#12688) 2025-06-25 22:11:18 +02:00
aa6cd74c03 Remove unnecesary item check for ServerboundPlayerActionPacket RELEASE_USE_ITEM (#12668) 2025-06-25 22:09:11 +02:00
ea10fa4a79 Don't mutate the position of Items for MC-4 Fix (#12702) 2025-06-25 21:51:26 +02:00
692e93a91f Fix MC-299110
When converting entity/poi data (SimpleRegionStorage),
we need to insert the new data version so that force upgrading
will write the data back with the correct version.
2025-06-25 12:25:45 -07:00
bee287927c Adventure 4.23.0 (#12690) 2025-06-25 21:16:18 +02:00
0caf75f839 Fix #12721 (#12725)
* Fix #12721

Track when knots are created and only fire the event then

* Use mutable boolean + check if actually spawned
2025-06-25 14:16:03 -04:00
d7510efc16 Fix #12722 (#12726)
Use our getRegistryAccess to null check against world
2025-06-24 15:26:37 -04:00
aa6ee44a7a Re-add global region scheduler tick erroneously removed in last commit 2025-06-24 08:14:29 -07:00
7c90c7c497 Optimise EntityScheduler ticking
The vast majority of the time, there are no tasks scheduled to
the EntityScheduler. We can avoid iterating the entire entity list
by tracking which schedulers have any tasks scheduled.
2025-06-24 07:19:33 -07:00
2f083acbed Ensure player entity schedulers are ticked when they are dead
If the player dies, then they are removed from the world and
as a result are not present in the world entity map.

To guarantee that the player entity scheduler is ticked, we can
tick all schedulers for players in the server player list, and
then skip all players we find in the world entity map.

This problem is not present on Folia since Folia must guarantee
that the player remains in the world.
2025-06-24 05:12:58 -07:00
38c1ddb52a Add and use FeatureHooks.getAllEntities
The ServerLevel#getAllEntities function only returns entities which
are accessible. FeatureHooks#getAllEntities will return all
entities, whether or not they are accessible.

Use the new hook in the EntityCommand, which allows server admins
to inspect entities in unloaded chunks.

Use the hook as well for ticking the EntityScheduler. This fixes
an issue whether unloaded entities did not have their scheduler ticked.
2025-06-24 04:55:58 -07:00
46b4b0b8d5 Improve keepalive ping system
Send more keepalives, record all transactions within the last minute.
We send more keepalives so that the latency calculation is more
accurate. Since we send more keepalives, we track all pending
keepalives in case multiple end up in flight.

Additionally, replace the latency calculation with a true
average over the last 5 seconds of keepalive transactions.
2025-06-24 04:23:08 -07:00
d0e808f44c Move player to correct position in vehicle move packet handler
We add the change to guarantee that the player position moves
in-sync with the vehicle's. As a result, it should be teleporting
the player using the new position of the vehicle rather than the
old.
2025-06-24 02:09:39 -07:00
e454fef40e Add support for private constructors in plugin main classes (#12652) 2025-06-23 22:50:59 -04:00
1814d8b47a build: publish to fill (#12717) 2025-06-23 14:13:13 -07:00
803baf0ba6 Support hidden entities in Waypoints (#12715) 2025-06-22 13:42:06 -04:00
5edcf6ddf6 Cleanup/command dispatching (#12713) 2025-06-21 21:44:07 -04:00
186e9e331b Relocate CommandMap#registerServerAliases() call to after lifecycle events have been run (#12601) 2025-06-21 14:44:07 -04:00
cceffe3d98 Release ItemType and BlockType (#12708) 2025-06-21 11:27:46 -07:00
6d0821d2b5 [ci skip] Fix docs for Spawner class and cleanup (#12710) 2025-06-21 17:54:24 +02:00
e714de6365 Fix excess slot updates
By: AJ Ferguson <fergusonjva@gmail.com>
2025-06-21 13:16:55 +02:00
c0dda0ea14 Add isForceDefaultGameMode method (#12673) 2025-06-21 13:10:11 +02:00
5652882134 Add isProxyEnabled method to ServerConfiguration (#12664) 2025-06-21 13:09:44 +02:00
4419afb9c9 fix: Safely handle nanosecond overflow in ClickCallback (#12686)
If you are creating a click callback using e.g. ChronoUnit.FOREVER.getDuration() this code will throw an ArithmeticException because toNanos overflows. The only way toNanos throws this exception is if the nanos overflow, so we can just safely cap it here as the max value for a long.
2025-06-21 12:58:46 +02:00
29fc853271 Allow empty paths in namespaced keys (#12687) 2025-06-21 01:56:45 -04:00
d61a51e81e Add ItemType#getBurnDuration() (#12604) 2025-06-21 01:54:29 -04:00
3750927a06 [ci skip] Fix PermissionManager#clearPermissions() docs bad wording (#12657) 2025-06-21 01:01:11 -04:00
71b0c76861 Adds support for vanilla negative explosions (#12705)
Fixes #10460
2025-06-21 00:54:53 -04:00
e4eb69b8a1 Do not allow ticket level decreases to be processed asynchronously
Note: This cannot happen on the Fabric/NeoForge versions since
async ticket level processing is not allowed, but can happen on
Paper. This change is made here so that Paper can
remain in sync.

Ticket level decreases may be handled asynchronously when the
off-thread invokes processTicketUpdates() when the main thread
is running ChunkHolderManager#tick(). This is because the ticket
update is queued during tick(), but not executed (invoking
processTicketUpdates) until after releasing the ticket lock.
This creates a small window for an off-thread to invoke
processTicketUpdates() and steal the update.

When the update is stolen, the full chunk status update (if any)
will be eventually queued to execute via the chunk task queue.
If the chunk queue is processed during the server tick at any
point other than the ChunkHolderManager tick, then any ticket
level decrease will violate an important invariant in the
Moonrise chunk system: ticket level decreases only occur during
ChunkHolderManager tick. This invariant exists to make interfacing
with the chunk system easier, especially working with off-thread
contexts.

This change is specifically made to work towards fixing
https://github.com/PaperMC/Folia/issues/363
2025-06-20 21:10:09 -07:00
219f86ee06 Implement chunk unload delay config option
Fixes https://github.com/PaperMC/Paper/issues/12056
2025-06-20 21:07:21 -07:00
c77d5f99f9 Fix MC-297591
Vanilla does not increment ticket timeouts if the chunk is
progressing in generation. They made this change in 1.21.6
so that the ender pearl ticket does not expire if the chunk
fails to generate before the timeout expires. Rather than
blindly adjusting the entire system behavior to fix this
small issue, we instead add non-expirable tickets to keep
ender pearls ticking.
2025-06-20 20:53:01 -07:00
839c6a1845 Fix #11169 (#12706)
This technically fixes the improperly updated patch, and also no longer checks canPickUpLoot.
2025-06-20 19:22:27 -04:00
6a51c44ec2 Cleanup Primed TNT Fix (#12704)
This option should probably be removed as its a descendant of an option that allows "old tnt cannon" behavior before ~1.9 But this improves the fix so properly update the velocity/position rather than the questionable way it was doing it before.
2025-06-20 18:22:37 -04:00
a7dd263566 Enable spigot obfuscation support (#12695) 2025-06-20 22:11:33 +01:00
4b3f967e49 Improve Fix MC-44654 (#12703)
This more properly implement spigot's fix for teleportation area effect clouds, now however supporting many other entity types specified in this bug report.

Currently, this is not an issue for (all) hanging blocks since they have a fix identical to this inside of setPos. Note however the client does not nicely support moving these entities anyways.
2025-06-20 16:02:24 -04:00
74fbcce5ae Check type of Material in get/set stats (#12607) 2025-06-20 16:45:40 +02:00
4781d28b4b Re-add Log4j Javadocs (#12693) 2025-06-18 18:31:59 -07:00
f5534cb7c7 [ci skip] Run generators (#12691) 2025-06-18 20:05:50 +02:00
62b7f86dae Avoid and discourage use of Maven Central as a CDN (#12689)
* Default LibraryLoader to Google's Maven Central mirror, add MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR, and warn on use of Maven Central with MavenLibraryResolver

* Account for both Maven Central URLs

* Update Javadoc
2025-06-18 10:47:21 -07:00
5613ed6dfb Provide env environment variable and copy spigots sys prop for overriding default repository 2025-06-18 11:04:48 +01:00
8980ead7ea Directly walk text component after converting from JSON
It's important to convert the ItemStack present inside
the text component. The ItemStack nests TEXT_COMPONENT (written
book pages, custom name, ...) which would otherwise not be walked
since we have set a breakpoint at the version and moved the walker
to the next version step.

This fixes item names for hover events inside written book pages
failing to convert to NBT. This issue is also present on DFU.
2025-06-17 19:02:35 -07:00
e4d7178a3c Implement WaypointTransmitter#isChunkVisible
The Vanilla chunk tracker on Moonrise always returns false. We need
to redirect to Moonrise's chunk loader.

aef2b81d6e
2025-06-17 17:53:12 -07:00
1fcc4162d1 Implement FeatureHooks#isChunkSent for Moonrise chunk system
Need to use the player chunk loader, as that will contain the
sent chunks.
2025-06-17 17:47:50 -07:00
40d5d31c83 Fix recursively converting JSON Text Components
See 142ec80d28
2025-06-17 16:38:01 -07:00
023e6c2953 Ensure waypoints are per world 2025-06-17 23:43:05 +02:00
d2b1158e6c Set correct world access on BSL snapshots 2025-06-17 20:38:39 +01:00
8318dcb74b Update DataConverter to 1.21.6-rc1
b388a85809

The 1.21.6 update will include better handling of legacy
hover events.
2025-06-17 10:00:54 -07:00
b28d77b3e3 Update Moonrise to 1.21.6
0451444abf
2025-06-17 09:46:59 -07:00
245b5473a0 Update base to 1.21.6 2025-06-17 17:17:44 +02:00
457a0a69bf Bump version string and protocol version to 1.21.6 release
Notably, this does not bump the world data version. This will be left for when the actual Vanilla base is updated, just in case. This early bump will likely be the exception for more ironed out update previews in the future.
2025-06-17 15:54:23 +02:00
a24f9b204c 1.21.6 dev
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Noah van der Aa <ndvdaa@gmail.com>
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
2025-06-17 15:45:25 +02:00
39203a65e0 [ci skip] Publish PR API and dev bundles (#12672)
* Setup PR publishing

also remove the JDK matrix, it's pointless with one value and other parts of the workflow depend on a single value...

* Use PaperMC action

* Change base PR maven url

* Update action

* Update action

* Update action

* Update action

* Update action

* Re-enable javadoc...?

* Delete PR comment workflow

* Rename publish tag

* comment broken jd link

* update bot name
2025-06-16 17:35:54 -07:00
ba7fb23ddd Finish moving over to Holderable (#12646) 2025-06-10 16:29:10 -07:00
519e4224b1 Fix infinite loop in RegionFile IO
If an exception is thrown during decompress then the read process
would be started again, which of course would eventually throw in
the decompress process.
2025-06-09 02:46:34 -07:00
95565e0f4f Add missing attribute serialization updater 2025-06-08 18:33:24 -07:00
320f25cb04 fix sponge-absorb deleting chest content (#12647) 2025-06-07 22:28:37 +01:00
3527ccdf2e feat: expose updateDemand and restock on Villager (#12608) 2025-06-07 12:42:11 +02:00
03efecf0d3 Do not fire PlayerDropItemEvent for /give command 2025-06-07 12:22:48 +02:00
94f2903584 Do not blow up accessing unregistered memories from API (Fixes #12618) (#12639) 2025-06-06 22:37:52 -04:00
e87320d5f2 Fix UOE when using generateTree with pale oak (#12616) 2025-06-06 21:51:42 -04:00
7ebc94c2a6 Add Registry#getTagValues (#12603) 2025-06-06 18:23:02 -07:00
4eda045b15 Backport fix for MC-296337 (Fixes #12617) (#12619) 2025-06-06 19:05:30 +01:00
11b4356fb4 Merge remote-tracking branch 'upstream/main'
All checks were successful
SteamWarCI Build successful
2025-05-31 19:42:03 +02:00
2ba1675c75 Replace deprecated Thread#getId usage with Thread#threadId 2025-05-29 04:59:52 -07:00
6f315356b6 Add MCUtil#toLocation from Folia
Helper methods to convert NMS world/position to Bukkit Location
2025-05-29 04:58:00 -07:00
4765010083 Improve error messages when PluginRemapper fails to initialize (#12598) 2025-05-28 12:33:25 -07:00
a033e3b9ef Fix ancient player custom name converter
Who knows for how long it's been broken, but it only came up now given DataConverter isn't applied
Fixes #12565
Supersedes #12568
2025-05-25 09:24:49 +02:00
b9d6ba243c Expose more data for MusicInstrument (#12415) 2025-05-24 17:16:54 -04:00
84ee4249c9 Add Map filled event (#12574) 2025-05-24 22:45:32 +02:00
ee3b405316 Replace spigot check with generation check 2025-05-24 22:43:48 +02:00
b8fe22c9cd Do not call EntityRemoveEvent during worldgen (#12588)
Ports the follow commits from spigot to paper.
All credits to go the respective commit authors listed below.

CraftBukkit: 3b4fd5b321f4440a2b3a67f3945739b45e6e687f

By: md_5 <git@md-5.net>
2025-05-24 22:17:42 +02:00
220b57add4 Fixs and Improvements for EndermanEscapeEvent (#12570) 2025-05-24 21:53:02 +02:00
7774243d11 Add plugin details to zip file errors (#12580)
Helps debug classloading across plugin boundaries. Zip file errors
can be thrown for multiple reasons, and they are capable of
affecting other plugins' classloading.
2025-05-24 21:18:41 +02:00
a3909f5486 [ci skip] Fix bad format for jd @link (#12581) 2025-05-24 21:17:16 +02:00
3efaf477c4 Add API for client-side signs (#11903) 2025-05-24 21:16:23 +02:00
b70bca6b69 Revert "fix: Don't hardcode checks for translation registries (#12571)"
This reverts commit f303a076bc.
2025-05-23 21:29:51 +02:00
87349c317f Fix CombatTracker stale on death (#12562) 2025-05-21 18:19:08 +02:00
f303a076bc fix: Don't hardcode checks for translation registries (#12571)
Devs can register custom Translator instances, and we can use the new `#canTranslate` method to avoid having to iterate through the whole set of sources.
2025-05-21 18:19:00 +02:00
113b18ee08 Update paperweight and Gradle wrapper (#12573) 2025-05-19 17:34:49 -07:00
fa360aa836 Add some missing annotations and an incorrect one (#12204) 2025-05-18 18:31:49 -04:00
ce0fa4c438 Replace old version command with brigadier equivalent (#12502)
---------

Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
2025-05-18 16:24:02 -04:00
6f73e62ecd Add getPickItemStack (#12552) 2025-05-18 20:42:14 +02:00
7171d29985 [ci skip] Mention CAN_PLACE/CAN_BREAK component in ItemMeta (#12559) 2025-05-18 19:49:57 +02:00
358786774c [ci skip] Fix format and mentions for ItemDamageFunction (#12560) 2025-05-18 13:23:52 -04:00
cc38032bee Deprecate TeleportCause CHORUS_FRUIT for CONSUMABLE_EFFECT (#12546) 2025-05-18 16:33:21 +02:00
f1dbed072c Implement BlocksAttack DamageReduction and ItemDamage (#12538) 2025-05-18 16:31:34 +02:00
28d7df75ac Backport HeroesOfTheVillage datafixer fix
Fixes #12515
2025-05-18 16:13:19 +02:00
c000b352ad fix(bukkit-brig-forwarding-map): Invert isEmpty method (#12555) 2025-05-18 09:12:59 +02:00
841d634230 Fix ItemStack#addUnsafeEnchantment ignored for missing enchantment component (#12549) 2025-05-17 16:13:08 +02:00
369ad1706b Cached tag parser for itemstack reading (#12547) 2025-05-17 13:42:51 +02:00
d683970d40 Add FishHookStateChangeEvent (#12165) 2025-05-15 20:17:32 +02:00
a25258190b Update mache 2025-05-11 22:28:25 +02:00
04ffca0b6b Also remove CraftPlayer methods 2025-05-09 14:55:41 +02:00
358e72ec0d Remove simplify remote item matching stuff for now
Twas broken for some time and I haven't had time to address it, this may be revisited later in a different way
2025-05-09 14:47:24 +02:00
d2ad2e668d Add missing EntityLookup#getAllMapped from Moonrise
Not used but the sources should remain synced.
2025-05-07 18:31:25 -07:00
6c3964d2f5 Properly save level data async (#12530)
Previously we added a parameter allowing for level data to be saved asynchronously which was then overriden by a vanilla parameter which does the opposite.

This reverts back to the previous behavior that we were doing before.

Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
2025-05-07 17:34:58 -04:00
cbcf75a57c Update visual fire handling with TriState support (#12303)
Replaced the Boolean-based visual fire system with TriState for improved clarity and flexibility, enabling three distinct states: TRUE, FALSE, and NOT_SET. Deprecated older methods in favor of new ones and updated internal handling to reflect these changes. Adjusted serialization and deserialization logic to accommodate the new TriState implementation.
2025-05-07 23:33:41 +02:00
ab0253fecd Expand PlayerDeathEvent API (#12221) 2025-05-06 20:14:58 -04:00
e2da5d2f0a Registry API for supported Mob Variants (#12417)
---------

Co-authored-by: Bjarne Koll <git@lynxplay.dev>
2025-05-06 17:13:00 -04:00
753cff7c8a Improvements for Dump paper commands (#12512) 2025-05-06 16:45:17 -04:00
42a2a6c2b5 Supports the ability for commands to be registered internally (#12520) 2025-05-06 16:05:00 -04:00
c98cd65802 Add configuration interface to expose certain config values (#12273) 2025-05-03 16:33:25 -04:00
53d1d04ec5 Disable Item Obfuscation for entity related stacks (#12297) 2025-05-03 20:52:33 +02:00
88a3a87015 Configurable xp orb merge group count (#12503) 2025-05-03 20:51:19 +02:00
6f1f5b67e0 Fix ArmorStand items for canceled EntityDeathEvent (#12288)
Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com>
2025-05-02 23:19:15 +02:00
2bd84f6f0e Expand PotionMeta Api to allow getting effective potion colour and effects (#12390) 2025-05-02 22:31:39 +02:00
825685f82f Add PlayerPickBlockEvent and PlayerPickEntityEvent (#12425)
Extensions of the existing PlayerPickItemEvent that allow more fine grained access to relevant context, like the picked block or the entity.
2025-05-02 22:14:27 +02:00
1074237311 Pass correct draw strength for EntityShootBowEvent (#12308) 2025-05-02 16:05:50 -04:00
d637ae85dd Fix NoSuchElementException in EntityTransformEvent for slimes (#12510) 2025-05-02 21:15:58 +02:00
cb3ffd0b4a Don't store empty PDCs on raids 2025-05-02 20:02:34 +01:00
93246a0730 Fix errors when loading raid files without a PDC 2025-05-02 19:43:06 +01:00
51345a1cc8 Correct nullable fall location type 2025-05-02 18:57:18 +02:00
ec421715ed Add missing spaces back (#12508) 2025-05-02 07:39:46 +02:00
b9b3cd652e Use components instead of ChatColor in more places (#12507) 2025-05-02 02:11:25 +02:00
1acf3b3837 Infer block entity data in brigadier blockstate argument (#12197) 2025-05-01 16:08:41 +02:00
c9411bfb83 Fix min ItemStack amount check for asHoverEvent (#12505) 2025-05-01 16:00:23 +02:00
835b955913 Add a method on InventoryView to get the MenuType (#12193)
Since there is a new (better) way to create views for players using MenuType, it would be nice to also be able to get it back from InventoryView after creating.
2025-04-30 21:43:51 -04:00
0e9b94d533 Fix ItemStack amount issues with Chat Components (#12216) 2025-04-30 21:24:49 -04:00
bc3d946fdf Normalizes CraftEntity#toString/getHandle (#12170) 2025-04-30 21:21:04 -04:00
567f63ae34 Parity for respawn events (#11792) 2025-04-30 20:04:24 +02:00
2754d7c3b9 Add Throw EntityChangeBlockEvent for BrushableBlockEntity#brush (#12133) 2025-04-30 14:03:40 -04:00
5acfdd6af4 Fix save/load NaN Entity Motion (#12269) 2025-04-30 19:53:32 +02:00
cd4fe5b7d0 [ci skip] Drop non-applicable ATs (#12498) 2025-04-30 19:30:45 +02:00
e663f99982 Add combat tracker API (#11853) 2025-04-30 19:24:33 +02:00
646b80ca53 Fix unnecessary map data saves (#12296) 2025-04-30 11:51:13 -04:00
1e930763d2 Fix ipv6 loopback addresses being able to get connection throttled (#12155) 2025-04-30 11:50:18 -04:00
a74400d92c Update adventure to 4.21.0 (#12499) 2025-04-30 11:36:52 +02:00
d4be73c990 Merge remote-tracking branch 'upstream/main'
All checks were successful
SteamWarCI Build successful
2025-04-29 19:41:25 +02:00
a7a76c8fc7 Add methods for Armadillo (#12031) 2025-04-29 15:44:37 +02:00
fc0c371761 Fix handling of resultant crafting container from craftItemResult (#12307)
The result object of overhanging items is based upon a derived view
of the provided crafting slots, meaning that we need to consider this
when handing back the resultant slots.
2025-04-29 15:38:11 +02:00
9e873f50d3 Fix inconsistencies between offline/online spawn position getter (#11960) 2025-04-29 14:57:36 +02:00
02d20ff7eb Fix NPE in Server#getMap before worlds are loaded (#12492) 2025-04-28 21:22:33 +02:00
d1810f241c Allow Server#getDefaultGameMode before worlds are initialized (#12490) 2025-04-28 17:36:46 +02:00
1db3785307 [ci skip] improve javadoc for off-hand swaps through getHotbarButton (#12489) 2025-04-28 17:22:05 +02:00
952338b33e [ci skip] Add missing exception docs to Player#listPlayer (#12488) 2025-04-28 15:00:02 +02:00
b9d3147d3b Use correct placed block position for sound (#12410)
Previously the server attempted to compute the block placed by using the
BlockPlaceContext. This approach however fails on replacable blocks, as
the BlockPlaceContext computes this during its construction, which
happened after the actual world modification.

The commit reworks this approach and now stores metadata in the
InteractionResult which can later be read.
The diff is structured to allow for easy future expansion of the tracked
metadata.
2025-04-27 14:19:42 +02:00
f8fa4f6f5e Add method to retrieve FishHook (#12310) 2025-04-27 14:12:01 +02:00
b418321d85 Merge remote-tracking branch 'upstream/main'
All checks were successful
SteamWarCI Build successful
2025-04-27 01:51:28 +02:00
3e3b42cdf5 Update player chat session sync (#12382) 2025-04-26 23:26:20 +02:00
f86b435228 Add vault change state event (#12069) 2025-04-26 16:34:12 +02:00
deaccd2c42 [ci skip] Add file reference url to help.yml (#12481) 2025-04-26 16:01:06 +02:00
58f12b93f8 Merge pull request 'Reenable commands in Commands.java' (#2) from reenable-commands into main
All checks were successful
SteamWarCI Build successful
Reviewed-on: #2
Reviewed-by: Lixfel <lixfel@noreply.localhost>
2025-04-26 09:44:06 +02:00
284f5adefd Re-enabling WhitelistCommand.
All checks were successful
SteamWarCI Build successful
2025-04-26 09:43:24 +02:00
3222985e43 [ci skip] Rebuild patches 2025-04-25 20:06:10 +02:00
1cfc96bcf7 Add keyStream() API to registries (#12479) 2025-04-25 14:26:56 +02:00
3409e2d73f Mace was not included in the ENCHANTABLE MaterialSetTag (#12476) 2025-04-25 11:25:05 +02:00
ae512811db Add isSuffocating to Block and BlockState (#12445) 2025-04-25 10:48:24 +02:00
a211ac2ec5 Remove unused warning (#12478) 2025-04-25 10:46:06 +02:00
a112d37025 Fix horse_variant and tropical_fish_pattern (#12472) 2025-04-24 22:39:33 +02:00
6652bb7612 Reenable commands in Commands.java
All checks were successful
SteamWarCI Build successful
2025-04-24 18:31:12 +02:00
9cddf136d7 Fix portal create event block list (#12373) 2025-04-24 18:10:13 +02:00
767868ddbf Fix some components (#12457) 2025-04-24 16:57:20 +02:00
1410a22bb2 Fix passengers sending when riding players
Fixes #12468
2025-04-24 13:59:28 +02:00
d05bf33c05 Fix CI
All checks were successful
SteamWarCI Build successful
2025-04-23 22:46:58 +02:00
2b50a2ea07 Trigger Rebuild
Some checks failed
SteamWarCI Build failed
2025-04-23 22:43:42 +02:00
67a5148512 Trigger Rebuild
Some checks failed
SteamWarCI Build failed
2025-04-23 22:41:22 +02:00
a5269d76c0 Trigger Rebuild
Some checks failed
SteamWarCI Build failed
2025-04-23 22:35:18 +02:00
adc22129ae Trigger Rebuild
Some checks failed
SteamWarCI Build failed
2025-04-23 22:34:35 +02:00
cf7e54ea59 Trigger Rebuild
Some checks failed
SteamWarCI Build failed
2025-04-23 22:33:21 +02:00
5d6f544ed1 Merge branch 'update/1.21.4'
Some checks failed
SteamWarCI Build failed
2025-04-23 22:32:06 +02:00
871373ac27 Trigger Rebuild
Some checks failed
SteamWarCI Build failed
2025-04-23 22:31:43 +02:00
1125 changed files with 47554 additions and 9744 deletions

View File

@ -19,18 +19,16 @@ jobs:
# The goal of the build workflow is split into multiple requirements.
# 1. Run on pushes to same repo.
# 2. Run on PR open/reopen/syncs from repos that are not the same (PRs from the same repo are covered by 1)
# 3. Run on labeled PRs that have the build-pr-jar flag.
# 3. Run on labeled PRs that have the publish-pr flag.
if: >
(
(github.event_name == 'push')
|| (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name && contains(fromJSON('["opened", "reopened", "synchronize"]'), github.event.action))
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'build-pr-jar')
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'publish-pr')
)
runs-on: ubuntu-latest
strategy:
matrix:
java: [21]
fail-fast: true
steps:
- if: ${{ github.event_name == 'push' }}
@ -43,14 +41,17 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: JDK ${{ matrix.java }}
- name: JDK 21
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-version: 21
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
# Allow cache writes on main and dev branches
cache-read-only: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/dev/') }}
- name: Configure Build
uses: actions/github-script@v7
@ -73,14 +74,14 @@ jobs:
if (event_name === "push" && ref_type === "branch") {
const {data: pulls} = await github.rest.pulls.list({ owner, repo, head: `${owner}:${ref_name}`, state: "open" });
const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "build-pr-jar"));
const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "publish-pr"));
if (pull) {
result["pr"] = pull.number;
result["action"] = "paperclip";
core.notice(`This is a push action but to a branch with an open PR with the build paperclip label (${JSON.stringify(result)})`);
return result;
}
} else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "build-pr-jar")) {
} else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "publish-pr")) {
result["pr"] = event.pull_request.number;
result["action"] = "paperclip";
core.notice(`This is a pull request action with a build paperclip label (${JSON.stringify(result)})`);
@ -102,7 +103,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (${{ matrix.java }})
name: Test Results
path: |
**/build/test-results/test/TEST-*.xml
@ -116,6 +117,13 @@ jobs:
with:
name: paper-${{ fromJSON(steps.determine.outputs.result).pr }}
path: paper-server/build/libs/paper-paperclip-*-mojmap.jar
- name: Publish Artifacts
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
uses: PaperMC/action-pr-publishing/upload@paper
with:
# TODO fallback for failing javadoc
publishing-task: ":paper-api:publishAllPublicationsTo_githubPackages_PRsRepository publishDevBundlePublicationTo_githubPackages_PRsRepository -PpublishDevBundle"
event_file:
name: "Event File"
# Only run on PRs if the source branch is on someone else's repo

View File

@ -1,84 +0,0 @@
# This workflow run on the completion of the
# build workflow but only does anything if the
# triggering workflow uploaded an artifact.
#
# Do note that it is then the trigger workflow that
# determines if this will update the PR text body. All
# this workflow does is check if an uploaded artifact
# exists and there is a PR tied to the previous workflow.
name: Comment on pull request
on:
workflow_run:
workflows: ['Build Paper']
types: [completed]
jobs:
pr_comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
env:
BRANCH_NAME: "${{ github.event.workflow_run.head_branch }}"
PR_OWNER: "${{ github.event.workflow_run.head_repository.owner.login }}"
PR_SHA: "${{ github.event.workflow_run.head_sha }}"
RUN_ID: "${{ github.event.workflow_run.id }}"
REPO_ID: "${{ github.event.repository.id }}"
EVENT_TYPE: "${{ github.event.workflow_run.event}}"
PULL_REQUESTS: "${{ toJSON(github.event.workflow_run.pull_requests) }}"
with:
# This snippet is public-domain, taken from
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
# Modified extensively by Machine_Maker
script: |
async function updatePR(owner, repo, issue_number, purpose, body) {
const { data } = await github.rest.issues.get({ owner, repo, issue_number });
core.debug(JSON.stringify(data, null, 2));
const marker = `<!-- bot: ${purpose} -->`;
let new_body = data.body ? data.body.trim().split(marker)[0].trim() : "";
new_body += `\n${marker}\n---\n${body}`;
core.info(`Updating the text body of PR #${issue_number} in ${owner}/${repo}`);
await github.rest.issues.update({ owner, repo, issue_number, body: new_body });
}
const { owner, repo } = context.repo;
const run_id = `${process.env.RUN_ID}`;
const repo_id = `${process.env.REPO_ID}`;
let pulls = [];
const event_type = `${process.env.EVENT_TYPE}`;
if (event_type === "push") { // if push, it's from the same repo which means `pull_requests` is populated
pulls = JSON.parse(`${process.env.PULL_REQUESTS}`);
} else {
const pr_branch = `${process.env.BRANCH_NAME}`;
const pr_sha = `${process.env.PR_SHA}`;
const pr_owner = `${process.env.PR_OWNER}`;
const { data } = await github.rest.pulls.list({ owner, repo, head: `${pr_owner}:${pr_branch}`, state: "open" });
core.debug(JSON.stringify(data, null, 2));
pulls = data.filter((pr) => pr.head.sha === pr_sha && pr.labels.find((l) => l.name === "build-pr-jar"));
}
if (!pulls.length) {
return core.notice("This workflow doesn't have any pull requests!");
} else if (pulls.length > 1) {
core.info(JSON.stringify(pulls, null, 2));
return core.error("Found multiple matching PRs");
}
const pull_request = pulls[0];
const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, { owner, repo, run_id });
if (!artifacts.length) {
return core.info("Skipping comment due to no artifact found");
}
const artifact = artifacts.find((art) => art.name === `paper-${pull_request.number}`);
if (!artifact) {
return core.info("Skipping comment to no matching artifact found");
}
const link = `https://nightly.link/${owner}/${repo}/actions/artifacts/${artifact.id}.zip`;
const body = `Download the paperclip jar for this pull request: [${artifact.name}.zip](${link})`;
core.info(`Adding a link to ${link}`);
await updatePR(owner, repo, pull_request.number, "paperclip-pr-build", body);

36
.github/workflows/publish_pr.yml vendored Normal file
View File

@ -0,0 +1,36 @@
name: Publish PR
on:
workflow_run:
workflows: [ "Build Paper" ]
types:
- completed
permissions:
packages: write # To upload the PR
actions: write # To get information about the uploading workflow run and to delete the run artifacts
contents: write # To download the `maven-publish` artifact, and to be able to create commit comments
issues: write # To be able to create PR comments
pull-requests: write # To be able to create PR comments
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Generate an Application repository access token
id: gen_repo_token
uses: kattecon/gh-app-access-token-gen@v1
with:
app_id: 1408328
private_key: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }}
repository: ${{ github.repository }}
- name: Publish PR
uses: PaperMC/action-pr-publishing@paper
env:
GITHUB_TOKEN: ${{ steps.gen_repo_token.outputs.token }}
with:
publishing-token: ${{ github.token }}
uploader-workflow-name: Build Paper
artifacts-base-path: io/papermc/paper
base-maven-url: 'https://maven-prs.papermc.io'
self-name: 'papermc-pr-publishing[bot]'

View File

@ -21,12 +21,14 @@ jobs:
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts
path: test_artifacts
name: "Test Results|Event File"
name_is_regexp: true
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_file: test_artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
files: "test_artifacts/**/*.xml"
comment_mode: off

View File

@ -40,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.5-R0.1-SNAPSHOT</version>
<version>1.21.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@ -53,7 +53,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.6-R0.1-SNAPSHOT")
}
java {

View File

@ -17,13 +17,8 @@ public net.minecraft.commands.arguments.blocks.BlockInput tag
public net.minecraft.core.MappedRegistry validateWrite(Lnet/minecraft/resources/ResourceKey;)V
public net.minecraft.nbt.ListTag <init>(Ljava/util/List;)V
public net.minecraft.nbt.ListTag identifyRawElementType()B
public net.minecraft.nbt.TagParser readArrayTag()Lnet/minecraft/nbt/Tag;
public net.minecraft.nbt.TagParser type(Ljava/lang/String;)Lnet/minecraft/nbt/Tag;
public net.minecraft.network.Connection address
public net.minecraft.network.Connection channel
public net.minecraft.network.chat.HoverEvent$ItemStackInfo components
public net.minecraft.network.chat.HoverEvent$ItemStackInfo count
public net.minecraft.network.chat.HoverEvent$ItemStackInfo item
public net.minecraft.network.chat.TextColor name
public net.minecraft.network.chat.contents.TranslatableContents filterAllowedArguments(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
public net.minecraft.network.chat.numbers.FixedFormat value
@ -108,14 +103,12 @@ public net.minecraft.server.level.ServerPlayer triggerDimensionChangeTriggers(Ln
public net.minecraft.server.level.ServerPlayer wardenSpawnTracker
public net.minecraft.server.level.ServerPlayer$RespawnPosAngle
public net.minecraft.server.level.ServerPlayerGameMode level
public net.minecraft.server.level.Ticket key
public net.minecraft.server.level.TicketType register(Ljava/lang/String;JZLnet/minecraft/server/level/TicketType$TicketUse;)Lnet/minecraft/server/level/TicketType;
public net.minecraft.server.network.ServerGamePacketListenerImpl isChatMessageIllegal(Ljava/lang/String;)Z
public net.minecraft.server.network.ServerLoginPacketListenerImpl authenticatedProfile
public net.minecraft.server.network.ServerLoginPacketListenerImpl connection
public net.minecraft.server.network.ServerLoginPacketListenerImpl state
public net.minecraft.server.network.ServerLoginPacketListenerImpl$State
public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/net/URI;)Ljava/nio/file/Path;
public net.minecraft.server.packs.repository.FolderRepositorySource$FolderPackDetector
public net.minecraft.server.packs.repository.FolderRepositorySource$FolderPackDetector <init>(Lnet/minecraft/world/level/validation/DirectoryValidator;)V
public net.minecraft.server.packs.repository.Pack resources
@ -129,7 +122,6 @@ public net.minecraft.tags.TagEntry id
public net.minecraft.tags.TagEntry required
public net.minecraft.tags.TagEntry tag
public net.minecraft.util.datafix.fixes.BlockStateData register(ILcom/mojang/serialization/Dynamic;[Lcom/mojang/serialization/Dynamic;)V
public net.minecraft.util.datafix.fixes.EntityCustomNameToComponentFix fixCustomName(Lcom/mojang/serialization/DynamicOps;Ljava/lang/String;Ljava/lang/String;)Lcom/mojang/serialization/Dynamic;
public net.minecraft.util.datafix.fixes.ItemIdFix ITEM_NAMES
public net.minecraft.util.datafix.fixes.ItemSpawnEggFix ID_TO_ENTITY
public net.minecraft.world.BossEvent color
@ -138,17 +130,21 @@ public net.minecraft.world.BossEvent overlay
public net.minecraft.world.CompoundContainer container1
public net.minecraft.world.CompoundContainer container2
public net.minecraft.world.SimpleContainer items
public net.minecraft.world.damagesource.CombatTracker entries
public net.minecraft.world.damagesource.CombatTracker getMostSignificantFall()Lnet/minecraft/world/damagesource/CombatEntry;
public net.minecraft.world.damagesource.CombatTracker inCombat
public net.minecraft.world.damagesource.CombatTracker mob
public net.minecraft.world.damagesource.CombatTracker takingDamage
public net.minecraft.world.damagesource.DamageSource <init>(Lnet/minecraft/core/Holder;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.effect.MobEffect attributeModifiers
public net.minecraft.world.effect.MobEffect$AttributeTemplate
public net.minecraft.world.effect.MobEffectInstance hiddenEffect
public net.minecraft.world.entity.AreaEffectCloud durationOnUse
public net.minecraft.world.entity.AreaEffectCloud ownerUUID
public net.minecraft.world.entity.AreaEffectCloud owner
public net.minecraft.world.entity.AreaEffectCloud potionContents
public net.minecraft.world.entity.AreaEffectCloud radiusOnUse
public net.minecraft.world.entity.AreaEffectCloud radiusPerTick
public net.minecraft.world.entity.AreaEffectCloud reapplicationDelay
public net.minecraft.world.entity.AreaEffectCloud updateColor()V
public net.minecraft.world.entity.AreaEffectCloud waitTime
public net.minecraft.world.entity.Display DATA_POS_ROT_INTERPOLATION_DURATION_ID
public net.minecraft.world.entity.Display createTransformation(Lnet/minecraft/network/syncher/SynchedEntityData;)Lcom/mojang/math/Transformation;
@ -198,7 +194,6 @@ public net.minecraft.world.entity.Entity getSwimSound()Lnet/minecraft/sounds/Sou
public net.minecraft.world.entity.Entity getSwimSplashSound()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.Entity hasVisualFire
public net.minecraft.world.entity.Entity isAffectedByBlocks()Z
public net.minecraft.world.entity.Entity isInBubbleColumn()Z
public net.minecraft.world.entity.Entity isInRain()Z
public net.minecraft.world.entity.Entity isInvulnerableToBase(Lnet/minecraft/world/damagesource/DamageSource;)Z
public net.minecraft.world.entity.Entity onGround
@ -213,7 +208,6 @@ public net.minecraft.world.entity.Entity unsetRemoved()V
public net.minecraft.world.entity.Entity wasTouchingWater
public net.minecraft.world.entity.ExperienceOrb count
public net.minecraft.world.entity.ExperienceOrb setValue(I)V
public net.minecraft.world.entity.ExperienceOrb value
public net.minecraft.world.entity.GlowSquid setDarkTicks(I)V
public net.minecraft.world.entity.Interaction attack
public net.minecraft.world.entity.Interaction getHeight()F
@ -248,14 +242,10 @@ public net.minecraft.world.entity.LivingEntity lastHurtByMob
public net.minecraft.world.entity.LivingEntity lastHurtByMobTimestamp
public net.minecraft.world.entity.LivingEntity lastHurtByPlayer
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerMemoryTime
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
public net.minecraft.world.entity.LivingEntity playSecondaryHurtSound(Lnet/minecraft/world/damagesource/DamageSource;)V
public net.minecraft.world.entity.LivingEntity setLivingEntityFlag(IZ)V
public net.minecraft.world.entity.LivingEntity useItemRemaining
public net.minecraft.world.entity.Mob armorDropChances
public net.minecraft.world.entity.Mob getAmbientSound()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.Mob getEquipmentDropChance(Lnet/minecraft/world/entity/EquipmentSlot;)F
public net.minecraft.world.entity.Mob handDropChances
public net.minecraft.world.entity.Mob isSunBurnTick()Z
public net.minecraft.world.entity.Mob lootTable
public net.minecraft.world.entity.Mob lootTableSeed
@ -339,14 +329,8 @@ public net.minecraft.world.entity.animal.wolf.Wolf setSoundVariant(Lnet/minecraf
public net.minecraft.world.entity.animal.wolf.Wolf setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.boss.enderdragon.EnderDragon subEntities
public net.minecraft.world.entity.boss.wither.WitherBoss bossEvent
public net.minecraft.world.entity.decoration.ArmorStand bodyPose
public net.minecraft.world.entity.decoration.ArmorStand disabledSlots
public net.minecraft.world.entity.decoration.ArmorStand headPose
public net.minecraft.world.entity.decoration.ArmorStand isDisabled(Lnet/minecraft/world/entity/EquipmentSlot;)Z
public net.minecraft.world.entity.decoration.ArmorStand leftArmPose
public net.minecraft.world.entity.decoration.ArmorStand leftLegPose
public net.minecraft.world.entity.decoration.ArmorStand rightArmPose
public net.minecraft.world.entity.decoration.ArmorStand rightLegPose
public net.minecraft.world.entity.decoration.ArmorStand setMarker(Z)V
public net.minecraft.world.entity.decoration.ArmorStand setSmall(Z)V
public net.minecraft.world.entity.decoration.HangingEntity setDirection(Lnet/minecraft/core/Direction;)V
@ -373,8 +357,6 @@ public net.minecraft.world.entity.monster.Creeper explodeCreeper()V
public net.minecraft.world.entity.monster.Creeper explosionRadius
public net.minecraft.world.entity.monster.Creeper maxSwell
public net.minecraft.world.entity.monster.Creeper swell
public net.minecraft.world.entity.monster.Drowned groundNavigation
public net.minecraft.world.entity.monster.Drowned waterNavigation
public net.minecraft.world.entity.monster.EnderMan teleport()Z
public net.minecraft.world.entity.monster.EnderMan teleportTowards(Lnet/minecraft/world/entity/Entity;)Z
public net.minecraft.world.entity.monster.Endermite life
@ -401,6 +383,7 @@ public net.minecraft.world.entity.monster.SpellcasterIllager$IllagerSpell
public net.minecraft.world.entity.monster.Strider steering
public net.minecraft.world.entity.monster.Vex hasLimitedLife
public net.minecraft.world.entity.monster.Vex limitedLifeTicks
public net.minecraft.world.entity.monster.Vex owner
public net.minecraft.world.entity.monster.Vindicator DOOR_BREAKING_PREDICATE
public net.minecraft.world.entity.monster.Vindicator isJohnny
public net.minecraft.world.entity.monster.Witch usingTime
@ -428,10 +411,10 @@ public net.minecraft.world.entity.npc.Villager increaseMerchantCareer()V
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
public net.minecraft.world.entity.npc.Villager releaseAllPois()V
public net.minecraft.world.entity.npc.Villager setUnhappy()V
public net.minecraft.world.entity.npc.Villager updateDemand()V
public net.minecraft.world.entity.npc.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos;
public net.minecraft.world.entity.player.Abilities flyingSpeed
public net.minecraft.world.entity.player.Abilities walkingSpeed
public net.minecraft.world.entity.player.Inventory compartments
public net.minecraft.world.entity.player.Inventory equipment
public net.minecraft.world.entity.player.Player DATA_PLAYER_MODE_CUSTOMISATION
public net.minecraft.world.entity.player.Player closeContainer()V
@ -459,9 +442,7 @@ public net.minecraft.world.entity.projectile.Arrow updateColor()V
public net.minecraft.world.entity.projectile.EvokerFangs warmupDelayTicks
public net.minecraft.world.entity.projectile.EyeOfEnder life
public net.minecraft.world.entity.projectile.EyeOfEnder surviveAfterDeath
public net.minecraft.world.entity.projectile.EyeOfEnder tx
public net.minecraft.world.entity.projectile.EyeOfEnder ty
public net.minecraft.world.entity.projectile.EyeOfEnder tz
public net.minecraft.world.entity.projectile.EyeOfEnder target
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_ATTACHED_TO_TARGET
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_ID_FIREWORKS_ITEM
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_SHOT_AT_ANGLE
@ -481,10 +462,9 @@ public net.minecraft.world.entity.projectile.FishingHook timeUntilHooked
public net.minecraft.world.entity.projectile.FishingHook timeUntilLured
public net.minecraft.world.entity.projectile.FishingHook$FishHookState
public net.minecraft.world.entity.projectile.LargeFireball explosionPower
public net.minecraft.world.entity.projectile.Projectile cachedOwner
public net.minecraft.world.entity.projectile.Projectile hasBeenShot
public net.minecraft.world.entity.projectile.Projectile leftOwner
public net.minecraft.world.entity.projectile.Projectile ownerUUID
public net.minecraft.world.entity.projectile.Projectile owner
public net.minecraft.world.entity.projectile.ShulkerBullet currentMoveDirection
public net.minecraft.world.entity.projectile.ShulkerBullet flightSteps
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaX
@ -492,7 +472,6 @@ public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaY
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaZ
public net.minecraft.world.entity.projectile.SpectralArrow duration
public net.minecraft.world.entity.projectile.ThrowableItemProjectile getDefaultItem()Lnet/minecraft/world/item/Item;
public net.minecraft.world.entity.projectile.ThrownPotion isLingering()Z
public net.minecraft.world.entity.projectile.ThrownTrident dealtDamage
public net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.entity.projectile.windcharge.BreezeWindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
@ -522,6 +501,7 @@ public net.minecraft.world.flag.FeatureFlagRegistry names
public net.minecraft.world.food.FoodData exhaustionLevel
public net.minecraft.world.food.FoodData foodLevel
public net.minecraft.world.food.FoodData saturationLevel
public net.minecraft.world.inventory.AbstractContainerMenu menuType
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftSlots
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftStatus
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftType
@ -558,7 +538,6 @@ public net.minecraft.world.item.context.UseOnContext <init>(Lnet/minecraft/world
public net.minecraft.world.item.crafting.RecipeManager recipes
public net.minecraft.world.item.crafting.RecipeMap byKey
public net.minecraft.world.item.crafting.RecipeMap byType
public net.minecraft.world.item.enchantment.ItemEnchantments showInTooltip
public net.minecraft.world.item.trading.MerchantOffer demand
public net.minecraft.world.item.trading.MerchantOffer result
public net.minecraft.world.item.trading.MerchantOffer specialPriceDiff
@ -626,7 +605,7 @@ public net.minecraft.world.level.block.entity.BedBlockEntity color
public net.minecraft.world.level.block.entity.BeehiveBlockEntity savedFlowerPos
public net.minecraft.world.level.block.entity.BellBlockEntity resonating
public net.minecraft.world.level.block.entity.BellBlockEntity resonationTicks
public net.minecraft.world.level.block.entity.BlockEntity saveId(Lnet/minecraft/nbt/CompoundTag;)V
public net.minecraft.world.level.block.entity.BlockEntity saveId(Lnet/minecraft/world/level/storage/ValueOutput;)V
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
public net.minecraft.world.level.block.entity.BrewingStandBlockEntity brewTime
public net.minecraft.world.level.block.entity.BrewingStandBlockEntity fuel
@ -638,10 +617,11 @@ public net.minecraft.world.level.block.entity.CampfireBlockEntity cookingTime
public net.minecraft.world.level.block.entity.ChestBlockEntity openersCounter
public net.minecraft.world.level.block.entity.ChestBlockEntity playSound(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/sounds/SoundEvent;)V
public net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity lastInteractedSlot
public net.minecraft.world.level.block.entity.ConduitBlockEntity MIN_KILL_SIZE
public net.minecraft.world.level.block.entity.ConduitBlockEntity destroyTarget
public net.minecraft.world.level.block.entity.ConduitBlockEntity destroyTargetUUID
public net.minecraft.world.level.block.entity.ConduitBlockEntity effectBlocks
public net.minecraft.world.level.block.entity.ConduitBlockEntity getDestroyRangeAABB(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/phys/AABB;
public net.minecraft.world.level.block.entity.ConduitBlockEntity updateDestroyTarget(Lnet/minecraft/world/entity/EntityReference;Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;Z)Lnet/minecraft/world/entity/EntityReference;
public net.minecraft.world.level.block.entity.CrafterBlockEntity craftingTicksRemaining
public net.minecraft.world.level.block.entity.DecoratedPotBlockEntity decorations
public net.minecraft.world.level.block.entity.EnderChestBlockEntity openersCounter
@ -675,13 +655,14 @@ public net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity age
public net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity exactTeleport
public net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity exitPortal
public net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity trialSpawner
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawner config
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawner isOminous
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawner stateAccessor
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData cooldownEndsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData currentMobs
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData detectedPlayers
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData nextMobSpawnsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData nextSpawnData
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData cooldownEndsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData currentMobs
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData detectedPlayers
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData nextMobSpawnsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData nextSpawnData
public net.minecraft.world.level.block.entity.vault.VaultBlockEntity serverData
public net.minecraft.world.level.block.entity.vault.VaultServerData getRewardedPlayers()Ljava/util/Set;
public net.minecraft.world.level.block.entity.vault.VaultServerData pauseStateUpdatingUntil(J)V
@ -700,7 +681,7 @@ public net.minecraft.world.level.chunk.LevelChunk level
public net.minecraft.world.level.chunk.LevelChunk loaded
public net.minecraft.world.level.chunk.LevelChunkSection states
public net.minecraft.world.level.chunk.PalettedContainer registry
public net.minecraft.world.level.chunk.status.ChunkStatusTasks postLoadProtoChunk(Lnet/minecraft/server/level/ServerLevel;Ljava/util/List;)V
public net.minecraft.world.level.chunk.status.ChunkStatusTasks postLoadProtoChunk(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/storage/ValueInput$ValueInputList;)V
public net.minecraft.world.level.chunk.storage.EntityStorage entityDeserializerQueue
public net.minecraft.world.level.chunk.storage.EntityStorage level
public net.minecraft.world.level.chunk.storage.RegionFileStorage regionCache
@ -777,7 +758,6 @@ public-f net.minecraft.world.inventory.AbstractContainerMenu lastSlots
public-f net.minecraft.world.inventory.AbstractContainerMenu remoteDataSlots
public-f net.minecraft.world.inventory.AbstractContainerMenu remoteSlots
public-f net.minecraft.world.inventory.AbstractContainerMenu slots
public-f net.minecraft.world.item.enchantment.ItemEnchantments$Mutable showInTooltip
public-f net.minecraft.world.item.trading.MerchantOffer baseCostA
public-f net.minecraft.world.item.trading.MerchantOffer costB
public-f net.minecraft.world.item.trading.MerchantOffer maxUses
@ -788,10 +768,6 @@ public-f net.minecraft.world.level.LevelSettings hardcore
public-f net.minecraft.world.level.LevelSettings levelName
public-f net.minecraft.world.level.block.ChestBlock MENU_PROVIDER_COMBINER
public-f net.minecraft.world.level.block.entity.BannerBlockEntity baseColor
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner normalConfig
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner ominousConfig
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner requiredPlayerRange
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner targetCooldownLength
public-f net.minecraft.world.level.saveddata.maps.MapItemSavedData centerX
public-f net.minecraft.world.level.saveddata.maps.MapItemSavedData centerZ
public-f net.minecraft.world.level.saveddata.maps.MapItemSavedData dimension

View File

@ -21,7 +21,7 @@ c net/minecraft/world/level/chunk/LevelChunk net/minecraft/world/level/chunk/Chu
# 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 H
# The method is made public by Spigot, which then causes accidental overrides
c net/minecraft/world/entity/Entity net/minecraft/world/entity/Entity

View File

@ -2,7 +2,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id("io.papermc.paperweight.core") version "2.0.0-beta.16" apply false
id("io.papermc.paperweight.core") version "2.0.0-beta.17" apply false
}
subprojects {

View File

@ -1,10 +1,9 @@
group=io.papermc.paper
version=1.21.5-R0.1-SNAPSHOT
mcVersion=1.21.5
version=1.21.6-R0.1-SNAPSHOT
mcVersion=1.21.6
# Set to true while updating Minecraft version
updatingMinecraft=true
updateTaskListIssue=https://github.com/PaperMC/Paper/issues/11736
updatingMinecraft=false
org.gradle.configuration-cache=true
org.gradle.caching=true

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

6
gradlew vendored
View File

@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@ -205,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

4
gradlew.bat vendored
View File

@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell

View File

@ -11,8 +11,7 @@ java {
val annotationsVersion = "26.0.2"
// Keep in sync with paper-server adventure-text-serializer-ansi dep
val adventureVersion = "4.21.0-mc1215-SNAPSHOT" // FIXME move to release asap
val adventureJavadocVersion = "4.20.0" // Fixme remove me
val adventureVersion = "4.23.0"
val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
val slf4jVersion = "2.0.16"
val log4jVersion = "2.24.1"
@ -58,15 +57,13 @@ dependencies {
exclude("com.google.guava", "guava")
}
// FIXME remove me when we are using a release again
val adventureGroup = "io.papermc.adventure"
apiAndDocs(platform("$adventureGroup:adventure-bom:$adventureVersion"))
apiAndDocs("$adventureGroup:adventure-api")
apiAndDocs("$adventureGroup:adventure-text-minimessage")
apiAndDocs("$adventureGroup:adventure-text-serializer-gson")
apiAndDocs("$adventureGroup:adventure-text-serializer-legacy")
apiAndDocs("$adventureGroup:adventure-text-serializer-plain")
apiAndDocs("$adventureGroup:adventure-text-logger-slf4j")
apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
apiAndDocs("net.kyori:adventure-api")
apiAndDocs("net.kyori:adventure-text-minimessage")
apiAndDocs("net.kyori:adventure-text-serializer-gson")
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
api("org.apache.maven:maven-resolver-provider:3.9.6") // make API dependency for Paper Plugins
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
@ -179,13 +176,13 @@ tasks.withType<Javadoc> {
"https://javadoc.io/doc/org.joml/joml/1.10.8/",
"https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0",
"https://jspecify.dev/docs/api/",
"https://jd.advntr.dev/api/$adventureJavadocVersion/",
"https://jd.advntr.dev/key/$adventureJavadocVersion/",
"https://jd.advntr.dev/text-minimessage/$adventureJavadocVersion/",
"https://jd.advntr.dev/text-serializer-gson/$adventureJavadocVersion/",
"https://jd.advntr.dev/text-serializer-legacy/$adventureJavadocVersion/",
"https://jd.advntr.dev/text-serializer-plain/$adventureJavadocVersion/",
"https://jd.advntr.dev/text-logger-slf4j/$adventureJavadocVersion/",
"https://jd.advntr.dev/api/$adventureVersion/",
"https://jd.advntr.dev/key/$adventureVersion/",
"https://jd.advntr.dev/text-minimessage/$adventureVersion/",
"https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
"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://logging.apache.org/log4j/2.x/javadoc/log4j-api/",
"https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3",

View File

@ -21,6 +21,7 @@ import org.bukkit.entity.Fish;
import org.bukkit.entity.Fox;
import org.bukkit.entity.Ghast;
import org.bukkit.entity.Guardian;
import org.bukkit.entity.HappyGhast;
import org.bukkit.entity.Illager;
import org.bukkit.entity.Illusioner;
import org.bukkit.entity.IronGolem;
@ -67,17 +68,17 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
GoalKey<AbstractHorse> HORSE_RANDOM_STAND = create("horse_random_stand", AbstractHorse.class);
GoalKey<AbstractHorse> RUN_AROUND_LIKE_CRAZY = create("run_around_like_crazy", AbstractHorse.class);
GoalKey<AbstractHorse> HORSE_RUN_AROUND_LIKE_CRAZY = create("horse_run_around_like_crazy", AbstractHorse.class);
GoalKey<AbstractSkeleton> ABSTRACT_SKELETON_MELEE = create("abstract_skeleton_melee", AbstractSkeleton.class);
GoalKey<AbstractSkeleton> SKELETON_MELEE = create("skeleton_melee", AbstractSkeleton.class);
GoalKey<AbstractVillager> LOOK_AT_TRADING_PLAYER = create("look_at_trading_player", AbstractVillager.class);
GoalKey<AbstractVillager> VILLAGER_LOOK_AT_TRADING_PLAYER = create("villager_look_at_trading_player", AbstractVillager.class);
GoalKey<AbstractVillager> TRADE_WITH_PLAYER = create("trade_with_player", AbstractVillager.class);
GoalKey<AbstractVillager> VILLAGER_TRADE_WITH_PLAYER = create("villager_trade_with_player", AbstractVillager.class);
GoalKey<Animals> BREED = create("breed", Animals.class);
@ -101,12 +102,12 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Bee> BEE_POLLINATE = create("bee_pollinate", Bee.class);
GoalKey<Bee> BEE_VALIDATE_FLOWER = create("bee_validate_flower", Bee.class);
GoalKey<Bee> BEE_VALIDATE_HIVE = create("bee_validate_hive", Bee.class);
GoalKey<Bee> BEE_WANDER = create("bee_wander", Bee.class);
GoalKey<Bee> VALIDATE_FLOWER = create("validate_flower", Bee.class);
GoalKey<Bee> VALIDATE_HIVE = create("validate_hive", Bee.class);
GoalKey<Blaze> BLAZE_ATTACK = create("blaze_attack", Blaze.class);
GoalKey<Cat> CAT_AVOID_ENTITY = create("cat_avoid_entity", Cat.class);
@ -165,16 +166,16 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Creature> WATER_AVOIDING_RANDOM_STROLL = create("water_avoiding_random_stroll", Creature.class);
GoalKey<Creeper> SWELL = create("swell", Creeper.class);
GoalKey<Creeper> CREEPER_SWELL = create("creeper_swell", Creeper.class);
GoalKey<Dolphin> DOLPHIN_JUMP = create("dolphin_jump", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_PLAY_WITH_ITEMS = create("dolphin_play_with_items", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_SWIM_TO_TREASURE = create("dolphin_swim_to_treasure", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_SWIM_WITH_PLAYER = create("dolphin_swim_with_player", Dolphin.class);
GoalKey<Dolphin> PLAY_WITH_ITEMS = create("play_with_items", Dolphin.class);
GoalKey<Drowned> DROWNED_ATTACK = create("drowned_attack", Drowned.class);
GoalKey<Drowned> DROWNED_GO_TO_BEACH = create("drowned_go_to_beach", Drowned.class);
@ -199,14 +200,14 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Fish> FISH_SWIM = create("fish_swim", Fish.class);
GoalKey<Fox> DEFEND_TRUSTED = create("defend_trusted", Fox.class);
GoalKey<Fox> FACEPLANT = create("faceplant", Fox.class);
GoalKey<Fox> FOX_BREED = create("fox_breed", Fox.class);
GoalKey<Fox> FOX_DEFEND_TRUSTED = create("fox_defend_trusted", Fox.class);
GoalKey<Fox> FOX_EAT_BERRIES = create("fox_eat_berries", Fox.class);
GoalKey<Fox> FOX_FACEPLANT = create("fox_faceplant", Fox.class);
GoalKey<Fox> FOX_FLOAT = create("fox_float", Fox.class);
GoalKey<Fox> FOX_FOLLOW_PARENT = create("fox_follow_parent", Fox.class);
@ -217,29 +218,27 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Fox> FOX_PANIC = create("fox_panic", Fox.class);
GoalKey<Fox> FOX_PERCH_AND_SEARCH = create("fox_perch_and_search", Fox.class);
GoalKey<Fox> FOX_POUNCE = create("fox_pounce", Fox.class);
GoalKey<Fox> FOX_SEARCH_FOR_ITEMS = create("fox_search_for_items", Fox.class);
GoalKey<Fox> FOX_SEEK_SHELTER = create("fox_seek_shelter", Fox.class);
GoalKey<Fox> FOX_SLEEP = create("fox_sleep", Fox.class);
GoalKey<Fox> FOX_STALK_PREY = create("fox_stalk_prey", Fox.class);
GoalKey<Fox> FOX_STROLL_THROUGH_VILLAGE = create("fox_stroll_through_village", Fox.class);
GoalKey<Fox> PERCH_AND_SEARCH = create("perch_and_search", Fox.class);
GoalKey<Fox> SEEK_SHELTER = create("seek_shelter", Fox.class);
GoalKey<Fox> SLEEP = create("sleep", Fox.class);
GoalKey<Fox> STALK_PREY = create("stalk_prey", Fox.class);
GoalKey<Ghast> GHAST_LOOK = create("ghast_look", Ghast.class);
GoalKey<Ghast> GHAST_SHOOT_FIREBALL = create("ghast_shoot_fireball", Ghast.class);
GoalKey<Ghast> RANDOM_FLOAT_AROUND = create("random_float_around", Ghast.class);
GoalKey<Guardian> GUARDIAN_ATTACK = create("guardian_attack", Guardian.class);
GoalKey<Illager> HOLD_GROUND_ATTACK = create("hold_ground_attack", Illager.class);
GoalKey<HappyGhast> HAPPY_GHAST_FLOAT = create("happy_ghast_float", HappyGhast.class);
GoalKey<Illager> ILLAGER_HOLD_GROUND_ATTACK = create("illager_hold_ground_attack", Illager.class);
GoalKey<Illager> RAIDER_OPEN_DOOR = create("raider_open_door", Illager.class);
@ -247,9 +246,9 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Illusioner> ILLUSIONER_MIRROR_SPELL = create("illusioner_mirror_spell", Illusioner.class);
GoalKey<IronGolem> DEFEND_VILLAGE = create("defend_village", IronGolem.class);
GoalKey<IronGolem> IRON_GOLEM_DEFEND_VILLAGE = create("iron_golem_defend_village", IronGolem.class);
GoalKey<IronGolem> OFFER_FLOWER = create("offer_flower", IronGolem.class);
GoalKey<IronGolem> IRON_GOLEM_OFFER_FLOWER = create("iron_golem_offer_flower", IronGolem.class);
GoalKey<Llama> LLAMA_ATTACK_WOLF = create("llama_attack_wolf", Llama.class);
@ -269,6 +268,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> FOLLOW_MOB = create("follow_mob", Mob.class);
GoalKey<Mob> GHAST_LOOK = create("ghast_look", Mob.class);
GoalKey<Mob> INTERACT = create("interact", Mob.class);
GoalKey<Mob> LEAP_AT = create("leap_at", Mob.class);
@ -281,10 +282,14 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> OPEN_DOOR = create("open_door", Mob.class);
GoalKey<Mob> RANDOM_FLOAT_AROUND = create("random_float_around", Mob.class);
GoalKey<Mob> RANDOM_LOOK_AROUND = create("random_look_around", Mob.class);
GoalKey<Mob> RESET_UNIVERSAL_ANGER = create("reset_universal_anger", Mob.class);
GoalKey<Mob> TEMPT_FOR_NON_PATHFINDERS = create("tempt_for_non_pathfinders", Mob.class);
GoalKey<Mob> USE_ITEM = create("use_item", Mob.class);
GoalKey<Mob> VINDICATOR_BREAK_DOOR = create("vindicator_break_door", Mob.class);
@ -317,7 +322,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Panda> PANDA_SNEEZE = create("panda_sneeze", Panda.class);
GoalKey<Parrot> LAND_ON_OWNERS_SHOULDER = create("land_on_owners_shoulder", Parrot.class);
GoalKey<Parrot> PARROT_LAND_ON_OWNERS_SHOULDER = create("parrot_land_on_owners_shoulder", Parrot.class);
GoalKey<Phantom> PHANTOM_ATTACK_PLAYER = create("phantom_attack_player", Phantom.class);
@ -339,27 +344,27 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Rabbit> RABBIT_PANIC = create("rabbit_panic", Rabbit.class);
GoalKey<Rabbit> RAID_GARDEN = create("raid_garden", Rabbit.class);
GoalKey<Raider> LONG_DISTANCE_PATROL = create("long_distance_patrol", Raider.class);
GoalKey<Raider> NEAREST_ATTACKABLE_WITCH = create("nearest_attackable_witch", Raider.class);
GoalKey<Raider> NEAREST_HEALABLE_RAIDER = create("nearest_healable_raider", Raider.class);
GoalKey<Raider> OBTAIN_RAID_LEADER_BANNER = create("obtain_raid_leader_banner", Raider.class);
GoalKey<Raider> PATHFIND_TO_RAID = create("pathfind_to_raid", Raider.class);
GoalKey<Rabbit> RABBIT_RAID_GARDEN = create("rabbit_raid_garden", Rabbit.class);
GoalKey<Raider> RAIDER_CELEBRATION = create("raider_celebration", Raider.class);
GoalKey<Raider> RAIDER_LONG_DISTANCE_PATROL = create("raider_long_distance_patrol", Raider.class);
GoalKey<Raider> RAIDER_MOVE_THROUGH_VILLAGE = create("raider_move_through_village", Raider.class);
GoalKey<Raider> RAIDER_NEAREST_ATTACKABLE_WITCH = create("raider_nearest_attackable_witch", Raider.class);
GoalKey<Raider> RAIDER_NEAREST_HEALABLE_RAIDER = create("raider_nearest_healable_raider", Raider.class);
GoalKey<Raider> RAIDER_OBTAIN_RAID_LEADER_BANNER = create("raider_obtain_raid_leader_banner", Raider.class);
GoalKey<Raider> RAIDER_PATHFIND_TO_RAID = create("raider_pathfind_to_raid", Raider.class);
GoalKey<RangedEntity> DROWNED_TRIDENT_ATTACK = create("drowned_trident_attack", RangedEntity.class);
GoalKey<RangedEntity> RANGED_ATTACK = create("ranged_attack", RangedEntity.class);
GoalKey<SchoolableFish> FOLLOW_FLOCK_LEADER = create("follow_flock_leader", SchoolableFish.class);
GoalKey<SchoolableFish> SCHOOLABLE_FISH_FOLLOW_FLOCK_LEADER = create("schoolable_fish_follow_flock_leader", SchoolableFish.class);
GoalKey<Shulker> SHULKER_ATTACK = create("shulker_attack", Shulker.class);
@ -373,7 +378,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Silverfish> SILVERFISH_WAKE_UP_FRIENDS = create("silverfish_wake_up_friends", Silverfish.class);
GoalKey<SkeletonHorse> SKELETON_TRAP = create("skeleton_trap", SkeletonHorse.class);
GoalKey<SkeletonHorse> SKELETON_HORSE_SKELETON_TRAP = create("skeleton_horse_skeleton_trap", SkeletonHorse.class);
GoalKey<Slime> SLIME_ATTACK = create("slime_attack", Slime.class);
@ -429,14 +434,14 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Vindicator> VINDICATOR_JOHNNY_ATTACK = create("vindicator_johnny_attack", Vindicator.class);
GoalKey<WanderingTrader> WANDER_TO_POSITION = create("wander_to_position", WanderingTrader.class);
GoalKey<WanderingTrader> WANDERING_TRADER_WANDER_TO_POSITION = create("wandering_trader_wander_to_position", WanderingTrader.class);
GoalKey<Wither> WITHER_DO_NOTHING = create("wither_do_nothing", Wither.class);
GoalKey<Wolf> BEG = create("beg", Wolf.class);
GoalKey<Wolf> WOLF_AVOID_ENTITY = create("wolf_avoid_entity", Wolf.class);
GoalKey<Wolf> WOLF_BEG = create("wolf_beg", Wolf.class);
GoalKey<Zombie> ZOMBIE_ATTACK = create("zombie_attack", Zombie.class);
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class AttributeKeys {
/**
* {@code minecraft:armor}
@ -81,6 +81,13 @@ public final class AttributeKeys {
*/
public static final TypedKey<Attribute> BURNING_TIME = create(key("burning_time"));
/**
* {@code minecraft:camera_distance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> CAMERA_DISTANCE = create(key("camera_distance"));
/**
* {@code minecraft:entity_interaction_range}
*
@ -249,6 +256,20 @@ public final class AttributeKeys {
*/
public static final TypedKey<Attribute> WATER_MOVEMENT_EFFICIENCY = create(key("water_movement_efficiency"));
/**
* {@code minecraft:waypoint_receive_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> WAYPOINT_RECEIVE_RANGE = create(key("waypoint_receive_range"));
/**
* {@code minecraft:waypoint_transmit_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> WAYPOINT_TRANSMIT_RANGE = create(key("waypoint_transmit_range"));
private AttributeKeys() {
}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class BannerPatternKeys {
/**
* {@code minecraft:base}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class BiomeKeys {
/**
* {@code minecraft:badlands}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class BlockTypeKeys {
/**
* {@code minecraft:acacia_button}
@ -2475,6 +2475,13 @@ public final class BlockTypeKeys {
*/
public static final TypedKey<BlockType> DRAGON_WALL_HEAD = create(key("dragon_wall_head"));
/**
* {@code minecraft:dried_ghast}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<BlockType> DRIED_GHAST = create(key("dried_ghast"));
/**
* {@code minecraft:dried_kelp_block}
*

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class CatVariantKeys {
/**
* {@code minecraft:all_black}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class ChickenVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class CowVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class DamageTypeKeys {
/**
* {@code minecraft:arrow}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class DataComponentTypeKeys {
/**
* {@code minecraft:attribute_modifiers}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class EnchantmentKeys {
/**
* {@code minecraft:aqua_affinity}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class FluidKeys {
/**
* {@code minecraft:empty}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class FrogVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class GameEventKeys {
/**
* {@code minecraft:block_activate}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class InstrumentKeys {
/**
* {@code minecraft:admire_goat_horn}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class JukeboxSongKeys {
/**
* {@code minecraft:11}
@ -144,6 +144,13 @@ public final class JukeboxSongKeys {
*/
public static final TypedKey<JukeboxSong> STRAD = create(key("strad"));
/**
* {@code minecraft:tears}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> TEARS = create(key("tears"));
/**
* {@code minecraft:wait}
*

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class MapDecorationTypeKeys {
/**
* {@code minecraft:banner_black}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class MenuTypeKeys {
/**
* {@code minecraft:anvil}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class MobEffectKeys {
/**
* {@code minecraft:absorption}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class PaintingVariantKeys {
/**
* {@code minecraft:alban}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class PigVariantKeys {
/**
* {@code minecraft:cold}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class SoundEventKeys {
/**
* {@code minecraft:ambient.basalt_deltas.additions}
@ -1929,6 +1929,62 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_DISPENSER_LAUNCH = create(key("block.dispenser.launch"));
/**
* {@code minecraft:block.dried_ghast.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_AMBIENT = create(key("block.dried_ghast.ambient"));
/**
* {@code minecraft:block.dried_ghast.ambient_water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_AMBIENT_WATER = create(key("block.dried_ghast.ambient_water"));
/**
* {@code minecraft:block.dried_ghast.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_BREAK = create(key("block.dried_ghast.break"));
/**
* {@code minecraft:block.dried_ghast.fall}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_FALL = create(key("block.dried_ghast.fall"));
/**
* {@code minecraft:block.dried_ghast.place}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_PLACE = create(key("block.dried_ghast.place"));
/**
* {@code minecraft:block.dried_ghast.place_in_water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_PLACE_IN_WATER = create(key("block.dried_ghast.place_in_water"));
/**
* {@code minecraft:block.dried_ghast.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_STEP = create(key("block.dried_ghast.step"));
/**
* {@code minecraft:block.dried_ghast.transition}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_TRANSITION = create(key("block.dried_ghast.transition"));
/**
* {@code minecraft:block.dripstone_block.break}
*
@ -1964,6 +2020,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_DRIPSTONE_BLOCK_STEP = create(key("block.dripstone_block.step"));
/**
* {@code minecraft:block.dry_grass.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRY_GRASS_AMBIENT = create(key("block.dry_grass.ambient"));
/**
* {@code minecraft:block.enchantment_table.use}
*
@ -4113,13 +4176,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_SAND_STEP = create(key("block.sand.step"));
/**
* {@code minecraft:block.sand.wind}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_SAND_WIND = create(key("block.sand.wind"));
/**
* {@code minecraft:block.scaffolding.break}
*
@ -7207,6 +7263,34 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_GHAST_WARN = create(key("entity.ghast.warn"));
/**
* {@code minecraft:entity.ghastling.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_AMBIENT = create(key("entity.ghastling.ambient"));
/**
* {@code minecraft:entity.ghastling.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_DEATH = create(key("entity.ghastling.death"));
/**
* {@code minecraft:entity.ghastling.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_HURT = create(key("entity.ghastling.hurt"));
/**
* {@code minecraft:entity.ghastling.spawn}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_SPAWN = create(key("entity.ghastling.spawn"));
/**
* {@code minecraft:entity.glow_item_frame.add_item}
*
@ -7452,6 +7536,62 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_GUARDIAN_HURT_LAND = create(key("entity.guardian.hurt_land"));
/**
* {@code minecraft:entity.happy_ghast.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_AMBIENT = create(key("entity.happy_ghast.ambient"));
/**
* {@code minecraft:entity.happy_ghast.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_DEATH = create(key("entity.happy_ghast.death"));
/**
* {@code minecraft:entity.happy_ghast.equip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_EQUIP = create(key("entity.happy_ghast.equip"));
/**
* {@code minecraft:entity.happy_ghast.harness_goggles_down}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_DOWN = create(key("entity.happy_ghast.harness_goggles_down"));
/**
* {@code minecraft:entity.happy_ghast.harness_goggles_up}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_UP = create(key("entity.happy_ghast.harness_goggles_up"));
/**
* {@code minecraft:entity.happy_ghast.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HURT = create(key("entity.happy_ghast.hurt"));
/**
* {@code minecraft:entity.happy_ghast.riding}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_RIDING = create(key("entity.happy_ghast.riding"));
/**
* {@code minecraft:entity.happy_ghast.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_UNEQUIP = create(key("entity.happy_ghast.unequip"));
/**
* {@code minecraft:entity.hoglin.ambient}
*
@ -7816,20 +7956,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_ITEM_FRAME_ROTATE_ITEM = create(key("entity.item_frame.rotate_item"));
/**
* {@code minecraft:entity.leash_knot.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_LEASH_KNOT_BREAK = create(key("entity.leash_knot.break"));
/**
* {@code minecraft:entity.leash_knot.place}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_LEASH_KNOT_PLACE = create(key("entity.leash_knot.place"));
/**
* {@code minecraft:entity.lightning_bolt.impact}
*
@ -8880,13 +9006,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_POLAR_BEAR_WARNING = create(key("entity.polar_bear.warning"));
/**
* {@code minecraft:entity.puffer_fish.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PUFFER_FISH_AMBIENT = create(key("entity.puffer_fish.ambient"));
/**
* {@code minecraft:entity.puffer_fish.blow_out}
*
@ -11323,6 +11442,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_HONEYCOMB_WAX_ON = create(key("item.honeycomb.wax_on"));
/**
* {@code minecraft:item.horse_armor.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_HORSE_ARMOR_UNEQUIP = create(key("item.horse_armor.unequip"));
/**
* {@code minecraft:item.ink_sac.use}
*
@ -11330,6 +11456,34 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_INK_SAC_USE = create(key("item.ink_sac.use"));
/**
* {@code minecraft:item.lead.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_BREAK = create(key("item.lead.break"));
/**
* {@code minecraft:item.lead.tied}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_TIED = create(key("item.lead.tied"));
/**
* {@code minecraft:item.lead.untied}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_UNTIED = create(key("item.lead.untied"));
/**
* {@code minecraft:item.llama_carpet.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LLAMA_CARPET_UNEQUIP = create(key("item.llama_carpet.unequip"));
/**
* {@code minecraft:item.lodestone_compass.lock}
*
@ -11372,6 +11526,20 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_OMINOUS_BOTTLE_DISPOSE = create(key("item.ominous_bottle.dispose"));
/**
* {@code minecraft:item.saddle.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SADDLE_UNEQUIP = create(key("item.saddle.unequip"));
/**
* {@code minecraft:item.shears.snip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SHEARS_SNIP = create(key("item.shears.snip"));
/**
* {@code minecraft:item.shield.block}
*
@ -11834,6 +12002,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> MUSIC_DISC_STRAD = create(key("music_disc.strad"));
/**
* {@code minecraft:music_disc.tears}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> MUSIC_DISC_TEARS = create(key("music_disc.tears"));
/**
* {@code minecraft:music_disc.wait}
*

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class StructureKeys {
/**
* {@code minecraft:ancient_city}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class StructureTypeKeys {
/**
* {@code minecraft:buried_treasure}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class TrimMaterialKeys {
/**
* {@code minecraft:amethyst}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class VillagerProfessionKeys {
/**
* {@code minecraft:armorer}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class VillagerTypeKeys {
/**
* {@code minecraft:desert}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class WolfSoundVariantKeys {
/**
* {@code minecraft:angry}

View File

@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
public final class WolfVariantKeys {
/**
* {@code minecraft:ashen}

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class BannerPatternTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class BiomeTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class BlockTypeTagKeys {
/**
@ -580,6 +580,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> GUARDED_BY_PIGLINS = create(key("guarded_by_piglins"));
/**
* {@code #minecraft:happy_ghast_avoids}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> HAPPY_GHAST_AVOIDS = create(key("happy_ghast_avoids"));
/**
* {@code #minecraft:hoglin_repellents}
*
@ -909,13 +916,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> PLANKS = create(key("planks"));
/**
* {@code #minecraft:plays_ambient_desert_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> PLAYS_AMBIENT_DESERT_BLOCK_SOUNDS = create(key("plays_ambient_desert_block_sounds"));
/**
* {@code #minecraft:polar_bears_spawnable_on_alternate}
*
@ -1203,6 +1203,27 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> TRAPDOORS = create(key("trapdoors"));
/**
* {@code #minecraft:triggers_ambient_desert_dry_vegetation_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS = create(key("triggers_ambient_desert_dry_vegetation_block_sounds"));
/**
* {@code #minecraft:triggers_ambient_desert_sand_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DESERT_SAND_BLOCK_SOUNDS = create(key("triggers_ambient_desert_sand_block_sounds"));
/**
* {@code #minecraft:triggers_ambient_dried_ghast_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DRIED_GHAST_BLOCK_SOUNDS = create(key("triggers_ambient_dried_ghast_block_sounds"));
/**
* {@code #minecraft:underwater_bonemeals}
*

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class DamageTypeTagKeys {
/**

View File

@ -25,7 +25,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class EnchantmentTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class EntityTypeTagKeys {
/**
@ -83,6 +83,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> CAN_BREATHE_UNDER_WATER = create(key("can_breathe_under_water"));
/**
* {@code #minecraft:can_equip_harness}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> CAN_EQUIP_HARNESS = create(key("can_equip_harness"));
/**
* {@code #minecraft:can_equip_saddle}
*
@ -125,6 +132,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> FALL_DAMAGE_IMMUNE = create(key("fall_damage_immune"));
/**
* {@code #minecraft:followable_friendly_mobs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> FOLLOWABLE_FRIENDLY_MOBS = create(key("followable_friendly_mobs"));
/**
* {@code #minecraft:freeze_hurts_extra_types}
*

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class FluidTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class GameEventTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class InstrumentTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class ItemTypeTagKeys {
/**
@ -601,6 +601,27 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> HANGING_SIGNS = create(key("hanging_signs"));
/**
* {@code #minecraft:happy_ghast_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HAPPY_GHAST_FOOD = create(key("happy_ghast_food"));
/**
* {@code #minecraft:happy_ghast_tempt_items}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HAPPY_GHAST_TEMPT_ITEMS = create(key("happy_ghast_tempt_items"));
/**
* {@code #minecraft:harnesses}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HARNESSES = create(key("harnesses"));
/**
* {@code #minecraft:head_armor}
*

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class PaintingVariantTagKeys {
/**

View File

@ -24,7 +24,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.5")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class StructureTagKeys {
/**

View File

@ -317,7 +317,7 @@ public class MaterialTags {
*/
public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
.endsWith("_SPAWN_EGG")
.ensureSize("SPAWN_EGGS", 81).lock();
.ensureSize("SPAWN_EGGS", 82).lock();
/**
* Covers all colors of stained glass.
@ -568,8 +568,8 @@ public class MaterialTags {
Material.FLINT_AND_STEEL, Material.CARROT_ON_A_STICK, Material.WARPED_FUNGUS_ON_A_STICK,
Material.BRUSH, Material.CARVED_PUMPKIN, Material.COMPASS, Material.SKELETON_SKULL,
Material.WITHER_SKELETON_SKULL, Material.PLAYER_HEAD, Material.ZOMBIE_HEAD,
Material.CREEPER_HEAD, Material.DRAGON_HEAD, Material.PIGLIN_HEAD)
.ensureSize("ENCHANTABLE", 75).lock();
Material.CREEPER_HEAD, Material.DRAGON_HEAD, Material.PIGLIN_HEAD, Material.MACE)
.ensureSize("ENCHANTABLE", 76).lock();
/**
* Covers the variants of raw ores.

View File

@ -15,45 +15,46 @@ import org.jspecify.annotations.Nullable;
@NullMarked
public final class GoalKey<T extends Mob> {
private final Class<T> entityClass;
private final NamespacedKey namespacedKey;
private final Class<T> type;
private final NamespacedKey key;
private GoalKey(Class<T> entityClass, NamespacedKey namespacedKey) {
this.entityClass = entityClass;
this.namespacedKey = namespacedKey;
private GoalKey(Class<T> type, NamespacedKey key) {
this.type = type;
this.key = key;
}
public Class<T> getEntityClass() {
return this.entityClass;
return this.type;
}
public NamespacedKey getNamespacedKey() {
return this.namespacedKey;
return this.key;
}
@Override
public boolean equals(@Nullable Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
GoalKey<?> goalKey = (GoalKey<?>) o;
return Objects.equals(this.entityClass, goalKey.entityClass) &&
Objects.equals(this.namespacedKey, goalKey.namespacedKey);
return Objects.equals(this.type, goalKey.type) &&
Objects.equals(this.key, goalKey.key);
}
@Override
public int hashCode() {
return Objects.hash(this.entityClass, this.namespacedKey);
return Objects.hash(this.type, this.key);
}
@Override
public String toString() {
return new StringJoiner(", ", GoalKey.class.getSimpleName() + "[", "]")
.add("entityClass=" + this.entityClass)
.add("namespacedKey=" + this.namespacedKey)
.add("type=" + this.type)
.add("key=" + this.key)
.toString();
}
public static <A extends Mob> GoalKey<A> of(Class<A> entityClass, NamespacedKey namespacedKey) {
return new GoalKey<>(entityClass, namespacedKey);
public static <A extends Mob> GoalKey<A> of(Class<A> type, NamespacedKey key) {
return new GoalKey<>(type, key);
}
}

View File

@ -27,7 +27,9 @@ public class EndermanEscapeEvent extends EntityEvent implements Cancellable {
}
/**
* @return The reason the enderman is trying to escape
* Gets the reason the enderman is trying to escape.
*
* @return The reason
*/
public Reason getReason() {
return this.reason;
@ -42,7 +44,8 @@ public class EndermanEscapeEvent extends EntityEvent implements Cancellable {
* Cancels the escape.
* <p>
* If this escape normally had resulted in damage avoidance such as indirect,
* the enderman will now take damage.
* the enderman will now take damage. However, this does not change the Enderman's
* innate immunities or damage behavior like arrows where the damage never happens.
*/
@Override
public void setCancelled(final boolean cancel) {
@ -76,7 +79,7 @@ public class EndermanEscapeEvent extends EntityEvent implements Cancellable {
*/
STARE,
/**
* Specific case for {@link #CRITICAL_HIT} where the enderman is taking rain damage
* Specific case for {@link #CRITICAL_HIT} where the enderman is taking damage by drowning (ex: rain)
*/
DROWN
}

View File

@ -1,9 +1,10 @@
package com.destroystokyo.paper.event.player;
import io.papermc.paper.event.player.AbstractRespawnEvent;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@ -11,36 +12,31 @@ import org.jspecify.annotations.NullMarked;
* Fired after a player has respawned
*/
@NullMarked
public class PlayerPostRespawnEvent extends PlayerEvent {
public class PlayerPostRespawnEvent extends AbstractRespawnEvent {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final Location respawnedLocation;
private final boolean isBedSpawn;
@ApiStatus.Internal
public PlayerPostRespawnEvent(final Player respawnPlayer, final Location respawnedLocation, final boolean isBedSpawn) {
super(respawnPlayer);
this.respawnedLocation = respawnedLocation;
this.isBedSpawn = isBedSpawn;
public PlayerPostRespawnEvent(
final Player respawnPlayer,
final Location respawnLocation,
final boolean isBedSpawn,
final boolean isAnchorSpawn,
final boolean missingRespawnBlock,
final PlayerRespawnEvent.RespawnReason respawnReason
) {
super(respawnPlayer, respawnLocation, isBedSpawn, isAnchorSpawn, missingRespawnBlock, respawnReason);
}
/**
* Returns the location of the respawned player
* Returns the location of the respawned player.
*
* @return location of the respawned player
* @see #getRespawnLocation()
*/
@ApiStatus.Obsolete
public Location getRespawnedLocation() {
return this.respawnedLocation.clone();
}
/**
* Checks if the player respawned to their bed
*
* @return whether the player respawned to their bed
*/
public boolean isBedSpawn() {
return this.isBedSpawn;
return super.getRespawnLocation();
}
@Override

View File

@ -119,7 +119,7 @@ public class AsyncTabCompleteEvent extends Event implements Cancellable {
* the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])}
* or current player names will not be called.
* <p>
* The passed collection will be cloned to a new {@code List}. You must call {{@link #getCompletions()}} to mutate from here
* The passed collection will be cloned to a new {@code List}. You must call {@link #getCompletions()} to mutate from here
*
* @param completions the new completions
*/

View File

@ -21,12 +21,24 @@ public interface VersionFetcher {
/**
* Gets the version message to cache and show to command senders.
*
* <p>NOTE: This is run in a new thread separate from that of the command processing thread</p>
* @return the message to show when requesting a version
* @apiNote This method may involve a web request which will block the executing thread
*/
Component getVersionMessage();
/**
* Gets the version message to cache and show to command senders.
*
* @param serverVersion the current version of the server (will match {@link Bukkit#getVersion()})
* @return the message to show when requesting a version
* @apiNote This method may involve a web request which will block the current thread
* @see #getVersionMessage()
* @deprecated {@code serverVersion} is not required
*/
Component getVersionMessage(String serverVersion);
@Deprecated
default Component getVersionMessage(String serverVersion) {
return getVersionMessage();
}
@ApiStatus.Internal
class DummyVersionFetcher implements VersionFetcher {
@ -37,7 +49,7 @@ public interface VersionFetcher {
}
@Override
public Component getVersionMessage(final String serverVersion) {
public Component getVersionMessage() {
Bukkit.getLogger().warning("Version provider has not been set, cannot check for updates!");
Bukkit.getLogger().info("Override the default implementation of org.bukkit.UnsafeValues#getVersionFetcher()");
new Throwable().printStackTrace();

View File

@ -1,10 +1,18 @@
package io.papermc.paper;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.world.damagesource.CombatEntry;
import io.papermc.paper.world.damagesource.FallLocationType;
import net.kyori.adventure.util.Services;
import org.bukkit.block.Biome;
import org.bukkit.damage.DamageEffect;
import org.bukkit.damage.DamageSource;
import org.bukkit.entity.LivingEntity;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.function.Predicate;
/**
* Static bridge to the server internals.
@ -45,5 +53,38 @@ public interface InternalAPIBridge {
@Deprecated(forRemoval = true, since = "1.21.5")
@ApiStatus.ScheduledForRemoval(inVersion = "1.22")
Biome constructLegacyCustomBiome();
/**
* Creates a new combat entry.
* <p>
* The fall location and fall distance will be calculated from the entity's current state.
*
* @param entity entity
* @param damageSource damage source
* @param damage damage amount
* @return new combat entry
*/
CombatEntry createCombatEntry(LivingEntity entity, DamageSource damageSource, float damage);
/**
* Creates a new combat entry
*
* @param damageSource damage source
* @param damage damage amount
* @param fallLocationType fall location type
* @param fallDistance fall distance
* @return combat entry
*/
CombatEntry createCombatEntry(DamageSource damageSource, float damage, @Nullable FallLocationType fallLocationType, float fallDistance);
/**
* Causes this predicate to be considered restricted.
* Applying this to a command node prevents this command from being executed from an
* unattended context, such as click events.
*
* @param predicate wrapped predicate
* @return wrapped predicate
*/
Predicate<CommandSourceStack> restricted(Predicate<CommandSourceStack> predicate);
}

View File

@ -15,5 +15,10 @@ public enum CommandRegistrationFlag {
* @deprecated This is the default behavior now.
*/
@Deprecated(since = "1.21.4")
FLATTEN_ALIASES
FLATTEN_ALIASES,
/**
* @deprecated Removed as it causes a warning to appear on the client now.
*/
@Deprecated(since = "1.21.6", forRemoval = true)
SERVER_ONLY
}

View File

@ -5,6 +5,7 @@ import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import com.mojang.brigadier.tree.LiteralCommandNode;
import io.papermc.paper.InternalAPIBridge;
import io.papermc.paper.plugin.bootstrap.BootstrapContext;
import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
import io.papermc.paper.plugin.configuration.PluginMeta;
@ -13,6 +14,7 @@ import io.papermc.paper.plugin.lifecycle.event.registrar.Registrar;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.function.Predicate;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NullMarked;
@ -85,6 +87,22 @@ public interface Commands extends Registrar {
return RequiredArgumentBuilder.argument(name, argumentType);
}
/**
* Creates a restricted {@link Predicate} that wraps the given predicate.
* <p>
* A restricted predicate prevents execution in unattended contexts, such as from
* chat click events. A warning is shown on the client before executing the command.
* <p>
* This is used by vanilla to prevent invocation of sensitive commands (like op) from
* players without their knowledge.
*
* @param predicate the original predicate to wrap
* @return a new predicate with restricted execution behavior
*/
static Predicate<CommandSourceStack> restricted(final Predicate<CommandSourceStack> predicate) {
return InternalAPIBridge.get().restricted(predicate);
}
/**
* Gets the underlying {@link CommandDispatcher}.
*

View File

@ -0,0 +1,33 @@
package io.papermc.paper.configuration;
/**
* Represents the configuration settings for a server.
* <p>
* This interface doesn't aim to cover every possible server configuration
* option but focuses on selected critical settings and behaviors.
*/
public interface ServerConfiguration {
/**
* Gets whether the server is in online mode.
* <p>
* This method returns true if:
* <ul>
* <li>The server is in {@link org.bukkit.Server#getOnlineMode online mode},</li>
* <li>Velocity is enabled and configured to be in online mode, or</li>
* <li>BungeeCord is enabled and configured to be in online mode.</li>
* </ul>
*
* @return whether the server is in online mode or behind a proxy configured for online mode
*/
boolean isProxyOnlineMode();
/**
* Gets whether the server is configured to work behind a proxy.
* <p>
* This returns true if either Velocity or BungeeCord is enabled.
*
* @return whether the server is configured to work behind a proxy
*/
boolean isProxyEnabled();
}

View File

@ -3,7 +3,6 @@ package io.papermc.paper.datacomponent;
import org.bukkit.Utility;
import org.bukkit.persistence.PersistentDataContainer;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NullMarked;
/**
@ -23,8 +22,8 @@ public interface DataComponentHolder extends DataComponentView {
* @param <T> value type
*/
@Utility
@org.jetbrains.annotations.ApiStatus.Experimental
public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull io.papermc.paper.datacomponent.DataComponentBuilder<T> valueBuilder);
@ApiStatus.Experimental
<T> void setData(final DataComponentType.Valued<T> type, final DataComponentBuilder<T> valueBuilder);
/**
* Sets the value of the data component type for this holder.
@ -33,16 +32,16 @@ public interface DataComponentHolder extends DataComponentView {
* @param value value to set
* @param <T> value type
*/
@org.jetbrains.annotations.ApiStatus.Experimental
public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull T value);
@ApiStatus.Experimental
<T> void setData(final DataComponentType.Valued<T> type, final T value);
/**
* Marks this non-valued data component type as present in this itemstack.
*
* @param type the data component type
*/
@org.jetbrains.annotations.ApiStatus.Experimental
public void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull NonValued type);
@ApiStatus.Experimental
void setData(final DataComponentType.NonValued type);
// TODO: Do we even want to have the concept of overriding here? Not sure what is going on with entity components
}

View File

@ -364,10 +364,10 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<Rabbit.Type> RABBIT_VARIANT = valued("rabbit/variant");
public static final DataComponentType.Valued<Pig.Variant> PIG_VARIANT = valued("pig/variant");
public static final DataComponentType.Valued<Cow.Variant> COW_VARIANT = valued("cow/variant");
// TODO: This is a eitherholder? Why specifically the chicken?? Oh wait this is prolly for chicken egg cause legacy item loading
public static final DataComponentType.Valued<Chicken.Variant> CHICKEN_VARIANT = valued("chicken/variant");
// This is a eitherholder? Why specifically the chicken?? Oh wait this is prolly for chicken egg cause legacy item loading
public static final DataComponentType.Valued<Frog.Variant> FROG_VARIANT = valued("frog/variant");
public static final DataComponentType.Valued<Horse.Style> HORSE_VARIANT = valued("horse/variant");
public static final DataComponentType.Valued<Horse.Color> HORSE_VARIANT = valued("horse/variant");
public static final DataComponentType.Valued<Art> PAINTING_VARIANT = valued("painting/variant");
public static final DataComponentType.Valued<Llama.Color> LLAMA_VARIANT = valued("llama/variant");
public static final DataComponentType.Valued<Axolotl.Variant> AXOLOTL_VARIANT = valued("axolotl/variant");
@ -376,7 +376,6 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<DyeColor> SHEEP_COLOR = valued("sheep/color");
public static final DataComponentType.Valued<DyeColor> SHULKER_COLOR = valued("shulker/color");
private static DataComponentType.NonValued unvalued(final String name) {
final DataComponentType dataComponentType = requireNonNull(Registry.DATA_COMPONENT_TYPE.get(NamespacedKey.minecraft(name)), name + " unvalued data component type couldn't be found, this is a bug.");
if (dataComponentType instanceof DataComponentType.NonValued) {

View File

@ -3,9 +3,8 @@ package io.papermc.paper.datacomponent;
import org.bukkit.Utility;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* This represents a view of a data component holder. No
@ -23,11 +22,11 @@ public interface DataComponentView {
* @param type the data component type
* @param <T> the value type
* @return the value for the data component type, or {@code null} if not set or marked as removed
* @see #hasData(io.papermc.paper.datacomponent.DataComponentType) for DataComponentType.NonValued
* @see #hasData(DataComponentType) for DataComponentType.NonValued
*/
@Contract(pure = true)
@ApiStatus.Experimental
public <T> @Nullable T getData(final DataComponentType.@NotNull Valued<T> type);
<T> @Nullable T getData(final DataComponentType.Valued<T> type);
/**
* Gets the value for the data component type on this holder with
@ -41,7 +40,7 @@ public interface DataComponentView {
@Utility
@Contract(value = "_, !null -> !null", pure = true)
@ApiStatus.Experimental
public <T> @Nullable T getDataOrDefault(final DataComponentType.@NotNull Valued<? extends T> type, final @Nullable T fallback);
<T> @Nullable T getDataOrDefault(final DataComponentType.Valued<? extends T> type, final @Nullable T fallback);
/**
* Checks if the data component type is set on this holder.
@ -51,7 +50,7 @@ public interface DataComponentView {
*/
@Contract(pure = true)
@ApiStatus.Experimental
boolean hasData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type);
boolean hasData(final DataComponentType type);
// Not applicable to entities
// /**
@ -61,5 +60,5 @@ public interface DataComponentView {
// */
// @Contract("-> new")
// @ApiStatus.Experimental
// java.util.@Unmodifiable Set<io.papermc.paper.datacomponent.@NotNull DataComponentType> getDataTypes();
// @Unmodifiable Set<DataComponentType> getDataTypes();
}

View File

@ -1,7 +1,10 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.item.blocksattacks.DamageReduction;
import io.papermc.paper.datacomponent.item.blocksattacks.ItemDamageFunction;
import io.papermc.paper.registry.tag.TagKey;
import java.util.List;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
@ -9,7 +12,11 @@ import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
// TODO
/**
* Holds block attacks to the holding player like Shield.
*
* @see io.papermc.paper.datacomponent.DataComponentTypes#BLOCKS_ATTACKS
*/
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
@ -20,18 +27,55 @@ public interface BlocksAttacks {
return ItemComponentTypesBridge.bridge().blocksAttacks();
}
/**
* Gets the amount of time (in seconds) that use must be held before successfully blocking attacks.
*
* @return the delay in seconds
*/
float blockDelaySeconds();
/**
* Gets the multiplier applied to the cooldown time for the item when attacked by a disabling attack (the multiplier for {@link Weapon#disableBlockingForSeconds()}).
* <br>
* If set to 0, this item can never be disabled by attacks.
*
* @return the multiplier for the cooldown time
*/
float disableCooldownScale();
//List<DamageReduction> damageReductions();
/**
* Gets a list of {@link DamageReduction} of how much damage should be blocked in a given attack.
*
* @return a list of damage reductions
*/
List<DamageReduction> damageReductions();
//ItemDamageFunction itemDamage();
/**
* Gets how much damage should be applied to the item from a given attack.
*
* @return the damage function
*/
ItemDamageFunction itemDamage();
/**
* Gets the DamageType that can bypass the blocking.
*
* @return a damage type tag key, or null if there is no such tag key
*/
@Nullable TagKey<DamageType> bypassedBy();
/**
* Gets the key sound to play when an attack is successfully blocked.
*
* @return a key of the sound
*/
@Nullable Key blockSound();
/**
* Gets the key sound to play when the item goes on its disabled cooldown due to an attack.
*
* @return a key of the sound
*/
@Nullable Key disableSound();
/**
@ -47,14 +91,14 @@ public interface BlocksAttacks {
@Contract(value = "_ -> this", mutates = "this")
Builder disableCooldownScale(float scale);
//@Contract(value = "_ -> this", mutates = "this")
//Builder addDamageReduction(DamageReduction reduction);
@Contract(value = "_ -> this", mutates = "this")
Builder addDamageReduction(DamageReduction reduction);
//@Contract(value = "_ -> this", mutates = "this")
//Builder damageReductions(List<DamageReduction> reductions);
@Contract(value = "_ -> this", mutates = "this")
Builder damageReductions(List<DamageReduction> reductions);
//@Contract(value = "_ -> this", mutates = "this")
//Builder itemDamage(ItemDamageFunction function);
@Contract(value = "_ -> this", mutates = "this")
Builder itemDamage(ItemDamageFunction function);
@Contract(value = "_ -> this", mutates = "this")
Builder bypassedBy(@Nullable TagKey<DamageType> bypassedBy);

View File

@ -1,7 +1,7 @@
package io.papermc.paper.datacomponent.item;
import java.util.List;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.Color;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;

View File

@ -104,6 +104,22 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
@Contract(pure = true)
boolean equipOnInteract();
/**
* Checks if the item can be sheared off an entity.
*
* @return true if can be sheared off an entity, false otherwise
*/
@Contract(pure = true)
boolean canBeSheared();
/**
* Returns the sound that is played when shearing this equipment off an entity.
*
* @return shear sound
*/
@Contract(pure = true)
Key shearSound();
/**
* Builder for {@link Equippable}.
*/
@ -182,5 +198,23 @@ public interface Equippable extends BuildableDataComponent<Equippable, Equippabl
*/
@Contract(value = "_ -> this", mutates = "this")
Builder equipOnInteract(boolean equipOnInteract);
/**
* Sets whether the item can be sheared off an entity.
*
* @param canBeSheared true if can be sheared off an entity
* @return the builder for chaining
*/
@Contract(value = "_ -> this", mutates = "this")
Builder canBeSheared(boolean canBeSheared);
/**
* Sets the sound that is played when shearing this equipment off an entity.
*
* @param shearSound the shear sound key
* @return the builder for chaining
*/
@Contract(value = "_ -> this", mutates = "this")
Builder shearSound(Key shearSound);
}
}

View File

@ -1,7 +1,6 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.block.BlockPredicate;
import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.jetbrains.annotations.ApiStatus;

View File

@ -1,6 +1,7 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.item.attribute.AttributeModifierDisplay;
import java.util.List;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
@ -55,13 +56,21 @@ public interface ItemAttributeModifiers {
AttributeModifier modifier();
/**
* Gets the slot group for this attribute.
* Gets the slot group for the paired attribute.
*
* @return the slot group
*/
default EquipmentSlotGroup getGroup() {
return this.modifier().getSlotGroup();
}
/**
* The display behavior for the attribute modifier.
*
* @return the display behavior
*/
@Contract(pure = true)
AttributeModifierDisplay display();
}
/**
@ -74,24 +83,55 @@ public interface ItemAttributeModifiers {
/**
* Adds a modifier to this builder.
*
* @param attribute attribute
* @param modifier modifier
* @param attribute the attribute
* @param modifier the modifier
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _ -> this", mutates = "this")
Builder addModifier(Attribute attribute, AttributeModifier modifier);
default Builder addModifier(Attribute attribute, AttributeModifier modifier) {
return this.addModifier(attribute, modifier, modifier.getSlotGroup());
}
/**
* Adds a modifier to this builder.
*
* @param attribute attribute
* @param modifier modifier
* @param attribute the attribute
* @param modifier the modifier
* @param equipmentSlotGroup the slot group this modifier applies to (overrides any slot group in the modifier)
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _, _ -> this", mutates = "this")
Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup);
default Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup) {
return this.addModifier(attribute, modifier, equipmentSlotGroup, AttributeModifierDisplay.reset());
}
/**
* Adds a modifier to this builder.
*
* @param attribute the attribute
* @param modifier the modifier
* @param display the modifier display behavior
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _, _ -> this", mutates = "this")
default Builder addModifier(Attribute attribute, AttributeModifier modifier, AttributeModifierDisplay display) {
return this.addModifier(attribute, modifier, modifier.getSlotGroup(), display);
}
/**
* Adds a modifier to this builder.
*
* @param attribute the attribute
* @param modifier the modifier
* @param equipmentSlotGroup the slot group this modifier applies to (overrides any slot group in the modifier)
* @param display the modifier display behavior
* @return the builder for chaining
* @see #modifiers()
*/
@Contract(value = "_, _, _, _ -> this", mutates = "this")
Builder addModifier(Attribute attribute, AttributeModifier modifier, EquipmentSlotGroup equipmentSlotGroup, AttributeModifierDisplay display);
}
}

View File

@ -90,7 +90,7 @@ interface ItemComponentTypesBridge {
MapId mapId(int id);
UseRemainder useRemainder(ItemStack itemStack);
UseRemainder useRemainder(ItemStack stack);
Consumable.Builder consumable();

View File

@ -60,6 +60,27 @@ public interface PotionContents {
@Contract(pure = true)
@Nullable String customName();
/**
* All effects that this component applies.
* <p>
* This is a combination of the base potion type and any custom effects.
*
* @return an unmodifiable list of all effects.
*/
@Contract(pure = true)
@Unmodifiable List<PotionEffect> allEffects();
/**
* Computes the effective colour of this potion contents component.
* <p>
* This blends all custom effects, or uses a default fallback colour.
* It may or may not have an alpha channel, used for tipped arrows.
*
* @return the effective colour this component would display with.
*/
@Contract(pure = true)
Color computeEffectiveColor();
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<PotionContents> {

View File

@ -0,0 +1,85 @@
package io.papermc.paper.datacomponent.item.attribute;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentLike;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* The display behavior for a dedicated attribute entry.
*
* @see io.papermc.paper.datacomponent.DataComponentTypes#ATTRIBUTE_MODIFIERS
* @see io.papermc.paper.datacomponent.item.ItemAttributeModifiers#itemAttributes()
*/
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface AttributeModifierDisplay {
/**
* Reset any override of the text displayed by the attribute modifier
* to its default behavior displaying the statistics.
*
* @return the new display behavior instance
*/
@Contract(value = "-> new", pure = true)
static Default reset() {
return AttributeModifierDisplayBridge.bridge().reset();
}
/**
* Hides the statistics displayed by the attribute modifier.
*
* @return the new display behavior instance
*/
@Contract(value = "-> new", pure = true)
static Hidden hidden() {
return AttributeModifierDisplayBridge.bridge().hidden();
}
/**
* Override the statistics displayed by the attribute modifier
* to an arbitrary text.
*
* @param text the overridden text
* @return the new display behavior instance
*/
@Contract(value = "_ -> new", pure = true)
static OverrideText override(final ComponentLike text) {
return AttributeModifierDisplayBridge.bridge().override(text);
}
/**
* Hidden statistics display for the attribute modifier.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Hidden extends AttributeModifierDisplay {
}
/**
* Default display for the attribute modifier, showing
* the statistic of its effect.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Default extends AttributeModifierDisplay {
}
/**
* Specifies an overridden text to show instead of
* the default behavior for the attribute modifier.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface OverrideText extends AttributeModifierDisplay {
/**
* Overridden text
*
* @return the overridden text
*/
Component text();
}
}

View File

@ -0,0 +1,24 @@
package io.papermc.paper.datacomponent.item.attribute;
import java.util.Optional;
import java.util.ServiceLoader;
import net.kyori.adventure.text.ComponentLike;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
@ApiStatus.Internal
interface AttributeModifierDisplayBridge {
Optional<AttributeModifierDisplayBridge> BRIDGE = ServiceLoader.load(AttributeModifierDisplayBridge.class).findFirst();
static AttributeModifierDisplayBridge bridge() {
return BRIDGE.orElseThrow();
}
AttributeModifierDisplay.Default reset();
AttributeModifierDisplay.Hidden hidden();
AttributeModifierDisplay.OverrideText override(ComponentLike text);
}

View File

@ -0,0 +1,21 @@
package io.papermc.paper.datacomponent.item.blocksattacks;
import java.util.Optional;
import java.util.ServiceLoader;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
@ApiStatus.Internal
interface BlocksAttacksBridge {
Optional<BlocksAttacksBridge> BRIDGE = ServiceLoader.load(BlocksAttacksBridge.class).findFirst();
static BlocksAttacksBridge bridge() {
return BRIDGE.orElseThrow();
}
DamageReduction.Builder blocksAttacksDamageReduction();
ItemDamageFunction.Builder blocksAttacksItemDamageFunction();
}

View File

@ -0,0 +1,76 @@
package io.papermc.paper.datacomponent.item.blocksattacks;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.registry.set.RegistryKeySet;
import org.bukkit.damage.DamageType;
import org.checkerframework.checker.index.qual.Positive;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* Hold how much damage should be blocked in a given attack.
*
* @see io.papermc.paper.datacomponent.DataComponentTypes#BLOCKS_ATTACKS
* @see io.papermc.paper.datacomponent.item.BlocksAttacks#damageReductions()
*/
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface DamageReduction {
@Contract(value = "-> new", pure = true)
static DamageReduction.Builder damageReduction() {
return BlocksAttacksBridge.bridge().blocksAttacksDamageReduction();
}
/**
* The damage types to block.
*
* @return the set of damage type
*/
@Nullable RegistryKeySet<DamageType> type();
/**
* Get the maximum angle between the users facing direction and the direction of the incoming attack to be blocked.
*
* @return the angle
*/
@Positive float horizontalBlockingAngle();
/**
* Get the constant amount of damage to be blocked.
*
* @return the base
*/
float base();
/**
* Get the fraction of the dealt damage to be blocked.
*
* @return the factor
*/
float factor();
/**
* Builder for {@link DamageReduction}.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<DamageReduction> {
@Contract(value = "_ -> this", mutates = "this")
DamageReduction.Builder type(RegistryKeySet<DamageType> type);
@Contract(value = "_ -> this", mutates = "this")
DamageReduction.Builder horizontalBlockingAngle(@Positive float horizontalBlockingAngle);
@Contract(value = "_ -> this", mutates = "this")
DamageReduction.Builder base(float base);
@Contract(value = "_ -> this", mutates = "this")
DamageReduction.Builder factor(float factor);
}
}

View File

@ -0,0 +1,71 @@
package io.papermc.paper.datacomponent.item.blocksattacks;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* Hold how much damage should be applied to the item from a given attack.
*
* @see io.papermc.paper.datacomponent.DataComponentTypes#BLOCKS_ATTACKS
* @see io.papermc.paper.datacomponent.item.BlocksAttacks#itemDamage()
*/
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemDamageFunction {
@Contract(value = "-> new", pure = true)
static ItemDamageFunction.Builder itemDamageFunction() {
return BlocksAttacksBridge.bridge().blocksAttacksItemDamageFunction();
}
/**
* Get the minimum amount of damage dealt by the attack before item damage is applied to the item.
*
* @return the threshold
*/
@NonNegative
float threshold();
/**
* Get the constant amount of damage applied to the item, if threshold is passed.
*
* @return the base
*/
float base();
/**
* Get the fraction of the dealt damage that should be applied to the item, if threshold is passed.
*
* @return the factor
*/
float factor();
/**
* Get the damage to apply for the item.
*
* @apiNote this doesn't apply enchantments like {@link org.bukkit.enchantments.Enchantment#UNBREAKING}
* @return the damage to apply
*/
int damageToApply(float damage);
/**
* Builder for {@link ItemDamageFunction}.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<ItemDamageFunction> {
@Contract(value = "_ -> this", mutates = "this")
ItemDamageFunction.Builder threshold(@NonNegative final float threshold);
@Contract(value = "_ -> this", mutates = "this")
ItemDamageFunction.Builder base(final float base);
@Contract(value = "_ -> this", mutates = "this")
ItemDamageFunction.Builder factor(final float factor);
}
}

View File

@ -1,11 +1,14 @@
package io.papermc.paper.datacomponent.item.consumable;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents the hand animation that is used when a player is consuming this item.
*/
@ApiStatus.Experimental
public enum ItemUseAnimation {
// Start generate - ItemUseAnimation
// @GeneratedFrom 1.21.5
// @GeneratedFrom 1.21.6
NONE,
EAT,
DRINK,

View File

@ -0,0 +1,79 @@
package io.papermc.paper.event.block;
import com.google.common.base.Preconditions;
import org.bukkit.block.Block;
import org.bukkit.block.data.type.Vault;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.block.BlockEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* Called when a vault block changes state.
*/
@NullMarked
public class VaultChangeStateEvent extends BlockEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final @Nullable Player player;
private final Vault.State currentState;
private final Vault.State newState;
private boolean cancelled = false;
@ApiStatus.Internal
public VaultChangeStateEvent(final Block vaultBlock, final @Nullable Player player, final Vault.State currentState, final Vault.State newState) {
super(vaultBlock);
this.player = player;
this.currentState = currentState;
this.newState = newState;
}
/**
* Gets the player associated with this state change, if applicable.
*
* @return The associated player, or {@code null} if not known.
*/
public @Nullable Player getPlayer() {
return this.player;
}
/**
* Gets the state the vault is currently in.
*
* @return The current vault state.
*/
public Vault.State getCurrentState() {
return currentState;
}
/**
* Gets the state the vault is attempting to transition to.
*
* @return The new vault state.
*/
public Vault.State getNewState() {
return newState;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(final boolean cancel) {
this.cancelled = cancel;
}
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}

View File

@ -0,0 +1,52 @@
package io.papermc.paper.event.entity;
import org.bukkit.entity.FishHook;
import org.bukkit.event.HandlerList;
import org.bukkit.event.entity.EntityEvent;
import org.bukkit.event.player.PlayerFishEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Called just before a {@link FishHook}'s {@link FishHook.HookState} is changed.
*
* <p>If you want to monitor a player's fishing state transition, you can use {@link PlayerFishEvent}.</p>
*/
@NullMarked
public final class FishHookStateChangeEvent extends EntityEvent {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final FishHook.HookState newHookState;
@ApiStatus.Internal
public FishHookStateChangeEvent(final FishHook entity, final FishHook.HookState newHookState) {
super(entity);
this.newHookState = newHookState;
}
/**
* Get the <strong>new</strong> hook state of the {@link FishHook}.
*
* <p>Refer to {@link FishHook#getState()} to get the current hook state.</p>
*
* @return the <strong>new</strong> hook state
*/
public FishHook.HookState getNewHookState() {
return this.newHookState;
}
@Override
public FishHook getEntity() {
return (FishHook) super.getEntity();
}
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}

View File

@ -0,0 +1,94 @@
package io.papermc.paper.event.packet;
import io.papermc.paper.math.BlockPosition;
import io.papermc.paper.math.Position;
import java.util.Collections;
import java.util.List;
import net.kyori.adventure.text.Component;
import org.bukkit.block.sign.Side;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NullMarked;
/**
* Called when a client attempts to modify a sign, but the location at which the sign should be edited
* has not yet been checked for the existence of a real sign.
* <p>
* Cancelling this event will prevent further processing of the sign change, but needs further handling
* by the plugin as the client's local world might be in an inconsistent state.
*
* @see Player#openVirtualSign(Position, Side)
*/
@NullMarked
@ApiStatus.Experimental
public class UncheckedSignChangeEvent extends PlayerEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList();
private boolean cancel = false;
private final BlockPosition editedBlockPosition;
private final Side side;
private final List<Component> lines;
@ApiStatus.Internal
public UncheckedSignChangeEvent(
final Player editor,
final BlockPosition editedBlockPosition,
final Side side,
final List<Component> lines
) {
super(editor);
this.editedBlockPosition = editedBlockPosition;
this.side = side;
this.lines = lines;
}
/**
* Gets the location at which a potential sign was edited.
*
* @return location where the change happened
*/
public BlockPosition getEditedBlockPosition() {
return editedBlockPosition;
}
/**
* Gets which side of the sign was edited.
*
* @return {@link Side} that was edited
*/
public Side getSide() {
return side;
}
/**
* Gets the lines that the player has entered.
*
* @return the lines
*/
public @Unmodifiable List<Component> lines() {
return Collections.unmodifiableList(lines);
}
@Override
public boolean isCancelled() {
return cancel;
}
@Override
public void setCancelled(final boolean cancel) {
this.cancel = cancel;
}
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}

View File

@ -0,0 +1,98 @@
package io.papermc.paper.event.player;
import com.google.common.collect.ImmutableSet;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NullMarked;
import java.util.Set;
@NullMarked
public abstract class AbstractRespawnEvent extends PlayerEvent {
protected Location respawnLocation;
private final boolean isBedSpawn;
private final boolean isAnchorSpawn;
private final boolean missingRespawnBlock;
private final PlayerRespawnEvent.RespawnReason respawnReason;
private final Set<PlayerRespawnEvent.RespawnFlag> respawnFlags;
protected AbstractRespawnEvent(
final Player respawnPlayer, final Location respawnLocation, final boolean isBedSpawn,
final boolean isAnchorSpawn, final boolean missingRespawnBlock, final PlayerRespawnEvent.RespawnReason respawnReason
) {
super(respawnPlayer);
this.respawnLocation = respawnLocation;
this.isBedSpawn = isBedSpawn;
this.isAnchorSpawn = isAnchorSpawn;
this.missingRespawnBlock = missingRespawnBlock;
this.respawnReason = respawnReason;
ImmutableSet.Builder<PlayerRespawnEvent.RespawnFlag> builder = ImmutableSet.builder();
if (respawnReason == PlayerRespawnEvent.RespawnReason.END_PORTAL) builder.add(PlayerRespawnEvent.RespawnFlag.END_PORTAL);
if (this.isBedSpawn) builder.add(PlayerRespawnEvent.RespawnFlag.BED_SPAWN);
if (this.isAnchorSpawn) builder.add(PlayerRespawnEvent.RespawnFlag.ANCHOR_SPAWN);
this.respawnFlags = builder.build();
}
/**
* Gets the current respawn location.
*
* @return the current respawn location
*/
public Location getRespawnLocation() {
return this.respawnLocation.clone();
}
/**
* Gets whether the respawn location is the player's bed.
*
* @return {@code true} if the respawn location is the player's bed
*/
public boolean isBedSpawn() {
return this.isBedSpawn;
}
/**
* Gets whether the respawn location is the player's respawn anchor.
*
* @return {@code true} if the respawn location is the player's respawn anchor
*/
public boolean isAnchorSpawn() {
return this.isAnchorSpawn;
}
/**
* Gets whether the player is missing a valid respawn block.
* <p>
* This will occur if the players respawn block is obstructed,
* or it is the first death after it was either destroyed or
* in case of a respawn anchor, ran out of charges.
*
* @return whether the player is missing a valid respawn block
*/
public boolean isMissingRespawnBlock() {
return this.missingRespawnBlock;
}
/**
* Gets the reason this respawn event was called.
*
* @return the reason the event was called
*/
public PlayerRespawnEvent.RespawnReason getRespawnReason() {
return this.respawnReason;
}
/**
* Gets the set of flags that apply to this respawn.
*
* @return an immutable set of the flags that apply to this respawn
* @deprecated in favour of {@link #getRespawnReason()}/{@link #isBedSpawn}/{@link #isAnchorSpawn()}
*/
@Deprecated
public @Unmodifiable Set<PlayerRespawnEvent.RespawnFlag> getRespawnFlags() {
return this.respawnFlags;
}
}

View File

@ -0,0 +1,63 @@
package io.papermc.paper.event.player;
import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jspecify.annotations.NullMarked;
/**
* Called when a player creates a filled map by right-clicking an empty map.
*/
@NullMarked
public class PlayerMapFilledEvent extends PlayerEvent {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final ItemStack originalItem;
private ItemStack createdMap;
@ApiStatus.Internal
public PlayerMapFilledEvent(final Player player, final ItemStack originalItem, final ItemStack createdMap) {
super(player);
this.originalItem = originalItem;
this.createdMap = createdMap;
}
/**
* Returns a copy of the empty map before it was consumed.
*
* @return cloned original item
*/
public ItemStack getOriginalItem() {
return this.originalItem.clone();
}
/**
* Returns a copy of the filled map which was created.
*
* @return cloned created map item
*/
public ItemStack getCreatedMap() {
return this.createdMap.clone();
}
/**
* Sets the filled map that will be created.
*
* @param createdMap map item
*/
public void setCreatedMap(final ItemStack createdMap) {
this.createdMap = createdMap.clone();
}
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}

View File

@ -0,0 +1,32 @@
package io.papermc.paper.event.player;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Event that is fired when a player uses the pick item functionality on a block
* (middle-clicking a block to get the appropriate item).
* After the handling of this event, the contents of the source and the target slot will be swapped,
* and the currently selected hotbar slot of the player will be set to the target slot.
*/
@NullMarked
public class PlayerPickBlockEvent extends PlayerPickItemEvent {
private final Block block;
@ApiStatus.Internal
public PlayerPickBlockEvent(final Player player, final Block block, final boolean includeData, final int targetSlot, final int sourceSlot) {
super(player, includeData, targetSlot, sourceSlot);
this.block = block;
}
/**
* Retrieves the block associated with this event.
*
* @return the block involved in the event
*/
public Block getBlock() {
return this.block;
}
}

View File

@ -0,0 +1,32 @@
package io.papermc.paper.event.player;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Event that is fired when a player uses the pick item functionality on an entity
* (middle-clicking an entity to get the appropriate item).
* After the handling of this event, the contents of the source and the target slot will be swapped,
* and the currently selected hotbar slot of the player will be set to the target slot.
*/
@NullMarked
public class PlayerPickEntityEvent extends PlayerPickItemEvent {
private final Entity entity;
@ApiStatus.Internal
public PlayerPickEntityEvent(final Player player, final Entity entity, final boolean includeData, final int targetSlot, final int sourceSlot) {
super(player, includeData, targetSlot, sourceSlot);
this.entity = entity;
}
/**
* Retrieves the entity associated with this event.
*
* @return the entity involved in the event
*/
public Entity getEntity() {
return this.entity;
}
}

View File

@ -10,27 +10,44 @@ import org.jetbrains.annotations.Range;
import org.jspecify.annotations.NullMarked;
/**
* Event that is fired when a player uses the pick item functionality (middle-clicking a block or entity to get the
* appropriate item). After the handling of this event, the contents of the source and the target slot will be swapped
* Event that is fired when a player uses the pick item functionality
* (middle-clicking a {@link PlayerPickBlockEvent block}
* or {@link PlayerPickEntityEvent entity} to get the appropriate item).
* After the handling of this event, the contents of the source and the target slot will be swapped,
* and the currently selected hotbar slot of the player will be set to the target slot.
*
* @see PlayerPickEntityEvent
* @see PlayerPickBlockEvent
*/
@NullMarked
public class PlayerPickItemEvent extends PlayerEvent implements Cancellable {
public abstract class PlayerPickItemEvent extends PlayerEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final boolean includeData;
private int targetSlot;
private int sourceSlot;
private boolean cancelled;
@ApiStatus.Internal
public PlayerPickItemEvent(final Player player, final int targetSlot, final int sourceSlot) {
protected PlayerPickItemEvent(final Player player, final boolean includeData, final int targetSlot, final int sourceSlot) {
super(player);
this.includeData = includeData;
this.targetSlot = targetSlot;
this.sourceSlot = sourceSlot;
}
/**
* Checks whether the player wants block/entity data included.
*
* @return {@code true} if data is included, otherwise {@code false}.
*/
public boolean isIncludeData() {
return includeData;
}
/**
* Returns the slot the item that is being picked goes into.
*

View File

@ -157,7 +157,7 @@ public interface PermissionManager {
void addPermissions(List<Permission> perm);
/**
* Clears the current registered permissinos.
* Clears all the current registered permissions.
* <p>
* This is used for reloading.
*/

View File

@ -1,8 +1,7 @@
/**
* The paper configuration package contains the new java representation of a plugins configuration file.
* While most values are described in detail on {@link io.papermc.paper.plugin.configuration.PluginMeta}, a full
* entry on the paper contains a full and extensive example of possible configurations of the paper-plugin.yml.
* @see <a href="https://docs.papermc.io/paper">Extensive documentation and examples of the paper-plugin.yml</a>
* <!--TODO update the documentation link once documentation for this exists and is deployed-->
* entry on the paper website contains a full and extensive example of possible configurations of the paper-plugin.yml.
* @see <a href="https://docs.papermc.io/paper/dev/getting-started/paper-plugins">Extensive documentation and examples of the paper-plugin.yml</a>
*/
package io.papermc.paper.plugin.configuration;

View File

@ -11,7 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
* server initialization.
* @see LifecycleEvents
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface LifecycleEvent {
}

View File

@ -4,7 +4,6 @@ import io.papermc.paper.plugin.lifecycle.event.handler.LifecycleEventHandler;
import io.papermc.paper.plugin.lifecycle.event.handler.configuration.LifecycleEventHandlerConfiguration;
import io.papermc.paper.plugin.lifecycle.event.types.LifecycleEventType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Manages a plugin's lifecycle events. Can be obtained
@ -12,8 +11,6 @@ import org.jspecify.annotations.NullMarked;
*
* @param <O> the owning type, {@link org.bukkit.plugin.Plugin} or {@link io.papermc.paper.plugin.bootstrap.BootstrapContext}
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface LifecycleEventManager<O extends LifecycleEventOwner> {

View File

@ -2,7 +2,6 @@ package io.papermc.paper.plugin.lifecycle.event;
import io.papermc.paper.plugin.configuration.PluginMeta;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Implemented by types that are considered owners
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
* a {@link LifecycleEventManager} where you can register
* event handlers.
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface LifecycleEventOwner {

View File

@ -1,8 +1,6 @@
package io.papermc.paper.plugin.lifecycle.event.handler;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A handler for a specific event. Can be implemented
@ -10,8 +8,6 @@ import org.jspecify.annotations.NullMarked;
*
* @param <E> the event
*/
@ApiStatus.Experimental
@NullMarked
@FunctionalInterface
public interface LifecycleEventHandler<E extends LifecycleEvent> {

View File

@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
import io.papermc.paper.plugin.lifecycle.event.handler.LifecycleEventHandler;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Base type for constructing configured event handlers for
@ -13,8 +12,6 @@ import org.jspecify.annotations.NullMarked;
* @param <O>
*/
@SuppressWarnings("unused")
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface LifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> {
}

View File

@ -3,15 +3,12 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* Handler configuration for event types that allow "monitor" handlers.
*
* @param <O> the required owner type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface MonitorLifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> extends LifecycleEventHandlerConfiguration<O> {

View File

@ -3,7 +3,6 @@ package io.papermc.paper.plugin.lifecycle.event.handler.configuration;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
/**
* Handler configuration that allows both "monitor" and prioritized handlers.
@ -11,8 +10,6 @@ import org.jspecify.annotations.NullMarked;
*
* @param <O> the required owner type
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface PrioritizedLifecycleEventHandlerConfiguration<O extends LifecycleEventOwner> extends LifecycleEventHandlerConfiguration<O> {

Some files were not shown because too many files have changed in this diff Show More