Compare commits

..
1392 changed files with 29804 additions and 33078 deletions

No files matched your search

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