Compare commits

...
Author SHA1 Message Date
Owen1212055 6409d5ce9e Update 2026-06-26 20:54:44 +02:00
Owen1212055 2de25adfc9 Merge remote-tracking branch 'origin/main' into feat/block-capturing
# Conflicts:
#	paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
#	paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
#	paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
#	paper-server/src/main/java/org/bukkit/craftbukkit/util/BlockStateListPopulator.java
2026-04-25 17:46:29 -04:00
Miles 182b2f8a2a Add Point Of Interest API (#12117) 2026-04-25 16:27:55 -04:00
Owen a8c05a35c2 Add an option to WorldCreator to avoid spawn location computation on world creation (#13407) 2026-04-25 15:31:47 -04:00
Pedro 945aea9961 Fix Damager for HangingBreakByEntityEvent and minor improvements (#12615) 2026-04-25 14:52:57 -04:00
Pedro 4aef3f0a67 Remove already fixed vanilla bug MC-244739 (#13787) 2026-04-25 14:26:37 -04:00
Pedro 60073714ba Update MOJIRA reference in DeOp command response for multiple targets [ci skip] (#13812) 2026-04-25 14:20:54 -04:00
Rothes 4f184db3c9 Fix memory leak on constantly damage (#13455) 2026-04-25 14:19:52 -04:00
Illia Bondar 57d84f68a3 Prevent NPE on ThrownPotion#splash (#13683) 2026-04-25 14:16:47 -04:00
Warrior 49daadd25d Fix insomniaStartTicks option being ignored for phantom spawning (#13609) 2026-04-25 13:57:03 -04:00
Pedro b2b1e177cb Improvement to Vehicle damage events (#13572) 2026-04-25 13:46:17 -04:00
PedroandLulu13022002 90aee8e007 Update world methods to take in account environment attributes (#13543)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2026-04-25 19:20:49 +02:00
Pedro d74f6bc77a Support for Kill damageable entities (#13667) 2026-04-25 13:12:18 -04:00
Kezz dd203a2716 chore: Don't log errors for accepting the EULA via the system property (#13681) 2026-04-25 13:02:42 -04:00
David Lüdtke dcf5577aae Fix PlayerProfile applySkinToPlayerHeadContents (#13692) 2026-04-25 12:53:39 -04:00
Harold c39822ae08 reset pending keepalive state on listener handoff during reconfiguration (#13712) 2026-04-25 12:50:10 -04:00
David 4af86ff3e0 Handle null ServerLevel in fromGlobalPos (#13703) 2026-04-25 12:41:23 -04:00
ac15CR 1a8417b12b [ci skip] Add Javadocs for PotionEffect withX methods (#13723) 2026-04-25 12:39:33 -04:00
personalized-advertising 65461225ef Update health after setPlayerProfile() (#13717) 2026-04-25 12:32:53 -04:00
PedroandLulu13022002 7b31cc2b6b Make leaveMessage in PlayerKickEvent nullable (#13804)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2026-04-25 12:30:26 -04:00
sovdeeandLulu13022002 aa6f09b098 Prevent Happy Ghast from playing mount/dismount noises when silenced (#13807)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2026-04-25 12:01:24 -04:00
Nassim Jahnke 944ce44a4a Fix CraftWorld identifier passing 2026-04-25 11:59:27 +02:00
Pedro 6fe7eb5aae Load World Key when its instance is created (#13818) 2026-04-25 09:58:13 +02:00
Spottedleaf 948acae8c2 Raise existing level.dat data size quota
It appears that custom data may push it to be higher than
what the default quota allows for.

See https://mojira.dev/MC-307144

Fixes https://github.com/PaperMC/Paper/issues/13820
2026-04-24 19:25:14 -07:00
Nassim Jahnke ef4e85d6db Replace remaining relevant getWorld(String) use 2026-04-24 19:16:43 +02:00
Shane Freeder 3611a815e6 Fix String#toLower/UpperCase usages 2026-04-23 16:37:29 +01:00
Jason Penilla 1d14197790 fix setSpawnLocation changing respawn dimension
it was carrying some leftover intermediary shape from before PaperLevelOverrides design was finalized - revert to original shape for correct behavior

also revert ordering change in setRespawnData
2026-04-21 09:49:28 -07:00
Spottedleaf 6bac3c95bf Delay open/close callbacks for chests
The logic for chests may invoke block updates, which may not
be safe to perform. For example, inventory closing due to
player logout (which restricts chunk loading due to being
inside an entity status callback) or during shutdown (which has
chunk loading restrictions due to the chunk system being halted).

This also fixes the recheckOpeners function not firing
the redstone event if the open count changes.
2026-04-20 03:05:27 -07:00
Spottedleaf 9b1dd57135 Do not empty beehives from worldgen threads
The level is not set here, so emptying would cause a crash
due to NPE, and of course the logic is not safe to run from
the worldgen thread even if the level was set.
2026-04-20 02:48:53 -07:00
Spottedleaf 4be1a310c2 Add EntityScheduler#scheduleOrExecute
This is useful on Folia where we may want to try to avoid
scheduling a delayed task.
2026-04-20 02:15:28 -07:00
Nassim Jahnke 66d3bbed38 Update frosted ice patch for 26.1 2026-04-19 18:41:44 +02:00
Jonathan d0be5e20fd Call BlockFadeEvent for FrostedIce (#13764) 2026-04-19 16:14:54 +02:00
Asish Kumar dd0810c4af Skip inactive AI ticks for unaware mobs (#13781) 2026-04-19 16:14:21 +02:00
Pedro 04ee8eac9b Remove Paper config unsupported-settings.compression-format (#13800) 2026-04-19 16:08:48 +02:00
Warrior c58cba39fb Port blockstate validation patch (#13786) 2026-04-19 16:08:32 +02:00
Lulu13022002andJake Potrebic 0c79f00b00 Improve GameRule API (#13668)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2026-04-18 20:09:16 +02:00
Pedro 144a7c7f34 Add missing deprecation for Material#getCreativeCategory (#13686) 2026-04-18 19:49:21 +02:00
Warrior 392e594c10 Fix EntityLungeEvent#setLungePower being ignored (#13784) 2026-04-18 19:29:26 +02:00
Pedro 0026eacf79 Remove unused config for logging.deobfuscate-stacktraces (#13778) 2026-04-18 19:05:33 +02:00
Lulu13022002 0a3a73c18f Fix fireball entity class (#13676) 2026-04-18 19:03:43 +02:00
Jason Penilla 02ec8e9585 [ci skip] Remove dead disableGameRuleLimits property reading 2026-04-15 11:48:36 -07:00
Jason Penilla 6f4b0045e4 Add earlier trigger for world migration delay in vanilla logic (#13792) 2026-04-15 20:37:07 +02:00
Jason PenillaandOwen1212055 78eb3aaf13 Start discouraging world name use (#13760)
Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
2026-04-15 18:31:47 +00:00
Mika 8987f91c92 [ci skip] chore(jd): ChunkGenerator improvements (#13655) 2026-04-11 17:20:49 +02:00
Bjarne Koll d61d8df477 Cleanup crafter slot diff (#13662) 2026-04-11 16:20:46 +02:00
Creeam 73aded4302 Fix spigot config silentCommandBlocks filtering player commands (#13649) 2026-04-11 15:47:03 +02:00
David 1241f406b1 [ci skip] Update Player#performCommand javadoc and signature (#13698) 2026-04-11 15:45:28 +02:00
Dueris 67a54b3117 Add EntityLungeEvent (#13637) 2026-04-11 15:25:42 +02:00
Nassim Jahnke ce56a02f94 Update Vanilla base to 26.1.2
No actual server changes aside from the usual data version bumps
2026-04-11 13:38:25 +02:00
Pedro 7773669d2b [ci skip] Update README and CONTRIBUTING for 26.1 (#13739) 2026-04-11 09:31:24 +02:00
Lulu13022002 7c923b7259 [ci skip] migrate remaining patches to jspecify 2026-04-10 14:39:04 +02:00
Jason Penilla 8650896cc9 handle legacy uid in vanilla migration and always write metadata during migration 2026-04-10 14:39:03 +02:00
Jason Penilla 870df9d3e6 [ci skip] Drop stale TODO
This is no longer needed as we explicitly add the correct gen settings to the SavedDataStorage for custom dimensions in CraftServer. We no longer have multiple PrimaryLevelData, and WorldGenSettings is saved in its own file.
2026-04-10 14:39:03 +02:00
Warrior 6a99268219 Add PlayerToggleEntityAgeLockEvent (#13742) 2026-04-10 14:39:02 +02:00
Nassim Jahnke bc8f592891 Fix attack check 2026-04-10 14:39:02 +02:00
Owen1212055 7e34fba076 feat: Optimize ServerWaypointManager when locator bar is disabled
The waypoint system  iterates over each player for running waypoint calculations. This, most notably, is done on setPosRaw which is executed twice for each player (one for non players).
This results in every time a player moves, it iterates over each player twice.

So instead, we cache the game rule and instead use this to prevent iterating over all the players and avoid the redundant connection logic checks.

This performance issue is most noticeable with many players on the same level.
2026-04-10 14:39:02 +02:00
tofik.07 9d2db14272 Cache the climbing check in activation range (#12764) 2026-04-10 14:39:01 +02:00
Owen1212055 5e9a9188c0 Lazy set Entity.projectileSource in AbstractProjectile#getShooter
Fixes #13475
Supersedes #13643
Supersedes 13481
2026-04-10 14:39:01 +02:00
Lulu13022002 79ad7f65bd Update unpick definitions 2026-04-10 14:39:00 +02:00
Jason Penilla 980122193f Implement new version schema: <mcver>.build.<paper_build_no>-<paper_status> / <mcver>.local-SNAPSHOT 2026-04-10 14:39:00 +02:00
Jason Penilla a0eb01aacd Change world storage layout to be closer to vanilla & implement migration (#13736) 2026-04-10 14:39:00 +02:00
28f8027abb 26.1
Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com>
Co-authored-by: Pedro <3602279+Doc94@users.noreply.github.com>
2026-04-10 14:38:59 +02:00
Riley ParkandHannes Greule bd74bf6581 feat: PlayerSwapWithEquipmentSlotEvent (#13687)
Co-authored-by: Hannes Greule <SirYwell@users.noreply.github.com>
2026-03-09 19:54:02 -07:00
Strokkur24 3f5728e249 Cleanup CLI args (#13646) 2026-02-28 12:48:51 +01:00
PedroandLulu13022002 c58f844300 Check for valid NamespacedKey in OldEnum#valueOf (#13596)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2026-02-28 12:14:14 +01:00
Lulu13022002 75bbf4fb27 Fix infinite loop for legacy wrapper (#13659) 2026-02-28 11:53:57 +01:00
notsneakybeaky 7e80cef519 Add ItemStack getter to FurnaceExactEvent (#13569) 2026-02-26 18:09:41 +01:00
Joshua Prince 32dff6b180 Fix crafter slot ID conversions (#13497) 2026-02-26 18:03:40 +01:00
masmc05 10235641e3 Fix item entity data serialization to json (#13632) 2026-02-26 17:54:18 +01:00
Yannick Lamprecht 13887c99a2 feature(#13558): add copper golem state api (#13561) 2026-02-26 17:49:15 +01:00
Timon Seidel 47aef92a92 [ci skip] chore(jd): improve PlayerConnectionValidateLoginEvent (#13591) 2026-02-26 14:40:31 +01:00
tofik.07 37e02efd95 feat: Add new overloads for Pathfinder (#13192) 2026-02-26 13:41:00 +01:00
TonytheMacaroni ad767b0c5c Fix MC-259832 (#13464) 2026-02-26 13:31:13 +01:00
KezzandLulu13022002 79c77f5d7d Pre-Adventure 5.0 changes (#13300)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2026-02-19 16:02:08 -08:00
Spottedleaf 6f71be809b Sync Moonrise
We do not implement the chunk unload settings, as I am not currently
aware of any need for this on Paper. Maybe in the future that changes.
2026-02-15 11:07:05 -08:00
Lulu13022002 4731020c9d only grow water plant on solid blocks, prevent item removal when event is cancelled 2026-02-15 20:04:50 +01:00
Spottedleaf 1f1406f1b6 Fix collision inconsistency with Vanilla
We need to avoid performing intersection checks with the epsilon value
when checking intersection against whole blocks.

I'm sure this is going to cause some collision problem but we will
cross that bridge when it happens.

Fixes https://github.com/PaperMC/Paper/issues/13579
2026-02-15 11:00:11 -08:00
Lulu13022002 dbd8747173 allow to bonemeal bamboo and moss block 2026-02-14 20:02:59 +01:00
Lulu13022002 d4895653fa bunch of bonemeal fixes
Track bonemeal usage for StructureGrowEvent and propagate context properly between the two events.
Call the StructureGrowEvent for fungus, only call the BlockFertilizeEvent if the placement is sucessful.
2026-02-13 20:31:06 +01:00
Lulu13022002 4397b319a7 fix relative pos for placed block on water 2026-02-12 22:28:19 +01:00
Lulu13022002 298a8bfd32 remove CapturedBlockState and capturedFlags field 2026-02-12 21:06:58 +01:00
Lulu13022002 bcf5a3fffe allow to bonemeal the ocean floor 2026-02-11 22:20:10 +01:00
Lulu13022002 84a73d8984 format 2026-02-11 21:17:17 +01:00
Owen1212055 f46fbbe20b Fix block against logic
TODO: Lillypad logic looks odd
2026-02-06 17:40:37 -05:00
Owen1212055 ad45c84240 Bye treetype field 2026-02-06 14:48:11 -05:00
Owen1212055 e4114b0e0e Adjust pre cancel 2026-02-06 14:38:26 -05:00
Owen1212055 d56b548552 Fix some niche issues 2026-02-06 14:21:55 -05:00
Owen1212055 8e32dcbfe7 Fix some layering issues, simplify a bit 2026-02-06 12:32:57 -05:00
Owen1212055 6968eb065e Small name cleanup 2026-02-06 10:31:01 -05:00
Owen1212055 d55864cc09 Fix block entity placement 2026-02-06 10:08:51 -05:00
Owen1212055 c77b8418bf Better bonemeal support 2026-02-06 10:04:38 -05:00
Owen1212055 f4074a073e Fix build 2026-02-05 17:05:08 -05:00
Owen1212055 05eb2e4543 Block Capturing System 2026-02-05 16:52:05 -05:00
1395 changed files with 36007 additions and 29478 deletions

No files matched your search

+4 -4
View File
@@ -47,10 +47,10 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: JDK 21
- name: JDK 25
uses: actions/setup-java@v4
with:
java-version: 21
java-version: 25
distribution: 'zulu'
- name: Setup Gradle
@@ -115,14 +115,14 @@ jobs:
- name: Create Paperclip Jar
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
run: ./gradlew createMojmapPaperclipJar --stacktrace
run: ./gradlew createPaperclipJar --stacktrace
- name: Upload Paperclip Jar
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
uses: actions/upload-artifact@v4
with:
name: paper-${{ fromJSON(steps.determine.outputs.result).pr }}
path: paper-server/build/libs/paper-paperclip-*-mojmap.jar
path: paper-server/build/libs/paper-paperclip-*.jar
- name: Publish Artifacts
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
+1
View File
@@ -20,6 +20,7 @@ nbactions.xml
bin/
dist/
manifest.mf
__pycache__/
# Mac filesystem dust
.DS_Store/
+9 -30
View File
@@ -21,12 +21,12 @@ which can be obtained in (most) package managers such as `apt` (Debian / Ubuntu;
you will most likely use this for WSL), `homebrew` (macOS / Linux), and more:
- `git` (package `git` everywhere);
- A Java 21 or later JDK (packages vary, use Google/DuckDuckGo/etc.).
- A Java 25 or later JDK (packages vary, use Google/DuckDuckGo/etc.).
- [Adoptium](https://adoptium.net/) has builds for most operating systems.
- Paper requires JDK 21 to build, however, makes use of Gradle's
- Paper requires JDK 25 to build, however, makes use of Gradle's
[Toolchains](https://docs.gradle.org/current/userguide/toolchains.html)
feature to allow building with only JRE 17 or later installed. (Gradle will
automatically provision JDK 21 for compilation if it cannot find an existing
feature to allow building with only JRE 21 or later installed. (Gradle will
automatically provision JDK 25 for compilation if it cannot find an existing
installation).
If you're on Windows, check
@@ -36,11 +36,11 @@ If you're compiling with Docker, you can use Adoptium's
[`eclipse-temurin`](https://hub.docker.com/_/eclipse-temurin/) images like so:
```console
# docker run -it -v "$(pwd)":/data --rm eclipse-temurin:21.0.5_11-jdk bash
# docker run -it -v "$(pwd)":/data --rm eclipse-temurin:25.0.2_10-jdk bash
Pulling image...
root@abcdefg1234:/# javac -version
javac 21.0.5
javac 25.0.2
```
## Understanding Patches
@@ -66,7 +66,7 @@ On Windows, remove the `./` the beginning of `gradlew` commands;
**Only changes made in `paper-server/src/minecraft` have to deal with the patch system.**
`paper-server/src/minecraft` is not a git repositories in the traditional sense. Its
initial commits are the decompiled and deobfuscated Minecraft source files. The per-file
initial commits are the decompiled Minecraft source files. The per-file
patches are applied on top of these files as a single, large commit, which is then followed
by the individual feature-patch commits.
@@ -184,8 +184,7 @@ These steps assume the `origin` remote is your fork of this repository and `upst
## PR Policy
We'll accept changes that make sense. You should be able to justify their
existence, along with any maintenance costs that come with them. Using
[obfuscation helpers](#obfuscation-helpers) aids in the maintenance costs.
existence, along with any maintenance costs that come with them.
Remember that these changes will affect everyone who runs Paper, not just you
and your server.
@@ -281,7 +280,7 @@ public class SomeVanillaClass {
We are in the process of switching nullability annotation libraries, so you might need to use one or the other:
**For classes we add**: Fields, method parameters and return types that are nullable should be marked via the
**For classes, we add or modifications to Vanilla Files**: Fields, method parameters and return types that are nullable should be marked via the
`@Nullable` annotation from `org.jspecify.annotations`. Whenever you create a new class, add `@NullMarked`, meaning types
are assumed to be non-null by default. For less obvious placing such as on generics or arrays, see the [JSpecify docs](https://jspecify.dev/docs/user-guide/).
@@ -382,26 +381,6 @@ index a92bf8967..d0ab87d0f 100644
```
-->
## Obfuscation Helpers
While rarely needed, obfuscation helpers are sometimes useful when it comes
to unmapped local variables, or poorly named method parameters. In an effort
to make future updates easier on ourselves, Paper tries to use obfuscation
helpers wherever it makes sense. The purpose of these helpers is to make the
code more readable and maintainable. These helpers should be made easy to
inline by the JVM wherever possible.
An example of an obfuscation helper for a local variable:
```java
double d0 = entity.getX(); final double fromX = d0; // Paper - OBFHELPER
// ...
this.someMethod(fromX); // Paper
```
While they may not always be done in exactly the same way, the general goal is
always to improve readability and maintainability. Use your best judgment and do
what fits best in your situation.
## Configuration files
To use a configurable value in your patch, add a new field in either the
+23 -20
View File
@@ -1,4 +1,6 @@
Paper [![Paper Build Status](https://img.shields.io/github/actions/workflow/status/PaperMC/Paper/build.yml?branch=main)](https://github.com/PaperMC/Paper/actions)
Paper [![Version](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Fartifactory.papermc.io%2Fartifactory%2Funiverse%2Fio%2Fpapermc%2Fpaper%2Fpaper-api%2Fmaven-metadata.xml&strategy=highestVersion&filter=26.1*&label=version&color=%23344ceb
)](https://papermc.io/downloads/paper)
[![Paper Build Status](https://img.shields.io/github/actions/workflow/status/PaperMC/Paper/build.yml?branch=main)](https://github.com/PaperMC/Paper/actions)
[![Discord](https://img.shields.io/discord/289587909051416579.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.gg/papermc)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/papermc?label=GitHub%20Sponsors)](https://github.com/sponsors/PaperMC)
[![Open Collective](https://img.shields.io/opencollective/all/papermc?label=OpenCollective%20Sponsors)](https://opencollective.com/papermc)
@@ -27,6 +29,23 @@ How To (Plugin Developers)
* See upcoming, pending, and recently added API [here](https://github.com/orgs/PaperMC/projects/2/views/4)
* Paper API javadocs here: [papermc.io/javadocs](https://papermc.io/javadocs/)
#### Repository (for paper-api)
See [the docs](https://docs.papermc.io/paper/dev/project-setup/#adding-paper-as-a-dependency) for more details.
##### Gradle
```kotlin
repositories {
maven {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:26.1.2.build.+")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(25))
}
```
##### Maven
```xml
@@ -40,32 +59,16 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.11-R0.1-SNAPSHOT</version>
<version>[26.1.2.build,)</version>
<scope>provided</scope>
</dependency>
```
##### Gradle
```kotlin
repositories {
maven {
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
```
How To (Compiling Jar From Source)
------
To compile Paper, you need JDK 21 and an internet connection.
To compile Paper, you need JDK 25 and an internet connection.
Clone this repo, run `./gradlew applyPatches`, then `./gradlew createMojmapBundlerJar` from your terminal. You can find the compiled jar in the `paper-server/build/libs` directory.
Clone this repo, run `./gradlew applyPatches`, then `./gradlew createPaperclipJar` from your terminal. You can find the compiled jar in the `paper-server/build/libs` directory.
To get a full list of tasks, run `./gradlew tasks`.
+41 -23
View File
@@ -3,6 +3,7 @@
private-f net.minecraft.network.CompressionDecoder inflater
private-f net.minecraft.server.MinecraftServer connection
private-f net.minecraft.server.MinecraftServer levels
private-f net.minecraft.server.jsonrpc.internalapi.MinecraftGameRuleServiceImpl gameRules
private-f net.minecraft.world.item.ItemStack components
private-f net.minecraft.world.item.ItemStack item
private-f net.minecraft.world.level.block.entity.BeehiveBlockEntity stored
@@ -32,7 +33,7 @@ public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket z
public net.minecraft.network.syncher.SynchedEntityData getItem(Lnet/minecraft/network/syncher/EntityDataAccessor;)Lnet/minecraft/network/syncher/SynchedEntityData$DataItem;
public net.minecraft.resources.RegistryOps lookupProvider
public net.minecraft.resources.RegistryOps$HolderLookupAdapter
public net.minecraft.server.Main forceUpgrade(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lnet/minecraft/world/level/storage/WorldData;Lcom/mojang/datafixers/DataFixer;ZLjava/util/function/BooleanSupplier;Lnet/minecraft/core/RegistryAccess;Z)V
public net.minecraft.server.Main forceUpgrade(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;Lcom/mojang/datafixers/DataFixer;ZLjava/util/function/BooleanSupplier;Lnet/minecraft/core/RegistryAccess;Z)V
public net.minecraft.server.MinecraftServer LOGGER
public net.minecraft.server.MinecraftServer doRunTask(Lnet/minecraft/server/TickTask;)V
public net.minecraft.server.MinecraftServer executor
@@ -41,11 +42,13 @@ public net.minecraft.server.MinecraftServer playerDataStorage
public net.minecraft.server.MinecraftServer resources
public net.minecraft.server.MinecraftServer serverThread
public net.minecraft.server.MinecraftServer$ReloadableResources
public net.minecraft.server.MinecraftServer$ReloadableResources <init>(Lnet/minecraft/server/packs/resources/CloseableResourceManager;Lnet/minecraft/server/ReloadableServerResources;)V
public net.minecraft.server.RegistryLayer STATIC_ACCESS
public net.minecraft.server.ReloadableServerResources
public net.minecraft.server.ServerAdvancementManager advancements
public net.minecraft.server.Services USERID_CACHE_FILE
public net.minecraft.server.dedicated.DedicatedServerProperties$WorldDimensionData
public net.minecraft.server.dedicated.DedicatedServerProperties$WorldDimensionData <init>(Lcom/google/gson/JsonObject;Ljava/lang/String;)V
public net.minecraft.server.dedicated.Settings getStringRaw(Ljava/lang/String;)Ljava/lang/String;
public net.minecraft.server.dedicated.Settings properties
public net.minecraft.server.level.ChunkHolder oldTicketLevel
@@ -96,6 +99,7 @@ public net.minecraft.server.level.ServerPlayer setShoulderEntityRight(Lnet/minec
public net.minecraft.server.level.ServerPlayer triggerDimensionChangeTriggers(Lnet/minecraft/server/level/ServerLevel;)V
public net.minecraft.server.level.ServerPlayer wardenSpawnTracker
public net.minecraft.server.level.ServerPlayer$RespawnPosAngle
public net.minecraft.server.level.ServerPlayer$RespawnPosAngle <init>(Lnet/minecraft/world/phys/Vec3;FF)V
public net.minecraft.server.level.ServerPlayerGameMode level
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl clientInformation
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl currentTask
@@ -136,8 +140,10 @@ 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.MobEffect$AttributeTemplate <init>(Lnet/minecraft/resources/Identifier;DLnet/minecraft/world/entity/ai/attributes/AttributeModifier$Operation;)V
public net.minecraft.world.effect.MobEffectInstance hiddenEffect
public net.minecraft.world.effect.MobEffectInstance isShorterDurationThan(Lnet/minecraft/world/effect/MobEffectInstance;)Z
public net.minecraft.world.entity.AgeableMob setAgeLocked(Z)V
public net.minecraft.world.entity.AreaEffectCloud durationOnUse
public net.minecraft.world.entity.AreaEffectCloud owner
public net.minecraft.world.entity.AreaEffectCloud potionContents
@@ -218,6 +224,7 @@ public net.minecraft.world.entity.Interaction setHeight(F)V
public net.minecraft.world.entity.Interaction setResponse(Z)V
public net.minecraft.world.entity.Interaction setWidth(F)V
public net.minecraft.world.entity.Interaction$PlayerAction
public net.minecraft.world.entity.Interaction$PlayerAction <init>(Ljava/util/UUID;J)V
public net.minecraft.world.entity.ItemBasedSteering boostTime
public net.minecraft.world.entity.ItemBasedSteering boostTimeTotal()I
public net.minecraft.world.entity.ItemBasedSteering boosting
@@ -249,6 +256,7 @@ public net.minecraft.world.entity.Mob getAmbientSound()Lnet/minecraft/sounds/Sou
public net.minecraft.world.entity.Mob isSunBurnTick()Z
public net.minecraft.world.entity.Mob lootTable
public net.minecraft.world.entity.Mob lootTableSeed
public net.minecraft.world.entity.Mob persistenceRequired
public net.minecraft.world.entity.OminousItemSpawner setItem(Lnet/minecraft/world/item/ItemStack;)V
public net.minecraft.world.entity.OminousItemSpawner spawnItemAfterTicks
public net.minecraft.world.entity.ai.attributes.Attribute sentiment
@@ -276,6 +284,10 @@ public net.minecraft.world.entity.animal.bee.Bee setRolling(Z)V
public net.minecraft.world.entity.animal.bee.Bee stayOutOfHiveCountdown
public net.minecraft.world.entity.animal.bee.Bee ticksWithoutNectarSinceExitingHive
public net.minecraft.world.entity.animal.bee.Bee timeSinceSting
public net.minecraft.world.entity.animal.chicken.Chicken getSoundVariant()Lnet/minecraft/core/Holder;
public net.minecraft.world.entity.animal.chicken.Chicken setSoundVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.cow.Cow getSoundVariant()Lnet/minecraft/core/Holder;
public net.minecraft.world.entity.animal.cow.Cow setSoundVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.cow.MushroomCow setVariant(Lnet/minecraft/world/entity/animal/cow/MushroomCow$Variant;)V
public net.minecraft.world.entity.animal.cow.MushroomCow stewEffects
public net.minecraft.world.entity.animal.dolphin.Dolphin treasurePos
@@ -285,9 +297,11 @@ public net.minecraft.world.entity.animal.equine.AbstractHorse owner
public net.minecraft.world.entity.animal.equine.Horse setVariantAndMarkings(Lnet/minecraft/world/entity/animal/equine/Variant;Lnet/minecraft/world/entity/animal/equine/Markings;)V
public net.minecraft.world.entity.animal.equine.Llama setVariant(Lnet/minecraft/world/entity/animal/equine/Llama$Variant;)V
public net.minecraft.world.entity.animal.equine.SkeletonHorse trapTime
public net.minecraft.world.entity.animal.feline.Cat getSoundVariant()Lnet/minecraft/core/Holder;
public net.minecraft.world.entity.animal.feline.Cat isRelaxStateOne()Z
public net.minecraft.world.entity.animal.feline.Cat setCollarColor(Lnet/minecraft/world/item/DyeColor;)V
public net.minecraft.world.entity.animal.feline.Cat setRelaxStateOne(Z)V
public net.minecraft.world.entity.animal.feline.Cat setSoundVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.feline.Cat setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.feline.Ocelot isTrusting()Z
public net.minecraft.world.entity.animal.feline.Ocelot setTrusting(Z)V
@@ -311,6 +325,8 @@ public net.minecraft.world.entity.animal.nautilus.AbstractNautilus inventory
public net.minecraft.world.entity.animal.panda.Panda getEatCounter()I
public net.minecraft.world.entity.animal.panda.Panda setEatCounter(I)V
public net.minecraft.world.entity.animal.parrot.Parrot setVariant(Lnet/minecraft/world/entity/animal/parrot/Parrot$Variant;)V
public net.minecraft.world.entity.animal.pig.Pig getSoundVariant()Lnet/minecraft/core/Holder;
public net.minecraft.world.entity.animal.pig.Pig setSoundVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.pig.Pig setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.pig.Pig steering
public net.minecraft.world.entity.animal.rabbit.Rabbit moreCarrotTicks
@@ -534,20 +550,21 @@ public net.minecraft.world.inventory.Slot slot
public net.minecraft.world.item.AdventureModePredicate predicates
public net.minecraft.world.item.BucketItem content
public net.minecraft.world.item.CrossbowItem FIREWORK_POWER
public net.minecraft.world.item.DebugStickItem handleInteraction(Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;ZLnet/minecraft/world/item/ItemStack;)Z
public net.minecraft.world.item.DebugStickItem handleInteraction(Lnet/minecraft/server/level/ServerPlayer;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;ZLnet/minecraft/world/item/ItemStack;)Z
public net.minecraft.world.item.ItemCooldowns cooldowns
public net.minecraft.world.item.ItemCooldowns tickCount
public net.minecraft.world.item.ItemCooldowns$CooldownInstance
public net.minecraft.world.item.ItemCooldowns$CooldownInstance <init>(II)V
public net.minecraft.world.item.ItemStackLinkedSet TYPE_AND_TAG
public net.minecraft.world.item.JukeboxSongPlayer song
public net.minecraft.world.item.MapItem createNewSavedData(Lnet/minecraft/server/level/ServerLevel;IIIZZLnet/minecraft/resources/ResourceKey;)Lnet/minecraft/world/level/saveddata/maps/MapId;
public net.minecraft.world.item.StandingAndWallBlockItem wallBlock
public net.minecraft.world.item.component.BundleContents$Mutable getMaxAmountToAdd(Lnet/minecraft/world/item/ItemStack;)I
public net.minecraft.world.item.component.ItemContainerContents MAX_SIZE
public net.minecraft.world.item.component.ItemContainerContents items
public net.minecraft.world.item.component.ResolvableProfile unpack()Lcom/mojang/datafixers/util/Either;
public net.minecraft.world.item.component.ResolvableProfile$Dynamic <init>(Lcom/mojang/datafixers/util/Either;Lnet/minecraft/world/entity/player/PlayerSkin$Patch;)V
public net.minecraft.world.item.component.ResolvableProfile$Partial
public net.minecraft.world.item.component.ResolvableProfile$Partial <init>(Ljava/util/Optional;Ljava/util/Optional;Lcom/mojang/authlib/properties/PropertyMap;)V
public net.minecraft.world.item.component.ResolvableProfile$Partial MAP_CODEC
public net.minecraft.world.item.component.ResolvableProfile$Static <init>(Lcom/mojang/datafixers/util/Either;Lnet/minecraft/world/entity/player/PlayerSkin$Patch;)V
public net.minecraft.world.item.context.UseOnContext <init>(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/InteractionHand;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/phys/BlockHitResult;)V
@@ -584,6 +601,7 @@ public net.minecraft.world.level.TicketStorage tickets
public net.minecraft.world.level.biome.Biome climateSettings
public net.minecraft.world.level.biome.Biome getTemperature(Lnet/minecraft/core/BlockPos;I)F
public net.minecraft.world.level.biome.Biome$ClimateSettings
public net.minecraft.world.level.biome.Biome$ClimateSettings <init>(ZFLnet/minecraft/world/level/biome/Biome$TemperatureModifier;F)V
public net.minecraft.world.level.block.Block popExperience(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;I)V
public net.minecraft.world.level.block.ChestBlock isBlockedChestByBlock(Lnet/minecraft/world/level/BlockGetter;Lnet/minecraft/core/BlockPos;)Z
public net.minecraft.world.level.block.ComposterBlock$EmptyContainer
@@ -699,20 +717,20 @@ public net.minecraft.world.level.chunk.status.ChunkStatusTasks postLoadProtoChun
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
public net.minecraft.world.level.dimension.end.EndDragonFight GATEWAY_COUNT
public net.minecraft.world.level.dimension.end.EndDragonFight dragonEvent
public net.minecraft.world.level.dimension.end.EndDragonFight dragonUUID
public net.minecraft.world.level.dimension.end.EndDragonFight findExitPortal()Lnet/minecraft/world/level/block/state/pattern/BlockPattern$BlockPatternMatch;
public net.minecraft.world.level.dimension.end.EndDragonFight gateways
public net.minecraft.world.level.dimension.end.EndDragonFight level
public net.minecraft.world.level.dimension.end.EndDragonFight portalLocation
public net.minecraft.world.level.dimension.end.EndDragonFight previouslyKilled
public net.minecraft.world.level.dimension.end.EndDragonFight respawnCrystals
public net.minecraft.world.level.dimension.end.EndDragonFight respawnDragon(Ljava/util/List;)V
public net.minecraft.world.level.dimension.end.EndDragonFight respawnStage
public net.minecraft.world.level.dimension.end.EndDragonFight setRespawnStage(Lnet/minecraft/world/level/dimension/end/DragonRespawnAnimation;)V
public net.minecraft.world.level.dimension.end.EndDragonFight spawnExitPortal(Z)V
public net.minecraft.world.level.dimension.end.EndDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V
public net.minecraft.world.level.dimension.end.EnderDragonFight GATEWAY_COUNT
public net.minecraft.world.level.dimension.end.EnderDragonFight dragonEvent
public net.minecraft.world.level.dimension.end.EnderDragonFight dragonUUID
public net.minecraft.world.level.dimension.end.EnderDragonFight exitPortalLocation
public net.minecraft.world.level.dimension.end.EnderDragonFight findExitPortal()Lnet/minecraft/world/level/block/state/pattern/BlockPattern$BlockPatternMatch;
public net.minecraft.world.level.dimension.end.EnderDragonFight gateways
public net.minecraft.world.level.dimension.end.EnderDragonFight hasPreviouslyKilledDragon
public net.minecraft.world.level.dimension.end.EnderDragonFight level
public net.minecraft.world.level.dimension.end.EnderDragonFight respawnCrystals
public net.minecraft.world.level.dimension.end.EnderDragonFight respawnDragon(Ljava/util/List;)V
public net.minecraft.world.level.dimension.end.EnderDragonFight respawnStage
public net.minecraft.world.level.dimension.end.EnderDragonFight setRespawnStage(Lnet/minecraft/world/level/dimension/end/DragonRespawnStage;)V
public net.minecraft.world.level.dimension.end.EnderDragonFight spawnExitPortal(Z)V
public net.minecraft.world.level.dimension.end.EnderDragonFight spawnNewGateway(Lnet/minecraft/core/BlockPos;)V
public net.minecraft.world.level.entity.PersistentEntitySectionManager ensureChunkQueuedForLoad(J)V
public net.minecraft.world.level.entity.PersistentEntitySectionManager permanentStorage
public net.minecraft.world.level.gamerules.GameRules rules
@@ -728,6 +746,7 @@ public net.minecraft.world.level.levelgen.SurfaceRules$LazyCondition
public net.minecraft.world.level.levelgen.SurfaceRules$LazyYCondition
public net.minecraft.world.level.levelgen.SurfaceRules$SurfaceRule
public net.minecraft.world.level.levelgen.SurfaceRules$VerticalGradientConditionSource
public net.minecraft.world.level.levelgen.SurfaceRules$VerticalGradientConditionSource <init>(Lnet/minecraft/resources/Identifier;Lnet/minecraft/world/level/levelgen/VerticalAnchor;Lnet/minecraft/world/level/levelgen/VerticalAnchor;)V
public net.minecraft.world.level.levelgen.structure.StructurePiece SHAPE_CHECK_BLOCKS
public net.minecraft.world.level.levelgen.structure.placement.StructurePlacement exclusionZone
public net.minecraft.world.level.levelgen.structure.placement.StructurePlacement frequency
@@ -736,10 +755,11 @@ public net.minecraft.world.level.levelgen.structure.placement.StructurePlacement
public net.minecraft.world.level.levelgen.structure.placement.StructurePlacement salt
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate entityInfoList
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate palettes
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager loadFromGenerated(Lnet/minecraft/resources/Identifier;)Ljava/util/Optional;
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager loadFromResource(Lnet/minecraft/resources/Identifier;)Ljava/util/Optional;
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager readStructure(Ljava/io/InputStream;)Lnet/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate;
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager resourceManagerSource
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager structureRepository
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager tryLoad(Lnet/minecraft/resources/Identifier;)Ljava/util/Optional;
public net.minecraft.world.level.levelgen.structure.templatesystem.loader.TemplateSource readStructure(Ljava/io/InputStream;)Lnet/minecraft/nbt/CompoundTag;
public net.minecraft.world.level.levelgen.structure.templatesystem.loader.TemplateSource readStructure(Lnet/minecraft/nbt/CompoundTag;)Lnet/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate;
public net.minecraft.world.level.material.MapColor MATERIAL_COLORS
public net.minecraft.world.level.pathfinder.Path nodes
public net.minecraft.world.level.pathfinder.PathFinder nodeEvaluator
@@ -748,10 +768,10 @@ public net.minecraft.world.level.saveddata.maps.MapItemSavedData carriedByPlayer
public net.minecraft.world.level.saveddata.maps.MapItemSavedData decorations
public net.minecraft.world.level.saveddata.maps.MapItemSavedData setColorsDirty(II)V
public net.minecraft.world.level.saveddata.maps.MapItemSavedData setDecorationsDirty()V
public net.minecraft.world.level.storage.DimensionDataStorage cache
public net.minecraft.world.level.storage.LevelStorageSource baseDir
public net.minecraft.world.level.storage.LevelStorageSource$LevelStorageAccess levelDirectory
public net.minecraft.world.level.storage.PrimaryLevelData settings
public net.minecraft.world.level.storage.SavedDataStorage cache
public net.minecraft.world.level.storage.TagValueInput input
public net.minecraft.world.scores.Objective displayName
public net.minecraft.world.scores.criteria.ObjectiveCriteria CRITERIA_CACHE
@@ -778,8 +798,6 @@ public-f net.minecraft.world.item.trading.MerchantOffer maxUses
public-f net.minecraft.world.item.trading.MerchantOffer priceMultiplier
public-f net.minecraft.world.item.trading.MerchantOffer rewardExp
public-f net.minecraft.world.item.trading.MerchantOffer xp
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.saveddata.maps.MapItemSavedData centerX
+5 -5
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.19" apply false
id("io.papermc.paperweight.core") version "2.0.0-SNAPSHOT" apply false
}
subprojects {
@@ -11,7 +11,7 @@ subprojects {
extensions.configure<JavaPluginExtension> {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(25)
}
}
}
@@ -21,7 +21,7 @@ val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile>().configureEach {
options.encoding = Charsets.UTF_8.name()
options.release = 21
options.release = 25
options.isFork = true
options.compilerArgs.addAll(listOf("-Xlint:-deprecation", "-Xlint:-removal"))
}
@@ -46,8 +46,8 @@ subprojects {
extensions.configure<PublishingExtension> {
repositories {
maven("https://artifactory.papermc.io/artifactory/snapshots/") {
name = "paperSnapshots"
maven("https://artifactory.papermc.io/artifactory/releases/") {
name = "paperReleases"
credentials(PasswordCredentials::class)
}
}
+3 -3
View File
@@ -1,9 +1,9 @@
group=io.papermc.paper
version=1.21.11-R0.1-SNAPSHOT
mcVersion=1.21.11
mcVersion=26.1.2
# This is the current API version for use in (paper-)plugin.yml files
# During snapshot cycles this should be the anticipated version of the release target
apiVersion=1.21.11
apiVersion=26.1.2
channel=ALPHA
# Set to true while updating Minecraft version
updatingMinecraft=false
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+1 -1
View File
@@ -57,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
+15 -14
View File
@@ -12,10 +12,10 @@ java {
}
val annotationsVersion = "26.0.2"
val adventureVersion = "4.25.0"
val adventureVersion = "4.26.1"
val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
val slf4jVersion = "2.0.16"
val log4jVersion = "2.24.1"
val slf4jVersion = "2.0.17"
val log4jVersion = "2.25.2"
val apiAndDocs: Configuration by configurations.creating {
attributes {
@@ -42,13 +42,13 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
dependencies {
// api dependencies are listed transitively to API consumers
api("com.google.guava:guava:33.3.1-jre")
api("com.google.code.gson:gson:2.11.0")
api("com.google.guava:guava:33.5.0-jre")
api("com.google.code.gson:gson:2.13.2")
api("org.yaml:snakeyaml:2.2")
api("org.joml:joml:1.10.8") {
isTransitive = false // https://github.com/JOML-CI/JOML/issues/352
}
api("it.unimi.dsi:fastutil:8.5.15")
api("it.unimi.dsi:fastutil:8.5.18")
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
api("org.slf4j:slf4j-api:$slf4jVersion")
api("com.mojang:brigadier:1.3.10")
@@ -82,13 +82,13 @@ dependencies {
api("org.jspecify:jspecify:1.0.0")
// Test dependencies
testImplementation("org.apache.commons:commons-lang3:3.17.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
testImplementation("org.apache.commons:commons-lang3:3.20.0")
testImplementation("org.junit.jupiter:junit-jupiter:6.0.3")
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.14.1")
testImplementation("org.ow2.asm:asm-tree:9.8")
mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // configure mockito agent that is needed in newer java versions
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testImplementation("org.mockito:mockito-core:5.22.0")
testImplementation("org.ow2.asm:asm-tree:9.9.1")
mockitoAgent("org.mockito:mockito-core:5.22.0") { isTransitive = false } // configure mockito agent that is needed in newer java versions
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.0.3")
}
val generatedDir: java.nio.file.Path = layout.projectDirectory.dir("src/generated/java").asFile.toPath()
@@ -187,11 +187,11 @@ tasks.withType<Javadoc>().configureEach {
options.use()
options.isDocFilesSubDirs = true
options.links(
"https://guava.dev/releases/33.3.1-jre/api/docs/",
"https://guava.dev/releases/33.5.0-jre/api/docs/",
"https://www.javadocs.dev/org.yaml/snakeyaml/2.2/",
"https://www.javadocs.dev/org.jetbrains/annotations/$annotationsVersion/",
"https://www.javadocs.dev/org.joml/joml/1.10.8/",
"https://www.javadocs.dev/com.google.code.gson/gson/2.11.0",
"https://www.javadocs.dev/com.google.code.gson/gson/2.13.2",
"https://jspecify.dev/docs/api/",
"https://jd.advntr.dev/api/$adventureVersion/",
"https://jd.advntr.dev/key/$adventureVersion/",
@@ -205,6 +205,7 @@ tasks.withType<Javadoc>().configureEach {
"https://www.javadocs.dev/org.apache.maven.resolver/maven-resolver-api/1.7.3",
)
options.tags("apiNote:a:API Note:")
options.tags("implNote:a:Implementation Note:")
inputs.files(apiAndDocs).ignoreEmptyDirectories().withPropertyName(apiAndDocs.name + "-configuration")
val apiAndDocsElements = apiAndDocs.elements
@@ -130,7 +130,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Creature> FLEE_SUN = create("flee_sun", Creature.class);
GoalKey<Creature> FOLLOW_BOAT = create("follow_boat", Creature.class);
GoalKey<Creature> FOLLOW_PLAYER_RIDDEN_ENTITY = create("follow_player_ridden_entity", Creature.class);
GoalKey<Creature> GOLEM_RANDOM_STROLL_IN_VILLAGE = create("golem_random_stroll_in_village", Creature.class);
@@ -2937,6 +2937,13 @@ public final class BlockTypeKeys {
*/
public static final TypedKey<BlockType> GOLD_ORE = create(key("gold_ore"));
/**
* {@code minecraft:golden_dandelion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<BlockType> GOLDEN_DANDELION = create(key("golden_dandelion"));
/**
* {@code minecraft:granite}
*
@@ -5513,6 +5520,13 @@ public final class BlockTypeKeys {
*/
public static final TypedKey<BlockType> POTTED_FLOWERING_AZALEA_BUSH = create(key("potted_flowering_azalea_bush"));
/**
* {@code minecraft:potted_golden_dandelion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<BlockType> POTTED_GOLDEN_DANDELION = create(key("potted_golden_dandelion"));
/**
* {@code minecraft:potted_jungle_sapling}
*
@@ -0,0 +1,54 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Cat;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#CAT_SOUND_VARIANT}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedClass
public final class CatSoundVariantKeys {
/**
* {@code minecraft:classic}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.SoundVariant> CLASSIC = create(key("classic"));
/**
* {@code minecraft:royal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.SoundVariant> ROYAL = create(key("royal"));
private CatSoundVariantKeys() {
}
/**
* Creates a typed key for {@link Cat.SoundVariant} in the registry {@code minecraft:cat_sound_variant}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
public static TypedKey<Cat.SoundVariant> create(final Key key) {
return TypedKey.create(RegistryKey.CAT_SOUND_VARIANT, key);
}
}
@@ -0,0 +1,54 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Chicken;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#CHICKEN_SOUND_VARIANT}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedClass
public final class ChickenSoundVariantKeys {
/**
* {@code minecraft:classic}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Chicken.SoundVariant> CLASSIC = create(key("classic"));
/**
* {@code minecraft:picky}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Chicken.SoundVariant> PICKY = create(key("picky"));
private ChickenSoundVariantKeys() {
}
/**
* Creates a typed key for {@link Chicken.SoundVariant} in the registry {@code minecraft:chicken_sound_variant}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
public static TypedKey<Chicken.SoundVariant> create(final Key key) {
return TypedKey.create(RegistryKey.CHICKEN_SOUND_VARIANT, key);
}
}
@@ -0,0 +1,54 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Cow;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#COW_SOUND_VARIANT}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedClass
public final class CowSoundVariantKeys {
/**
* {@code minecraft:classic}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cow.SoundVariant> CLASSIC = create(key("classic"));
/**
* {@code minecraft:moody}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cow.SoundVariant> MOODY = create(key("moody"));
private CowSoundVariantKeys() {
}
/**
* Creates a typed key for {@link Cow.SoundVariant} in the registry {@code minecraft:cow_sound_variant}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
public static TypedKey<Cow.SoundVariant> create(final Key key) {
return TypedKey.create(RegistryKey.COW_SOUND_VARIANT, key);
}
}
@@ -25,6 +25,13 @@ import org.jspecify.annotations.NullMarked;
@NullMarked
@GeneratedClass
public final class DataComponentTypeKeys {
/**
* {@code minecraft:additional_trade_cost}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> ADDITIONAL_TRADE_COST = create(key("additional_trade_cost"));
/**
* {@code minecraft:attack_range}
*
@@ -130,6 +137,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> CAT_COLLAR = create(key("cat/collar"));
/**
* {@code minecraft:cat/sound_variant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> CAT_SOUND_VARIANT = create(key("cat/sound_variant"));
/**
* {@code minecraft:cat/variant}
*
@@ -144,6 +158,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> CHARGED_PROJECTILES = create(key("charged_projectiles"));
/**
* {@code minecraft:chicken/sound_variant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> CHICKEN_SOUND_VARIANT = create(key("chicken/sound_variant"));
/**
* {@code minecraft:chicken/variant}
*
@@ -172,6 +193,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> CONTAINER_LOOT = create(key("container_loot"));
/**
* {@code minecraft:cow/sound_variant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> COW_SOUND_VARIANT = create(key("cow/sound_variant"));
/**
* {@code minecraft:cow/variant}
*
@@ -242,6 +270,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> DEBUG_STICK_STATE = create(key("debug_stick_state"));
/**
* {@code minecraft:dye}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> DYE = create(key("dye"));
/**
* {@code minecraft:dyed_color}
*
@@ -494,6 +529,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> PIERCING_WEAPON = create(key("piercing_weapon"));
/**
* {@code minecraft:pig/sound_variant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> PIG_SOUND_VARIANT = create(key("pig/sound_variant"));
/**
* {@code minecraft:pig/variant}
*
@@ -3959,6 +3959,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> GOLDEN_CHESTPLATE = create(key("golden_chestplate"));
/**
* {@code minecraft:golden_dandelion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOLDEN_DANDELION = create(key("golden_dandelion"));
/**
* {@code minecraft:golden_helmet}
*
@@ -0,0 +1,61 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Pig;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#PIG_SOUND_VARIANT}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedClass
public final class PigSoundVariantKeys {
/**
* {@code minecraft:big}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Pig.SoundVariant> BIG = create(key("big"));
/**
* {@code minecraft:classic}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Pig.SoundVariant> CLASSIC = create(key("classic"));
/**
* {@code minecraft:mini}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Pig.SoundVariant> MINI = create(key("mini"));
private PigSoundVariantKeys() {
}
/**
* Creates a typed key for {@link Pig.SoundVariant} in the registry {@code minecraft:pig_sound_variant}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
public static TypedKey<Pig.SoundVariant> create(final Key key) {
return TypedKey.create(RegistryKey.PIG_SOUND_VARIANT, key);
}
}
@@ -0,0 +1,181 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.entity.poi.PoiType;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#POINT_OF_INTEREST_TYPE}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedClass
public final class PoiTypeKeys {
/**
* {@code minecraft:armorer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> ARMORER = create(key("armorer"));
/**
* {@code minecraft:bee_nest}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> BEE_NEST = create(key("bee_nest"));
/**
* {@code minecraft:beehive}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> BEEHIVE = create(key("beehive"));
/**
* {@code minecraft:butcher}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> BUTCHER = create(key("butcher"));
/**
* {@code minecraft:cartographer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> CARTOGRAPHER = create(key("cartographer"));
/**
* {@code minecraft:cleric}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> CLERIC = create(key("cleric"));
/**
* {@code minecraft:farmer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> FARMER = create(key("farmer"));
/**
* {@code minecraft:fisherman}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> FISHERMAN = create(key("fisherman"));
/**
* {@code minecraft:fletcher}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> FLETCHER = create(key("fletcher"));
/**
* {@code minecraft:home}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> HOME = create(key("home"));
/**
* {@code minecraft:leatherworker}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> LEATHERWORKER = create(key("leatherworker"));
/**
* {@code minecraft:librarian}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> LIBRARIAN = create(key("librarian"));
/**
* {@code minecraft:lightning_rod}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> LIGHTNING_ROD = create(key("lightning_rod"));
/**
* {@code minecraft:lodestone}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> LODESTONE = create(key("lodestone"));
/**
* {@code minecraft:mason}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> MASON = create(key("mason"));
/**
* {@code minecraft:meeting}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> MEETING = create(key("meeting"));
/**
* {@code minecraft:nether_portal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> NETHER_PORTAL = create(key("nether_portal"));
/**
* {@code minecraft:shepherd}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> SHEPHERD = create(key("shepherd"));
/**
* {@code minecraft:test_instance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> TEST_INSTANCE = create(key("test_instance"));
/**
* {@code minecraft:toolsmith}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> TOOLSMITH = create(key("toolsmith"));
/**
* {@code minecraft:weaponsmith}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PoiType> WEAPONSMITH = create(key("weaponsmith"));
private PoiTypeKeys() {
}
private static TypedKey<PoiType> create(final Key key) {
return TypedKey.create(RegistryKey.POINT_OF_INTEREST_TYPE, key);
}
}
@@ -3707,6 +3707,34 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_NOTE_BLOCK_SNARE = create(key("block.note_block.snare"));
/**
* {@code minecraft:block.note_block.trumpet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_NOTE_BLOCK_TRUMPET = create(key("block.note_block.trumpet"));
/**
* {@code minecraft:block.note_block.trumpet_exposed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_NOTE_BLOCK_TRUMPET_EXPOSED = create(key("block.note_block.trumpet_exposed"));
/**
* {@code minecraft:block.note_block.trumpet_oxidized}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_NOTE_BLOCK_TRUMPET_OXIDIZED = create(key("block.note_block.trumpet_oxidized"));
/**
* {@code minecraft:block.note_block.trumpet_weathered}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_NOTE_BLOCK_TRUMPET_WEATHERED = create(key("block.note_block.trumpet_weathered"));
/**
* {@code minecraft:block.note_block.xylophone}
*
@@ -6031,6 +6059,153 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_AXOLOTL_SWIM = create(key("entity.axolotl.swim"));
/**
* {@code minecraft:entity.baby_cat.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_AMBIENT = create(key("entity.baby_cat.ambient"));
/**
* {@code minecraft:entity.baby_cat.beg_for_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_BEG_FOR_FOOD = create(key("entity.baby_cat.beg_for_food"));
/**
* {@code minecraft:entity.baby_cat.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_DEATH = create(key("entity.baby_cat.death"));
/**
* {@code minecraft:entity.baby_cat.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_EAT = create(key("entity.baby_cat.eat"));
/**
* {@code minecraft:entity.baby_cat.hiss}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_HISS = create(key("entity.baby_cat.hiss"));
/**
* {@code minecraft:entity.baby_cat.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_HURT = create(key("entity.baby_cat.hurt"));
/**
* {@code minecraft:entity.baby_cat.purr}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_PURR = create(key("entity.baby_cat.purr"));
/**
* {@code minecraft:entity.baby_cat.purreow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_PURREOW = create(key("entity.baby_cat.purreow"));
/**
* {@code minecraft:entity.baby_cat.stray_ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CAT_STRAY_AMBIENT = create(key("entity.baby_cat.stray_ambient"));
/**
* {@code minecraft:entity.baby_chicken.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CHICKEN_AMBIENT = create(key("entity.baby_chicken.ambient"));
/**
* {@code minecraft:entity.baby_chicken.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CHICKEN_DEATH = create(key("entity.baby_chicken.death"));
/**
* {@code minecraft:entity.baby_chicken.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CHICKEN_HURT = create(key("entity.baby_chicken.hurt"));
/**
* {@code minecraft:entity.baby_chicken.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_CHICKEN_STEP = create(key("entity.baby_chicken.step"));
/**
* {@code minecraft:entity.baby_horse.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_AMBIENT = create(key("entity.baby_horse.ambient"));
/**
* {@code minecraft:entity.baby_horse.angry}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_ANGRY = create(key("entity.baby_horse.angry"));
/**
* {@code minecraft:entity.baby_horse.breathe}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_BREATHE = create(key("entity.baby_horse.breathe"));
/**
* {@code minecraft:entity.baby_horse.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_DEATH = create(key("entity.baby_horse.death"));
/**
* {@code minecraft:entity.baby_horse.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_EAT = create(key("entity.baby_horse.eat"));
/**
* {@code minecraft:entity.baby_horse.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_HURT = create(key("entity.baby_horse.hurt"));
/**
* {@code minecraft:entity.baby_horse.land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_LAND = create(key("entity.baby_horse.land"));
/**
* {@code minecraft:entity.baby_horse.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_HORSE_STEP = create(key("entity.baby_horse.step"));
/**
* {@code minecraft:entity.baby_nautilus.ambient}
*
@@ -6087,6 +6262,90 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_SWIM = create(key("entity.baby_nautilus.swim"));
/**
* {@code minecraft:entity.baby_pig.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_PIG_AMBIENT = create(key("entity.baby_pig.ambient"));
/**
* {@code minecraft:entity.baby_pig.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_PIG_DEATH = create(key("entity.baby_pig.death"));
/**
* {@code minecraft:entity.baby_pig.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_PIG_EAT = create(key("entity.baby_pig.eat"));
/**
* {@code minecraft:entity.baby_pig.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_PIG_HURT = create(key("entity.baby_pig.hurt"));
/**
* {@code minecraft:entity.baby_pig.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_PIG_STEP = create(key("entity.baby_pig.step"));
/**
* {@code minecraft:entity.baby_wolf.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_WOLF_AMBIENT = create(key("entity.baby_wolf.ambient"));
/**
* {@code minecraft:entity.baby_wolf.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_WOLF_DEATH = create(key("entity.baby_wolf.death"));
/**
* {@code minecraft:entity.baby_wolf.growl}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_WOLF_GROWL = create(key("entity.baby_wolf.growl"));
/**
* {@code minecraft:entity.baby_wolf.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_WOLF_HURT = create(key("entity.baby_wolf.hurt"));
/**
* {@code minecraft:entity.baby_wolf.pant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_WOLF_PANT = create(key("entity.baby_wolf.pant"));
/**
* {@code minecraft:entity.baby_wolf.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_WOLF_STEP = create(key("entity.baby_wolf.step"));
/**
* {@code minecraft:entity.baby_wolf.whine}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_WOLF_WHINE = create(key("entity.baby_wolf.whine"));
/**
* {@code minecraft:entity.bat.ambient}
*
@@ -6556,6 +6815,69 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_CAT_STRAY_AMBIENT = create(key("entity.cat.stray_ambient"));
/**
* {@code minecraft:entity.cat_royal.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_AMBIENT = create(key("entity.cat_royal.ambient"));
/**
* {@code minecraft:entity.cat_royal.beg_for_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_BEG_FOR_FOOD = create(key("entity.cat_royal.beg_for_food"));
/**
* {@code minecraft:entity.cat_royal.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_DEATH = create(key("entity.cat_royal.death"));
/**
* {@code minecraft:entity.cat_royal.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_EAT = create(key("entity.cat_royal.eat"));
/**
* {@code minecraft:entity.cat_royal.hiss}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_HISS = create(key("entity.cat_royal.hiss"));
/**
* {@code minecraft:entity.cat_royal.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_HURT = create(key("entity.cat_royal.hurt"));
/**
* {@code minecraft:entity.cat_royal.purr}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_PURR = create(key("entity.cat_royal.purr"));
/**
* {@code minecraft:entity.cat_royal.purreow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_PURREOW = create(key("entity.cat_royal.purreow"));
/**
* {@code minecraft:entity.cat_royal.stray_ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAT_ROYAL_STRAY_AMBIENT = create(key("entity.cat_royal.stray_ambient"));
/**
* {@code minecraft:entity.chicken.ambient}
*
@@ -6591,6 +6913,27 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_CHICKEN_STEP = create(key("entity.chicken.step"));
/**
* {@code minecraft:entity.chicken_picky.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CHICKEN_PICKY_AMBIENT = create(key("entity.chicken_picky.ambient"));
/**
* {@code minecraft:entity.chicken_picky.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CHICKEN_PICKY_DEATH = create(key("entity.chicken_picky.death"));
/**
* {@code minecraft:entity.chicken_picky.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CHICKEN_PICKY_HURT = create(key("entity.chicken_picky.hurt"));
/**
* {@code minecraft:entity.cod.ambient}
*
@@ -6787,6 +7130,34 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_COW_STEP = create(key("entity.cow.step"));
/**
* {@code minecraft:entity.cow_moody.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_COW_MOODY_AMBIENT = create(key("entity.cow_moody.ambient"));
/**
* {@code minecraft:entity.cow_moody.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_COW_MOODY_DEATH = create(key("entity.cow_moody.death"));
/**
* {@code minecraft:entity.cow_moody.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_COW_MOODY_HURT = create(key("entity.cow_moody.hurt"));
/**
* {@code minecraft:entity.cow_moody.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_COW_MOODY_STEP = create(key("entity.cow_moody.step"));
/**
* {@code minecraft:entity.creaking.activate}
*
@@ -9223,6 +9594,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_PIG_DEATH = create(key("entity.pig.death"));
/**
* {@code minecraft:entity.pig.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_EAT = create(key("entity.pig.eat"));
/**
* {@code minecraft:entity.pig.hurt}
*
@@ -9244,6 +9622,62 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_PIG_STEP = create(key("entity.pig.step"));
/**
* {@code minecraft:entity.pig_big.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_BIG_AMBIENT = create(key("entity.pig_big.ambient"));
/**
* {@code minecraft:entity.pig_big.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_BIG_DEATH = create(key("entity.pig_big.death"));
/**
* {@code minecraft:entity.pig_big.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_BIG_EAT = create(key("entity.pig_big.eat"));
/**
* {@code minecraft:entity.pig_big.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_BIG_HURT = create(key("entity.pig_big.hurt"));
/**
* {@code minecraft:entity.pig_mini.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_MINI_AMBIENT = create(key("entity.pig_mini.ambient"));
/**
* {@code minecraft:entity.pig_mini.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_MINI_DEATH = create(key("entity.pig_mini.death"));
/**
* {@code minecraft:entity.pig_mini.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_MINI_EAT = create(key("entity.pig_mini.eat"));
/**
* {@code minecraft:entity.pig_mini.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PIG_MINI_HURT = create(key("entity.pig_mini.hurt"));
/**
* {@code minecraft:entity.piglin.admiring_item}
*
@@ -12107,6 +12541,20 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_GOAT_HORN_SOUND_7 = create(key("item.goat_horn.sound.7"));
/**
* {@code minecraft:item.golden_dandelion.unuse}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_GOLDEN_DANDELION_UNUSE = create(key("item.golden_dandelion.unuse"));
/**
* {@code minecraft:item.golden_dandelion.use}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_GOLDEN_DANDELION_USE = create(key("item.golden_dandelion.use"));
/**
* {@code minecraft:item.hoe.till}
*
@@ -116,13 +116,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> BAMBOO_BLOCKS = create(key("bamboo_blocks"));
/**
* {@code #minecraft:bamboo_plantable_on}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> BAMBOO_PLANTABLE_ON = create(key("bamboo_plantable_on"));
/**
* {@code #minecraft:banners}
*
@@ -194,11 +187,18 @@ public final class BlockTypeTagKeys {
public static final TagKey<BlockType> BEEHIVES = create(key("beehives"));
/**
* {@code #minecraft:big_dripleaf_placeable}
* {@code #minecraft:beneath_bamboo_podzol_replaceable}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> BIG_DRIPLEAF_PLACEABLE = create(key("big_dripleaf_placeable"));
public static final TagKey<BlockType> BENEATH_BAMBOO_PODZOL_REPLACEABLE = create(key("beneath_bamboo_podzol_replaceable"));
/**
* {@code #minecraft:beneath_tree_podzol_replaceable}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> BENEATH_TREE_PODZOL_REPLACEABLE = create(key("beneath_tree_podzol_replaceable"));
/**
* {@code #minecraft:birch_logs}
@@ -263,6 +263,34 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> CANDLES = create(key("candles"));
/**
* {@code #minecraft:cannot_replace_below_tree_trunk}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> CANNOT_REPLACE_BELOW_TREE_TRUNK = create(key("cannot_replace_below_tree_trunk"));
/**
* {@code #minecraft:cannot_support_kelp}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> CANNOT_SUPPORT_KELP = create(key("cannot_support_kelp"));
/**
* {@code #minecraft:cannot_support_seagrass}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> CANNOT_SUPPORT_SEAGRASS = create(key("cannot_support_seagrass"));
/**
* {@code #minecraft:cannot_support_snow_layer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> CANNOT_SUPPORT_SNOW_LAYER = create(key("cannot_support_snow_layer"));
/**
* {@code #minecraft:cauldrons}
*
@@ -480,13 +508,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> DRIPSTONE_REPLACEABLE_BLOCKS = create(key("dripstone_replaceable_blocks"));
/**
* {@code #minecraft:dry_vegetation_may_place_on}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> DRY_VEGETATION_MAY_PLACE_ON = create(key("dry_vegetation_may_place_on"));
/**
* {@code #minecraft:edible_for_sheep}
*
@@ -501,6 +522,20 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> EMERALD_ORES = create(key("emerald_ores"));
/**
* {@code #minecraft:enables_bubble_column_drag_down}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> ENABLES_BUBBLE_COLUMN_DRAG_DOWN = create(key("enables_bubble_column_drag_down"));
/**
* {@code #minecraft:enables_bubble_column_push_up}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> ENABLES_BUBBLE_COLUMN_PUSH_UP = create(key("enables_bubble_column_push_up"));
/**
* {@code #minecraft:enchantment_power_provider}
*
@@ -571,6 +606,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> FLOWERS = create(key("flowers"));
/**
* {@code #minecraft:forest_rock_can_place_on}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> FOREST_ROCK_CAN_PLACE_ON = create(key("forest_rock_can_place_on"));
/**
* {@code #minecraft:foxes_spawnable_on}
*
@@ -613,6 +655,20 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> GOLD_ORES = create(key("gold_ores"));
/**
* {@code #minecraft:grass_blocks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> GRASS_BLOCKS = create(key("grass_blocks"));
/**
* {@code #minecraft:grows_crops}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> GROWS_CROPS = create(key("grows_crops"));
/**
* {@code #minecraft:guarded_by_piglins}
*
@@ -634,6 +690,20 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> HOGLIN_REPELLENTS = create(key("hoglin_repellents"));
/**
* {@code #minecraft:huge_brown_mushroom_can_place_on}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> HUGE_BROWN_MUSHROOM_CAN_PLACE_ON = create(key("huge_brown_mushroom_can_place_on"));
/**
* {@code #minecraft:huge_red_mushroom_can_place_on}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> HUGE_RED_MUSHROOM_CAN_PLACE_ON = create(key("huge_red_mushroom_can_place_on"));
/**
* {@code #minecraft:ice}
*
@@ -641,6 +711,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> ICE = create(key("ice"));
/**
* {@code #minecraft:ice_spike_replaceable}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> ICE_SPIKE_REPLACEABLE = create(key("ice_spike_replaceable"));
/**
* {@code #minecraft:impermeable}
*
@@ -872,6 +949,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> MOOSHROOMS_SPAWNABLE_ON = create(key("mooshrooms_spawnable_on"));
/**
* {@code #minecraft:moss_blocks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> MOSS_BLOCKS = create(key("moss_blocks"));
/**
* {@code #minecraft:moss_replaceable}
*
@@ -880,11 +964,11 @@ public final class BlockTypeTagKeys {
public static final TagKey<BlockType> MOSS_REPLACEABLE = create(key("moss_replaceable"));
/**
* {@code #minecraft:mushroom_grow_block}
* {@code #minecraft:mud}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> MUSHROOM_GROW_BLOCK = create(key("mushroom_grow_block"));
public static final TagKey<BlockType> MUD = create(key("mud"));
/**
* {@code #minecraft:needs_diamond_tool}
@@ -935,6 +1019,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> OCCLUDES_VIBRATION_SIGNALS = create(key("occludes_vibration_signals"));
/**
* {@code #minecraft:overrides_mushroom_light_requirement}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> OVERRIDES_MUSHROOM_LIGHT_REQUIREMENT = create(key("overrides_mushroom_light_requirement"));
/**
* {@code #minecraft:overworld_carver_replaceables}
*
@@ -1005,6 +1096,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> PREVENT_MOB_SPAWNING_INSIDE = create(key("prevent_mob_spawning_inside"));
/**
* {@code #minecraft:prevents_nearby_leaf_decay}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> PREVENTS_NEARBY_LEAF_DECAY = create(key("prevents_nearby_leaf_decay"));
/**
* {@code #minecraft:rabbits_spawnable_on}
*
@@ -1096,13 +1194,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> SLABS = create(key("slabs"));
/**
* {@code #minecraft:small_dripleaf_placeable}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SMALL_DRIPLEAF_PLACEABLE = create(key("small_dripleaf_placeable"));
/**
* {@code #minecraft:small_flowers}
*
@@ -1145,20 +1236,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> SNOW = create(key("snow"));
/**
* {@code #minecraft:snow_layer_can_survive_on}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SNOW_LAYER_CAN_SURVIVE_ON = create(key("snow_layer_can_survive_on"));
/**
* {@code #minecraft:snow_layer_cannot_survive_on}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SNOW_LAYER_CANNOT_SURVIVE_ON = create(key("snow_layer_cannot_survive_on"));
/**
* {@code #minecraft:soul_fire_base_blocks}
*
@@ -1229,6 +1306,237 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> STRIDER_WARM_BLOCKS = create(key("strider_warm_blocks"));
/**
* {@code #minecraft:substrate_overworld}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUBSTRATE_OVERWORLD = create(key("substrate_overworld"));
/**
* {@code #minecraft:support_override_cactus_flower}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORT_OVERRIDE_CACTUS_FLOWER = create(key("support_override_cactus_flower"));
/**
* {@code #minecraft:support_override_snow_layer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORT_OVERRIDE_SNOW_LAYER = create(key("support_override_snow_layer"));
/**
* {@code #minecraft:supports_azalea}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_AZALEA = create(key("supports_azalea"));
/**
* {@code #minecraft:supports_bamboo}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_BAMBOO = create(key("supports_bamboo"));
/**
* {@code #minecraft:supports_big_dripleaf}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_BIG_DRIPLEAF = create(key("supports_big_dripleaf"));
/**
* {@code #minecraft:supports_cactus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_CACTUS = create(key("supports_cactus"));
/**
* {@code #minecraft:supports_chorus_flower}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_CHORUS_FLOWER = create(key("supports_chorus_flower"));
/**
* {@code #minecraft:supports_chorus_plant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_CHORUS_PLANT = create(key("supports_chorus_plant"));
/**
* {@code #minecraft:supports_cocoa}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_COCOA = create(key("supports_cocoa"));
/**
* {@code #minecraft:supports_crimson_fungus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_CRIMSON_FUNGUS = create(key("supports_crimson_fungus"));
/**
* {@code #minecraft:supports_crimson_roots}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_CRIMSON_ROOTS = create(key("supports_crimson_roots"));
/**
* {@code #minecraft:supports_crops}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_CROPS = create(key("supports_crops"));
/**
* {@code #minecraft:supports_dry_vegetation}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_DRY_VEGETATION = create(key("supports_dry_vegetation"));
/**
* {@code #minecraft:supports_frogspawn}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_FROGSPAWN = create(key("supports_frogspawn"));
/**
* {@code #minecraft:supports_hanging_mangrove_propagule}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_HANGING_MANGROVE_PROPAGULE = create(key("supports_hanging_mangrove_propagule"));
/**
* {@code #minecraft:supports_lily_pad}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_LILY_PAD = create(key("supports_lily_pad"));
/**
* {@code #minecraft:supports_mangrove_propagule}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_MANGROVE_PROPAGULE = create(key("supports_mangrove_propagule"));
/**
* {@code #minecraft:supports_melon_stem}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_MELON_STEM = create(key("supports_melon_stem"));
/**
* {@code #minecraft:supports_melon_stem_fruit}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_MELON_STEM_FRUIT = create(key("supports_melon_stem_fruit"));
/**
* {@code #minecraft:supports_nether_sprouts}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_NETHER_SPROUTS = create(key("supports_nether_sprouts"));
/**
* {@code #minecraft:supports_nether_wart}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_NETHER_WART = create(key("supports_nether_wart"));
/**
* {@code #minecraft:supports_pumpkin_stem}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_PUMPKIN_STEM = create(key("supports_pumpkin_stem"));
/**
* {@code #minecraft:supports_pumpkin_stem_fruit}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_PUMPKIN_STEM_FRUIT = create(key("supports_pumpkin_stem_fruit"));
/**
* {@code #minecraft:supports_small_dripleaf}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_SMALL_DRIPLEAF = create(key("supports_small_dripleaf"));
/**
* {@code #minecraft:supports_stem_crops}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_STEM_CROPS = create(key("supports_stem_crops"));
/**
* {@code #minecraft:supports_stem_fruit}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_STEM_FRUIT = create(key("supports_stem_fruit"));
/**
* {@code #minecraft:supports_sugar_cane}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_SUGAR_CANE = create(key("supports_sugar_cane"));
/**
* {@code #minecraft:supports_sugar_cane_adjacently}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_SUGAR_CANE_ADJACENTLY = create(key("supports_sugar_cane_adjacently"));
/**
* {@code #minecraft:supports_vegetation}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_VEGETATION = create(key("supports_vegetation"));
/**
* {@code #minecraft:supports_warped_fungus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_WARPED_FUNGUS = create(key("supports_warped_fungus"));
/**
* {@code #minecraft:supports_warped_roots}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_WARPED_ROOTS = create(key("supports_warped_roots"));
/**
* {@code #minecraft:supports_wither_rose}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> SUPPORTS_WITHER_ROSE = create(key("supports_wither_rose"));
/**
* {@code #minecraft:sword_efficient}
*
@@ -183,15 +183,6 @@ public final class EnchantmentTagKeys {
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_DESERT_COMMON = create(key("trades/desert_common"));
/**
* {@code #minecraft:trades/desert_special}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_DESERT_SPECIAL = create(key("trades/desert_special"));
/**
* {@code #minecraft:trades/jungle_common}
*
@@ -201,15 +192,6 @@ public final class EnchantmentTagKeys {
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_JUNGLE_COMMON = create(key("trades/jungle_common"));
/**
* {@code #minecraft:trades/jungle_special}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_JUNGLE_SPECIAL = create(key("trades/jungle_special"));
/**
* {@code #minecraft:trades/plains_common}
*
@@ -219,15 +201,6 @@ public final class EnchantmentTagKeys {
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_PLAINS_COMMON = create(key("trades/plains_common"));
/**
* {@code #minecraft:trades/plains_special}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_PLAINS_SPECIAL = create(key("trades/plains_special"));
/**
* {@code #minecraft:trades/savanna_common}
*
@@ -237,15 +210,6 @@ public final class EnchantmentTagKeys {
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_SAVANNA_COMMON = create(key("trades/savanna_common"));
/**
* {@code #minecraft:trades/savanna_special}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_SAVANNA_SPECIAL = create(key("trades/savanna_special"));
/**
* {@code #minecraft:trades/snow_common}
*
@@ -255,15 +219,6 @@ public final class EnchantmentTagKeys {
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_SNOW_COMMON = create(key("trades/snow_common"));
/**
* {@code #minecraft:trades/snow_special}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_SNOW_SPECIAL = create(key("trades/snow_special"));
/**
* {@code #minecraft:trades/swamp_common}
*
@@ -273,15 +228,6 @@ public final class EnchantmentTagKeys {
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_SWAMP_COMMON = create(key("trades/swamp_common"));
/**
* {@code #minecraft:trades/swamp_special}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_SWAMP_SPECIAL = create(key("trades/swamp_special"));
/**
* {@code #minecraft:trades/taiga_common}
*
@@ -291,15 +237,6 @@ public final class EnchantmentTagKeys {
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_TAIGA_COMMON = create(key("trades/taiga_common"));
/**
* {@code #minecraft:trades/taiga_special}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.TRADE_REBALANCE)
public static final TagKey<Enchantment> TRADES_TAIGA_SPECIAL = create(key("trades/taiga_special"));
/**
* {@code #minecraft:treasure}
*
@@ -144,6 +144,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> CANDIDATE_FOR_IRON_GOLEM_GIFT = create(key("candidate_for_iron_golem_gift"));
/**
* {@code #minecraft:cannot_be_age_locked}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> CANNOT_BE_AGE_LOCKED = create(key("cannot_be_age_locked"));
/**
* {@code #minecraft:cannot_be_pushed_onto_boats}
*
@@ -25,6 +25,13 @@ import org.jspecify.annotations.NullMarked;
@NullMarked
@GeneratedClass
public final class FluidTagKeys {
/**
* {@code #minecraft:bubble_column_can_occupy}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Fluid> BUBBLE_COLUMN_CAN_OCCUPY = create(key("bubble_column_can_occupy"));
/**
* {@code #minecraft:lava}
*
@@ -32,6 +39,27 @@ public final class FluidTagKeys {
*/
public static final TagKey<Fluid> LAVA = create(key("lava"));
/**
* {@code #minecraft:supports_frogspawn}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Fluid> SUPPORTS_FROGSPAWN = create(key("supports_frogspawn"));
/**
* {@code #minecraft:supports_lily_pad}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Fluid> SUPPORTS_LILY_PAD = create(key("supports_lily_pad"));
/**
* {@code #minecraft:supports_sugar_cane_adjacently}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Fluid> SUPPORTS_SUGAR_CANE_ADJACENTLY = create(key("supports_sugar_cane_adjacently"));
/**
* {@code #minecraft:water}
*
@@ -186,6 +186,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> CANDLES = create(key("candles"));
/**
* {@code #minecraft:cat_collar_dyes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> CAT_COLLAR_DYES = create(key("cat_collar_dyes"));
/**
* {@code #minecraft:cat_food}
*
@@ -193,6 +200,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> CAT_FOOD = create(key("cat_food"));
/**
* {@code #minecraft:cauldron_can_remove_dye}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> CAULDRON_CAN_REMOVE_DYE = create(key("cauldron_can_remove_dye"));
/**
* {@code #minecraft:chains}
*
@@ -397,11 +411,11 @@ public final class ItemTypeTagKeys {
public static final TagKey<ItemType> DUPLICATES_ALLAYS = create(key("duplicates_allays"));
/**
* {@code #minecraft:dyeable}
* {@code #minecraft:dyes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> DYEABLE = create(key("dyeable"));
public static final TagKey<ItemType> DYES = create(key("dyes"));
/**
* {@code #minecraft:eggs}
@@ -655,6 +669,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> GOLD_TOOL_MATERIALS = create(key("gold_tool_materials"));
/**
* {@code #minecraft:grass_blocks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> GRASS_BLOCKS = create(key("grass_blocks"));
/**
* {@code #minecraft:hanging_signs}
*
@@ -816,6 +837,20 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> LOGS_THAT_BURN = create(key("logs_that_burn"));
/**
* {@code #minecraft:loom_dyes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> LOOM_DYES = create(key("loom_dyes"));
/**
* {@code #minecraft:loom_patterns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> LOOM_PATTERNS = create(key("loom_patterns"));
/**
* {@code #minecraft:mangrove_logs}
*
@@ -837,6 +872,27 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> MEAT = create(key("meat"));
/**
* {@code #minecraft:metal_nuggets}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> METAL_NUGGETS = create(key("metal_nuggets"));
/**
* {@code #minecraft:moss_blocks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> MOSS_BLOCKS = create(key("moss_blocks"));
/**
* {@code #minecraft:mud}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> MUD = create(key("mud"));
/**
* {@code #minecraft:nautilus_bucket_food}
*
@@ -1320,6 +1376,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> WITHER_SKELETON_DISLIKED_WEAPONS = create(key("wither_skeleton_disliked_weapons"));
/**
* {@code #minecraft:wolf_collar_dyes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> WOLF_COLLAR_DYES = create(key("wolf_collar_dyes"));
/**
* {@code #minecraft:wolf_food}
*
@@ -0,0 +1,61 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.entity.poi.PoiType;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla tag keys for {@link RegistryKey#POINT_OF_INTEREST_TYPE}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedClass
public final class PoiTypeTagKeys {
/**
* {@code #minecraft:acquirable_job_site}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PoiType> ACQUIRABLE_JOB_SITE = create(key("acquirable_job_site"));
/**
* {@code #minecraft:bee_home}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PoiType> BEE_HOME = create(key("bee_home"));
/**
* {@code #minecraft:village}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PoiType> VILLAGE = create(key("village"));
private PoiTypeTagKeys() {
}
/**
* Creates a tag key for {@link PoiType} in the registry {@code minecraft:point_of_interest_type}.
*
* @param key the tag key's key
* @return a new tag key
*/
public static TagKey<PoiType> create(final Key key) {
return TagKey.create(RegistryKey.POINT_OF_INTEREST_TYPE, key);
}
}
@@ -0,0 +1,47 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.potion.PotionType;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla tag keys for {@link RegistryKey#POTION}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedClass
public final class PotionTypeTagKeys {
/**
* {@code #minecraft:tradeable}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PotionType> TRADEABLE = create(key("tradeable"));
private PotionTypeTagKeys() {
}
/**
* Creates a tag key for {@link PotionType} in the registry {@code minecraft:potion}.
*
* @param key the tag key's key
* @return a new tag key
*/
public static TagKey<PotionType> create(final Key key) {
return TagKey.create(RegistryKey.POTION, key);
}
}
@@ -134,7 +134,7 @@ public class TimingHistory {
}
}
return pair(
worldMap.get(world.getName()),
worldMap.get(world.getKey().toString()),
toArrayMapper(regions.values(),new Function<RegionData, Object>() {
@NotNull
@Override
@@ -75,7 +75,7 @@ public final class NamespacedTag implements com.destroystokyo.paper.Namespaced {
Preconditions.checkArgument(key != null, "Key cannot be null");
this.namespace = plugin.getName().toLowerCase(Locale.ROOT);
this.key = key.toLowerCase().toLowerCase(Locale.ROOT);
this.key = key.toLowerCase(Locale.ROOT);
// Check validity after normalization
Preconditions.checkArgument(VALID_NAMESPACE.matcher(this.namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", this.namespace);
@@ -165,8 +165,7 @@ public class ParticleBuilder implements Cloneable {
throw new IllegalStateException("Please set location first");
}
this.receivers = Lists.newArrayList();
for (final Player nearbyPlayer : this.location.getWorld()
.getNearbyPlayers(this.location, radius, radius, radius)) {
for (final Player nearbyPlayer : this.location.getWorld().getNearbyPlayers(this.location, radius, radius, radius)) {
final Location loc = nearbyPlayer.getLocation();
final double x = NumberConversions.square(this.location.getX() - loc.getX());
final double y = NumberConversions.square(this.location.getY() - loc.getY());
@@ -3,6 +3,7 @@ package com.destroystokyo.paper.entity;
import java.util.List;
import org.bukkit.Location;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Mob;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@@ -45,7 +46,7 @@ public interface Pathfinder {
@Nullable PathResult findPath(Location loc);
/**
* Calculates a destination for the Entity to navigate to to reach the target entity,
* Calculates a destination for the Entity to navigate to reach the target entity,
* but does not set it as the current target.
* Useful for calculating what would happen before setting it.
* <p>
@@ -57,7 +58,25 @@ public interface Pathfinder {
* @param target the Entity to navigate to
* @return The closest Location the Entity can get to for this navigation, or null if no path could be calculated
*/
@Nullable PathResult findPath(LivingEntity target);
@Nullable
default PathResult findPath(LivingEntity target) {
return this.findPath((Entity) target);
}
/**
* Calculates a destination for the Entity to navigate to reach the target entity,
* but does not set it as the current target.
* Useful for calculating what would happen before setting it.
* <p>
* The behavior of this PathResult is subject to the games pathfinding rules, and may
* result in the pathfinding automatically updating to follow the target Entity.
* <p>
* However, this behavior is not guaranteed, and is subject to the game's behavior.
*
* @param target the Entity to navigate to
* @return The closest Location the Entity can get to for this navigation, or null if no path could be calculated
*/
@Nullable PathResult findPath(Entity target);
/**
* Calculates a destination for the Entity to navigate to, and sets it with default speed
@@ -84,7 +103,7 @@ public interface Pathfinder {
}
/**
* Calculates a destination for the Entity to navigate to to reach the target entity,
* Calculates a destination for the Entity to navigate to reach the target entity,
* and sets it with default speed.
* <p>
* The behavior of this PathResult is subject to the games pathfinding rules, and may
@@ -100,7 +119,7 @@ public interface Pathfinder {
}
/**
* Calculates a destination for the Entity to navigate to to reach the target entity,
* Calculates a destination for the Entity to navigate to reach the target entity,
* and sets it with specified speed.
* <p>
* The behavior of this PathResult is subject to the games pathfinding rules, and may
@@ -113,6 +132,39 @@ public interface Pathfinder {
* @return If the pathfinding was successfully started
*/
default boolean moveTo(LivingEntity target, double speed) {
return this.moveTo((Entity) target, speed);
}
/**
* Calculates a destination for the Entity to navigate to reach the target entity,
* and sets it with default speed.
* <p>
* The behavior of this PathResult is subject to the games pathfinding rules, and may
* result in the pathfinding automatically updating to follow the target Entity.
* <p>
* However, this behavior is not guaranteed, and is subject to the game's behavior.
*
* @param target the Entity to navigate to
* @return If the pathfinding was successfully started
*/
default boolean moveTo(Entity target) {
return this.moveTo(target, 1);
}
/**
* Calculates a destination for the Entity to navigate to reach the target entity,
* and sets it with specified speed.
* <p>
* The behavior of this PathResult is subject to the games pathfinding rules, and may
* result in the pathfinding automatically updating to follow the target Entity.
* <p>
* However, this behavior is not guaranteed, and is subject to the game's behavior.
*
* @param target the Entity to navigate to
* @param speed Speed multiplier to navigate at, where 1 is 'normal'
* @return If the pathfinding was successfully started
*/
default boolean moveTo(Entity target, double speed) {
PathResult path = this.findPath(target);
return path != null && this.moveTo(path, speed);
}
@@ -18,7 +18,7 @@ public final class Reputation {
}
public Reputation(final Map<ReputationType, Integer> reputation) {
Preconditions.checkNotNull(reputation, "reputation cannot be null");
Preconditions.checkArgument(reputation != null, "reputation cannot be null");
this.reputation = reputation;
}
@@ -29,7 +29,7 @@ public final class Reputation {
* @return The value of the {@link ReputationType type}.
*/
public int getReputation(final ReputationType type) {
Preconditions.checkNotNull(type, "the reputation type cannot be null");
Preconditions.checkArgument(type != null, "type cannot be null");
return this.reputation.getOrDefault(type, 0);
}
@@ -40,7 +40,7 @@ public final class Reputation {
* @param value The value of the {@link ReputationType type}.
*/
public void setReputation(final ReputationType type, final int value) {
Preconditions.checkNotNull(type, "the reputation type cannot be null");
Preconditions.checkArgument(type != null, "type cannot be null");
this.reputation.put(type, value);
}
@@ -240,6 +240,8 @@ public class AsyncTabCompleteEvent extends Event implements Cancellable {
/**
* A rich tab completion, consisting of a string suggestion, and a nullable {@link Component} tooltip.
* <p>
* <b>Warning:</b> In a future update, this class will no longer implement {@link Examinable}.
*/
public interface Completion extends Examinable {
@@ -258,6 +260,7 @@ public class AsyncTabCompleteEvent extends Event implements Cancellable {
@Nullable Component tooltip();
@Override
@Deprecated(forRemoval = true, since = "1.21.11")
default Stream<? extends ExaminableProperty> examinableProperties() {
return Stream.of(ExaminableProperty.of("suggestion", this.suggestion()), ExaminableProperty.of("tooltip", this.tooltip()));
}
@@ -257,16 +257,16 @@ public interface PlayerProfile extends org.bukkit.profile.PlayerProfile, PlayerH
@Override
default void applySkinToPlayerHeadContents(final PlayerHeadObjectContents.Builder builder) {
if (this.getProperties().isEmpty() && (this.getName() != null) != (this.getId() != null)) {
if (this.getProperties().isEmpty()) {
if (this.getId() != null) {
builder.id(this.getId());
} else {
} else if (this.getName() != null) {
builder.name(this.getName());
}
return;
} else {
builder.id(this.getId())
.name(this.getName())
.profileProperties(this.getProperties().stream().map(prop -> property(prop.getName(), prop.getValue(), prop.getSignature())).toList());
}
builder.id(this.getId())
.name(this.getName())
.profileProperties(this.getProperties().stream().map(prop -> property(prop.getName(), prop.getValue(), prop.getSignature())).toList());
}
}
@@ -3,6 +3,7 @@ package io.papermc.paper;
import com.destroystokyo.paper.SkinParts;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.datacomponent.item.ResolvableProfile;
import io.papermc.paper.entity.poi.PoiType;
import io.papermc.paper.world.damagesource.CombatEntry;
import io.papermc.paper.world.damagesource.FallLocationType;
import java.util.Set;
@@ -52,6 +53,14 @@ public interface InternalAPIBridge {
*/
DamageEffect getDamageEffect(String key);
/**
* Creates an occupancy instance for the passed enum entry name.
*
* @param enumNameEntry the enum entry
* @return the occupancy
*/
PoiType.Occupancy createOccupancy(String enumNameEntry);
/**
* Constructs the legacy custom biome instance for the biome enum.
*
@@ -45,15 +45,15 @@ import io.papermc.paper.datacomponent.item.Weapon;
import io.papermc.paper.datacomponent.item.WritableBookContent;
import io.papermc.paper.datacomponent.item.WrittenBookContent;
import io.papermc.paper.item.MapPostProcessing;
import io.papermc.paper.registry.tag.TagKey;
import io.papermc.paper.registry.set.RegistryKeySet;
import java.util.List;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.text.Component;
import org.bukkit.Art;
import org.bukkit.DyeColor;
import org.bukkit.FireworkEffect;
import org.bukkit.MusicInstrument;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.block.banner.PatternType;
import org.bukkit.damage.DamageType;
@@ -82,8 +82,6 @@ import org.checkerframework.common.value.qual.IntRange;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import static java.util.Objects.requireNonNull;
/**
* All the different types of data that {@link org.bukkit.inventory.ItemStack ItemStacks}
* and {@link org.bukkit.inventory.ItemType ItemTypes} can have.
@@ -239,8 +237,9 @@ public final class DataComponentTypes {
* @see #ENCHANTMENTS
*/
public static final DataComponentType.Valued<ItemEnchantments> STORED_ENCHANTMENTS = valued("stored_enchantments");
public static final DataComponentType.Valued<DyeColor> DYE = valued("dye");
/**
* Represents a color applied to a dyeable item (in the {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#DYEABLE} item tag).
* Represents a color applied to a dyeable item.
*/
public static final DataComponentType.Valued<DyedItemColor> DYED_COLOR = valued("dyed_color");
/**
@@ -306,7 +305,7 @@ public final class DataComponentTypes {
*/
public static final DataComponentType.Valued<OminousBottleAmplifier> OMINOUS_BOTTLE_AMPLIFIER = valued("ominous_bottle_amplifier");
public static final DataComponentType.Valued<JukeboxPlayable> JUKEBOX_PLAYABLE = valued("jukebox_playable");
public static final DataComponentType.Valued<TagKey<PatternType>> PROVIDES_BANNER_PATTERNS = valued("provides_banner_patterns");
public static final DataComponentType.Valued<RegistryKeySet<PatternType>> PROVIDES_BANNER_PATTERNS = valued("provides_banner_patterns");
/**
* List of recipes that should be unlocked when using the Knowledge Book item.
*/
@@ -378,9 +377,11 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<MushroomCow.Variant> MOOSHROOM_VARIANT = valued("mooshroom/variant");
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<Pig.SoundVariant> PIG_SOUND_VARIANT = valued("pig/sound_variant");
public static final DataComponentType.Valued<Cow.Variant> COW_VARIANT = valued("cow/variant");
public static final DataComponentType.Valued<Cow.SoundVariant> COW_SOUND_VARIANT = valued("cow/sound_variant");
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<Chicken.SoundVariant> CHICKEN_SOUND_VARIANT = valued("chicken/sound_variant");
public static final DataComponentType.Valued<Frog.Variant> FROG_VARIANT = valued("frog/variant");
public static final DataComponentType.Valued<Horse.Color> HORSE_VARIANT = valued("horse/variant");
public static final DataComponentType.Valued<Art> PAINTING_VARIANT = valued("painting/variant");
@@ -388,26 +389,26 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<Axolotl.Variant> AXOLOTL_VARIANT = valued("axolotl/variant");
public static final DataComponentType.Valued<ZombieNautilus.Variant> ZOMBIE_NAUTILUS_VARIANT = valued("zombie_nautilus/variant");
public static final DataComponentType.Valued<Cat.Type> CAT_VARIANT = valued("cat/variant");
public static final DataComponentType.Valued<Cat.SoundVariant> CAT_SOUND_VARIANT = valued("cat/sound_variant");
public static final DataComponentType.Valued<DyeColor> CAT_COLLAR = valued("cat/collar");
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.");
private static DataComponentType.NonValued unvalued(final @KeyPattern.Value String key) {
final DataComponentType dataComponentType = Registry.DATA_COMPONENT_TYPE.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
if (dataComponentType instanceof DataComponentType.NonValued) {
return (DataComponentType.NonValued) dataComponentType;
}
throw new IllegalStateException(name + " is not a valid unvalued type, it is a " + dataComponentType.getClass().getTypeName());
throw new IllegalStateException(key + " is not a valid unvalued type, it is a " + dataComponentType.getClass().getTypeName());
}
@SuppressWarnings("unchecked")
private static <T> DataComponentType.Valued<T> valued(final String name) {
DataComponentType dataComponentType = requireNonNull(Registry.DATA_COMPONENT_TYPE.get(NamespacedKey.minecraft(name)), name + " valued data component type couldn't be found, this is a bug.");
private static <T> DataComponentType.Valued<T> valued(final @KeyPattern.Value String key) {
final DataComponentType dataComponentType = Registry.DATA_COMPONENT_TYPE.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
if (dataComponentType instanceof DataComponentType.Valued) {
return (DataComponentType.Valued<T>) dataComponentType;
}
throw new IllegalStateException(name + " is not a valid valued type, it is a " + dataComponentType.getClass().getTypeName());
throw new IllegalStateException(key + " is not a valid valued type, it is a " + dataComponentType.getClass().getTypeName());
}
private DataComponentTypes() {
@@ -3,7 +3,7 @@ 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 io.papermc.paper.registry.set.RegistryKeySet;
import java.util.List;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
@@ -68,7 +68,7 @@ public interface BlocksAttacks {
* @return a damage type tag key, or null if there is no such tag key
*/
@Contract(pure = true)
@Nullable TagKey<DamageType> bypassedBy();
@Nullable RegistryKeySet<DamageType> bypassedBy();
/**
* Gets the key sound to play when an attack is successfully blocked.
@@ -109,7 +109,7 @@ public interface BlocksAttacks {
Builder itemDamage(ItemDamageFunction function);
@Contract(value = "_ -> this", mutates = "this")
Builder bypassedBy(@Nullable TagKey<DamageType> bypassedBy);
Builder bypassedBy(@Nullable RegistryKeySet<DamageType> bypassedBy);
@Contract(value = "_ -> this", mutates = "this")
Builder blockSound(@Nullable Key sound);
@@ -1,6 +1,6 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.registry.tag.TagKey;
import io.papermc.paper.registry.set.RegistryKeySet;
import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
@@ -16,15 +16,15 @@ import org.jspecify.annotations.NullMarked;
public interface DamageResistant {
@Contract(value = "_ -> new", pure = true)
static DamageResistant damageResistant(final TagKey<DamageType> types) {
static DamageResistant damageResistant(final RegistryKeySet<DamageType> types) {
return ItemComponentTypesBridge.bridge().damageResistant(types);
}
/**
* The types that this damage type is invincible to.
*
* @return the key of the tag holding the respective damage types.
* @return the registry key set holding the respective damage types.
*/
@Contract(value = "-> new", pure = true)
TagKey<DamageType> types();
RegistryKeySet<DamageType> types();
}
@@ -100,7 +100,7 @@ interface ItemComponentTypesBridge {
UseCooldown.Builder useCooldown(final float seconds);
DamageResistant damageResistant(TagKey<DamageType> types);
DamageResistant damageResistant(RegistryKeySet<DamageType> types);
Enchantable enchantable(int level);
@@ -0,0 +1,30 @@
package io.papermc.paper.entity.poi;
import java.util.function.Predicate;
import org.bukkit.Location;
import org.bukkit.World;
import org.jspecify.annotations.NullMarked;
/**
* Holds the result of searching for a point of interest.
*
* @see World#locateAllPoiInRange(Location, Predicate, int)
* @see World#locateAllPoiInRange(Location, Predicate, int, PoiType.Occupancy)
*/
@NullMarked
public interface PoiSearchResult {
/**
* Returns the {@link PoiType}.
*
* @return the {@link PoiType}
*/
PoiType poiType();
/**
* Return the location of the {@link PoiType}.
*
* @return the location the {@link PoiType} was found at
*/
Location location();
}
@@ -0,0 +1,66 @@
package io.papermc.paper.entity.poi;
import io.papermc.paper.InternalAPIBridge;
import org.bukkit.Keyed;
import org.bukkit.block.data.BlockData;
import org.jspecify.annotations.NullMarked;
/**
* Represents a point of interest (POI).
* <p>
* Many PoiTypes act as a marker vs storing occupants examples of this are most
* explicitly {@link PoiTypes#NETHER_PORTAL}. This state can be checked using the method
* {@link #hasOccupants()} which will return {@code true} if the PoiType can have occupants.
*
* @see PoiTypes
*/
@NullMarked
public interface PoiType extends Keyed {
/**
* Determines whether the provided BlockState is relevant to this
* point of interest.
*
* @param data the BlockData to check
* @return {@code true} if the BlockState is relevant, otherwise {@code false}
*/
boolean is(BlockData data);
/**
* Determines whether this PoiType can actually hold occupants.
*
* @return {@code true} if this PoiType can hold occupants
*/
boolean hasOccupants();
/**
* Determines the type of occupancy the point of interest has.
* <p>
* A PoiType occupancy is defined by how much "space" a point of interest
* has.
* <p>
* With context to a Villager workstation if a villager is currently using
* a workstation as a source of its profession the occupancy would be
* {@link Occupancy#IS_OCCUPIED}, however, if no villager was attached to
* a workstation its occupancy would be {@link Occupancy#HAS_SPACE}.
*/
interface Occupancy {
/**
* The poi has space.
*/
Occupancy HAS_SPACE = occupancy("HAS_SPACE");
/**
* The poi is occupied.
*/
Occupancy IS_OCCUPIED = occupancy("IS_OCCUPIED");
/**
* The poi is either occupied or has space.
*/
Occupancy ANY = occupancy("ANY");
private static Occupancy occupancy(final String enumEntryName) {
return InternalAPIBridge.get().createOccupancy(enumEntryName);
}
}
}
@@ -0,0 +1,64 @@
package io.papermc.paper.entity.poi;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Registry;
import org.jspecify.annotations.NullMarked;
/**
* All the built-in point of interest types.
*/
@NullMarked
public final class PoiTypes {
// Start generate - PoiTypes
public static final PoiType ARMORER = get("armorer");
public static final PoiType BEE_NEST = get("bee_nest");
public static final PoiType BEEHIVE = get("beehive");
public static final PoiType BUTCHER = get("butcher");
public static final PoiType CARTOGRAPHER = get("cartographer");
public static final PoiType CLERIC = get("cleric");
public static final PoiType FARMER = get("farmer");
public static final PoiType FISHERMAN = get("fisherman");
public static final PoiType FLETCHER = get("fletcher");
public static final PoiType HOME = get("home");
public static final PoiType LEATHERWORKER = get("leatherworker");
public static final PoiType LIBRARIAN = get("librarian");
public static final PoiType LIGHTNING_ROD = get("lightning_rod");
public static final PoiType LODESTONE = get("lodestone");
public static final PoiType MASON = get("mason");
public static final PoiType MEETING = get("meeting");
public static final PoiType NETHER_PORTAL = get("nether_portal");
public static final PoiType SHEPHERD = get("shepherd");
public static final PoiType TEST_INSTANCE = get("test_instance");
public static final PoiType TOOLSMITH = get("toolsmith");
public static final PoiType WEAPONSMITH = get("weaponsmith");
// End generate - PoiTypes
private static PoiType get(@KeyPattern.Value final String key) {
return Registry.POINT_OF_INTEREST_TYPE.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
private PoiTypes() {
}
}
@@ -1,6 +1,8 @@
package io.papermc.paper.event.connection;
import io.papermc.paper.connection.PlayerConfigurationConnection;
import io.papermc.paper.connection.PlayerConnection;
import io.papermc.paper.connection.PlayerLoginConnection;
import net.kyori.adventure.text.Component;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
@@ -10,8 +12,13 @@ import org.jspecify.annotations.Nullable;
/**
* Validates whether a player connection is able to log in.
* <p>
* Called when is attempting to log in for the first time, or is finishing up
* being configured.
* Called when a player is attempting to log in for the first time,
* or is finishing up being configured.
*
* @implNote Since 1.21.7, during these phases, the {@link #getConnection() connection}
* is either {@link PlayerLoginConnection} or {@link PlayerConfigurationConnection},
* allowing access to phase-specific API.
* <br>However, these underlying connection types are not guaranteed to be stable across versions.
*/
public class PlayerConnectionValidateLoginEvent extends Event {
@@ -29,9 +36,13 @@ public class PlayerConnectionValidateLoginEvent extends Event {
/**
* Gets the connection of the player in this event.
* Note, the type of this connection is not guaranteed to be stable across versions.
* Additionally, disconnecting the player through this connection / using any methods that may send packets
* is not supported.
* @apiNote Disconnecting the player through this connection
* or using any methods that may send packets is not supported.
*
* @implNote Since 1.21.7, this connection is either
* {@link PlayerLoginConnection} or {@link PlayerConfigurationConnection}
* depending on which phase it is fired in, allowing access to phase-specific API.
* <br>However, these underlying connection types are not guaranteed to be stable across versions.
*
* @return connection
*/
@@ -0,0 +1,71 @@
package io.papermc.paper.event.entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.entity.EntityEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Called when a living entity tries to lunge with a spear.
*/
@NullMarked
public class EntityLungeEvent extends EntityEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList();
private int lungePower;
private boolean cancelled;
@ApiStatus.Internal
public EntityLungeEvent(final LivingEntity entity, final int lungePower) {
super(entity);
this.lungePower = lungePower;
}
/**
* Gets the lunge power, which when initially passed, matches the enchantment level of the item, but can be higher.
*
* @return the lunge power
*/
public int getLungePower() {
return this.lungePower;
}
/**
* Sets the lunge power. This commonly matches the enchantment level of the item, and can be set higher.
* <p>
* If set higher than 3, the power of the lunge will continue to scale like normal, as if the max enchantment
* level is higher.
*
* @param lungePower the new lunge power
*/
public void setLungePower(final int lungePower) {
this.lungePower = lungePower;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
/**
* Set whether to cancel the lunge. If cancelled, the living entity will not lunge forward.
*
* @param cancel {@code true} if you wish to cancel this event
*/
@Override
public void setCancelled(final boolean cancel) {
this.cancelled = cancel;
}
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@NullMarked
public class PlayerArmSwingEvent extends PlayerAnimationEvent {
public class PlayerArmSwingEvent extends PlayerAnimationEvent { // todo redundant with parent?
private final EquipmentSlot equipmentSlot;
@@ -0,0 +1,75 @@
package io.papermc.paper.event.player;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Triggered when a {@link Player} swaps an item with an equipment slot.
*/
@NullMarked
public class PlayerSwapWithEquipmentSlotEvent extends PlayerEvent implements Cancellable {
private static final HandlerList HANDLERS = new HandlerList();
private final ItemStack itemInHand;
private final EquipmentSlot slot;
private final ItemStack itemToSwap;
private boolean cancelled;
@ApiStatus.Internal
public PlayerSwapWithEquipmentSlotEvent(
final Player player,
final ItemStack itemInHand,
final EquipmentSlot slot,
final ItemStack itemToSwap
) {
super(player);
this.itemInHand = itemInHand;
this.slot = slot;
this.itemToSwap = itemToSwap;
}
/**
* {@return the item in one of the hand slots}
*/
public ItemStack getItemInHand() {
return this.itemInHand.clone();
}
/**
* {@return the slot to swap into}
*/
public EquipmentSlot getSlot() {
return this.slot;
}
/**
* {@return the item to swap}
*/
public ItemStack getItemToSwap() {
return this.itemToSwap.clone();
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(final boolean cancelled) {
this.cancelled = cancelled;
}
@Override
public HandlerList getHandlers() {
return HANDLERS;
}
public static HandlerList getHandlerList() {
return HANDLERS;
}
}
@@ -0,0 +1,81 @@
package io.papermc.paper.event.player;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Called when a player toggles the age lock of an entity using an item.
*/
@NullMarked
public class PlayerToggleEntityAgeLockEvent extends PlayerEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final LivingEntity entity;
private final ItemStack item;
private final EquipmentSlot hand;
private final boolean ageLocked;
private boolean cancelled;
@ApiStatus.Internal
public PlayerToggleEntityAgeLockEvent(final Player player, final LivingEntity entity, final ItemStack item, final EquipmentSlot hand, final boolean ageLocked) {
super(player);
this.entity = entity;
this.item = item;
this.hand = hand;
this.ageLocked = ageLocked;
}
/**
* {@return the entity that is having its age locked or unlocked}
*/
public LivingEntity getEntity() {
return this.entity;
}
/**
* {@return the item being used to toggle the age lock of the entity}
*/
public ItemStack getItem() {
return this.item.clone();
}
/**
* {@return the hand being used to toggle the age lock of the entity}
*/
public EquipmentSlot getHand() {
return this.hand;
}
/**
* {@return whether the age of the entity is going to be locked or not}
*/
public boolean isAgeLocked() {
return this.ageLocked;
}
@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;
}
}
@@ -11,7 +11,8 @@ import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* Called when a world's gamerule is changed, either by command or by api.
* Called when a world's gamerule is changed, either by command, world options menu, or by api.
* @see <a href="https://minecraft.wiki/w/Game_rule#Modifying_game_rules">Modifying game rules - Minecraft wiki</a>
*/
@NullMarked
public class WorldGameRuleChangeEvent extends WorldEvent implements Cancellable {
@@ -68,7 +68,7 @@ public class WorldBorderBoundsChangeEvent extends WorldBorderEvent implements Ca
* @param newSize the new size
*/
public void setNewSize(final double newSize) {
this.newSize = Math.clamp(newSize, 1.0D, this.worldBorder.getMaxSize());
this.newSize = Math.clamp(newSize, 1.0, this.worldBorder.getMaxSize());
}
/**
@@ -1,6 +1,8 @@
package io.papermc.paper.item;
public enum MapPostProcessing {
// Start generate - MapPostProcessing
LOCK,
SCALE
SCALE;
// End generate - MapPostProcessing
}
@@ -2,6 +2,7 @@ package io.papermc.paper.registry;
import io.papermc.paper.datacomponent.DataComponentType;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.entity.poi.PoiType;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
@@ -92,6 +93,11 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @see io.papermc.paper.registry.keys.VillagerProfessionKeys
*/
RegistryKey<Villager.Profession> VILLAGER_PROFESSION = create("villager_profession");
/**
* Built-in registry for poi types.
* @see io.papermc.paper.registry.keys.PoiTypeKeys
*/
RegistryKey<PoiType> POINT_OF_INTEREST_TYPE = create("point_of_interest_type");
/**
* Built-in registry for villager types.
* @see io.papermc.paper.registry.keys.VillagerTypeKeys
@@ -201,6 +207,11 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @see io.papermc.paper.registry.keys.CatVariantKeys
*/
RegistryKey<Cat.Type> CAT_VARIANT = create("cat_variant");
/**
* Data-driven registry for cat sound variants.
* @see io.papermc.paper.registry.keys.CatSoundVariantKeys
*/
RegistryKey<Cat.SoundVariant> CAT_SOUND_VARIANT = create("cat_sound_variant");
/**
* Data-driven registry for frog variants.
* @see io.papermc.paper.registry.keys.FrogVariantKeys
@@ -211,16 +222,31 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @see io.papermc.paper.registry.keys.ChickenVariantKeys
*/
RegistryKey<Chicken.Variant> CHICKEN_VARIANT = create("chicken_variant");
/**
* Data-driven registry for chicken sound variants.
* @see io.papermc.paper.registry.keys.ChickenSoundVariantKeys
*/
RegistryKey<Chicken.SoundVariant> CHICKEN_SOUND_VARIANT = create("chicken_sound_variant");
/**
* Data-driven registry for cow variants.
* @see io.papermc.paper.registry.keys.CowVariantKeys
*/
RegistryKey<Cow.Variant> COW_VARIANT = create("cow_variant");
/**
* Data-driven registry for cow sound variants.
* @see io.papermc.paper.registry.keys.CowSoundVariantKeys
*/
RegistryKey<Cow.SoundVariant> COW_SOUND_VARIANT = create("cow_sound_variant");
/**
* Data-driven registry for pig variants.
* @see io.papermc.paper.registry.keys.PigVariantKeys
*/
RegistryKey<Pig.Variant> PIG_VARIANT = create("pig_variant");
/**
* Data-driven registry for pig sound variants.
* @see io.papermc.paper.registry.keys.PigSoundVariantKeys
*/
RegistryKey<Pig.SoundVariant> PIG_SOUND_VARIANT = create("pig_sound_variant");
/**
* Data-driven registry for zombie nautilus variants.
* @see io.papermc.paper.registry.keys.ZombieNautilusVariantKeys
@@ -20,12 +20,20 @@ public interface CatTypeRegistryEntry {
*/
ClientTextureAsset clientTextureAsset();
/**
* Provides the client texture asset of the cat type for baby cats.
*
* @return the baby client texture asset.
*/
ClientTextureAsset babyClientTextureAsset();
/**
* A mutable builder for the {@link CatTypeRegistryEntry} plugins may change in applicable registry events.
* <p>
* The following values are required for each builder:
* <ul>
* <li>{@link #clientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #babyClientTextureAsset(ClientTextureAsset)}</li>
* </ul>
*/
@ApiStatus.Experimental
@@ -41,5 +49,15 @@ public interface CatTypeRegistryEntry {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder clientTextureAsset(ClientTextureAsset clientTextureAsset);
/**
* Sets the client texture asset of the cat type for baby cats.
*
* @param babyClientTextureAsset the baby client texture asset.
* @return this builder instance.
* @see CatTypeRegistryEntry#babyClientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder babyClientTextureAsset(ClientTextureAsset babyClientTextureAsset);
}
}
@@ -35,6 +35,13 @@ public interface ChickenVariantRegistryEntry {
*/
ClientTextureAsset clientTextureAsset();
/**
* Provides the client texture asset of the baby chicken variant, which represents the texture to use.
*
* @return the baby client texture asset.
*/
ClientTextureAsset babyClientTextureAsset();
/**
* Provides the model of the chicken variant.
*
@@ -48,6 +55,7 @@ public interface ChickenVariantRegistryEntry {
* The following values are required for each builder:
* <ul>
* <li>{@link #clientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #babyClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #model(Model)}</li>
* </ul>
*/
@@ -65,6 +73,16 @@ public interface ChickenVariantRegistryEntry {
@Contract(value = "_ -> this", mutates = "this")
Builder clientTextureAsset(ClientTextureAsset clientTextureAsset);
/**
* Sets the client texture asset of the baby chicken variant, which is the location of the texture to use.
*
* @param babyClientTextureAsset the baby client texture asset.
* @return this builder instance.
* @see ChickenVariantRegistryEntry#babyClientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder babyClientTextureAsset(ClientTextureAsset babyClientTextureAsset);
/**
* Sets the model to use for this chicken variant.
*
@@ -40,6 +40,13 @@ public interface CowVariantRegistryEntry {
*/
ClientTextureAsset clientTextureAsset();
/**
* Provides the client texture asset of the baby cow variant, which represents the texture to use.
*
* @return the baby client texture asset.
*/
ClientTextureAsset babyClientTextureAsset();
/**
* Provides the model of the cow variant.
*
@@ -53,6 +60,7 @@ public interface CowVariantRegistryEntry {
* The following values are required for each builder:
* <ul>
* <li>{@link #clientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #babyClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #model(Model)}</li>
* </ul>
*/
@@ -70,6 +78,16 @@ public interface CowVariantRegistryEntry {
@Contract(value = "_ -> this", mutates = "this")
Builder clientTextureAsset(ClientTextureAsset clientTextureAsset);
/**
* Sets the client texture asset of the baby cow variant, which is the location of the texture to use.
*
* @param babyClientTextureAsset the baby client texture asset.
* @return this builder instance.
* @see CowVariantRegistryEntry#babyClientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder babyClientTextureAsset(ClientTextureAsset babyClientTextureAsset);
/**
* Sets the model to use for this cow variant.
*
@@ -35,6 +35,13 @@ public interface PigVariantRegistryEntry {
*/
ClientTextureAsset clientTextureAsset();
/**
* Provides the client texture asset of the baby pig variant, which represents the texture to use.
*
* @return the baby client texture asset.
*/
ClientTextureAsset babyClientTextureAsset();
/**
* Provides the model of the pig variant.
*
@@ -48,6 +55,7 @@ public interface PigVariantRegistryEntry {
* The following values are required for each builder:
* <ul>
* <li>{@link #clientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #babyClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #model(Model)}</li>
* </ul>
*/
@@ -65,6 +73,16 @@ public interface PigVariantRegistryEntry {
@Contract(value = "_ -> this", mutates = "this")
Builder clientTextureAsset(ClientTextureAsset clientTextureAsset);
/**
* Sets the client texture asset of the baby pig variant, which is the location of the texture to use.
*
* @param babyClientTextureAsset the baby client texture asset.
* @return this builder instance.
* @see PigVariantRegistryEntry#babyClientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder babyClientTextureAsset(ClientTextureAsset babyClientTextureAsset);
/**
* Sets the model to use for this pig variant.
*
@@ -34,6 +34,27 @@ public interface WolfVariantRegistryEntry {
*/
ClientTextureAsset tameClientTextureAsset();
/**
* Provides the client texture asset of the wolf variant for when it is an angry baby.
*
* @return the baby angry client texture asset.
*/
ClientTextureAsset babyAngryClientTextureAsset();
/**
* Provides the client texture asset of the wolf variant for when it is a wild baby.
*
* @return the baby wild client texture asset.
*/
ClientTextureAsset babyWildClientTextureAsset();
/**
* Provides the client texture asset of the wolf variant for when it is a tame baby.
*
* @return the baby tame client texture asset.
*/
ClientTextureAsset babyTameClientTextureAsset();
/**
* A mutable builder for the {@link WolfVariantRegistryEntry} plugins may change in applicable registry events.
* <p>
@@ -42,6 +63,9 @@ public interface WolfVariantRegistryEntry {
* <li>{@link #angryClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #wildClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #tameClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #babyAngryClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #babyWildClientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #babyTameClientTextureAsset(ClientTextureAsset)}</li>
* </ul>
*/
@ApiStatus.Experimental
@@ -77,5 +101,35 @@ public interface WolfVariantRegistryEntry {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder tameClientTextureAsset(ClientTextureAsset tameClientTextureAsset);
/**
* Sets the client texture asset of the wolf variant for when it is an angry baby.
*
* @param babyAngryClientTextureAsset the baby angry client texture asset.
* @return this builder instance.
* @see WolfVariantRegistryEntry#babyAngryClientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder babyAngryClientTextureAsset(ClientTextureAsset babyAngryClientTextureAsset);
/**
* Sets the client texture asset of the wolf variant for when it is a wild baby.
*
* @param babyWildClientTextureAsset the baby wild client texture asset.
* @return this builder instance.
* @see WolfVariantRegistryEntry#babyWildClientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder babyWildClientTextureAsset(ClientTextureAsset babyWildClientTextureAsset);
/**
* Sets the client texture asset of the wolf variant for when it is a tame baby.
*
* @param babyTameClientTextureAsset the baby tame client texture asset.
* @return this builder instance.
* @see WolfVariantRegistryEntry#babyTameClientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder babyTameClientTextureAsset(ClientTextureAsset babyTameClientTextureAsset);
}
}
+14 -13
View File
@@ -1,16 +1,12 @@
package org.bukkit;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryBuilderFactory;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.data.InlinedRegistryBuilderProvider;
import io.papermc.paper.registry.data.PaintingVariantRegistryEntry;
import java.util.Locale;
import java.util.function.Consumer;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.util.OldEnum;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -129,8 +125,8 @@ public interface Art extends OldEnum<Art>, Keyed {
// End generate - Art
@NotNull
private static Art getArt(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PAINTING_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
private static Art getArt(@NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PAINTING_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -209,7 +205,7 @@ public interface Art extends OldEnum<Art>, Keyed {
@Deprecated(since = "1.6.2", forRemoval = true)
@Nullable
static Art getById(int id) {
for (Art art : Registry.ART) {
for (Art art : RegistryAccess.registryAccess().getRegistry(RegistryKey.PAINTING_VARIANT)) {
if (id == art.getId()) {
return art;
}
@@ -231,8 +227,12 @@ public interface Art extends OldEnum<Art>, Keyed {
@Nullable
static Art getByName(@NotNull String name) {
Preconditions.checkArgument(name != null, "Name cannot be null");
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
if (key == null) {
return null;
}
return Bukkit.getUnsafe().get(RegistryKey.PAINTING_VARIANT, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
return Bukkit.getUnsafe().get(RegistryKey.PAINTING_VARIANT, key);
}
/**
@@ -243,18 +243,19 @@ public interface Art extends OldEnum<Art>, Keyed {
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Art valueOf(@NotNull String name) {
Art art = Bukkit.getUnsafe().get(RegistryKey.PAINTING_VARIANT, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
final Art art = key == null ? null : Bukkit.getUnsafe().get(RegistryKey.PAINTING_VARIANT, key);
Preconditions.checkArgument(art != null, "No art found with the name %s", name);
return art;
}
/**
* @return an array of all known arts.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Art[] values() {
return Lists.newArrayList(Registry.ART).toArray(new Art[0]);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PAINTING_VARIANT).stream().toArray(Art[]::new);
}
}
@@ -859,9 +859,13 @@ public final class Bukkit {
/**
* Gets the world with the given name.
*
* <p>This method is considered obsolete and is a candidate for future deprecation.
* Prefer using {@link #getWorld(NamespacedKey)}.</p>
*
* @param name the name of the world to retrieve
* @return a world with the given name, or null if none exists
*/
@ApiStatus.Obsolete
@Nullable
public static World getWorld(@NotNull String name) {
return server.getWorld(name);
@@ -877,7 +881,7 @@ public final class Bukkit {
public static World getWorld(@NotNull UUID uid) {
return server.getWorld(uid);
}
// Paper start
/**
* Gets the world from the given NamespacedKey
*
@@ -899,7 +903,6 @@ public final class Bukkit {
public static World getWorld(@NotNull net.kyori.adventure.key.Key worldKey) {
return server.getWorld(worldKey);
}
// Paper end
/**
* Create a new virtual {@link WorldBorder}.
@@ -1753,7 +1756,7 @@ public final class Bukkit {
// Paper end
/**
* Gets the folder that contains all of the various {@link World}s.
* Gets the folder that contains all the various {@link World}s.
*
* @return folder that contains all worlds
*/
@@ -1,7 +1,9 @@
package org.bukkit;
import net.kyori.adventure.key.Key;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -29,11 +31,23 @@ public interface ChunkSnapshot {
/**
* Gets name of the world containing this chunk
*
* <p>This method is considered obsolete and is a candidate for future deprecation.
* Prefer using {@link #getWorldKey()} as the world identity.</p>
*
* @return Parent World Name
*/
@NotNull
@ApiStatus.Obsolete
String getWorldName();
/**
* Gets the key of the world containing this chunk
*
* @return Parent World Key
*/
@NotNull
Key getWorldKey();
/**
* Get block type for block at corresponding coordinate in the chunk
*
@@ -1,9 +1,10 @@
package org.bukkit;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.util.OldEnum;
import org.jetbrains.annotations.NotNull;
@@ -25,8 +26,8 @@ public interface Fluid extends OldEnum<Fluid>, Keyed {
// End generate - Fluid
@NotNull
private static Fluid getFluid(@NotNull String key) {
return Registry.FLUID.getOrThrow(NamespacedKey.minecraft(key));
private static Fluid getFluid(@NotNull @KeyPattern.Value String key) {
return Registry.FLUID.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -37,18 +38,19 @@ public interface Fluid extends OldEnum<Fluid>, Keyed {
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Fluid valueOf(@NotNull String name) {
Fluid fluid = Bukkit.getUnsafe().get(RegistryKey.FLUID, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
Fluid fluid = key == null ? null : Bukkit.getUnsafe().get(RegistryKey.FLUID, key);
Preconditions.checkArgument(fluid != null, "No fluid found with the name %s", name);
return fluid;
}
/**
* @return an array of all known fluids.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Fluid[] values() {
return Lists.newArrayList(Registry.FLUID).toArray(new Fluid[0]);
return Registry.FLUID.stream().toArray(Fluid[]::new);
}
}
@@ -1,8 +1,8 @@
package org.bukkit;
import com.google.common.collect.Lists;
import java.util.Collection;
import java.util.Collections;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -250,17 +250,17 @@ public abstract class GameEvent implements Keyed {
* Returns the set of all GameEvents.
*
* @return the memoryKeys
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.20.1")
public static Collection<GameEvent> values() {
return Collections.unmodifiableCollection(Lists.newArrayList(Registry.GAME_EVENT));
return Registry.GAME_EVENT.stream().toList();
}
@NotNull
private static GameEvent getEvent(@NotNull String key) {
return Registry.GAME_EVENT.getOrThrow(NamespacedKey.minecraft(key));
private static GameEvent getEvent(@NotNull @KeyPattern.Value String key) {
return Registry.GAME_EVENT.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
// Paper start
/**
@@ -488,6 +488,14 @@ public abstract class GameRule<T> implements net.kyori.adventure.translation.Tra
@NotNull
public abstract Class<T> getType();
/**
* Get the default value of this rule.
*
* @return the default value
*/
@NotNull
public abstract T getDefaultValue();
/**
* Get a {@link GameRule} by its name.
*
@@ -1,5 +1,6 @@
package org.bukkit;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@@ -132,8 +133,9 @@ public final class GameRules {
public static final GameRule<Boolean> WATER_SOURCE_CONVERSION = getRule("water_source_conversion");
// End generate - GameRules
@SuppressWarnings("unchecked")
private static <T> GameRule<T> getRule(@KeyPattern.Value String key) {
return (GameRule<T>) Registry.GAME_RULE.getOrThrow(NamespacedKey.minecraft(key));
return (GameRule<T>) Registry.GAME_RULE.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
private GameRules() {
@@ -1,7 +1,6 @@
package org.bukkit;
import com.google.common.collect.Maps;
import java.util.Map;
import org.apache.commons.lang3.ArrayUtils;
import org.jetbrains.annotations.Nullable;
public enum Instrument {
@@ -9,109 +8,120 @@ public enum Instrument {
/**
* Piano (Harp) is the standard instrument for a note block.
*/
PIANO(0x0, Sound.BLOCK_NOTE_BLOCK_HARP),
PIANO(Sound.BLOCK_NOTE_BLOCK_HARP),
/**
* Bass drum is normally played when a note block is on top of a
* stone-like block.
*/
BASS_DRUM(0x1, Sound.BLOCK_NOTE_BLOCK_BASEDRUM),
BASS_DRUM(Sound.BLOCK_NOTE_BLOCK_BASEDRUM),
/**
* Snare drum is normally played when a note block is on top of a sandy
* block.
*/
SNARE_DRUM(0x2, Sound.BLOCK_NOTE_BLOCK_SNARE),
SNARE_DRUM(Sound.BLOCK_NOTE_BLOCK_SNARE),
/**
* Sticks (Hat) are normally played when a note block is on top of a glass
* block.
*/
STICKS(0x3, Sound.BLOCK_NOTE_BLOCK_HAT),
STICKS(Sound.BLOCK_NOTE_BLOCK_HAT),
/**
* Bass guitar is normally played when a note block is on top of a wooden
* block.
*/
BASS_GUITAR(0x4, Sound.BLOCK_NOTE_BLOCK_BASS),
BASS_GUITAR(Sound.BLOCK_NOTE_BLOCK_BASS),
/**
* Flute is normally played when a note block is on top of a clay block.
*/
FLUTE(0x5, Sound.BLOCK_NOTE_BLOCK_FLUTE),
FLUTE(Sound.BLOCK_NOTE_BLOCK_FLUTE),
/**
* Bell is normally played when a note block is on top of a gold block.
*/
BELL(0x6, Sound.BLOCK_NOTE_BLOCK_BELL),
BELL(Sound.BLOCK_NOTE_BLOCK_BELL),
/**
* Guitar is normally played when a note block is on top of a woolen block.
*/
GUITAR(0x7, Sound.BLOCK_NOTE_BLOCK_GUITAR),
GUITAR(Sound.BLOCK_NOTE_BLOCK_GUITAR),
/**
* Chime is normally played when a note block is on top of a packed ice
* block.
*/
CHIME(0x8, Sound.BLOCK_NOTE_BLOCK_CHIME),
CHIME(Sound.BLOCK_NOTE_BLOCK_CHIME),
/**
* Xylophone is normally played when a note block is on top of a bone block.
*/
XYLOPHONE(0x9, Sound.BLOCK_NOTE_BLOCK_XYLOPHONE),
XYLOPHONE(Sound.BLOCK_NOTE_BLOCK_XYLOPHONE),
/**
* Iron Xylophone is normally played when a note block is on top of an iron block.
*/
IRON_XYLOPHONE(0xA, Sound.BLOCK_NOTE_BLOCK_IRON_XYLOPHONE),
IRON_XYLOPHONE(Sound.BLOCK_NOTE_BLOCK_IRON_XYLOPHONE),
/**
* Cow Bell is normally played when a note block is on top of a soul sand block.
*/
COW_BELL(0xB, Sound.BLOCK_NOTE_BLOCK_COW_BELL),
COW_BELL(Sound.BLOCK_NOTE_BLOCK_COW_BELL),
/**
* Didgeridoo is normally played when a note block is on top of a pumpkin block.
*/
DIDGERIDOO(0xC, Sound.BLOCK_NOTE_BLOCK_DIDGERIDOO),
DIDGERIDOO(Sound.BLOCK_NOTE_BLOCK_DIDGERIDOO),
/**
* Bit is normally played when a note block is on top of an emerald block.
*/
BIT(0xD, Sound.BLOCK_NOTE_BLOCK_BIT),
BIT(Sound.BLOCK_NOTE_BLOCK_BIT),
/**
* Banjo is normally played when a note block is on top of a hay block.
*/
BANJO(0xE, Sound.BLOCK_NOTE_BLOCK_BANJO),
BANJO(Sound.BLOCK_NOTE_BLOCK_BANJO),
/**
* Pling is normally played when a note block is on top of a glowstone block.
*/
PLING(0xF, Sound.BLOCK_NOTE_BLOCK_PLING),
PLING(Sound.BLOCK_NOTE_BLOCK_PLING),
/**
* Trumpet is normally played when a note block is on top of a copper block.
*/
TRUMPET(Sound.BLOCK_NOTE_BLOCK_TRUMPET),
/**
* Trumpet exposed is normally played when a note block is on top of an exposed copper block.
*/
TRUMPET_EXPOSED(Sound.BLOCK_NOTE_BLOCK_TRUMPET_EXPOSED),
/**
* Trumpet oxidized is normally played when a note block is on top of an oxidized copper block.
*/
TRUMPET_OXIDIZED(Sound.BLOCK_NOTE_BLOCK_TRUMPET_OXIDIZED),
/**
* Trumpet weathered is normally played when a note block is on top of a weathered copper block.
*/
TRUMPET_WEATHERED(Sound.BLOCK_NOTE_BLOCK_TRUMPET_WEATHERED),
/**
* Zombie is normally played when a Zombie Head is on top of the note block.
*/
ZOMBIE(0x10, Sound.BLOCK_NOTE_BLOCK_IMITATE_ZOMBIE), // Paper
ZOMBIE(Sound.BLOCK_NOTE_BLOCK_IMITATE_ZOMBIE),
/**
* Skeleton is normally played when a Skeleton Head is on top of the note block.
*/
SKELETON(0x11, Sound.BLOCK_NOTE_BLOCK_IMITATE_SKELETON), // Paper
SKELETON(Sound.BLOCK_NOTE_BLOCK_IMITATE_SKELETON),
/**
* Creeper is normally played when a Creeper Head is on top of the note block.
*/
CREEPER(0x12, Sound.BLOCK_NOTE_BLOCK_IMITATE_CREEPER), // Paper
CREEPER(Sound.BLOCK_NOTE_BLOCK_IMITATE_CREEPER),
/**
* Dragon is normally played when a Dragon Head is on top of the note block.
*/
DRAGON(0x13, Sound.BLOCK_NOTE_BLOCK_IMITATE_ENDER_DRAGON), // Paper
DRAGON(Sound.BLOCK_NOTE_BLOCK_IMITATE_ENDER_DRAGON),
/**
* Wither Skeleton is normally played when a Wither Skeleton Head is on top of the note block.
*/
WITHER_SKELETON(0x14, Sound.BLOCK_NOTE_BLOCK_IMITATE_WITHER_SKELETON), // Paper
WITHER_SKELETON(Sound.BLOCK_NOTE_BLOCK_IMITATE_WITHER_SKELETON),
/**
* Piglin is normally played when a Piglin Head is on top of the note block.
*/
PIGLIN(0x15, Sound.BLOCK_NOTE_BLOCK_IMITATE_PIGLIN), // Paper
PIGLIN(Sound.BLOCK_NOTE_BLOCK_IMITATE_PIGLIN),
/**
* Custom Sound is normally played when a Player Head with the required data is on top of the note block.
*/
CUSTOM_HEAD(0x16, null); // Paper
CUSTOM_HEAD(null);
private final byte type;
private final Sound sound;
private static final Map<Byte, Instrument> BY_DATA = Maps.newHashMap();
// Paper - remove ctor (the server still uses the byte magic value)
private Instrument(final int type, final Sound sound) {
this.type = (byte) type;
Instrument(final Sound sound) {
this.sound = sound;
}
@@ -128,10 +138,11 @@ public enum Instrument {
/**
* @return The type ID of this instrument.
* @deprecated use {@link #ordinal()}, there's no meaning to this id
*/
@org.jetbrains.annotations.ApiStatus.Internal // Paper
@Deprecated(since = "26.1")
public byte getType() {
return this.type;
return (byte) this.ordinal();
}
/**
@@ -139,16 +150,11 @@ public enum Instrument {
*
* @param type The type ID
* @return The instrument
* @deprecated type is just the ordinal of the enum, no meaning in the game
*/
@org.jetbrains.annotations.ApiStatus.Internal // Paper
@Nullable
@Deprecated(since = "26.1")
public static Instrument getByType(final byte type) {
return BY_DATA.get(type);
}
static {
for (Instrument instrument : Instrument.values()) {
BY_DATA.put(instrument.getType(), instrument);
}
return ArrayUtils.get(values(), type);
}
}
@@ -2,6 +2,8 @@ package org.bukkit;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.text.Component;
import org.jspecify.annotations.NullMarked;
@@ -55,8 +57,8 @@ public interface JukeboxSong extends Keyed, Translatable {
JukeboxSong WARD = get("ward");
// End generate - JukeboxSong
private static JukeboxSong get(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.JUKEBOX_SONG).getOrThrow(NamespacedKey.minecraft(key));
private static JukeboxSong get(@KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.JUKEBOX_SONG).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -574,7 +574,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
} else if (o.getWorld() == null || getWorld() == null) {
throw new IllegalArgumentException("Cannot measure distance to a null world");
} else if (o.getWorld() != getWorld()) {
throw new IllegalArgumentException("Cannot measure distance between " + getWorld().getName() + " and " + o.getWorld().getName());
throw new IllegalArgumentException("Cannot measure distance between " + getWorld().getKey() + " and " + o.getWorld().getKey());
}
return NumberConversions.square(x - o.x) + NumberConversions.square(y - o.y) + NumberConversions.square(z - o.z);
@@ -1189,7 +1189,7 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
Map<String, Object> data = new HashMap<String, Object>();
if (this.world != null) {
data.put("world", getWorld().getName());
data.put("world_key", getWorld().getKey().toString());
}
data.put("x", this.x);
@@ -1213,12 +1213,20 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
@NotNull
public static Location deserialize(@NotNull Map<String, Object> args) {
World world = null;
boolean requiresWorld = false;
if (args.containsKey("world")) {
world = Bukkit.getWorld((String) args.get("world"));
if (world == null) {
throw new IllegalArgumentException("unknown world");
}
requiresWorld = true;
}
if (args.containsKey("world_key")) {
world = Bukkit.getWorld(NamespacedKey.fromString((String) args.get("world_key")));
requiresWorld = true;
}
if (requiresWorld && world == null) {
throw new IllegalArgumentException("unknown world");
}
return new Location(world, NumberConversions.toDouble(args.get("x")), NumberConversions.toDouble(args.get("y")), NumberConversions.toDouble(args.get("z")), NumberConversions.toFloat(args.get("yaw")), NumberConversions.toFloat(args.get("pitch")));
}
@@ -1057,6 +1057,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
GLOWSTONE(-1),
GOLD_BLOCK(-1),
GOLD_ORE(-1),
GOLDEN_DANDELION(-1),
GRANITE(-1),
GRANITE_SLAB(-1, Slab.class),
GRANITE_STAIRS(-1, Stairs.class),
@@ -1425,6 +1426,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
POTTED_DEAD_BUSH(-1),
POTTED_FERN(-1),
POTTED_FLOWERING_AZALEA_BUSH(-1),
POTTED_GOLDEN_DANDELION(-1),
POTTED_JUNGLE_SAPLING(-1),
POTTED_LILY_OF_THE_VALLEY(-1),
POTTED_MANGROVE_PROPAGULE(-1),
@@ -3554,10 +3556,12 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
/**
* Get the {@link CreativeCategory} to which this material belongs.
*
* @return the creative category. null if does not belong to a category
* @return the creative category. null if it does not belong to a category
* @deprecated items can belong to multiple creative categories and this is no
* longer implemented, will always be {@link CreativeCategory#BUILDING_BLOCKS} if not null
*/
@Nullable
public CreativeCategory getCreativeCategory() {
@Deprecated(since = "1.20.6", forRemoval = true)
public @Nullable CreativeCategory getCreativeCategory() {
ItemType type = asItemType();
return type == null ? null : type.getCreativeCategory();
}
@@ -1,14 +1,14 @@
package org.bukkit;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryBuilderFactory;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.data.InlinedRegistryBuilderProvider;
import io.papermc.paper.registry.data.InstrumentRegistryEntry;
import java.util.Collection;
import java.util.Collections;
import java.util.function.Consumer;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@@ -46,8 +46,8 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran
public static final MusicInstrument YEARN_GOAT_HORN = getInstrument("yearn_goat_horn");
// End generate - MusicInstrument
private static MusicInstrument getInstrument(final String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.INSTRUMENT).getOrThrow(NamespacedKey.minecraft(key));
private static MusicInstrument getInstrument(final @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.INSTRUMENT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -60,7 +60,7 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran
@Nullable
@Deprecated(since = "1.20.1")
public static MusicInstrument getByKey(final NamespacedKey namespacedKey) {
return Registry.INSTRUMENT.get(namespacedKey);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.INSTRUMENT).get(namespacedKey);
}
/**
@@ -71,7 +71,7 @@ public abstract class MusicInstrument implements Keyed, net.kyori.adventure.tran
*/
@Deprecated(since = "1.20.1")
public static Collection<MusicInstrument> values() {
return Collections.unmodifiableCollection(Lists.newArrayList(Registry.INSTRUMENT));
return RegistryAccess.registryAccess().getRegistry(RegistryKey.INSTRUMENT).stream().toList();
}
/**
@@ -81,7 +81,7 @@ public final class NamespacedKey implements Key, com.destroystokyo.paper.Namespa
private void validate() {
Preconditions.checkArgument(this.namespace.length() + 1 + this.key.length() <= Short.MAX_VALUE, "NamespacedKey must be less than 32768 characters");
checkError("[a-z0-9_-.]", "namespace", this.namespace, Key.checkNamespace(this.namespace));
checkError("[a-z0-9_-.]", "namespace", this.namespace, Key.checkNamespace(this.namespace)); // note: for now we will pretend ".." is a valid namespace like adventure to not break conversion
checkError("[a-z0-9_-./]", "key", this.key, Key.checkValue(this.key));
}
@@ -175,6 +175,8 @@ public enum Particle implements Keyed {
*/
BLOCK_MARKER("block_marker", BlockData.class),
COPPER_FIRE_FLAME("copper_fire_flame"),
PAUSE_MOB_GROWTH("pause_mob_growth"),
RESET_MOB_GROWTH("reset_mob_growth"),
;
private final NamespacedKey key;
@@ -5,6 +5,7 @@ import java.util.List;
import java.util.Random;
import java.util.function.Consumer;
import java.util.function.Predicate;
import io.papermc.paper.world.MoonPhase;
import org.bukkit.block.Biome;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.BlockData;
@@ -526,12 +527,12 @@ public interface RegionAccessor extends Keyed, io.papermc.paper.world.flag.Featu
@NotNull
public <T extends Entity> T addEntity(@NotNull T entity);
// Paper start
/**
* @return the current moon phase at the current time in the world
* @apiNote the returned value may be inaccurate in custom biome using environmental attribute override
*/
@NotNull
io.papermc.paper.world.MoonPhase getMoonPhase();
MoonPhase getMoonPhase();
/**
* Get the world's key
@@ -559,5 +560,4 @@ public interface RegionAccessor extends Keyed, io.papermc.paper.world.flag.Featu
* @return collides or not
*/
boolean hasCollisionsIn(@NotNull org.bukkit.util.BoundingBox boundingBox);
// Paper end
}
@@ -5,6 +5,7 @@ import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import io.papermc.paper.datacomponent.DataComponentType;
import io.papermc.paper.entity.poi.PoiType;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
@@ -280,6 +281,12 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see Villager.Profession
*/
Registry<Villager.Profession> VILLAGER_PROFESSION = registryFor(RegistryKey.VILLAGER_PROFESSION);
/**
* Point of interest types.
*
* @see PoiType
*/
Registry<PoiType> POINT_OF_INTEREST_TYPE = registryFor(RegistryKey.POINT_OF_INTEREST_TYPE);
/**
* Villager type.
*
+26 -7
View File
@@ -5,6 +5,7 @@ import java.awt.image.BufferedImage;
import java.io.File;
import java.io.Serializable;
import java.net.InetAddress;
import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
@@ -792,11 +793,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public void setRespawnWorld(@NotNull World world);
/**
* Gets the world with the given name.
* Gets the world with the given legacy Bukkit name.
*
* @param name the name of the world to retrieve
* @return a world with the given name, or null if none exists
* <p>This method is considered obsolete and is a candidate for future deprecation.
* Prefer using {@link #getWorld(NamespacedKey)}.</p>
*
* @param name the legacy Bukkit name of the world to retrieve
* @return a world with the given legacy Bukkit name, or null if none exists
*/
@ApiStatus.Obsolete
@Nullable
public World getWorld(@NotNull String name);
@@ -1565,7 +1570,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
public ConsoleCommandSender getConsoleSender();
// Paper start
/**
* Creates a special {@link CommandSender} which redirects command feedback (in the form of chat messages) to the
* specified listener. The returned sender will have the same effective permissions as {@link #getConsoleSender()}.
@@ -1575,16 +1579,31 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
@NotNull
public CommandSender createCommandSender(final @NotNull java.util.function.Consumer<? super net.kyori.adventure.text.Component> feedback);
// Paper end
/**
* Gets the folder that contains all of the various {@link World}s.
* Gets the folder that contains {@link #getLevelDirectory()}.
*
* @return folder that contains all worlds
* <p>This is usually the server's current working directory
* but can be overridden using command line flags (i.e. {@code --universe} or {@code --world-container}).</p>
*
* @return folder that contains the level directory
*/
@ApiStatus.Obsolete
@NotNull
public File getWorldContainer();
/**
* Gets the level directory.
*
* <p>This is the {@code ./world} directory in a fresh default server. Contains player data, dimensions, datapacks,
* and other world data.</p>
*
* @return the level directory
*/
@ApiStatus.Experimental
@NotNull
Path getLevelDirectory();
/**
* Gets every player that has ever played on this server.
* <p>
+142 -8
View File
@@ -1,9 +1,10 @@
package org.bukkit;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.util.OldEnum;
import org.jetbrains.annotations.NotNull;
@@ -1075,6 +1076,14 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound BLOCK_NOTE_BLOCK_SNARE = getSound("block.note_block.snare");
Sound BLOCK_NOTE_BLOCK_TRUMPET = getSound("block.note_block.trumpet");
Sound BLOCK_NOTE_BLOCK_TRUMPET_EXPOSED = getSound("block.note_block.trumpet_exposed");
Sound BLOCK_NOTE_BLOCK_TRUMPET_OXIDIZED = getSound("block.note_block.trumpet_oxidized");
Sound BLOCK_NOTE_BLOCK_TRUMPET_WEATHERED = getSound("block.note_block.trumpet_weathered");
Sound BLOCK_NOTE_BLOCK_XYLOPHONE = getSound("block.note_block.xylophone");
Sound BLOCK_NYLIUM_BREAK = getSound("block.nylium.break");
@@ -1739,6 +1748,48 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_AXOLOTL_SWIM = getSound("entity.axolotl.swim");
Sound ENTITY_BABY_CAT_AMBIENT = getSound("entity.baby_cat.ambient");
Sound ENTITY_BABY_CAT_BEG_FOR_FOOD = getSound("entity.baby_cat.beg_for_food");
Sound ENTITY_BABY_CAT_DEATH = getSound("entity.baby_cat.death");
Sound ENTITY_BABY_CAT_EAT = getSound("entity.baby_cat.eat");
Sound ENTITY_BABY_CAT_HISS = getSound("entity.baby_cat.hiss");
Sound ENTITY_BABY_CAT_HURT = getSound("entity.baby_cat.hurt");
Sound ENTITY_BABY_CAT_PURR = getSound("entity.baby_cat.purr");
Sound ENTITY_BABY_CAT_PURREOW = getSound("entity.baby_cat.purreow");
Sound ENTITY_BABY_CAT_STRAY_AMBIENT = getSound("entity.baby_cat.stray_ambient");
Sound ENTITY_BABY_CHICKEN_AMBIENT = getSound("entity.baby_chicken.ambient");
Sound ENTITY_BABY_CHICKEN_DEATH = getSound("entity.baby_chicken.death");
Sound ENTITY_BABY_CHICKEN_HURT = getSound("entity.baby_chicken.hurt");
Sound ENTITY_BABY_CHICKEN_STEP = getSound("entity.baby_chicken.step");
Sound ENTITY_BABY_HORSE_AMBIENT = getSound("entity.baby_horse.ambient");
Sound ENTITY_BABY_HORSE_ANGRY = getSound("entity.baby_horse.angry");
Sound ENTITY_BABY_HORSE_BREATHE = getSound("entity.baby_horse.breathe");
Sound ENTITY_BABY_HORSE_DEATH = getSound("entity.baby_horse.death");
Sound ENTITY_BABY_HORSE_EAT = getSound("entity.baby_horse.eat");
Sound ENTITY_BABY_HORSE_HURT = getSound("entity.baby_horse.hurt");
Sound ENTITY_BABY_HORSE_LAND = getSound("entity.baby_horse.land");
Sound ENTITY_BABY_HORSE_STEP = getSound("entity.baby_horse.step");
Sound ENTITY_BABY_NAUTILUS_AMBIENT = getSound("entity.baby_nautilus.ambient");
Sound ENTITY_BABY_NAUTILUS_AMBIENT_LAND = getSound("entity.baby_nautilus.ambient_land");
@@ -1755,6 +1806,30 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_BABY_NAUTILUS_SWIM = getSound("entity.baby_nautilus.swim");
Sound ENTITY_BABY_PIG_AMBIENT = getSound("entity.baby_pig.ambient");
Sound ENTITY_BABY_PIG_DEATH = getSound("entity.baby_pig.death");
Sound ENTITY_BABY_PIG_EAT = getSound("entity.baby_pig.eat");
Sound ENTITY_BABY_PIG_HURT = getSound("entity.baby_pig.hurt");
Sound ENTITY_BABY_PIG_STEP = getSound("entity.baby_pig.step");
Sound ENTITY_BABY_WOLF_AMBIENT = getSound("entity.baby_wolf.ambient");
Sound ENTITY_BABY_WOLF_DEATH = getSound("entity.baby_wolf.death");
Sound ENTITY_BABY_WOLF_GROWL = getSound("entity.baby_wolf.growl");
Sound ENTITY_BABY_WOLF_HURT = getSound("entity.baby_wolf.hurt");
Sound ENTITY_BABY_WOLF_PANT = getSound("entity.baby_wolf.pant");
Sound ENTITY_BABY_WOLF_STEP = getSound("entity.baby_wolf.step");
Sound ENTITY_BABY_WOLF_WHINE = getSound("entity.baby_wolf.whine");
Sound ENTITY_BAT_AMBIENT = getSound("entity.bat.ambient");
Sound ENTITY_BAT_DEATH = getSound("entity.bat.death");
@@ -1889,6 +1964,24 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_CAT_STRAY_AMBIENT = getSound("entity.cat.stray_ambient");
Sound ENTITY_CAT_ROYAL_AMBIENT = getSound("entity.cat_royal.ambient");
Sound ENTITY_CAT_ROYAL_BEG_FOR_FOOD = getSound("entity.cat_royal.beg_for_food");
Sound ENTITY_CAT_ROYAL_DEATH = getSound("entity.cat_royal.death");
Sound ENTITY_CAT_ROYAL_EAT = getSound("entity.cat_royal.eat");
Sound ENTITY_CAT_ROYAL_HISS = getSound("entity.cat_royal.hiss");
Sound ENTITY_CAT_ROYAL_HURT = getSound("entity.cat_royal.hurt");
Sound ENTITY_CAT_ROYAL_PURR = getSound("entity.cat_royal.purr");
Sound ENTITY_CAT_ROYAL_PURREOW = getSound("entity.cat_royal.purreow");
Sound ENTITY_CAT_ROYAL_STRAY_AMBIENT = getSound("entity.cat_royal.stray_ambient");
Sound ENTITY_CHICKEN_AMBIENT = getSound("entity.chicken.ambient");
Sound ENTITY_CHICKEN_DEATH = getSound("entity.chicken.death");
@@ -1899,6 +1992,12 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_CHICKEN_STEP = getSound("entity.chicken.step");
Sound ENTITY_CHICKEN_PICKY_AMBIENT = getSound("entity.chicken_picky.ambient");
Sound ENTITY_CHICKEN_PICKY_DEATH = getSound("entity.chicken_picky.death");
Sound ENTITY_CHICKEN_PICKY_HURT = getSound("entity.chicken_picky.hurt");
Sound ENTITY_COD_AMBIENT = getSound("entity.cod.ambient");
Sound ENTITY_COD_DEATH = getSound("entity.cod.death");
@@ -1955,6 +2054,14 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_COW_STEP = getSound("entity.cow.step");
Sound ENTITY_COW_MOODY_AMBIENT = getSound("entity.cow_moody.ambient");
Sound ENTITY_COW_MOODY_DEATH = getSound("entity.cow_moody.death");
Sound ENTITY_COW_MOODY_HURT = getSound("entity.cow_moody.hurt");
Sound ENTITY_COW_MOODY_STEP = getSound("entity.cow_moody.step");
Sound ENTITY_CREAKING_ACTIVATE = getSound("entity.creaking.activate");
Sound ENTITY_CREAKING_AMBIENT = getSound("entity.creaking.ambient");
@@ -2651,12 +2758,30 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_PIG_DEATH = getSound("entity.pig.death");
Sound ENTITY_PIG_EAT = getSound("entity.pig.eat");
Sound ENTITY_PIG_HURT = getSound("entity.pig.hurt");
Sound ENTITY_PIG_SADDLE = getSound("entity.pig.saddle");
Sound ENTITY_PIG_STEP = getSound("entity.pig.step");
Sound ENTITY_PIG_BIG_AMBIENT = getSound("entity.pig_big.ambient");
Sound ENTITY_PIG_BIG_DEATH = getSound("entity.pig_big.death");
Sound ENTITY_PIG_BIG_EAT = getSound("entity.pig_big.eat");
Sound ENTITY_PIG_BIG_HURT = getSound("entity.pig_big.hurt");
Sound ENTITY_PIG_MINI_AMBIENT = getSound("entity.pig_mini.ambient");
Sound ENTITY_PIG_MINI_DEATH = getSound("entity.pig_mini.death");
Sound ENTITY_PIG_MINI_EAT = getSound("entity.pig_mini.eat");
Sound ENTITY_PIG_MINI_HURT = getSound("entity.pig_mini.hurt");
Sound ENTITY_PIGLIN_ADMIRING_ITEM = getSound("entity.piglin.admiring_item");
Sound ENTITY_PIGLIN_AMBIENT = getSound("entity.piglin.ambient");
@@ -3475,6 +3600,10 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ITEM_GOAT_HORN_SOUND_7 = getSound("item.goat_horn.sound.7");
Sound ITEM_GOLDEN_DANDELION_UNUSE = getSound("item.golden_dandelion.unuse");
Sound ITEM_GOLDEN_DANDELION_USE = getSound("item.golden_dandelion.use");
Sound ITEM_HOE_TILL = getSound("item.hoe.till");
Sound ITEM_HONEY_BOTTLE_DRINK = getSound("item.honey_bottle.drink");
@@ -3701,8 +3830,8 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
// End generate - Sound
@NotNull
private static Sound getSound(@NotNull String key) {
return Registry.SOUNDS.getOrThrow(NamespacedKey.minecraft(key));
private static Sound getSound(@NotNull @KeyPattern.Value String key) {
return Registry.SOUNDS.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -3713,9 +3842,14 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Sound valueOf(@NotNull String name) {
Sound sound = Bukkit.getUnsafe().get(RegistryKey.SOUND_EVENT, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
if (sound != null) {
return sound;
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
Sound sound;
if (key != null) {
sound = Bukkit.getUnsafe().get(RegistryKey.SOUND_EVENT, key);
if (sound != null) {
return sound;
}
}
// Sound keys can have dots in them which where converted to _. Since converting
@@ -3742,12 +3876,12 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
/**
* @return an array of all known sounds.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Sound[] values() {
return Lists.newArrayList(Registry.SOUNDS).toArray(new Sound[0]);
return Registry.SOUNDS.stream().toArray(Sound[]::new);
}
// Paper start
+181 -27
View File
@@ -48,8 +48,6 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> BAMBOO_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bamboo_blocks"), Material.class);
Tag<Material> BAMBOO_PLANTABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bamboo_plantable_on"), Material.class);
Tag<Material> BANNERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("banners"), Material.class);
Tag<Material> BARS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("bars"), Material.class);
@@ -70,7 +68,9 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> BEEHIVES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beehives"), Material.class);
Tag<Material> BIG_DRIPLEAF_PLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("big_dripleaf_placeable"), Material.class);
Tag<Material> BENEATH_BAMBOO_PODZOL_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beneath_bamboo_podzol_replaceable"), Material.class);
Tag<Material> BENEATH_TREE_PODZOL_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("beneath_tree_podzol_replaceable"), Material.class);
Tag<Material> BIRCH_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("birch_logs"), Material.class);
@@ -90,6 +90,14 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> CANDLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("candles"), Material.class);
Tag<Material> CANNOT_REPLACE_BELOW_TREE_TRUNK = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cannot_replace_below_tree_trunk"), Material.class);
Tag<Material> CANNOT_SUPPORT_KELP = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cannot_support_kelp"), Material.class);
Tag<Material> CANNOT_SUPPORT_SEAGRASS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cannot_support_seagrass"), Material.class);
Tag<Material> CANNOT_SUPPORT_SNOW_LAYER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cannot_support_snow_layer"), Material.class);
Tag<Material> CAULDRONS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cauldrons"), Material.class);
Tag<Material> CAVE_VINES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("cave_vines"), Material.class);
@@ -152,12 +160,14 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> DRIPSTONE_REPLACEABLE_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dripstone_replaceable_blocks"), Material.class);
Tag<Material> DRY_VEGETATION_MAY_PLACE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("dry_vegetation_may_place_on"), Material.class);
Tag<Material> EDIBLE_FOR_SHEEP = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("edible_for_sheep"), Material.class);
Tag<Material> EMERALD_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("emerald_ores"), Material.class);
Tag<Material> ENABLES_BUBBLE_COLUMN_DRAG_DOWN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("enables_bubble_column_drag_down"), Material.class);
Tag<Material> ENABLES_BUBBLE_COLUMN_PUSH_UP = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("enables_bubble_column_push_up"), Material.class);
Tag<Material> ENCHANTMENT_POWER_PROVIDER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("enchantment_power_provider"), Material.class);
Tag<Material> ENCHANTMENT_POWER_TRANSMITTER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("enchantment_power_transmitter"), Material.class);
@@ -178,6 +188,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> FLOWERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("flowers"), Material.class);
Tag<Material> FOREST_ROCK_CAN_PLACE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("forest_rock_can_place_on"), Material.class);
Tag<Material> FOXES_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("foxes_spawnable_on"), Material.class);
Tag<Material> FROG_PREFER_JUMP_TO = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("frog_prefer_jump_to"), Material.class);
@@ -190,14 +202,24 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> GOLD_ORES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("gold_ores"), Material.class);
Tag<Material> GRASS_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("grass_blocks"), Material.class);
Tag<Material> GROWS_CROPS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("grows_crops"), Material.class);
Tag<Material> GUARDED_BY_PIGLINS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("guarded_by_piglins"), Material.class);
Tag<Material> HAPPY_GHAST_AVOIDS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("happy_ghast_avoids"), Material.class);
Tag<Material> HOGLIN_REPELLENTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("hoglin_repellents"), Material.class);
Tag<Material> HUGE_BROWN_MUSHROOM_CAN_PLACE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("huge_brown_mushroom_can_place_on"), Material.class);
Tag<Material> HUGE_RED_MUSHROOM_CAN_PLACE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("huge_red_mushroom_can_place_on"), Material.class);
Tag<Material> ICE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("ice"), Material.class);
Tag<Material> ICE_SPIKE_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("ice_spike_replaceable"), Material.class);
Tag<Material> IMPERMEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("impermeable"), Material.class);
Tag<Material> INCORRECT_FOR_COPPER_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("incorrect_for_copper_tool"), Material.class);
@@ -264,9 +286,11 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> MOOSHROOMS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mooshrooms_spawnable_on"), Material.class);
Tag<Material> MOSS_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("moss_blocks"), Material.class);
Tag<Material> MOSS_REPLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("moss_replaceable"), Material.class);
Tag<Material> MUSHROOM_GROW_BLOCK = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mushroom_grow_block"), Material.class);
Tag<Material> MUD = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("mud"), Material.class);
Tag<Material> NEEDS_DIAMOND_TOOL = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("needs_diamond_tool"), Material.class);
@@ -282,6 +306,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> OCCLUDES_VIBRATION_SIGNALS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("occludes_vibration_signals"), Material.class);
Tag<Material> OVERRIDES_MUSHROOM_LIGHT_REQUIREMENT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("overrides_mushroom_light_requirement"), Material.class);
Tag<Material> OVERWORLD_CARVER_REPLACEABLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("overworld_carver_replaceables"), Material.class);
Tag<Material> OVERWORLD_NATURAL_LOGS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("overworld_natural_logs"), Material.class);
@@ -302,6 +328,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> PREVENT_MOB_SPAWNING_INSIDE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("prevent_mob_spawning_inside"), Material.class);
Tag<Material> PREVENTS_NEARBY_LEAF_DECAY = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("prevents_nearby_leaf_decay"), Material.class);
Tag<Material> RABBITS_SPAWNABLE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("rabbits_spawnable_on"), Material.class);
Tag<Material> RAILS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("rails"), Material.class);
@@ -328,8 +356,6 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> SLABS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("slabs"), Material.class);
Tag<Material> SMALL_DRIPLEAF_PLACEABLE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("small_dripleaf_placeable"), Material.class);
Tag<Material> SMALL_FLOWERS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("small_flowers"), Material.class);
Tag<Material> SMELTS_TO_GLASS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("smelts_to_glass"), Material.class);
@@ -342,10 +368,6 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> SNOW = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow"), Material.class);
Tag<Material> SNOW_LAYER_CAN_SURVIVE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow_layer_can_survive_on"), Material.class);
Tag<Material> SNOW_LAYER_CANNOT_SURVIVE_ON = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("snow_layer_cannot_survive_on"), Material.class);
Tag<Material> SOUL_FIRE_BASE_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("soul_fire_base_blocks"), Material.class);
Tag<Material> SOUL_SPEED_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("soul_speed_blocks"), Material.class);
@@ -366,6 +388,72 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> STRIDER_WARM_BLOCKS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("strider_warm_blocks"), Material.class);
Tag<Material> SUBSTRATE_OVERWORLD = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("substrate_overworld"), Material.class);
Tag<Material> SUPPORT_OVERRIDE_CACTUS_FLOWER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("support_override_cactus_flower"), Material.class);
Tag<Material> SUPPORT_OVERRIDE_SNOW_LAYER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("support_override_snow_layer"), Material.class);
Tag<Material> SUPPORTS_AZALEA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_azalea"), Material.class);
Tag<Material> SUPPORTS_BAMBOO = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_bamboo"), Material.class);
Tag<Material> SUPPORTS_BIG_DRIPLEAF = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_big_dripleaf"), Material.class);
Tag<Material> SUPPORTS_CACTUS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_cactus"), Material.class);
Tag<Material> SUPPORTS_CHORUS_FLOWER = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_chorus_flower"), Material.class);
Tag<Material> SUPPORTS_CHORUS_PLANT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_chorus_plant"), Material.class);
Tag<Material> SUPPORTS_COCOA = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_cocoa"), Material.class);
Tag<Material> SUPPORTS_CRIMSON_FUNGUS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_crimson_fungus"), Material.class);
Tag<Material> SUPPORTS_CRIMSON_ROOTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_crimson_roots"), Material.class);
Tag<Material> SUPPORTS_CROPS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_crops"), Material.class);
Tag<Material> SUPPORTS_DRY_VEGETATION = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_dry_vegetation"), Material.class);
Tag<Material> SUPPORTS_FROGSPAWN = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_frogspawn"), Material.class);
Tag<Material> SUPPORTS_HANGING_MANGROVE_PROPAGULE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_hanging_mangrove_propagule"), Material.class);
Tag<Material> SUPPORTS_LILY_PAD = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_lily_pad"), Material.class);
Tag<Material> SUPPORTS_MANGROVE_PROPAGULE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_mangrove_propagule"), Material.class);
Tag<Material> SUPPORTS_MELON_STEM = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_melon_stem"), Material.class);
Tag<Material> SUPPORTS_MELON_STEM_FRUIT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_melon_stem_fruit"), Material.class);
Tag<Material> SUPPORTS_NETHER_SPROUTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_nether_sprouts"), Material.class);
Tag<Material> SUPPORTS_NETHER_WART = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_nether_wart"), Material.class);
Tag<Material> SUPPORTS_PUMPKIN_STEM = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_pumpkin_stem"), Material.class);
Tag<Material> SUPPORTS_PUMPKIN_STEM_FRUIT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_pumpkin_stem_fruit"), Material.class);
Tag<Material> SUPPORTS_SMALL_DRIPLEAF = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_small_dripleaf"), Material.class);
Tag<Material> SUPPORTS_STEM_CROPS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_stem_crops"), Material.class);
Tag<Material> SUPPORTS_STEM_FRUIT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_stem_fruit"), Material.class);
Tag<Material> SUPPORTS_SUGAR_CANE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_sugar_cane"), Material.class);
Tag<Material> SUPPORTS_SUGAR_CANE_ADJACENTLY = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_sugar_cane_adjacently"), Material.class);
Tag<Material> SUPPORTS_VEGETATION = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_vegetation"), Material.class);
Tag<Material> SUPPORTS_WARPED_FUNGUS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_warped_fungus"), Material.class);
Tag<Material> SUPPORTS_WARPED_ROOTS = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_warped_roots"), Material.class);
Tag<Material> SUPPORTS_WITHER_ROSE = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("supports_wither_rose"), Material.class);
Tag<Material> SWORD_EFFICIENT = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sword_efficient"), Material.class);
Tag<Material> SWORD_INSTANTLY_MINES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("sword_instantly_mines"), Material.class);
@@ -478,8 +566,12 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_CANDLES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("candles"), Material.class);
Tag<Material> ITEMS_CAT_COLLAR_DYES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cat_collar_dyes"), Material.class);
Tag<Material> ITEMS_CAT_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cat_food"), Material.class);
Tag<Material> ITEMS_CAULDRON_CAN_REMOVE_DYE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cauldron_can_remove_dye"), Material.class);
Tag<Material> ITEMS_CHAINS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("chains"), Material.class);
Tag<Material> ITEMS_CHERRY_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cherry_logs"), Material.class);
@@ -538,7 +630,7 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_DUPLICATES_ALLAYS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("duplicates_allays"), Material.class);
Tag<Material> ITEMS_DYEABLE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("dyeable"), Material.class);
Tag<Material> ITEMS_DYES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("dyes"), Material.class);
Tag<Material> ITEMS_EGGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("eggs"), Material.class);
@@ -612,6 +704,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_GOLD_TOOL_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("gold_tool_materials"), Material.class);
Tag<Material> ITEMS_GRASS_BLOCKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("grass_blocks"), Material.class);
Tag<Material> ITEMS_HANGING_SIGNS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("hanging_signs"), Material.class);
Tag<Material> ITEMS_HAPPY_GHAST_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("happy_ghast_food"), Material.class);
@@ -658,12 +752,22 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_LOGS_THAT_BURN = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("logs_that_burn"), Material.class);
Tag<Material> ITEMS_LOOM_DYES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("loom_dyes"), Material.class);
Tag<Material> ITEMS_LOOM_PATTERNS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("loom_patterns"), Material.class);
Tag<Material> ITEMS_MANGROVE_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("mangrove_logs"), Material.class);
Tag<Material> ITEMS_MAP_INVISIBILITY_EQUIPMENT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("map_invisibility_equipment"), Material.class);
Tag<Material> ITEMS_MEAT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("meat"), Material.class);
Tag<Material> ITEMS_METAL_NUGGETS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("metal_nuggets"), Material.class);
Tag<Material> ITEMS_MOSS_BLOCKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("moss_blocks"), Material.class);
Tag<Material> ITEMS_MUD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("mud"), Material.class);
Tag<Material> ITEMS_NAUTILUS_BUCKET_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("nautilus_bucket_food"), Material.class);
Tag<Material> ITEMS_NAUTILUS_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("nautilus_food"), Material.class);
@@ -802,6 +906,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_WITHER_SKELETON_DISLIKED_WEAPONS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wither_skeleton_disliked_weapons"), Material.class);
Tag<Material> ITEMS_WOLF_COLLAR_DYES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wolf_collar_dyes"), Material.class);
Tag<Material> ITEMS_WOLF_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wolf_food"), Material.class);
Tag<Material> ITEMS_WOODEN_BUTTONS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wooden_buttons"), Material.class);
@@ -830,8 +936,16 @@ public interface Tag<T extends Keyed> extends Keyed {
String REGISTRY_FLUIDS = "fluids";
Tag<Fluid> FLUIDS_BUBBLE_COLUMN_CAN_OCCUPY = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("bubble_column_can_occupy"), Fluid.class);
Tag<Fluid> FLUIDS_LAVA = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("lava"), Fluid.class);
Tag<Fluid> FLUIDS_SUPPORTS_FROGSPAWN = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("supports_frogspawn"), Fluid.class);
Tag<Fluid> FLUIDS_SUPPORTS_LILY_PAD = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("supports_lily_pad"), Fluid.class);
Tag<Fluid> FLUIDS_SUPPORTS_SUGAR_CANE_ADJACENTLY = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("supports_sugar_cane_adjacently"), Fluid.class);
Tag<Fluid> FLUIDS_WATER = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("water"), Fluid.class);
String REGISTRY_ENTITY_TYPES = "entity_types";
@@ -870,6 +984,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<EntityType> ENTITY_TYPES_CANDIDATE_FOR_IRON_GOLEM_GIFT = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("candidate_for_iron_golem_gift"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CANNOT_BE_AGE_LOCKED = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("cannot_be_age_locked"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CANNOT_BE_PUSHED_ONTO_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("cannot_be_pushed_onto_boats"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_DEFLECTS_PROJECTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("deflects_projectiles"), EntityType.class);
@@ -940,18 +1056,54 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<GameEvent> GAME_EVENT_WARDEN_CAN_LISTEN = Bukkit.getTag(REGISTRY_GAME_EVENTS, NamespacedKey.minecraft("warden_can_listen"), GameEvent.class);
// End generate - Tag
//<editor-fold desc="deprecated tags" defaultstate="collapsed">
/**
* @deprecated {@link #WOOL_CARPETS}.
* @deprecated replaced by {@link #WOOL_CARPETS}.
*/
@Deprecated(since = "1.19")
@Deprecated(since = "1.19", forRemoval = true)
Tag<Material> CARPETS = WOOL_CARPETS;
/**
* @deprecated replaced by {@link #CANNOT_SUPPORT_SNOW_LAYER}
*/
@Deprecated(since = "26.1", forRemoval = true)
Tag<Material> SNOW_LAYER_CANNOT_SURVIVE_ON = CANNOT_SUPPORT_SNOW_LAYER;
/**
* @deprecated replaced by {@link #SUPPORT_OVERRIDE_SNOW_LAYER}
*/
@Deprecated(since = "26.1", forRemoval = true)
Tag<Material> SNOW_LAYER_CAN_SURVIVE_ON = SUPPORT_OVERRIDE_SNOW_LAYER;
/**
* @deprecated partially replaced by {@link #OVERRIDES_MUSHROOM_LIGHT_REQUIREMENT}
*/
@Deprecated(since = "26.1", forRemoval = true)
Tag<Material> MUSHROOM_GROW_BLOCK = OVERRIDES_MUSHROOM_LIGHT_REQUIREMENT;
/**
* @deprecated replaced by {@link #SUPPORTS_SMALL_DRIPLEAF}
*/
@Deprecated(since = "26.1", forRemoval = true)
Tag<Material> SMALL_DRIPLEAF_PLACEABLE = SUPPORTS_SMALL_DRIPLEAF;
/**
* @deprecated replaced by {@link #SUPPORTS_BIG_DRIPLEAF}
*/
@Deprecated(since = "26.1", forRemoval = true)
Tag<Material> BIG_DRIPLEAF_PLACEABLE = SUPPORTS_BIG_DRIPLEAF;
/**
* @deprecated replaced by {@link #SUPPORTS_BAMBOO}
*/
@Deprecated(since = "26.1", forRemoval = true)
Tag<Material> BAMBOO_PLANTABLE_ON = SUPPORTS_BAMBOO;
/**
* @deprecated replaced by {@link #SUPPORTS_DRY_VEGETATION}
*/
@Deprecated(since = "26.1", forRemoval = true)
Tag<Material> DRY_VEGETATION_MAY_PLACE_ON = SUPPORTS_DRY_VEGETATION;
/**
* Vanilla block tag representing all blocks which dead bushes may be placed on.
*
* @deprecated partially replaced by {@link #DRY_VEGETATION_MAY_PLACE_ON}
* @deprecated partially replaced by {@link #SUPPORTS_DRY_VEGETATION}
*/
@Deprecated(since = "1.21.5", forRemoval = true)
Tag<Material> DEAD_BUSH_MAY_PLACE_ON = DRY_VEGETATION_MAY_PLACE_ON;
Tag<Material> DEAD_BUSH_MAY_PLACE_ON = SUPPORTS_DRY_VEGETATION;
/**
* @deprecated replaced by {@link #TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS}
*/
@@ -961,23 +1113,23 @@ public interface Tag<T extends Keyed> extends Keyed {
* Vanilla block tag representing all blocks that are replaceable by
* dripstone.
*
* @deprecated use {@link #DRIPSTONE_REPLACEABLE_BLOCKS}
* @deprecated replaced by {@link #DRIPSTONE_REPLACEABLE_BLOCKS}
*/
@Deprecated(since = "1.21.4", forRemoval = true)
Tag<Material> DRIPSTONE_REPLACEABLE = DRIPSTONE_REPLACEABLE_BLOCKS;
/**
* Vanilla item tag representing all piglin food.
*
* @deprecated use {@link #ITEMS_PIGLIN_FOOD}
* @deprecated replaced by {@link #ITEMS_PIGLIN_FOOD}
*/
@Deprecated(since = "1.20.5")
@Deprecated(since = "1.20.5", forRemoval = true)
Tag<Material> PIGLIN_FOOD = ITEMS_PIGLIN_FOOD;
/**
* Vanilla item tag representing all fox food.
*
* @deprecated use {@link #ITEMS_FOX_FOOD}
* @deprecated replaced by {@link #ITEMS_FOX_FOOD}
*/
@Deprecated(since = "1.20.5")
@Deprecated(since = "1.20.5", forRemoval = true)
Tag<Material> FOX_FOOD = ITEMS_FOX_FOOD;
/**
* Vanilla item tag representing all furnace materials.
@@ -989,7 +1141,7 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla item tag representing all items which modify note block sounds when placed on top.
*
* @deprecated use {@link #ITEMS_NOTEBLOCK_TOP_INSTRUMENTS}
* @deprecated replaced by {@link #ITEMS_NOTEBLOCK_TOP_INSTRUMENTS}
*/
@Deprecated(since = "1.21.4", forRemoval = true)
Tag<Material> ITEMS_NOTE_BLOCK_TOP_INSTRUMENTS = ITEMS_NOTEBLOCK_TOP_INSTRUMENTS;
@@ -1005,16 +1157,18 @@ public interface Tag<T extends Keyed> extends Keyed {
/**
* Vanilla item tag representing all items which tempt axolotls.
*
* @deprecated use {@link #ITEMS_AXOLOTL_FOOD}
* @deprecated replaced by {@link #ITEMS_AXOLOTL_FOOD}
*/
@Deprecated(since = "1.20.5")
@Deprecated(since = "1.20.5", forRemoval = true)
Tag<Material> AXOLOTL_TEMPT_ITEMS = ITEMS_AXOLOTL_FOOD;
/**
* Vanilla tag representing entities which deflect arrows.
* @deprecated use {@link #ENTITY_TYPES_DEFLECTS_PROJECTILES}
*
* @deprecated replaced by {@link #ENTITY_TYPES_DEFLECTS_PROJECTILES}
*/
@Deprecated(since = "1.20.5")
@Deprecated(since = "1.20.5", forRemoval = true)
Tag<EntityType> ENTITY_TYPES_DEFLECTS_ARROWS = ENTITY_TYPES_DEFLECTS_PROJECTILES;
//</editor-fold>
/**
* Returns whether or not this tag has an entry for the specified item.
@@ -7,7 +7,6 @@ import net.kyori.adventure.text.event.HoverEvent;
import org.bukkit.advancement.Advancement;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.block.Biome;
import org.bukkit.block.data.BlockData;
import org.bukkit.damage.DamageSource;
import org.bukkit.damage.DamageType;
@@ -60,7 +59,7 @@ public interface UnsafeValues {
int getDataVersion();
ItemStack modifyItemStack(ItemStack stack, String arguments);
ItemStack modifyItemStack(ItemStack item, String components);
void checkSupported(PluginDescriptionFile pdf) throws InvalidPluginException;
@@ -142,7 +141,7 @@ public interface UnsafeValues {
String get(Class<?> aClass, String value);
@ApiStatus.Internal
<B extends Keyed> B get(RegistryKey<B> registry, NamespacedKey key);
@Nullable <B extends Keyed> B get(RegistryKey<B> registry, NamespacedKey key);
// Paper start
@Deprecated(forRemoval = true)
+86 -12
View File
@@ -1,5 +1,7 @@
package org.bukkit;
import io.papermc.paper.entity.poi.PoiSearchResult;
import io.papermc.paper.entity.poi.PoiType;
import io.papermc.paper.raytracing.PositionedRayTraceConfigurationBuilder;
import java.io.File;
import java.nio.file.Path;
@@ -43,6 +45,7 @@ import org.bukkit.util.BoundingBox;
import org.bukkit.util.RayTraceResult;
import org.bukkit.util.StructureSearchResult;
import org.bukkit.util.Vector;
import org.checkerframework.checker.index.qual.Positive;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
@@ -1809,7 +1812,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
@Nullable
default RayTraceResult rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate<? super Entity> filter) {
return this.rayTraceEntities(start, direction, maxDistance, 0.0D, filter);
return this.rayTraceEntities(start, direction, maxDistance, 0.0, filter);
}
/**
@@ -2051,7 +2054,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
/**
* Gets the relative in-game time of this world.
* Gets the relative in-game time of this world, or {@code 0} if this world does not have a world clock.
* <p>
* The relative time is analogous to hours * 1000
*
@@ -2076,7 +2079,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
public void setTime(long time);
/**
* Gets the full in-game time on this world
* Gets the full in-game time on this world, or {@code 0} if this world does not have a world clock.
*
* @return The current absolute time
* @see #getTime() Returns a relative time of this world
@@ -2091,7 +2094,10 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*
* @param time The new absolute time to set this world to
* @see #setTime(long) Sets the relative time of this world
* @deprecated all overworlds share the same world clock by default now
* @throws IllegalArgumentException if this world does not have a world clock (e.g. the nether)
*/
@Deprecated // TODO world clock API with links to it
public void setFullTime(long time);
// Paper start
@@ -2766,10 +2772,11 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Gets if this world is natural.
* <p>
* When false, the moon is not visible and eyeblossoms do not open/close
* When true, eyeblossoms cycle open/close, nether portals can spawn
* zombified piglins and creaking heart works
*
* @return true if world is natural
* @deprecated replaced by the gameplay/eyeblossom_open and gameplay/creaking_active environment attributes
* @deprecated replaced by the gameplay/nether_portal_spawns_piglin, gameplay/eyeblossom_open and gameplay/creaking_active environmental attributes
*/
@Deprecated(since = "1.21.11")
public boolean isNatural();
@@ -2781,7 +2788,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* not always be the case.
*
* @return true if beds work in this world
* @deprecated Due to 1.21.11 beds changes, a boolean no longer
* @deprecated due to 1.21.11 beds changes, a boolean no longer
* represents if they work. There is no replacement API yet
*/
@ApiStatus.Obsolete(since = "1.21.11")
@@ -2806,6 +2813,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* transforming to zombified piglins.
*
* @return true if piglins will not transform to zombified piglins
* @apiNote the returned value may be inaccurate in custom biome using environmental attribute override
*/
public boolean isPiglinSafe();
@@ -2813,6 +2821,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* Gets if this world allows players to charge and use respawn anchors.
*
* @return true if players can charge and use respawn anchors
* @apiNote the returned value may be inaccurate in custom biome using environmental attribute override
*/
public boolean isRespawnAnchorWorks();
@@ -2821,6 +2830,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* raid.
*
* @return true if raids will be triggered
* @apiNote the returned value may be inaccurate in custom biome using environmental attribute override
*/
public boolean hasRaids();
@@ -2834,7 +2844,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* </ul>
*
* @return true if this world has the above mechanics
* @deprecated as of 1.21.11, ultra warm is replaced by the WATER_EVAPORATES, FAST_LAVA, and DEFAULT_DRIPSTONE_PARTICLE environment attributes.
* @deprecated replaced by the gameplay/water_evaporates and gameplay/fast_lava environmental attributes
*/
@Deprecated(since = "1.21.11")
public boolean isUltraWarm();
@@ -3799,8 +3809,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param <T> the GameRule's type
* @return the current value
*/
@Nullable
public <T> T getGameRuleValue(@NotNull GameRule<T> rule);
public @NotNull <T> T getGameRuleValue(@NotNull GameRule<T> rule);
/**
* Get the default value for a given {@link GameRule}. This value is not
@@ -3809,9 +3818,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param rule the rule to return a default value for
* @param <T> the type of GameRule
* @return the default value
* @deprecated use {@link GameRule#getDefaultValue()} instead
*/
@Nullable
public <T> T getGameRuleDefault(@NotNull GameRule<T> rule);
@Deprecated(since = "26.1.2")
default <T> @NotNull T getGameRuleDefault(@NotNull GameRule<T> rule) {
return rule.getDefaultValue();
}
/**
* Set the given {@link GameRule}'s new value.
@@ -4104,7 +4116,6 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
public <T> void spawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force);
// Paper end
/**
* Spawns the particle (the number of times specified by count)
* at the target location. The position of each particle will be
@@ -4291,6 +4302,69 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
return java.util.Optional.ofNullable(this.locateNearestBiome(origin, radius, step, step, biome)).map(BiomeSearchResult::getLocation).orElse(null);
}
/**
* Finds the nearest point of interest closest to the given location
* without any occupancy restriction.
*
* @param origin where to start looking for a new point of interest at
* @param poiType the poi type to find
* @param radius the radius
* @return a location at the nearest PoiType or {@code null} if no poi was found
*/
@Nullable
default Location locateNearestPoi(@NotNull Location origin, @NotNull PoiType poiType, @Positive int radius) {
return this.locateNearestPoi(origin, poiType, radius, PoiType.Occupancy.ANY);
}
/**
* Finds the nearest point of interest closest to the given location.
* <p>
* {@link PoiType} that return {@code false} for {@link PoiType#hasOccupants()}
* may not behave as expected for given occupancies other than
* {@link PoiType.Occupancy#ANY}.
*
* @param origin where to start looking for a new point of interest at
* @param poiType the poi type to find
* @param radius the radius
* @param occupancy the current required occupancy of the point of interest
* @return a location at the nearest PoiType or {@code null} if no poi was found
*/
@Nullable
Location locateNearestPoi(@NotNull Location origin, @NotNull PoiType poiType, @Positive int radius, @NotNull PoiType.Occupancy occupancy);
/**
* Finds all valid {@link PoiType} in the provided radius and returns them
* in a list format without any occupancy restriction.
*
* @param origin the center point of the radius
* @param poiTypePredicate the predicate to test whether a PoiType
* can be collected into the result
* @param radius the radius
* @return a list of search results containing all found Poi's in the range
*/
@NotNull
default List<PoiSearchResult> locateAllPoiInRange(@NotNull Location origin, @NotNull Predicate<PoiType> poiTypePredicate, @Positive int radius) {
return this.locateAllPoiInRange(origin, poiTypePredicate, radius, PoiType.Occupancy.ANY);
}
/**
* Finds all valid {@link PoiType} in the provided radius and returns them
* in a list format.
* <p>
* {@link PoiType} that return false for {@link PoiType#hasOccupants()}
* may not behave as expected for given occupancies other than
* {@link PoiType.Occupancy#ANY}.
*
* @param origin the center point of the radius
* @param poiTypePredicate the predicate to test whether a PoiType
* can be collected into the result
* @param radius the radius
* @param occupancy the current required occupancy of the point of interest
* @return a list of search results containing all found Poi's in the range
*/
@NotNull
List<PoiSearchResult> locateAllPoiInRange(@NotNull Location origin, @NotNull Predicate<PoiType> poiTypePredicate, @Positive int radius, @NotNull PoiType.Occupancy occupancy);
/**
* Gets the coordinate scaling of this world.
*
@@ -36,7 +36,7 @@ public interface WorldBorder {
*
* @param newSize The new size of the border.
*
* @throws IllegalArgumentException if newSize is less than 1.0D or greater than {@link #getMaxSize()}
* @throws IllegalArgumentException if newSize is less than 1.0 or greater than {@link #getMaxSize()}
* @see #changeSize(double, long)
*/
void setSize(double newSize);
@@ -47,7 +47,7 @@ public interface WorldBorder {
* @param newSize The new side length of the border.
* @param ticks The time in ticks in which the border grows or shrinks from the previous size to that being set.
*
* @throws IllegalArgumentException if newSize is less than 1.0D or greater than {@link #getMaxSize()}
* @throws IllegalArgumentException if newSize is less than 1.0 or greater than {@link #getMaxSize()}
* @throws IllegalArgumentException if ticks is out of range
* @see #setSize(double)
*/
@@ -64,7 +64,7 @@ public interface WorldBorder {
*/
@Deprecated(since = "1.21.11", forRemoval = true)
default void setSize(double newSize, long seconds) {
this.changeSize(Math.clamp(newSize, 1.0D, this.getMaxSize()), Tick.tick().fromDuration(Duration.ofSeconds(seconds)));
this.changeSize(Math.clamp(newSize, 1.0, this.getMaxSize()), Tick.tick().fromDuration(Duration.ofSeconds(seconds)));
}
/**
@@ -74,7 +74,7 @@ public interface WorldBorder {
* @param unit The time unit.
* @param time The time in which the border grows or shrinks from the previous size to that being set.
*
* @throws IllegalArgumentException if newSize is less than 1.0D or greater than {@link #getMaxSize()}
* @throws IllegalArgumentException if newSize is less than 1.0 or greater than {@link #getMaxSize()}
* @throws IllegalArgumentException if time is out of range once converted in ticks
* @deprecated Use {@link #changeSize(double, long)} instead
*/
@@ -2,10 +2,12 @@ package org.bukkit;
import com.google.common.base.Preconditions;
import java.util.Random;
import io.papermc.paper.math.Position;
import org.bukkit.command.CommandSender;
import org.bukkit.generator.BiomeProvider;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -25,17 +27,23 @@ public class WorldCreator {
private boolean hardcore = false;
private boolean bonusChest = false;
private @Nullable Position spawnPositionOverride;
private @Nullable Float spawnYawOverride;
private @Nullable Float spawnPitchOverride;
/**
* Creates an empty WorldCreationOptions for the given world name
* Creates an empty WorldCreationOptions for the given world name.
*
* <p>Prefer {@link #ofKey(NamespacedKey)} for new or already-migrated worlds.</p>
*
* @param name Name of the world that will be created
*/
@ApiStatus.Obsolete
public WorldCreator(@NotNull String name) {
// Paper start
this(name, getWorldKey(name));
this(name, null);
}
private static NamespacedKey getWorldKey(String name) {
private static NamespacedKey defaultWorldKey(String name) {
final String mainLevelName = Bukkit.getUnsafe().getMainLevelName();
if (name.equals(mainLevelName)) {
return NamespacedKey.minecraft("overworld");
@@ -48,29 +56,46 @@ public class WorldCreator {
}
}
private static String nameFromKey(NamespacedKey key) {
if (key.getNamespace().equals("minecraft")) {
// This way, plugins can load legacy worlds by the 'minecraft:<name>' key.
return key.getKey();
}
return key.getNamespace() + "_" + key.getKey();
}
/**
* Creates an empty WorldCreator for the given world name and key
* Creates an empty WorldCreator for the given world name or key.
*
* @param levelName LevelName of the world that will be created
* @param worldKey NamespacedKey of the world that will be created
* @deprecated To load unconverted pre-26.1 worlds identified by their name (custom key was never persisted), use
* {@link #WorldCreator(String)}. For new worlds and already-converted worlds, prefer {@link #ofKey(NamespacedKey)}.
*/
public WorldCreator(@NotNull String levelName, @NotNull NamespacedKey worldKey) {
if (levelName == null || worldKey == null) {
throw new IllegalArgumentException("World name and key cannot be null");
@Deprecated(since = "26.1")
public WorldCreator(@Nullable String levelName, @Nullable NamespacedKey worldKey) {
if (levelName == null && worldKey == null) {
throw new IllegalArgumentException("World name and key cannot both be null");
}
this.name = levelName;
if (levelName != null && worldKey != null) {
throw new IllegalArgumentException("World name and key cannot both be specified");
}
this.name = levelName == null ? nameFromKey(worldKey) : levelName;
this.seed = (new Random()).nextLong();
this.key = worldKey;
this.key = worldKey == null ? defaultWorldKey(levelName) : worldKey;
}
/**
* Creates an empty WorldCreator for the given key.
* LevelName will be the Key part of the NamespacedKey.
*
* <p>Note: Prior to 26.1, custom world keys were never persisted. To load unconverted pre-26.1 worlds created
* with this method, use {@link #WorldCreator(String)} with {@link NamespacedKey#getKey()}, or use this method
* with {@link NamespacedKey#minecraft(String)} and {@link NamespacedKey#getKey()}.</p>
*
* @param worldKey NamespacedKey of the world that will be created
*/
public WorldCreator(@NotNull NamespacedKey worldKey) {
this(worldKey.getKey(), worldKey);
this(null, worldKey);
}
/**
@@ -88,15 +113,24 @@ public class WorldCreator {
*
* @param levelName LevelName of the world that will be created
* @param worldKey NamespacedKey of the world that will be created
* @deprecated Prior to 26.1, custom world keys were never persisted. To load unconverted pre-26.1 worlds created
* with this method, use {@link #WorldCreator(String)} with the name.
*/
@Deprecated(since = "26.1")
@NotNull
public static WorldCreator ofNameAndKey(@NotNull String levelName, @NotNull NamespacedKey worldKey) {
return new WorldCreator(levelName, worldKey);
if (!defaultWorldKey(levelName).equals(worldKey)) {
throw new IllegalArgumentException("Cannot create world with mismatched name and key identities.");
}
return new WorldCreator(levelName, null);
}
/**
* Creates an empty WorldCreator for the given key.
* LevelName will be the Key part of the NamespacedKey.
*
* <p>Note: Prior to 26.1, custom world keys were never persisted. To load unconverted pre-26.1 worlds created
* with this method, use {@link #WorldCreator(String)} with {@link NamespacedKey#getKey()}, or use this method
* with {@link NamespacedKey#minecraft(String)} and {@link NamespacedKey#getKey()}.</p>
*
* @param worldKey NamespacedKey of the world that will be created
*/
@@ -104,7 +138,6 @@ public class WorldCreator {
public static WorldCreator ofKey(@NotNull NamespacedKey worldKey) {
return new WorldCreator(worldKey);
}
// Paper end
/**
* Copies the options from the specified world
@@ -152,10 +185,14 @@ public class WorldCreator {
}
/**
* Gets the name of the world that is to be loaded or created.
* Gets the legacy Bukkit name of the world that is to be loaded or created.
*
* @return World name
* <p>This method is considered obsolete and is a candidate for future deprecation.
* Prefer using {@link #key()}.</p>
*
* @return legacy Bukkit world name
*/
@ApiStatus.Obsolete
@NotNull
public String name() {
return name;
@@ -229,6 +266,80 @@ public class WorldCreator {
return this;
}
/**
* Sets the forced spawn position for the world created by this {@link WorldCreator}.
* <p>
* This overrides vanilla and custom generator behavior without loading any chunks.
* When a forced spawn is specified, the bonus chest will not be generated.
*
* @param position the spawn position
* @param yaw the yaw rotation at spawn
* @param pitch the pitch rotation at spawn
* @return this object, for chaining
*/
@NotNull
public WorldCreator forcedSpawnPosition(@NotNull Position position, float yaw, float pitch) {
this.spawnPositionOverride = position; // If you set this to null, it wont do anything!
this.spawnYawOverride = yaw;
this.spawnPitchOverride = pitch;
return this;
}
/**
* Clears any previously forced spawn position.
* <p>
* After calling this, vanilla spawn selection behavior is used.
*
* @return this object, for chaining
*/
@NotNull
public WorldCreator clearForcedSpawnPosition() {
this.spawnPositionOverride = null;
this.spawnYawOverride = null;
this.spawnPitchOverride = null;
return this;
}
/**
* Gets the forced spawn position that will be applied when this world is created.
* <p>
* If this returns {@code null}, vanilla or custom generator behavior will be used
* to determine the spawn position.
*
* @return the forced spawn position, or {@code null} for the vanilla behavior
*/
public @Nullable Position forcedSpawnPosition() {
return this.spawnPositionOverride;
}
/**
* Gets the forced spawn yaw that will be applied when this world is created.
* <p>
* If this returns {@code null}, the spawn yaw will be determined by vanilla behavior
* or the world generator.
* <p>
* This value is only meaningful if a forced spawn position is present.
*
* @return the forced spawn yaw, or {@code null} for the vanilla behavior
*/
public @Nullable Float forcedSpawnYaw() {
return this.spawnYawOverride;
}
/**
* Gets the forced spawn pitch that will be applied when this world is created.
* <p>
* If this returns {@code null}, the spawn pitch will be determined by vanilla behavior
* or the world generator.
* <p>
* This value is only meaningful if a forced spawn position is present.
*
* @return the forced spawn pitch, or {@code null} for the vanilla behavior
*/
public @Nullable Float forcedSpawnPitch() {
return this.spawnPitchOverride;
}
/**
* Gets the generator that will be used to create or load the world.
* <p>
@@ -589,7 +700,6 @@ public class WorldCreator {
return result;
}
// Paper start - keep spawn loaded tristate
/**
* Returns the current intent to keep the world loaded, @see {@link WorldCreator#keepSpawnLoaded(net.kyori.adventure.util.TriState)}
*
@@ -615,5 +725,4 @@ public class WorldCreator {
public WorldCreator keepSpawnLoaded(@NotNull net.kyori.adventure.util.TriState keepSpawnLoaded) {
return this;
}
// Paper end - keep spawn loaded tristate
}
@@ -1,9 +1,10 @@
package org.bukkit.attribute;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Bukkit;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
@@ -159,8 +160,8 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
Attribute WAYPOINT_RECEIVE_RANGE = getAttribute("waypoint_receive_range");
@NotNull
private static Attribute getAttribute(@NotNull String key) {
return Registry.ATTRIBUTE.getOrThrow(NamespacedKey.minecraft(key));
private static Attribute getAttribute(@NotNull @KeyPattern.Value String key) {
return Registry.ATTRIBUTE.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -177,19 +178,20 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Attribute valueOf(@NotNull String name) {
Attribute attribute = Bukkit.getUnsafe().get(RegistryKey.ATTRIBUTE, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
Attribute attribute = key == null ? null : Bukkit.getUnsafe().get(RegistryKey.ATTRIBUTE, key);
Preconditions.checkArgument(attribute != null, "No attribute found with the name %s", name);
return attribute;
}
/**
* @return an array of all known attributes.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Attribute[] values() {
return Lists.newArrayList(Registry.ATTRIBUTE).toArray(new Attribute[0]);
return Registry.ATTRIBUTE.stream().toArray(Attribute[]::new);
}
/**
@@ -1,11 +1,12 @@
package org.bukkit.block;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.InternalAPIBridge;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Bukkit;
import org.bukkit.FeatureFlag;
import org.bukkit.Keyed;
@@ -165,8 +166,8 @@ public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.transl
Biome CUSTOM = InternalAPIBridge.get().constructLegacyCustomBiome();
@NotNull
private static Biome getBiome(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.BIOME).getOrThrow(NamespacedKey.minecraft(key));
private static Biome getBiome(@NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.BIOME).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -181,19 +182,20 @@ public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.transl
return Biome.CUSTOM;
}
Biome biome = Bukkit.getUnsafe().get(RegistryKey.BIOME, NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
Biome biome = key == null ? null : Bukkit.getUnsafe().get(RegistryKey.BIOME, key);
Preconditions.checkArgument(biome != null, "No biome found with the name %s", name);
return biome;
}
/**
* @return an array of all known biomes.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Biome[] values() {
return Lists.newArrayList(Registry.BIOME).toArray(new Biome[0]);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.BIOME).stream().toArray(Biome[]::new);
}
// Paper start
@@ -232,18 +232,16 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
}
// Paper end
// Paper start - add isValidTool
/**
* Checks if the itemstack is a valid tool to
* break the block with
*
* @param itemStack The (tool) itemstack
* @param tool The tool
* @return whether the block will drop items
* @deprecated partially replaced by {@link Block#isPreferredTool(ItemStack)}
*/
@Deprecated(since = "1.21", forRemoval = true) // Paper
boolean isValidTool(@NotNull ItemStack itemStack);
// Paper end - add isValidTool
boolean isValidTool(@NotNull ItemStack tool);
/**
* Gets the Location of the block
@@ -438,11 +436,18 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr
int getBlockPower(@NotNull BlockFace face);
/**
* Returns the redstone power being provided to this block
* Returns the redstone power being provided to this block.
* <p>
* Equivalent to:
* {@snippet lang="java" :
* getBlockPower(BlockFace.SELF);
* }
*
* @return The power level.
*/
int getBlockPower();
default int getBlockPower() {
return this.getBlockPower(BlockFace.SELF);
}
/**
* Checks if this block is empty.
@@ -1024,6 +1024,8 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
BlockType.Typed<BlockData> GOLD_ORE = getBlockType("gold_ore");
BlockType.Typed<BlockData> GOLDEN_DANDELION = getBlockType("golden_dandelion");
BlockType.Typed<BlockData> GRANITE = getBlockType("granite");
BlockType.Typed<Slab> GRANITE_SLAB = getBlockType("granite_slab");
@@ -1760,6 +1762,8 @@ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.tran
BlockType.Typed<BlockData> POTTED_FLOWERING_AZALEA_BUSH = getBlockType("potted_flowering_azalea_bush");
BlockType.Typed<BlockData> POTTED_GOLDEN_DANDELION = getBlockType("potted_golden_dandelion");
BlockType.Typed<BlockData> POTTED_JUNGLE_SAPLING = getBlockType("potted_jungle_sapling");
BlockType.Typed<BlockData> POTTED_LILY_OF_THE_VALLEY = getBlockType("potted_lily_of_the_valley");
@@ -41,8 +41,7 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
/**
* Sets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. Setting the name to null is the
* same as setting it to "@".
* that this CommandBlock executes.
*
* @param name New name for this CommandBlock.
* @deprecated in favour of {@link #name(net.kyori.adventure.text.Component)}
@@ -61,8 +60,7 @@ public interface CommandBlock extends TileState, io.papermc.paper.command.Comman
/**
* Sets the name of this CommandBlock. The name is used with commands
* that this CommandBlock executes. Setting the name to null is the
* same as setting it to a {@link net.kyori.adventure.text.TextComponent} containing {@code @}.
* that this CommandBlock executes.
*
* @param name New name for this CommandBlock.
*/
@@ -1,10 +1,11 @@
package org.bukkit.block.banner;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
@@ -152,7 +153,7 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
return null;
}
for (PatternType type : Registry.BANNER_PATTERN) {
for (PatternType type : RegistryAccess.registryAccess().getRegistry(RegistryKey.BANNER_PATTERN)) {
if (identifier.equals(type.getIdentifier())) {
return type;
}
@@ -162,8 +163,8 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
}
@NotNull
private static PatternType getType(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.BANNER_PATTERN).getOrThrow(NamespacedKey.minecraft(key));
private static PatternType getType(@NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.BANNER_PATTERN).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -174,18 +175,19 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static PatternType valueOf(@NotNull String name) {
PatternType type = Registry.BANNER_PATTERN.get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
PatternType type = key == null ? null : RegistryAccess.registryAccess().getRegistry(RegistryKey.BANNER_PATTERN).get(key);
Preconditions.checkArgument(type != null, "No pattern type found with the name %s", name);
return type;
}
/**
* @return an array of all known pattern types.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static PatternType[] values() {
return Lists.newArrayList(Registry.BANNER_PATTERN).toArray(new PatternType[0]);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.BANNER_PATTERN).stream().toArray(PatternType[]::new);
}
}
@@ -76,14 +76,14 @@ public interface DragonBattle {
/**
* Try to initiate a respawn sequence to summon the dragon.
*
* @param enderCrystals the {@link EnderCrystal EnderCrystals} to use in the
* @param crystals the {@link EnderCrystal EnderCrystals} to use in the
* respawn, or a null or empty list to render the respawn sequence
* uncancellable. null entries or crystals that do not reside in the same
* world as this dragon battle will be ignored.
*
* @return true if the respawn was initiated, false otherwise.
*/
public boolean initiateRespawn(@Nullable Collection<EnderCrystal> enderCrystals);
public boolean initiateRespawn(@Nullable Collection<EnderCrystal> crystals);
/**
* Get this battle's current respawn phase.
@@ -2,8 +2,9 @@ package org.bukkit.damage;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.Translatable;
import org.jetbrains.annotations.NotNull;
@@ -121,8 +122,8 @@ public interface DamageType extends Keyed, Translatable {
// End generate - DamageType
@NotNull
private static DamageType getDamageType(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.DAMAGE_TYPE).getOrThrow(NamespacedKey.minecraft(key));
private static DamageType getDamageType(@NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.DAMAGE_TYPE).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -1,9 +1,10 @@
package org.bukkit.enchantments;
import com.google.common.collect.Lists;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
@@ -235,8 +236,8 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
public static final Enchantment LUNGE = getEnchantment("lunge");
@NotNull
private static Enchantment getEnchantment(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).getOrThrow(NamespacedKey.minecraft(key));
private static Enchantment getEnchantment(@NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -513,7 +514,7 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
if (key == null) {
return null;
}
return Registry.ENCHANTMENT.get(key);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).get(key);
}
/**
@@ -543,6 +544,6 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
@NotNull
@Deprecated(since = "1.20.3")
public static Enchantment[] values() {
return Lists.newArrayList(Registry.ENCHANTMENT).toArray(new Enchantment[0]);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).stream().toArray(Enchantment[]::new);
}
}
@@ -20,53 +20,4 @@ public abstract class EnchantmentWrapper extends Enchantment {
public Enchantment getEnchantment() {
return this;
}
// Paper start
@NotNull
@Override
public net.kyori.adventure.text.Component displayName(int level) {
return getEnchantment().displayName(level);
}
@Override
public @NotNull String translationKey() {
return getEnchantment().translationKey();
}
@Override
public boolean isTradeable() {
return getEnchantment().isTradeable();
}
@Override
public boolean isDiscoverable() {
return getEnchantment().isDiscoverable();
}
@Override
public int getMinModifiedCost(int level) {
return getEnchantment().getMinModifiedCost(level);
}
@Override
public int getMaxModifiedCost(int level) {
return getEnchantment().getMaxModifiedCost(level);
}
@NotNull
@Override
public io.papermc.paper.enchantments.EnchantmentRarity getRarity() {
return getEnchantment().getRarity();
}
@Override
public float getDamageIncrease(int level, @NotNull org.bukkit.entity.EntityCategory entityCategory) {
return getEnchantment().getDamageIncrease(level, entityCategory);
}
@NotNull
@Override
public java.util.Set<org.bukkit.inventory.EquipmentSlot> getActiveSlots() {
return getEnchantment().getActiveSlots();
}
// Paper end
}
@@ -5,69 +5,83 @@ package org.bukkit.entity;
*/
public interface Ageable extends Creature {
/**
* Gets the age of this mob.
* Gets the age of this creature.
*
* @return Age
*/
public int getAge();
/**
* Sets the age of this mob.
* Sets the age of this creature.
*
* @param age New age
*/
public void setAge(int age);
/**
* Lock the age of the animal, setting this will prevent the animal from
* maturing or getting ready for mating.
* Lock the age of the creature, setting this will prevent the creature from
* maturing or getting ready for mating. Plugins can still increase the age
* manually, however.
*
* @param lock new lock
* @deprecated see {@link Breedable#setAgeLock(boolean)}
* @param lock new lock state
*/
@Deprecated(since = "1.16.2")
public void setAgeLock(boolean lock);
/**
* Gets the current agelock.
* Checks if the age of the creature is locked.
*
* @return the current agelock
* @deprecated see {@link Breedable#getAgeLock()}
* @return the current lock state
* @see #setAgeLock(boolean)
*/
@Deprecated(since = "1.16.2")
public boolean getAgeLock();
/**
* Sets the age of the mob to a baby
* Transforms this creature to its baby counter-part.
* <p>
* This will not have any effect if the creature is already in
* this state.
*
* @apiNote some of them cannot be represented as such, so it's
* wise to check if {@link #isAdult()} returns {@code false} after this method
* for general purpose use.
* @see #setAdult()
* @see #setAge(int)
*/
public void setBaby();
/**
* Sets the age of the mob to an adult
* Transforms this creature to its adult counter-part.
* <p>
* This will not have any effect if the creature is already in
* this state.
*
* @see #setBaby()
* @see #setAge(int)
*/
public void setAdult();
/**
* Returns true if the mob is an adult.
* Returns true if the creature is an adult.
*
* @return return true if the mob is an adult
* @return if the creature is an adult
* @see #getAge()
*/
public boolean isAdult();
/**
* Return the ability to breed of the animal.
* Return the ability to breed of the creature.
*
* @return the ability to breed of the animal
* @return the ability to breed of the creature
* @deprecated see {@link Breedable#canBreed()}
*/
@Deprecated(since = "1.16.2")
public boolean canBreed();
/**
* Set breedability of the animal, if the animal is a baby and set to
* Set breedability of the creature, if the creature is a baby and set to
* breed it will instantly grow up.
*
* @param breed breedability of the animal
* @param breed breedability of the creature
* @deprecated see {@link Breedable#setBreed(boolean)}
*/
@Deprecated(since = "1.16.2")
@@ -5,21 +5,6 @@ package org.bukkit.entity;
*/
public interface Breedable extends Ageable {
/**
* Lock the age of the animal, setting this will prevent the animal from
* maturing or getting ready for mating.
*
* @param lock new lock
*/
public void setAgeLock(boolean lock);
/**
* Gets the current agelock.
*
* @return the current agelock
*/
public boolean getAgeLock();
/**
* Return the ability to breed of the animal.
*
@@ -1,10 +1,11 @@
package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.DyeColor;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
@@ -32,6 +33,21 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
*/
public void setCatType(@NotNull Type type);
/**
* Get the sound variant of this cat.
*
* @return cat sound variant
*/
@NotNull
SoundVariant getSoundVariant();
/**
* Set the sound variant of this cat.
*
* @param variant cat sound variant
*/
void setSoundVariant(@NotNull SoundVariant variant);
/**
* Get the collar color of this cat
*
@@ -79,8 +95,8 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
// End generate - CatType
@NotNull
private static Type getType(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
private static Type getType(@NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -91,19 +107,37 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Type valueOf(@NotNull String name) {
Type type = RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT).get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
Type type = key == null ? null : RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT).get(key);
Preconditions.checkArgument(type != null, "No cat type found with the name %s", name);
return type;
}
/**
* @return an array of all known cat types.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Type[] values() {
return Lists.newArrayList(RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT)).toArray(new Type[0]);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_VARIANT).stream().toArray(Type[]::new);
}
}
/**
* Represents the sound variant of a cat.
*/
interface SoundVariant extends Keyed {
// Start generate - CatSoundVariant
SoundVariant CLASSIC = getSoundVariant("classic");
SoundVariant ROYAL = getSoundVariant("royal");
// End generate - CatSoundVariant
@NotNull
private static SoundVariant getSoundVariant(final @NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CAT_SOUND_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
@@ -2,8 +2,9 @@ package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jspecify.annotations.NullMarked;
/**
@@ -26,6 +27,20 @@ public interface Chicken extends Animals {
*/
void setVariant(Variant variant);
/**
* Get the sound variant of this chicken.
*
* @return chicken sound variant
*/
SoundVariant getSoundVariant();
/**
* Set the sound variant of this chicken.
*
* @param variant chicken sound variant
*/
void setSoundVariant(SoundVariant variant);
/**
* Gets if this chicken was spawned as a chicken jockey.
*
@@ -67,8 +82,24 @@ public interface Chicken extends Animals {
Variant WARM = getVariant("warm");
// End generate - ChickenVariant
private static Variant getVariant(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CHICKEN_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
private static Variant getVariant(@KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CHICKEN_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
/**
* Represents the sound variant of a chicken.
*/
interface SoundVariant extends Keyed {
// Start generate - ChickenSoundVariant
SoundVariant CLASSIC = getSoundVariant("classic");
SoundVariant PICKY = getSoundVariant("picky");
// End generate - ChickenSoundVariant
private static SoundVariant getSoundVariant(final @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.CHICKEN_SOUND_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
}
@@ -25,6 +25,20 @@ public interface CopperGolem extends Golem, Shearable {
*/
void setWeatheringState(WeatheringCopperState state);
/**
* Get the current copper golem state of the copper golem.
*
* @return the copper golem state
*/
CopperGolem.State getGolemState();
/**
* Set the copper golem state of the copper golem.
*
* @param state the new copper golem state
*/
void setGolemState(CopperGolem.State state);
/**
* Get the current oxidizing state of the copper golem.
*
@@ -125,4 +139,15 @@ public interface CopperGolem extends Golem, Shearable {
@ApiStatus.Internal
record AtTimeImpl(long time) implements AtTime {}
}
@NullMarked
enum State {
// Start generate - CopperGolemState
IDLE,
GETTING_ITEM,
GETTING_NO_ITEM,
DROPPING_ITEM,
DROPPING_NO_ITEM;
// End generate - CopperGolemState
}
}
@@ -2,8 +2,9 @@ package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jspecify.annotations.NullMarked;
/**
@@ -26,6 +27,20 @@ public interface Cow extends AbstractCow {
*/
void setVariant(Variant variant);
/**
* Get the sound variant of this cow.
*
* @return cow sound variant
*/
SoundVariant getSoundVariant();
/**
* Set the sound variant of this cow.
*
* @param variant cow sound variant
*/
void setSoundVariant(SoundVariant variant);
/**
* Represents the variant of a cow.
*/
@@ -39,8 +54,24 @@ public interface Cow extends AbstractCow {
Variant WARM = getVariant("warm");
// End generate - CowVariant
private static Variant getVariant(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.COW_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
private static Variant getVariant(@KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.COW_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
/**
* Represents the sound variant of a cow.
*/
interface SoundVariant extends Keyed {
// Start generate - CowSoundVariant
SoundVariant CLASSIC = getSoundVariant("classic");
SoundVariant MOODY = getSoundVariant("moody");
// End generate - CowSoundVariant
private static SoundVariant getSoundVariant(final @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.COW_SOUND_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
}
@@ -2,12 +2,15 @@ package org.bukkit.entity;
import org.bukkit.attribute.Attribute;
import org.bukkit.damage.DamageSource;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.bukkit.damage.DamageType;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* Represents an {@link Entity} that has health and can take damage.
*/
@NullMarked
public interface Damageable extends Entity {
/**
* Deals the given amount of damage to this entity.
@@ -32,7 +35,24 @@ public interface Damageable extends Entity {
* @param amount amount of damage to deal
* @param damageSource source to which the damage should be attributed
*/
void damage(double amount, @NotNull DamageSource damageSource);
void damage(double amount, DamageSource damageSource);
/**
* Sets the entity's health to 0 and kill the entity with a generic DamageSource.
*
* @throws IllegalStateException if is used in world generation
*/
default void kill() {
this.kill(DamageSource.builder(DamageType.GENERIC_KILL).build());
}
/**
* Sets the entity's health to 0 and kill the entity with the specified DamageSource.
*
* @param damageSource the DamageSource to use for the kill
* @throws IllegalStateException if is used in world generation
*/
void kill(DamageSource damageSource);
/**
* Gets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is dead.
@@ -57,7 +77,7 @@ public interface Damageable extends Entity {
* @param amount heal amount
*/
default void heal(final double amount) {
this.heal(amount, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.CUSTOM);
this.heal(amount, EntityRegainHealthEvent.RegainReason.CUSTOM);
}
/**
@@ -66,7 +86,7 @@ public interface Damageable extends Entity {
* @param amount heal amount
* @param reason heal reason
*/
void heal(double amount, @NotNull org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason reason);
void heal(double amount, EntityRegainHealthEvent.RegainReason reason);
/**
* Gets the entity's absorption amount.
@@ -37,8 +37,6 @@ import org.bukkit.entity.minecart.PoweredMinecart;
import org.bukkit.entity.minecart.RideableMinecart;
import org.bukkit.entity.minecart.SpawnerMinecart;
import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -98,7 +96,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
EXPERIENCE_ORB("experience_orb", ExperienceOrb.class, 2),
EYE_OF_ENDER("eye_of_ender", EnderSignal.class, 15),
FALLING_BLOCK("falling_block", FallingBlock.class, 21),
FIREBALL("fireball", Fireball.class, 12),
FIREBALL("fireball", LargeFireball.class, 12),
FIREWORK_ROCKET("firework_rocket", Firework.class, 22),
FISHING_BOBBER("fishing_bobber", FishHook.class, -1, false),
FOX("fox", Fox.class, -1),
@@ -1,10 +1,11 @@
package org.bukkit.entity;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import java.util.Locale;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import java.util.Locale;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
@@ -61,8 +62,8 @@ public interface Frog extends Animals {
// End generate - FrogVariant
@NotNull
private static Variant getVariant(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
private static Variant getVariant(@NotNull @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
/**
@@ -73,19 +74,20 @@ public interface Frog extends Animals {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Variant valueOf(@NotNull String name) {
Variant variant = RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT).get(NamespacedKey.fromString(name.toLowerCase(Locale.ROOT)));
final NamespacedKey key = NamespacedKey.fromString(name.toLowerCase(Locale.ROOT));
Variant variant = key == null ? null : RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT).get(key);
Preconditions.checkArgument(variant != null, "No frog variant found with the name %s", name);
return variant;
}
/**
* @return an array of all known frog variants.
* @deprecated use {@link Registry#iterator()}.
* @deprecated use {@link Registry#stream()}.
*/
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Variant[] values() {
return Lists.newArrayList(RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT)).toArray(new Variant[0]);
return RegistryAccess.registryAccess().getRegistry(RegistryKey.FROG_VARIANT).stream().toArray(Variant[]::new);
}
}
}
@@ -2,8 +2,9 @@ package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.KeyPattern;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jspecify.annotations.NullMarked;
/**
@@ -26,6 +27,20 @@ public interface Pig extends Steerable, Vehicle {
*/
void setVariant(Variant variant);
/**
* Get the sound variant of this pig.
*
* @return pig sound variant
*/
SoundVariant getSoundVariant();
/**
* Set the sound variant of this pig.
*
* @param variant pig sound variant
*/
void setSoundVariant(SoundVariant variant);
/**
* Represents the variant of a pig.
*/
@@ -39,8 +54,26 @@ public interface Pig extends Steerable, Vehicle {
Variant WARM = getVariant("warm");
// End generate - PigVariant
private static Variant getVariant(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PIG_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
private static Variant getVariant(@KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PIG_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
/**
* Represents the sound variant of a pig.
*/
interface SoundVariant extends Keyed {
// Start generate - PigSoundVariant
SoundVariant BIG = getSoundVariant("big");
SoundVariant CLASSIC = getSoundVariant("classic");
SoundVariant MINI = getSoundVariant("mini");
// End generate - PigSoundVariant
private static SoundVariant getSoundVariant(final @KeyPattern.Value String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.PIG_SOUND_VARIANT).getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key));
}
}
}
Loaded 100 of 1395 files, more files were not shown because too many files have changed in this diff. Show more