Compare commits

..
Author SHA1 Message Date
Jason Penilla a136173f15 adjust delay to 5s 2024-09-13 15:04:18 -07:00
Jason Penilla fcf48a9c94 Add ticket on player join to avoid chunk load-unload-load cycle
Adding the entity will add and then immediately remove an entity load ticket, which would result in the chunk loading and then unloading before being loaded again once the player chunk loader reacts (delay can vary based on rate limit configs)

By adding a ticket with a short removal delay we attempt to keep the chunk loaded until the player chunk loader reacts, but this is not a guarantee due to the aforementioned rate limit configs. Plugins should still handle load/unload events as normal, however this will reduce redundant calls.

The delay is currently set to 2 seconds, however we may want to adjust this before merging
2024-09-13 14:38:01 -07:00
2573 changed files with 213948 additions and 220729 deletions

No files matched your search

@@ -0,0 +1,77 @@
name: Behavior Bug or Plugin Incompatibility
description: Report issues with plugin incompatbility or other behavior related issues.
labels: [ "status: needs triage", "type: bug" ]
body:
- type: textarea
attributes:
label: Expected behavior
description: What you expected to see.
validations:
required: true
- type: textarea
attributes:
label: Observed/Actual behavior
description: What you actually saw.
validations:
required: true
- type: textarea
attributes:
label: Steps/models to reproduce
description: This may include a build schematic, a video, or detailed instructions to help reconstruct the issue.
validations:
required: true
- type: textarea
attributes:
label: Plugin and Datapack List
description: |
All plugins and datapacks running on your server.
To list plugins, run `/plugins`. For datapacks, run `/datapack list`.
validations:
required: true
- type: textarea
attributes:
label: Paper version
description: |
Run `/version` on your server and **paste** the full, unmodified output here.
"latest" is *not* a version; we require the output of `/version` so we can adequately track down the issue.
Additionally, do NOT provide a screenshot, you MUST paste the entire output.
<details>
<summary>Example</summary>
```
> version
[20:34:42 INFO]: Checking version, please wait...
[20:34:42 INFO]: This server is running Paper version 1.21-105-master@7e91a2c (2024-07-20T21:04:31Z) (Implementing API version 1.21-R0.1-SNAPSHOT)
[20:34:42 INFO]: You are running the latest version
[20:34:42 INFO]: Previous version: 1.21-103-aa3b356 (MC: 1.21)
```
</details>
validations:
required: true
- type: textarea
attributes:
label: Other
description: |
Please include other helpful information below.
The more information we receive, the quicker and more effective we can be at finding the solution to the issue.
validations:
required: false
- type: markdown
attributes:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. You searched for and ensured there isn't already an open issue regarding this.
3. Your version of Minecraft is supported by Paper.
If you think you have a bug but are not sure, feel free to ask the `#paper-help` channel of our
[Discord](https://discord.gg/papermc).
@@ -1,79 +0,0 @@
name: "🐛 Bug or Incompatibility"
description: Report issues related to unexpected behavior or vanilla/plugin incompatibility.
type: "Bug"
labels:
- "status: needs triage"
body:
- type: markdown
attributes:
value: |
Before submitting this issue, please ensure the following:
1. You are using the latest version of Paper, available on our [our downloads page](https://papermc.io/downloads/paper).
2. You have searched to confirm there isn’t [an existing open issue](https://github.com/PaperMC/Paper/issues?q=is%3Aissue%20state%3Aopen%20type%3ABug) on this topic.
3. Your version of Minecraft is supported by Paper.
If you're unsure whether you've encountered a bug, feel free to ask in the `#paper-help` channel on our
[Discord](https://discord.gg/papermc).
- type: textarea
attributes:
label: Expected behavior
description: What you expected to see.
validations:
required: true
- type: textarea
attributes:
label: Observed/Actual behavior
description: What you actually saw.
validations:
required: true
- type: textarea
attributes:
label: Steps/models to reproduce
description: This may include a build schematic, a video, or detailed instructions to help reconstruct the issue.
validations:
required: true
- type: textarea
attributes:
label: Plugin and Datapack List
description: |
All plugins and datapacks running on your server.
To list plugins, run `/plugins`. For datapacks, run `/datapack list`.
validations:
required: true
- type: textarea
attributes:
label: Paper version
description: |
Run `/version` on your server and **paste** the full, unmodified output here.
"latest" is *not* a version; we require the output of `/version` so we can adequately track down the issue.
Additionally, do NOT provide a screenshot, you MUST paste the entire output.
<details>
<summary>Example</summary>
```
> version
[20:34:42 INFO]: Checking version, please wait...
[20:34:42 INFO]: This server is running Paper version 1.21-105-master@7e91a2c (2024-07-20T21:04:31Z) (Implementing API version 1.21-R0.1-SNAPSHOT)
[20:34:42 INFO]: You are running the latest version
[20:34:42 INFO]: Previous version: 1.21-103-aa3b356 (MC: 1.21)
```
</details>
validations:
required: true
- type: textarea
attributes:
label: Other
description: |
Please include other helpful information below.
The more information we receive, the quicker and more effective we can be at finding the solution to the issue.
validations:
required: false
+9 -6
View File
@@ -1,10 +1,13 @@
blank_issues_enabled: false
contact_links:
- name: "❗Exploits"
- name: Feature Request
url: https://github.com/PaperMC/Paper/discussions/new?category=ideas
about: Suggest an idea for Paper
- name: PaperMC Discord
url: https://discord.gg/papermc
about: If you are having issues with spark or have other minor issues, come ask us on our Discord server!
- name: Exploit Report
url: https://discord.gg/papermc
about: |
Since GitHub doesn’t currently support private issues, exploit reports are managed through our Discord.
To report an exploit, please visit the #paper-exploit-report channel.
- name: "🗨 Questions"
url: https://discord.gg/papermc
about: If you have questions or need help with any minor issues, feel free to ask us on our Discord server!
Due to GitHub not currently allowing private issues, exploit reports are currently handled via our Discord.
To report an exploit, see the #paper-exploit-report channel.
@@ -1,78 +0,0 @@
name: "💥 Crash or Stacktrace"
description: Report any server crashes or alarming stack traces.
type: "Bug"
labels:
- "status: needs triage"
body:
- type: markdown
attributes:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. Your version of Minecraft is supported by Paper.
If your server crash log contains `DO NOT REPORT THIS TO PAPER`, please ask in our
[Discord](https://discord.gg/papermc) before opening this issue. These messages are informing you of server
lag and providing debug information.
- type: textarea
attributes:
label: Stack trace
description: |
We need all of the stack trace! Do not cut off parts of it. Please do not use attachments.
If you prefer, you can use a paste site like https://mclo.gs.
value: |
```
paste your stack trace or a mclo.gs link here!
```
placeholder: Please don't remove the backticks; it makes your issue a lot harder to read!
validations:
required: true
- type: textarea
attributes:
label: Plugin and Datapack List
description: |
All plugins and datapacks running on your server.
To list plugins, run `/plugins`. For datapacks, run `/datapack list`.
validations:
required: true
- type: textarea
attributes:
label: Actions to reproduce (if known)
description: This may include a build schematic, a video, or detailed instructions to help reconstruct the issue. Anything helps!
validations:
required: false
- type: textarea
attributes:
label: Paper version
description: |
Run `/version` on your server and **paste** the full, unmodified output here.
"latest" is *not* a version; we require the output of `/version` so we can adequately track down the issue.
Additionally, do NOT provide a screenshot, you MUST paste the entire output.
<details>
<summary>Example</summary>
```
> version
[20:34:42 INFO]: Checking version, please wait...
[20:34:42 INFO]: This server is running Paper version 1.21-105-master@7e91a2c (2024-07-20T21:04:31Z) (Implementing API version 1.21-R0.1-SNAPSHOT)
[20:34:42 INFO]: You are running the latest version
[20:34:42 INFO]: Previous version: 1.21-103-aa3b356 (MC: 1.21)
```
</details>
validations:
required: true
- type: textarea
attributes:
label: Other
description: |
Please include other helpful information below, if any.
The more information we receive, the quicker and more effective we can be at finding the solution to the issue.
validations:
required: false
-53
View File
@@ -1,53 +0,0 @@
name: "💡 New Feature"
description: Propose a new idea for Paper.
type: "Feature"
labels:
- "status: needs triage"
body:
- type: markdown
attributes:
value: |
Thank you for submitting a feature request for Paper! Please be as detailed as possible to help us review and consider your request effectively.
Before submitting, please ensure the following:
1. You are using a supported version of Paper.
2. The feature you’re requesting isn’t already included in the version you’re using.
3. You’ve searched for and confirmed there isn’t already [an open request](https://github.com/PaperMC/Paper/issues?q=is%3Aissue%20is%3Aopen%20type%3AFeature) for this feature.
- If a similar request exists, feel free to add any additional details you think are helpful.
If you have any questions, feel free to ask in the `#paper-help` or `#paper-dev` channels on our [Discord](https://discord.gg/papermc).
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: Please provide some context for this request. Why do you want it added?
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like.
description: A clear and concise description of what you want.
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered.
description: List any alternatives you might have tried to get the feature you want.
validations:
required: true
- type: textarea
attributes:
label: Other
description: Add any other context or screenshots about the feature request below.
validations:
required: false
- type: markdown
attributes:
value: |
Before submitting this feature request, please search our issue tracker to ensure your feature has not
already been requested.
+15 -22
View File
@@ -1,19 +1,7 @@
name: "🐌 Performance Problem"
description: Report any performance issues.
type: "Bug"
labels:
- "scope: performance"
- "status: needs triage"
name: Performance Problem
description: Report performance related problems or other areas of concern
labels: [ "status: needs triage", "type: performance" ]
body:
- type: markdown
attributes:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. You searched for and ensured there isn't already [an open issue](https://github.com/PaperMC/Paper/issues?q=is%3Aissue%20state%3Aopen%20type%3ABug) regarding this.
3. Your version of Minecraft is supported by Paper.
- type: markdown
attributes:
value: |
@@ -22,11 +10,8 @@ body:
- type: input
attributes:
label: Spark Profile
description: |
Please provide all profiles as links rather than screenshots. Screenshots limit our ability to investigate the root cause of the issue.
For more information, see our [profiling documentation](https://docs.papermc.io/paper/profiling).
label: Profile link
description: We ask that all profiles are a link, not a screenshot. Screenshots inhibit our ability to figure out the real cause of the issue.
placeholder: "Example: https://spark.lucko.me/XsN0hxGfsi"
validations:
required: true
@@ -50,10 +35,10 @@ body:
- type: textarea
attributes:
label: Server config files
description: We need bukkit.yml, spigot.yml, paper-global.yml, paper-world-defaults.yml and server.properties. If you use per-world Paper configs, make sure to include them. You can paste it below or use a paste site like https://mclo.gs.
description: We need bukkit.yml, spigot.yml, paper-global.yml, paper-world-defaults.yml and server.properties. If you use per-world Paper configs, make sure to include them. You can paste it below or use a paste site like https://paste.gg.
value: |
```
Paste configs or mclo.gs link here!
Paste configs or paste.gg link here!
```
placeholder: Please don't remove the backticks; it makes your issue a lot harder to read!
validations:
@@ -89,3 +74,11 @@ body:
The more information we receive, the quicker and more effective we can be at finding the solution to the issue.
validations:
required: false
- type: markdown
attributes:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. You searched for and ensured there isn't already an open issue regarding this.
3. Your version of Minecraft is supported by Paper.
@@ -0,0 +1,76 @@
name: Server crash or Stacktrace
description: Report server crashes or scary stacktraces
labels: [ "status: needs triage" ]
body:
- type: textarea
attributes:
label: Stack trace
description: |
We need all of the stack trace! Do not cut off parts of it. Please do not use attachments.
If you prefer, you can use a paste site like https://paste.gg.
value: |
```
paste your stack trace or a paste.gg link here!
```
placeholder: Please don't remove the backticks; it makes your issue a lot harder to read!
validations:
required: true
- type: textarea
attributes:
label: Plugin and Datapack List
description: |
All plugins and datapacks running on your server.
To list plugins, run `/plugins`. For datapacks, run `/datapack list`.
validations:
required: true
- type: textarea
attributes:
label: Actions to reproduce (if known)
description: This may include a build schematic, a video, or detailed instructions to help reconstruct the issue. Anything helps!
validations:
required: false
- type: textarea
attributes:
label: Paper version
description: |
Run `/version` on your server and **paste** the full, unmodified output here.
"latest" is *not* a version; we require the output of `/version` so we can adequately track down the issue.
Additionally, do NOT provide a screenshot, you MUST paste the entire output.
<details>
<summary>Example</summary>
```
> version
[20:34:42 INFO]: Checking version, please wait...
[20:34:42 INFO]: This server is running Paper version 1.21-105-master@7e91a2c (2024-07-20T21:04:31Z) (Implementing API version 1.21-R0.1-SNAPSHOT)
[20:34:42 INFO]: You are running the latest version
[20:34:42 INFO]: Previous version: 1.21-103-aa3b356 (MC: 1.21)
```
</details>
validations:
required: true
- type: textarea
attributes:
label: Other
description: |
Please include other helpful information below, if any.
The more information we receive, the quicker and more effective we can be at finding the solution to the issue.
validations:
required: false
- type: markdown
attributes:
value: |
Before submitting this issue, please ensure the following:
1. You are running the latest version of Paper from [our downloads page](https://papermc.io/downloads/paper).
2. Your version of Minecraft is supported by Paper.
If your server crash log contains `DO NOT REPORT THIS TO PAPER`, please ask in our
[Discord](https://discord.gg/papermc) before opening this issue. These messages are informing you of server
lag and providing debug information.
+3 -1
View File
@@ -36,8 +36,10 @@ jobs:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
uses: gradle/actions/setup-gradle@v3
- name: Configure Build
uses: actions/github-script@v7
+1 -1
View File
@@ -18,7 +18,7 @@ jobs:
actions: read
steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@v6
uses: dawidd6/action-download-artifact@v3
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts
-13
View File
@@ -185,8 +185,6 @@ These steps assume the `origin` remote is your fork of this repository and `upst
1. Checkout feature/fix branch and rebase on master: `git checkout patch-branch && git rebase master`.
1. Apply updated patches: `./gradlew applyPatches`.
1. If there are conflicts, fix them.
* If there are conflicts within `Paper-API`, after fixing them run `./gradlew rebuildApiPatches` before re-running `./gradlew applyPatches`.
* The API patches are applied first, so if there are conflicts in the API patches, the server patches will not be applied.
1. If your PR creates new patches instead of modifying existing ones, in both the `Paper-Server` and `Paper-API` directories, ensure your newly-created patch is the last commit by either:
* Renaming the patch file with a large 4-digit number in front (e.g. 9999-Patch-to-add-some-new-stuff.patch), and re-applying patches.
* Running `git rebase --interactive base` and moving the commits to the end.
@@ -251,17 +249,6 @@ instead of adding a new import to the top of the file. If you are using a type a
can add an import with a comment. However, if its only used a couple of times, the FQN is preferred to prevent future
patch conflicts in the import section of the file.
### Nullability annotations
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
`@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/).
**For classes added by upstream**: Keep using both `@Nullable` and `@NotNull` from `org.jetbrains.annotations`. These
will be replaced later.
```java
import org.bukkit.event.Event;
// don't add import here, use FQN like below
+1 -1
View File
@@ -43,7 +43,7 @@ ysl3000 <yannicklamprecht@live.de>
Machine_Maker <machine@machinemaker.me>
Ivan Pekov <ivan@mrivanplays.com>
Camotoy <20743703+Camotoy@users.noreply.github.com>
Bjarne Koll <git@lynxplay.dev>
Bjarne Koll <lynxplay101@gmail.com>
MeFisto94 <MeFisto94@users.noreply.github.com>
Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
LemonCaramel <admin@caramel.moe>
+2 -7
View File
@@ -1,8 +1,3 @@
> [!CAUTION]
> **This branch will be deleted soon, please replace usage of it with the new `main` branch**.
>
> If you need history from before 1.21.4, please use the archive repo: https://github.com/PaperMC/Paper-archive
Paper [![Paper Build Status](https://img.shields.io/github/actions/workflow/status/PaperMC/Paper/build.yml?branch=master)](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)
@@ -45,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.4-R0.1-SNAPSHOT</version>
<version>1.21.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@@ -58,7 +53,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.4-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT")
}
java {
+1 -1
View File
@@ -14,7 +14,7 @@ tiny 2 0 mojang+yarn spigot
# CraftBukkit changes type
c net/minecraft/server/level/ServerLevel net/minecraft/server/level/WorldServer
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData L
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData K
c net/minecraft/world/level/chunk/LevelChunk net/minecraft/world/level/chunk/Chunk
f Lnet/minecraft/server/level/ServerLevel; level r
+2 -3
View File
@@ -11,7 +11,7 @@ import kotlin.io.path.*
plugins {
java
`maven-publish`
id("io.papermc.paperweight.core") version "1.7.7"
id("io.papermc.paperweight.core") version "1.7.1"
}
allprojects {
@@ -31,7 +31,6 @@ subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release = 21
options.isFork = true
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
@@ -68,7 +67,7 @@ repositories {
}
dependencies {
paramMappings("net.fabricmc:yarn:1.21.4+build.1:mergedv2")
paramMappings("net.fabricmc:yarn:1.21.1+build.3:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.10.3:fat")
decompiler("org.vineflower:vineflower:1.10.1")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.13")
+2 -2
View File
@@ -1,6 +1,6 @@
group=io.papermc.paper
version=1.21.4-R0.1-SNAPSHOT
mcVersion=1.21.4
version=1.21.1-R0.1-SNAPSHOT
mcVersion=1.21.1
# 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-8.11.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+1 -4
View File
@@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -86,8 +84,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Vendored
-2
View File
@@ -13,8 +13,6 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
+1 -3
View File
@@ -1,6 +1,5 @@
import io.papermc.paperweight.PaperweightSourceGeneratorHelper
import io.papermc.paperweight.extension.PaperweightSourceGeneratorExt
import io.papermc.paperweight.util.defaultJavaLauncher
plugins {
java
@@ -16,7 +15,7 @@ dependencies {
implementation("com.squareup:javapoet:1.13.0")
implementation(project(":paper-api"))
implementation("io.github.classgraph:classgraph:4.8.47")
implementation("org.jetbrains:annotations:24.1.0")
implementation("org.jetbrains:annotations:24.0.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
@@ -26,7 +25,6 @@ tasks.register<JavaExec>("generate") {
mainClass.set("io.papermc.generator.Main")
classpath(sourceSets.main.map { it.runtimeClasspath })
args(projectDir.toPath().resolve("generated").toString())
javaLauncher = javaToolchains.defaultJavaLauncher(project)
}
tasks.test {
@@ -51,7 +51,7 @@ import org.bukkit.entity.WanderingTrader;
import org.bukkit.entity.Wither;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.Zombie;
import org.jspecify.annotations.NullMarked;
import org.checkerframework.checker.nullness.qual.NonNull;
/**
* Vanilla keys for Mob Goals.
@@ -66,8 +66,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
@@ -103,10 +102,6 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Bee> BEE_WANDER = create("bee_wander", Bee.class);
GoalKey<Bee> VALIDATE_FLOWER = create("validate_flower", Bee.class);
GoalKey<Bee> VALIDATE_HIVE = create("validate_hive", Bee.class);
GoalKey<Blaze> BLAZE_ATTACK = create("blaze_attack", Blaze.class);
GoalKey<Cat> CAT_AVOID_ENTITY = create("cat_avoid_entity", Cat.class);
@@ -239,8 +234,6 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Guardian> GUARDIAN_ATTACK = create("guardian_attack", Guardian.class);
GoalKey<Illager> HOLD_GROUND_ATTACK = create("hold_ground_attack", Illager.class);
GoalKey<Illager> RAIDER_OPEN_DOOR = create("raider_open_door", Illager.class);
GoalKey<Illusioner> ILLUSIONER_BLINDNESS_SPELL = create("illusioner_blindness_spell", Illusioner.class);
@@ -341,6 +334,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Rabbit> RAID_GARDEN = create("raid_garden", Rabbit.class);
GoalKey<Raider> HOLD_GROUND_ATTACK = create("hold_ground_attack", Raider.class);
GoalKey<Raider> LONG_DISTANCE_PATROL = create("long_distance_patrol", Raider.class);
GoalKey<Raider> NEAREST_ATTACKABLE_WITCH = create("nearest_attackable_witch", Raider.class);
@@ -441,7 +436,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
private static <T extends Mob> GoalKey<T> create(final String key, final Class<T> type) {
private static <T extends Mob> @NonNull GoalKey<T> create(final @NonNull String key,
final @NonNull Class<T> type) {
return GoalKey.of(type, NamespacedKey.minecraft(key));
}
}
@@ -1,260 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.attribute.Attribute;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#ATTRIBUTE}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class AttributeKeys {
/**
* {@code minecraft:armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> ARMOR = create(key("armor"));
/**
* {@code minecraft:armor_toughness}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> ARMOR_TOUGHNESS = create(key("armor_toughness"));
/**
* {@code minecraft:attack_damage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> ATTACK_DAMAGE = create(key("attack_damage"));
/**
* {@code minecraft:attack_knockback}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> ATTACK_KNOCKBACK = create(key("attack_knockback"));
/**
* {@code minecraft:attack_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> ATTACK_SPEED = create(key("attack_speed"));
/**
* {@code minecraft:block_break_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> BLOCK_BREAK_SPEED = create(key("block_break_speed"));
/**
* {@code minecraft:block_interaction_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> BLOCK_INTERACTION_RANGE = create(key("block_interaction_range"));
/**
* {@code minecraft:burning_time}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> BURNING_TIME = create(key("burning_time"));
/**
* {@code minecraft:entity_interaction_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> ENTITY_INTERACTION_RANGE = create(key("entity_interaction_range"));
/**
* {@code minecraft:explosion_knockback_resistance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> EXPLOSION_KNOCKBACK_RESISTANCE = create(key("explosion_knockback_resistance"));
/**
* {@code minecraft:fall_damage_multiplier}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> FALL_DAMAGE_MULTIPLIER = create(key("fall_damage_multiplier"));
/**
* {@code minecraft:flying_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> FLYING_SPEED = create(key("flying_speed"));
/**
* {@code minecraft:follow_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> FOLLOW_RANGE = create(key("follow_range"));
/**
* {@code minecraft:gravity}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> GRAVITY = create(key("gravity"));
/**
* {@code minecraft:jump_strength}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> JUMP_STRENGTH = create(key("jump_strength"));
/**
* {@code minecraft:knockback_resistance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> KNOCKBACK_RESISTANCE = create(key("knockback_resistance"));
/**
* {@code minecraft:luck}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> LUCK = create(key("luck"));
/**
* {@code minecraft:max_absorption}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> MAX_ABSORPTION = create(key("max_absorption"));
/**
* {@code minecraft:max_health}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> MAX_HEALTH = create(key("max_health"));
/**
* {@code minecraft:mining_efficiency}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> MINING_EFFICIENCY = create(key("mining_efficiency"));
/**
* {@code minecraft:movement_efficiency}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> MOVEMENT_EFFICIENCY = create(key("movement_efficiency"));
/**
* {@code minecraft:movement_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> MOVEMENT_SPEED = create(key("movement_speed"));
/**
* {@code minecraft:oxygen_bonus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> OXYGEN_BONUS = create(key("oxygen_bonus"));
/**
* {@code minecraft:safe_fall_distance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> SAFE_FALL_DISTANCE = create(key("safe_fall_distance"));
/**
* {@code minecraft:scale}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> SCALE = create(key("scale"));
/**
* {@code minecraft:sneaking_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> SNEAKING_SPEED = create(key("sneaking_speed"));
/**
* {@code minecraft:spawn_reinforcements}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> SPAWN_REINFORCEMENTS = create(key("spawn_reinforcements"));
/**
* {@code minecraft:step_height}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> STEP_HEIGHT = create(key("step_height"));
/**
* {@code minecraft:submerged_mining_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> SUBMERGED_MINING_SPEED = create(key("submerged_mining_speed"));
/**
* {@code minecraft:sweeping_damage_ratio}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> SWEEPING_DAMAGE_RATIO = create(key("sweeping_damage_ratio"));
/**
* {@code minecraft:tempt_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> TEMPT_RANGE = create(key("tempt_range"));
/**
* {@code minecraft:water_movement_efficiency}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> WATER_MOVEMENT_EFFICIENCY = create(key("water_movement_efficiency"));
private AttributeKeys() {
}
private static TypedKey<Attribute> create(final Key key) {
return TypedKey.create(RegistryKey.ATTRIBUTE, key);
}
}
@@ -1,344 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.banner.PatternType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#BANNER_PATTERN}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class BannerPatternKeys {
/**
* {@code minecraft:base}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> BASE = create(key("base"));
/**
* {@code minecraft:border}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> BORDER = create(key("border"));
/**
* {@code minecraft:bricks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> BRICKS = create(key("bricks"));
/**
* {@code minecraft:circle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> CIRCLE = create(key("circle"));
/**
* {@code minecraft:creeper}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> CREEPER = create(key("creeper"));
/**
* {@code minecraft:cross}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> CROSS = create(key("cross"));
/**
* {@code minecraft:curly_border}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> CURLY_BORDER = create(key("curly_border"));
/**
* {@code minecraft:diagonal_left}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> DIAGONAL_LEFT = create(key("diagonal_left"));
/**
* {@code minecraft:diagonal_right}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> DIAGONAL_RIGHT = create(key("diagonal_right"));
/**
* {@code minecraft:diagonal_up_left}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> DIAGONAL_UP_LEFT = create(key("diagonal_up_left"));
/**
* {@code minecraft:diagonal_up_right}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> DIAGONAL_UP_RIGHT = create(key("diagonal_up_right"));
/**
* {@code minecraft:flow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> FLOW = create(key("flow"));
/**
* {@code minecraft:flower}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> FLOWER = create(key("flower"));
/**
* {@code minecraft:globe}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> GLOBE = create(key("globe"));
/**
* {@code minecraft:gradient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> GRADIENT = create(key("gradient"));
/**
* {@code minecraft:gradient_up}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> GRADIENT_UP = create(key("gradient_up"));
/**
* {@code minecraft:guster}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> GUSTER = create(key("guster"));
/**
* {@code minecraft:half_horizontal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> HALF_HORIZONTAL = create(key("half_horizontal"));
/**
* {@code minecraft:half_horizontal_bottom}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> HALF_HORIZONTAL_BOTTOM = create(key("half_horizontal_bottom"));
/**
* {@code minecraft:half_vertical}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> HALF_VERTICAL = create(key("half_vertical"));
/**
* {@code minecraft:half_vertical_right}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> HALF_VERTICAL_RIGHT = create(key("half_vertical_right"));
/**
* {@code minecraft:mojang}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> MOJANG = create(key("mojang"));
/**
* {@code minecraft:piglin}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> PIGLIN = create(key("piglin"));
/**
* {@code minecraft:rhombus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> RHOMBUS = create(key("rhombus"));
/**
* {@code minecraft:skull}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> SKULL = create(key("skull"));
/**
* {@code minecraft:small_stripes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> SMALL_STRIPES = create(key("small_stripes"));
/**
* {@code minecraft:square_bottom_left}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> SQUARE_BOTTOM_LEFT = create(key("square_bottom_left"));
/**
* {@code minecraft:square_bottom_right}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> SQUARE_BOTTOM_RIGHT = create(key("square_bottom_right"));
/**
* {@code minecraft:square_top_left}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> SQUARE_TOP_LEFT = create(key("square_top_left"));
/**
* {@code minecraft:square_top_right}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> SQUARE_TOP_RIGHT = create(key("square_top_right"));
/**
* {@code minecraft:straight_cross}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRAIGHT_CROSS = create(key("straight_cross"));
/**
* {@code minecraft:stripe_bottom}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_BOTTOM = create(key("stripe_bottom"));
/**
* {@code minecraft:stripe_center}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_CENTER = create(key("stripe_center"));
/**
* {@code minecraft:stripe_downleft}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_DOWNLEFT = create(key("stripe_downleft"));
/**
* {@code minecraft:stripe_downright}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_DOWNRIGHT = create(key("stripe_downright"));
/**
* {@code minecraft:stripe_left}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_LEFT = create(key("stripe_left"));
/**
* {@code minecraft:stripe_middle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_MIDDLE = create(key("stripe_middle"));
/**
* {@code minecraft:stripe_right}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_RIGHT = create(key("stripe_right"));
/**
* {@code minecraft:stripe_top}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> STRIPE_TOP = create(key("stripe_top"));
/**
* {@code minecraft:triangle_bottom}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> TRIANGLE_BOTTOM = create(key("triangle_bottom"));
/**
* {@code minecraft:triangle_top}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> TRIANGLE_TOP = create(key("triangle_top"));
/**
* {@code minecraft:triangles_bottom}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> TRIANGLES_BOTTOM = create(key("triangles_bottom"));
/**
* {@code minecraft:triangles_top}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PatternType> TRIANGLES_TOP = create(key("triangles_top"));
private BannerPatternKeys() {
}
/**
* Creates a key for {@link PatternType} in the registry {@code minecraft:banner_pattern}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<PatternType> create(final Key key) {
return TypedKey.create(RegistryKey.BANNER_PATTERN, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.Biome;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#BIOME}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class BiomeKeys {
/**
@@ -300,13 +299,6 @@ public final class BiomeKeys {
*/
public static final TypedKey<Biome> OLD_GROWTH_SPRUCE_TAIGA = create(key("old_growth_spruce_taiga"));
/**
* {@code minecraft:pale_garden}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Biome> PALE_GARDEN = create(key("pale_garden"));
/**
* {@code minecraft:plains}
*
@@ -492,7 +484,7 @@ public final class BiomeKeys {
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<Biome> create(final Key key) {
public static @NonNull TypedKey<Biome> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.BIOME, key);
}
}
File diff suppressed because it is too large. Load diff
@@ -1,113 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
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.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#CAT_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class CatVariantKeys {
/**
* {@code minecraft:all_black}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> ALL_BLACK = create(key("all_black"));
/**
* {@code minecraft:black}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> BLACK = create(key("black"));
/**
* {@code minecraft:british_shorthair}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> BRITISH_SHORTHAIR = create(key("british_shorthair"));
/**
* {@code minecraft:calico}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> CALICO = create(key("calico"));
/**
* {@code minecraft:jellie}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> JELLIE = create(key("jellie"));
/**
* {@code minecraft:persian}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> PERSIAN = create(key("persian"));
/**
* {@code minecraft:ragdoll}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> RAGDOLL = create(key("ragdoll"));
/**
* {@code minecraft:red}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> RED = create(key("red"));
/**
* {@code minecraft:siamese}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> SIAMESE = create(key("siamese"));
/**
* {@code minecraft:tabby}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> TABBY = create(key("tabby"));
/**
* {@code minecraft:white}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Cat.Type> WHITE = create(key("white"));
private CatVariantKeys() {
}
private static TypedKey<Cat.Type> create(final Key key) {
return TypedKey.create(RegistryKey.CAT_VARIANT, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#DAMAGE_TYPE}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class DamageTypeKeys {
/**
@@ -83,13 +82,6 @@ public final class DamageTypeKeys {
*/
public static final TypedKey<DamageType> DRY_OUT = create(key("dry_out"));
/**
* {@code minecraft:ender_pearl}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DamageType> ENDER_PEARL = create(key("ender_pearl"));
/**
* {@code minecraft:explosion}
*
@@ -209,13 +201,6 @@ public final class DamageTypeKeys {
*/
public static final TypedKey<DamageType> LIGHTNING_BOLT = create(key("lightning_bolt"));
/**
* {@code minecraft:mace_smash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DamageType> MACE_SMASH = create(key("mace_smash"));
/**
* {@code minecraft:magic}
*
@@ -380,7 +365,7 @@ public final class DamageTypeKeys {
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<DamageType> create(final Key key) {
public static @NonNull TypedKey<DamageType> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.DAMAGE_TYPE, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.enchantments.Enchantment;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#ENCHANTMENT}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class EnchantmentKeys {
/**
@@ -324,14 +323,7 @@ public final class EnchantmentKeys {
private EnchantmentKeys() {
}
/**
* Creates a key for {@link Enchantment} in the registry {@code minecraft:enchantment}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<Enchantment> create(final Key key) {
private static @NonNull TypedKey<Enchantment> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.ENCHANTMENT, key);
}
}
@@ -1,71 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Fluid;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#FLUID}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class FluidKeys {
/**
* {@code minecraft:empty}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Fluid> EMPTY = create(key("empty"));
/**
* {@code minecraft:flowing_lava}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Fluid> FLOWING_LAVA = create(key("flowing_lava"));
/**
* {@code minecraft:flowing_water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Fluid> FLOWING_WATER = create(key("flowing_water"));
/**
* {@code minecraft:lava}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Fluid> LAVA = create(key("lava"));
/**
* {@code minecraft:water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Fluid> WATER = create(key("water"));
private FluidKeys() {
}
private static TypedKey<Fluid> create(final Key key) {
return TypedKey.create(RegistryKey.FLUID, key);
}
}
@@ -1,57 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Frog;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#FROG_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class FrogVariantKeys {
/**
* {@code minecraft:cold}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Frog.Variant> COLD = create(key("cold"));
/**
* {@code minecraft:temperate}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Frog.Variant> TEMPERATE = create(key("temperate"));
/**
* {@code minecraft:warm}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Frog.Variant> WARM = create(key("warm"));
private FrogVariantKeys() {
}
private static TypedKey<Frog.Variant> create(final Key key) {
return TypedKey.create(RegistryKey.FROG_VARIANT, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.GameEvent;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#GAME_EVENT}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class GameEventKeys {
/**
@@ -450,14 +449,7 @@ public final class GameEventKeys {
private GameEventKeys() {
}
/**
* Creates a key for {@link GameEvent} in the registry {@code minecraft:game_event}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<GameEvent> create(final Key key) {
private static @NonNull TypedKey<GameEvent> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.GAME_EVENT, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.MusicInstrument;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#INSTRUMENT}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class InstrumentKeys {
/**
@@ -86,14 +85,7 @@ public final class InstrumentKeys {
private InstrumentKeys() {
}
/**
* Creates a key for {@link MusicInstrument} in the registry {@code minecraft:instrument}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<MusicInstrument> create(final Key key) {
private static @NonNull TypedKey<MusicInstrument> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.INSTRUMENT, key);
}
}
File diff suppressed because it is too large. Load diff
@@ -1,176 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.JukeboxSong;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#JUKEBOX_SONG}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class JukeboxSongKeys {
/**
* {@code minecraft:11}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> ELEVEN = create(key("11"));
/**
* {@code minecraft:13}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> THIRTEEN = create(key("13"));
/**
* {@code minecraft:5}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> FIVE = create(key("5"));
/**
* {@code minecraft:blocks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> BLOCKS = create(key("blocks"));
/**
* {@code minecraft:cat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> CAT = create(key("cat"));
/**
* {@code minecraft:chirp}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> CHIRP = create(key("chirp"));
/**
* {@code minecraft:creator}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> CREATOR = create(key("creator"));
/**
* {@code minecraft:creator_music_box}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> CREATOR_MUSIC_BOX = create(key("creator_music_box"));
/**
* {@code minecraft:far}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> FAR = create(key("far"));
/**
* {@code minecraft:mall}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> MALL = create(key("mall"));
/**
* {@code minecraft:mellohi}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> MELLOHI = create(key("mellohi"));
/**
* {@code minecraft:otherside}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> OTHERSIDE = create(key("otherside"));
/**
* {@code minecraft:pigstep}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> PIGSTEP = create(key("pigstep"));
/**
* {@code minecraft:precipice}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> PRECIPICE = create(key("precipice"));
/**
* {@code minecraft:relic}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> RELIC = create(key("relic"));
/**
* {@code minecraft:stal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> STAL = create(key("stal"));
/**
* {@code minecraft:strad}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> STRAD = create(key("strad"));
/**
* {@code minecraft:wait}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> WAIT = create(key("wait"));
/**
* {@code minecraft:ward}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> WARD = create(key("ward"));
private JukeboxSongKeys() {
}
/**
* Creates a key for {@link JukeboxSong} in the registry {@code minecraft:jukebox_song}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<JukeboxSong> create(final Key key) {
return TypedKey.create(RegistryKey.JUKEBOX_SONG, key);
}
}
@@ -1,281 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.map.MapCursor;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#MAP_DECORATION_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class MapDecorationTypeKeys {
/**
* {@code minecraft:banner_black}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_BLACK = create(key("banner_black"));
/**
* {@code minecraft:banner_blue}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_BLUE = create(key("banner_blue"));
/**
* {@code minecraft:banner_brown}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_BROWN = create(key("banner_brown"));
/**
* {@code minecraft:banner_cyan}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_CYAN = create(key("banner_cyan"));
/**
* {@code minecraft:banner_gray}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_GRAY = create(key("banner_gray"));
/**
* {@code minecraft:banner_green}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_GREEN = create(key("banner_green"));
/**
* {@code minecraft:banner_light_blue}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_LIGHT_BLUE = create(key("banner_light_blue"));
/**
* {@code minecraft:banner_light_gray}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_LIGHT_GRAY = create(key("banner_light_gray"));
/**
* {@code minecraft:banner_lime}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_LIME = create(key("banner_lime"));
/**
* {@code minecraft:banner_magenta}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_MAGENTA = create(key("banner_magenta"));
/**
* {@code minecraft:banner_orange}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_ORANGE = create(key("banner_orange"));
/**
* {@code minecraft:banner_pink}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_PINK = create(key("banner_pink"));
/**
* {@code minecraft:banner_purple}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_PURPLE = create(key("banner_purple"));
/**
* {@code minecraft:banner_red}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_RED = create(key("banner_red"));
/**
* {@code minecraft:banner_white}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_WHITE = create(key("banner_white"));
/**
* {@code minecraft:banner_yellow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BANNER_YELLOW = create(key("banner_yellow"));
/**
* {@code minecraft:blue_marker}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> BLUE_MARKER = create(key("blue_marker"));
/**
* {@code minecraft:frame}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> FRAME = create(key("frame"));
/**
* {@code minecraft:jungle_temple}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> JUNGLE_TEMPLE = create(key("jungle_temple"));
/**
* {@code minecraft:mansion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> MANSION = create(key("mansion"));
/**
* {@code minecraft:monument}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> MONUMENT = create(key("monument"));
/**
* {@code minecraft:player}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> PLAYER = create(key("player"));
/**
* {@code minecraft:player_off_limits}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> PLAYER_OFF_LIMITS = create(key("player_off_limits"));
/**
* {@code minecraft:player_off_map}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> PLAYER_OFF_MAP = create(key("player_off_map"));
/**
* {@code minecraft:red_marker}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> RED_MARKER = create(key("red_marker"));
/**
* {@code minecraft:red_x}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> RED_X = create(key("red_x"));
/**
* {@code minecraft:swamp_hut}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> SWAMP_HUT = create(key("swamp_hut"));
/**
* {@code minecraft:target_point}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> TARGET_POINT = create(key("target_point"));
/**
* {@code minecraft:target_x}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> TARGET_X = create(key("target_x"));
/**
* {@code minecraft:trial_chambers}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> TRIAL_CHAMBERS = create(key("trial_chambers"));
/**
* {@code minecraft:village_desert}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> VILLAGE_DESERT = create(key("village_desert"));
/**
* {@code minecraft:village_plains}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> VILLAGE_PLAINS = create(key("village_plains"));
/**
* {@code minecraft:village_savanna}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> VILLAGE_SAVANNA = create(key("village_savanna"));
/**
* {@code minecraft:village_snowy}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> VILLAGE_SNOWY = create(key("village_snowy"));
/**
* {@code minecraft:village_taiga}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MapCursor.Type> VILLAGE_TAIGA = create(key("village_taiga"));
private MapDecorationTypeKeys() {
}
private static TypedKey<MapCursor.Type> create(final Key key) {
return TypedKey.create(RegistryKey.MAP_DECORATION_TYPE, key);
}
}
@@ -1,211 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.MenuType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#MENU}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class MenuTypeKeys {
/**
* {@code minecraft:anvil}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> ANVIL = create(key("anvil"));
/**
* {@code minecraft:beacon}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> BEACON = create(key("beacon"));
/**
* {@code minecraft:blast_furnace}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> BLAST_FURNACE = create(key("blast_furnace"));
/**
* {@code minecraft:brewing_stand}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> BREWING_STAND = create(key("brewing_stand"));
/**
* {@code minecraft:cartography_table}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> CARTOGRAPHY_TABLE = create(key("cartography_table"));
/**
* {@code minecraft:crafter_3x3}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> CRAFTER_3X3 = create(key("crafter_3x3"));
/**
* {@code minecraft:crafting}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> CRAFTING = create(key("crafting"));
/**
* {@code minecraft:enchantment}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> ENCHANTMENT = create(key("enchantment"));
/**
* {@code minecraft:furnace}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> FURNACE = create(key("furnace"));
/**
* {@code minecraft:generic_3x3}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GENERIC_3X3 = create(key("generic_3x3"));
/**
* {@code minecraft:generic_9x1}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GENERIC_9X1 = create(key("generic_9x1"));
/**
* {@code minecraft:generic_9x2}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GENERIC_9X2 = create(key("generic_9x2"));
/**
* {@code minecraft:generic_9x3}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GENERIC_9X3 = create(key("generic_9x3"));
/**
* {@code minecraft:generic_9x4}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GENERIC_9X4 = create(key("generic_9x4"));
/**
* {@code minecraft:generic_9x5}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GENERIC_9X5 = create(key("generic_9x5"));
/**
* {@code minecraft:generic_9x6}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GENERIC_9X6 = create(key("generic_9x6"));
/**
* {@code minecraft:grindstone}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> GRINDSTONE = create(key("grindstone"));
/**
* {@code minecraft:hopper}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> HOPPER = create(key("hopper"));
/**
* {@code minecraft:lectern}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> LECTERN = create(key("lectern"));
/**
* {@code minecraft:loom}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> LOOM = create(key("loom"));
/**
* {@code minecraft:merchant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> MERCHANT = create(key("merchant"));
/**
* {@code minecraft:shulker_box}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> SHULKER_BOX = create(key("shulker_box"));
/**
* {@code minecraft:smithing}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> SMITHING = create(key("smithing"));
/**
* {@code minecraft:smoker}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> SMOKER = create(key("smoker"));
/**
* {@code minecraft:stonecutter}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<MenuType> STONECUTTER = create(key("stonecutter"));
private MenuTypeKeys() {
}
private static TypedKey<MenuType> create(final Key key) {
return TypedKey.create(RegistryKey.MENU, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.potion.PotionEffectType;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#MOB_EFFECT}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class MobEffectKeys {
/**
@@ -303,7 +302,7 @@ public final class MobEffectKeys {
private MobEffectKeys() {
}
private static TypedKey<PotionEffectType> create(final Key key) {
private static @NonNull TypedKey<PotionEffectType> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.MOB_EFFECT, key);
}
}
@@ -1,393 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Art;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#PAINTING_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class PaintingVariantKeys {
/**
* {@code minecraft:alban}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> ALBAN = create(key("alban"));
/**
* {@code minecraft:aztec}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> AZTEC = create(key("aztec"));
/**
* {@code minecraft:aztec2}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> AZTEC2 = create(key("aztec2"));
/**
* {@code minecraft:backyard}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> BACKYARD = create(key("backyard"));
/**
* {@code minecraft:baroque}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> BAROQUE = create(key("baroque"));
/**
* {@code minecraft:bomb}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> BOMB = create(key("bomb"));
/**
* {@code minecraft:bouquet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> BOUQUET = create(key("bouquet"));
/**
* {@code minecraft:burning_skull}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> BURNING_SKULL = create(key("burning_skull"));
/**
* {@code minecraft:bust}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> BUST = create(key("bust"));
/**
* {@code minecraft:cavebird}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> CAVEBIRD = create(key("cavebird"));
/**
* {@code minecraft:changing}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> CHANGING = create(key("changing"));
/**
* {@code minecraft:cotan}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> COTAN = create(key("cotan"));
/**
* {@code minecraft:courbet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> COURBET = create(key("courbet"));
/**
* {@code minecraft:creebet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> CREEBET = create(key("creebet"));
/**
* {@code minecraft:donkey_kong}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> DONKEY_KONG = create(key("donkey_kong"));
/**
* {@code minecraft:earth}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> EARTH = create(key("earth"));
/**
* {@code minecraft:endboss}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> ENDBOSS = create(key("endboss"));
/**
* {@code minecraft:fern}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> FERN = create(key("fern"));
/**
* {@code minecraft:fighters}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> FIGHTERS = create(key("fighters"));
/**
* {@code minecraft:finding}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> FINDING = create(key("finding"));
/**
* {@code minecraft:fire}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> FIRE = create(key("fire"));
/**
* {@code minecraft:graham}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> GRAHAM = create(key("graham"));
/**
* {@code minecraft:humble}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> HUMBLE = create(key("humble"));
/**
* {@code minecraft:kebab}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> KEBAB = create(key("kebab"));
/**
* {@code minecraft:lowmist}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> LOWMIST = create(key("lowmist"));
/**
* {@code minecraft:match}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> MATCH = create(key("match"));
/**
* {@code minecraft:meditative}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> MEDITATIVE = create(key("meditative"));
/**
* {@code minecraft:orb}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> ORB = create(key("orb"));
/**
* {@code minecraft:owlemons}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> OWLEMONS = create(key("owlemons"));
/**
* {@code minecraft:passage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> PASSAGE = create(key("passage"));
/**
* {@code minecraft:pigscene}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> PIGSCENE = create(key("pigscene"));
/**
* {@code minecraft:plant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> PLANT = create(key("plant"));
/**
* {@code minecraft:pointer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> POINTER = create(key("pointer"));
/**
* {@code minecraft:pond}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> POND = create(key("pond"));
/**
* {@code minecraft:pool}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> POOL = create(key("pool"));
/**
* {@code minecraft:prairie_ride}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> PRAIRIE_RIDE = create(key("prairie_ride"));
/**
* {@code minecraft:sea}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> SEA = create(key("sea"));
/**
* {@code minecraft:skeleton}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> SKELETON = create(key("skeleton"));
/**
* {@code minecraft:skull_and_roses}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> SKULL_AND_ROSES = create(key("skull_and_roses"));
/**
* {@code minecraft:stage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> STAGE = create(key("stage"));
/**
* {@code minecraft:sunflowers}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> SUNFLOWERS = create(key("sunflowers"));
/**
* {@code minecraft:sunset}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> SUNSET = create(key("sunset"));
/**
* {@code minecraft:tides}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> TIDES = create(key("tides"));
/**
* {@code minecraft:unpacked}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> UNPACKED = create(key("unpacked"));
/**
* {@code minecraft:void}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> VOID = create(key("void"));
/**
* {@code minecraft:wanderer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> WANDERER = create(key("wanderer"));
/**
* {@code minecraft:wasteland}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> WASTELAND = create(key("wasteland"));
/**
* {@code minecraft:water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> WATER = create(key("water"));
/**
* {@code minecraft:wind}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> WIND = create(key("wind"));
/**
* {@code minecraft:wither}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> WITHER = create(key("wither"));
private PaintingVariantKeys() {
}
/**
* Creates a key for {@link Art} in the registry {@code minecraft:painting_variant}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<Art> create(final Key key) {
return TypedKey.create(RegistryKey.PAINTING_VARIANT, key);
}
}
File diff suppressed because it is too large. Load diff
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.Structure;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#STRUCTURE}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class StructureKeys {
/**
@@ -275,7 +274,7 @@ public final class StructureKeys {
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<Structure> create(final Key key) {
public static @NonNull TypedKey<Structure> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.STRUCTURE, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.StructureType;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#STRUCTURE_TYPE}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class StructureTypeKeys {
/**
@@ -142,7 +141,7 @@ public final class StructureTypeKeys {
private StructureTypeKeys() {
}
private static TypedKey<StructureType> create(final Key key) {
private static @NonNull TypedKey<StructureType> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.STRUCTURE_TYPE, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.meta.trim.TrimMaterial;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#TRIM_MATERIAL}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class TrimMaterialKeys {
/**
@@ -97,13 +96,6 @@ public final class TrimMaterialKeys {
*/
public static final TypedKey<TrimMaterial> REDSTONE = create(key("redstone"));
/**
* {@code minecraft:resin}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<TrimMaterial> RESIN = create(key("resin"));
private TrimMaterialKeys() {
}
@@ -114,7 +106,7 @@ public final class TrimMaterialKeys {
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<TrimMaterial> create(final Key key) {
public static @NonNull TypedKey<TrimMaterial> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.TRIM_MATERIAL, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.meta.trim.TrimPattern;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#TRIM_PATTERN}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class TrimPatternKeys {
/**
@@ -163,7 +162,7 @@ public final class TrimPatternKeys {
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<TrimPattern> create(final Key key) {
public static @NonNull TypedKey<TrimPattern> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.TRIM_PATTERN, key);
}
}
@@ -1,141 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Villager;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#VILLAGER_PROFESSION}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class VillagerProfessionKeys {
/**
* {@code minecraft:armorer}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> ARMORER = create(key("armorer"));
/**
* {@code minecraft:butcher}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> 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<Villager.Profession> 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<Villager.Profession> 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<Villager.Profession> 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<Villager.Profession> 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<Villager.Profession> FLETCHER = create(key("fletcher"));
/**
* {@code minecraft:leatherworker}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> 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<Villager.Profession> LIBRARIAN = create(key("librarian"));
/**
* {@code minecraft:mason}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> MASON = create(key("mason"));
/**
* {@code minecraft:nitwit}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> NITWIT = create(key("nitwit"));
/**
* {@code minecraft:none}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> NONE = create(key("none"));
/**
* {@code minecraft:shepherd}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> SHEPHERD = create(key("shepherd"));
/**
* {@code minecraft:toolsmith}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Profession> 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<Villager.Profession> WEAPONSMITH = create(key("weaponsmith"));
private VillagerProfessionKeys() {
}
private static TypedKey<Villager.Profession> create(final Key key) {
return TypedKey.create(RegistryKey.VILLAGER_PROFESSION, key);
}
}
@@ -1,85 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Villager;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#VILLAGER_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class VillagerTypeKeys {
/**
* {@code minecraft:desert}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Type> DESERT = create(key("desert"));
/**
* {@code minecraft:jungle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Type> JUNGLE = create(key("jungle"));
/**
* {@code minecraft:plains}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Type> PLAINS = create(key("plains"));
/**
* {@code minecraft:savanna}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Type> SAVANNA = create(key("savanna"));
/**
* {@code minecraft:snow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Type> SNOW = create(key("snow"));
/**
* {@code minecraft:swamp}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Type> SWAMP = create(key("swamp"));
/**
* {@code minecraft:taiga}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Villager.Type> TAIGA = create(key("taiga"));
private VillagerTypeKeys() {
}
private static TypedKey<Villager.Type> create(final Key key) {
return TypedKey.create(RegistryKey.VILLAGER_TYPE, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Wolf;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#WOLF_VARIANT}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class WolfVariantKeys {
/**
@@ -100,7 +99,7 @@ public final class WolfVariantKeys {
* @return a new typed key
*/
@ApiStatus.Experimental
public static TypedKey<Wolf.Variant> create(final Key key) {
public static @NonNull TypedKey<Wolf.Variant> create(final @NonNull Key key) {
return TypedKey.create(RegistryKey.WOLF_VARIANT, key);
}
}
@@ -1,120 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.banner.PatternType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#BANNER_PATTERN}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class BannerPatternTagKeys {
/**
* {@code #minecraft:no_item_required}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> NO_ITEM_REQUIRED = create(key("no_item_required"));
/**
* {@code #minecraft:pattern_item/bordure_indented}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_BORDURE_INDENTED = create(key("pattern_item/bordure_indented"));
/**
* {@code #minecraft:pattern_item/creeper}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_CREEPER = create(key("pattern_item/creeper"));
/**
* {@code #minecraft:pattern_item/field_masoned}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_FIELD_MASONED = create(key("pattern_item/field_masoned"));
/**
* {@code #minecraft:pattern_item/flow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_FLOW = create(key("pattern_item/flow"));
/**
* {@code #minecraft:pattern_item/flower}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_FLOWER = create(key("pattern_item/flower"));
/**
* {@code #minecraft:pattern_item/globe}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_GLOBE = create(key("pattern_item/globe"));
/**
* {@code #minecraft:pattern_item/guster}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_GUSTER = create(key("pattern_item/guster"));
/**
* {@code #minecraft:pattern_item/mojang}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_MOJANG = create(key("pattern_item/mojang"));
/**
* {@code #minecraft:pattern_item/piglin}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_PIGLIN = create(key("pattern_item/piglin"));
/**
* {@code #minecraft:pattern_item/skull}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<PatternType> PATTERN_ITEM_SKULL = create(key("pattern_item/skull"));
private BannerPatternTagKeys() {
}
/**
* Creates a tag key for {@link PatternType} in the registry {@code minecraft:banner_pattern}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<PatternType> create(final Key key) {
return TagKey.create(RegistryKey.BANNER_PATTERN, key);
}
}
@@ -1,533 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.Biome;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#BIOME}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class BiomeTagKeys {
/**
* {@code #minecraft:allows_surface_slime_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> ALLOWS_SURFACE_SLIME_SPAWNS = create(key("allows_surface_slime_spawns"));
/**
* {@code #minecraft:allows_tropical_fish_spawns_at_any_height}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> ALLOWS_TROPICAL_FISH_SPAWNS_AT_ANY_HEIGHT = create(key("allows_tropical_fish_spawns_at_any_height"));
/**
* {@code #minecraft:has_closer_water_fog}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_CLOSER_WATER_FOG = create(key("has_closer_water_fog"));
/**
* {@code #minecraft:has_structure/ancient_city}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_ANCIENT_CITY = create(key("has_structure/ancient_city"));
/**
* {@code #minecraft:has_structure/bastion_remnant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_BASTION_REMNANT = create(key("has_structure/bastion_remnant"));
/**
* {@code #minecraft:has_structure/buried_treasure}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_BURIED_TREASURE = create(key("has_structure/buried_treasure"));
/**
* {@code #minecraft:has_structure/desert_pyramid}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_DESERT_PYRAMID = create(key("has_structure/desert_pyramid"));
/**
* {@code #minecraft:has_structure/end_city}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_END_CITY = create(key("has_structure/end_city"));
/**
* {@code #minecraft:has_structure/igloo}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_IGLOO = create(key("has_structure/igloo"));
/**
* {@code #minecraft:has_structure/jungle_temple}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_JUNGLE_TEMPLE = create(key("has_structure/jungle_temple"));
/**
* {@code #minecraft:has_structure/mineshaft}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_MINESHAFT = create(key("has_structure/mineshaft"));
/**
* {@code #minecraft:has_structure/mineshaft_mesa}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_MINESHAFT_MESA = create(key("has_structure/mineshaft_mesa"));
/**
* {@code #minecraft:has_structure/nether_fortress}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_NETHER_FORTRESS = create(key("has_structure/nether_fortress"));
/**
* {@code #minecraft:has_structure/nether_fossil}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_NETHER_FOSSIL = create(key("has_structure/nether_fossil"));
/**
* {@code #minecraft:has_structure/ocean_monument}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_OCEAN_MONUMENT = create(key("has_structure/ocean_monument"));
/**
* {@code #minecraft:has_structure/ocean_ruin_cold}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_OCEAN_RUIN_COLD = create(key("has_structure/ocean_ruin_cold"));
/**
* {@code #minecraft:has_structure/ocean_ruin_warm}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_OCEAN_RUIN_WARM = create(key("has_structure/ocean_ruin_warm"));
/**
* {@code #minecraft:has_structure/pillager_outpost}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_PILLAGER_OUTPOST = create(key("has_structure/pillager_outpost"));
/**
* {@code #minecraft:has_structure/ruined_portal_desert}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_RUINED_PORTAL_DESERT = create(key("has_structure/ruined_portal_desert"));
/**
* {@code #minecraft:has_structure/ruined_portal_jungle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_RUINED_PORTAL_JUNGLE = create(key("has_structure/ruined_portal_jungle"));
/**
* {@code #minecraft:has_structure/ruined_portal_mountain}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_RUINED_PORTAL_MOUNTAIN = create(key("has_structure/ruined_portal_mountain"));
/**
* {@code #minecraft:has_structure/ruined_portal_nether}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_RUINED_PORTAL_NETHER = create(key("has_structure/ruined_portal_nether"));
/**
* {@code #minecraft:has_structure/ruined_portal_ocean}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_RUINED_PORTAL_OCEAN = create(key("has_structure/ruined_portal_ocean"));
/**
* {@code #minecraft:has_structure/ruined_portal_standard}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_RUINED_PORTAL_STANDARD = create(key("has_structure/ruined_portal_standard"));
/**
* {@code #minecraft:has_structure/ruined_portal_swamp}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_RUINED_PORTAL_SWAMP = create(key("has_structure/ruined_portal_swamp"));
/**
* {@code #minecraft:has_structure/shipwreck}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_SHIPWRECK = create(key("has_structure/shipwreck"));
/**
* {@code #minecraft:has_structure/shipwreck_beached}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_SHIPWRECK_BEACHED = create(key("has_structure/shipwreck_beached"));
/**
* {@code #minecraft:has_structure/stronghold}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_STRONGHOLD = create(key("has_structure/stronghold"));
/**
* {@code #minecraft:has_structure/swamp_hut}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_SWAMP_HUT = create(key("has_structure/swamp_hut"));
/**
* {@code #minecraft:has_structure/trail_ruins}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_TRAIL_RUINS = create(key("has_structure/trail_ruins"));
/**
* {@code #minecraft:has_structure/trial_chambers}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_TRIAL_CHAMBERS = create(key("has_structure/trial_chambers"));
/**
* {@code #minecraft:has_structure/village_desert}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_VILLAGE_DESERT = create(key("has_structure/village_desert"));
/**
* {@code #minecraft:has_structure/village_plains}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_VILLAGE_PLAINS = create(key("has_structure/village_plains"));
/**
* {@code #minecraft:has_structure/village_savanna}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_VILLAGE_SAVANNA = create(key("has_structure/village_savanna"));
/**
* {@code #minecraft:has_structure/village_snowy}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_VILLAGE_SNOWY = create(key("has_structure/village_snowy"));
/**
* {@code #minecraft:has_structure/village_taiga}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_VILLAGE_TAIGA = create(key("has_structure/village_taiga"));
/**
* {@code #minecraft:has_structure/woodland_mansion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_STRUCTURE_WOODLAND_MANSION = create(key("has_structure/woodland_mansion"));
/**
* {@code #minecraft:increased_fire_burnout}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> INCREASED_FIRE_BURNOUT = create(key("increased_fire_burnout"));
/**
* {@code #minecraft:is_badlands}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_BADLANDS = create(key("is_badlands"));
/**
* {@code #minecraft:is_beach}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_BEACH = create(key("is_beach"));
/**
* {@code #minecraft:is_deep_ocean}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_DEEP_OCEAN = create(key("is_deep_ocean"));
/**
* {@code #minecraft:is_end}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_END = create(key("is_end"));
/**
* {@code #minecraft:is_forest}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_FOREST = create(key("is_forest"));
/**
* {@code #minecraft:is_hill}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_HILL = create(key("is_hill"));
/**
* {@code #minecraft:is_jungle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_JUNGLE = create(key("is_jungle"));
/**
* {@code #minecraft:is_mountain}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_MOUNTAIN = create(key("is_mountain"));
/**
* {@code #minecraft:is_nether}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_NETHER = create(key("is_nether"));
/**
* {@code #minecraft:is_ocean}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_OCEAN = create(key("is_ocean"));
/**
* {@code #minecraft:is_overworld}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_OVERWORLD = create(key("is_overworld"));
/**
* {@code #minecraft:is_river}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_RIVER = create(key("is_river"));
/**
* {@code #minecraft:is_savanna}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_SAVANNA = create(key("is_savanna"));
/**
* {@code #minecraft:is_taiga}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> IS_TAIGA = create(key("is_taiga"));
/**
* {@code #minecraft:mineshaft_blocking}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> MINESHAFT_BLOCKING = create(key("mineshaft_blocking"));
/**
* {@code #minecraft:more_frequent_drowned_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> MORE_FREQUENT_DROWNED_SPAWNS = create(key("more_frequent_drowned_spawns"));
/**
* {@code #minecraft:plays_underwater_music}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> PLAYS_UNDERWATER_MUSIC = create(key("plays_underwater_music"));
/**
* {@code #minecraft:polar_bears_spawn_on_alternate_blocks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> POLAR_BEARS_SPAWN_ON_ALTERNATE_BLOCKS = create(key("polar_bears_spawn_on_alternate_blocks"));
/**
* {@code #minecraft:produces_corals_from_bonemeal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> PRODUCES_CORALS_FROM_BONEMEAL = create(key("produces_corals_from_bonemeal"));
/**
* {@code #minecraft:reduce_water_ambient_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> REDUCE_WATER_AMBIENT_SPAWNS = create(key("reduce_water_ambient_spawns"));
/**
* {@code #minecraft:required_ocean_monument_surrounding}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> REQUIRED_OCEAN_MONUMENT_SURROUNDING = create(key("required_ocean_monument_surrounding"));
/**
* {@code #minecraft:snow_golem_melts}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SNOW_GOLEM_MELTS = create(key("snow_golem_melts"));
/**
* {@code #minecraft:spawns_cold_variant_frogs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SPAWNS_COLD_VARIANT_FROGS = create(key("spawns_cold_variant_frogs"));
/**
* {@code #minecraft:spawns_gold_rabbits}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SPAWNS_GOLD_RABBITS = create(key("spawns_gold_rabbits"));
/**
* {@code #minecraft:spawns_snow_foxes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SPAWNS_SNOW_FOXES = create(key("spawns_snow_foxes"));
/**
* {@code #minecraft:spawns_warm_variant_frogs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SPAWNS_WARM_VARIANT_FROGS = create(key("spawns_warm_variant_frogs"));
/**
* {@code #minecraft:spawns_white_rabbits}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SPAWNS_WHITE_RABBITS = create(key("spawns_white_rabbits"));
/**
* {@code #minecraft:stronghold_biased_to}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> STRONGHOLD_BIASED_TO = create(key("stronghold_biased_to"));
/**
* {@code #minecraft:water_on_map_outlines}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> WATER_ON_MAP_OUTLINES = create(key("water_on_map_outlines"));
/**
* {@code #minecraft:without_patrol_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> WITHOUT_PATROL_SPAWNS = create(key("without_patrol_spawns"));
/**
* {@code #minecraft:without_wandering_trader_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> WITHOUT_WANDERING_TRADER_SPAWNS = create(key("without_wandering_trader_spawns"));
/**
* {@code #minecraft:without_zombie_sieges}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> WITHOUT_ZOMBIE_SIEGES = create(key("without_zombie_sieges"));
private BiomeTagKeys() {
}
/**
* Creates a tag key for {@link Biome} in the registry {@code minecraft:worldgen/biome}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Biome> create(final Key key) {
return TagKey.create(RegistryKey.BIOME, key);
}
}
@@ -1,57 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.Cat;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#CAT_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class CatVariantTagKeys {
/**
* {@code #minecraft:default_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Cat.Type> DEFAULT_SPAWNS = create(key("default_spawns"));
/**
* {@code #minecraft:full_moon_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Cat.Type> FULL_MOON_SPAWNS = create(key("full_moon_spawns"));
private CatVariantTagKeys() {
}
/**
* Creates a tag key for {@link Cat.Type} in the registry {@code minecraft:cat_variant}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Cat.Type> create(final Key key) {
return TagKey.create(RegistryKey.CAT_VARIANT, key);
}
}
@@ -1,274 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#DAMAGE_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class DamageTypeTagKeys {
/**
* {@code #minecraft:always_hurts_ender_dragons}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> ALWAYS_HURTS_ENDER_DRAGONS = create(key("always_hurts_ender_dragons"));
/**
* {@code #minecraft:always_kills_armor_stands}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> ALWAYS_KILLS_ARMOR_STANDS = create(key("always_kills_armor_stands"));
/**
* {@code #minecraft:always_most_significant_fall}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> ALWAYS_MOST_SIGNIFICANT_FALL = create(key("always_most_significant_fall"));
/**
* {@code #minecraft:always_triggers_silverfish}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> ALWAYS_TRIGGERS_SILVERFISH = create(key("always_triggers_silverfish"));
/**
* {@code #minecraft:avoids_guardian_thorns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> AVOIDS_GUARDIAN_THORNS = create(key("avoids_guardian_thorns"));
/**
* {@code #minecraft:burn_from_stepping}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BURN_FROM_STEPPING = create(key("burn_from_stepping"));
/**
* {@code #minecraft:burns_armor_stands}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BURNS_ARMOR_STANDS = create(key("burns_armor_stands"));
/**
* {@code #minecraft:bypasses_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BYPASSES_ARMOR = create(key("bypasses_armor"));
/**
* {@code #minecraft:bypasses_effects}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BYPASSES_EFFECTS = create(key("bypasses_effects"));
/**
* {@code #minecraft:bypasses_enchantments}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BYPASSES_ENCHANTMENTS = create(key("bypasses_enchantments"));
/**
* {@code #minecraft:bypasses_invulnerability}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BYPASSES_INVULNERABILITY = create(key("bypasses_invulnerability"));
/**
* {@code #minecraft:bypasses_resistance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BYPASSES_RESISTANCE = create(key("bypasses_resistance"));
/**
* {@code #minecraft:bypasses_shield}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BYPASSES_SHIELD = create(key("bypasses_shield"));
/**
* {@code #minecraft:bypasses_wolf_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> BYPASSES_WOLF_ARMOR = create(key("bypasses_wolf_armor"));
/**
* {@code #minecraft:can_break_armor_stand}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> CAN_BREAK_ARMOR_STAND = create(key("can_break_armor_stand"));
/**
* {@code #minecraft:damages_helmet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> DAMAGES_HELMET = create(key("damages_helmet"));
/**
* {@code #minecraft:ignites_armor_stands}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IGNITES_ARMOR_STANDS = create(key("ignites_armor_stands"));
/**
* {@code #minecraft:is_drowning}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_DROWNING = create(key("is_drowning"));
/**
* {@code #minecraft:is_explosion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_EXPLOSION = create(key("is_explosion"));
/**
* {@code #minecraft:is_fall}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_FALL = create(key("is_fall"));
/**
* {@code #minecraft:is_fire}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_FIRE = create(key("is_fire"));
/**
* {@code #minecraft:is_freezing}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_FREEZING = create(key("is_freezing"));
/**
* {@code #minecraft:is_lightning}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_LIGHTNING = create(key("is_lightning"));
/**
* {@code #minecraft:is_player_attack}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_PLAYER_ATTACK = create(key("is_player_attack"));
/**
* {@code #minecraft:is_projectile}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> IS_PROJECTILE = create(key("is_projectile"));
/**
* {@code #minecraft:mace_smash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> MACE_SMASH = create(key("mace_smash"));
/**
* {@code #minecraft:no_anger}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> NO_ANGER = create(key("no_anger"));
/**
* {@code #minecraft:no_impact}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> NO_IMPACT = create(key("no_impact"));
/**
* {@code #minecraft:no_knockback}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> NO_KNOCKBACK = create(key("no_knockback"));
/**
* {@code #minecraft:panic_causes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> PANIC_CAUSES = create(key("panic_causes"));
/**
* {@code #minecraft:panic_environmental_causes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> PANIC_ENVIRONMENTAL_CAUSES = create(key("panic_environmental_causes"));
/**
* {@code #minecraft:witch_resistant_to}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> WITCH_RESISTANT_TO = create(key("witch_resistant_to"));
/**
* {@code #minecraft:wither_immune_to}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<DamageType> WITHER_IMMUNE_TO = create(key("wither_immune_to"));
private DamageTypeTagKeys() {
}
/**
* Creates a tag key for {@link DamageType} in the registry {@code minecraft:damage_type}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<DamageType> create(final Key key) {
return TagKey.create(RegistryKey.DAMAGE_TYPE, key);
}
}
@@ -8,8 +8,8 @@ import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.MinecraftExperimental;
import org.bukkit.enchantments.Enchantment;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#ENCHANTMENT}.
@@ -24,8 +24,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class EnchantmentTagKeys {
/**
@@ -318,7 +317,7 @@ public final class EnchantmentTagKeys {
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Enchantment> create(final Key key) {
public static @NonNull TagKey<Enchantment> create(final @NonNull Key key) {
return TagKey.create(RegistryKey.ENCHANTMENT, key);
}
}
@@ -1,57 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Fluid;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#FLUID}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class FluidTagKeys {
/**
* {@code #minecraft:lava}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Fluid> LAVA = create(key("lava"));
/**
* {@code #minecraft:water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Fluid> WATER = create(key("water"));
private FluidTagKeys() {
}
/**
* Creates a tag key for {@link Fluid} in the registry {@code minecraft:fluid}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Fluid> create(final Key key) {
return TagKey.create(RegistryKey.FLUID, key);
}
}
@@ -1,78 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.GameEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#GAME_EVENT}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class GameEventTagKeys {
/**
* {@code #minecraft:allay_can_listen}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<GameEvent> ALLAY_CAN_LISTEN = create(key("allay_can_listen"));
/**
* {@code #minecraft:ignore_vibrations_sneaking}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<GameEvent> IGNORE_VIBRATIONS_SNEAKING = create(key("ignore_vibrations_sneaking"));
/**
* {@code #minecraft:shrieker_can_listen}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<GameEvent> SHRIEKER_CAN_LISTEN = create(key("shrieker_can_listen"));
/**
* {@code #minecraft:vibrations}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<GameEvent> VIBRATIONS = create(key("vibrations"));
/**
* {@code #minecraft:warden_can_listen}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<GameEvent> WARDEN_CAN_LISTEN = create(key("warden_can_listen"));
private GameEventTagKeys() {
}
/**
* Creates a tag key for {@link GameEvent} in the registry {@code minecraft:game_event}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<GameEvent> create(final Key key) {
return TagKey.create(RegistryKey.GAME_EVENT, key);
}
}
@@ -1,64 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.MusicInstrument;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#INSTRUMENT}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class InstrumentTagKeys {
/**
* {@code #minecraft:goat_horns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<MusicInstrument> GOAT_HORNS = create(key("goat_horns"));
/**
* {@code #minecraft:regular_goat_horns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<MusicInstrument> REGULAR_GOAT_HORNS = create(key("regular_goat_horns"));
/**
* {@code #minecraft:screaming_goat_horns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<MusicInstrument> SCREAMING_GOAT_HORNS = create(key("screaming_goat_horns"));
private InstrumentTagKeys() {
}
/**
* Creates a tag key for {@link MusicInstrument} in the registry {@code minecraft:instrument}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<MusicInstrument> create(final Key key) {
return TagKey.create(RegistryKey.INSTRUMENT, key);
}
}
@@ -7,8 +7,8 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.ItemType;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#ITEM}.
@@ -23,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.21.4")
@NullMarked
@GeneratedFrom("1.21.1")
@ApiStatus.Experimental
public final class ItemTypeTagKeys {
/**
@@ -132,20 +131,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> BREAKS_DECORATED_POTS = create(key("breaks_decorated_pots"));
/**
* {@code #minecraft:brewing_fuel}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> BREWING_FUEL = create(key("brewing_fuel"));
/**
* {@code #minecraft:bundles}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> BUNDLES = create(key("bundles"));
/**
* {@code #minecraft:buttons}
*
@@ -307,13 +292,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> DIAMOND_ORES = create(key("diamond_ores"));
/**
* {@code #minecraft:diamond_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> DIAMOND_TOOL_MATERIALS = create(key("diamond_tool_materials"));
/**
* {@code #minecraft:dirt}
*
@@ -328,20 +306,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> DOORS = create(key("doors"));
/**
* {@code #minecraft:drowned_preferred_weapons}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> DROWNED_PREFERRED_WEAPONS = create(key("drowned_preferred_weapons"));
/**
* {@code #minecraft:duplicates_allays}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> DUPLICATES_ALLAYS = create(key("duplicates_allays"));
/**
* {@code #minecraft:dyeable}
*
@@ -510,6 +474,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> FISHES = create(key("fishes"));
/**
* {@code #minecraft:flowers}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> FLOWERS = create(key("flowers"));
/**
* {@code #minecraft:foot_armor}
*
@@ -538,20 +509,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> FROG_FOOD = create(key("frog_food"));
/**
* {@code #minecraft:furnace_minecart_fuel}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> FURNACE_MINECART_FUEL = create(key("furnace_minecart_fuel"));
/**
* {@code #minecraft:gaze_disguise_equipment}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> GAZE_DISGUISE_EQUIPMENT = create(key("gaze_disguise_equipment"));
/**
* {@code #minecraft:goat_food}
*
@@ -566,13 +523,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> GOLD_ORES = create(key("gold_ores"));
/**
* {@code #minecraft:gold_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> GOLD_TOOL_MATERIALS = create(key("gold_tool_materials"));
/**
* {@code #minecraft:hanging_signs}
*
@@ -629,13 +579,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> IRON_ORES = create(key("iron_ores"));
/**
* {@code #minecraft:iron_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> IRON_TOOL_MATERIALS = create(key("iron_tool_materials"));
/**
* {@code #minecraft:jungle_logs}
*
@@ -706,13 +649,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> MANGROVE_LOGS = create(key("mangrove_logs"));
/**
* {@code #minecraft:map_invisibility_equipment}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> MAP_INVISIBILITY_EQUIPMENT = create(key("map_invisibility_equipment"));
/**
* {@code #minecraft:meat}
*
@@ -720,13 +656,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> MEAT = create(key("meat"));
/**
* {@code #minecraft:netherite_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> NETHERITE_TOOL_MATERIALS = create(key("netherite_tool_materials"));
/**
* {@code #minecraft:non_flammable_wood}
*
@@ -755,20 +684,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> OCELOT_FOOD = create(key("ocelot_food"));
/**
* {@code #minecraft:pale_oak_logs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> PALE_OAK_LOGS = create(key("pale_oak_logs"));
/**
* {@code #minecraft:panda_eats_from_ground}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> PANDA_EATS_FROM_GROUND = create(key("panda_eats_from_ground"));
/**
* {@code #minecraft:panda_food}
*
@@ -818,13 +733,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> PIGLIN_LOVED = create(key("piglin_loved"));
/**
* {@code #minecraft:piglin_preferred_weapons}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> PIGLIN_PREFERRED_WEAPONS = create(key("piglin_preferred_weapons"));
/**
* {@code #minecraft:piglin_repellents}
*
@@ -832,20 +740,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> PIGLIN_REPELLENTS = create(key("piglin_repellents"));
/**
* {@code #minecraft:piglin_safe_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> PIGLIN_SAFE_ARMOR = create(key("piglin_safe_armor"));
/**
* {@code #minecraft:pillager_preferred_weapons}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> PILLAGER_PREFERRED_WEAPONS = create(key("pillager_preferred_weapons"));
/**
* {@code #minecraft:planks}
*
@@ -874,62 +768,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> REDSTONE_ORES = create(key("redstone_ores"));
/**
* {@code #minecraft:repairs_chain_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_CHAIN_ARMOR = create(key("repairs_chain_armor"));
/**
* {@code #minecraft:repairs_diamond_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_DIAMOND_ARMOR = create(key("repairs_diamond_armor"));
/**
* {@code #minecraft:repairs_gold_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_GOLD_ARMOR = create(key("repairs_gold_armor"));
/**
* {@code #minecraft:repairs_iron_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_IRON_ARMOR = create(key("repairs_iron_armor"));
/**
* {@code #minecraft:repairs_leather_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_LEATHER_ARMOR = create(key("repairs_leather_armor"));
/**
* {@code #minecraft:repairs_netherite_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_NETHERITE_ARMOR = create(key("repairs_netherite_armor"));
/**
* {@code #minecraft:repairs_turtle_helmet}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_TURTLE_HELMET = create(key("repairs_turtle_helmet"));
/**
* {@code #minecraft:repairs_wolf_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> REPAIRS_WOLF_ARMOR = create(key("repairs_wolf_armor"));
/**
* {@code #minecraft:sand}
*
@@ -958,13 +796,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> SHOVELS = create(key("shovels"));
/**
* {@code #minecraft:shulker_boxes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> SHULKER_BOXES = create(key("shulker_boxes"));
/**
* {@code #minecraft:signs}
*
@@ -972,13 +803,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> SIGNS = create(key("signs"));
/**
* {@code #minecraft:skeleton_preferred_weapons}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> SKELETON_PREFERRED_WEAPONS = create(key("skeleton_preferred_weapons"));
/**
* {@code #minecraft:skulls}
*
@@ -1084,6 +908,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> SWORDS = create(key("swords"));
/**
* {@code #minecraft:tall_flowers}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> TALL_FLOWERS = create(key("tall_flowers"));
/**
* {@code #minecraft:terracotta}
*
@@ -1105,6 +936,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> TRIM_MATERIALS = create(key("trim_materials"));
/**
* {@code #minecraft:trim_templates}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> TRIM_TEMPLATES = create(key("trim_templates"));
/**
* {@code #minecraft:trimmable_armor}
*
@@ -1119,13 +957,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> TURTLE_FOOD = create(key("turtle_food"));
/**
* {@code #minecraft:villager_picks_up}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> VILLAGER_PICKS_UP = create(key("villager_picks_up"));
/**
* {@code #minecraft:villager_plantable_seeds}
*
@@ -1154,13 +985,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> WART_BLOCKS = create(key("wart_blocks"));
/**
* {@code #minecraft:wither_skeleton_disliked_weapons}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> WITHER_SKELETON_DISLIKED_WEAPONS = create(key("wither_skeleton_disliked_weapons"));
/**
* {@code #minecraft:wolf_food}
*
@@ -1210,13 +1034,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> WOODEN_STAIRS = create(key("wooden_stairs"));
/**
* {@code #minecraft:wooden_tool_materials}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> WOODEN_TOOL_MATERIALS = create(key("wooden_tool_materials"));
/**
* {@code #minecraft:wooden_trapdoors}
*
@@ -1248,7 +1065,7 @@ public final class ItemTypeTagKeys {
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<ItemType> create(final Key key) {
public static @NonNull TagKey<ItemType> create(final @NonNull Key key) {
return TagKey.create(RegistryKey.ITEM, key);
}
}
@@ -1,50 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Art;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#PAINTING_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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class PaintingVariantTagKeys {
/**
* {@code #minecraft:placeable}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Art> PLACEABLE = create(key("placeable"));
private PaintingVariantTagKeys() {
}
/**
* Creates a tag key for {@link Art} in the registry {@code minecraft:painting_variant}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Art> create(final Key key) {
return TagKey.create(RegistryKey.PAINTING_VARIANT, key);
}
}
@@ -1,198 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.MinecraftExperimental;
import org.bukkit.generator.structure.Structure;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#STRUCTURE}.
*
* @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"
})
@GeneratedFrom("1.21.4")
@NullMarked
@ApiStatus.Experimental
public final class StructureTagKeys {
/**
* {@code #minecraft:cats_spawn_as_black}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> CATS_SPAWN_AS_BLACK = create(key("cats_spawn_as_black"));
/**
* {@code #minecraft:cats_spawn_in}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> CATS_SPAWN_IN = create(key("cats_spawn_in"));
/**
* {@code #minecraft:dolphin_located}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> DOLPHIN_LOCATED = create(key("dolphin_located"));
/**
* {@code #minecraft:eye_of_ender_located}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> EYE_OF_ENDER_LOCATED = create(key("eye_of_ender_located"));
/**
* {@code #minecraft:mineshaft}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> MINESHAFT = create(key("mineshaft"));
/**
* {@code #minecraft:ocean_ruin}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> OCEAN_RUIN = create(key("ocean_ruin"));
/**
* {@code #minecraft:on_desert_village_maps}
*
* @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<Structure> ON_DESERT_VILLAGE_MAPS = create(key("on_desert_village_maps"));
/**
* {@code #minecraft:on_jungle_explorer_maps}
*
* @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<Structure> ON_JUNGLE_EXPLORER_MAPS = create(key("on_jungle_explorer_maps"));
/**
* {@code #minecraft:on_ocean_explorer_maps}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> ON_OCEAN_EXPLORER_MAPS = create(key("on_ocean_explorer_maps"));
/**
* {@code #minecraft:on_plains_village_maps}
*
* @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<Structure> ON_PLAINS_VILLAGE_MAPS = create(key("on_plains_village_maps"));
/**
* {@code #minecraft:on_savanna_village_maps}
*
* @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<Structure> ON_SAVANNA_VILLAGE_MAPS = create(key("on_savanna_village_maps"));
/**
* {@code #minecraft:on_snowy_village_maps}
*
* @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<Structure> ON_SNOWY_VILLAGE_MAPS = create(key("on_snowy_village_maps"));
/**
* {@code #minecraft:on_swamp_explorer_maps}
*
* @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<Structure> ON_SWAMP_EXPLORER_MAPS = create(key("on_swamp_explorer_maps"));
/**
* {@code #minecraft:on_taiga_village_maps}
*
* @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<Structure> ON_TAIGA_VILLAGE_MAPS = create(key("on_taiga_village_maps"));
/**
* {@code #minecraft:on_treasure_maps}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> ON_TREASURE_MAPS = create(key("on_treasure_maps"));
/**
* {@code #minecraft:on_trial_chambers_maps}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> ON_TRIAL_CHAMBERS_MAPS = create(key("on_trial_chambers_maps"));
/**
* {@code #minecraft:on_woodland_explorer_maps}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> ON_WOODLAND_EXPLORER_MAPS = create(key("on_woodland_explorer_maps"));
/**
* {@code #minecraft:ruined_portal}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> RUINED_PORTAL = create(key("ruined_portal"));
/**
* {@code #minecraft:shipwreck}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> SHIPWRECK = create(key("shipwreck"));
/**
* {@code #minecraft:village}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Structure> VILLAGE = create(key("village"));
private StructureTagKeys() {
}
/**
* Creates a tag key for {@link Structure} in the registry {@code minecraft:worldgen/structure}.
*
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Structure> create(final Key key) {
return TagKey.create(RegistryKey.STRUCTURE, key);
}
}
@@ -8,77 +8,37 @@ import io.papermc.paper.registry.RegistryKey;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import org.bukkit.Art;
import org.bukkit.Fluid;
import org.bukkit.GameEvent;
import org.bukkit.JukeboxSong;
import org.bukkit.MusicInstrument;
import org.bukkit.Sound;
import org.bukkit.attribute.Attribute;
import org.bukkit.block.Biome;
import org.bukkit.block.BlockType;
import org.bukkit.block.banner.PatternType;
import org.bukkit.damage.DamageType;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Cat;
import org.bukkit.entity.Frog;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Wolf;
import org.bukkit.generator.structure.Structure;
import org.bukkit.generator.structure.StructureType;
import org.bukkit.inventory.ItemType;
import org.bukkit.inventory.MenuType;
import org.bukkit.inventory.meta.trim.TrimMaterial;
import org.bukkit.inventory.meta.trim.TrimPattern;
import org.bukkit.map.MapCursor;
import org.bukkit.potion.PotionEffectType;
public interface Generators {
SourceGenerator[] API = {
// built-ins
simpleKey("GameEventKeys", GameEvent.class, Registries.GAME_EVENT, RegistryKey.GAME_EVENT, true),
simpleKey("StructureTypeKeys", StructureType.class, Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, false),
simpleKey("MobEffectKeys", PotionEffectType.class, Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, false),
simpleKey("BlockTypeKeys", BlockType.class, Registries.BLOCK, RegistryKey.BLOCK, false),
simpleKey("ItemTypeKeys", ItemType.class, Registries.ITEM, RegistryKey.ITEM, false),
simpleKey("CatVariantKeys", Cat.Type.class, Registries.CAT_VARIANT, RegistryKey.CAT_VARIANT, false),
simpleKey("FrogVariantKeys", Frog.Variant.class, Registries.FROG_VARIANT, RegistryKey.FROG_VARIANT, false),
simpleKey("VillagerProfessionKeys", Villager.Profession.class, Registries.VILLAGER_PROFESSION, RegistryKey.VILLAGER_PROFESSION, false),
simpleKey("VillagerTypeKeys", Villager.Type.class, Registries.VILLAGER_TYPE, RegistryKey.VILLAGER_TYPE, false),
simpleKey("MapDecorationTypeKeys", MapCursor.Type.class, Registries.MAP_DECORATION_TYPE, RegistryKey.MAP_DECORATION_TYPE, false),
simpleKey("MenuTypeKeys", MenuType.class, Registries.MENU, RegistryKey.MENU, false),
simpleKey("AttributeKeys", Attribute.class, Registries.ATTRIBUTE, RegistryKey.ATTRIBUTE, false),
simpleKey("FluidKeys", Fluid.class, Registries.FLUID, RegistryKey.FLUID, false),
simpleKey("SoundEventKeys", Sound.class, Registries.SOUND_EVENT, RegistryKey.SOUND_EVENT, false),
// data-driven
simpleKey("GameEventKeys", GameEvent.class, Registries.GAME_EVENT, RegistryKey.GAME_EVENT, false),
simpleKey("BiomeKeys", Biome.class, Registries.BIOME, RegistryKey.BIOME, true),
simpleKey("StructureKeys", Structure.class, Registries.STRUCTURE, RegistryKey.STRUCTURE, true),
simpleKey("TrimMaterialKeys", TrimMaterial.class, Registries.TRIM_MATERIAL, RegistryKey.TRIM_MATERIAL, true),
simpleKey("TrimPatternKeys", TrimPattern.class, Registries.TRIM_PATTERN, RegistryKey.TRIM_PATTERN, true),
simpleKey("StructureKeys", Structure.class, Registries.STRUCTURE, RegistryKey.STRUCTURE, true),
simpleKey("StructureTypeKeys", StructureType.class, Registries.STRUCTURE_TYPE, RegistryKey.STRUCTURE_TYPE, false),
simpleKey("InstrumentKeys", MusicInstrument.class, Registries.INSTRUMENT, RegistryKey.INSTRUMENT, false),
simpleKey("EnchantmentKeys", Enchantment.class, Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, false),
simpleKey("MobEffectKeys", PotionEffectType.class, Registries.MOB_EFFECT, RegistryKey.MOB_EFFECT, false),
simpleKey("DamageTypeKeys", DamageType.class, Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE, true),
simpleKey("WolfVariantKeys", Wolf.Variant.class, Registries.WOLF_VARIANT, RegistryKey.WOLF_VARIANT, true),
simpleKey("EnchantmentKeys", Enchantment.class, Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT, true),
simpleKey("JukeboxSongKeys", JukeboxSong.class, Registries.JUKEBOX_SONG, RegistryKey.JUKEBOX_SONG, true),
simpleKey("BannerPatternKeys", PatternType.class, Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN, true),
simpleKey("PaintingVariantKeys", Art.class, Registries.PAINTING_VARIANT, RegistryKey.PAINTING_VARIANT, true),
simpleKey("InstrumentKeys", MusicInstrument.class, Registries.INSTRUMENT, RegistryKey.INSTRUMENT, true),
simpleKey("ItemTypeKeys", ItemType.class, Registries.ITEM, RegistryKey.ITEM, false),
// tags
simpleTagKey("GameEventTagKeys", GameEvent.class, Registries.GAME_EVENT, RegistryKey.GAME_EVENT),
simpleTagKey("BlockTypeTagKeys", BlockType.class, Registries.BLOCK, RegistryKey.BLOCK),
simpleTagKey("ItemTypeTagKeys", ItemType.class, Registries.ITEM, RegistryKey.ITEM),
simpleTagKey("CatVariantTagKeys", Cat.Type.class, Registries.CAT_VARIANT, RegistryKey.CAT_VARIANT),
simpleTagKey("FluidTagKeys", Fluid.class, Registries.FLUID, RegistryKey.FLUID),
simpleTagKey("BiomeTagKeys", Biome.class, Registries.BIOME, RegistryKey.BIOME),
simpleTagKey("StructureTagKeys", Structure.class, Registries.STRUCTURE, RegistryKey.STRUCTURE),
simpleTagKey("DamageTypeTagKeys", DamageType.class, Registries.DAMAGE_TYPE, RegistryKey.DAMAGE_TYPE),
simpleTagKey("EnchantmentTagKeys", Enchantment.class, Registries.ENCHANTMENT, RegistryKey.ENCHANTMENT),
simpleTagKey("BannerPatternTagKeys", PatternType.class, Registries.BANNER_PATTERN, RegistryKey.BANNER_PATTERN),
simpleTagKey("PaintingVariantTagKeys", Art.class, Registries.PAINTING_VARIANT, RegistryKey.PAINTING_VARIANT),
simpleTagKey("InstrumentTagKeys", MusicInstrument.class, Registries.INSTRUMENT, RegistryKey.INSTRUMENT),
simpleTagKey("ItemTypeTagKeys", ItemType.class, Registries.ITEM, RegistryKey.ITEM),
new MobGoalGenerator("VanillaGoal", "com.destroystokyo.paper.entity.ai")
};
@@ -7,25 +7,22 @@ import io.papermc.generator.utils.TagCollector;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import net.minecraft.SharedConstants;
import net.minecraft.commands.Commands;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.RegistryDataLoader;
import net.minecraft.server.Bootstrap;
import net.minecraft.server.RegistryLayer;
import net.minecraft.server.ReloadableServerResources;
import net.minecraft.server.WorldLoader;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.ServerPacksSource;
import net.minecraft.server.packs.resources.MultiPackResourceManager;
import net.minecraft.tags.TagKey;
import net.minecraft.tags.TagLoader;
import net.minecraft.world.flag.FeatureFlags;
import org.apache.commons.io.file.PathUtils;
import org.slf4j.Logger;
@@ -45,22 +42,11 @@ public final class Main {
resourceRepository.reload();
final MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList());
LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
final List<Registry.PendingTags<?>> pendingTags = TagLoader.loadTagsForExistingRegistries(resourceManager, layers.getLayer(RegistryLayer.STATIC));
final List<HolderLookup.RegistryLookup<?>> worldGenLayer = TagLoader.buildUpdatedLookups(layers.getAccessForLoading(RegistryLayer.WORLDGEN), pendingTags);
final RegistryAccess.Frozen frozenWorldgenRegistries = RegistryDataLoader.load(resourceManager, worldGenLayer, RegistryDataLoader.WORLDGEN_REGISTRIES);
layers = layers.replaceFrom(RegistryLayer.WORLDGEN, frozenWorldgenRegistries);
layers = WorldLoader.loadAndReplaceLayer(resourceManager, layers, RegistryLayer.WORLDGEN, RegistryDataLoader.WORLDGEN_REGISTRIES);
REGISTRY_ACCESS = layers.compositeAccess().freeze();
final ReloadableServerResources reloadableServerResources = ReloadableServerResources.loadResources(
resourceManager,
layers,
pendingTags,
FeatureFlags.VANILLA_SET,
Commands.CommandSelection.DEDICATED,
0,
MoreExecutors.directExecutor(),
MoreExecutors.directExecutor()
).join();
reloadableServerResources.updateStaticRegistryTags();
final ReloadableServerResources datapack = ReloadableServerResources.loadResources(resourceManager, layers, FeatureFlags.REGISTRY.allFlags(), Commands.CommandSelection.DEDICATED, 0, MoreExecutors.directExecutor(), MoreExecutors.directExecutor()).join();
datapack.updateRegistryTags();
EXPERIMENTAL_TAGS = TagCollector.grabExperimental(resourceManager);
}
@@ -23,24 +23,21 @@ import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.lang.model.SourceVersion;
import net.kyori.adventure.key.Key;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.registries.VanillaRegistries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.flag.FeatureElement;
import net.minecraft.world.flag.FeatureFlags;
import org.bukkit.MinecraftExperimental;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier;
import static com.squareup.javapoet.TypeSpec.classBuilder;
import static io.papermc.generator.utils.Annotations.EXPERIMENTAL_API_ANNOTATION;
import static io.papermc.generator.utils.Annotations.NOT_NULL;
import static io.papermc.generator.utils.Annotations.experimentalAnnotations;
import static java.util.Objects.requireNonNull;
import static javax.lang.model.element.Modifier.FINAL;
@@ -54,7 +51,8 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> VANILLA_REGISTRY_ENTRIES = VanillaRegistries.BUILDER.entries.stream()
.collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap));
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> EXPERIMENTAL_REGISTRY_ENTRIES = Map.of(); // Update for Experimental API
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> EXPERIMENTAL_REGISTRY_ENTRIES = Collections.emptyMap(); // Update for Experimental API
private static final Map<RegistryKey<?>, String> REGISTRY_KEY_FIELD_NAMES;
static {
final Map<RegistryKey<?>, String> map = new HashMap<>();
@@ -92,14 +90,14 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
}
private MethodSpec.Builder createMethod(final TypeName returnType) {
final TypeName keyType = TypeName.get(Key.class);
final TypeName keyType = TypeName.get(Key.class).annotated(NOT_NULL);
final ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build();
final MethodSpec.Builder create = MethodSpec.methodBuilder("create")
.addModifiers(this.publicCreateKeyMethod ? PUBLIC : PRIVATE, STATIC)
.addParameter(keyParam)
.addCode("return $T.create($T.$L, $N);", TypedKey.class, RegistryKey.class, requireNonNull(REGISTRY_KEY_FIELD_NAMES.get(this.apiRegistryKey), "Missing field for " + this.apiRegistryKey), keyParam)
.returns(returnType);
.returns(returnType.annotated(NOT_NULL));
if (this.publicCreateKeyMethod) {
create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental
create.addJavadoc(CREATE_JAVADOC, this.apiType, this.registryKey.location().toString());
@@ -118,13 +116,6 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
);
}
@Deprecated
private static final Map<String, String> JUKEBOX_SONG_NAMES = Map.of(
"5", "FIVE",
"11", "ELEVEN",
"13", "THIRTEEN"
);
@Override
protected TypeSpec getTypeSpec() {
final TypeName typedKey = ParameterizedTypeName.get(TypedKey.class, this.apiType);
@@ -132,18 +123,14 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
final TypeSpec.Builder typeBuilder = this.keyHolderType();
final MethodSpec.Builder createMethod = this.createMethod(typedKey);
final Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
final Registry<T> registry = Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey);
final Set<ResourceKey<T>> experimental = this.collectExperimentalKeys(registry);
boolean allExperimental = true;
for (final Holder.Reference<T> reference : registry.listElements().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) {
for (final Holder.Reference<T> reference : registry.holders().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) {
final ResourceKey<T> key = reference.key();
final String keyPath = key.location().getPath();
String fieldName = Formatting.formatKeyAsField(keyPath);
if (!SourceVersion.isIdentifier(fieldName) && this.registryKey.equals(Registries.JUKEBOX_SONG) && JUKEBOX_SONG_NAMES.containsKey(fieldName)) {
fieldName = JUKEBOX_SONG_NAMES.get(fieldName);
}
final String fieldName = Formatting.formatKeyAsField(keyPath);
final FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL)
.initializer("$N(key($S))", createMethod.build(), keyPath)
.addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), key.location().toString());
@@ -163,7 +150,6 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
return typeBuilder.addMethod(createMethod.build()).build();
}
// todo at some point this should be per feature data pack not all merged
private Set<ResourceKey<T>> collectExperimentalKeys(final Registry<T> registry) {
if (FeatureElement.FILTERED_REGISTRIES.contains(registry.key())) {
return this.collectExperimentalKeysBuiltIn(registry);
@@ -173,8 +159,8 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
}
private Set<ResourceKey<T>> collectExperimentalKeysBuiltIn(final Registry<T> registry) {
final HolderLookup.RegistryLookup<T> filteredLookup = registry.filterElements(v -> {
return v instanceof final FeatureElement featureElement && FeatureFlags.isExperimental(featureElement.requiredFeatures()); // Update for Experimental API
final HolderLookup.RegistryLookup<T> filteredLookup = registry.asLookup().filterElements(v -> {
return false; // Update for Experimental API
});
return filteredLookup.listElementIds().collect(Collectors.toUnmodifiableSet());
}
@@ -16,7 +16,6 @@ import io.papermc.paper.registry.tag.TagKey;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import net.kyori.adventure.key.Key;
@@ -26,6 +25,7 @@ import org.bukkit.MinecraftExperimental;
import static com.squareup.javapoet.TypeSpec.classBuilder;
import static io.papermc.generator.utils.Annotations.EXPERIMENTAL_API_ANNOTATION;
import static io.papermc.generator.utils.Annotations.NOT_NULL;
import static io.papermc.generator.utils.Annotations.experimentalAnnotations;
import static java.util.Objects.requireNonNull;
import static javax.lang.model.element.Modifier.FINAL;
@@ -72,14 +72,14 @@ public class GeneratedTagKeyType<T, A> extends SimpleGenerator {
}
private MethodSpec.Builder createMethod(final TypeName returnType) {
final TypeName keyType = TypeName.get(Key.class);
final TypeName keyType = TypeName.get(Key.class).annotated(NOT_NULL);
final ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build();
final MethodSpec.Builder create = MethodSpec.methodBuilder("create")
.addModifiers(this.publicCreateKeyMethod ? PUBLIC : PRIVATE, STATIC)
.addParameter(keyParam)
.addCode("return $T.create($T.$L, $N);", TagKey.class, RegistryKey.class, requireNonNull(REGISTRY_KEY_FIELD_NAMES.get(this.apiRegistryKey), "Missing field for " + this.apiRegistryKey), keyParam)
.returns(returnType);
.returns(returnType.annotated(NOT_NULL));
if (this.publicCreateKeyMethod) {
create.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO remove once not experimental
create.addJavadoc(CREATE_JAVADOC, this.apiType, this.registryKey.location().toString());
@@ -105,17 +105,16 @@ public class GeneratedTagKeyType<T, A> extends SimpleGenerator {
final TypeSpec.Builder typeBuilder = this.keyHolderType();
final MethodSpec.Builder createMethod = this.createMethod(tagKey);
final Registry<T> registry = Main.REGISTRY_ACCESS.lookupOrThrow(this.registryKey);
final Registry<T> registry = Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey);
final AtomicBoolean allExperimental = new AtomicBoolean(true);
registry.listTagIds().sorted(Formatting.alphabeticKeyOrder(nmsTagKey -> nmsTagKey.location().getPath())).forEach(nmsTagKey -> {
registry.getTagNames().sorted(Formatting.alphabeticKeyOrder(nmsTagKey -> nmsTagKey.location().getPath())).forEach(nmsTagKey -> {
final String fieldName = Formatting.formatKeyAsField(nmsTagKey.location().getPath());
final FieldSpec.Builder fieldBuilder = FieldSpec.builder(tagKey, fieldName, PUBLIC, STATIC, FINAL)
.initializer("$N(key($S))", createMethod.build(), nmsTagKey.location().getPath())
.addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), "#" + nmsTagKey.location());
final String featureFlagName = Main.EXPERIMENTAL_TAGS.get(nmsTagKey);
if (featureFlagName != null) {
fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.valueOf(featureFlagName.toUpperCase(Locale.ENGLISH)))); // Update for Experimental API
if (Main.EXPERIMENTAL_TAGS.containsKey(nmsTagKey)) {
fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.TRADE_REBALANCE)); // Update for Experimental API
} else {
allExperimental.set(false);
}
@@ -31,4 +31,5 @@ public abstract class SimpleGenerator implements SourceGenerator {
builder.build().writeTo(parent, StandardCharsets.UTF_8);
}
}
@@ -1,5 +1,6 @@
package io.papermc.generator.types.goal;
import com.destroystokyo.paper.entity.RangedEntity;
import com.destroystokyo.paper.entity.ai.GoalKey;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
@@ -18,10 +19,44 @@ import io.papermc.generator.utils.Formatting;
import io.papermc.generator.utils.Javadocs;
import java.util.Comparator;
import java.util.List;
import javax.lang.model.element.Modifier;
import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.ai.goal.WrappedGoal;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.AbstractHorse;
import org.bukkit.entity.Blaze;
import org.bukkit.entity.Cat;
import org.bukkit.entity.Creature;
import org.bukkit.entity.Dolphin;
import org.bukkit.entity.Drowned;
import org.bukkit.entity.Enderman;
import org.bukkit.entity.Evoker;
import org.bukkit.entity.Fish;
import org.bukkit.entity.Fox;
import org.bukkit.entity.Ghast;
import org.bukkit.entity.Llama;
import org.bukkit.entity.Mob;
import org.bukkit.entity.Monster;
import org.bukkit.entity.Panda;
import org.bukkit.entity.Parrot;
import org.bukkit.entity.PigZombie;
import org.bukkit.entity.PolarBear;
import org.bukkit.entity.Rabbit;
import org.bukkit.entity.Raider;
import org.bukkit.entity.Ravager;
import org.bukkit.entity.Shulker;
import org.bukkit.entity.Silverfish;
import org.bukkit.entity.SkeletonHorse;
import org.bukkit.entity.Slime;
import org.bukkit.entity.Spellcaster;
import org.bukkit.entity.Spider;
import org.bukkit.entity.Squid;
import org.bukkit.entity.Tameable;
import org.bukkit.entity.TraderLlama;
import org.bukkit.entity.Turtle;
import org.bukkit.entity.Vex;
import org.bukkit.entity.Vindicator;
import org.bukkit.entity.WanderingTrader;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
import org.jetbrains.annotations.Nullable;
@@ -50,8 +85,10 @@ public class MobGoalGenerator extends SimpleGenerator {
.addAnnotations(Annotations.CLASS_HEADER)
.addJavadoc(CLASS_HEADER);
TypeName mobType = ParameterizedTypeName.get(ClassName.get(Class.class), type);
TypeName keyType = TypeName.get(String.class);
TypeName mobType = ParameterizedTypeName.get(ClassName.get(Class.class), type)
.annotated(Annotations.NOT_NULL);
TypeName keyType = TypeName.get(String.class)
.annotated(Annotations.NOT_NULL);
ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build();
ParameterSpec typeParam = ParameterSpec.builder(mobType, "type", FINAL).build();
@@ -61,7 +98,7 @@ public class MobGoalGenerator extends SimpleGenerator {
.addParameter(typeParam)
.addCode("return $T.of($N, $T.minecraft($N));", GoalKey.class, typeParam, NamespacedKey.class, keyParam)
.addTypeVariable(type)
.returns(ParameterizedTypeName.get(ClassName.get(GoalKey.class), type));
.returns(ParameterizedTypeName.get(ClassName.get(GoalKey.class), type).annotated(Annotations.NOT_NULL));
List<Class<Goal>> classes;
try (ScanResult scanResult = new ClassGraph().enableAllInfo().whitelistPackages("net.minecraft").scan()) {
@@ -97,4 +134,10 @@ public class MobGoalGenerator extends SimpleGenerator {
protected JavaFile.Builder file(JavaFile.Builder builder) {
return builder;
}
record DeprecatedEntry(Class<?> entity, String entryName, @Nullable String removalVersion,
@Nullable String removedVersion) {
}
}
@@ -236,8 +236,6 @@ public class MobGoalNames {
bukkitMap.put(net.minecraft.world.entity.monster.breeze.Breeze.class, org.bukkit.entity.Breeze.class);
bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class);
bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class);
bukkitMap.put(net.minecraft.world.entity.monster.creaking.Creaking.class, org.bukkit.entity.Creaking.class);
bukkitMap.put(net.minecraft.world.entity.animal.AgeableWaterCreature.class, org.bukkit.entity.Squid.class); // close enough
//</editor-fold>
}
@@ -270,7 +268,6 @@ public class MobGoalNames {
name = cut;
}
}
name = name.replace("PathfinderGoal", "");
name = name.replace("TargetGoal", "");
name = name.replace("Goal", "");
@@ -7,9 +7,9 @@ import java.util.List;
import io.papermc.paper.generated.GeneratedFrom;
import net.minecraft.SharedConstants;
import org.bukkit.MinecraftExperimental;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import org.jspecify.annotations.NullMarked;
public final class Annotations {
@@ -46,7 +46,7 @@ public final class Annotations {
@ApiStatus.Experimental
public static final AnnotationSpec EXPERIMENTAL_API_ANNOTATION = AnnotationSpec.builder(ApiStatus.Experimental.class).build();
public static final AnnotationSpec NULL_MARKED = AnnotationSpec.builder(NullMarked.class).build();
public static final AnnotationSpec NOT_NULL = AnnotationSpec.builder(NonNull.class).build();
private static final AnnotationSpec SUPPRESS_WARNINGS = AnnotationSpec.builder(SuppressWarnings.class)
.addMember("value", "$S", "unused")
.addMember("value", "$S", "SpellCheckingInspection")
@@ -56,8 +56,7 @@ public final class Annotations {
.build();
public static final Iterable<AnnotationSpec> CLASS_HEADER = List.of(
SUPPRESS_WARNINGS,
GENERATED_FROM,
NULL_MARKED
GENERATED_FROM
);
private Annotations() {
@@ -18,11 +18,11 @@ public record CollectingContext<T>(Set<ResourceKey<T>> registered,
@Override
public Holder.Reference<T> register(final ResourceKey<T> resourceKey, final @NonNull T t, final Lifecycle lifecycle) {
this.registered.add(resourceKey);
return Holder.Reference.createStandAlone(this.registry, resourceKey);
return Holder.Reference.createStandAlone(this.registry.holderOwner(), resourceKey);
}
@Override
public <S> HolderGetter<S> lookup(final ResourceKey<? extends Registry<? extends S>> resourceKey) {
return Main.REGISTRY_ACCESS.lookupOrThrow(resourceKey);
return Main.REGISTRY_ACCESS.registryOrThrow(resourceKey).asLookup();
}
}
@@ -47,7 +47,7 @@ public final class TagCollector {
return;
}
result.put(entry.value().listTagIds()
result.put(entry.value().getTagNames()
.filter(tagKey -> tagKey.location().getPath().equals(path))
.findFirst()
.orElseThrow(), packId);
+3 -2
View File
@@ -1,6 +1,7 @@
public net/minecraft/server/WorldLoader loadAndReplaceLayer(Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/server/RegistryLayer;Ljava/util/List;)Lnet/minecraft/core/LayeredRegistryAccess;
# for auto-marking experimental stuff
public net/minecraft/core/RegistrySetBuilder entries
public net/minecraft/core/RegistrySetBuilder$RegistryStub
public net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER
public net/minecraft/data/registries/VanillaRegistries BUILDER
public net/minecraft/data/registries/WinterDropRegistries BUILDER
public net/minecraft/data/registries/TradeRebalanceRegistries BUILDER
@@ -27,10 +27,10 @@ index 5dd700a956e915c00b25d91dea8d6f285ddab72b..97e78e27ee0eea2c8b24886eeb19164d
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..dfb490fe94c1f543cc75e9f5ca76f8254bff9159
index 0000000000000000000000000000000000000000..6271e2bad0ed937c2c46a8c8fdf186c46b0b620e
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,93 @@
@@ -0,0 +1,91 @@
+plugins {
+ `java-library`
+ `maven-publish`
@@ -46,13 +46,11 @@ index 0000000000000000000000000000000000000000..dfb490fe94c1f543cc75e9f5ca76f825
+
+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:32.1.2-jre")
+ api("com.google.code.gson:gson:2.10.1")
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion")
+ api("org.yaml:snakeyaml:2.2")
+ api("org.joml:joml:1.10.8") {
+ isTransitive = false // https://github.com/JOML-CI/JOML/issues/352
+ }
+ api("org.joml:joml:1.10.5")
+
+ compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
@@ -65,8 +63,8 @@ index 0000000000000000000000000000000000000000..dfb490fe94c1f543cc75e9f5ca76f825
+ testImplementation("org.apache.commons:commons-lang3:3.12.0")
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
+ testImplementation("org.hamcrest:hamcrest:2.2")
+ testImplementation("org.mockito:mockito-core:5.14.1")
+ testImplementation("org.ow2.asm:asm-tree:9.7.1")
+ testImplementation("org.mockito:mockito-core:5.11.0")
+ testImplementation("org.ow2.asm:asm-tree:9.7")
+}
+
+configure<PublishingExtension> {
@@ -102,7 +100,7 @@ index 0000000000000000000000000000000000000000..dfb490fe94c1f543cc75e9f5ca76f825
+ options.use()
+ options.isDocFilesSubDirs = true
+ options.links(
+ "https://guava.dev/releases/33.3.1-jre/api/docs/",
+ "https://guava.dev/releases/32.1.2-jre/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/",
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/",
@@ -126,7 +124,7 @@ index 0000000000000000000000000000000000000000..dfb490fe94c1f543cc75e9f5ca76f825
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 25a8f7daaf393f3306ca5c6c0c79d3de7bc983db..0000000000000000000000000000000000000000
index 2c5ac393cffbe61330c5aa95115e7e906c0775d3..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,267 +0,0 @@
@@ -137,7 +135,7 @@ index 25a8f7daaf393f3306ca5c6c0c79d3de7bc983db..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.21.4-R0.1-SNAPSHOT</version>
- <version>1.21.1-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
@@ -166,21 +164,21 @@ index 25a8f7daaf393f3306ca5c6c0c79d3de7bc983db..00000000000000000000000000000000
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>33.3.1-jre</version>
- <version>32.1.2-jre</version>
- <scope>compile</scope>
- </dependency>
- <!-- bundled with Minecraft, should be kept in sync -->
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.11.0</version>
- <version>2.10.1</version>
- <scope>compile</scope>
- </dependency>
- <!-- bundled with Minecraft, should be kept in sync -->
- <dependency>
- <groupId>org.joml</groupId>
- <artifactId>joml</artifactId>
- <version>1.10.8</version>
- <version>1.10.5</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@@ -238,13 +236,13 @@ index 25a8f7daaf393f3306ca5c6c0c79d3de7bc983db..00000000000000000000000000000000
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>5.14.1</version>
- <version>5.11.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-tree</artifactId>
- <version>9.7.1</version>
- <version>9.7</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+10 -12
View File
@@ -5,13 +5,13 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index dfb490fe94c1f543cc75e9f5ca76f8254bff9159..3667f27baa87c82e071cc14ca20491d38feee255 100644
index 6271e2bad0ed937c2c46a8c8fdf186c46b0b620e..a918fd14c95e714e935758d60bccd72755e00b11 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -20,15 +20,27 @@ dependencies {
api("org.joml:joml:1.10.8") {
isTransitive = false // https://github.com/JOML-CI/JOML/issues/352
}
@@ -18,15 +18,26 @@ dependencies {
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion")
api("org.yaml:snakeyaml:2.2")
api("org.joml:joml:1.10.5")
+ // Paper start
+ api("com.googlecode.json-simple:json-simple:1.1.1") {
+ isTransitive = false // includes junit
@@ -32,27 +32,25 @@ index dfb490fe94c1f543cc75e9f5ca76f8254bff9159..3667f27baa87c82e071cc14ca20491d3
+ compileOnlyApi(checkerQual)
+ testCompileOnly(checkerQual)
+ // Paper end
+ api("org.jspecify:jspecify:1.0.0") // Paper - add jspecify
+
testImplementation("org.apache.commons:commons-lang3:3.12.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testImplementation("org.hamcrest:hamcrest:2.2")
@@ -71,8 +83,13 @@ tasks.withType<Javadoc> {
@@ -69,8 +80,12 @@ tasks.withType<Javadoc> {
options.links(
"https://guava.dev/releases/33.3.1-jre/api/docs/",
"https://guava.dev/releases/32.1.2-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/$annotationsVersion/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/",
+ // Paper start - add missing javadoc links
+ "https://javadoc.io/doc/org.joml/joml/1.10.8/index.html",
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0",
+ "https://jspecify.dev/docs/api/",
+ "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
+ // Paper end
)
options.tags("apiNote:a:API Note:")
@@ -91,3 +108,14 @@ tasks.withType<Javadoc> {
@@ -89,3 +104,14 @@ tasks.withType<Javadoc> {
tasks.test {
useJUnitPlatform()
}
+10 -101
View File
@@ -7,52 +7,16 @@ Subject: [PATCH] Test changes
- Ignore package-private methods for nullability annotations
- Add excludes for classes which don't pass
- Disable stupid BukkitMirrorTest
- configure mockito agent to address changes in newer java versions see https://openjdk.org/jeps/451
Co-authored-by: Riley Park <rileysebastianpark@gmail.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
Co-authored-by: Yannick Lamprecht <yannicklamprecht@live.de>
diff --git a/build.gradle.kts b/build.gradle.kts
index 3667f27baa87c82e071cc14ca20491d38feee255..73aaa8a341565626556327cda6a73f98c318863a 100644
index a918fd14c95e714e935758d60bccd72755e00b11..768024b2b4584fd7dd86f068c0e79c89ffc5faa1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -11,6 +11,18 @@ java {
val annotationsVersion = "24.1.0"
val bungeeCordChatVersion = "1.20-R0.2"
+// Paper start - configure mockito agent that is needed in newer java versions
+val mockitoAgent = configurations.register("mockitoAgent")
+abstract class MockitoAgentProvider : CommandLineArgumentProvider {
+ @get:CompileClasspath
+ abstract val fileCollection: ConfigurableFileCollection
+
+ override fun asArguments(): Iterable<String> {
+ return listOf("-javaagent:" + fileCollection.files.single().absolutePath)
+ }
+}
+// Paper end - configure mockito agent that is needed in newer java versions
+
dependencies {
// api dependencies are listed transitively to API consumers
api("com.google.guava:guava:33.3.1-jre")
@@ -46,6 +58,7 @@ dependencies {
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.14.1")
testImplementation("org.ow2.asm:asm-tree:9.7.1")
+ mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
}
configure<PublishingExtension> {
@@ -107,8 +120,19 @@ tasks.withType<Javadoc> {
tasks.test {
@@ -105,6 +105,12 @@ tasks.test {
useJUnitPlatform()
+ // Paper start - configure mockito agent that is needed in newer java versions
+ val provider = objects.newInstance<MockitoAgentProvider>()
+ provider.fileCollection.from(mockitoAgent)
+ jvmArgumentProviders.add(provider)
+ // Paper end - configure mockito agent that is needed in newer java versions
}
+// Paper start - compile tests with -parameters for better junit parameterized test names
@@ -102,7 +66,7 @@ index 0000000000000000000000000000000000000000..77154095cfb8b259bdb318e8ff40cb6f
+ }
+}
diff --git a/src/test/java/org/bukkit/AnnotationTest.java b/src/test/java/org/bukkit/AnnotationTest.java
index 64e7aef6220097edefdff3b98a771b988365930d..07f904a78f51b220a5891aca1afffac4f46d58b4 100644
index 64e7aef6220097edefdff3b98a771b988365930d..d9091ba1e5a55e03adca98305233cce9d6888609 100644
--- a/src/test/java/org/bukkit/AnnotationTest.java
+++ b/src/test/java/org/bukkit/AnnotationTest.java
@@ -29,7 +29,13 @@ public class AnnotationTest {
@@ -139,19 +103,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..07f904a78f51b220a5891aca1afffac4
};
@Test
@@ -61,20 +77,60 @@ public class AnnotationTest {
continue;
}
+ // Paper start - skip class if it's @NullMarked
+ if (isClassNullMarked(clazz, foundClasses)) {
+ continue;
+ }
+ // Paper end - skip class if it's @NullMarked
+
for (MethodNode method : clazz.methods) {
if (!isMethodIncluded(clazz, method, foundClasses)) {
continue;
@@ -67,14 +83,48 @@ public class AnnotationTest {
}
if (mustBeAnnotated(Type.getReturnType(method.desc)) && !isWellAnnotated(method.invisibleAnnotations)) {
@@ -200,7 +152,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..07f904a78f51b220a5891aca1afffac4
ParameterNode paramNode = parameters == null ? null : parameters.get(i);
String paramName = paramNode == null ? null : paramNode.name;
@@ -91,17 +147,37 @@ public class AnnotationTest {
@@ -91,13 +141,18 @@ public class AnnotationTest {
Collections.sort(errors);
@@ -223,50 +175,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..07f904a78f51b220a5891aca1afffac4
}
private static void collectClasses(@NotNull File from, @NotNull Map<String, ClassNode> to) throws IOException {
if (from.isDirectory()) {
+ // Paper start - skip packages with @NullMarked
+ final File packageInfo = new File(from, "package-info.class");
+ if (packageInfo.exists()) {
+ try (final FileInputStream in = new FileInputStream(packageInfo)) {
+ final ClassReader cr = new ClassReader(in);
+
+ final ClassNode node = new ClassNode();
+ cr.accept(node, ClassReader.SKIP_CODE | ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
+
+ if (isClassNullMarked0(node)) {
+ return; // skip packages with @NullMarked
+ }
+ }
+ }
+ // Paper end - skip packages with @NullMarked
final File[] files = from.listFiles();
assert files != null;
@@ -125,6 +201,23 @@ public class AnnotationTest {
}
}
+ // Paper start - skip class if it's @NullMarked
+ private static boolean isClassNullMarked(@NotNull ClassNode clazz, @NotNull Map<String, ClassNode> allClasses) {
+ if (clazz.nestHostClass != null) {
+ final ClassNode nestHostNode = allClasses.get(clazz.nestHostClass);
+ if (nestHostNode != null) {
+ return isClassNullMarked0(nestHostNode);
+ }
+ }
+
+ return isClassNullMarked0(clazz);
+ }
+
+ private static boolean isClassNullMarked0(@NotNull ClassNode clazz) {
+ return clazz.visibleAnnotations != null && clazz.visibleAnnotations.stream().anyMatch(node -> "Lorg/jspecify/annotations/NullMarked;".equals(node.desc));
+ }
+ // Paper end - skip class if it's @NullMarked
+
private static boolean isClassIncluded(@NotNull ClassNode clazz, @NotNull Map<String, ClassNode> allClasses) {
// Exclude private, synthetic or deprecated classes and annotations, since their members can't be null
if ((clazz.access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_SYNTHETIC | Opcodes.ACC_DEPRECATED | Opcodes.ACC_ANNOTATION)) != 0) {
@@ -140,6 +233,11 @@ public class AnnotationTest {
@@ -140,6 +195,11 @@ public class AnnotationTest {
// Exceptions are excluded
return false;
}
@@ -278,7 +187,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..07f904a78f51b220a5891aca1afffac4
for (String excludedClass : EXCLUDED_CLASSES) {
if (excludedClass.equals(clazz.name)) {
@@ -152,7 +250,7 @@ public class AnnotationTest {
@@ -152,7 +212,7 @@ public class AnnotationTest {
private static boolean isMethodIncluded(@NotNull ClassNode clazz, @NotNull MethodNode method, @NotNull Map<String, ClassNode> allClasses) {
// Exclude private, synthetic and deprecated methods
@@ -287,7 +196,7 @@ index 64e7aef6220097edefdff3b98a771b988365930d..07f904a78f51b220a5891aca1afffac4
return false;
}
@@ -170,11 +268,30 @@ public class AnnotationTest {
@@ -170,11 +230,30 @@ public class AnnotationTest {
if ("<init>".equals(method.name) && isAnonymous(clazz)) {
return false;
}
@@ -332,10 +241,10 @@ index 89ca06ebecdaadd5dfc7bc74473ca15ad36f6eff..5974ceea58940e1799f3589eac0e39b9
public static Stream<Arguments> data() {
diff --git a/src/test/java/org/bukkit/support/TestServer.java b/src/test/java/org/bukkit/support/TestServer.java
index c67e0784c043ed194f6acde32411e156412a9b24..eb1fd4b911c4af76cdd3eac85d5365e7941a4a2e 100644
index 5709d52ed4ac4ce8dd8b0569281279f7305c5fb9..a47ee3ce660ec4467b5ed6a4b41fb2d19179a189 100644
--- a/src/test/java/org/bukkit/support/TestServer.java
+++ b/src/test/java/org/bukkit/support/TestServer.java
@@ -83,6 +83,11 @@ public final class TestServer {
@@ -72,6 +72,11 @@ public final class TestServer {
UnsafeValues unsafeValues = mock(withSettings().stubOnly());
when(instance.getUnsafe()).thenReturn(unsafeValues);
+41 -112
View File
@@ -7,7 +7,7 @@ Currently includes generated key holder classes for types
used in the Registry Modification API
diff --git a/build.gradle.kts b/build.gradle.kts
index 73aaa8a341565626556327cda6a73f98c318863a..a214483db535890a4b89e35a8c50cfd709df36d4 100644
index 768024b2b4584fd7dd86f068c0e79c89ffc5faa1..f11a22ab01e97e51619c96f2d8a78a99297efc59 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,7 @@
@@ -18,8 +18,8 @@ index 73aaa8a341565626556327cda6a73f98c318863a..a214483db535890a4b89e35a8c50cfd7
}
java {
@@ -61,6 +62,22 @@ dependencies {
mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
@@ -45,6 +46,22 @@ dependencies {
testImplementation("org.ow2.asm:asm-tree:9.7")
}
+// Paper start
@@ -41,7 +41,7 @@ index 73aaa8a341565626556327cda6a73f98c318863a..a214483db535890a4b89e35a8c50cfd7
configure<PublishingExtension> {
publications.create<MavenPublication>("maven") {
from(components["java"])
@@ -143,3 +160,14 @@ tasks.check {
@@ -121,3 +138,14 @@ tasks.check {
dependsOn(scanJar)
}
// Paper end
@@ -85,10 +85,10 @@ index 0000000000000000000000000000000000000000..2512dba27edfdccbc4430815b6cba048
+}
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKey.java b/src/main/java/io/papermc/paper/registry/RegistryKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..647f6a1ec1f9d3c203b41f90a99bfd415bf67366
index 0000000000000000000000000000000000000000..76daccf4ea502e1747a6f9176dc16fd20c561286
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/RegistryKey.java
@@ -0,0 +1,196 @@
@@ -0,0 +1,147 @@
+package io.papermc.paper.registry;
+
+import net.kyori.adventure.key.Keyed;
@@ -114,14 +114,12 @@ index 0000000000000000000000000000000000000000..647f6a1ec1f9d3c203b41f90a99bfd41
+import org.bukkit.generator.structure.Structure;
+import org.bukkit.generator.structure.StructureType;
+import org.bukkit.inventory.ItemType;
+import org.bukkit.inventory.MenuType;
+import org.bukkit.inventory.meta.trim.TrimMaterial;
+import org.bukkit.inventory.meta.trim.TrimPattern;
+import org.bukkit.map.MapCursor;
+import org.bukkit.potion.PotionEffectType;
+import org.bukkit.potion.PotionType;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+
+import static io.papermc.paper.registry.RegistryKeyImpl.create;
+
@@ -138,7 +136,6 @@ index 0000000000000000000000000000000000000000..647f6a1ec1f9d3c203b41f90a99bfd41
+ * @param <T> the value type
+ */
+@SuppressWarnings("unused")
+@NullMarked
+public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
+
+ /* ******************* *
@@ -155,6 +152,11 @@ index 0000000000000000000000000000000000000000..647f6a1ec1f9d3c203b41f90a99bfd41
+ */
+ RegistryKey<StructureType> STRUCTURE_TYPE = create("worldgen/structure_type");
+ /**
+ * Built-in registry for instruments.
+ * @see io.papermc.paper.registry.keys.InstrumentKeys
+ */
+ RegistryKey<MusicInstrument> INSTRUMENT = create("instrument");
+ /**
+ * Built-in registry for potion effect types (mob effects).
+ * @see io.papermc.paper.registry.keys.MobEffectKeys
+ */
@@ -169,52 +171,6 @@ index 0000000000000000000000000000000000000000..647f6a1ec1f9d3c203b41f90a99bfd41
+ */
+ @ApiStatus.Internal
+ RegistryKey<ItemType> ITEM = create("item");
+ /**
+ * Built-in registry for cat variants.
+ * @see io.papermc.paper.registry.keys.CatVariantKeys
+ */
+ RegistryKey<Cat.Type> CAT_VARIANT = create("cat_variant");
+ /**
+ * Built-in registry for frog variants.
+ * @see io.papermc.paper.registry.keys.FrogVariantKeys
+ */
+ RegistryKey<Frog.Variant> FROG_VARIANT = create("frog_variant");
+ /**
+ * Built-in registry for villager professions.
+ * @see io.papermc.paper.registry.keys.VillagerProfessionKeys
+ */
+ RegistryKey<Villager.Profession> VILLAGER_PROFESSION = create("villager_profession");
+ /**
+ * Built-in registry for villager types.
+ * @see io.papermc.paper.registry.keys.VillagerTypeKeys
+ */
+ RegistryKey<Villager.Type> VILLAGER_TYPE = create("villager_type");
+ /**
+ * Built-in registry for map decoration types.
+ * @see io.papermc.paper.registry.keys.MapDecorationTypeKeys
+ */
+ RegistryKey<MapCursor.Type> MAP_DECORATION_TYPE = create("map_decoration_type");
+ /**
+ * Built-in registry for menu types.
+ * @see io.papermc.paper.registry.keys.MenuTypeKeys
+ */
+ RegistryKey<MenuType> MENU = create("menu");
+ /**
+ * Built-in registry for attributes.
+ * @see io.papermc.paper.registry.keys.AttributeKeys
+ */
+ RegistryKey<Attribute> ATTRIBUTE = create("attribute");
+ /**
+ * Built-in registry for fluids.
+ * @see io.papermc.paper.registry.keys.FluidKeys
+ */
+ RegistryKey<Fluid> FLUID = create("fluid");
+ /**
+ * Built-in registry for sound events.
+ * @see io.papermc.paper.registry.keys.SoundEventKeys
+ */
+ RegistryKey<Sound> SOUND_EVENT = create("sound_event");
+
+
+
+ /* ********************** *
@@ -257,51 +213,44 @@ index 0000000000000000000000000000000000000000..647f6a1ec1f9d3c203b41f90a99bfd41
+ RegistryKey<Enchantment> ENCHANTMENT = create("enchantment");
+ /**
+ * Data-driven registry for jukebox songs.
+ * @see io.papermc.paper.registry.keys.JukeboxSongKeys
+ */
+ @ApiStatus.Experimental
+ RegistryKey<JukeboxSong> JUKEBOX_SONG = create("jukebox_song");
+ /**
+ * Data-driven registry for banner patterns.
+ * @see io.papermc.paper.registry.keys.BannerPatternKeys
+ */
+ RegistryKey<PatternType> BANNER_PATTERN = create("banner_pattern");
+ /**
+ * Data-driven registry for painting variants.
+ * @see io.papermc.paper.registry.keys.PaintingVariantKeys
+ */
+ RegistryKey<Art> PAINTING_VARIANT = create("painting_variant");
+ /**
+ * Data-driven registry for instruments.
+ * @see io.papermc.paper.registry.keys.InstrumentKeys
+ */
+ RegistryKey<MusicInstrument> INSTRUMENT = create("instrument");
+
+
+ /* ******************* *
+ * API-only Registries *
+ * ******************* */
+ RegistryKey<Art> PAINTING_VARIANT = create("painting_variant");
+ RegistryKey<Attribute> ATTRIBUTE = create("attribute");
+ RegistryKey<PatternType> BANNER_PATTERN = create("banner_pattern");
+ RegistryKey<Cat.Type> CAT_VARIANT = create("cat_variant");
+ RegistryKey<EntityType> ENTITY_TYPE = create("entity_type");
+ RegistryKey<Particle> PARTICLE_TYPE = create("particle_type");
+ RegistryKey<PotionType> POTION = create("potion");
+ RegistryKey<Sound> SOUND_EVENT = create("sound_event");
+ RegistryKey<Villager.Profession> VILLAGER_PROFESSION = create("villager_profession");
+ RegistryKey<Villager.Type> VILLAGER_TYPE = create("villager_type");
+ RegistryKey<MemoryKey<?>> MEMORY_MODULE_TYPE = create("memory_module_type");
+ RegistryKey<Fluid> FLUID = create("fluid");
+ RegistryKey<Frog.Variant> FROG_VARIANT = create("frog_variant");
+ RegistryKey<MapCursor.Type> MAP_DECORATION_TYPE = create("map_decoration_type");
+}
diff --git a/src/main/java/io/papermc/paper/registry/RegistryKeyImpl.java b/src/main/java/io/papermc/paper/registry/RegistryKeyImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..80e3e64f47ac55a4978c9e5b430e2f2d1c871d1b
index 0000000000000000000000000000000000000000..791813220b2504214b1adecc69093cd600fb0f8c
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/RegistryKeyImpl.java
@@ -0,0 +1,26 @@
@@ -0,0 +1,24 @@
+package io.papermc.paper.registry;
+
+import com.google.common.collect.Sets;
+import java.util.Set;
+import net.kyori.adventure.key.Key;
+import org.intellij.lang.annotations.Subst;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+
+@NullMarked
+record RegistryKeyImpl<T>(Key key) implements RegistryKey<T> {
+record RegistryKeyImpl<T>(@NotNull Key key) implements RegistryKey<T> {
+
+ static final Set<RegistryKey<?>> REGISTRY_KEYS = Sets.newIdentityHashSet();
+
@@ -319,16 +268,16 @@ index 0000000000000000000000000000000000000000..80e3e64f47ac55a4978c9e5b430e2f2d
+}
diff --git a/src/main/java/io/papermc/paper/registry/TypedKey.java b/src/main/java/io/papermc/paper/registry/TypedKey.java
new file mode 100644
index 0000000000000000000000000000000000000000..81bee5224196008662ddda528b5dcb8dd7cb9f21
index 0000000000000000000000000000000000000000..6f5a062ba7ee7173468ecea3c1855a233bf3855e
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/TypedKey.java
@@ -0,0 +1,45 @@
@@ -0,0 +1,44 @@
+package io.papermc.paper.registry;
+
+import net.kyori.adventure.key.Key;
+import net.kyori.adventure.key.Keyed;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Represents a key for a value in a specific registry.
@@ -336,8 +285,7 @@ index 0000000000000000000000000000000000000000..81bee5224196008662ddda528b5dcb8d
+ * @param <T> the value type for the registry
+ */
+@ApiStatus.Experimental
+@NullMarked
+public sealed interface TypedKey<T> extends Key permits TypedKeyImpl {
+public sealed interface TypedKey<T> extends Keyed permits TypedKeyImpl {
+
+ /**
+ * Gets the key for the value in the registry.
@@ -345,7 +293,7 @@ index 0000000000000000000000000000000000000000..81bee5224196008662ddda528b5dcb8d
+ * @return the value's key
+ */
+ @Override
+ Key key();
+ @NotNull Key key();
+
+ /**
+ * Gets the registry key for the value this key
@@ -353,7 +301,7 @@ index 0000000000000000000000000000000000000000..81bee5224196008662ddda528b5dcb8d
+ *
+ * @return the registry key
+ */
+ RegistryKey<T> registryKey();
+ @NotNull RegistryKey<T> registryKey();
+
+ /**
+ * Create a typed key from a key and a registry key.
@@ -364,51 +312,32 @@ index 0000000000000000000000000000000000000000..81bee5224196008662ddda528b5dcb8d
+ * @return a new key for the value key and registry key
+ */
+ @ApiStatus.Experimental
+ static <T> TypedKey<T> create(final RegistryKey<T> registryKey, final Key key) {
+ static <T> @NotNull TypedKey<T> create(final @NotNull RegistryKey<T> registryKey, final @NotNull Key key) {
+ return new TypedKeyImpl<>(key, registryKey);
+ }
+}
diff --git a/src/main/java/io/papermc/paper/registry/TypedKeyImpl.java b/src/main/java/io/papermc/paper/registry/TypedKeyImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..3e29f7007500582cdc3f84b91f11ebeb58f68bbf
index 0000000000000000000000000000000000000000..1a97b3359c4ece5c29131da7c3f208aaa8fab66e
--- /dev/null
+++ b/src/main/java/io/papermc/paper/registry/TypedKeyImpl.java
@@ -0,0 +1,23 @@
@@ -0,0 +1,8 @@
+package io.papermc.paper.registry;
+
+import net.kyori.adventure.key.Key;
+import org.jspecify.annotations.NullMarked;
+import net.kyori.adventure.key.Keyed;
+import org.jetbrains.annotations.NotNull;
+
+@NullMarked
+record TypedKeyImpl<T>(Key key, RegistryKey<T> registryKey) implements TypedKey<T> {
+ // Wrap key methods to make this easier to use
+ @Override
+ public String namespace() {
+ return this.key.namespace();
+ }
+
+ @Override
+ public String value() {
+ return this.key.value();
+ }
+
+ @Override
+ public String asString() {
+ return this.key.asString();
+ }
+record TypedKeyImpl<T>(@NotNull Key key, @NotNull RegistryKey<T> registryKey) implements TypedKey<T> {
+}
diff --git a/src/main/java/org/bukkit/MinecraftExperimental.java b/src/main/java/org/bukkit/MinecraftExperimental.java
index a86b87e4c3332202e40e484c3f9c6562b419c70f..e996a758fc1e4ecfec68641733d69665f30792e8 100644
index a86b87e4c3332202e40e484c3f9c6562b419c70f..305532968f9f7dd497c77259ed147ea2f081bc74 100644
--- a/src/main/java/org/bukkit/MinecraftExperimental.java
+++ b/src/main/java/org/bukkit/MinecraftExperimental.java
@@ -47,5 +47,10 @@ public @interface MinecraftExperimental {
@@ -47,5 +47,6 @@ public @interface MinecraftExperimental {
@ApiStatus.Internal
public enum Requires {
+ // Paper start
+ TRADE_REBALANCE,
+ REDSTONE_EXPERIMENTS,
+ MINECART_IMPROVEMENTS
+ // Paper end
+ BUNDLE, TRADE_REBALANCE // Paper
}
}
@@ -6,14 +6,14 @@ Subject: [PATCH] Add FastUtil to Bukkit
Doesn't expose to plugins, just allows Paper-API to use it for optimization
diff --git a/build.gradle.kts b/build.gradle.kts
index a214483db535890a4b89e35a8c50cfd709df36d4..e1acfa9abed37e5332edf6b6cf66e3b9b926b366 100644
index f11a22ab01e97e51619c96f2d8a78a99297efc59..2f266350a787a4cfdfda1b0e760bfb7604cac43c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -37,6 +37,7 @@ dependencies {
@@ -23,6 +23,7 @@ dependencies {
api("com.googlecode.json-simple:json-simple:1.1.1") {
isTransitive = false // includes junit
}
+ api("it.unimi.dsi:fastutil:8.5.15")
+ api("it.unimi.dsi:fastutil:8.5.6")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
File diff suppressed because it is too large. Load diff
+7 -10
View File
@@ -6,25 +6,22 @@ Subject: [PATCH] Paper Utils
diff --git a/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java
new file mode 100644
index 0000000000000000000000000000000000000000..fbcd82b513b4cb9839f9d2b38d9c6c73148e30a6
index 0000000000000000000000000000000000000000..9db0056ab94145819628b3ad8d8d26130d117fcf
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/SneakyThrow.java
@@ -0,0 +1,19 @@
@@ -0,0 +1,16 @@
+package com.destroystokyo.paper.util;
+
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+@ApiStatus.Internal
+@NullMarked
+public final class SneakyThrow {
+public class SneakyThrow {
+
+ public static void sneaky(final Throwable exception) {
+ SneakyThrow.throwSneaky(exception);
+ public static void sneaky(@NotNull Throwable exception) {
+ SneakyThrow.<RuntimeException>throwSneaky(exception);
+ }
+
+ @SuppressWarnings("unchecked")
+ private static <T extends Throwable> void throwSneaky(final Throwable exception) throws T {
+ private static <T extends Throwable> void throwSneaky(@NotNull Throwable exception) throws T {
+ throw (T) exception;
+ }
+
@@ -6,153 +6,142 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index ed5d58d7569300c917dd52b11953a63fae6878d4..43086f7d201c0988086ef06cfe5a0f866d130961 100644
index af3514113abdf3f42c41f1e7ff0f930cc1a417f5..ed0b67ac322aa22b191cd35502ae5b4f20af19f8 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -61,6 +61,9 @@ dependencies {
@@ -47,6 +47,9 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
+
+ implementation("org.ow2.asm:asm:9.7.1")
+ implementation("org.ow2.asm:asm-commons:9.7.1")
+ implementation("org.ow2.asm:asm:9.7")
+ implementation("org.ow2.asm:asm-commons:9.7")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java
new file mode 100644
index 0000000000000000000000000000000000000000..5a702481d28d90cb503faad0d9b9c3231bbff940
index 0000000000000000000000000000000000000000..5b28e9b1daba7834af67dbc193dd656bedd9a994
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java
@@ -0,0 +1,46 @@
@@ -0,0 +1,42 @@
+package com.destroystokyo.paper.event.executor;
+
+import com.destroystokyo.paper.util.SneakyThrow;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Method;
+
+import com.destroystokyo.paper.util.SneakyThrow;
+import org.bukkit.event.Event;
+import org.bukkit.event.EventException;
+import org.bukkit.event.Listener;
+import org.bukkit.plugin.EventExecutor;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+
+@ApiStatus.Internal
+@NullMarked
+public class MethodHandleEventExecutor implements EventExecutor {
+
+ private final Class<? extends Event> eventClass;
+ private final MethodHandle handle;
+
+ public MethodHandleEventExecutor(final Class<? extends Event> eventClass, final MethodHandle handle) {
+ public MethodHandleEventExecutor(@NotNull Class<? extends Event> eventClass, @NotNull MethodHandle handle) {
+ this.eventClass = eventClass;
+ this.handle = handle;
+ }
+
+ public MethodHandleEventExecutor(final Class<? extends Event> eventClass, final Method m) {
+ public MethodHandleEventExecutor(@NotNull Class<? extends Event> eventClass, @NotNull Method m) {
+ this.eventClass = eventClass;
+ try {
+ m.setAccessible(true);
+ this.handle = MethodHandles.lookup().unreflect(m);
+ } catch (final IllegalAccessException e) {
+ } catch (IllegalAccessException e) {
+ throw new AssertionError("Unable to set accessible", e);
+ }
+ }
+
+ @Override
+ public void execute(final Listener listener, final Event event) throws EventException {
+ if (!this.eventClass.isInstance(event)) return;
+ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException {
+ if (!eventClass.isInstance(event)) return;
+ try {
+ this.handle.invoke(listener, event);
+ } catch (final Throwable t) {
+ handle.invoke(listener, event);
+ } catch (Throwable t) {
+ SneakyThrow.sneaky(t);
+ }
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java
new file mode 100644
index 0000000000000000000000000000000000000000..bbdb5b472df116b71c459bdc6cc4b74267ea0f5e
index 0000000000000000000000000000000000000000..827f2b27f70a7ec0bc11d039305c3e58c02a4ef4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/StaticMethodHandleEventExecutor.java
@@ -0,0 +1,44 @@
@@ -0,0 +1,42 @@
+package com.destroystokyo.paper.event.executor;
+
+import com.destroystokyo.paper.util.SneakyThrow;
+import com.google.common.base.Preconditions;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+
+import com.destroystokyo.paper.util.SneakyThrow;
+import com.google.common.base.Preconditions;
+
+import org.bukkit.event.Event;
+import org.bukkit.event.EventException;
+import org.bukkit.event.Listener;
+import org.bukkit.plugin.EventExecutor;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+@ApiStatus.Internal
+@NullMarked
+public class StaticMethodHandleEventExecutor implements EventExecutor {
+
+ private final Class<? extends Event> eventClass;
+ private final MethodHandle handle;
+
+ public StaticMethodHandleEventExecutor(final Class<? extends Event> eventClass, final Method m) {
+ public StaticMethodHandleEventExecutor(@NotNull Class<? extends Event> eventClass, @NotNull Method m) {
+ Preconditions.checkArgument(Modifier.isStatic(m.getModifiers()), "Not a static method: %s", m);
+ Preconditions.checkArgument(eventClass != null, "eventClass is null");
+ this.eventClass = eventClass;
+ try {
+ m.setAccessible(true);
+ this.handle = MethodHandles.lookup().unreflect(m);
+ } catch (final IllegalAccessException e) {
+ } catch (IllegalAccessException e) {
+ throw new AssertionError("Unable to set accessible", e);
+ }
+ }
+
+ @Override
+ public void execute(final Listener listener, final Event event) throws EventException {
+ if (!this.eventClass.isInstance(event)) return;
+ public void execute(@NotNull Listener listener, @NotNull Event event) throws EventException {
+ if (!eventClass.isInstance(event)) return;
+ try {
+ this.handle.invoke(event);
+ } catch (final Throwable throwable) {
+ handle.invoke(event);
+ } catch (Throwable throwable) {
+ SneakyThrow.sneaky(throwable);
+ }
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
new file mode 100644
index 0000000000000000000000000000000000000000..abfcb6e8383ff311940d82afe4ff990649a082dc
index 0000000000000000000000000000000000000000..084c31af1a7ba32bb4c3dc8f16f67fd09ce0b6a4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
@@ -0,0 +1,59 @@
@@ -0,0 +1,54 @@
+package com.destroystokyo.paper.event.executor.asm;
+
+import java.lang.reflect.Method;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.bukkit.plugin.EventExecutor;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+import org.objectweb.asm.ClassWriter;
+import org.objectweb.asm.Type;
+import org.objectweb.asm.commons.GeneratorAdapter;
+
+import static org.objectweb.asm.Opcodes.ACC_PUBLIC;
+import static org.objectweb.asm.Opcodes.INVOKEINTERFACE;
+import static org.objectweb.asm.Opcodes.INVOKESPECIAL;
+import static org.objectweb.asm.Opcodes.INVOKEVIRTUAL;
+import static org.objectweb.asm.Opcodes.V1_8;
+import static org.objectweb.asm.Opcodes.*;
+
+@ApiStatus.Internal
+@NullMarked
+public final class ASMEventExecutorGenerator {
+public class ASMEventExecutorGenerator {
+
+ private static final String EXECUTE_DESCRIPTOR = "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event;)V";
+
+ public static byte[] generateEventExecutor(final Method m, final String name) {
+ final ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
+ writer.visit(V1_8, ACC_PUBLIC, name.replace('.', '/'), null, Type.getInternalName(Object.class), new String[]{Type.getInternalName(EventExecutor.class)});
+ @NotNull
+ public static byte[] generateEventExecutor(@NotNull Method m, @NotNull String name) {
+ ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
+ writer.visit(V1_8, ACC_PUBLIC, name.replace('.', '/'), null, Type.getInternalName(Object.class), new String[] {Type.getInternalName(EventExecutor.class)});
+ // Generate constructor
+ GeneratorAdapter methodGenerator = new GeneratorAdapter(writer.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null), ACC_PUBLIC, "<init>", "()V");
+ methodGenerator.loadThis();
@@ -180,25 +169,22 @@ index 0000000000000000000000000000000000000000..abfcb6e8383ff311940d82afe4ff9906
+ }
+
+ public static AtomicInteger NEXT_ID = new AtomicInteger(1);
+
+ @NotNull
+ public static String generateName() {
+ final int id = NEXT_ID.getAndIncrement();
+ int id = NEXT_ID.getAndIncrement();
+ return "com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor" + id;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java
new file mode 100644
index 0000000000000000000000000000000000000000..581561fbd32c81ab1774ba8f0b7f3cec9392d99a
index 0000000000000000000000000000000000000000..f79685b48bb581277a6891927988b6f7a4389dc4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ClassDefiner.java
@@ -0,0 +1,35 @@
@@ -0,0 +1,34 @@
+package com.destroystokyo.paper.event.executor.asm;
+
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+@ApiStatus.Internal
+@NullMarked
+public interface ClassDefiner {
+
+ /**
@@ -206,7 +192,7 @@ index 0000000000000000000000000000000000000000..581561fbd32c81ab1774ba8f0b7f3cec
+ *
+ * @return if classes bypass access checks
+ */
+ default boolean isBypassAccessChecks() {
+ public default boolean isBypassAccessChecks() {
+ return false;
+ }
+
@@ -220,79 +206,79 @@ index 0000000000000000000000000000000000000000..581561fbd32c81ab1774ba8f0b7f3cec
+ * @throws ClassFormatError if the class data is invalid
+ * @throws NullPointerException if any of the arguments are null
+ */
+ Class<?> defineClass(ClassLoader parentLoader, String name, byte[] data);
+ @NotNull
+ public Class<?> defineClass(@NotNull ClassLoader parentLoader, @NotNull String name, @NotNull byte[] data);
+
+ static ClassDefiner getInstance() {
+ @NotNull
+ public static ClassDefiner getInstance() {
+ return SafeClassDefiner.INSTANCE;
+ }
+
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java
new file mode 100644
index 0000000000000000000000000000000000000000..48bcc72293c2a31b6e2dd2dcd6a79d618c72a137
index 0000000000000000000000000000000000000000..abcc966d8ee01d73c1d1480237ab46fa0ab55fdc
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/SafeClassDefiner.java
@@ -0,0 +1,66 @@
@@ -0,0 +1,64 @@
+package com.destroystokyo.paper.event.executor.asm;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.MapMaker;
+import java.util.concurrent.ConcurrentMap;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+
+@ApiStatus.Internal
+@NullMarked
+import com.google.common.base.Preconditions;
+
+import com.google.common.collect.MapMaker;
+import org.jetbrains.annotations.NotNull;
+
+public class SafeClassDefiner implements ClassDefiner {
+
+ /* default */ static final SafeClassDefiner INSTANCE = new SafeClassDefiner();
+
+ private SafeClassDefiner() {
+ }
+ private SafeClassDefiner() {}
+
+ private final ConcurrentMap<ClassLoader, GeneratedClassLoader> loaders = new MapMaker().weakKeys().makeMap();
+
+ @NotNull
+ @Override
+ public Class<?> defineClass(final ClassLoader parentLoader, final String name, final byte[] data) {
+ final GeneratedClassLoader loader = this.loaders.computeIfAbsent(parentLoader, GeneratedClassLoader::new);
+ public Class<?> defineClass(@NotNull ClassLoader parentLoader, @NotNull String name, @NotNull byte[] data) {
+ GeneratedClassLoader loader = loaders.computeIfAbsent(parentLoader, GeneratedClassLoader::new);
+ synchronized (loader.getClassLoadingLock(name)) {
+ Preconditions.checkState(!loader.hasClass(name), "%s already defined", name);
+ final Class<?> c = loader.define(name, data);
+ Class<?> c = loader.define(name, data);
+ assert c.getName().equals(name);
+ return c;
+ }
+ }
+
+ private static class GeneratedClassLoader extends ClassLoader {
+
+ static {
+ ClassLoader.registerAsParallelCapable();
+ }
+
+ protected GeneratedClassLoader(final ClassLoader parent) {
+ protected GeneratedClassLoader(@NotNull ClassLoader parent) {
+ super(parent);
+ }
+
+ private Class<?> define(final String name, final byte[] data) {
+ synchronized (this.getClassLoadingLock(name)) {
+ assert !this.hasClass(name);
+ final Class<?> c = this.defineClass(name, data, 0, data.length);
+ this.resolveClass(c);
+ private Class<?> define(@NotNull String name, byte[] data) {
+ synchronized (getClassLoadingLock(name)) {
+ assert !hasClass(name);
+ Class<?> c = defineClass(name, data, 0, data.length);
+ resolveClass(c);
+ return c;
+ }
+ }
+
+ @Override
+ public Object getClassLoadingLock(final String name) {
+ @NotNull
+ public Object getClassLoadingLock(@NotNull String name) {
+ return super.getClassLoadingLock(name);
+ }
+
+ public boolean hasClass(final String name) {
+ synchronized (this.getClassLoadingLock(name)) {
+ public boolean hasClass(@NotNull String name) {
+ synchronized (getClassLoadingLock(name)) {
+ try {
+ Class.forName(name);
+ return true;
+ } catch (final ClassNotFoundException e) {
+ } catch (ClassNotFoundException e) {
+ return false;
+ }
+ }
File diff suppressed because it is too large. Load diff
+30 -34
View File
@@ -6,27 +6,25 @@ Subject: [PATCH] Add Position
diff --git a/src/main/java/io/papermc/paper/math/BlockPosition.java b/src/main/java/io/papermc/paper/math/BlockPosition.java
new file mode 100644
index 0000000000000000000000000000000000000000..c358bfdefc9bc7598dbd0d89a6b0b8a9408b5bb3
index 0000000000000000000000000000000000000000..f0fdabce4af640da2a406412e67020761ded3ac1
--- /dev/null
+++ b/src/main/java/io/papermc/paper/math/BlockPosition.java
@@ -0,0 +1,100 @@
@@ -0,0 +1,98 @@
+package io.papermc.paper.math;
+
+import org.bukkit.Axis;
+import org.bukkit.block.BlockFace;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * A position represented with integers.
+ * <p>
+ * <b>May see breaking changes until Experimental annotation is removed.</b>
+ *
+ * @see FinePosition
+ */
+@ApiStatus.Experimental
+@NullMarked
+public interface BlockPosition extends Position {
+
+ @Override
@@ -55,17 +53,17 @@ index 0000000000000000000000000000000000000000..c358bfdefc9bc7598dbd0d89a6b0b8a9
+ }
+
+ @Override
+ default BlockPosition toBlock() {
+ default @NotNull BlockPosition toBlock() {
+ return this;
+ }
+
+ @Override
+ default BlockPosition offset(final int x, final int y, final int z) {
+ default @NotNull BlockPosition offset(int x, int y, int z) {
+ return x == 0 && y == 0 && z == 0 ? this : new BlockPositionImpl(this.blockX() + x, this.blockY() + y, this.blockZ() + z);
+ }
+
+ @Override
+ default FinePosition offset(final double x, final double y, final double z) {
+ default @NotNull FinePosition offset(double x, double y, double z) {
+ return new FinePositionImpl(this.blockX() + x, this.blockY() + y, this.blockZ() + z);
+ }
+
@@ -76,7 +74,7 @@ index 0000000000000000000000000000000000000000..c358bfdefc9bc7598dbd0d89a6b0b8a9
+ * @return the offset block position
+ */
+ @Contract(value = "_ -> new", pure = true)
+ default BlockPosition offset(final BlockFace blockFace) {
+ default @NotNull BlockPosition offset(@NotNull BlockFace blockFace) {
+ return this.offset(blockFace, 1);
+ }
+
@@ -89,7 +87,7 @@ index 0000000000000000000000000000000000000000..c358bfdefc9bc7598dbd0d89a6b0b8a9
+ * @return the offset block position
+ */
+ @Contract(pure = true)
+ default BlockPosition offset(final BlockFace blockFace, final int amount) {
+ default @NotNull BlockPosition offset(@NotNull BlockFace blockFace, int amount) {
+ return amount == 0 ? this : new BlockPositionImpl(this.blockX() + (blockFace.getModX() * amount), this.blockY() + (blockFace.getModY() * amount), this.blockZ() + (blockFace.getModZ() * amount));
+ }
+
@@ -102,7 +100,7 @@ index 0000000000000000000000000000000000000000..c358bfdefc9bc7598dbd0d89a6b0b8a9
+ * @return the offset block position
+ */
+ @Contract(pure = true)
+ default BlockPosition offset(final Axis axis, final int amount) {
+ default @NotNull BlockPosition offset(@NotNull Axis axis, int amount) {
+ return amount == 0 ? this : switch (axis) {
+ case X -> new BlockPositionImpl(this.blockX() + amount, this.blockY(), this.blockZ());
+ case Y -> new BlockPositionImpl(this.blockX(), this.blockY() + amount, this.blockZ());
@@ -122,25 +120,24 @@ index 0000000000000000000000000000000000000000..eb5a3f26c7ba56c6715827f52c0013a8
+}
diff --git a/src/main/java/io/papermc/paper/math/FinePosition.java b/src/main/java/io/papermc/paper/math/FinePosition.java
new file mode 100644
index 0000000000000000000000000000000000000000..b9c0065d8a9dedc3bd1a2d8bfbedfbc7f952ff93
index 0000000000000000000000000000000000000000..d8df70d731573cf2446044925f218876d62fd7cf
--- /dev/null
+++ b/src/main/java/io/papermc/paper/math/FinePosition.java
@@ -0,0 +1,57 @@
@@ -0,0 +1,56 @@
+package io.papermc.paper.math;
+
+import org.bukkit.util.NumberConversions;
+import org.bukkit.util.Vector;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * A position represented with doubles.
+ * <p>
+ * <b>May see breaking changes until Experimental annotation is removed.</b>
+ *
+ * @see BlockPosition
+ */
+@ApiStatus.Experimental
+@NullMarked
+public interface FinePosition extends Position {
+
+ @Override
@@ -169,17 +166,17 @@ index 0000000000000000000000000000000000000000..b9c0065d8a9dedc3bd1a2d8bfbedfbc7
+ }
+
+ @Override
+ default BlockPosition toBlock() {
+ default @NotNull BlockPosition toBlock() {
+ return new BlockPositionImpl(this.blockX(), this.blockY(), this.blockZ());
+ }
+
+ @Override
+ default FinePosition offset(final int x, final int y, final int z) {
+ default @NotNull FinePosition offset(int x, int y, int z) {
+ return this.offset((double) x, y, z);
+ }
+
+ @Override
+ default FinePosition offset(final double x, final double y, final double z) {
+ default @NotNull FinePosition offset(double x, double y, double z) {
+ return x == 0.0 && y == 0.0 && z == 0.0 ? this : new FinePositionImpl(this.x() + x, this.y() + y, this.z() + z);
+ }
+}
@@ -195,10 +192,10 @@ index 0000000000000000000000000000000000000000..93476aaf8d21efb5a30b6d2cc2eeda81
+}
diff --git a/src/main/java/io/papermc/paper/math/Position.java b/src/main/java/io/papermc/paper/math/Position.java
new file mode 100644
index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06750700c4
index 0000000000000000000000000000000000000000..26bc5a0fa67855af87c8fd4cd8229b4d9f242740
--- /dev/null
+++ b/src/main/java/io/papermc/paper/math/Position.java
@@ -0,0 +1,192 @@
@@ -0,0 +1,191 @@
+package io.papermc.paper.math;
+
+import org.bukkit.Location;
@@ -206,7 +203,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+import org.bukkit.util.Vector;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.Contract;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Common interface for {@link FinePosition} and {@link BlockPosition}.
@@ -214,7 +211,6 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * <b>May see breaking changes until Experimental annotation is removed.</b>
+ */
+@ApiStatus.Experimental
+@NullMarked
+public interface Position {
+
+ FinePosition FINE_ZERO = new FinePositionImpl(0, 0, 0);
@@ -291,7 +287,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @param z z value to offset
+ * @return the offset position
+ */
+ Position offset(int x, int y, int z);
+ @NotNull Position offset(int x, int y, int z);
+
+ /**
+ * Returns a position offset by the specified amounts.
@@ -301,7 +297,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @param z z value to offset
+ * @return the offset position
+ */
+ FinePosition offset(double x, double y, double z);
+ @NotNull FinePosition offset(double x, double y, double z);
+
+ /**
+ * Returns a new position at the center of the block position this represents
@@ -309,7 +305,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return a new center position
+ */
+ @Contract(value = "-> new", pure = true)
+ default FinePosition toCenter() {
+ default @NotNull FinePosition toCenter() {
+ return new FinePositionImpl(this.blockX() + 0.5, this.blockY() + 0.5, this.blockZ() + 0.5);
+ }
+
@@ -320,7 +316,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return the block position
+ */
+ @Contract(pure = true)
+ BlockPosition toBlock();
+ @NotNull BlockPosition toBlock();
+
+ /**
+ * Converts this position to a vector
@@ -328,7 +324,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return a new vector
+ */
+ @Contract(value = "-> new", pure = true)
+ default Vector toVector() {
+ default @NotNull Vector toVector() {
+ return new Vector(this.x(), this.y(), this.z());
+ }
+
@@ -339,7 +335,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return a new location
+ */
+ @Contract(value = "_ -> new", pure = true)
+ default Location toLocation(final World world) {
+ default @NotNull Location toLocation(@NotNull World world) {
+ return new Location(world, this.x(), this.y(), this.z());
+ }
+
@@ -352,7 +348,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return a position with those coords
+ */
+ @Contract(value = "_, _, _ -> new", pure = true)
+ static BlockPosition block(final int x, final int y, final int z) {
+ static @NotNull BlockPosition block(int x, int y, int z) {
+ return new BlockPositionImpl(x, y, z);
+ }
+
@@ -363,7 +359,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return a new position at that location
+ */
+ @Contract(value = "_ -> new", pure = true)
+ static BlockPosition block(final Location location) {
+ static @NotNull BlockPosition block(@NotNull Location location) {
+ return new BlockPositionImpl(location.getBlockX(), location.getBlockY(), location.getBlockZ());
+ }
+
@@ -376,7 +372,7 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return a position with those coords
+ */
+ @Contract(value = "_, _, _ -> new", pure = true)
+ static FinePosition fine(final double x, final double y, final double z) {
+ static @NotNull FinePosition fine(double x, double y, double z) {
+ return new FinePositionImpl(x, y, z);
+ }
+
@@ -387,12 +383,12 @@ index 0000000000000000000000000000000000000000..0e6a6a6738353b118e0ed093994dda06
+ * @return a new position at that location
+ */
+ @Contract(value = "_ -> new", pure = true)
+ static FinePosition fine(final Location location) {
+ static @NotNull FinePosition fine(@NotNull Location location) {
+ return new FinePositionImpl(location.getX(), location.getY(), location.getZ());
+ }
+}
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 734054f1e8dad74c13d7ae0b1c1af2d9f45b2636..bc8a64d54e001eae6ef4520a49e261b96c5ae9f3 100644
index 7c4db051472fb6a6c6d24092dc6f75487356690a..85c342fc50f2fe0ce9a1b3980df9e088c3dea92d 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -20,7 +20,7 @@ import org.jetbrains.annotations.Nullable;
+54 -22
View File
@@ -8,7 +8,7 @@ expose isRunning
diff --git a/src/main/java/co/aikar/timings/FullServerTickHandler.java b/src/main/java/co/aikar/timings/FullServerTickHandler.java
new file mode 100644
index 0000000000000000000000000000000000000000..73b125979e2f2dfd13cbf689a90b29cc68a36e09
index 0000000000000000000000000000000000000000..3e747abde6fefae90f1c15cb00158bc5303cbe50
--- /dev/null
+++ b/src/main/java/co/aikar/timings/FullServerTickHandler.java
@@ -0,0 +1,89 @@
@@ -94,7 +94,7 @@ index 0000000000000000000000000000000000000000..73b125979e2f2dfd13cbf689a90b29cc
+ TimingsManager.HISTORY.add(new TimingHistory());
+ TimingsManager.resetTimings();
+ }
+ //Bukkit.getUnsafe().reportTimings();
+ Bukkit.getUnsafe().reportTimings();
+ }
+
+ boolean isViolated() {
@@ -1275,10 +1275,10 @@ index 0000000000000000000000000000000000000000..df142a89b8c43acb81eb383eac0ef048
+}
diff --git a/src/main/java/co/aikar/timings/Timings.java b/src/main/java/co/aikar/timings/Timings.java
new file mode 100644
index 0000000000000000000000000000000000000000..95b7cdf0677ef71e6885fa78aa5c75bb500f5f53
index 0000000000000000000000000000000000000000..e81d0bc309de877ed2b5da6122f55c162e9b5f10
--- /dev/null
+++ b/src/main/java/co/aikar/timings/Timings.java
@@ -0,0 +1,325 @@
@@ -0,0 +1,331 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -1426,8 +1426,14 @@ index 0000000000000000000000000000000000000000..95b7cdf0677ef71e6885fa78aa5c75bb
+ * @param enabled Should timings be reported
+ */
+ public static void setTimingsEnabled(boolean enabled) {
+ if (enabled && !warnedAboutDeprecationOnEnable) {
+ Bukkit.getLogger().severe(PlainTextComponentSerializer.plainText().serialize(deprecationMessage()));
+ timingsEnabled = enabled;
+ warnAboutDeprecationOnEnable();
+ reset();
+ }
+
+ private static void warnAboutDeprecationOnEnable() {
+ if (timingsEnabled && !warnedAboutDeprecationOnEnable) {
+ Bukkit.getLogger().warning(PlainTextComponentSerializer.plainText().serialize(deprecationMessage()));
+ warnedAboutDeprecationOnEnable = true;
+ }
+ }
@@ -1435,7 +1441,7 @@ index 0000000000000000000000000000000000000000..95b7cdf0677ef71e6885fa78aa5c75bb
+ public static Component deprecationMessage() {
+ return Component.text()
+ .color(TextColor.color(0xffc93a))
+ .append(Component.text("[!] The timings profiler is in no-op mode and will be fully removed in a later update."))
+ .append(Component.text("[!] The timings profiler has been enabled but has been scheduled for removal from Paper in the future."))
+ .append(Component.newline())
+ .append(Component.text(" We recommend migrating to the spark profiler."))
+ .append(Component.newline())
@@ -1606,10 +1612,10 @@ index 0000000000000000000000000000000000000000..95b7cdf0677ef71e6885fa78aa5c75bb
+
diff --git a/src/main/java/co/aikar/timings/TimingsCommand.java b/src/main/java/co/aikar/timings/TimingsCommand.java
new file mode 100644
index 0000000000000000000000000000000000000000..b83e5ff7ada8771fdf27ba9807c77ba6a4ce12da
index 0000000000000000000000000000000000000000..95d87c9dbf2b237787294dfbe7fed87a36e6dedf
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsCommand.java
@@ -0,0 +1,127 @@
@@ -0,0 +1,126 @@
+/*
+ * This file is licensed under the MIT License (MIT).
+ *
@@ -1668,9 +1674,8 @@ index 0000000000000000000000000000000000000000..b83e5ff7ada8771fdf27ba9807c77ba6
+ if (!testPermission(sender)) {
+ return true;
+ }
+ if (true) {
+ if (false) {
+ sender.sendMessage(Timings.deprecationMessage());
+ return true;
+ }
+ if (args.length < 1) {
+ sender.sendMessage(text("Usage: " + this.usageMessage, NamedTextColor.RED));
@@ -2859,7 +2864,7 @@ index 0000000000000000000000000000000000000000..3e61a926620a67daec3af54b72a1b911
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 6391011464ac0c95d4da7fb9c698f35c58b40922..a327c71f110fc0330a3a43ab118565d35801eb32 100644
index fe6c43405e3f11272c1ff015f1dcd47129a68d41..8d729fb196d83e01e4652fb1f77f5cab7b57cc31 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -870,7 +870,6 @@ public final class Bukkit {
@@ -2871,10 +2876,10 @@ index 6391011464ac0c95d4da7fb9c698f35c58b40922..a327c71f110fc0330a3a43ab118565d3
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 01f8e0811f8b337acac31819a85bb44b189b3c21..a1bffe44764fc3e1bb96bf014c56025b0bde7507 100644
index fa6ad07214d5e38866bf6bee9139c6c938e9f51a..57c9b560c77a56588870598acb543469040ceec1 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1978,6 +1978,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1960,6 +1960,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2901,6 +2906,35 @@ index 01f8e0811f8b337acac31819a85bb44b189b3c21..a1bffe44764fc3e1bb96bf014c56025b
/**
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index d8b346fe0f9634218954fe818d53272a0896af9c..12ef99f1c91b92a133611c5f5aeaaeebd02ce232 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -40,6 +40,11 @@ public interface UnsafeValues {
net.kyori.adventure.text.Component resolveWithContext(net.kyori.adventure.text.Component component, org.bukkit.command.CommandSender context, org.bukkit.entity.Entity scoreboardSubject, boolean bypassPermissions) throws java.io.IOException;
// Paper end
+ /**
+ * @deprecated Timings will be removed in the future
+ */
+ @Deprecated(forRemoval = true)
+ void reportTimings(); // Paper
Material toLegacy(Material material);
Material fromLegacy(Material material);
@@ -151,4 +156,12 @@ public interface UnsafeValues {
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
}
// Paper end
+
+ // Paper start
+ /**
+ * @deprecated Timings will be removed in the future
+ */
+ @Deprecated(forRemoval = true)
+ String getTimingsServerName();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/BufferedCommandSender.java b/src/main/java/org/bukkit/command/BufferedCommandSender.java
new file mode 100644
index 0000000000000000000000000000000000000000..45ed63797b13e114bf3795c80a6c3967d8eb2351
@@ -2933,7 +2967,7 @@ index 0000000000000000000000000000000000000000..45ed63797b13e114bf3795c80a6c3967
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 6686d025222dc50156347a1757c88da02f882eec..cee16db367907cfa4b432dc6969f403321a855ea 100644
index f3cdf13f22aa789ee8cc235b61fda4035b254219..17d3da22e8fcdf73a587b17a0cdac3b23ded3567 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -33,7 +33,16 @@ public abstract class Command {
@@ -3450,10 +3484,10 @@ index 516d7fc7812aac343782861d0d567f54aa578c2a..00000000000000000000000000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 64d32c377d0303ed28011a5f002274de3c16b383..a06daeeee71a5ca58fbc1e13453d9116eadbcac2 100644
index 5bcec42a91859002409cab9756999e5adc4c867f..3594b0eb4068c83c93efe948a8ef4ba217edce17 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2771,7 +2771,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2731,7 +2731,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -3474,7 +3508,7 @@ index 64d32c377d0303ed28011a5f002274de3c16b383..a06daeeee71a5ca58fbc1e13453d9116
@NotNull
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index d6f3c8da8bae1f70e0f9bee3e688a04801a3b546..b03f3e0ce9fdb0bb587cf1a1c10b8cfaa2eab09e 100644
index 46c7be5fa69f13900860b9944523beea16f2409b..6018574cd15b802833613beefa88da15dc2730cb 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -381,7 +381,6 @@ public final class SimplePluginManager implements PluginManager {
@@ -3525,11 +3559,9 @@ index d6f3c8da8bae1f70e0f9bee3e688a04801a3b546..b03f3e0ce9fdb0bb587cf1a1c10b8cfa
}
/**
@@ -932,8 +932,9 @@ public final class SimplePluginManager implements PluginManager {
*
@@ -933,7 +933,7 @@ public final class SimplePluginManager implements PluginManager {
* @param use True if per event timing code should be used
*/
+ @Deprecated(forRemoval = true)
public void useTimings(boolean use) {
- useTimings = use;
+ co.aikar.timings.Timings.setTimingsEnabled(use); // Paper
@@ -3537,7 +3569,7 @@ index d6f3c8da8bae1f70e0f9bee3e688a04801a3b546..b03f3e0ce9fdb0bb587cf1a1c10b8cfa
// Paper start
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 70ac93d420d0a8528428a3d038a2ef6a86d2fddd..2e4a0a66151b358cc89d8eea26002f9fda16ee48 100644
index ab04ffe4cd05315a2ee0f64c553b4c674740eb7f..de6b6188587fd254ab96cbc1f95fda2056d9cbe2 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -55,7 +55,6 @@ public final class JavaPluginLoader implements PluginLoader {
@@ -7,7 +7,7 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index a327c71f110fc0330a3a43ab118565d35801eb32..60ad479817c95aef809f73c6688cd6b2a0bb91df 100644
index 6ecab28705afc0e3652677b516d8a5398e8b2666..db51751d2dc1ac419e8fac32466ad3a7727fa2fe 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -83,6 +83,20 @@ public final class Bukkit {
@@ -32,7 +32,7 @@ index a327c71f110fc0330a3a43ab118565d35801eb32..60ad479817c95aef809f73c6688cd6b2
* Attempts to set the {@link Server} singleton.
* <p>
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index a1bffe44764fc3e1bb96bf014c56025b0bde7507..f5005063c33d5e7ac030c4d43cb042c18c799284 100644
index f4b2ad91c7a46af5fc16f31369d155e4e3ab3aae..638e98416fdf7ac065abe058d625b1c924be5abb 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -68,6 +68,18 @@ import org.jetbrains.annotations.Nullable;
@@ -55,7 +55,7 @@ index a1bffe44764fc3e1bb96bf014c56025b0bde7507..f5005063c33d5e7ac030c4d43cb042c1
* Used for all administrative messages, such as an operator using a
* command.
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index b03f3e0ce9fdb0bb587cf1a1c10b8cfaa2eab09e..48b66054913c8b53e6e7fd34615c2ab54727693f 100644
index 6018574cd15b802833613beefa88da15dc2730cb..e7b1895d3918487d711afcbe41d76863d85c0a62 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -117,9 +117,22 @@ public final class SimplePluginManager implements PluginManager {
@@ -82,7 +82,7 @@ index b03f3e0ce9fdb0bb587cf1a1c10b8cfaa2eab09e..48b66054913c8b53e6e7fd34615c2ab5
}
Preconditions.checkArgument(directory != null, "Directory cannot be null");
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index 2e4a0a66151b358cc89d8eea26002f9fda16ee48..b412aaf08901d169ac9fc89b36f9d6ccb95c53d3 100644
index de6b6188587fd254ab96cbc1f95fda2056d9cbe2..eaefbb00e9993d54906cc8cf35cf753c0d6c7707 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -93,7 +93,7 @@ public final class JavaPluginLoader implements PluginLoader {
@@ -5,10 +5,10 @@ Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a06daeeee71a5ca58fbc1e13453d9116eadbcac2..bc64083c02bce93a22521173c9430eb5469ba8a6 100644
index 3594b0eb4068c83c93efe948a8ef4ba217edce17..1ba2f706a62ee6962451305b1895654453b485cd 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2623,6 +2623,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2583,6 +2583,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public String getLocale();
+4 -4
View File
@@ -5,10 +5,10 @@ Subject: [PATCH] Add getTPS method
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 60ad479817c95aef809f73c6688cd6b2a0bb91df..e4f7ff41d7205994fef87989a7955d7b8fe4d7f4 100644
index d978c72cdbc10792f852a4ba372518073893d02b..5780003631beae773231afe3afc6b834bfe1f84d 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2132,6 +2132,17 @@ public final class Bukkit {
@@ -2108,6 +2108,17 @@ public final class Bukkit {
return server.getEntity(uuid);
}
@@ -27,10 +27,10 @@ index 60ad479817c95aef809f73c6688cd6b2a0bb91df..e4f7ff41d7205994fef87989a7955d7b
* Get the advancement specified by this key.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index f5005063c33d5e7ac030c4d43cb042c18c799284..4f15cc4bcc07d3061dd94b20fc77f549ddfcbb6b 100644
index 8949b8e29ae7f412481291630a5cb7b5b8809842..ba28d9f3213ca4b5f15178dc637bff37a8896edc 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1815,6 +1815,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1797,6 +1797,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
Entity getEntity(@NotNull UUID uuid);
@@ -10,21 +10,18 @@ Co-authored-by: Riley Park <rileysebastianpark@gmail.com>
diff --git a/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
new file mode 100644
index 0000000000000000000000000000000000000000..023cc52a9e28e1238c7452c0f3f577f2850fd861
index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c716339346
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/util/VersionFetcher.java
@@ -0,0 +1,47 @@
@@ -0,0 +1,45 @@
+package com.destroystokyo.paper.util;
+
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import org.bukkit.Bukkit;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+@NullMarked
+public interface VersionFetcher {
+
+ /**
+ * Amount of time to cache results for in milliseconds
+ * <p>
@@ -42,9 +39,9 @@ index 0000000000000000000000000000000000000000..023cc52a9e28e1238c7452c0f3f577f2
+ * @param serverVersion the current version of the server (will match {@link Bukkit#getVersion()})
+ * @return the message to show when requesting a version
+ */
+ Component getVersionMessage(String serverVersion);
+ @NotNull
+ Component getVersionMessage(@NotNull String serverVersion);
+
+ @ApiStatus.Internal
+ class DummyVersionFetcher implements VersionFetcher {
+
+ @Override
@@ -52,8 +49,9 @@ index 0000000000000000000000000000000000000000..023cc52a9e28e1238c7452c0f3f577f2
+ return -1;
+ }
+
+ @NotNull
+ @Override
+ public Component getVersionMessage(final String serverVersion) {
+ public Component getVersionMessage(@NotNull String serverVersion) {
+ Bukkit.getLogger().warning("Version provider has not been set, cannot check for updates!");
+ Bukkit.getLogger().info("Override the default implementation of org.bukkit.UnsafeValues#getVersionFetcher()");
+ new Throwable().printStackTrace();
@@ -63,10 +61,10 @@ index 0000000000000000000000000000000000000000..023cc52a9e28e1238c7452c0f3f577f2
+}
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
new file mode 100644
index 0000000000000000000000000000000000000000..652ff54e7c50412503725d628bfe72ed03059790
index 0000000000000000000000000000000000000000..9df9d09aa477d4cd3c496ba0933c816df1ef0964
--- /dev/null
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -0,0 +1,122 @@
@@ -0,0 +1,121 @@
+package io.papermc.paper;
+
+import java.time.Instant;
@@ -75,12 +73,11 @@ index 0000000000000000000000000000000000000000..652ff54e7c50412503725d628bfe72ed
+import net.kyori.adventure.key.Key;
+import net.kyori.adventure.util.Services;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Information about the current server build.
+ */
+@NullMarked
+@ApiStatus.NonExtendable
+public interface ServerBuildInfo {
+ /**
@@ -93,7 +90,7 @@ index 0000000000000000000000000000000000000000..652ff54e7c50412503725d628bfe72ed
+ *
+ * @return the {@code ServerBuildInfo}
+ */
+ static ServerBuildInfo buildInfo() {
+ static @NotNull ServerBuildInfo buildInfo() {
+ //<editor-fold defaultstate="collapsed" desc="Holder">
+ final class Holder {
+ static final Optional<ServerBuildInfo> INSTANCE = Services.service(ServerBuildInfo.class);
@@ -107,7 +104,7 @@ index 0000000000000000000000000000000000000000..652ff54e7c50412503725d628bfe72ed
+ *
+ * @return the brand id of the server (e.g. "papermc:paper")
+ */
+ Key brandId();
+ @NotNull Key brandId();
+
+ /**
+ * Checks if the current server supports the specified brand.
@@ -116,56 +113,56 @@ index 0000000000000000000000000000000000000000..652ff54e7c50412503725d628bfe72ed
+ * @return {@code true} if the server supports the specified brand
+ */
+ @ApiStatus.Experimental
+ boolean isBrandCompatible(final Key brandId);
+ boolean isBrandCompatible(final @NotNull Key brandId);
+
+ /**
+ * Gets the brand name of the server.
+ *
+ * @return the brand name of the server (e.g. "Paper")
+ */
+ String brandName();
+ @NotNull String brandName();
+
+ /**
+ * Gets the Minecraft version id.
+ *
+ * @return the Minecraft version id (e.g. "1.20.4", "1.20.2-pre2", "23w31a")
+ */
+ String minecraftVersionId();
+ @NotNull String minecraftVersionId();
+
+ /**
+ * Gets the Minecraft version name.
+ *
+ * @return the Minecraft version name (e.g. "1.20.4", "1.20.2 Pre-release 2", "23w31a")
+ */
+ String minecraftVersionName();
+ @NotNull String minecraftVersionName();
+
+ /**
+ * Gets the build number.
+ *
+ * @return the build number
+ */
+ OptionalInt buildNumber();
+ @NotNull OptionalInt buildNumber();
+
+ /**
+ * Gets the build time.
+ *
+ * @return the build time
+ */
+ Instant buildTime();
+ @NotNull Instant buildTime();
+
+ /**
+ * Gets the git commit branch.
+ *
+ * @return the git commit branch
+ */
+ Optional<String> gitBranch();
+ @NotNull Optional<String> gitBranch();
+
+ /**
+ * Gets the git commit hash.
+ *
+ * @return the git commit hash
+ */
+ Optional<String> gitCommit();
+ @NotNull Optional<String> gitCommit();
+
+ /**
+ * Creates a string representation of the server build information.
@@ -173,7 +170,7 @@ index 0000000000000000000000000000000000000000..652ff54e7c50412503725d628bfe72ed
+ * @param representation the type of representation
+ * @return a string
+ */
+ String asString(final StringRepresentation representation);
+ @NotNull String asString(final @NotNull StringRepresentation representation);
+
+ /**
+ * String representation types.
@@ -191,10 +188,10 @@ index 0000000000000000000000000000000000000000..652ff54e7c50412503725d628bfe72ed
+}
diff --git a/src/main/java/io/papermc/paper/util/JarManifests.java b/src/main/java/io/papermc/paper/util/JarManifests.java
new file mode 100644
index 0000000000000000000000000000000000000000..7915a70d676b1205dcae39259f670af258a1ab9b
index 0000000000000000000000000000000000000000..909617079db61b675cc7b60b44ef96b306076343
--- /dev/null
+++ b/src/main/java/io/papermc/paper/util/JarManifests.java
@@ -0,0 +1,38 @@
@@ -0,0 +1,37 @@
+package io.papermc.paper.util;
+
+import java.io.IOException;
@@ -205,10 +202,9 @@ index 0000000000000000000000000000000000000000..7915a70d676b1205dcae39259f670af2
+import java.util.WeakHashMap;
+import java.util.jar.Manifest;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@NullMarked
+@ApiStatus.Internal
+public final class JarManifests {
+ private JarManifests() {
@@ -216,7 +212,7 @@ index 0000000000000000000000000000000000000000..7915a70d676b1205dcae39259f670af2
+
+ private static final Map<ClassLoader, Manifest> MANIFESTS = Collections.synchronizedMap(new WeakHashMap<>());
+
+ public static @Nullable Manifest manifest(final Class<?> clazz) {
+ public static @Nullable Manifest manifest(final @NotNull Class<?> clazz) {
+ return MANIFESTS.computeIfAbsent(clazz.getClassLoader(), classLoader -> {
+ final String classLocation = "/" + clazz.getName().replace(".", "/") + ".class";
+ final URL resource = clazz.getResource(classLocation);
@@ -234,7 +230,7 @@ index 0000000000000000000000000000000000000000..7915a70d676b1205dcae39259f670af2
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index e4f7ff41d7205994fef87989a7955d7b8fe4d7f4..75e0c5b884363be03876103e0d66e67de03c4856 100644
index 5780003631beae773231afe3afc6b834bfe1f84d..a005d5f8879262c763d8c4fbd09b9a99810d5e8c 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -110,13 +110,26 @@ public final class Bukkit {
@@ -295,7 +291,7 @@ index e4f7ff41d7205994fef87989a7955d7b8fe4d7f4..75e0c5b884363be03876103e0d66e67d
* Gets a view of all currently logged in players. This {@linkplain
* Collections#unmodifiableCollection(Collection) view} is a reused
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 4f15cc4bcc07d3061dd94b20fc77f549ddfcbb6b..2ed640d5a0027f7a94a5cf4555741c27c9b1b3a4 100644
index ba28d9f3213ca4b5f15178dc637bff37a8896edc..8a07f21eeb04fb54032ce377a1478f60303e1824 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -120,6 +120,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -316,22 +312,21 @@ index 4f15cc4bcc07d3061dd94b20fc77f549ddfcbb6b..2ed640d5a0027f7a94a5cf4555741c27
* Gets a view of all currently logged in players. This {@linkplain
* Collections#unmodifiableCollection(Collection) view} is a reused
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index aec092e019667d53faf3e7352799772804d5d260..012b46c82d9d06d1d2da8da626fc5cde6e9e2ca4 100644
index 12ef99f1c91b92a133611c5f5aeaaeebd02ce232..6e67fdb091a006d2d13bc2d93db4d55348af4c8f 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -156,4 +156,13 @@ public interface UnsafeValues {
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
}
// Paper end
@@ -163,5 +163,12 @@ public interface UnsafeValues {
*/
@Deprecated(forRemoval = true)
String getTimingsServerName();
+
+ // Paper start
+ /**
+ * Called once by the version command on first use, then cached.
+ */
+ default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
+ return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
+ }
+ // Paper end
// Paper end
}
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index 263208d3cba36cb80c9ee4e3022ef702ea113df2..e64bb57f74e6d6f78927be228825b3e0bdf41f48 100644
+2 -2
View File
@@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index d7f95863922bf332c674d538eb187015fadae9d8..411297f66520774a4072c9e15aa9bdf03a527208 100644
index c78fb359bd28b8dc1ba242642ec612e856525993..4e1fb0974d061d5bb64899cac576318d2e6f8bf6 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -791,5 +791,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -25,7 +25,7 @@ index d7f95863922bf332c674d538eb187015fadae9d8..411297f66520774a4072c9e15aa9bdf0
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/FallingBlock.java b/src/main/java/org/bukkit/entity/FallingBlock.java
index 5d7d940cdad7915efa639b8940a17dc97b60ecd8..315dcf9da29e077a819f602ebf1c76286164b264 100644
index d96fd494b523491fcf1ac54d164351fd487f65d6..ae1ce2ee2deb82f3f4144ec54b3ba119b437c5e9 100644
--- a/src/main/java/org/bukkit/entity/FallingBlock.java
+++ b/src/main/java/org/bukkit/entity/FallingBlock.java
@@ -126,4 +126,15 @@ public interface FallingBlock extends Entity {
+3 -3
View File
@@ -8,7 +8,7 @@ Add per player no-tick, tick, and send view distances.
Also add send/no-tick view distance to World.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index ed87e82eb0e30bdea6f7760bb80addcb3bbe59cc..683357f685b1d5f52151a5e78fc5265ebf9d32c2 100644
index 9732929b666b0a5e1a2a41c8e8794cc4f2535e41..0a3a66e04f8785874f10a76603bff46469543688 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2968,6 +2968,66 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -79,10 +79,10 @@ index ed87e82eb0e30bdea6f7760bb80addcb3bbe59cc..683357f685b1d5f52151a5e78fc5265e
* Gets all generated structures that intersect the chunk at the given
* coordinates. <br>
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index bc64083c02bce93a22521173c9430eb5469ba8a6..2073aca572a1b751e895373f32fffba0edf026a5 100644
index 1ba2f706a62ee6962451305b1895654453b485cd..7d530bd0e4d833da760d1cf82aba966b7fb480b1 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2637,6 +2637,82 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2597,6 +2597,82 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param affects Whether the player can affect mob spawning
*/
public void setAffectsSpawning(boolean affects);
+10 -7
View File
@@ -6,10 +6,10 @@ Subject: [PATCH] Add BeaconEffectEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..741d0e73bc635a545c94c4b1254cee8f41ba8925
index 0000000000000000000000000000000000000000..7270c1feece2dc15a4a0503c4bca93a1288f8f13
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/block/BeaconEffectEvent.java
@@ -0,0 +1,88 @@
@@ -0,0 +1,91 @@
+package com.destroystokyo.paper.event.block;
+
+import org.bukkit.block.Block;
@@ -19,12 +19,11 @@ index 0000000000000000000000000000000000000000..741d0e73bc635a545c94c4b1254cee8f
+import org.bukkit.event.block.BlockEvent;
+import org.bukkit.potion.PotionEffect;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when a beacon effect is being applied to a player.
+ */
+@NullMarked
+public class BeaconEffectEvent extends BlockEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
@@ -36,7 +35,7 @@ index 0000000000000000000000000000000000000000..741d0e73bc635a545c94c4b1254cee8f
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public BeaconEffectEvent(final Block block, final PotionEffect effect, final Player player, final boolean primary) {
+ public BeaconEffectEvent(@NotNull Block block, @NotNull PotionEffect effect, @NotNull Player player, boolean primary) {
+ super(block);
+ this.effect = effect;
+ this.player = player;
@@ -48,6 +47,7 @@ index 0000000000000000000000000000000000000000..741d0e73bc635a545c94c4b1254cee8f
+ *
+ * @return Potion effect
+ */
+ @NotNull
+ public PotionEffect getEffect() {
+ return this.effect;
+ }
@@ -57,7 +57,7 @@ index 0000000000000000000000000000000000000000..741d0e73bc635a545c94c4b1254cee8f
+ *
+ * @param effect Potion effect
+ */
+ public void setEffect(final PotionEffect effect) {
+ public void setEffect(@NotNull PotionEffect effect) {
+ this.effect = effect;
+ }
+
@@ -66,6 +66,7 @@ index 0000000000000000000000000000000000000000..741d0e73bc635a545c94c4b1254cee8f
+ *
+ * @return Affected player
+ */
+ @NotNull
+ public Player getPlayer() {
+ return this.player;
+ }
@@ -85,15 +86,17 @@ index 0000000000000000000000000000000000000000..741d0e73bc635a545c94c4b1254cee8f
+ }
+
+ @Override
+ public void setCancelled(final boolean cancel) {
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 75e0c5b884363be03876103e0d66e67de03c4856..81b3800e86bcd20b47df13e9c9ef3a83abfcb7c6 100644
index a005d5f8879262c763d8c4fbd09b9a99810d5e8c..26f3ac9c15ff554becfe8ea53a48f67b2de60ed6 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2361,6 +2361,19 @@ public final class Bukkit {
@@ -2337,6 +2337,19 @@ public final class Bukkit {
return server.getUnsafe();
}
@@ -29,10 +29,10 @@ index 75e0c5b884363be03876103e0d66e67de03c4856..81b3800e86bcd20b47df13e9c9ef3a83
public static Server.Spigot spigot() {
return server.spigot();
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 2ed640d5a0027f7a94a5cf4555741c27c9b1b3a4..1b18d3916f3972675d9371ec5c6e020d70a723f6 100644
index 8a07f21eeb04fb54032ce377a1478f60303e1824..d78481bf17818415524f14417caf86d5684b2235 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1835,6 +1835,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1817,6 +1817,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public double[] getTPS();
// Paper end
@@ -6,7 +6,7 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
Change Javadoc to be accurate
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 81b3800e86bcd20b47df13e9c9ef3a83abfcb7c6..1ada54827acfaacab0a32ae5d55def952547c352 100644
index fe074fe9553f61bdd72b64830532a78415348781..4c5327da1468cb1f9af00a99e7e79f578c47ee2a 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -472,6 +472,30 @@ public final class Bukkit {
@@ -41,7 +41,7 @@ index 81b3800e86bcd20b47df13e9c9ef3a83abfcb7c6..1ada54827acfaacab0a32ae5d55def95
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 1b18d3916f3972675d9371ec5c6e020d70a723f6..93d924c586803161820707af823c352f7c5d40e1 100644
index 9545da2adacaf0bd719c2baef929588cd1042d25..19b75704ed9eee0c929df417e1e5d0ea3718e2f8 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -383,6 +383,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -76,10 +76,10 @@ index 1b18d3916f3972675d9371ec5c6e020d70a723f6..93d924c586803161820707af823c352f
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 2073aca572a1b751e895373f32fffba0edf026a5..17f55697d02d7b9c9b42c4b89a33db9207622a36 100644
index 7d530bd0e4d833da760d1cf82aba966b7fb480b1..f9bacbfa223826b3b54525648080fda306a1ec36 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1254,6 +1254,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1214,6 +1214,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendMap(@NotNull MapView map);
@@ -6,31 +6,30 @@ Subject: [PATCH] Add exception reporting event
diff --git a/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..95a5a59e6bd88345177fca0b12008ddd689cb448
index 0000000000000000000000000000000000000000..9377ee1c2368ce058397037952d17bc010f66957
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/server/ServerExceptionEvent.java
@@ -0,0 +1,43 @@
@@ -0,0 +1,45 @@
+package com.destroystokyo.paper.event.server;
+
+import com.destroystokyo.paper.exception.ServerException;
+import org.bukkit.Bukkit;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import com.destroystokyo.paper.exception.ServerException;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called whenever an exception is thrown in a recoverable section of the server.
+ */
+@NullMarked
+public class ServerExceptionEvent extends Event {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final ServerException exception;
+ @NotNull private final ServerException exception;
+
+ @ApiStatus.Internal
+ public ServerExceptionEvent(final ServerException exception) {
+ public ServerExceptionEvent(@NotNull ServerException exception) {
+ super(!Bukkit.isPrimaryThread());
+ this.exception = exception;
+ }
@@ -40,15 +39,18 @@ index 0000000000000000000000000000000000000000..95a5a59e6bd88345177fca0b12008ddd
+ *
+ * @return Exception thrown
+ */
+ @NotNull
+ public ServerException getException() {
+ return this.exception;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
@@ -494,7 +496,7 @@ index 36fc2c35395c72f8b81a2a2f3265fd205384ce26..c7fa1d235cea78bda4656ed66b8d42b1
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 48b66054913c8b53e6e7fd34615c2ab54727693f..001465eedafa51ac027a4db51cba6223edfe1171 100644
index e7b1895d3918487d711afcbe41d76863d85c0a62..003bece642b682985625db93cad93026352bfc66 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -528,7 +528,8 @@ public final class SimplePluginManager implements PluginManager {
@@ -432,10 +432,10 @@ index 0000000000000000000000000000000000000000..20a028450667edf102b59b6b50ac6e89
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 17f55697d02d7b9c9b42c4b89a33db9207622a36..01fcff92daec5d4bf4b2b9213925cd2604cdec98 100644
index f9bacbfa223826b3b54525648080fda306a1ec36..a0317801b5a41d523324c1482356f26935f6a330 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1288,6 +1288,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1248,6 +1248,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
spigot().sendMessage(position, components);
}
@@ -7,7 +7,7 @@ Upstream added methods for this so the original methods
are now deprecated
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 7afa4674a79f24db6344f02038ed9e2310c9cc66..598c88f02a764abe62f9f10833b2c499a0fb00ff 100644
index 67115810d5e837f154c3accd92dbb5e4192d264f..32e89741ffd895e31af0104a0126c2f72742a1bb 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -243,12 +243,44 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -32,7 +32,8 @@ index 7afa4674a79f24db6344f02038ed9e2310c9cc66..598c88f02a764abe62f9f10833b2c499
*
* @param count amount of arrows in entity's body
+ * @param fireEvent whether to fire the {@link org.bukkit.event.entity.ArrowBodyCountChangeEvent} event
+ */
*/
- public void setArrowsInBody(int count);
+ void setArrowsInBody(int count, boolean fireEvent); // Paper
+
+ // Paper start - Add methods for working with arrows stuck in living entities
@@ -42,8 +43,7 @@ index 7afa4674a79f24db6344f02038ed9e2310c9cc66..598c88f02a764abe62f9f10833b2c499
+ * A value of 0 will cause the server to re-calculate the amount of ticks on the next tick.
+ *
+ * @param ticks Amount of ticks
*/
- public void setArrowsInBody(int count);
+ */
+ void setNextArrowRemoval(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int ticks);
+
+ /**
@@ -56,7 +56,7 @@ index 7afa4674a79f24db6344f02038ed9e2310c9cc66..598c88f02a764abe62f9f10833b2c499
/**
* Returns the living entity's current maximum no damage ticks.
@@ -787,4 +819,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -777,4 +809,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @return Whether the entity is invisible
*/
public boolean isInvisible();
@@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 01fcff92daec5d4bf4b2b9213925cd2604cdec98..cb758b5907aa0c214123550fe14ccfdacbc6b208 100644
index a0317801b5a41d523324c1482356f26935f6a330..47c792202e8cc6d97fcb5e9bed98d327ecc5ab2b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2252,6 +2252,180 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2212,6 +2212,180 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void setResourcePack(@NotNull UUID uuid, @NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt, boolean force);
// Paper end
@@ -6,10 +6,10 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 1ada54827acfaacab0a32ae5d55def952547c352..13fa39ed3d5ffa8a459d68d1e240e869ba42ac32 100644
index bd3fa2bcee24ab7e8f740722f55ed6294fdb294a..d9f84c4a5bc5609e7d9fd0970696a46a32f3f5ff 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2396,6 +2396,13 @@ public final class Bukkit {
@@ -2372,6 +2372,13 @@ public final class Bukkit {
public static org.bukkit.command.CommandMap getCommandMap() {
return server.getCommandMap();
}
@@ -24,10 +24,10 @@ index 1ada54827acfaacab0a32ae5d55def952547c352..13fa39ed3d5ffa8a459d68d1e240e869
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 93d924c586803161820707af823c352f7c5d40e1..6567d1746f5cf16c9f3518203dd9916ff916ca68 100644
index 067eb3a5f5676f3b1b3f49a65df9c4054c48a1e7..990d0d02d1bd95886126efe08e8107322e3199d5 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2096,4 +2096,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2078,4 +2078,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
Spigot spigot();
// Spigot end
@@ -5,7 +5,7 @@ Subject: [PATCH] Custom replacement for eaten items
diff --git a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java
index 36b16b6076321310b6ed60e515064e506b706b58..3208dedfb6769e3e8c2ebeb17c0e02d80adf233a 100644
index 5c054eb531e3caf17c179aff6a712fb8c33d8f77..6110d0417340710333b44312d82c7bd5165a8954 100644
--- a/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerItemConsumeEvent.java
@@ -24,6 +24,7 @@ public class PlayerItemConsumeEvent extends PlayerEvent implements Cancellable {
@@ -6,10 +6,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..11f8540a4752cf4d2112eff48bcca3b935c9f8b1
index 0000000000000000000000000000000000000000..1d8e3c93a139bba11affca74b742269f24300d2c
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityAddToWorldEvent.java
@@ -0,0 +1,44 @@
@@ -0,0 +1,45 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.World;
@@ -18,22 +18,21 @@ index 0000000000000000000000000000000000000000..11f8540a4752cf4d2112eff48bcca3b9
+import org.bukkit.event.entity.CreatureSpawnEvent;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired any time an entity is being added to the world for any reason (including a chunk loading).
+ * <p>
+ * Not to be confused with {@link CreatureSpawnEvent}
+ */
+@NullMarked
+public class EntityAddToWorldEvent extends EntityEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final World world;
+ @NotNull private final World world;
+
+ @ApiStatus.Internal
+ public EntityAddToWorldEvent(final Entity entity, final World world) {
+ public EntityAddToWorldEvent(@NotNull Entity entity, @NotNull World world) {
+ super(entity);
+ this.world = world;
+ }
@@ -41,25 +40,27 @@ index 0000000000000000000000000000000000000000..11f8540a4752cf4d2112eff48bcca3b9
+ /**
+ * @return The world that the entity is being added to
+ */
+ @NotNull
+ public World getWorld() {
+ return this.world;
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..5ad5632d4d47d8b42e4f2af19c0fe6cf94ac5643
index 0000000000000000000000000000000000000000..d75e6a8334c7408ea8c3f155414fc14dc427f190
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityRemoveFromWorldEvent.java
@@ -0,0 +1,42 @@
@@ -0,0 +1,43 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.World;
@@ -67,21 +68,20 @@ index 0000000000000000000000000000000000000000..5ad5632d4d47d8b42e4f2af19c0fe6cf
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Fired any time an entity is being removed from a world for any reason (including a chunk unloading).
+ * Note: The entity is updated prior to this event being called, as such, the entity's world may not be equal to {@link #getWorld()}.
+ */
+@NullMarked
+public class EntityRemoveFromWorldEvent extends EntityEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final World world;
+ @NotNull private final World world;
+
+ @ApiStatus.Internal
+ public EntityRemoveFromWorldEvent(final Entity entity, final World world) {
+ public EntityRemoveFromWorldEvent(@NotNull Entity entity, @NotNull World world) {
+ super(entity);
+ this.world = world;
+ }
@@ -89,15 +89,17 @@ index 0000000000000000000000000000000000000000..5ad5632d4d47d8b42e4f2af19c0fe6cf
+ /**
+ * @return The world that the entity is being removed from
+ */
+ @NotNull
+ public World getWorld() {
+ return this.world;
+ }
+
+ @Override
+ @NotNull
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+15 -12
View File
@@ -7,10 +7,10 @@ Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..8624e0a528985c9b118f5e8a0f33d3286af2fc36
index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee4b29e109
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
@@ -0,0 +1,84 @@
@@ -0,0 +1,87 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.Location;
@@ -19,8 +19,8 @@ index 0000000000000000000000000000000000000000..8624e0a528985c9b118f5e8a0f33d328
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.entity.EntityEvent;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Fired when an Entity decides to start moving towards a location.
@@ -28,17 +28,16 @@ index 0000000000000000000000000000000000000000..8624e0a528985c9b118f5e8a0f33d328
+ * This event does not fire for the entities actual movement. Only when it
+ * is choosing to start moving to a location.
+ */
+@NullMarked
+public class EntityPathfindEvent extends EntityEvent implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final @Nullable Entity targetEntity;
+ private final Location location;
+ @Nullable private final Entity targetEntity;
+ @NotNull private final Location location;
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public EntityPathfindEvent(final Entity entity, final Location location, final @Nullable Entity targetEntity) {
+ public EntityPathfindEvent(@NotNull Entity entity, @NotNull Location location, @Nullable Entity targetEntity) {
+ super(entity);
+ this.targetEntity = targetEntity;
+ this.location = location;
@@ -49,7 +48,7 @@ index 0000000000000000000000000000000000000000..8624e0a528985c9b118f5e8a0f33d328
+ *
+ * @return The Entity that is pathfinding.
+ */
+ @Override
+ @NotNull
+ public Entity getEntity() {
+ return this.entity;
+ }
@@ -57,11 +56,12 @@ index 0000000000000000000000000000000000000000..8624e0a528985c9b118f5e8a0f33d328
+ /**
+ * If the Entity is trying to pathfind to an entity, this is the entity in relation.
+ * <br>
+ * Otherwise, this will return {@code null}.
+ * Otherwise this will return {@code null}.
+ *
+ * @return The entity target or {@code null}
+ */
+ public @Nullable Entity getTargetEntity() {
+ @Nullable
+ public Entity getTargetEntity() {
+ return this.targetEntity;
+ }
+
@@ -72,6 +72,7 @@ index 0000000000000000000000000000000000000000..8624e0a528985c9b118f5e8a0f33d328
+ *
+ * @return Location of where the entity is trying to pathfind to.
+ */
+ @NotNull
+ public Location getLoc() {
+ return this.location.clone();
+ }
@@ -82,15 +83,17 @@ index 0000000000000000000000000000000000000000..8624e0a528985c9b118f5e8a0f33d328
+ }
+
+ @Override
+ public void setCancelled(final boolean cancel) {
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
@@ -10,10 +10,10 @@ Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..9ff2bbf7f99df45cc626cad60bec4d14a8a04e3e
index 0000000000000000000000000000000000000000..dbb635686e9108b9d3df5d373e6972cca07c0621
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
@@ -0,0 +1,85 @@
@@ -0,0 +1,86 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.entity.Player;
@@ -23,8 +23,8 @@ index 0000000000000000000000000000000000000000..9ff2bbf7f99df45cc626cad60bec4d14
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.util.Vector;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Represents an event that is called when a player right-clicks an unknown entity.
@@ -33,18 +33,17 @@ index 0000000000000000000000000000000000000000..9ff2bbf7f99df45cc626cad60bec4d14
+ * This event may be called multiple times per interaction with different interaction hands
+ * and with or without the clicked position.
+ */
+@NullMarked
+public class PlayerUseUnknownEntityEvent extends PlayerEvent {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final int entityId;
+ private final boolean attack;
+ private final EquipmentSlot hand;
+ private final @NotNull EquipmentSlot hand;
+ private final @Nullable Vector clickedPosition;
+
+ @ApiStatus.Internal
+ public PlayerUseUnknownEntityEvent(final Player player, final int entityId, final boolean attack, final EquipmentSlot hand, final @Nullable Vector clickedPosition) {
+ public PlayerUseUnknownEntityEvent(@NotNull Player player, int entityId, boolean attack, @NotNull EquipmentSlot hand, @Nullable Vector clickedPosition) {
+ super(player);
+ this.entityId = entityId;
+ this.attack = attack;
@@ -75,7 +74,7 @@ index 0000000000000000000000000000000000000000..9ff2bbf7f99df45cc626cad60bec4d14
+ *
+ * @return the hand used to interact
+ */
+ public EquipmentSlot getHand() {
+ public @NotNull EquipmentSlot getHand() {
+ return this.hand;
+ }
+
@@ -90,11 +89,13 @@ index 0000000000000000000000000000000000000000..9ff2bbf7f99df45cc626cad60bec4d14
+ return this.clickedPosition != null ? this.clickedPosition.clone() : null;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
@@ -7,14 +7,13 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a0b953c45
index 0000000000000000000000000000000000000000..7c049bad187b94331f42f96833d1cf4ce03ef477
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerHandshakeEvent.java
@@ -0,0 +1,257 @@
@@ -0,0 +1,267 @@
+package com.destroystokyo.paper.event.player;
+
+import com.google.common.base.Preconditions;
+import java.util.UUID;
+import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.format.NamedTextColor;
+import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -22,8 +21,10 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.ApiStatus;
+import org.jspecify.annotations.NullMarked;
+import org.jspecify.annotations.Nullable;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.UUID;
+
+/**
+ * This event is fired during a player handshake.
@@ -33,17 +34,16 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * <p>WARNING: TAMPERING WITH THIS EVENT CAN BE DANGEROUS</p>
+ */
+@NullMarked
+public class PlayerHandshakeEvent extends Event implements Cancellable {
+
+ private static final HandlerList HANDLER_LIST = new HandlerList();
+
+ private final String originalHandshake;
+ private final String originalSocketAddressHostname;
+ private @Nullable String serverHostname;
+ private @Nullable String socketAddressHostname;
+ private @Nullable UUID uniqueId;
+ private @Nullable String propertiesJson;
+ @NotNull private final String originalHandshake;
+ @NotNull private final String originalSocketAddressHostname;
+ @Nullable private String serverHostname;
+ @Nullable private String socketAddressHostname;
+ @Nullable private UUID uniqueId;
+ @Nullable private String propertiesJson;
+ private boolean failed;
+ private Component failMessage = Component.text("If you wish to use IP forwarding, please enable it in your BungeeCord config as well!", NamedTextColor.YELLOW);
+
@@ -51,12 +51,12 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+
+ @Deprecated
+ @ApiStatus.Internal
+ public PlayerHandshakeEvent(final String originalHandshake, final boolean cancelled) {
+ public PlayerHandshakeEvent(@NotNull String originalHandshake, boolean cancelled) {
+ this(originalHandshake, "127.0.0.1", cancelled);
+ }
+
+ @ApiStatus.Internal
+ public PlayerHandshakeEvent(final String originalHandshake, final String originalSocketAddressHostname, final boolean cancelled) {
+ public PlayerHandshakeEvent(@NotNull String originalHandshake, @NotNull String originalSocketAddressHostname, boolean cancelled) {
+ super(true);
+ this.originalHandshake = originalHandshake;
+ this.originalSocketAddressHostname = originalSocketAddressHostname;
@@ -85,7 +85,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ * @param cancel {@code true} if this event is cancelled, {@code false} otherwise
+ */
+ @Override
+ public void setCancelled(final boolean cancel) {
+ public void setCancelled(boolean cancel) {
+ this.cancelled = cancel;
+ }
+
@@ -94,6 +94,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @return the original handshake string
+ */
+ @NotNull
+ public String getOriginalHandshake() {
+ return this.originalHandshake;
+ }
@@ -106,6 +107,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @return the original socket address hostname
+ */
+ @NotNull
+ public String getOriginalSocketAddressHostname() {
+ return this.originalSocketAddressHostname;
+ }
@@ -117,7 +119,8 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @return the server hostname string
+ */
+ public @Nullable String getServerHostname() {
+ @Nullable
+ public String getServerHostname() {
+ return this.serverHostname;
+ }
+
@@ -128,7 +131,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @param serverHostname the server hostname string
+ */
+ public void setServerHostname(final String serverHostname) {
+ public void setServerHostname(@NotNull String serverHostname) {
+ this.serverHostname = serverHostname;
+ }
+
@@ -139,7 +142,8 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @return the socket address hostname string
+ */
+ public @Nullable String getSocketAddressHostname() {
+ @Nullable
+ public String getSocketAddressHostname() {
+ return this.socketAddressHostname;
+ }
+
@@ -150,7 +154,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @param socketAddressHostname the socket address hostname string
+ */
+ public void setSocketAddressHostname(final String socketAddressHostname) {
+ public void setSocketAddressHostname(@NotNull String socketAddressHostname) {
+ this.socketAddressHostname = socketAddressHostname;
+ }
+
@@ -159,7 +163,8 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @return the unique id
+ */
+ public @Nullable UUID getUniqueId() {
+ @Nullable
+ public UUID getUniqueId() {
+ return this.uniqueId;
+ }
+
@@ -168,7 +173,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @param uniqueId the unique id
+ */
+ public void setUniqueId(final UUID uniqueId) {
+ public void setUniqueId(@NotNull UUID uniqueId) {
+ this.uniqueId = uniqueId;
+ }
+
@@ -179,7 +184,8 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @return the profile properties, as JSON
+ */
+ public @Nullable String getPropertiesJson() {
+ @Nullable
+ public String getPropertiesJson() {
+ return this.propertiesJson;
+ }
+
@@ -203,7 +209,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @param failed {@code true} if authentication failed, {@code false} otherwise
+ */
+ public void setFailed(final boolean failed) {
+ public void setFailed(boolean failed) {
+ this.failed = failed;
+ }
+
@@ -214,7 +220,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @param propertiesJson the profile properties, as JSON
+ */
+ public void setPropertiesJson(final String propertiesJson) {
+ public void setPropertiesJson(@NotNull String propertiesJson) {
+ this.propertiesJson = propertiesJson;
+ }
+
@@ -223,6 +229,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @return the message to display to the client
+ */
+ @NotNull
+ public Component failMessage() {
+ return this.failMessage;
+ }
@@ -232,7 +239,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ *
+ * @param failMessage the message to display to the client
+ */
+ public void failMessage(final Component failMessage) {
+ public void failMessage(@NotNull Component failMessage) {
+ this.failMessage = failMessage;
+ }
+
@@ -242,6 +249,7 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ * @return the message to display to the client
+ * @deprecated use {@link #failMessage()}
+ */
+ @NotNull
+ @Deprecated
+ public String getFailMessage() {
+ return LegacyComponentSerializer.legacySection().serialize(this.failMessage());
@@ -254,16 +262,18 @@ index 0000000000000000000000000000000000000000..aea04fb357f5728195fd9c9bdcd6304a
+ * @deprecated use {@link #failMessage(Component)}
+ */
+ @Deprecated
+ public void setFailMessage(final String failMessage) {
+ public void setFailMessage(@NotNull String failMessage) {
+ Preconditions.checkArgument(failMessage != null && !failMessage.isEmpty(), "fail message cannot be null or empty");
+ this.failMessage(LegacyComponentSerializer.legacySection().deserialize(failMessage));
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return HANDLER_LIST;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return HANDLER_LIST;
+ }
+1 -1
View File
@@ -5,7 +5,7 @@ Subject: [PATCH] Arrow pickup rule API
diff --git a/src/main/java/org/bukkit/entity/AbstractArrow.java b/src/main/java/org/bukkit/entity/AbstractArrow.java
index 9cebf79b6217063fbce395b655261ee4ab0f4e45..c901990454ec930169b0dc561987bea101f9b6ae 100644
index 4d9938249684b7db01b78baf4eeeaa2e0638a963..493f81ba879d1eb29a32722da27e4ff7ce4c68a8 100644
--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
+++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
@@ -186,4 +186,38 @@ public interface AbstractArrow extends Projectile {
Loaded 100 of 2573 files, more files were not shown because too many files have changed in this diff. Show more