Update to 1.21.11-pre3 (#13194)

Co-authored-by: roro1506HD <[email protected]>
Co-authored-by: Owen1212055 <[email protected]>
Co-authored-by: Lulu13022002 <[email protected]>
Co-authored-by: Pedro <[email protected]>
Co-authored-by: Doc <[email protected]>
Co-authored-by: Miles <[email protected]>
Co-authored-by: Bjarne Koll <[email protected]>
This commit is contained in:
Jason Penilla
2025-11-26 10:18:28 -07:00
committed by GitHub
co-authored by roro1506HD Owen1212055 Lulu13022002 Pedro Doc Miles Bjarne Koll
parent f8cf03d68c
commit a2c9f58a8a
978 changed files with 11320 additions and 8017 deletions
+24
View File
@@ -192,6 +192,30 @@ and your server.
While we will fix minor formatting issues, you should stick to the guide below
when making and submitting changes.
### Branches and Minecraft Versions
Generally, PRs should be targeted at the `main` branch, where active development for
the latest Minecraft release happens.
If a new Minecraft release is imminent, it may be wise to wait until it's released
and merged to `main` to avoid having to rebase your PR, as the `main` branch will be
frozen during this time (you can ask in the Paper Discord if you're unsure).
For old Minecraft versions - we are unlikely to accept PRs targeting any versions not
marked as supported at https://fill-ui.papermc.io/projects/paper.
For snapshots and other pre-release versions - you should only target these branches
for changes specific to features or changes in those versions. For example, if Copper
Golem is going to be added in 1.21.9, you can PR to the relevant dev branch as it would
not make sense to merge that into `main`. Or, if you are fixing a bug that only exists in
a dev branch, you should target that branch. When submitting PRs to dev branches, please
coordinate with the dev team in Discord or open an issue before starting work to ensure
it's an area we want to accept changes for. The team prefers to handle initial updating
work through to the server running ourselves, so do not attempt to PR version updates
(i.e. 25w42a -> 25w43a, etc.) or while there are still unapplied source patches. Feature
patches are also not applied until at earliest the pre-release phase to avoid unnecessary
churn.
## Formatting
All modifications to Vanilla files should be marked. For historical reasons,
+113 -118
View File
@@ -9,7 +9,6 @@ private-f net.minecraft.world.level.block.entity.BeehiveBlockEntity stored
protected net.minecraft.world.entity.LivingEntity skipDropExperience
protected-f net.minecraft.server.MinecraftServer worldData
public net.minecraft.ChatFormatting code
public net.minecraft.Util onThreadException(Ljava/lang/Thread;Ljava/lang/Throwable;)V
public net.minecraft.advancements.Advancement decorateName(Lnet/minecraft/advancements/DisplayInfo;)Lnet/minecraft/network/chat/Component;
public net.minecraft.commands.CommandSourceStack source
public net.minecraft.commands.arguments.DimensionArgument ERROR_INVALID_VALUE
@@ -21,8 +20,6 @@ public net.minecraft.network.Connection address
public net.minecraft.network.Connection channel
public net.minecraft.network.chat.TextColor name
public net.minecraft.network.chat.contents.TranslatableContents filterAllowedArguments(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult;
public net.minecraft.network.chat.numbers.FixedFormat value
public net.minecraft.network.chat.numbers.StyledFormat style
public net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket <init>(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/entity/BlockEntityType;Lnet/minecraft/nbt/CompoundTag;)V
public net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket blockState
public net.minecraft.network.protocol.game.ServerboundMovePlayerPacket hasPos
@@ -120,6 +117,7 @@ public net.minecraft.stats.ServerRecipeBook known
public net.minecraft.tags.TagEntry id
public net.minecraft.tags.TagEntry required
public net.minecraft.tags.TagEntry tag
public net.minecraft.util.Util onThreadException(Ljava/lang/Thread;Ljava/lang/Throwable;)V
public net.minecraft.util.datafix.fixes.BlockStateData register(ILcom/mojang/serialization/Dynamic;[Lcom/mojang/serialization/Dynamic;)V
public net.minecraft.util.datafix.fixes.ItemIdFix ITEM_NAMES
public net.minecraft.util.datafix.fixes.ItemSpawnEggFix ID_TO_ENTITY
@@ -209,7 +207,6 @@ public net.minecraft.world.entity.Entity unsetRemoved()V
public net.minecraft.world.entity.Entity wasTouchingWater
public net.minecraft.world.entity.ExperienceOrb count
public net.minecraft.world.entity.ExperienceOrb setValue(I)V
public net.minecraft.world.entity.GlowSquid setDarkTicks(I)V
public net.minecraft.world.entity.Interaction attack
public net.minecraft.world.entity.Interaction getHeight()F
public net.minecraft.world.entity.Interaction getResponse()Z
@@ -260,70 +257,72 @@ public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips
public net.minecraft.world.entity.ai.gossip.GossipContainer$EntityGossips <init>()V
public net.minecraft.world.entity.ai.navigation.PathNavigation pathFinder
public net.minecraft.world.entity.ambient.Bat targetPosition
public net.minecraft.world.entity.animal.AbstractSchoolingFish leader
public net.minecraft.world.entity.animal.AbstractSchoolingFish schoolSize
public net.minecraft.world.entity.animal.Animal inLove
public net.minecraft.world.entity.animal.Animal loveCause
public net.minecraft.world.entity.animal.Bee hivePos
public net.minecraft.world.entity.animal.Bee isRolling()Z
public net.minecraft.world.entity.animal.Bee numCropsGrownSincePollination
public net.minecraft.world.entity.animal.Bee setHasNectar(Z)V
public net.minecraft.world.entity.animal.Bee setHasStung(Z)V
public net.minecraft.world.entity.animal.Bee setRolling(Z)V
public net.minecraft.world.entity.animal.Bee stayOutOfHiveCountdown
public net.minecraft.world.entity.animal.Bee ticksWithoutNectarSinceExitingHive
public net.minecraft.world.entity.animal.Bee timeSinceSting
public net.minecraft.world.entity.animal.Cat isRelaxStateOne()Z
public net.minecraft.world.entity.animal.Cat setCollarColor(Lnet/minecraft/world/item/DyeColor;)V
public net.minecraft.world.entity.animal.Cat setRelaxStateOne(Z)V
public net.minecraft.world.entity.animal.Cat setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.Dolphin treasurePos
public net.minecraft.world.entity.animal.Fox DATA_TRUSTED_ID_0
public net.minecraft.world.entity.animal.Fox DATA_TRUSTED_ID_1
public net.minecraft.world.entity.animal.Fox isDefending()Z
public net.minecraft.world.entity.animal.Fox setDefending(Z)V
public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V
public net.minecraft.world.entity.animal.Fox setSleeping(Z)V
public net.minecraft.world.entity.animal.Fox setVariant(Lnet/minecraft/world/entity/animal/Fox$Variant;)V
public net.minecraft.world.entity.animal.MushroomCow setVariant(Lnet/minecraft/world/entity/animal/MushroomCow$Variant;)V
public net.minecraft.world.entity.animal.MushroomCow stewEffects
public net.minecraft.world.entity.animal.Ocelot isTrusting()Z
public net.minecraft.world.entity.animal.Ocelot setTrusting(Z)V
public net.minecraft.world.entity.animal.Panda getEatCounter()I
public net.minecraft.world.entity.animal.Panda setEatCounter(I)V
public net.minecraft.world.entity.animal.Parrot setVariant(Lnet/minecraft/world/entity/animal/Parrot$Variant;)V
public net.minecraft.world.entity.animal.Pig setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.Pig steering
public net.minecraft.world.entity.animal.Rabbit moreCarrotTicks
public net.minecraft.world.entity.animal.Rabbit registerGoals()V
public net.minecraft.world.entity.animal.Rabbit setVariant(Lnet/minecraft/world/entity/animal/Rabbit$Variant;)V
public net.minecraft.world.entity.animal.Salmon setVariant(Lnet/minecraft/world/entity/animal/Salmon$Variant;)V
public net.minecraft.world.entity.animal.TropicalFish getPackedVariant()I
public net.minecraft.world.entity.animal.TropicalFish setPackedVariant(I)V
public net.minecraft.world.entity.animal.Turtle goingHome
public net.minecraft.world.entity.animal.Turtle homePos
public net.minecraft.world.entity.animal.Turtle setHasEgg(Z)V
public net.minecraft.world.entity.animal.allay.Allay canDuplicate()Z
public net.minecraft.world.entity.animal.allay.Allay duplicateAllay()V
public net.minecraft.world.entity.animal.allay.Allay duplicationCooldown
public net.minecraft.world.entity.animal.allay.Allay jukeboxPos
public net.minecraft.world.entity.animal.allay.Allay resetDuplicationCooldown()V
public net.minecraft.world.entity.animal.axolotl.Axolotl setVariant(Lnet/minecraft/world/entity/animal/axolotl/Axolotl$Variant;)V
public net.minecraft.world.entity.animal.bee.Bee hivePos
public net.minecraft.world.entity.animal.bee.Bee isRolling()Z
public net.minecraft.world.entity.animal.bee.Bee numCropsGrownSincePollination
public net.minecraft.world.entity.animal.bee.Bee setHasNectar(Z)V
public net.minecraft.world.entity.animal.bee.Bee setHasStung(Z)V
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.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
public net.minecraft.world.entity.animal.equine.AbstractHorse createInventory()V
public net.minecraft.world.entity.animal.equine.AbstractHorse inventory
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 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 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
public net.minecraft.world.entity.animal.fish.AbstractSchoolingFish leader
public net.minecraft.world.entity.animal.fish.AbstractSchoolingFish schoolSize
public net.minecraft.world.entity.animal.fish.Salmon setVariant(Lnet/minecraft/world/entity/animal/fish/Salmon$Variant;)V
public net.minecraft.world.entity.animal.fish.TropicalFish getPackedVariant()I
public net.minecraft.world.entity.animal.fish.TropicalFish setPackedVariant(I)V
public net.minecraft.world.entity.animal.fox.Fox DATA_TRUSTED_ID_0
public net.minecraft.world.entity.animal.fox.Fox DATA_TRUSTED_ID_1
public net.minecraft.world.entity.animal.fox.Fox isDefending()Z
public net.minecraft.world.entity.animal.fox.Fox setDefending(Z)V
public net.minecraft.world.entity.animal.fox.Fox setFaceplanted(Z)V
public net.minecraft.world.entity.animal.fox.Fox setSleeping(Z)V
public net.minecraft.world.entity.animal.fox.Fox setVariant(Lnet/minecraft/world/entity/animal/fox/Fox$Variant;)V
public net.minecraft.world.entity.animal.frog.Frog setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.frog.Tadpole age
public net.minecraft.world.entity.animal.goat.Goat DATA_HAS_LEFT_HORN
public net.minecraft.world.entity.animal.goat.Goat DATA_HAS_RIGHT_HORN
public net.minecraft.world.entity.animal.horse.AbstractHorse createInventory()V
public net.minecraft.world.entity.animal.horse.AbstractHorse inventory
public net.minecraft.world.entity.animal.horse.AbstractHorse owner
public net.minecraft.world.entity.animal.horse.Horse setVariantAndMarkings(Lnet/minecraft/world/entity/animal/horse/Variant;Lnet/minecraft/world/entity/animal/horse/Markings;)V
public net.minecraft.world.entity.animal.horse.Llama setVariant(Lnet/minecraft/world/entity/animal/horse/Llama$Variant;)V
public net.minecraft.world.entity.animal.horse.SkeletonHorse trapTime
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 setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.animal.pig.Pig steering
public net.minecraft.world.entity.animal.rabbit.Rabbit moreCarrotTicks
public net.minecraft.world.entity.animal.rabbit.Rabbit registerGoals()V
public net.minecraft.world.entity.animal.rabbit.Rabbit setVariant(Lnet/minecraft/world/entity/animal/rabbit/Rabbit$Variant;)V
public net.minecraft.world.entity.animal.sniffer.Sniffer calculateDigPosition()Ljava/util/Optional;
public net.minecraft.world.entity.animal.sniffer.Sniffer canDig()Z
public net.minecraft.world.entity.animal.sniffer.Sniffer getExploredPositions()Ljava/util/stream/Stream;
public net.minecraft.world.entity.animal.sniffer.Sniffer getState()Lnet/minecraft/world/entity/animal/sniffer/Sniffer$State;
public net.minecraft.world.entity.animal.sniffer.Sniffer storeExploredPosition(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/entity/animal/sniffer/Sniffer;
public net.minecraft.world.entity.animal.squid.GlowSquid setDarkTicks(I)V
public net.minecraft.world.entity.animal.turtle.Turtle goingHome
public net.minecraft.world.entity.animal.turtle.Turtle homePos
public net.minecraft.world.entity.animal.turtle.Turtle setHasEgg(Z)V
public net.minecraft.world.entity.animal.wolf.Wolf getSoundVariant()Lnet/minecraft/core/Holder;
public net.minecraft.world.entity.animal.wolf.Wolf getVariant()Lnet/minecraft/core/Holder;
public net.minecraft.world.entity.animal.wolf.Wolf isWet
@@ -351,7 +350,7 @@ public net.minecraft.world.entity.decoration.Mannequin setDescription(Lnet/minec
public net.minecraft.world.entity.decoration.Mannequin setHideDescription(Z)V
public net.minecraft.world.entity.decoration.Mannequin setImmovable(Z)V
public net.minecraft.world.entity.decoration.Mannequin setProfile(Lnet/minecraft/world/item/component/ResolvableProfile;)V
public net.minecraft.world.entity.decoration.Painting setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.decoration.painting.Painting setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
public net.minecraft.world.entity.item.FallingBlockEntity blockState
public net.minecraft.world.entity.item.FallingBlockEntity cancelDrop
@@ -373,14 +372,11 @@ public net.minecraft.world.entity.monster.Creeper swell
public net.minecraft.world.entity.monster.EnderMan teleport()Z
public net.minecraft.world.entity.monster.EnderMan teleportTowards(Lnet/minecraft/world/entity/Entity;)Z
public net.minecraft.world.entity.monster.Endermite life
public net.minecraft.world.entity.monster.Evoker getWololoTarget()Lnet/minecraft/world/entity/animal/sheep/Sheep;
public net.minecraft.world.entity.monster.Evoker setWololoTarget(Lnet/minecraft/world/entity/animal/sheep/Sheep;)V
public net.minecraft.world.entity.monster.Guardian randomStrollGoal
public net.minecraft.world.entity.monster.Guardian setActiveAttackTarget(I)V
public net.minecraft.world.entity.monster.Guardian$GuardianAttackGoal
public net.minecraft.world.entity.monster.Guardian$GuardianAttackGoal attackTime
public net.minecraft.world.entity.monster.Phantom anchorPoint
public net.minecraft.world.entity.monster.Pillager inventory
public net.minecraft.world.entity.monster.Ravager attackTick
public net.minecraft.world.entity.monster.Ravager roarTick
public net.minecraft.world.entity.monster.Ravager stunnedTick
@@ -388,44 +384,46 @@ public net.minecraft.world.entity.monster.Shulker DATA_COLOR_ID
public net.minecraft.world.entity.monster.Shulker getRawPeekAmount()I
public net.minecraft.world.entity.monster.Shulker setAttachFace(Lnet/minecraft/core/Direction;)V
public net.minecraft.world.entity.monster.Shulker setRawPeekAmount(I)V
public net.minecraft.world.entity.monster.Skeleton DATA_STRAY_CONVERSION_ID
public net.minecraft.world.entity.monster.Skeleton conversionTime
public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
public net.minecraft.world.entity.monster.SpellcasterIllager getCurrentSpell()Lnet/minecraft/world/entity/monster/SpellcasterIllager$IllagerSpell;
public net.minecraft.world.entity.monster.SpellcasterIllager$IllagerSpell
public net.minecraft.world.entity.monster.Strider steering
public net.minecraft.world.entity.monster.Vex hasLimitedLife
public net.minecraft.world.entity.monster.Vex limitedLifeTicks
public net.minecraft.world.entity.monster.Vex owner
public net.minecraft.world.entity.monster.Vindicator DOOR_BREAKING_PREDICATE
public net.minecraft.world.entity.monster.Vindicator isJohnny
public net.minecraft.world.entity.monster.Witch usingTime
public net.minecraft.world.entity.monster.Zombie DATA_DROWNED_CONVERSION_ID
public net.minecraft.world.entity.monster.Zombie DOOR_BREAKING_PREDICATE
public net.minecraft.world.entity.monster.Zombie conversionTime
public net.minecraft.world.entity.monster.Zombie isSunSensitive()Z
public net.minecraft.world.entity.monster.Zombie startUnderWaterConversion(I)V
public net.minecraft.world.entity.monster.ZombieVillager DATA_CONVERTING_ID
public net.minecraft.world.entity.monster.ZombieVillager conversionStarter
public net.minecraft.world.entity.monster.ZombieVillager startConverting(Ljava/util/UUID;I)V
public net.minecraft.world.entity.monster.ZombieVillager villagerConversionTime
public net.minecraft.world.entity.monster.hoglin.Hoglin cannotBeHunted
public net.minecraft.world.entity.monster.hoglin.Hoglin isImmuneToZombification()Z
public net.minecraft.world.entity.monster.hoglin.Hoglin timeInOverworld
public net.minecraft.world.entity.monster.illager.Evoker getWololoTarget()Lnet/minecraft/world/entity/animal/sheep/Sheep;
public net.minecraft.world.entity.monster.illager.Evoker setWololoTarget(Lnet/minecraft/world/entity/animal/sheep/Sheep;)V
public net.minecraft.world.entity.monster.illager.Pillager inventory
public net.minecraft.world.entity.monster.illager.SpellcasterIllager getCurrentSpell()Lnet/minecraft/world/entity/monster/illager/SpellcasterIllager$IllagerSpell;
public net.minecraft.world.entity.monster.illager.SpellcasterIllager$IllagerSpell
public net.minecraft.world.entity.monster.illager.Vindicator DOOR_BREAKING_PREDICATE
public net.minecraft.world.entity.monster.illager.Vindicator isJohnny
public net.minecraft.world.entity.monster.piglin.AbstractPiglin isImmuneToZombification()Z
public net.minecraft.world.entity.monster.piglin.AbstractPiglin timeInOverworld
public net.minecraft.world.entity.monster.piglin.Piglin cannotHunt
public net.minecraft.world.entity.monster.piglin.Piglin inventory
public net.minecraft.world.entity.monster.piglin.Piglin isChargingCrossbow()Z
public net.minecraft.world.entity.monster.skeleton.Skeleton DATA_STRAY_CONVERSION_ID
public net.minecraft.world.entity.monster.skeleton.Skeleton conversionTime
public net.minecraft.world.entity.monster.skeleton.Skeleton inPowderSnowTime
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker cooldownTicks
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker increaseWarningLevel()V
public net.minecraft.world.entity.monster.warden.WardenSpawnTracker ticksSinceLastWarning
public net.minecraft.world.entity.npc.Villager increaseMerchantCareer()V
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
public net.minecraft.world.entity.npc.Villager releaseAllPois()V
public net.minecraft.world.entity.npc.Villager setUnhappy()V
public net.minecraft.world.entity.npc.Villager updateDemand()V
public net.minecraft.world.entity.npc.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos;
public net.minecraft.world.entity.monster.zombie.Zombie DATA_DROWNED_CONVERSION_ID
public net.minecraft.world.entity.monster.zombie.Zombie DOOR_BREAKING_PREDICATE
public net.minecraft.world.entity.monster.zombie.Zombie conversionTime
public net.minecraft.world.entity.monster.zombie.Zombie isSunSensitive()Z
public net.minecraft.world.entity.monster.zombie.Zombie startUnderWaterConversion(I)V
public net.minecraft.world.entity.monster.zombie.ZombieVillager DATA_CONVERTING_ID
public net.minecraft.world.entity.monster.zombie.ZombieVillager conversionStarter
public net.minecraft.world.entity.monster.zombie.ZombieVillager startConverting(Ljava/util/UUID;I)V
public net.minecraft.world.entity.monster.zombie.ZombieVillager villagerConversionTime
public net.minecraft.world.entity.npc.villager.Villager numberOfRestocksToday
public net.minecraft.world.entity.npc.villager.Villager releaseAllPois()V
public net.minecraft.world.entity.npc.villager.Villager setUnhappy()V
public net.minecraft.world.entity.npc.villager.Villager updateDemand()V
public net.minecraft.world.entity.npc.wanderingtrader.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos;
public net.minecraft.world.entity.player.Abilities flyingSpeed
public net.minecraft.world.entity.player.Abilities walkingSpeed
public net.minecraft.world.entity.player.Inventory equipment
@@ -435,20 +433,6 @@ public net.minecraft.world.entity.player.Player getFireImmuneTicks()I
public net.minecraft.world.entity.player.Player hurtDir
public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
public net.minecraft.world.entity.player.Player sleepCounter
public net.minecraft.world.entity.projectile.AbstractArrow baseDamage
public net.minecraft.world.entity.projectile.AbstractArrow firedFromWeapon
public net.minecraft.world.entity.projectile.AbstractArrow getHitGroundSoundEvent()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.projectile.AbstractArrow getPickupItem()Lnet/minecraft/world/item/ItemStack;
public net.minecraft.world.entity.projectile.AbstractArrow isInGround()Z
public net.minecraft.world.entity.projectile.AbstractArrow life
public net.minecraft.world.entity.projectile.AbstractArrow pickupItemStack
public net.minecraft.world.entity.projectile.AbstractArrow setPickupItemStack(Lnet/minecraft/world/item/ItemStack;)V
public net.minecraft.world.entity.projectile.AbstractArrow setPierceLevel(B)V
public net.minecraft.world.entity.projectile.AbstractHurtingProjectile assignDirectionalMovement(Lnet/minecraft/world/phys/Vec3;D)V
public net.minecraft.world.entity.projectile.Arrow NO_EFFECT_COLOR
public net.minecraft.world.entity.projectile.Arrow getPotionContents()Lnet/minecraft/world/item/alchemy/PotionContents;
public net.minecraft.world.entity.projectile.Arrow setPotionContents(Lnet/minecraft/world/item/alchemy/PotionContents;)V
public net.minecraft.world.entity.projectile.Arrow updateColor()V
public net.minecraft.world.entity.projectile.EvokerFangs warmupDelayTicks
public net.minecraft.world.entity.projectile.EyeOfEnder life
public net.minecraft.world.entity.projectile.EyeOfEnder surviveAfterDeath
@@ -471,7 +455,6 @@ public net.minecraft.world.entity.projectile.FishingHook setHookedEntity(Lnet/mi
public net.minecraft.world.entity.projectile.FishingHook timeUntilHooked
public net.minecraft.world.entity.projectile.FishingHook timeUntilLured
public net.minecraft.world.entity.projectile.FishingHook$FishHookState
public net.minecraft.world.entity.projectile.LargeFireball explosionPower
public net.minecraft.world.entity.projectile.Projectile hasBeenShot
public net.minecraft.world.entity.projectile.Projectile leftOwner
public net.minecraft.world.entity.projectile.Projectile owner
@@ -480,12 +463,27 @@ public net.minecraft.world.entity.projectile.ShulkerBullet flightSteps
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaX
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaY
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaZ
public net.minecraft.world.entity.projectile.SpectralArrow duration
public net.minecraft.world.entity.projectile.ThrowableItemProjectile getDefaultItem()Lnet/minecraft/world/item/Item;
public net.minecraft.world.entity.projectile.ThrownTrident dealtDamage
public net.minecraft.world.entity.projectile.windcharge.AbstractWindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.entity.projectile.windcharge.BreezeWindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.entity.projectile.windcharge.WindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.entity.projectile.arrow.AbstractArrow baseDamage
public net.minecraft.world.entity.projectile.arrow.AbstractArrow firedFromWeapon
public net.minecraft.world.entity.projectile.arrow.AbstractArrow getHitGroundSoundEvent()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.projectile.arrow.AbstractArrow getPickupItem()Lnet/minecraft/world/item/ItemStack;
public net.minecraft.world.entity.projectile.arrow.AbstractArrow isInGround()Z
public net.minecraft.world.entity.projectile.arrow.AbstractArrow life
public net.minecraft.world.entity.projectile.arrow.AbstractArrow pickupItemStack
public net.minecraft.world.entity.projectile.arrow.AbstractArrow setPickupItemStack(Lnet/minecraft/world/item/ItemStack;)V
public net.minecraft.world.entity.projectile.arrow.AbstractArrow setPierceLevel(B)V
public net.minecraft.world.entity.projectile.arrow.Arrow NO_EFFECT_COLOR
public net.minecraft.world.entity.projectile.arrow.Arrow getPotionContents()Lnet/minecraft/world/item/alchemy/PotionContents;
public net.minecraft.world.entity.projectile.arrow.Arrow setPotionContents(Lnet/minecraft/world/item/alchemy/PotionContents;)V
public net.minecraft.world.entity.projectile.arrow.Arrow updateColor()V
public net.minecraft.world.entity.projectile.arrow.SpectralArrow duration
public net.minecraft.world.entity.projectile.arrow.ThrownTrident dealtDamage
public net.minecraft.world.entity.projectile.hurtingprojectile.AbstractHurtingProjectile assignDirectionalMovement(Lnet/minecraft/world/phys/Vec3;D)V
public net.minecraft.world.entity.projectile.hurtingprojectile.LargeFireball explosionPower
public net.minecraft.world.entity.projectile.hurtingprojectile.windcharge.AbstractWindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.entity.projectile.hurtingprojectile.windcharge.BreezeWindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.entity.projectile.hurtingprojectile.windcharge.WindCharge explode(Lnet/minecraft/world/phys/Vec3;)V
public net.minecraft.world.entity.projectile.throwableitemprojectile.ThrowableItemProjectile getDefaultItem()Lnet/minecraft/world/item/Item;
public net.minecraft.world.entity.raid.Raid heroesOfTheVillage
public net.minecraft.world.entity.raid.Raid numGroups
public net.minecraft.world.entity.raid.Raid raidEvent
@@ -494,17 +492,17 @@ public net.minecraft.world.entity.raid.Raid ticksActive
public net.minecraft.world.entity.raid.Raid totalHealth
public net.minecraft.world.entity.raid.Raider$HoldGroundAttackGoal
public net.minecraft.world.entity.raid.Raids raidMap
public net.minecraft.world.entity.vehicle.AbstractBoat getStatus()Lnet/minecraft/world/entity/vehicle/AbstractBoat$Status;
public net.minecraft.world.entity.vehicle.AbstractBoat status
public net.minecraft.world.entity.vehicle.AbstractMinecartContainer lootTable
public net.minecraft.world.entity.vehicle.AbstractMinecartContainer lootTableSeed
public net.minecraft.world.entity.vehicle.MinecartCommandBlock DATA_ID_COMMAND_NAME
public net.minecraft.world.entity.vehicle.MinecartFurnace fuel
public net.minecraft.world.entity.vehicle.MinecartTNT explode(Lnet/minecraft/world/damagesource/DamageSource;D)V
public net.minecraft.world.entity.vehicle.MinecartTNT explosionPowerBase
public net.minecraft.world.entity.vehicle.MinecartTNT explosionSpeedFactor
public net.minecraft.world.entity.vehicle.MinecartTNT fuse
public net.minecraft.world.entity.vehicle.VehicleEntity getDropItem()Lnet/minecraft/world/item/Item;
public net.minecraft.world.entity.vehicle.boat.AbstractBoat getStatus()Lnet/minecraft/world/entity/vehicle/boat/AbstractBoat$Status;
public net.minecraft.world.entity.vehicle.boat.AbstractBoat status
public net.minecraft.world.entity.vehicle.minecart.AbstractMinecartContainer lootTable
public net.minecraft.world.entity.vehicle.minecart.AbstractMinecartContainer lootTableSeed
public net.minecraft.world.entity.vehicle.minecart.MinecartCommandBlock DATA_ID_COMMAND_NAME
public net.minecraft.world.entity.vehicle.minecart.MinecartFurnace fuel
public net.minecraft.world.entity.vehicle.minecart.MinecartTNT explode(Lnet/minecraft/world/damagesource/DamageSource;D)V
public net.minecraft.world.entity.vehicle.minecart.MinecartTNT explosionPowerBase
public net.minecraft.world.entity.vehicle.minecart.MinecartTNT explosionSpeedFactor
public net.minecraft.world.entity.vehicle.minecart.MinecartTNT fuse
public net.minecraft.world.flag.FeatureFlag mask
public net.minecraft.world.flag.FeatureFlag universe
public net.minecraft.world.flag.FeatureFlagRegistry names
@@ -520,16 +518,16 @@ public net.minecraft.world.inventory.AbstractContainerMenu synchronizeSlotToRemo
public net.minecraft.world.inventory.AbstractContainerMenu triggerSlotListeners(ILnet/minecraft/world/item/ItemStack;Ljava/util/function/Supplier;)V
public net.minecraft.world.inventory.AbstractCraftingMenu craftSlots
public net.minecraft.world.inventory.AbstractCraftingMenu resultSlots
public net.minecraft.world.inventory.AbstractMountInventoryMenu SLOT_BODY_ARMOR
public net.minecraft.world.inventory.AbstractMountInventoryMenu SLOT_INVENTORY_START
public net.minecraft.world.inventory.AbstractMountInventoryMenu SLOT_SADDLE
public net.minecraft.world.inventory.AbstractMountInventoryMenu mount
public net.minecraft.world.inventory.AnvilMenu cost
public net.minecraft.world.inventory.AnvilMenu itemName
public net.minecraft.world.inventory.AnvilMenu repairItemCountCost
public net.minecraft.world.inventory.BrewingStandMenu brewingStandData
public net.minecraft.world.inventory.CraftingMenu access
public net.minecraft.world.inventory.DispenserMenu dispenser
public net.minecraft.world.inventory.HorseInventoryMenu SLOT_BODY_ARMOR
public net.minecraft.world.inventory.HorseInventoryMenu SLOT_HORSE_INVENTORY_START
public net.minecraft.world.inventory.HorseInventoryMenu SLOT_SADDLE
public net.minecraft.world.inventory.HorseInventoryMenu horse
public net.minecraft.world.inventory.MerchantContainer selectionHint
public net.minecraft.world.inventory.Slot slot
public net.minecraft.world.item.AdventureModePredicate predicates
@@ -571,9 +569,6 @@ public net.minecraft.world.level.BaseSpawner spawnCount
public net.minecraft.world.level.BaseSpawner spawnDelay
public net.minecraft.world.level.BaseSpawner spawnPotentials
public net.minecraft.world.level.BaseSpawner spawnRange
public net.minecraft.world.level.GameRules GAME_RULE_TYPES
public net.minecraft.world.level.GameRules$Value deserialize(Ljava/lang/String;)V
public net.minecraft.world.level.GameRules$Value onChanged(Lnet/minecraft/server/MinecraftServer;)V
public net.minecraft.world.level.Level DEFAULT_EXPLOSION_BLOCK_PARTICLES
public net.minecraft.world.level.Level blockEntityTickers
public net.minecraft.world.level.Level getEntities()Lnet/minecraft/world/level/entity/LevelEntityGetter;
@@ -718,6 +713,7 @@ public net.minecraft.world.level.dimension.end.EndDragonFight spawnExitPortal(Z)
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
public net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator settings
public net.minecraft.world.level.levelgen.SurfaceRules$Condition
public net.minecraft.world.level.levelgen.SurfaceRules$Context
@@ -738,8 +734,8 @@ public net.minecraft.world.level.levelgen.structure.placement.StructurePlacement
public net.minecraft.world.level.levelgen.structure.placement.StructurePlacement salt
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate entityInfoList
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate palettes
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager loadFromGenerated(Lnet/minecraft/resources/ResourceLocation;)Ljava/util/Optional;
public net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplateManager loadFromResource(Lnet/minecraft/resources/ResourceLocation;)Ljava/util/Optional;
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.material.MapColor MATERIAL_COLORS
@@ -764,7 +760,6 @@ public-f net.minecraft.server.dedicated.DedicatedServer serverLinks
public-f net.minecraft.server.dedicated.DedicatedServer settings
public-f net.minecraft.server.dedicated.DedicatedServerProperties pauseWhenEmptySeconds
public-f net.minecraft.world.entity.LivingEntity combatTracker
public-f net.minecraft.world.entity.LivingEntity invulnerableDuration
public-f net.minecraft.world.entity.Mob goalSelector
public-f net.minecraft.world.entity.Mob targetSelector
public-f net.minecraft.world.entity.ai.attributes.RangedAttribute maxValue
+6 -3
View File
@@ -1,9 +1,12 @@
group=io.papermc.paper
version=1.21.10-R0.1-SNAPSHOT
mcVersion=1.21.10
version=1.21.11-pre3-R0.1-SNAPSHOT
mcVersion=1.21.11-pre3
# This is the current API version for use in (paper-)plugin.yml files
# During snapshot cycles this should be the anticipated version of the release target
apiVersion=1.21.11
# Set to true while updating Minecraft version
updatingMinecraft=false
updatingMinecraft=true
org.gradle.configuration-cache=true
org.gradle.caching=true
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.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+28 -10
View File
@@ -1,3 +1,5 @@
import paper.libs.com.google.gson.Gson
plugins {
`java-library`
`maven-publish`
@@ -136,20 +138,36 @@ configure<PublishingExtension> {
}
}
val generateApiVersioningFile by tasks.registering {
inputs.property("version", project.version)
val pomProps = layout.buildDirectory.file("pom.properties")
outputs.file(pomProps)
val projectVersion = project.version
doLast {
pomProps.get().asFile.writeText("version=$projectVersion")
abstract class GenerateApiVersioningFile : DefaultTask() {
@get:OutputFile
abstract val outputFile: RegularFileProperty
@get:Input
abstract val projectVersion: Property<String>
@get:Input
abstract val apiVersion: Property<String>
@TaskAction
fun generate() {
val file = outputFile.get().asFile
file.parentFile.mkdirs()
val map = mapOf(
"version" to projectVersion.get(),
"currentApiVersion" to apiVersion.get()
)
file.writeText(Gson().toJson(map))
}
}
val generateApiVersioningFile = tasks.register<GenerateApiVersioningFile>("generateApiVersioningFile") {
outputFile.set(layout.buildDirectory.file("apiVersioning.json"))
projectVersion.set(project.version.toString())
apiVersion.set(rootProject.providers.gradleProperty("apiVersion"))
}
tasks.jar {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
into("META-INF/maven/${project.group}/${project.name}")
}
from(generateApiVersioningFile.flatMap { it.outputFile })
manifest {
attributes(
"Automatic-Module-Name" to "org.bukkit"
@@ -70,6 +70,8 @@ import org.jspecify.annotations.NullMarked;
@NullMarked
@GeneratedClass
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> HORSE_MOUNT_PANIC = create("horse_mount_panic", AbstractHorse.class);
GoalKey<AbstractHorse> HORSE_RANDOM_STAND = create("horse_random_stand", AbstractHorse.class);
GoalKey<AbstractHorse> HORSE_RUN_AROUND_LIKE_CRAZY = create("horse_run_around_like_crazy", AbstractHorse.class);
@@ -298,6 +300,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Monster> RANGED_CROSSBOW_ATTACK = create("ranged_crossbow_attack", Monster.class);
GoalKey<Monster> SPEAR_USE = create("spear_use", Monster.class);
GoalKey<Ocelot> OCELOT_AVOID_ENTITY = create("ocelot_avoid_entity", Ocelot.class);
GoalKey<Ocelot> OCELOT_TEMPT = create("ocelot_tempt", Ocelot.class);
@@ -284,6 +284,13 @@ public final class DamageTypeKeys {
*/
public static final TypedKey<DamageType> SONIC_BOOM = create(key("sonic_boom"));
/**
* {@code minecraft:spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DamageType> SPEAR = create(key("spear"));
/**
* {@code minecraft:spit}
*
@@ -25,6 +25,13 @@ import org.jspecify.annotations.NullMarked;
@NullMarked
@GeneratedClass
public final class DataComponentTypeKeys {
/**
* {@code minecraft:attack_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> ATTACK_RANGE = create(key("attack_range"));
/**
* {@code minecraft:attribute_modifiers}
*
@@ -214,6 +221,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> DAMAGE_RESISTANT = create(key("damage_resistant"));
/**
* {@code minecraft:damage_type}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> DAMAGE_TYPE = create(key("damage_type"));
/**
* {@code minecraft:death_protection}
*
@@ -354,6 +368,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> JUKEBOX_PLAYABLE = create(key("jukebox_playable"));
/**
* {@code minecraft:kinetic_weapon}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> KINETIC_WEAPON = create(key("kinetic_weapon"));
/**
* {@code minecraft:llama/variant}
*
@@ -424,6 +445,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> MAX_STACK_SIZE = create(key("max_stack_size"));
/**
* {@code minecraft:minimum_attack_charge}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> MINIMUM_ATTACK_CHARGE = create(key("minimum_attack_charge"));
/**
* {@code minecraft:mooshroom/variant}
*
@@ -459,6 +487,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> PARROT_VARIANT = create(key("parrot/variant"));
/**
* {@code minecraft:piercing_weapon}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> PIERCING_WEAPON = create(key("piercing_weapon"));
/**
* {@code minecraft:pig/variant}
*
@@ -578,6 +613,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> SUSPICIOUS_STEW_EFFECTS = create(key("suspicious_stew_effects"));
/**
* {@code minecraft:swing_animation}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> SWING_ANIMATION = create(key("swing_animation"));
/**
* {@code minecraft:tool}
*
@@ -641,6 +683,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> USE_COOLDOWN = create(key("use_cooldown"));
/**
* {@code minecraft:use_effects}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> USE_EFFECTS = create(key("use_effects"));
/**
* {@code minecraft:use_remainder}
*
@@ -697,6 +746,13 @@ public final class DataComponentTypeKeys {
*/
public static final TypedKey<DataComponentType> WRITTEN_BOOK_CONTENT = create(key("written_book_content"));
/**
* {@code minecraft:zombie_nautilus/variant}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<DataComponentType> ZOMBIE_NAUTILUS_VARIANT = create(key("zombie_nautilus/variant"));
private DataComponentTypeKeys() {
}
@@ -172,6 +172,13 @@ public final class EnchantmentKeys {
*/
public static final TypedKey<Enchantment> LUCK_OF_THE_SEA = create(key("luck_of_the_sea"));
/**
* {@code minecraft:lunge}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Enchantment> LUNGE = create(key("lunge"));
/**
* {@code minecraft:lure}
*
@@ -0,0 +1,451 @@
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.GameRule;
import org.bukkit.MinecraftExperimental;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#GAME_RULE}.
*
* @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 GameRuleKeys {
/**
* {@code minecraft:advance_time}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> ADVANCE_TIME = create(key("advance_time"));
/**
* {@code minecraft:advance_weather}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> ADVANCE_WEATHER = create(key("advance_weather"));
/**
* {@code minecraft:allow_entering_nether_using_portals}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> ALLOW_ENTERING_NETHER_USING_PORTALS = create(key("allow_entering_nether_using_portals"));
/**
* {@code minecraft:block_drops}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> BLOCK_DROPS = create(key("block_drops"));
/**
* {@code minecraft:block_explosion_drop_decay}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> BLOCK_EXPLOSION_DROP_DECAY = create(key("block_explosion_drop_decay"));
/**
* {@code minecraft:command_block_output}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> COMMAND_BLOCK_OUTPUT = create(key("command_block_output"));
/**
* {@code minecraft:command_blocks_work}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> COMMAND_BLOCKS_WORK = create(key("command_blocks_work"));
/**
* {@code minecraft:drowning_damage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> DROWNING_DAMAGE = create(key("drowning_damage"));
/**
* {@code minecraft:elytra_movement_check}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> ELYTRA_MOVEMENT_CHECK = create(key("elytra_movement_check"));
/**
* {@code minecraft:ender_pearls_vanish_on_death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> ENDER_PEARLS_VANISH_ON_DEATH = create(key("ender_pearls_vanish_on_death"));
/**
* {@code minecraft:entity_drops}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> ENTITY_DROPS = create(key("entity_drops"));
/**
* {@code minecraft:fall_damage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> FALL_DAMAGE = create(key("fall_damage"));
/**
* {@code minecraft:fire_damage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> FIRE_DAMAGE = create(key("fire_damage"));
/**
* {@code minecraft:fire_spread_radius_around_player}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> FIRE_SPREAD_RADIUS_AROUND_PLAYER = create(key("fire_spread_radius_around_player"));
/**
* {@code minecraft:forgive_dead_players}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> FORGIVE_DEAD_PLAYERS = create(key("forgive_dead_players"));
/**
* {@code minecraft:freeze_damage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> FREEZE_DAMAGE = create(key("freeze_damage"));
/**
* {@code minecraft:global_sound_events}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> GLOBAL_SOUND_EVENTS = create(key("global_sound_events"));
/**
* {@code minecraft:immediate_respawn}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> IMMEDIATE_RESPAWN = create(key("immediate_respawn"));
/**
* {@code minecraft:keep_inventory}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> KEEP_INVENTORY = create(key("keep_inventory"));
/**
* {@code minecraft:lava_source_conversion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> LAVA_SOURCE_CONVERSION = create(key("lava_source_conversion"));
/**
* {@code minecraft:limited_crafting}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> LIMITED_CRAFTING = create(key("limited_crafting"));
/**
* {@code minecraft:locator_bar}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> LOCATOR_BAR = create(key("locator_bar"));
/**
* {@code minecraft:log_admin_commands}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> LOG_ADMIN_COMMANDS = create(key("log_admin_commands"));
/**
* {@code minecraft:max_block_modifications}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MAX_BLOCK_MODIFICATIONS = create(key("max_block_modifications"));
/**
* {@code minecraft:max_command_forks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MAX_COMMAND_FORKS = create(key("max_command_forks"));
/**
* {@code minecraft:max_command_sequence_length}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MAX_COMMAND_SEQUENCE_LENGTH = create(key("max_command_sequence_length"));
/**
* {@code minecraft:max_entity_cramming}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MAX_ENTITY_CRAMMING = create(key("max_entity_cramming"));
/**
* {@code minecraft:max_minecart_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.MINECART_IMPROVEMENTS)
public static final TypedKey<GameRule<?>> MAX_MINECART_SPEED = create(key("max_minecart_speed"));
/**
* {@code minecraft:max_snow_accumulation_height}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MAX_SNOW_ACCUMULATION_HEIGHT = create(key("max_snow_accumulation_height"));
/**
* {@code minecraft:mob_drops}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MOB_DROPS = create(key("mob_drops"));
/**
* {@code minecraft:mob_explosion_drop_decay}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MOB_EXPLOSION_DROP_DECAY = create(key("mob_explosion_drop_decay"));
/**
* {@code minecraft:mob_griefing}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> MOB_GRIEFING = create(key("mob_griefing"));
/**
* {@code minecraft:natural_health_regeneration}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> NATURAL_HEALTH_REGENERATION = create(key("natural_health_regeneration"));
/**
* {@code minecraft:player_movement_check}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> PLAYER_MOVEMENT_CHECK = create(key("player_movement_check"));
/**
* {@code minecraft:players_nether_portal_creative_delay}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> PLAYERS_NETHER_PORTAL_CREATIVE_DELAY = create(key("players_nether_portal_creative_delay"));
/**
* {@code minecraft:players_nether_portal_default_delay}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> PLAYERS_NETHER_PORTAL_DEFAULT_DELAY = create(key("players_nether_portal_default_delay"));
/**
* {@code minecraft:players_sleeping_percentage}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> PLAYERS_SLEEPING_PERCENTAGE = create(key("players_sleeping_percentage"));
/**
* {@code minecraft:projectiles_can_break_blocks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> PROJECTILES_CAN_BREAK_BLOCKS = create(key("projectiles_can_break_blocks"));
/**
* {@code minecraft:pvp}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> PVP = create(key("pvp"));
/**
* {@code minecraft:raids}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> RAIDS = create(key("raids"));
/**
* {@code minecraft:random_tick_speed}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> RANDOM_TICK_SPEED = create(key("random_tick_speed"));
/**
* {@code minecraft:reduced_debug_info}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> REDUCED_DEBUG_INFO = create(key("reduced_debug_info"));
/**
* {@code minecraft:respawn_radius}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> RESPAWN_RADIUS = create(key("respawn_radius"));
/**
* {@code minecraft:send_command_feedback}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SEND_COMMAND_FEEDBACK = create(key("send_command_feedback"));
/**
* {@code minecraft:show_advancement_messages}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SHOW_ADVANCEMENT_MESSAGES = create(key("show_advancement_messages"));
/**
* {@code minecraft:show_death_messages}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SHOW_DEATH_MESSAGES = create(key("show_death_messages"));
/**
* {@code minecraft:spawn_mobs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPAWN_MOBS = create(key("spawn_mobs"));
/**
* {@code minecraft:spawn_monsters}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPAWN_MONSTERS = create(key("spawn_monsters"));
/**
* {@code minecraft:spawn_patrols}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPAWN_PATROLS = create(key("spawn_patrols"));
/**
* {@code minecraft:spawn_phantoms}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPAWN_PHANTOMS = create(key("spawn_phantoms"));
/**
* {@code minecraft:spawn_wandering_traders}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPAWN_WANDERING_TRADERS = create(key("spawn_wandering_traders"));
/**
* {@code minecraft:spawn_wardens}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPAWN_WARDENS = create(key("spawn_wardens"));
/**
* {@code minecraft:spawner_blocks_work}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPAWNER_BLOCKS_WORK = create(key("spawner_blocks_work"));
/**
* {@code minecraft:spectators_generate_chunks}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPECTATORS_GENERATE_CHUNKS = create(key("spectators_generate_chunks"));
/**
* {@code minecraft:spread_vines}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> SPREAD_VINES = create(key("spread_vines"));
/**
* {@code minecraft:tnt_explodes}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> TNT_EXPLODES = create(key("tnt_explodes"));
/**
* {@code minecraft:tnt_explosion_drop_decay}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> TNT_EXPLOSION_DROP_DECAY = create(key("tnt_explosion_drop_decay"));
/**
* {@code minecraft:universal_anger}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> UNIVERSAL_ANGER = create(key("universal_anger"));
/**
* {@code minecraft:water_source_conversion}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameRule<?>> WATER_SOURCE_CONVERSION = create(key("water_source_conversion"));
private GameRuleKeys() {
}
private static TypedKey<GameRule<?>> create(final Key key) {
return TypedKey.create(RegistryKey.GAME_RULE, key);
}
}
@@ -1383,6 +1383,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> CALIBRATED_SCULK_SENSOR = create(key("calibrated_sculk_sensor"));
/**
* {@code minecraft:camel_husk_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> CAMEL_HUSK_SPAWN_EGG = create(key("camel_husk_spawn_egg"));
/**
* {@code minecraft:camel_spawn_egg}
*
@@ -2139,6 +2146,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> COPPER_LEGGINGS = create(key("copper_leggings"));
/**
* {@code minecraft:copper_nautilus_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> COPPER_NAUTILUS_ARMOR = create(key("copper_nautilus_armor"));
/**
* {@code minecraft:copper_nugget}
*
@@ -2167,6 +2181,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> COPPER_SHOVEL = create(key("copper_shovel"));
/**
* {@code minecraft:copper_spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> COPPER_SPEAR = create(key("copper_spear"));
/**
* {@code minecraft:copper_sword}
*
@@ -3063,6 +3084,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> DIAMOND_LEGGINGS = create(key("diamond_leggings"));
/**
* {@code minecraft:diamond_nautilus_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> DIAMOND_NAUTILUS_ARMOR = create(key("diamond_nautilus_armor"));
/**
* {@code minecraft:diamond_ore}
*
@@ -3084,6 +3112,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> DIAMOND_SHOVEL = create(key("diamond_shovel"));
/**
* {@code minecraft:diamond_spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> DIAMOND_SPEAR = create(key("diamond_spear"));
/**
* {@code minecraft:diamond_sword}
*
@@ -3952,6 +3987,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> GOLDEN_LEGGINGS = create(key("golden_leggings"));
/**
* {@code minecraft:golden_nautilus_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOLDEN_NAUTILUS_ARMOR = create(key("golden_nautilus_armor"));
/**
* {@code minecraft:golden_pickaxe}
*
@@ -3966,6 +4008,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> GOLDEN_SHOVEL = create(key("golden_shovel"));
/**
* {@code minecraft:golden_spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> GOLDEN_SPEAR = create(key("golden_spear"));
/**
* {@code minecraft:golden_sword}
*
@@ -4568,6 +4617,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> IRON_LEGGINGS = create(key("iron_leggings"));
/**
* {@code minecraft:iron_nautilus_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> IRON_NAUTILUS_ARMOR = create(key("iron_nautilus_armor"));
/**
* {@code minecraft:iron_nugget}
*
@@ -4596,6 +4652,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> IRON_SHOVEL = create(key("iron_shovel"));
/**
* {@code minecraft:iron_spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> IRON_SPEAR = create(key("iron_spear"));
/**
* {@code minecraft:iron_sword}
*
@@ -5940,6 +6003,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> NAUTILUS_SHELL = create(key("nautilus_shell"));
/**
* {@code minecraft:nautilus_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> NAUTILUS_SPAWN_EGG = create(key("nautilus_spawn_egg"));
/**
* {@code minecraft:nether_brick}
*
@@ -6066,6 +6136,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> NETHERITE_HOE = create(key("netherite_hoe"));
/**
* {@code minecraft:netherite_horse_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> NETHERITE_HORSE_ARMOR = create(key("netherite_horse_armor"));
/**
* {@code minecraft:netherite_ingot}
*
@@ -6080,6 +6157,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> NETHERITE_LEGGINGS = create(key("netherite_leggings"));
/**
* {@code minecraft:netherite_nautilus_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> NETHERITE_NAUTILUS_ARMOR = create(key("netherite_nautilus_armor"));
/**
* {@code minecraft:netherite_pickaxe}
*
@@ -6101,6 +6185,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> NETHERITE_SHOVEL = create(key("netherite_shovel"));
/**
* {@code minecraft:netherite_spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> NETHERITE_SPEAR = create(key("netherite_spear"));
/**
* {@code minecraft:netherite_sword}
*
@@ -6710,6 +6801,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> PAPER = create(key("paper"));
/**
* {@code minecraft:parched_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> PARCHED_SPAWN_EGG = create(key("parched_spawn_egg"));
/**
* {@code minecraft:parrot_spawn_egg}
*
@@ -8733,6 +8831,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> STONE_SLAB = create(key("stone_slab"));
/**
* {@code minecraft:stone_spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> STONE_SPEAR = create(key("stone_spear"));
/**
* {@code minecraft:stone_stairs}
*
@@ -10273,6 +10378,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> WOODEN_SHOVEL = create(key("wooden_shovel"));
/**
* {@code minecraft:wooden_spear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> WOODEN_SPEAR = create(key("wooden_spear"));
/**
* {@code minecraft:wooden_sword}
*
@@ -10420,6 +10532,13 @@ public final class ItemTypeKeys {
*/
public static final TypedKey<ItemType> ZOMBIE_HORSE_SPAWN_EGG = create(key("zombie_horse_spawn_egg"));
/**
* {@code minecraft:zombie_nautilus_spawn_egg}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ItemType> ZOMBIE_NAUTILUS_SPAWN_EGG = create(key("zombie_nautilus_spawn_egg"));
/**
* {@code minecraft:zombie_spawn_egg}
*
@@ -46,6 +46,13 @@ public final class MobEffectKeys {
*/
public static final TypedKey<PotionEffectType> BLINDNESS = create(key("blindness"));
/**
* {@code minecraft:breath_of_the_nautilus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<PotionEffectType> BREATH_OF_THE_NAUTILUS = create(key("breath_of_the_nautilus"));
/**
* {@code minecraft:conduit_power}
*
@@ -6031,6 +6031,62 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_AXOLOTL_SWIM = create(key("entity.axolotl.swim"));
/**
* {@code minecraft:entity.baby_nautilus.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_AMBIENT = create(key("entity.baby_nautilus.ambient"));
/**
* {@code minecraft:entity.baby_nautilus.ambient_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_AMBIENT_LAND = create(key("entity.baby_nautilus.ambient_land"));
/**
* {@code minecraft:entity.baby_nautilus.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_DEATH = create(key("entity.baby_nautilus.death"));
/**
* {@code minecraft:entity.baby_nautilus.death_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_DEATH_LAND = create(key("entity.baby_nautilus.death_land"));
/**
* {@code minecraft:entity.baby_nautilus.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_EAT = create(key("entity.baby_nautilus.eat"));
/**
* {@code minecraft:entity.baby_nautilus.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_HURT = create(key("entity.baby_nautilus.hurt"));
/**
* {@code minecraft:entity.baby_nautilus.hurt_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_HURT_LAND = create(key("entity.baby_nautilus.hurt_land"));
/**
* {@code minecraft:entity.baby_nautilus.swim}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_BABY_NAUTILUS_SWIM = create(key("entity.baby_nautilus.swim"));
/**
* {@code minecraft:entity.bat.ambient}
*
@@ -6360,6 +6416,83 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_CAMEL_STEP_SAND = create(key("entity.camel.step_sand"));
/**
* {@code minecraft:entity.camel_husk.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_AMBIENT = create(key("entity.camel_husk.ambient"));
/**
* {@code minecraft:entity.camel_husk.dash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_DASH = create(key("entity.camel_husk.dash"));
/**
* {@code minecraft:entity.camel_husk.dash_ready}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_DASH_READY = create(key("entity.camel_husk.dash_ready"));
/**
* {@code minecraft:entity.camel_husk.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_DEATH = create(key("entity.camel_husk.death"));
/**
* {@code minecraft:entity.camel_husk.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_EAT = create(key("entity.camel_husk.eat"));
/**
* {@code minecraft:entity.camel_husk.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_HURT = create(key("entity.camel_husk.hurt"));
/**
* {@code minecraft:entity.camel_husk.saddle}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_SADDLE = create(key("entity.camel_husk.saddle"));
/**
* {@code minecraft:entity.camel_husk.sit}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_SIT = create(key("entity.camel_husk.sit"));
/**
* {@code minecraft:entity.camel_husk.stand}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_STAND = create(key("entity.camel_husk.stand"));
/**
* {@code minecraft:entity.camel_husk.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_STEP = create(key("entity.camel_husk.step"));
/**
* {@code minecraft:entity.camel_husk.step_sand}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_CAMEL_HUSK_STEP_SAND = create(key("entity.camel_husk.step_sand"));
/**
* {@code minecraft:entity.cat.ambient}
*
@@ -8481,6 +8614,97 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_MULE_JUMP = create(key("entity.mule.jump"));
/**
* {@code minecraft:entity.nautilus.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_AMBIENT = create(key("entity.nautilus.ambient"));
/**
* {@code minecraft:entity.nautilus.ambient_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_AMBIENT_LAND = create(key("entity.nautilus.ambient_land"));
/**
* {@code minecraft:entity.nautilus.dash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_DASH = create(key("entity.nautilus.dash"));
/**
* {@code minecraft:entity.nautilus.dash_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_DASH_LAND = create(key("entity.nautilus.dash_land"));
/**
* {@code minecraft:entity.nautilus.dash_ready}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_DASH_READY = create(key("entity.nautilus.dash_ready"));
/**
* {@code minecraft:entity.nautilus.dash_ready_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_DASH_READY_LAND = create(key("entity.nautilus.dash_ready_land"));
/**
* {@code minecraft:entity.nautilus.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_DEATH = create(key("entity.nautilus.death"));
/**
* {@code minecraft:entity.nautilus.death_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_DEATH_LAND = create(key("entity.nautilus.death_land"));
/**
* {@code minecraft:entity.nautilus.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_EAT = create(key("entity.nautilus.eat"));
/**
* {@code minecraft:entity.nautilus.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_HURT = create(key("entity.nautilus.hurt"));
/**
* {@code minecraft:entity.nautilus.hurt_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_HURT_LAND = create(key("entity.nautilus.hurt_land"));
/**
* {@code minecraft:entity.nautilus.riding}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_RIDING = create(key("entity.nautilus.riding"));
/**
* {@code minecraft:entity.nautilus.swim}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_NAUTILUS_SWIM = create(key("entity.nautilus.swim"));
/**
* {@code minecraft:entity.ocelot.ambient}
*
@@ -8593,6 +8817,34 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_PANDA_WORRIED_AMBIENT = create(key("entity.panda.worried_ambient"));
/**
* {@code minecraft:entity.parched.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARCHED_AMBIENT = create(key("entity.parched.ambient"));
/**
* {@code minecraft:entity.parched.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARCHED_DEATH = create(key("entity.parched.death"));
/**
* {@code minecraft:entity.parched.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARCHED_HURT = create(key("entity.parched.hurt"));
/**
* {@code minecraft:entity.parched.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARCHED_STEP = create(key("entity.parched.step"));
/**
* {@code minecraft:entity.parrot.ambient}
*
@@ -8649,6 +8901,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_PARROT_IMITATE_BREEZE = create(key("entity.parrot.imitate.breeze"));
/**
* {@code minecraft:entity.parrot.imitate.camel_husk}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARROT_IMITATE_CAMEL_HUSK = create(key("entity.parrot.imitate.camel_husk"));
/**
* {@code minecraft:entity.parrot.imitate.creaking}
*
@@ -8740,6 +8999,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_PARROT_IMITATE_MAGMA_CUBE = create(key("entity.parrot.imitate.magma_cube"));
/**
* {@code minecraft:entity.parrot.imitate.parched}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARROT_IMITATE_PARCHED = create(key("entity.parrot.imitate.parched"));
/**
* {@code minecraft:entity.parrot.imitate.phantom}
*
@@ -8873,6 +9139,20 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_PARROT_IMITATE_ZOMBIE = create(key("entity.parrot.imitate.zombie"));
/**
* {@code minecraft:entity.parrot.imitate.zombie_horse}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARROT_IMITATE_ZOMBIE_HORSE = create(key("entity.parrot.imitate.zombie_horse"));
/**
* {@code minecraft:entity.parrot.imitate.zombie_nautilus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PARROT_IMITATE_ZOMBIE_NAUTILUS = create(key("entity.parrot.imitate.zombie_nautilus"));
/**
* {@code minecraft:entity.parrot.imitate.zombie_villager}
*
@@ -11141,6 +11421,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_HORSE_AMBIENT = create(key("entity.zombie_horse.ambient"));
/**
* {@code minecraft:entity.zombie_horse.angry}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_HORSE_ANGRY = create(key("entity.zombie_horse.angry"));
/**
* {@code minecraft:entity.zombie_horse.death}
*
@@ -11148,6 +11435,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_HORSE_DEATH = create(key("entity.zombie_horse.death"));
/**
* {@code minecraft:entity.zombie_horse.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_HORSE_EAT = create(key("entity.zombie_horse.eat"));
/**
* {@code minecraft:entity.zombie_horse.hurt}
*
@@ -11155,6 +11449,90 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_HORSE_HURT = create(key("entity.zombie_horse.hurt"));
/**
* {@code minecraft:entity.zombie_nautilus.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_AMBIENT = create(key("entity.zombie_nautilus.ambient"));
/**
* {@code minecraft:entity.zombie_nautilus.ambient_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_AMBIENT_LAND = create(key("entity.zombie_nautilus.ambient_land"));
/**
* {@code minecraft:entity.zombie_nautilus.dash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_DASH = create(key("entity.zombie_nautilus.dash"));
/**
* {@code minecraft:entity.zombie_nautilus.dash_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_DASH_LAND = create(key("entity.zombie_nautilus.dash_land"));
/**
* {@code minecraft:entity.zombie_nautilus.dash_ready}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_DASH_READY = create(key("entity.zombie_nautilus.dash_ready"));
/**
* {@code minecraft:entity.zombie_nautilus.dash_ready_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_DASH_READY_LAND = create(key("entity.zombie_nautilus.dash_ready_land"));
/**
* {@code minecraft:entity.zombie_nautilus.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_DEATH = create(key("entity.zombie_nautilus.death"));
/**
* {@code minecraft:entity.zombie_nautilus.death_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_DEATH_LAND = create(key("entity.zombie_nautilus.death_land"));
/**
* {@code minecraft:entity.zombie_nautilus.eat}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_EAT = create(key("entity.zombie_nautilus.eat"));
/**
* {@code minecraft:entity.zombie_nautilus.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_HURT = create(key("entity.zombie_nautilus.hurt"));
/**
* {@code minecraft:entity.zombie_nautilus.hurt_land}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_HURT_LAND = create(key("entity.zombie_nautilus.hurt_land"));
/**
* {@code minecraft:entity.zombie_nautilus.swim}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_ZOMBIE_NAUTILUS_SWIM = create(key("entity.zombie_nautilus.swim"));
/**
* {@code minecraft:entity.zombie_villager.ambient}
*
@@ -11316,6 +11694,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_ARMOR_EQUIP_LEATHER = create(key("item.armor.equip_leather"));
/**
* {@code minecraft:item.armor.equip_nautilus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_ARMOR_EQUIP_NAUTILUS = create(key("item.armor.equip_nautilus"));
/**
* {@code minecraft:item.armor.equip_netherite}
*
@@ -11337,6 +11722,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_ARMOR_EQUIP_WOLF = create(key("item.armor.equip_wolf"));
/**
* {@code minecraft:item.armor.unequip_nautilus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_ARMOR_UNEQUIP_NAUTILUS = create(key("item.armor.unequip_nautilus"));
/**
* {@code minecraft:item.armor.unequip_wolf}
*
@@ -11806,6 +12198,20 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_MACE_SMASH_GROUND_HEAVY = create(key("item.mace.smash_ground_heavy"));
/**
* {@code minecraft:item.nautilus_saddle_equip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_NAUTILUS_SADDLE_EQUIP = create(key("item.nautilus_saddle_equip"));
/**
* {@code minecraft:item.nautilus_saddle_underwater_equip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_NAUTILUS_SADDLE_UNDERWATER_EQUIP = create(key("item.nautilus_saddle_underwater_equip"));
/**
* {@code minecraft:item.nether_wart.plant}
*
@@ -11855,6 +12261,69 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_SHOVEL_FLATTEN = create(key("item.shovel.flatten"));
/**
* {@code minecraft:item.spear.attack}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_ATTACK = create(key("item.spear.attack"));
/**
* {@code minecraft:item.spear.hit}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_HIT = create(key("item.spear.hit"));
/**
* {@code minecraft:item.spear.lunge_1}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_LUNGE_1 = create(key("item.spear.lunge_1"));
/**
* {@code minecraft:item.spear.lunge_2}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_LUNGE_2 = create(key("item.spear.lunge_2"));
/**
* {@code minecraft:item.spear.lunge_3}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_LUNGE_3 = create(key("item.spear.lunge_3"));
/**
* {@code minecraft:item.spear.use}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_USE = create(key("item.spear.use"));
/**
* {@code minecraft:item.spear_wood.attack}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_WOOD_ATTACK = create(key("item.spear_wood.attack"));
/**
* {@code minecraft:item.spear_wood.hit}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_WOOD_HIT = create(key("item.spear_wood.hit"));
/**
* {@code minecraft:item.spear_wood.use}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SPEAR_WOOD_USE = create(key("item.spear_wood.use"));
/**
* {@code minecraft:item.spyglass.stop_using}
*
@@ -0,0 +1,54 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.annotation.GeneratedClass;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.ZombieNautilus;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#ZOMBIE_NAUTILUS_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 ZombieNautilusVariantKeys {
/**
* {@code minecraft:temperate}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ZombieNautilus.Variant> TEMPERATE = create(key("temperate"));
/**
* {@code minecraft:warm}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<ZombieNautilus.Variant> WARM = create(key("warm"));
private ZombieNautilusVariantKeys() {
}
/**
* Creates a typed key for {@link ZombieNautilus.Variant} in the registry {@code minecraft:zombie_nautilus_variant}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
public static TypedKey<ZombieNautilus.Variant> create(final Key key) {
return TypedKey.create(RegistryKey.ZOMBIE_NAUTILUS_VARIANT, key);
}
}
@@ -39,13 +39,6 @@ public final class BiomeTagKeys {
*/
public static final TagKey<Biome> ALLOWS_TROPICAL_FISH_SPAWNS_AT_ANY_HEIGHT = create(key("allows_tropical_fish_spawns_at_any_height"));
/**
* {@code #minecraft:has_closer_water_fog}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> HAS_CLOSER_WATER_FOG = create(key("has_closer_water_fog"));
/**
* {@code #minecraft:has_structure/ancient_city}
*
@@ -284,13 +277,6 @@ public final class BiomeTagKeys {
*/
public static final TagKey<Biome> HAS_STRUCTURE_WOODLAND_MANSION = create(key("has_structure/woodland_mansion"));
/**
* {@code #minecraft:increased_fire_burnout}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> INCREASED_FIRE_BURNOUT = create(key("increased_fire_burnout"));
/**
* {@code #minecraft:is_badlands}
*
@@ -403,13 +389,6 @@ public final class BiomeTagKeys {
*/
public static final TagKey<Biome> MORE_FREQUENT_DROWNED_SPAWNS = create(key("more_frequent_drowned_spawns"));
/**
* {@code #minecraft:plays_underwater_music}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> PLAYS_UNDERWATER_MUSIC = create(key("plays_underwater_music"));
/**
* {@code #minecraft:polar_bears_spawn_on_alternate_blocks}
*
@@ -438,13 +417,6 @@ public final class BiomeTagKeys {
*/
public static final TagKey<Biome> REQUIRED_OCEAN_MONUMENT_SURROUNDING = create(key("required_ocean_monument_surrounding"));
/**
* {@code #minecraft:snow_golem_melts}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SNOW_GOLEM_MELTS = create(key("snow_golem_melts"));
/**
* {@code #minecraft:spawns_cold_variant_farm_animals}
*
@@ -459,6 +431,13 @@ public final class BiomeTagKeys {
*/
public static final TagKey<Biome> SPAWNS_COLD_VARIANT_FROGS = create(key("spawns_cold_variant_frogs"));
/**
* {@code #minecraft:spawns_coral_variant_zombie_nautilus}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> SPAWNS_CORAL_VARIANT_ZOMBIE_NAUTILUS = create(key("spawns_coral_variant_zombie_nautilus"));
/**
* {@code #minecraft:spawns_gold_rabbits}
*
@@ -508,13 +487,6 @@ public final class BiomeTagKeys {
*/
public static final TagKey<Biome> WATER_ON_MAP_OUTLINES = create(key("water_on_map_outlines"));
/**
* {@code #minecraft:without_patrol_spawns}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Biome> WITHOUT_PATROL_SPAWNS = create(key("without_patrol_spawns"));
/**
* {@code #minecraft:without_wandering_trader_spawns}
*
@@ -242,6 +242,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> CAMPFIRES = create(key("campfires"));
/**
* {@code #minecraft:can_glide_through}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> CAN_GLIDE_THROUGH = create(key("can_glide_through"));
/**
* {@code #minecraft:candle_cakes}
*
@@ -81,6 +81,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> BOAT = create(key("boat"));
/**
* {@code #minecraft:burn_in_daylight}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> BURN_IN_DAYLIGHT = create(key("burn_in_daylight"));
/**
* {@code #minecraft:can_breathe_under_water}
*
@@ -102,6 +109,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> CAN_EQUIP_SADDLE = create(key("can_equip_saddle"));
/**
* {@code #minecraft:can_float_while_ridden}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> CAN_FLOAT_WHILE_RIDDEN = create(key("can_float_while_ridden"));
/**
* {@code #minecraft:can_turn_in_boats}
*
@@ -116,6 +130,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> CAN_WEAR_HORSE_ARMOR = create(key("can_wear_horse_armor"));
/**
* {@code #minecraft:can_wear_nautilus_armor}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> CAN_WEAR_NAUTILUS_ARMOR = create(key("can_wear_nautilus_armor"));
/**
* {@code #minecraft:candidate_for_iron_golem_gift}
*
@@ -228,6 +249,13 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> INVERTED_HEALING_AND_HARM = create(key("inverted_healing_and_harm"));
/**
* {@code #minecraft:nautilus_hostiles}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> NAUTILUS_HOSTILES = create(key("nautilus_hostiles"));
/**
* {@code #minecraft:no_anger_from_wind_charge}
*
@@ -172,6 +172,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> CAMEL_FOOD = create(key("camel_food"));
/**
* {@code #minecraft:camel_husk_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> CAMEL_HUSK_FOOD = create(key("camel_husk_food"));
/**
* {@code #minecraft:candles}
*
@@ -487,6 +494,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> ENCHANTABLE_LEG_ARMOR = create(key("enchantable/leg_armor"));
/**
* {@code #minecraft:enchantable/lunge}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> ENCHANTABLE_LUNGE = create(key("enchantable/lunge"));
/**
* {@code #minecraft:enchantable/mace}
*
@@ -494,6 +508,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> ENCHANTABLE_MACE = create(key("enchantable/mace"));
/**
* {@code #minecraft:enchantable/melee_weapon}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> ENCHANTABLE_MELEE_WEAPON = create(key("enchantable/melee_weapon"));
/**
* {@code #minecraft:enchantable/mining}
*
@@ -516,11 +537,11 @@ public final class ItemTypeTagKeys {
public static final TagKey<ItemType> ENCHANTABLE_SHARP_WEAPON = create(key("enchantable/sharp_weapon"));
/**
* {@code #minecraft:enchantable/sword}
* {@code #minecraft:enchantable/sweeping}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> ENCHANTABLE_SWORD = create(key("enchantable/sword"));
public static final TagKey<ItemType> ENCHANTABLE_SWEEPING = create(key("enchantable/sweeping"));
/**
* {@code #minecraft:enchantable/trident}
@@ -816,6 +837,27 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> MEAT = create(key("meat"));
/**
* {@code #minecraft:nautilus_bucket_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> NAUTILUS_BUCKET_FOOD = create(key("nautilus_bucket_food"));
/**
* {@code #minecraft:nautilus_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> NAUTILUS_FOOD = create(key("nautilus_food"));
/**
* {@code #minecraft:nautilus_taming_items}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> NAUTILUS_TAMING_ITEMS = create(key("nautilus_taming_items"));
/**
* {@code #minecraft:netherite_tool_materials}
*
@@ -1131,6 +1173,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> SOUL_FIRE_BASE_BLOCKS = create(key("soul_fire_base_blocks"));
/**
* {@code #minecraft:spears}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> SPEARS = create(key("spears"));
/**
* {@code #minecraft:spruce_logs}
*
@@ -1355,6 +1404,13 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> WOOL_CARPETS = create(key("wool_carpets"));
/**
* {@code #minecraft:zombie_horse_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> ZOMBIE_HORSE_FOOD = create(key("zombie_horse_food"));
private ItemTypeTagKeys() {
}
@@ -202,7 +202,7 @@ public class MaterialTags {
*/
public static final MaterialSetTag HORSE_ARMORS = new MaterialSetTag(keyFor("horse_armors"))
.endsWith("_HORSE_ARMOR")
.ensureSize("HORSE_ARMORS", 5).lock();
.ensureSize("HORSE_ARMORS", 6).lock();
/**
* Covers the variants of infested blocks.
@@ -340,7 +340,7 @@ public class MaterialTags {
*/
public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
.endsWith("_SPAWN_EGG")
.ensureSize("SPAWN_EGGS", 83).lock();
.ensureSize("SPAWN_EGGS", 87).lock();
/**
* Covers all colors of stained glass.
@@ -677,6 +677,7 @@ public class MaterialTags {
.not(Material.COPPER_HORSE_ARMOR, Material.COPPER_GOLEM_SPAWN_EGG)
.not(Material.COPPER_HELMET, Material.COPPER_CHESTPLATE, Material.COPPER_LEGGINGS, Material.COPPER_BOOTS)
.not(Material.COPPER_AXE, Material.COPPER_HOE, Material.COPPER_PICKAXE, Material.COPPER_SHOVEL, Material.COPPER_SWORD)
.not(Material.COPPER_NAUTILUS_ARMOR, Material.COPPER_SPEAR)
.ensureSize("UNAFFECTED_COPPER_BLOCKS", 30).lock();
/**
@@ -738,49 +739,49 @@ public class MaterialTags {
* Covers all Wooden Tools.
*/
public static final MaterialSetTag WOODEN_TOOLS = new MaterialSetTag(keyFor("wooden_tools"))
.add(Material.WOODEN_AXE, Material.WOODEN_HOE, Material.WOODEN_PICKAXE, Material.WOODEN_SHOVEL, Material.WOODEN_SWORD)
.ensureSize("WOODEN_TOOLS", 5).lock();
.add(Material.WOODEN_AXE, Material.WOODEN_HOE, Material.WOODEN_PICKAXE, Material.WOODEN_SHOVEL, Material.WOODEN_SWORD, Material.WOODEN_SPEAR)
.lock();
/**
* Covers all Stone Tools.
*/
public static final MaterialSetTag STONE_TOOLS = new MaterialSetTag(keyFor("stone_tools"))
.add(Material.STONE_AXE, Material.STONE_HOE, Material.STONE_PICKAXE, Material.STONE_SHOVEL, Material.STONE_SWORD)
.ensureSize("STONE_TOOLS", 5).lock();
.add(Material.STONE_AXE, Material.STONE_HOE, Material.STONE_PICKAXE, Material.STONE_SHOVEL, Material.STONE_SWORD, Material.STONE_SPEAR)
.lock();
/**
* Covers all copper Tools.
*/
public static final MaterialSetTag COPPER_TOOLS = new MaterialSetTag(keyFor("copper_tools"))
.add(Material.COPPER_AXE, Material.COPPER_HOE, Material.COPPER_PICKAXE, Material.COPPER_SHOVEL, Material.COPPER_SWORD)
.ensureSize("COPPER_TOOLS", 5).lock();
.add(Material.COPPER_AXE, Material.COPPER_HOE, Material.COPPER_PICKAXE, Material.COPPER_SHOVEL, Material.COPPER_SWORD, Material.COPPER_SPEAR)
.lock();
/**
* Covers all Iron Tools.
*/
public static final MaterialSetTag IRON_TOOLS = new MaterialSetTag(keyFor("iron_tools"))
.add(Material.IRON_AXE, Material.IRON_HOE, Material.IRON_PICKAXE, Material.IRON_SHOVEL, Material.IRON_SWORD)
.ensureSize("IRON_TOOLS", 5).lock();
.add(Material.IRON_AXE, Material.IRON_HOE, Material.IRON_PICKAXE, Material.IRON_SHOVEL, Material.IRON_SWORD, Material.IRON_SPEAR)
.lock();
/**
* Covers all Gold Tools.
*/
public static final MaterialSetTag GOLDEN_TOOLS = new MaterialSetTag(keyFor("golden_tools"))
.add(Material.GOLDEN_AXE, Material.GOLDEN_HOE, Material.GOLDEN_PICKAXE, Material.GOLDEN_SHOVEL, Material.GOLDEN_SWORD)
.ensureSize("GOLDEN_TOOLS", 5).lock();
.add(Material.GOLDEN_AXE, Material.GOLDEN_HOE, Material.GOLDEN_PICKAXE, Material.GOLDEN_SHOVEL, Material.GOLDEN_SWORD, Material.GOLDEN_SPEAR)
.lock();
/**
* Covers all Diamond Tools.
*/
public static final MaterialSetTag DIAMOND_TOOLS = new MaterialSetTag(keyFor("diamond_tools"))
.add(Material.DIAMOND_AXE, Material.DIAMOND_HOE, Material.DIAMOND_PICKAXE, Material.DIAMOND_SHOVEL, Material.DIAMOND_SWORD)
.ensureSize("DIAMOND_TOOLS", 5).lock();
.add(Material.DIAMOND_AXE, Material.DIAMOND_HOE, Material.DIAMOND_PICKAXE, Material.DIAMOND_SHOVEL, Material.DIAMOND_SWORD, Material.DIAMOND_SPEAR)
.lock();
/**
* Covers all Netherite Tools.
*/
public static final MaterialSetTag NETHERITE_TOOLS = new MaterialSetTag(keyFor("netherite_tools"))
.add(Material.NETHERITE_AXE, Material.NETHERITE_HOE, Material.NETHERITE_PICKAXE, Material.NETHERITE_SHOVEL, Material.NETHERITE_SWORD)
.ensureSize("NETHERITE_TOOLS", 5).lock();
.add(Material.NETHERITE_AXE, Material.NETHERITE_HOE, Material.NETHERITE_PICKAXE, Material.NETHERITE_SHOVEL, Material.NETHERITE_SWORD, Material.NETHERITE_SPEAR)
.lock();
}
@@ -5,8 +5,11 @@ import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.datacomponent.item.ResolvableProfile;
import io.papermc.paper.world.damagesource.CombatEntry;
import io.papermc.paper.world.damagesource.FallLocationType;
import java.util.function.Function;
import java.util.function.Predicate;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.util.Services;
import org.bukkit.GameRule;
import org.bukkit.block.Biome;
import org.bukkit.damage.DamageEffect;
import org.bukkit.damage.DamageSource;
@@ -16,8 +19,6 @@ import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.function.Predicate;
/**
* Static bridge to the server internals.
* <p>
@@ -97,5 +98,6 @@ public interface InternalAPIBridge {
SkinParts.Mutable allSkinParts();
Component defaultMannequinDescription();
}
<MODERN, LEGACY> GameRule<LEGACY> legacyGameRuleBridge(GameRule<MODERN> rule, Function<LEGACY, MODERN> fromLegacyToModern, Function<MODERN, LEGACY> toLegacyFromModern, Class<LEGACY> legacyClass);
}
@@ -0,0 +1,56 @@
package io.papermc.paper.block.bed;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.Nullable;
/**
* An action type that represents the action that will happen after
* {@link org.bukkit.event.player.PlayerBedEnterEvent} and that is
* happening during {@link io.papermc.paper.event.player.PlayerBedFailEnterEvent}
*/
@ApiStatus.NonExtendable
@ApiStatus.Experimental
public interface BedEnterAction {
/**
* Gets if the player is allowed to sleep in the bed.
* This can be {@link BedRuleResult#ALLOWED} at the same time as {@link #canSetSpawn()}
* <p>
* It is advised to check for {@link BedEnterProblem}s first, as if it returns anything but {@code null}
* the bed interaction is prevented
*
* @return whether the player is allowed to sleep
*/
BedRuleResult canSleep();
/**
* Gets if the player is allowed to save its spawn point in the bed.
* This can be {@link BedRuleResult#ALLOWED} at the same time as {@link #canSleep()}
* <p>
* It is advised to check for {@link BedEnterProblem}s first, as if it returns anything but {@code null}
* the bed interaction is prevented
*
* @return whether the player is allowed to save its spawn point
*/
BedRuleResult canSetSpawn();
/**
* A problem is an issue that prevents the player from sleeping and from saving its spawn point.
* No problem being found doesn't mean the player successfully slept or set its spawn point,
* see {@link #canSleep()} and {@link #canSetSpawn()} for individual successes
*
* @return any of {@link BedEnterProblem}s if one is found, otherwise {@code null}
*/
@Nullable
BedEnterProblem problem();
/**
* Returns the default error message to be shown as an actionbar message to the player
*
* @return the error message
*/
@Nullable
Component errorMessage();
}
@@ -0,0 +1,27 @@
package io.papermc.paper.block.bed;
import java.util.Optional;
import java.util.ServiceLoader;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
interface BedEnterActionBridge {
static BedEnterActionBridge instance() {
final class Holder {
static final Optional<BedEnterActionBridge> INSTANCE = ServiceLoader.load(BedEnterActionBridge.class, BedEnterActionBridge.class.getClassLoader()).findFirst();
}
return Holder.INSTANCE.orElseThrow();
}
BedEnterProblem createTooFarAwayProblem();
BedEnterProblem createObstructedProblem();
BedEnterProblem createNotSafeProblem();
BedEnterProblem createExplosionProblem();
BedEnterProblem createOtherProblem();
}
@@ -0,0 +1,63 @@
package io.papermc.paper.block.bed;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.Nullable;
/**
* Represents a problem that prevents a player from continuing
* the sleeping process, preventing it from sleeping and from setting
* its spawn point
*/
@ApiStatus.NonExtendable
@ApiStatus.Experimental
public interface BedEnterProblem {
/**
* Happens when the bed is too far away from the player.
* Makes no explosion and has an error message
*
* @see #errorMessage()
*/
BedEnterProblem TOO_FAR_AWAY = BedEnterActionBridge.instance().createTooFarAwayProblem();
/**
* Happens when the bed has blocks one block above it.
* Makes no explosion and has an error message
*
* @see #errorMessage()
*/
BedEnterProblem OBSTRUCTED = BedEnterActionBridge.instance().createObstructedProblem();
/**
* Happens when there are monsters in a 16x10x16 box centered on the bed's head
* and the player is not in creative mode. Makes no explosion and has an error message
*
* @see #errorMessage()
*/
BedEnterProblem NOT_SAFE = BedEnterActionBridge.instance().createNotSafeProblem();
/**
* Happens when the bed is set to explode. This is defined in the environment attributes of the world.
* This doesn't have a fixed error message, see {@link BedEnterAction#errorMessage()}
*/
BedEnterProblem EXPLOSION = BedEnterActionBridge.instance().createExplosionProblem();
/**
* Happens when a player tries to sleep when an invalid state, for example when a player tries
* to sleep but is already sleeping or is dead.
* This doesn't have an error message at all, the interaction is simply discarded
*/
BedEnterProblem OTHER = BedEnterActionBridge.instance().createOtherProblem();
/**
* Returns the error message associated with this problem, if any.
* This component is sent to the client as an actionbar message
* when this problem occur
*
* @return the error message
*/
@Nullable
Component errorMessage();
}
@@ -0,0 +1,37 @@
package io.papermc.paper.block.bed;
import org.jetbrains.annotations.ApiStatus;
/**
* Represents the result of a bed rule during {@link org.bukkit.event.player.PlayerBedEnterEvent}
* and {@link io.papermc.paper.event.player.PlayerBedFailEnterEvent}. Bed rules are responsible
* for allowing players to sleep and to set their spawn point
*/
@ApiStatus.Experimental
public sealed interface BedRuleResult permits BedRuleResultImpl {
/**
* Used when the bed rule is allowed
*/
BedRuleResult ALLOWED = new BedRuleResultImpl(true);
/**
* Used when the bed rule is denied due to there
* being too much light. This is the case during
* daytime without thunderstorms
*/
BedRuleResult TOO_MUCH_LIGHT = new BedRuleResultImpl(false);
/**
* Used when the bed rule is set to always be denied
*/
BedRuleResult NEVER = new BedRuleResultImpl(false);
/**
* Returns {@code true} if this result is a success
*
* @return whether this result is a success
*/
boolean success();
}
@@ -0,0 +1,9 @@
package io.papermc.paper.block.bed;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
record BedRuleResultImpl(
boolean success
) implements BedRuleResult {
}
@@ -0,0 +1,4 @@
@NullMarked
package io.papermc.paper.block.bed;
import org.jspecify.annotations.NullMarked;
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent;
import io.papermc.paper.datacomponent.item.AttackRange;
import io.papermc.paper.datacomponent.item.BannerPatternLayers;
import io.papermc.paper.datacomponent.item.BlockItemDataProperties;
import io.papermc.paper.datacomponent.item.BlocksAttacks;
@@ -21,27 +22,31 @@ import io.papermc.paper.datacomponent.item.ItemContainerContents;
import io.papermc.paper.datacomponent.item.ItemEnchantments;
import io.papermc.paper.datacomponent.item.ItemLore;
import io.papermc.paper.datacomponent.item.JukeboxPlayable;
import io.papermc.paper.datacomponent.item.KineticWeapon;
import io.papermc.paper.datacomponent.item.LodestoneTracker;
import io.papermc.paper.datacomponent.item.MapDecorations;
import io.papermc.paper.datacomponent.item.MapId;
import io.papermc.paper.datacomponent.item.MapItemColor;
import io.papermc.paper.datacomponent.item.OminousBottleAmplifier;
import io.papermc.paper.datacomponent.item.PiercingWeapon;
import io.papermc.paper.datacomponent.item.PotDecorations;
import io.papermc.paper.datacomponent.item.PotionContents;
import io.papermc.paper.datacomponent.item.Repairable;
import io.papermc.paper.datacomponent.item.ResolvableProfile;
import io.papermc.paper.datacomponent.item.SeededContainerLoot;
import io.papermc.paper.datacomponent.item.SuspiciousStewEffects;
import io.papermc.paper.datacomponent.item.SwingAnimation;
import io.papermc.paper.datacomponent.item.Tool;
import io.papermc.paper.datacomponent.item.TooltipDisplay;
import io.papermc.paper.datacomponent.item.UseCooldown;
import io.papermc.paper.datacomponent.item.UseEffects;
import io.papermc.paper.datacomponent.item.UseRemainder;
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 java.util.List;
import io.papermc.paper.registry.tag.TagKey;
import java.util.List;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import org.bukkit.Art;
@@ -51,6 +56,7 @@ import org.bukkit.MusicInstrument;
import org.bukkit.NamespacedKey;
import org.bukkit.Registry;
import org.bukkit.block.banner.PatternType;
import org.bukkit.damage.DamageType;
import org.bukkit.entity.Axolotl;
import org.bukkit.entity.Cat;
import org.bukkit.entity.Chicken;
@@ -67,6 +73,7 @@ import org.bukkit.entity.Salmon;
import org.bukkit.entity.TropicalFish;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.ZombieNautilus;
import org.bukkit.inventory.ItemRarity;
import org.bukkit.inventory.meta.trim.TrimMaterial;
import org.checkerframework.checker.index.qual.NonNegative;
@@ -111,12 +118,16 @@ public final class DataComponentTypes {
* If set, the item will not lose any durability when used.
*/
public static final DataComponentType.NonValued UNBREAKABLE = unvalued("unbreakable");
public static final DataComponentType.Valued<UseEffects> USE_EFFECTS = valued("use_effects");
/**
* Custom name override for an item (as set by renaming with an Anvil).
*
* @see #ITEM_NAME
*/
public static final DataComponentType.Valued<Component> CUSTOM_NAME = valued("custom_name");
public static final DataComponentType.Valued<Float> MINIMUM_ATTACK_CHARGE = valued("minimum_attack_charge");
public static final DataComponentType.Valued<DamageType> DAMAGE_TYPE = valued("damage_type");
/**
* When present, replaces default item name with contained chat component.
* <p>
@@ -210,6 +221,10 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<Key> TOOLTIP_STYLE = valued("tooltip_style");
public static final DataComponentType.Valued<DeathProtection> DEATH_PROTECTION = valued("death_protection");
public static final DataComponentType.Valued<BlocksAttacks> BLOCKS_ATTACKS = valued("blocks_attacks");
public static final DataComponentType.Valued<PiercingWeapon> PIERCING_WEAPON = valued("piercing_weapon");
public static final DataComponentType.Valued<KineticWeapon> KINETIC_WEAPON = valued("kinetic_weapon");
public static final DataComponentType.Valued<AttackRange> ATTACK_RANGE = valued("attack_range");
public static final DataComponentType.Valued<SwingAnimation> SWING_ANIMATION = valued("swing_animation");
/**
* Stores list of enchantments and their levels for an Enchanted Book.
* Unlike {@link #ENCHANTMENTS}, the effects provided by enchantments
@@ -371,6 +386,7 @@ public final class DataComponentTypes {
public static final DataComponentType.Valued<Art> PAINTING_VARIANT = valued("painting/variant");
public static final DataComponentType.Valued<Llama.Color> LLAMA_VARIANT = valued("llama/variant");
public static final DataComponentType.Valued<Axolotl.Variant> AXOLOTL_VARIANT = valued("axolotl/variant");
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<DyeColor> CAT_COLLAR = valued("cat/collar");
public static final DataComponentType.Valued<DyeColor> SHEEP_COLOR = valued("sheep/color");
@@ -0,0 +1,55 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Range;
import org.jspecify.annotations.NullMarked;
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface AttackRange {
/**
* Returns a new builder for creating an Attack Range.
*
* @return a builder instance
*/
@Contract(value = "-> new", pure = true)
static Builder attackRange() {
return ItemComponentTypesBridge.bridge().attackRange();
}
@Contract(pure = true)
@Range(from = 0, to = 64) float minReach();
@Contract(pure = true)
@Range(from = 0, to = 64) float maxReach();
@Contract(pure = true)
@Range(from = 0, to = 1) float hitboxMargin();
@Contract(pure = true)
@Range(from = 0, to = 2) float mobFactor();
/**
* Builder for {@link AttackRange}.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<AttackRange> {
@Contract(value = "_ -> this", mutates = "this")
Builder minReach(@Range(from = 0, to = 64) float minReach);
@Contract(value = "_ -> this", mutates = "this")
Builder maxReach(@Range(from = 0, to = 64) float maxReach);
@Contract(value = "_ -> this", mutates = "this")
Builder hitboxMargin(@Range(from = 0, to = 1) float hitboxMargin);
@Contract(value = "_ -> this", mutates = "this")
Builder mobFactor(@Range(from = 0, to = 2) float mobFactor);
}
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.tag.TagKey;
import java.util.List;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
@@ -32,7 +33,8 @@ public interface BlocksAttacks {
*
* @return the delay in seconds
*/
float blockDelaySeconds();
@Contract(pure = true)
@NonNegative float blockDelaySeconds();
/**
* Gets the multiplier applied to the cooldown time for the item when attacked by a disabling attack (the multiplier for {@link Weapon#disableBlockingForSeconds()}).
@@ -41,13 +43,15 @@ public interface BlocksAttacks {
*
* @return the multiplier for the cooldown time
*/
float disableCooldownScale();
@Contract(pure = true)
@NonNegative float disableCooldownScale();
/**
* Gets a list of {@link DamageReduction} of how much damage should be blocked in a given attack.
*
* @return a list of damage reductions
*/
@Contract(pure = true)
List<DamageReduction> damageReductions();
/**
@@ -55,6 +59,7 @@ public interface BlocksAttacks {
*
* @return the damage function
*/
@Contract(pure = true)
ItemDamageFunction itemDamage();
/**
@@ -62,6 +67,7 @@ public interface BlocksAttacks {
*
* @return a damage type tag key, or null if there is no such tag key
*/
@Contract(pure = true)
@Nullable TagKey<DamageType> bypassedBy();
/**
@@ -69,6 +75,7 @@ public interface BlocksAttacks {
*
* @return a key of the sound
*/
@Contract(pure = true)
@Nullable Key blockSound();
/**
@@ -76,6 +83,7 @@ public interface BlocksAttacks {
*
* @return a key of the sound
*/
@Contract(pure = true)
@Nullable Key disableSound();
/**
@@ -86,10 +94,10 @@ public interface BlocksAttacks {
interface Builder extends DataComponentBuilder<BlocksAttacks> {
@Contract(value = "_ -> this", mutates = "this")
Builder blockDelaySeconds(float delay);
Builder blockDelaySeconds(@NonNegative float delay);
@Contract(value = "_ -> this", mutates = "this")
Builder disableCooldownScale(float scale);
Builder disableCooldownScale(@NonNegative float scale);
@Contract(value = "_ -> this", mutates = "this")
Builder addDamageReduction(DamageReduction reduction);
@@ -15,7 +15,7 @@ import org.jspecify.annotations.NullMarked;
@ApiStatus.NonExtendable
public interface DyedItemColor {
@Contract(value = "_, _ -> new", pure = true)
@Contract(value = "_ -> new", pure = true)
static DyedItemColor dyedItemColor(final Color color) {
return dyedItemColor().color(color).build();
}
@@ -117,4 +117,16 @@ interface ItemComponentTypesBridge {
TooltipDisplay.Builder tooltipDisplay();
Weapon.Builder weapon();
KineticWeapon.Builder kineticWeapon();
UseEffects.Builder useEffects();
PiercingWeapon.Builder piercingWeapon();
AttackRange.Builder attackRange();
SwingAnimation.Builder swingAnimation();
KineticWeapon.Condition kineticWeaponCondition(int maxDurationTicks, float minSpeed, float minRelativeSpeed);
}
@@ -19,7 +19,7 @@ import org.jspecify.annotations.NullMarked;
@ApiStatus.NonExtendable
public interface ItemEnchantments {
@Contract(value = "_, _ -> new", pure = true)
@Contract(value = "_ -> new", pure = true)
static ItemEnchantments itemEnchantments(final Map<Enchantment, @IntRange(from = 1, to = 255) Integer> enchantments) {
return itemEnchantments().addAll(enchantments).build();
}
@@ -0,0 +1,106 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import net.kyori.adventure.key.Key;
import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Range;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface KineticWeapon {
/**
* Returns a new builder for creating a Kinetic Weapon.
*
* @return a builder instance
*/
@Contract(value = "-> new", pure = true)
static Builder kineticWeapon() {
return ItemComponentTypesBridge.bridge().kineticWeapon();
}
/**
* Creates a {@link Condition} object.
*/
@Contract(value = "_, _, _ -> new", pure = true)
static Condition condition(final @NonNegative int maxDurationTicks, final float minSpeed, final float minRelativeSpeed) {
return ItemComponentTypesBridge.bridge().kineticWeaponCondition(maxDurationTicks, minSpeed, minRelativeSpeed);
}
@Contract(pure = true)
@NonNegative int contactCooldownTicks();
@Contract(pure = true)
@NonNegative int delayTicks();
@Contract(pure = true)
@Nullable Condition dismountConditions();
@Contract(pure = true)
@Nullable Condition knockbackConditions();
@Contract(pure = true)
@Nullable Condition damageConditions();
float forwardMovement();
float damageMultiplier();
@Contract(pure = true)
@Nullable Key sound();
@Contract(pure = true)
@Nullable Key hitSound();
interface Condition {
@Contract(pure = true)
@NonNegative int maxDurationTicks();
@Contract(pure = true)
float minSpeed();
@Contract(pure = true)
float minRelativeSpeed();
}
/**
* Builder for {@link KineticWeapon}.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<KineticWeapon> {
@Contract(value = "_ -> this", mutates = "this")
Builder contactCooldownTicks(@NonNegative int ticks);
@Contract(value = "_ -> this", mutates = "this")
Builder delayTicks(@NonNegative int ticks);
@Contract(value = "_ -> this", mutates = "this")
Builder dismountConditions(@Nullable Condition condition);
@Contract(value = "_ -> this", mutates = "this")
Builder knockbackConditions(@Nullable Condition condition);
@Contract(value = "_ -> this", mutates = "this")
Builder damageConditions(@Nullable Condition condition);
@Contract(value = "_ -> this", mutates = "this")
Builder forwardMovement(float forwardMovement);
@Contract(value = "_ -> this", mutates = "this")
Builder damageMultiplier(float damageMultiplier);
@Contract(value = "_ -> this", mutates = "this")
Builder sound(Key sound);
@Contract(value = "_ -> this", mutates = "this")
Builder hitSound(Key sound);
}
}
@@ -0,0 +1,52 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import net.kyori.adventure.key.Key;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.Range;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface PiercingWeapon {
/**
* Returns a new builder for creating a Piercing Weapon.
*
* @return a builder instance
*/
static Builder piercingWeapon() {
return ItemComponentTypesBridge.bridge().piercingWeapon();
}
boolean dealsKnockback();
boolean dismounts();
@Nullable Key sound();
@Nullable Key hitSound();
/**
* Builder for {@link PiercingWeapon}.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<PiercingWeapon> {
@Contract(value = "_ -> this", mutates = "this")
Builder dealsKnockback(boolean dealsKnockback);
@Contract(value = "_ -> this", mutates = "this")
Builder dismounts(boolean dismounts);
@Contract(value = "_ -> this", mutates = "this")
Builder sound(@Nullable Key sound);
@Contract(value = "_ -> this", mutates = "this")
Builder hitSound(@Nullable Key sound);
}
}
@@ -0,0 +1,60 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import org.checkerframework.checker.index.qual.Positive;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface SwingAnimation {
@Contract(value = "-> new", pure = true)
static Builder swingAnimation() {
return ItemComponentTypesBridge.bridge().swingAnimation();
}
@Contract(pure = true)
Animation type();
@Contract(pure = true)
@Positive int duration();
enum Animation {
// Start generate - SwingAnimationType
NONE,
WHACK,
STAB;
// End generate - SwingAnimationType
}
/**
* Builder for {@link SwingAnimation}.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<SwingAnimation> {
/**
* Sets the swing animation type.
*
* @param type animation type
* @return the builder for chaining
* @see #type()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder type(Animation type);
/**
* Sets the swing animation duration in ticks.
*
* @param duration duration (>= 0)
* @return the builder for chaining
* @see #duration()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder duration(@Positive int duration);
}
}
@@ -2,12 +2,11 @@ package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.DataComponentType;
import java.util.Set;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
import java.util.Set;
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
@@ -0,0 +1,68 @@
package io.papermc.paper.datacomponent.item;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jspecify.annotations.NullMarked;
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface UseEffects {
/**
* Returns a new builder for creating a UseEffects component.
*
* @return a builder instance.
*/
static Builder useEffects() {
return ItemComponentTypesBridge.bridge().useEffects();
}
@Contract(pure = true)
boolean canSprint();
@Contract(pure = true)
boolean interactVibrations();
@Contract(pure = true)
float speedMultiplier();
/**
* Builder for {@link UseEffects}.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends DataComponentBuilder<UseEffects> {
/**
* Sets whether the player can sprint while using the item.
*
* @param canSprint true to allow sprinting
* @return the builder for chaining
* @see #canSprint()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder canSprint(boolean canSprint);
/**
* Sets whether using the item generates interaction vibrations.
*
* @param interactVibrations true to generate vibrations
* @return the builder for chaining
* @see #interactVibrations()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder interactVibrations(boolean interactVibrations);
/**
* Sets the speed multiplier while using the item.
*
* @param speedMultiplier multiplier (1.0 >= value >= 0.0)
* @return the builder for chaining
* @see #speedMultiplier()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder speedMultiplier(float speedMultiplier);
}
}
@@ -13,11 +13,12 @@ public enum ItemUseAnimation {
DRINK,
BLOCK,
BOW,
SPEAR,
TRIDENT,
CROSSBOW,
SPYGLASS,
TOOT_HORN,
BRUSH,
BUNDLE;
BUNDLE,
SPEAR;
// End generate - ItemUseAnimation
}
@@ -1,5 +1,6 @@
package io.papermc.paper.event.player;
import io.papermc.paper.block.bed.BedEnterAction;
import net.kyori.adventure.text.Component;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@@ -17,24 +18,41 @@ public class PlayerBedFailEnterEvent extends PlayerEvent implements Cancellable
private final FailReason failReason;
private final Block bed;
private final BedEnterAction enterAction;
private boolean willExplode;
private @Nullable Component message;
private boolean cancelled;
@ApiStatus.Internal
public PlayerBedFailEnterEvent(final Player player, final FailReason failReason, final Block bed, final boolean willExplode, final @Nullable Component message) {
public PlayerBedFailEnterEvent(final Player player, final FailReason failReason, final Block bed, final boolean willExplode, final @Nullable Component message, BedEnterAction enterAction) {
super(player);
this.failReason = failReason;
this.bed = bed;
this.enterAction = enterAction;
this.willExplode = willExplode;
this.message = message;
}
/**
* @deprecated This enum has been replaced with a system that better
* represents how beds work. See {@link #enterAction}
*/
@ApiStatus.Obsolete(since = "1.21.11")
public FailReason getFailReason() {
return this.failReason;
}
/**
* This describes the default outcome of this event.
*
* @return the action representing the default outcome of this event
*/
@ApiStatus.Experimental
public BedEnterAction enterAction() {
return this.enterAction;
}
public Block getBed() {
return this.bed;
}
@@ -80,10 +98,16 @@ public class PlayerBedFailEnterEvent extends PlayerEvent implements Cancellable
return HANDLER_LIST;
}
/**
* @deprecated Enums no longer represents reliably how beds work and fail. This has been
* replaced with {@link BedEnterAction} that better fits the new beds
*/
@ApiStatus.Obsolete(since = "1.21.11")
public enum FailReason {
/**
* The world doesn't allow sleeping (ex. Nether or The End). Entering
* the bed is prevented and the bed explodes.
* the bed is prevented but the bed doesn't explode. When the bed
* explodes, {@link #EXPLOSION} is used instead.
*/
NOT_POSSIBLE_HERE,
/**
@@ -110,6 +134,10 @@ public class PlayerBedFailEnterEvent extends PlayerEvent implements Cancellable
/**
* Entering the bed is prevented due to there being monsters nearby.
*/
NOT_SAFE
NOT_SAFE,
/**
* Entering the bed is prevented and the bed explodes.
*/
EXPLOSION
}
}
@@ -19,7 +19,7 @@ public class WorldGameRuleChangeEvent extends WorldEvent implements Cancellable
private static final HandlerList HANDLER_LIST = new HandlerList();
private final @Nullable CommandSender commandSender;
private final GameRule<?> gameRule;
protected final GameRule<?> gameRule;
private String value;
private boolean cancelled;
@@ -1,10 +1,15 @@
package io.papermc.paper.event.world.border;
import com.google.common.base.Preconditions;
import io.papermc.paper.util.Tick;
import java.time.Duration;
import org.bukkit.World;
import org.bukkit.WorldBorder;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Range;
import org.jspecify.annotations.NullMarked;
/**
@@ -63,16 +68,41 @@ public class WorldBorderBoundsChangeEvent extends WorldBorderEvent implements Ca
* @param newSize the new size
*/
public void setNewSize(final double newSize) {
this.newSize = Math.min(this.worldBorder.getMaxSize(), Math.max(1.0D, newSize));
this.newSize = Math.clamp(newSize, 1.0D, this.worldBorder.getMaxSize());
}
/**
* Gets the time in ticks for the change. Will be 0 if instant.
*
* @return the time in ticks for the change
*/
public @Range(from = 0, to = Integer.MAX_VALUE) long getDurationTicks() {
return this.duration;
}
/**
* Sets the time in ticks for the change. Will change {@link #getType()} to return
* {@link Type#STARTED_MOVE}.
*
* @param duration the time in ticks for the change
*/
public void setDurationTicks(final @Range(from = 0, to = Integer.MAX_VALUE) long duration) {
Preconditions.checkArgument(duration >= 0 && duration <= Integer.MAX_VALUE, "duration must be between 0-%s", Integer.MAX_VALUE);
this.duration = duration;
if (this.type == Type.INSTANT_MOVE) {
this.type = Type.STARTED_MOVE;
}
}
/**
* Gets the time in milliseconds for the change. Will be 0 if instant.
*
* @return the time in milliseconds for the change
* @deprecated in favor of {@link #getDurationTicks()}
*/
public long getDuration() {
return this.duration;
@Deprecated(forRemoval = true, since = "1.21.11")
public @NonNegative long getDuration() {
return Tick.of(this.getDurationTicks()).toMillis();
}
/**
@@ -80,13 +110,11 @@ public class WorldBorderBoundsChangeEvent extends WorldBorderEvent implements Ca
* {@link Type#STARTED_MOVE}.
*
* @param duration the time in milliseconds for the change
* @deprecated in favor of {@link #setDurationTicks(long)}
*/
public void setDuration(final long duration) {
// PAIL: TODO: Magic Values
this.duration = Math.min(9223372036854775L, Math.max(0L, duration));
if (duration >= 0 && this.type == Type.INSTANT_MOVE) {
this.type = Type.STARTED_MOVE;
}
@Deprecated(forRemoval = true, since = "1.21.11")
public void setDuration(final @NonNegative long duration) {
this.setDurationTicks(Tick.tick().fromDuration(Duration.ofMillis(duration)));
}
@Override
@@ -9,6 +9,7 @@ import net.kyori.adventure.key.Keyed;
import org.bukkit.Art;
import org.bukkit.Fluid;
import org.bukkit.GameEvent;
import org.bukkit.GameRule;
import org.bukkit.JukeboxSong;
import org.bukkit.MusicInstrument;
import org.bukkit.Particle;
@@ -27,6 +28,7 @@ import org.bukkit.entity.Frog;
import org.bukkit.entity.Pig;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.ZombieNautilus;
import org.bukkit.entity.memory.MemoryKey;
import org.bukkit.generator.structure.Structure;
import org.bukkit.generator.structure.StructureType;
@@ -125,8 +127,11 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @see io.papermc.paper.registry.keys.DataComponentTypeKeys
*/
RegistryKey<DataComponentType> DATA_COMPONENT_TYPE = create("data_component_type");
/**
* Built-in registry for game rules.
* @see io.papermc.paper.registry.keys.GameRuleKeys
*/
RegistryKey<GameRule<?>> GAME_RULE = create("game_rule");
/* ********************** *
* Data-driven Registries *
@@ -216,6 +221,11 @@ public sealed interface RegistryKey<T> extends Keyed permits RegistryKeyImpl {
* @see io.papermc.paper.registry.keys.PigVariantKeys
*/
RegistryKey<Pig.Variant> PIG_VARIANT = create("pig_variant");
/**
* Data-driven registry for zombie nautilus variants.
* @see io.papermc.paper.registry.keys.ZombieNautilusVariantKeys
*/
RegistryKey<ZombieNautilus.Variant> ZOMBIE_NAUTILUS_VARIANT = create("zombie_nautilus_variant");
/**
* Data-driven registry for dialogs.
* @see io.papermc.paper.registry.keys.DialogKeys
@@ -157,7 +157,7 @@ public interface EnchantmentRegistryEntry {
* a tag obtained via {@link RegistryComposeEvent#getOrCreateTag(TagKey)} with
* tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_MELEE_WEAPON}.
*
* @param supportedItems the registry key set representing the supported items.
* @return this builder instance.
@@ -174,7 +174,7 @@ public interface EnchantmentRegistryEntry {
* {@link RegistryComposeEvent#getOrCreateTag(TagKey)} with
* tag keys found in {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys} such as
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_ARMOR} and
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_SWORD}.
* {@link io.papermc.paper.registry.keys.tags.ItemTypeTagKeys#ENCHANTABLE_MELEE_WEAPON}.
* <p>
* Defaults to {@code null} which means all {@link #supportedItems()} are considered primary items.
* Additionally, the tag {@link io.papermc.paper.registry.keys.tags.EnchantmentTagKeys#IN_ENCHANTING_TABLE} defines
@@ -0,0 +1,78 @@
package io.papermc.paper.registry.data;
import io.papermc.paper.registry.RegistryBuilder;
import io.papermc.paper.registry.data.client.ClientTextureAsset;
import org.bukkit.entity.ZombieNautilus;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
/**
* A data-centric version-specific registry entry for the {@link org.bukkit.entity.ZombieNautilus.Variant} type.
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ZombieNautilusVariantRegistryEntry {
/**
* The model of the variant to render the configured texture on.
*/
enum Model {
/**
* The normal model.
*/
NORMAL,
/**
* The warm model.
*/
WARM,
}
/**
* Provides the client texture asset of the variant, which represents the texture to use.
*
* @return the client texture asset.
*/
ClientTextureAsset clientTextureAsset();
/**
* Provides the model of the variant.
*
* @return the model.
*/
Model model();
/**
* A mutable builder for the {@link ZombieNautilusVariantRegistryEntry} plugins may change in applicable registry events.
* <p>
* The following values are required for each builder:
* <ul>
* <li>{@link #clientTextureAsset(ClientTextureAsset)}</li>
* <li>{@link #model(Model)}</li>
* </ul>
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
interface Builder extends ZombieNautilusVariantRegistryEntry, RegistryBuilder<ZombieNautilus.Variant> {
/**
* Sets the client texture asset of the variant, which is the location of the texture to use.
*
* @param clientTextureAsset the client texture asset.
* @return this builder instance.
* @see ZombieNautilusVariantRegistryEntry#clientTextureAsset()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder clientTextureAsset(ClientTextureAsset clientTextureAsset);
/**
* Sets the model to use for this variant.
*
* @param model the model.
* @return this builder instance.
* @see ZombieNautilusVariantRegistryEntry#model()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder model(Model model);
}
}
@@ -15,6 +15,7 @@ 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.WolfVariantRegistryEntry;
import io.papermc.paper.registry.data.ZombieNautilusVariantRegistryEntry;
import io.papermc.paper.registry.data.dialog.DialogRegistryEntry;
import org.bukkit.Art;
import org.bukkit.GameEvent;
@@ -29,6 +30,7 @@ import org.bukkit.entity.Cow;
import org.bukkit.entity.Frog;
import org.bukkit.entity.Pig;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.ZombieNautilus;
import static io.papermc.paper.registry.event.RegistryEventProviderImpl.create;
@@ -52,6 +54,7 @@ public final class RegistryEvents {
public static final RegistryEventProvider<Chicken.Variant, ChickenVariantRegistryEntry.Builder> CHICKEN_VARIANT = create(RegistryKey.CHICKEN_VARIANT);
public static final RegistryEventProvider<Cow.Variant, CowVariantRegistryEntry.Builder> COW_VARIANT = create(RegistryKey.COW_VARIANT);
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);
// End generate - RegistryEvents
+4 -13
View File
@@ -1,5 +1,6 @@
package org.bukkit;
import com.google.common.base.Enums;
import com.google.common.collect.Maps;
import java.util.Map;
import org.bukkit.block.BlockFace;
@@ -442,7 +443,6 @@ public enum Effect {
SOUND_WITH_CHARGE_SHOT(1051, Type.SOUND),
;
private static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger();
// Paper end
private final int id;
@@ -512,22 +512,13 @@ public enum Effect {
static {
for (Effect effect : values()) {
if (!isDeprecated(effect)) // Paper
if (Enums.getField(effect).isAnnotationPresent(Deprecated.class)) {
continue;
}
BY_ID.put(effect.id, effect);
}
}
// Paper start
private static boolean isDeprecated(Effect effect) {
try {
return Effect.class.getDeclaredField(effect.name()).isAnnotationPresent(Deprecated.class);
} catch (NoSuchFieldException e) {
LOGGER.error("Error getting effect enum field {}", effect.name(), e);
return false;
}
}
// Paper end
/**
* Represents the type of an effect.
* @deprecated not representative of what Effect does
@@ -60,6 +60,10 @@ public enum EntityEffect {
* delay, only the speed at which the entity in the spawner spins.
*/
RESET_SPAWNER_MINECART_DELAY(1, SpawnerMinecart.class),
/**
* When a kinetic weapon hits an entity.
*/
HIT(2, LivingEntity.class),
/**
* When mobs get hurt.
*
@@ -11,7 +11,7 @@ public enum ExplosionResult {
/**
* Represents an explosion where no change took place.
*
* This is the case when {@link org.bukkit.GameRule#MOB_GRIEFING} is
* This is the case when {@link org.bukkit.GameRules#MOB_GRIEFING} is
* disabled.
*/
KEEP,
@@ -19,8 +19,8 @@ public enum ExplosionResult {
* Represents an explosion where all destroyed blocks drop their items.
*
* This is the case when
* {@link org.bukkit.GameRule#TNT_EXPLOSION_DROP_DECAY} or
* {@link org.bukkit.GameRule#BLOCK_EXPLOSION_DROP_DECAY} is disabled.
* {@link org.bukkit.GameRules#TNT_EXPLOSION_DROP_DECAY} or
* {@link org.bukkit.GameRules#BLOCK_EXPLOSION_DROP_DECAY} is disabled.
*/
DESTROY,
/**
+290 -175
View File
@@ -1,9 +1,10 @@
package org.bukkit;
import com.google.common.base.Preconditions;
import io.papermc.paper.InternalAPIBridge;
import io.papermc.paper.world.flag.FeatureDependant;
import java.util.HashMap;
import java.util.Map;
import java.util.function.UnaryOperator;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -15,343 +16,469 @@ import org.jetbrains.annotations.Nullable;
* Wiki</a>
*
* @param <T> type of rule (Boolean or Integer)
* @see GameRules
*/
public final class GameRule<T> implements net.kyori.adventure.translation.Translatable, FeatureDependant {
@ApiStatus.NonExtendable
public abstract class GameRule<T> implements net.kyori.adventure.translation.Translatable, FeatureDependant, Keyed {
private static Map<String, GameRule<?>> gameRules = new HashMap<>();
// Boolean rules
/**
* Toggles the announcing of advancements.
*
* @deprecated renamed to {@link GameRules#SHOW_ADVANCEMENT_MESSAGES}
*/
public static final GameRule<Boolean> ANNOUNCE_ADVANCEMENTS = new GameRule<>("announceAdvancements", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> ANNOUNCE_ADVANCEMENTS = GameRules.SHOW_ADVANCEMENT_MESSAGES;
/**
* Whether command blocks should notify admins when they perform commands.
*
* @deprecated renamed to {@link GameRules#COMMAND_BLOCK_OUTPUT}
*/
public static final GameRule<Boolean> COMMAND_BLOCK_OUTPUT = new GameRule<>("commandBlockOutput", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> COMMAND_BLOCK_OUTPUT = GameRules.COMMAND_BLOCK_OUTPUT;
/**
* Whether the server should skip checking player speed.
*
* @deprecated renamed to {@link GameRules#PLAYER_MOVEMENT_CHECK} (inverted)
*/
public static final GameRule<Boolean> DISABLE_PLAYER_MOVEMENT_CHECK = new GameRule<>("disablePlayerMovementCheck", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DISABLE_PLAYER_MOVEMENT_CHECK = InternalAPIBridge.get().legacyGameRuleBridge(GameRules.PLAYER_MOVEMENT_CHECK, inverseBool(), inverseBool(), Boolean.class);
/**
* Whether the server should skip checking player speed when the player is
* wearing elytra.
*
* @deprecated renamed to {@link GameRules#ELYTRA_MOVEMENT_CHECK} (inverted)
*/
public static final GameRule<Boolean> DISABLE_ELYTRA_MOVEMENT_CHECK = new GameRule<>("disableElytraMovementCheck", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DISABLE_ELYTRA_MOVEMENT_CHECK = InternalAPIBridge.get().legacyGameRuleBridge(GameRules.ELYTRA_MOVEMENT_CHECK, inverseBool(), inverseBool(), Boolean.class);
/**
* Whether time progresses from the current moment.
*
* @deprecated renamed to {@link GameRules#ADVANCE_TIME}
*/
public static final GameRule<Boolean> DO_DAYLIGHT_CYCLE = new GameRule<>("doDaylightCycle", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_DAYLIGHT_CYCLE = GameRules.ADVANCE_TIME;
/**
* Whether entities that are not mobs should have drops.
*
* @deprecated renamed to {@link GameRules#ENTITY_DROPS}
*/
public static final GameRule<Boolean> DO_ENTITY_DROPS = new GameRule<>("doEntityDrops", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_ENTITY_DROPS = GameRules.ENTITY_DROPS;
/**
* Whether fire should spread and naturally extinguish.
*
* @deprecated use {@link GameRules#FIRE_SPREAD_RADIUS_AROUND_PLAYER}
*/
public static final GameRule<Boolean> DO_FIRE_TICK = new GameRule<>("doFireTick", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_FIRE_TICK = InternalAPIBridge.get().legacyGameRuleBridge(GameRules.FIRE_SPREAD_RADIUS_AROUND_PLAYER, (value) -> value ? 128 : 0, (value) -> value != 0, Boolean.class);
/**
* Whether players should only be able to craft recipes they've unlocked
* first.
*
* @deprecated renamed to {@link GameRules#LIMITED_CRAFTING}
*/
public static final GameRule<Boolean> DO_LIMITED_CRAFTING = new GameRule<>("doLimitedCrafting", Boolean.class);
/**
* Whether mobs should drop items.
*/
public static final GameRule<Boolean> DO_MOB_LOOT = new GameRule<>("doMobLoot", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_LIMITED_CRAFTING = GameRules.LIMITED_CRAFTING;
/**
* Whether projectiles can break blocks.
*
* @deprecated renamed to {@link GameRules#PROJECTILES_CAN_BREAK_BLOCKS}
*/
public static final GameRule<Boolean> PROJECTILES_CAN_BREAK_BLOCKS = new GameRule<>("projectilesCanBreakBlocks", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> PROJECTILES_CAN_BREAK_BLOCKS = GameRules.PROJECTILES_CAN_BREAK_BLOCKS;
/**
* Whether mobs should drop items.
*
* @deprecated renamed to {@link GameRules#MOB_DROPS}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_MOB_LOOT = GameRules.MOB_DROPS;
/**
* Whether mobs should naturally spawn.
*
* @deprecated renamed to {@link GameRules#SPAWN_MOBS}
*/
public static final GameRule<Boolean> DO_MOB_SPAWNING = new GameRule<>("doMobSpawning", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_MOB_SPAWNING = GameRules.SPAWN_MOBS;
/**
* Whether blocks should have drops.
*
* @deprecated renamed to {@link GameRules#BLOCK_DROPS}
*/
public static final GameRule<Boolean> DO_TILE_DROPS = new GameRule<>("doTileDrops", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_TILE_DROPS = GameRules.BLOCK_DROPS;
/**
* Whether the weather will change from the current moment.
*
* @deprecated renamed to {@link GameRules#ADVANCE_WEATHER}
*/
public static final GameRule<Boolean> DO_WEATHER_CYCLE = new GameRule<>("doWeatherCycle", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_WEATHER_CYCLE = GameRules.ADVANCE_WEATHER;
/**
* Whether the player should keep items in their inventory after death.
*
* @deprecated renamed to {@link GameRules#KEEP_INVENTORY}
*/
public static final GameRule<Boolean> KEEP_INVENTORY = new GameRule<>("keepInventory", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> KEEP_INVENTORY = GameRules.KEEP_INVENTORY;
/**
* Whether to log admin commands to server log.
*
* @deprecated renamed to {@link GameRules#LOG_ADMIN_COMMANDS}
*/
public static final GameRule<Boolean> LOG_ADMIN_COMMANDS = new GameRule<>("logAdminCommands", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> LOG_ADMIN_COMMANDS = GameRules.LOG_ADMIN_COMMANDS;
/**
* Whether mobs can pick up items or change blocks.
*
* @deprecated renamed to {@link GameRules#MOB_GRIEFING}
*/
public static final GameRule<Boolean> MOB_GRIEFING = new GameRule<>("mobGriefing", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> MOB_GRIEFING = GameRules.MOB_GRIEFING;
/**
* Whether players can regenerate health naturally through their hunger bar.
*
* @deprecated renamed to {@link GameRules#NATURAL_HEALTH_REGENERATION}
*/
public static final GameRule<Boolean> NATURAL_REGENERATION = new GameRule<>("naturalRegeneration", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> NATURAL_REGENERATION = GameRules.NATURAL_HEALTH_REGENERATION;
/**
* Whether the debug screen shows all or reduced information.
*
* @deprecated renamed to {@link GameRules#REDUCED_DEBUG_INFO}
*/
public static final GameRule<Boolean> REDUCED_DEBUG_INFO = new GameRule<>("reducedDebugInfo", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> REDUCED_DEBUG_INFO = GameRules.REDUCED_DEBUG_INFO;
/**
* Whether the feedback from commands executed by a player should show up in
* chat. Also affects the default behavior of whether command blocks store
* their output text.
*
* @deprecated renamed to {@link GameRules#SEND_COMMAND_FEEDBACK}
*/
public static final GameRule<Boolean> SEND_COMMAND_FEEDBACK = new GameRule<>("sendCommandFeedback", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> SEND_COMMAND_FEEDBACK = GameRules.SEND_COMMAND_FEEDBACK;
/**
* Whether a message appears in chat when a player dies.
*
* @deprecated renamed to {@link GameRules#SHOW_DEATH_MESSAGES}
*/
public static final GameRule<Boolean> SHOW_DEATH_MESSAGES = new GameRule<>("showDeathMessages", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> SHOW_DEATH_MESSAGES = GameRules.SHOW_DEATH_MESSAGES;
/**
* Whether players in spectator mode can generate chunks.
*
* @deprecated renamed to {@link GameRules#SPECTATORS_GENERATE_CHUNKS}
*/
public static final GameRule<Boolean> SPECTATORS_GENERATE_CHUNKS = new GameRule<>("spectatorsGenerateChunks", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> SPECTATORS_GENERATE_CHUNKS = GameRules.SPECTATORS_GENERATE_CHUNKS;
/**
* Whether pillager raids are enabled or not.
*
* @deprecated renamed to {@link GameRules#RAIDS} (inverted)
*/
public static final GameRule<Boolean> DISABLE_RAIDS = new GameRule<>("disableRaids", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DISABLE_RAIDS = InternalAPIBridge.get().legacyGameRuleBridge(GameRules.RAIDS, inverseBool(), inverseBool(), Boolean.class);
/**
* Whether phantoms will appear without sleeping or not.
*
* @deprecated renamed to {@link GameRules#SPAWN_PHANTOMS}
*/
public static final GameRule<Boolean> DO_INSOMNIA = new GameRule<>("doInsomnia", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_INSOMNIA = GameRules.SPAWN_PHANTOMS;
/**
* Whether clients will respawn immediately after death or not.
*
* @deprecated renamed to {@link GameRules#IMMEDIATE_RESPAWN}
*/
public static final GameRule<Boolean> DO_IMMEDIATE_RESPAWN = new GameRule<>("doImmediateRespawn", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_IMMEDIATE_RESPAWN = GameRules.IMMEDIATE_RESPAWN;
/**
* Whether drowning damage is enabled or not.
*
* @deprecated renamed to {@link GameRules#DROWNING_DAMAGE}
*/
public static final GameRule<Boolean> DROWNING_DAMAGE = new GameRule<>("drowningDamage", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DROWNING_DAMAGE = GameRules.DROWNING_DAMAGE;
/**
* Whether fall damage is enabled or not.
*
* @deprecated renamed to {@link GameRules#FALL_DAMAGE}
*/
public static final GameRule<Boolean> FALL_DAMAGE = new GameRule<>("fallDamage", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> FALL_DAMAGE = GameRules.FALL_DAMAGE;
/**
* Whether fire damage is enabled or not.
*
* @deprecated renamed to {@link GameRules#FIRE_DAMAGE}
*/
public static final GameRule<Boolean> FIRE_DAMAGE = new GameRule<>("fireDamage", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> FIRE_DAMAGE = GameRules.FIRE_DAMAGE;
/**
* Whether freeze damage is enabled or not.
*
* @deprecated renamed to {@link GameRules#FREEZE_DAMAGE}
*/
public static final GameRule<Boolean> FREEZE_DAMAGE = new GameRule<>("freezeDamage", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> FREEZE_DAMAGE = GameRules.FREEZE_DAMAGE;
/**
* Whether patrols should naturally spawn.
*
* @deprecated renamed to {@link GameRules#SPAWN_PATROLS}
*/
public static final GameRule<Boolean> DO_PATROL_SPAWNING = new GameRule<>("doPatrolSpawning", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_PATROL_SPAWNING = GameRules.SPAWN_PATROLS;
/**
* Whether traders should naturally spawn.
*
* @deprecated renamed to {@link GameRules#SPAWN_WANDERING_TRADERS}
*/
public static final GameRule<Boolean> DO_TRADER_SPAWNING = new GameRule<>("doTraderSpawning", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_TRADER_SPAWNING = GameRules.SPAWN_WANDERING_TRADERS;
/**
* Whether wardens should naturally spawn.
*
* @deprecated renamed to {@link GameRules#SPAWN_WARDENS}
*/
public static final GameRule<Boolean> DO_WARDEN_SPAWNING = new GameRule<>("doWardenSpawning", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_WARDEN_SPAWNING = GameRules.SPAWN_WARDENS;
/**
* Whether mobs should cease being angry at a player once they die.
*
* @deprecated renamed to {@link GameRules#FORGIVE_DEAD_PLAYERS}
*/
public static final GameRule<Boolean> FORGIVE_DEAD_PLAYERS = new GameRule<>("forgiveDeadPlayers", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> FORGIVE_DEAD_PLAYERS = GameRules.FORGIVE_DEAD_PLAYERS;
/**
* Whether mobs will target all player entities once angered.
*
* @deprecated renamed to {@link GameRules#UNIVERSAL_ANGER}
*/
public static final GameRule<Boolean> UNIVERSAL_ANGER = new GameRule<>("universalAnger", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> UNIVERSAL_ANGER = GameRules.UNIVERSAL_ANGER;
/**
* Whether block explosions will destroy dropped items.
*
* @deprecated renamed to {@link GameRules#BLOCK_EXPLOSION_DROP_DECAY}
*/
public static final GameRule<Boolean> BLOCK_EXPLOSION_DROP_DECAY = new GameRule<>("blockExplosionDropDecay", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> BLOCK_EXPLOSION_DROP_DECAY = GameRules.BLOCK_EXPLOSION_DROP_DECAY;
/**
* * Whether mob explosions will destroy dropped items.
*
* @deprecated renamed to {@link GameRules#MOB_EXPLOSION_DROP_DECAY}
*/
public static final GameRule<Boolean> MOB_EXPLOSION_DROP_DECAY = new GameRule<>("mobExplosionDropDecay", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> MOB_EXPLOSION_DROP_DECAY = GameRules.MOB_EXPLOSION_DROP_DECAY;
/**
* Whether tnt explosions will destroy dropped items.
*
* @deprecated renamed to {@link GameRules#TNT_EXPLOSION_DROP_DECAY}
*/
public static final GameRule<Boolean> TNT_EXPLOSION_DROP_DECAY = new GameRule<>("tntExplosionDropDecay", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> TNT_EXPLOSION_DROP_DECAY = GameRules.TNT_EXPLOSION_DROP_DECAY;
/**
* Whether water blocks can convert into water source blocks.
*
* @deprecated renamed to {@link GameRules#WATER_SOURCE_CONVERSION}
*/
public static final GameRule<Boolean> WATER_SOURCE_CONVERSION = new GameRule<>("waterSourceConversion", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> WATER_SOURCE_CONVERSION = GameRules.WATER_SOURCE_CONVERSION;
/**
* Whether lava blocks can convert into lava source blocks.
*
* @deprecated renamed to {@link GameRules#LAVA_SOURCE_CONVERSION}
*/
public static final GameRule<Boolean> LAVA_SOURCE_CONVERSION = new GameRule<>("lavaSourceConversion", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> LAVA_SOURCE_CONVERSION = GameRules.LAVA_SOURCE_CONVERSION;
/**
* Whether global level events such as ender dragon, wither, and completed
* end portal effects will propagate across the entire server.
*
* @deprecated renamed to {@link GameRules#GLOBAL_SOUND_EVENTS}
*/
public static final GameRule<Boolean> GLOBAL_SOUND_EVENTS = new GameRule<>("globalSoundEvents", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> GLOBAL_SOUND_EVENTS = GameRules.GLOBAL_SOUND_EVENTS;
/**
* Whether vines will spread.
*
* @deprecated renamed to {@link GameRules#SPREAD_VINES}
*/
public static final GameRule<Boolean> DO_VINES_SPREAD = new GameRule<>("doVinesSpread", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> DO_VINES_SPREAD = GameRules.SPREAD_VINES;
/**
* Whether ender pearls will vanish on player death.
*
* @deprecated renamed to {@link GameRules#ENDER_PEARLS_VANISH_ON_DEATH}
*/
public static final GameRule<Boolean> ENDER_PEARLS_VANISH_ON_DEATH = new GameRule<>("enderPearlsVanishOnDeath", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> ENDER_PEARLS_VANISH_ON_DEATH = GameRules.ENDER_PEARLS_VANISH_ON_DEATH;
/**
* Whether fire will still propagate far away from players (8 chunks).
*
* @deprecated use {@link GameRules#FIRE_SPREAD_RADIUS_AROUND_PLAYER}
*/
public static final GameRule<Boolean> ALLOW_FIRE_TICKS_AWAY_FROM_PLAYER = new GameRule<>("allowFireTicksAwayFromPlayer", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> ALLOW_FIRE_TICKS_AWAY_FROM_PLAYER = InternalAPIBridge.get().legacyGameRuleBridge(GameRules.FIRE_SPREAD_RADIUS_AROUND_PLAYER, (value) -> value ? -1 : 128, (value) -> value == -1, Boolean.class);
/**
* Whether primed tnt explodes.
*
* @deprecated renamed to {@link GameRules#TNT_EXPLODES}
*/
public static final GameRule<Boolean> TNT_EXPLODES = new GameRule<>("tntExplodes", Boolean.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> TNT_EXPLODES = GameRules.TNT_EXPLODES;
/**
* Configures if the world uses the locator bar.
*
* @deprecated renamed to {@link GameRules#LOCATOR_BAR}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> LOCATOR_BAR = GameRules.LOCATOR_BAR;
/**
* Whether player versus player combat is allowed.
*
* @deprecated renamed to {@link GameRules#PVP}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> PVP = GameRules.PVP;
/**
* Whether monsters should naturally spawn.
*
* @deprecated renamed to {@link GameRules#SPAWN_MONSTERS}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> SPAWN_MONSTERS = GameRules.SPAWN_MONSTERS;
/**
* Whether players can enter the Nether using portals.
*
* @deprecated renamed to {@link GameRules#ALLOW_ENTERING_NETHER_USING_PORTALS}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> ALLOW_ENTERING_NETHER_USING_PORTALS = GameRules.ALLOW_ENTERING_NETHER_USING_PORTALS;
/**
* Whether command blocks are enabled.
*
* @deprecated renamed to {@link GameRules#COMMAND_BLOCKS_WORK}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> COMMAND_BLOCKS_ENABLED = GameRules.COMMAND_BLOCKS_WORK;
/**
* Whether spawner blocks are enabled.
*
* @deprecated renamed to {@link GameRules#SPAWNER_BLOCKS_WORK}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Boolean> SPAWNER_BLOCKS_ENABLED = GameRules.SPAWNER_BLOCKS_WORK;
// Numerical rules
/**
* How often a random block tick occurs (such as plant growth, leaf decay,
* etc.) per chunk section per game tick. 0 will disable random ticks,
* higher numbers will increase random ticks.
*
* @deprecated renamed to {@link GameRules#RANDOM_TICK_SPEED}
*/
public static final GameRule<Integer> RANDOM_TICK_SPEED = new GameRule<>("randomTickSpeed", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> RANDOM_TICK_SPEED = GameRules.RANDOM_TICK_SPEED;
/**
* The number of blocks outward from the world spawn coordinates that a
* player will spawn in when first joining a server or when dying without a
* spawnpoint.
*
* @deprecated renamed to {@link GameRules#RESPAWN_RADIUS}
*/
public static final GameRule<Integer> SPAWN_RADIUS = new GameRule<>("spawnRadius", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> SPAWN_RADIUS = GameRules.RESPAWN_RADIUS;
/**
* The maximum number of other pushable entities a mob or player can push,
* before taking suffocation damage.
* <br>
* Setting to 0 disables this rule.
*
* @deprecated renamed to {@link GameRules#MAX_ENTITY_CRAMMING}
*/
public static final GameRule<Integer> MAX_ENTITY_CRAMMING = new GameRule<>("maxEntityCramming", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> MAX_ENTITY_CRAMMING = GameRules.MAX_ENTITY_CRAMMING;
/**
* Determines the number at which the chain of command blocks act as a
* "chain."
* <br>
* This is the maximum amount of command blocks that can be activated in a
* single tick from a single chain.
*
* @deprecated renamed to {@link GameRules#MAX_COMMAND_SEQUENCE_LENGTH}
*/
public static final GameRule<Integer> MAX_COMMAND_CHAIN_LENGTH = new GameRule<>("maxCommandChainLength", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> MAX_COMMAND_CHAIN_LENGTH = GameRules.MAX_COMMAND_SEQUENCE_LENGTH;
/**
* Determines the number of different commands/functions which execute
* commands can fork into.
*
* @deprecated renamed to {@link GameRules#MAX_COMMAND_FORKS}
*/
public static final GameRule<Integer> MAX_COMMAND_FORK_COUNT = new GameRule<>("maxCommandForkCount", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> MAX_COMMAND_FORK_COUNT = GameRules.MAX_COMMAND_FORKS;
/**
* Determines the maximum number of blocks which a command can modify.
*
* @deprecated renamed to {@link GameRules#MAX_BLOCK_MODIFICATIONS}
*/
public static final GameRule<Integer> COMMAND_MODIFICATION_BLOCK_LIMIT = new GameRule<>("commandModificationBlockLimit", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> COMMAND_MODIFICATION_BLOCK_LIMIT = GameRules.MAX_BLOCK_MODIFICATIONS;
/**
* The percentage of online players which must be sleeping for the night to
* advance.
*
* @deprecated renamed to {@link GameRules#PLAYERS_SLEEPING_PERCENTAGE}
*/
public static final GameRule<Integer> PLAYERS_SLEEPING_PERCENTAGE = new GameRule<>("playersSleepingPercentage", Integer.class);
public static final GameRule<Integer> SNOW_ACCUMULATION_HEIGHT = new GameRule<>("snowAccumulationHeight", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> PLAYERS_SLEEPING_PERCENTAGE = GameRules.PLAYERS_SLEEPING_PERCENTAGE;
/**
* @deprecated renamed to {@link GameRules#MAX_SNOW_ACCUMULATION_HEIGHT}
*/
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> SNOW_ACCUMULATION_HEIGHT = GameRules.MAX_SNOW_ACCUMULATION_HEIGHT;
/**
* The amount of time a player must stand in a nether portal before the
* portal activates.
*
* @deprecated renamed to {@link GameRules#PLAYERS_NETHER_PORTAL_DEFAULT_DELAY}
*/
public static final GameRule<Integer> PLAYERS_NETHER_PORTAL_DEFAULT_DELAY = new GameRule<>("playersNetherPortalDefaultDelay", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> PLAYERS_NETHER_PORTAL_DEFAULT_DELAY = GameRules.PLAYERS_NETHER_PORTAL_DEFAULT_DELAY;
/**
* The amount of time a player in creative mode must stand in a nether
* portal before the portal activates.
*
* @deprecated renamed to {@link GameRules#PLAYERS_NETHER_PORTAL_CREATIVE_DELAY}
*/
public static final GameRule<Integer> PLAYERS_NETHER_PORTAL_CREATIVE_DELAY = new GameRule<>("playersNetherPortalCreativeDelay", Integer.class);
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> PLAYERS_NETHER_PORTAL_CREATIVE_DELAY = GameRules.PLAYERS_NETHER_PORTAL_CREATIVE_DELAY;
/**
* The maximum speed of minecarts (when the new movement algorithm is
* enabled).
*
* @deprecated renamed to {@link GameRules#MAX_MINECART_SPEED}
*/
@MinecraftExperimental(MinecraftExperimental.Requires.MINECART_IMPROVEMENTS) // Paper - add missing annotation
@org.jetbrains.annotations.ApiStatus.Experimental // Paper - add missing annotation
public static final GameRule<Integer> MINECART_MAX_SPEED = new GameRule<>("minecartMaxSpeed", Integer.class);
@MinecraftExperimental(MinecraftExperimental.Requires.MINECART_IMPROVEMENTS)
@ApiStatus.Experimental
@Deprecated(forRemoval = true, since = "1.21.11")
public static final GameRule<Integer> MINECART_MAX_SPEED = GameRules.MAX_MINECART_SPEED;
/**
* Configures if the world uses the locator bar.
*/
public static final GameRule<Boolean> LOCATOR_BAR = new GameRule<>("locatorBar", Boolean.class);
/**
* Whether player versus player combat is allowed.
*/
public static final GameRule<Boolean> PVP = new GameRule<>("pvp", Boolean.class);
/**
* Whether monsters should naturally spawn.
*/
public static final GameRule<Boolean> SPAWN_MONSTERS = new GameRule<>("spawnMonsters", Boolean.class);
/**
* Whether players can enter the Nether using portals.
*/
public static final GameRule<Boolean> ALLOW_ENTERING_NETHER_USING_PORTALS = new GameRule<>("allowEnteringNetherUsingPortals", Boolean.class);
/**
* Whether command blocks are enabled.
*/
public static final GameRule<Boolean> COMMAND_BLOCKS_ENABLED = new GameRule<>("commandBlocksEnabled", Boolean.class);
/**
* Whether spawner blocks are enabled.
*/
public static final GameRule<Boolean> SPAWNER_BLOCKS_ENABLED = new GameRule<>("spawnerBlocksEnabled", Boolean.class);
// All GameRules instantiated above this for organizational purposes
private final String name;
private final Class<T> type;
private GameRule(@NotNull String name, @NotNull Class<T> clazz) {
Preconditions.checkNotNull(name, "GameRule name cannot be null");
Preconditions.checkNotNull(clazz, "GameRule type cannot be null");
Preconditions.checkArgument(clazz == Boolean.class || clazz == Integer.class, "Must be of type Boolean or Integer. Found %s ", clazz.getName());
this.name = name;
this.type = clazz;
gameRules.put(name, this);
private static UnaryOperator<Boolean> inverseBool() {
return operand -> !operand;
}
/**
* Get the name of this GameRule.
*
* @return the name of this GameRule
* @deprecated Game rule is now a registry, use {@link #getKey()} instead
*/
@NotNull
public String getName() {
return name;
}
@Deprecated(since = "1.21.11", forRemoval = true)
public abstract String getName();
/**
* Get the type of this rule.
@@ -359,26 +486,7 @@ public final class GameRule<T> implements net.kyori.adventure.translation.Transl
* @return the rule type; Integer or Boolean
*/
@NotNull
public Class<T> getType() {
return type;
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof GameRule)) {
return false;
}
GameRule<?> other = (GameRule<?>) obj;
return this.getName().equals(other.getName()) && this.getType() == other.getType();
}
@Override
public String toString() {
return "GameRule{" + "key=" + name + ", type=" + type + '}';
}
public abstract Class<T> getType();
/**
* Get a {@link GameRule} by its name.
@@ -386,26 +494,33 @@ public final class GameRule<T> implements net.kyori.adventure.translation.Transl
* @param rule the name of the GameRule
* @return the {@link GameRule} or null if no GameRule matches the given
* name
* @deprecated Game rule is now a registry, fetch element from it
*/
@Nullable
public static GameRule<?> getByName(@NotNull String rule) {
Preconditions.checkNotNull(rule, "Rule cannot be null");
return gameRules.get(rule);
@Deprecated(since = "1.21.11", forRemoval = true)
public static <T> GameRule<T> getByName(@NotNull String rule) {
Preconditions.checkArgument(rule != null, "Rule cannot be null");
NamespacedKey key = NamespacedKey.fromString(rule);
if (key == null) {
return null;
}
return (GameRule<T>) Registry.GAME_RULE.get(key);
}
/**
* Get an immutable collection of {@link GameRule}s.
*
* @return an immutable collection containing all registered GameRules.
* @deprecated Game rule is now a registry, fetch elements from it
*/
@NotNull
@Deprecated(since = "1.21.11", forRemoval = true)
public static GameRule<?>[] values() {
return gameRules.values().toArray(new GameRule<?>[gameRules.size()]);
return Registry.GAME_RULE.stream().toArray(GameRule[]::new);
}
@Override
public @NotNull String translationKey() {
return "gamerule." + this.name;
}
public abstract @NotNull String translationKey();
}
@@ -0,0 +1,141 @@
package org.bukkit;
import net.kyori.adventure.key.KeyPattern;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* All the vanilla gamerules
*/
@NullMarked
public final class GameRules {
// Start generate - GameRules
public static final GameRule<Boolean> ADVANCE_TIME = getRule("advance_time");
public static final GameRule<Boolean> ADVANCE_WEATHER = getRule("advance_weather");
public static final GameRule<Boolean> ALLOW_ENTERING_NETHER_USING_PORTALS = getRule("allow_entering_nether_using_portals");
public static final GameRule<Boolean> BLOCK_DROPS = getRule("block_drops");
public static final GameRule<Boolean> BLOCK_EXPLOSION_DROP_DECAY = getRule("block_explosion_drop_decay");
public static final GameRule<Boolean> COMMAND_BLOCK_OUTPUT = getRule("command_block_output");
public static final GameRule<Boolean> COMMAND_BLOCKS_WORK = getRule("command_blocks_work");
public static final GameRule<Boolean> DROWNING_DAMAGE = getRule("drowning_damage");
public static final GameRule<Boolean> ELYTRA_MOVEMENT_CHECK = getRule("elytra_movement_check");
public static final GameRule<Boolean> ENDER_PEARLS_VANISH_ON_DEATH = getRule("ender_pearls_vanish_on_death");
public static final GameRule<Boolean> ENTITY_DROPS = getRule("entity_drops");
public static final GameRule<Boolean> FALL_DAMAGE = getRule("fall_damage");
public static final GameRule<Boolean> FIRE_DAMAGE = getRule("fire_damage");
public static final GameRule<Integer> FIRE_SPREAD_RADIUS_AROUND_PLAYER = getRule("fire_spread_radius_around_player");
public static final GameRule<Boolean> FORGIVE_DEAD_PLAYERS = getRule("forgive_dead_players");
public static final GameRule<Boolean> FREEZE_DAMAGE = getRule("freeze_damage");
public static final GameRule<Boolean> GLOBAL_SOUND_EVENTS = getRule("global_sound_events");
public static final GameRule<Boolean> IMMEDIATE_RESPAWN = getRule("immediate_respawn");
public static final GameRule<Boolean> KEEP_INVENTORY = getRule("keep_inventory");
public static final GameRule<Boolean> LAVA_SOURCE_CONVERSION = getRule("lava_source_conversion");
public static final GameRule<Boolean> LIMITED_CRAFTING = getRule("limited_crafting");
public static final GameRule<Boolean> LOCATOR_BAR = getRule("locator_bar");
public static final GameRule<Boolean> LOG_ADMIN_COMMANDS = getRule("log_admin_commands");
public static final GameRule<Integer> MAX_BLOCK_MODIFICATIONS = getRule("max_block_modifications");
public static final GameRule<Integer> MAX_COMMAND_FORKS = getRule("max_command_forks");
public static final GameRule<Integer> MAX_COMMAND_SEQUENCE_LENGTH = getRule("max_command_sequence_length");
public static final GameRule<Integer> MAX_ENTITY_CRAMMING = getRule("max_entity_cramming");
@MinecraftExperimental(MinecraftExperimental.Requires.MINECART_IMPROVEMENTS)
@ApiStatus.Experimental
public static final GameRule<Integer> MAX_MINECART_SPEED = getRule("max_minecart_speed");
public static final GameRule<Integer> MAX_SNOW_ACCUMULATION_HEIGHT = getRule("max_snow_accumulation_height");
public static final GameRule<Boolean> MOB_DROPS = getRule("mob_drops");
public static final GameRule<Boolean> MOB_EXPLOSION_DROP_DECAY = getRule("mob_explosion_drop_decay");
public static final GameRule<Boolean> MOB_GRIEFING = getRule("mob_griefing");
public static final GameRule<Boolean> NATURAL_HEALTH_REGENERATION = getRule("natural_health_regeneration");
public static final GameRule<Boolean> PLAYER_MOVEMENT_CHECK = getRule("player_movement_check");
public static final GameRule<Integer> PLAYERS_NETHER_PORTAL_CREATIVE_DELAY = getRule("players_nether_portal_creative_delay");
public static final GameRule<Integer> PLAYERS_NETHER_PORTAL_DEFAULT_DELAY = getRule("players_nether_portal_default_delay");
public static final GameRule<Integer> PLAYERS_SLEEPING_PERCENTAGE = getRule("players_sleeping_percentage");
public static final GameRule<Boolean> PROJECTILES_CAN_BREAK_BLOCKS = getRule("projectiles_can_break_blocks");
public static final GameRule<Boolean> PVP = getRule("pvp");
public static final GameRule<Boolean> RAIDS = getRule("raids");
public static final GameRule<Integer> RANDOM_TICK_SPEED = getRule("random_tick_speed");
public static final GameRule<Boolean> REDUCED_DEBUG_INFO = getRule("reduced_debug_info");
public static final GameRule<Integer> RESPAWN_RADIUS = getRule("respawn_radius");
public static final GameRule<Boolean> SEND_COMMAND_FEEDBACK = getRule("send_command_feedback");
public static final GameRule<Boolean> SHOW_ADVANCEMENT_MESSAGES = getRule("show_advancement_messages");
public static final GameRule<Boolean> SHOW_DEATH_MESSAGES = getRule("show_death_messages");
public static final GameRule<Boolean> SPAWN_MOBS = getRule("spawn_mobs");
public static final GameRule<Boolean> SPAWN_MONSTERS = getRule("spawn_monsters");
public static final GameRule<Boolean> SPAWN_PATROLS = getRule("spawn_patrols");
public static final GameRule<Boolean> SPAWN_PHANTOMS = getRule("spawn_phantoms");
public static final GameRule<Boolean> SPAWN_WANDERING_TRADERS = getRule("spawn_wandering_traders");
public static final GameRule<Boolean> SPAWN_WARDENS = getRule("spawn_wardens");
public static final GameRule<Boolean> SPAWNER_BLOCKS_WORK = getRule("spawner_blocks_work");
public static final GameRule<Boolean> SPECTATORS_GENERATE_CHUNKS = getRule("spectators_generate_chunks");
public static final GameRule<Boolean> SPREAD_VINES = getRule("spread_vines");
public static final GameRule<Boolean> TNT_EXPLODES = getRule("tnt_explodes");
public static final GameRule<Boolean> TNT_EXPLOSION_DROP_DECAY = getRule("tnt_explosion_drop_decay");
public static final GameRule<Boolean> UNIVERSAL_ANGER = getRule("universal_anger");
public static final GameRule<Boolean> WATER_SOURCE_CONVERSION = getRule("water_source_conversion");
// End generate - GameRules
private static <T> GameRule<T> getRule(@KeyPattern.Value String key) {
return (GameRule<T>) Registry.GAME_RULE.getOrThrow(NamespacedKey.minecraft(key));
}
private GameRules() {
}
}
@@ -205,6 +205,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
BUCKET(-1, 16),
BUNDLE(-1, 1),
BURN_POTTERY_SHERD(-1),
CAMEL_HUSK_SPAWN_EGG(-1),
CAMEL_SPAWN_EGG(-1),
CARROT(-1),
CARROT_ON_A_STICK(-1, 1),
@@ -248,9 +249,11 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
COPPER_HORSE_ARMOR(-1, 1),
COPPER_INGOT(-1),
COPPER_LEGGINGS(-1, 1),
COPPER_NAUTILUS_ARMOR(-1, 1),
COPPER_NUGGET(-1),
COPPER_PICKAXE(-1, 1),
COPPER_SHOVEL(-1, 1),
COPPER_SPEAR(-1, 1),
COPPER_SWORD(-1, 1),
COW_SPAWN_EGG(-1),
CREAKING_SPAWN_EGG(-1),
@@ -272,8 +275,10 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
DIAMOND_HOE(-1, 1),
DIAMOND_HORSE_ARMOR(-1, 1),
DIAMOND_LEGGINGS(-1, 1),
DIAMOND_NAUTILUS_ARMOR(-1, 1),
DIAMOND_PICKAXE(-1, 1),
DIAMOND_SHOVEL(-1, 1),
DIAMOND_SPEAR(-1, 1),
DIAMOND_SWORD(-1, 1),
DISC_FRAGMENT_5(-1),
DOLPHIN_SPAWN_EGG(-1),
@@ -340,8 +345,10 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
GOLDEN_HOE(-1, 1),
GOLDEN_HORSE_ARMOR(-1, 1),
GOLDEN_LEGGINGS(-1, 1),
GOLDEN_NAUTILUS_ARMOR(-1, 1),
GOLDEN_PICKAXE(-1, 1),
GOLDEN_SHOVEL(-1, 1),
GOLDEN_SPEAR(-1, 1),
GOLDEN_SWORD(-1, 1),
GRAY_BUNDLE(-1, 1),
GRAY_DYE(-1),
@@ -375,9 +382,11 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
IRON_HORSE_ARMOR(-1, 1),
IRON_INGOT(-1),
IRON_LEGGINGS(-1, 1),
IRON_NAUTILUS_ARMOR(-1, 1),
IRON_NUGGET(-1),
IRON_PICKAXE(-1, 1),
IRON_SHOVEL(-1, 1),
IRON_SPEAR(-1, 1),
IRON_SWORD(-1, 1),
ITEM_FRAME(-1),
JUNGLE_BOAT(-1, 1),
@@ -446,6 +455,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
MUTTON(-1),
NAME_TAG(-1),
NAUTILUS_SHELL(-1),
NAUTILUS_SPAWN_EGG(-1),
NETHER_BRICK(-1),
NETHER_STAR(-1),
NETHERITE_AXE(-1, 1),
@@ -453,11 +463,14 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
NETHERITE_CHESTPLATE(-1, 1),
NETHERITE_HELMET(-1, 1),
NETHERITE_HOE(-1, 1),
NETHERITE_HORSE_ARMOR(-1, 1),
NETHERITE_INGOT(-1),
NETHERITE_LEGGINGS(-1, 1),
NETHERITE_NAUTILUS_ARMOR(-1, 1),
NETHERITE_PICKAXE(-1, 1),
NETHERITE_SCRAP(-1),
NETHERITE_SHOVEL(-1, 1),
NETHERITE_SPEAR(-1, 1),
NETHERITE_SWORD(-1, 1),
NETHERITE_UPGRADE_SMITHING_TEMPLATE(-1),
OAK_BOAT(-1, 1),
@@ -473,6 +486,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
PALE_OAK_CHEST_BOAT(-1, 1),
PANDA_SPAWN_EGG(-1),
PAPER(-1),
PARCHED_SPAWN_EGG(-1),
PARROT_SPAWN_EGG(-1),
PHANTOM_MEMBRANE(-1),
PHANTOM_SPAWN_EGG(-1),
@@ -564,6 +578,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
STONE_HOE(-1, 1),
STONE_PICKAXE(-1, 1),
STONE_SHOVEL(-1, 1),
STONE_SPEAR(-1, 1),
STONE_SWORD(-1, 1),
STRAY_SPAWN_EGG(-1),
STRIDER_SPAWN_EGG(-1),
@@ -612,6 +627,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
WOODEN_HOE(-1, 1),
WOODEN_PICKAXE(-1, 1),
WOODEN_SHOVEL(-1, 1),
WOODEN_SPEAR(-1, 1),
WOODEN_SWORD(-1, 1),
WRITABLE_BOOK(-1, 1),
WRITTEN_BOOK(-1, 16),
@@ -620,6 +636,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
YELLOW_HARNESS(-1, 1),
ZOGLIN_SPAWN_EGG(-1),
ZOMBIE_HORSE_SPAWN_EGG(-1),
ZOMBIE_NAUTILUS_SPAWN_EGG(-1),
ZOMBIE_SPAWN_EGG(-1),
ZOMBIE_VILLAGER_SPAWN_EGG(-1),
ZOMBIFIED_PIGLIN_SPAWN_EGG(-1),
@@ -348,7 +348,13 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see DataComponentType
*/
Registry<DataComponentType> DATA_COMPONENT_TYPE = registryFor(RegistryKey.DATA_COMPONENT_TYPE); // Paper
Registry<DataComponentType> DATA_COMPONENT_TYPE = registryFor(RegistryKey.DATA_COMPONENT_TYPE);
/**
* Game rules.
*
* @see GameRule
*/
Registry<GameRule<?>> GAME_RULE = registryFor(RegistryKey.GAME_RULE);
//<editor-fold desc="renames" defaultstate="collapsed">
/**
@@ -557,7 +563,6 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @deprecated this method's behavior is broken and not useful. If you want to get an object
* based on its vanilla name, or a key, wrap it in a {@link NamespacedKey} object and use {@link #get(NamespacedKey)}
*/
// Paper
@Deprecated(forRemoval = true)
default @Nullable T match(final String input) {
Preconditions.checkArgument(input != null, "input must not be null");
@@ -243,7 +243,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* Separate from the portal game rule.
*
* @return whether this server allows the Nether or not
* @see GameRule#ALLOW_ENTERING_NETHER_USING_PORTALS
* @see GameRules#ALLOW_ENTERING_NETHER_USING_PORTALS
*/
public boolean getAllowNether();
@@ -1739,6 +1739,22 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_AXOLOTL_SWIM = getSound("entity.axolotl.swim");
Sound ENTITY_BABY_NAUTILUS_AMBIENT = getSound("entity.baby_nautilus.ambient");
Sound ENTITY_BABY_NAUTILUS_AMBIENT_LAND = getSound("entity.baby_nautilus.ambient_land");
Sound ENTITY_BABY_NAUTILUS_DEATH = getSound("entity.baby_nautilus.death");
Sound ENTITY_BABY_NAUTILUS_DEATH_LAND = getSound("entity.baby_nautilus.death_land");
Sound ENTITY_BABY_NAUTILUS_EAT = getSound("entity.baby_nautilus.eat");
Sound ENTITY_BABY_NAUTILUS_HURT = getSound("entity.baby_nautilus.hurt");
Sound ENTITY_BABY_NAUTILUS_HURT_LAND = getSound("entity.baby_nautilus.hurt_land");
Sound ENTITY_BABY_NAUTILUS_SWIM = getSound("entity.baby_nautilus.swim");
Sound ENTITY_BAT_AMBIENT = getSound("entity.bat.ambient");
Sound ENTITY_BAT_DEATH = getSound("entity.bat.death");
@@ -1833,6 +1849,28 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_CAMEL_STEP_SAND = getSound("entity.camel.step_sand");
Sound ENTITY_CAMEL_HUSK_AMBIENT = getSound("entity.camel_husk.ambient");
Sound ENTITY_CAMEL_HUSK_DASH = getSound("entity.camel_husk.dash");
Sound ENTITY_CAMEL_HUSK_DASH_READY = getSound("entity.camel_husk.dash_ready");
Sound ENTITY_CAMEL_HUSK_DEATH = getSound("entity.camel_husk.death");
Sound ENTITY_CAMEL_HUSK_EAT = getSound("entity.camel_husk.eat");
Sound ENTITY_CAMEL_HUSK_HURT = getSound("entity.camel_husk.hurt");
Sound ENTITY_CAMEL_HUSK_SADDLE = getSound("entity.camel_husk.saddle");
Sound ENTITY_CAMEL_HUSK_SIT = getSound("entity.camel_husk.sit");
Sound ENTITY_CAMEL_HUSK_STAND = getSound("entity.camel_husk.stand");
Sound ENTITY_CAMEL_HUSK_STEP = getSound("entity.camel_husk.step");
Sound ENTITY_CAMEL_HUSK_STEP_SAND = getSound("entity.camel_husk.step_sand");
Sound ENTITY_CAT_AMBIENT = getSound("entity.cat.ambient");
Sound ENTITY_CAT_BEG_FOR_FOOD = getSound("entity.cat.beg_for_food");
@@ -2439,6 +2477,32 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_MULE_JUMP = getSound("entity.mule.jump");
Sound ENTITY_NAUTILUS_AMBIENT = getSound("entity.nautilus.ambient");
Sound ENTITY_NAUTILUS_AMBIENT_LAND = getSound("entity.nautilus.ambient_land");
Sound ENTITY_NAUTILUS_DASH = getSound("entity.nautilus.dash");
Sound ENTITY_NAUTILUS_DASH_LAND = getSound("entity.nautilus.dash_land");
Sound ENTITY_NAUTILUS_DASH_READY = getSound("entity.nautilus.dash_ready");
Sound ENTITY_NAUTILUS_DASH_READY_LAND = getSound("entity.nautilus.dash_ready_land");
Sound ENTITY_NAUTILUS_DEATH = getSound("entity.nautilus.death");
Sound ENTITY_NAUTILUS_DEATH_LAND = getSound("entity.nautilus.death_land");
Sound ENTITY_NAUTILUS_EAT = getSound("entity.nautilus.eat");
Sound ENTITY_NAUTILUS_HURT = getSound("entity.nautilus.hurt");
Sound ENTITY_NAUTILUS_HURT_LAND = getSound("entity.nautilus.hurt_land");
Sound ENTITY_NAUTILUS_RIDING = getSound("entity.nautilus.riding");
Sound ENTITY_NAUTILUS_SWIM = getSound("entity.nautilus.swim");
Sound ENTITY_OCELOT_AMBIENT = getSound("entity.ocelot.ambient");
Sound ENTITY_OCELOT_DEATH = getSound("entity.ocelot.death");
@@ -2471,6 +2535,14 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_PANDA_WORRIED_AMBIENT = getSound("entity.panda.worried_ambient");
Sound ENTITY_PARCHED_AMBIENT = getSound("entity.parched.ambient");
Sound ENTITY_PARCHED_DEATH = getSound("entity.parched.death");
Sound ENTITY_PARCHED_HURT = getSound("entity.parched.hurt");
Sound ENTITY_PARCHED_STEP = getSound("entity.parched.step");
Sound ENTITY_PARROT_AMBIENT = getSound("entity.parrot.ambient");
Sound ENTITY_PARROT_DEATH = getSound("entity.parrot.death");
@@ -2487,6 +2559,8 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_PARROT_IMITATE_BREEZE = getSound("entity.parrot.imitate.breeze");
Sound ENTITY_PARROT_IMITATE_CAMEL_HUSK = getSound("entity.parrot.imitate.camel_husk");
Sound ENTITY_PARROT_IMITATE_CREAKING = getSound("entity.parrot.imitate.creaking");
Sound ENTITY_PARROT_IMITATE_CREEPER = getSound("entity.parrot.imitate.creeper");
@@ -2513,6 +2587,8 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_PARROT_IMITATE_MAGMA_CUBE = getSound("entity.parrot.imitate.magma_cube");
Sound ENTITY_PARROT_IMITATE_PARCHED = getSound("entity.parrot.imitate.parched");
Sound ENTITY_PARROT_IMITATE_PHANTOM = getSound("entity.parrot.imitate.phantom");
Sound ENTITY_PARROT_IMITATE_PIGLIN = getSound("entity.parrot.imitate.piglin");
@@ -2551,6 +2627,10 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_PARROT_IMITATE_ZOMBIE = getSound("entity.parrot.imitate.zombie");
Sound ENTITY_PARROT_IMITATE_ZOMBIE_HORSE = getSound("entity.parrot.imitate.zombie_horse");
Sound ENTITY_PARROT_IMITATE_ZOMBIE_NAUTILUS = getSound("entity.parrot.imitate.zombie_nautilus");
Sound ENTITY_PARROT_IMITATE_ZOMBIE_VILLAGER = getSound("entity.parrot.imitate.zombie_villager");
Sound ENTITY_PARROT_STEP = getSound("entity.parrot.step");
@@ -3199,10 +3279,38 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ENTITY_ZOMBIE_HORSE_AMBIENT = getSound("entity.zombie_horse.ambient");
Sound ENTITY_ZOMBIE_HORSE_ANGRY = getSound("entity.zombie_horse.angry");
Sound ENTITY_ZOMBIE_HORSE_DEATH = getSound("entity.zombie_horse.death");
Sound ENTITY_ZOMBIE_HORSE_EAT = getSound("entity.zombie_horse.eat");
Sound ENTITY_ZOMBIE_HORSE_HURT = getSound("entity.zombie_horse.hurt");
Sound ENTITY_ZOMBIE_NAUTILUS_AMBIENT = getSound("entity.zombie_nautilus.ambient");
Sound ENTITY_ZOMBIE_NAUTILUS_AMBIENT_LAND = getSound("entity.zombie_nautilus.ambient_land");
Sound ENTITY_ZOMBIE_NAUTILUS_DASH = getSound("entity.zombie_nautilus.dash");
Sound ENTITY_ZOMBIE_NAUTILUS_DASH_LAND = getSound("entity.zombie_nautilus.dash_land");
Sound ENTITY_ZOMBIE_NAUTILUS_DASH_READY = getSound("entity.zombie_nautilus.dash_ready");
Sound ENTITY_ZOMBIE_NAUTILUS_DASH_READY_LAND = getSound("entity.zombie_nautilus.dash_ready_land");
Sound ENTITY_ZOMBIE_NAUTILUS_DEATH = getSound("entity.zombie_nautilus.death");
Sound ENTITY_ZOMBIE_NAUTILUS_DEATH_LAND = getSound("entity.zombie_nautilus.death_land");
Sound ENTITY_ZOMBIE_NAUTILUS_EAT = getSound("entity.zombie_nautilus.eat");
Sound ENTITY_ZOMBIE_NAUTILUS_HURT = getSound("entity.zombie_nautilus.hurt");
Sound ENTITY_ZOMBIE_NAUTILUS_HURT_LAND = getSound("entity.zombie_nautilus.hurt_land");
Sound ENTITY_ZOMBIE_NAUTILUS_SWIM = getSound("entity.zombie_nautilus.swim");
Sound ENTITY_ZOMBIE_VILLAGER_AMBIENT = getSound("entity.zombie_villager.ambient");
Sound ENTITY_ZOMBIE_VILLAGER_CONVERTED = getSound("entity.zombie_villager.converted");
@@ -3249,12 +3357,16 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ITEM_ARMOR_EQUIP_LEATHER = getSound("item.armor.equip_leather");
Sound ITEM_ARMOR_EQUIP_NAUTILUS = getSound("item.armor.equip_nautilus");
Sound ITEM_ARMOR_EQUIP_NETHERITE = getSound("item.armor.equip_netherite");
Sound ITEM_ARMOR_EQUIP_TURTLE = getSound("item.armor.equip_turtle");
Sound ITEM_ARMOR_EQUIP_WOLF = getSound("item.armor.equip_wolf");
Sound ITEM_ARMOR_UNEQUIP_NAUTILUS = getSound("item.armor.unequip_nautilus");
Sound ITEM_ARMOR_UNEQUIP_WOLF = getSound("item.armor.unequip_wolf");
Sound ITEM_AXE_SCRAPE = getSound("item.axe.scrape");
@@ -3389,6 +3501,10 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ITEM_MACE_SMASH_GROUND_HEAVY = getSound("item.mace.smash_ground_heavy");
Sound ITEM_NAUTILUS_SADDLE_EQUIP = getSound("item.nautilus_saddle_equip");
Sound ITEM_NAUTILUS_SADDLE_UNDERWATER_EQUIP = getSound("item.nautilus_saddle_underwater_equip");
Sound ITEM_NETHER_WART_PLANT = getSound("item.nether_wart.plant");
Sound ITEM_OMINOUS_BOTTLE_DISPOSE = getSound("item.ominous_bottle.dispose");
@@ -3403,6 +3519,24 @@ public interface Sound extends OldEnum<Sound>, Keyed, net.kyori.adventure.sound.
Sound ITEM_SHOVEL_FLATTEN = getSound("item.shovel.flatten");
Sound ITEM_SPEAR_ATTACK = getSound("item.spear.attack");
Sound ITEM_SPEAR_HIT = getSound("item.spear.hit");
Sound ITEM_SPEAR_LUNGE_1 = getSound("item.spear.lunge_1");
Sound ITEM_SPEAR_LUNGE_2 = getSound("item.spear.lunge_2");
Sound ITEM_SPEAR_LUNGE_3 = getSound("item.spear.lunge_3");
Sound ITEM_SPEAR_USE = getSound("item.spear.use");
Sound ITEM_SPEAR_WOOD_ATTACK = getSound("item.spear_wood.attack");
Sound ITEM_SPEAR_WOOD_HIT = getSound("item.spear_wood.hit");
Sound ITEM_SPEAR_WOOD_USE = getSound("item.spear_wood.use");
Sound ITEM_SPYGLASS_STOP_USING = getSound("item.spyglass.stop_using");
Sound ITEM_SPYGLASS_USE = getSound("item.spyglass.use");
@@ -55,6 +55,7 @@ public enum Statistic implements Keyed {
LEAVE_GAME,
MINECART_ONE_CM,
MOB_KILLS,
NAUTILUS_ONE_CM,
OPEN_BARREL,
CHEST_OPENED,
ENDERCHEST_OPENED,
+27 -1
View File
@@ -84,6 +84,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> CAMPFIRES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("campfires"), Material.class);
Tag<Material> CAN_GLIDE_THROUGH = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("can_glide_through"), Material.class);
Tag<Material> CANDLE_CAKES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("candle_cakes"), Material.class);
Tag<Material> CANDLES = Bukkit.getTag(REGISTRY_BLOCKS, NamespacedKey.minecraft("candles"), Material.class);
@@ -472,6 +474,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_CAMEL_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("camel_food"), Material.class);
Tag<Material> ITEMS_CAMEL_HUSK_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("camel_husk_food"), Material.class);
Tag<Material> ITEMS_CANDLES = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("candles"), Material.class);
Tag<Material> ITEMS_CAT_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("cat_food"), Material.class);
@@ -562,15 +566,19 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_ENCHANTABLE_LEG_ARMOR = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/leg_armor"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_LUNGE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/lunge"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_MACE = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/mace"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_MELEE_WEAPON = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/melee_weapon"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_MINING = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/mining"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_MINING_LOOT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/mining_loot"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_SHARP_WEAPON = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/sharp_weapon"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_SWORD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/sword"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_SWEEPING = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/sweeping"), Material.class);
Tag<Material> ITEMS_ENCHANTABLE_TRIDENT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("enchantable/trident"), Material.class);
@@ -656,6 +664,12 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_MEAT = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("meat"), 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);
Tag<Material> ITEMS_NAUTILUS_TAMING_ITEMS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("nautilus_taming_items"), Material.class);
Tag<Material> ITEMS_NETHERITE_TOOL_MATERIALS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("netherite_tool_materials"), Material.class);
Tag<Material> ITEMS_NON_FLAMMABLE_WOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("non_flammable_wood"), Material.class);
@@ -746,6 +760,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_SOUL_FIRE_BASE_BLOCKS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("soul_fire_base_blocks"), Material.class);
Tag<Material> ITEMS_SPEARS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("spears"), Material.class);
Tag<Material> ITEMS_SPRUCE_LOGS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("spruce_logs"), Material.class);
Tag<Material> ITEMS_STAIRS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("stairs"), Material.class);
@@ -810,6 +826,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<Material> ITEMS_WOOL_CARPETS = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("wool_carpets"), Material.class);
Tag<Material> ITEMS_ZOMBIE_HORSE_FOOD = Bukkit.getTag(REGISTRY_ITEMS, NamespacedKey.minecraft("zombie_horse_food"), Material.class);
String REGISTRY_FLUIDS = "fluids";
Tag<Fluid> FLUIDS_LAVA = Bukkit.getTag(REGISTRY_FLUIDS, NamespacedKey.minecraft("lava"), Fluid.class);
@@ -834,16 +852,22 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<EntityType> ENTITY_TYPES_BOAT = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("boat"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_BURN_IN_DAYLIGHT = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("burn_in_daylight"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CAN_BREATHE_UNDER_WATER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_breathe_under_water"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CAN_EQUIP_HARNESS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_equip_harness"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CAN_EQUIP_SADDLE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_equip_saddle"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CAN_FLOAT_WHILE_RIDDEN = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_float_while_ridden"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CAN_TURN_IN_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_turn_in_boats"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CAN_WEAR_HORSE_ARMOR = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_wear_horse_armor"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_CAN_WEAR_NAUTILUS_ARMOR = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("can_wear_nautilus_armor"), EntityType.class);
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_PUSHED_ONTO_BOATS = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("cannot_be_pushed_onto_boats"), EntityType.class);
@@ -876,6 +900,8 @@ public interface Tag<T extends Keyed> extends Keyed {
Tag<EntityType> ENTITY_TYPES_INVERTED_HEALING_AND_HARM = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("inverted_healing_and_harm"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_NAUTILUS_HOSTILES = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("nautilus_hostiles"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_NO_ANGER_FROM_WIND_CHARGE = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("no_anger_from_wind_charge"), EntityType.class);
Tag<EntityType> ENTITY_TYPES_NON_CONTROLLING_RIDER = Bukkit.getTag(REGISTRY_ENTITY_TYPES, NamespacedKey.minecraft("non_controlling_rider"), EntityType.class);
+19 -13
View File
@@ -43,6 +43,7 @@ import org.bukkit.util.BoundingBox;
import org.bukkit.util.RayTraceResult;
import org.bukkit.util.StructureSearchResult;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -2288,7 +2289,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* <p>
* Note that if a non-null {@code source} Entity is provided and {@code
* breakBlocks} is {@code true}, the value of {@code breakBlocks} will be
* ignored if {@link GameRule#MOB_GRIEFING} is {@code false} in the world
* ignored if {@link GameRules#MOB_GRIEFING} is {@code false} in the world
* in which the explosion occurs. In other words, the mob griefing gamerule
* will take priority over {@code breakBlocks} if explosions are not allowed.
*
@@ -2445,7 +2446,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* <p>
* Note that if a non-null {@code source} Entity is provided and {@code
* breakBlocks} is {@code true}, the value of {@code breakBlocks} will be
* ignored if {@link GameRule#MOB_GRIEFING} is {@code false} in the world
* ignored if {@link GameRules#MOB_GRIEFING} is {@code false} in the world
* in which the explosion occurs. In other words, the mob griefing gamerule
* will take priority over {@code breakBlocks} if explosions are not allowed.
*
@@ -2462,7 +2463,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* Gets the current PVP setting for this world.
*
* @return True if PVP is enabled
* @deprecated use {@link GameRule#PVP} instead
* @deprecated use {@link GameRules#PVP} instead
*/
@Deprecated(since = "1.21.9")
public boolean getPVP();
@@ -2471,7 +2472,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* Sets the PVP setting for this world.
*
* @param pvp True/False whether PVP should be Enabled.
* @deprecated use {@link GameRule#PVP} instead
* @deprecated use {@link GameRules#PVP} instead
*/
@Deprecated(since = "1.21.9")
public void setPVP(boolean pvp);
@@ -2796,23 +2797,26 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Gets if this world is natural.
*
* When false, compasses spin randomly, and using a bed to set the respawn
* point or sleep, is disabled. When true, nether portals can spawn
* zombified piglins.
* <p>
* When false, the moon is not visible and eyeblossoms do not open/close
*
* @return true if world is natural
* @deprecated replaced by the gameplay/eyeblossom_open and gameplay/creaking_active environment attributes
*/
@Deprecated(since = "1.21.11")
public boolean isNatural();
/**
* Gets if beds work in this world.
*
* A non-working bed will blow up when trying to sleep. {@link #isNatural()}
* defines if a bed can be used to set spawn point.
* <p>
* A non-working bed can blow up when trying to sleep, but that may
* not always be the case.
*
* @return true if beds work in this world
* @deprecated Due to 1.21.11 beds changes, a boolean no longer
* represents if they work. There is no replacement API yet
*/
@ApiStatus.Obsolete(since = "1.21.11")
public boolean isBedWorks();
/**
@@ -2862,7 +2866,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* </ul>
*
* @return true if this world has the above mechanics
* @deprecated as of 1.21.11, ultra warm is replaced by the WATER_EVAPORATES, FAST_LAVA, and DEFAULT_DRIPSTONE_PARTICLE environment attributes.
*/
@Deprecated(since = "1.21.11")
public boolean isUltraWarm();
/**
@@ -3789,7 +3795,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @return String value of rule
* @deprecated use {@link #getGameRuleValue(GameRule)} instead
*/
@Deprecated(since = "1.13")
@Deprecated(since = "1.21.11", forRemoval = true)
@Contract("null -> null; !null -> !null")
@Nullable
public String getGameRuleValue(@Nullable String rule);
@@ -3807,7 +3813,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @return True if rule was set
* @deprecated use {@link #setGameRule(GameRule, Object)} instead.
*/
@Deprecated(since = "1.13")
@Deprecated(since = "1.13", forRemoval = true)
public boolean setGameRuleValue(@NotNull String rule, @NotNull String value);
/**
@@ -1,8 +1,13 @@
package org.bukkit;
import com.google.common.base.Preconditions;
import io.papermc.paper.util.Tick;
import java.time.Duration;
import java.util.concurrent.TimeUnit;
import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.Range;
public interface WorldBorder {
@@ -12,20 +17,19 @@ public interface WorldBorder {
* @return the associated world, or null if this world border is not associated
* with any specific world, such as those created via {@link Server#createWorldBorder()}
*/
@Nullable
public World getWorld();
@Nullable World getWorld();
/**
* Resets the border to default values.
*/
public void reset();
void reset();
/**
* Gets the current side length of the border.
*
* @return The current side length of the border.
*/
public double getSize();
double getSize();
/**
* Sets the border to a square region with the specified side length in blocks.
@@ -33,8 +37,21 @@ public interface WorldBorder {
* @param newSize The new size of the border.
*
* @throws IllegalArgumentException if newSize is less than 1.0D or greater than {@link #getMaxSize()}
* @see #changeSize(double, long)
*/
public void setSize(double newSize);
void setSize(double newSize);
/**
* Sets the border to a square region with the specified side length in blocks.
*
* @param newSize The new side length of the border.
* @param ticks The time in ticks in which the border grows or shrinks from the previous size to that being set.
*
* @throws IllegalArgumentException if newSize is less than 1.0D or greater than {@link #getMaxSize()}
* @throws IllegalArgumentException if ticks is out of range
* @see #setSize(double)
*/
void changeSize(double newSize, @Range(from = 0, to = Integer.MAX_VALUE) long ticks);
/**
* Sets the border to a square region with the specified side length in blocks.
@@ -42,9 +59,13 @@ public interface WorldBorder {
* @param newSize The new side length of the border.
* @param seconds The time in seconds in which the border grows or shrinks from the previous size to that being set.
*
* @throws IllegalArgumentException if newSize is less than 1.0D or greater than {@link #getMaxSize()}
* @throws IllegalArgumentException if seconds is out of range once converted in ticks
* @deprecated Use {@link #changeSize(double, long)} instead
*/
public void setSize(double newSize, long seconds);
@Deprecated(since = "1.21.11", forRemoval = true)
default void setSize(double newSize, long seconds) {
this.changeSize(Math.clamp(newSize, 1.0D, this.getMaxSize()), Tick.tick().fromDuration(Duration.ofSeconds(seconds)));
}
/**
* Sets the border to a square region with the specified side length in blocks.
@@ -53,17 +74,22 @@ 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 unit is <code>null</code> or newSize is less than 1.0D 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
*/
public void setSize(double newSize, @NotNull TimeUnit unit, long time);
@Deprecated(since = "1.21.11", forRemoval = true)
default void setSize(double newSize, @NotNull TimeUnit unit, @NonNegative long time) {
Preconditions.checkArgument(unit != null, "TimeUnit cannot be null.");
this.changeSize(newSize, Tick.tick().fromDuration(Duration.of(time, unit.toChronoUnit())));
}
/**
* Gets the current border center.
*
* @return The current border center.
*/
@NotNull
public Location getCenter();
@NotNull Location getCenter();
/**
* Sets the new border center.
@@ -73,7 +99,7 @@ public interface WorldBorder {
*
* @throws IllegalArgumentException if the absolute value of x or z is higher than {@link #getMaxCenterCoordinate()}
*/
public void setCenter(double x, double z);
void setCenter(double x, double z);
/**
* Sets the new border center.
@@ -82,63 +108,87 @@ public interface WorldBorder {
*
* @throws IllegalArgumentException if location is <code>null</code> or the absolute value of {@link Location#getX()} or {@link Location#getZ()} is higher than {@link #getMaxCenterCoordinate()}
*/
public void setCenter(@NotNull Location location);
void setCenter(@NotNull Location location);
/**
* Gets the current border damage buffer.
*
* @return The current border damage buffer.
*/
public double getDamageBuffer();
double getDamageBuffer();
/**
* Sets the amount of blocks a player may safely be outside the border before taking damage.
*
* @param blocks The amount of blocks. (The default is 5 blocks.)
*/
public void setDamageBuffer(double blocks);
void setDamageBuffer(double blocks);
/**
* Gets the current border damage amount.
*
* @return The current border damage amount.
*/
public double getDamageAmount();
double getDamageAmount();
/**
* Sets the amount of damage a player takes when outside the border plus the border buffer.
*
* @param damage The amount of damage. (The default is 0.2 damage per second per block.)
*/
public void setDamageAmount(double damage);
void setDamageAmount(double damage);
/**
* Gets the current border warning time in seconds.
*
* @return The current border warning time in seconds.
* @deprecated Use {@link #getWarningTimeTicks()} instead
*/
public int getWarningTime();
@Deprecated(since = "1.21.11", forRemoval = true)
default @NonNegative int getWarningTime() {
return (int) Tick.of(this.getWarningTimeTicks()).toSeconds();
}
/**
* Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
*
* @param seconds The amount of time in seconds. (The default is 15 seconds.)
* @param seconds The amount of time in seconds.
* @deprecated Use {@link #setWarningTimeTicks(int)} instead
*/
public void setWarningTime(int seconds);
@Deprecated(since = "1.21.11", forRemoval = true)
default void setWarningTime(@NonNegative int seconds) {
Preconditions.checkArgument(seconds >= 0, "seconds cannot be lower than 0");
this.setWarningTimeTicks(Tick.tick().fromDuration(Duration.ofSeconds(seconds)));
}
/**
* Gets the current border warning time in ticks.
*
* @return The current border warning time in ticks.
*/
@NonNegative int getWarningTimeTicks();
/**
* Sets the warning time that causes the screen to be tinted red when a contracting border will reach the player within the specified time.
*
* @param ticks The number of ticks.
*/
void setWarningTimeTicks(@NonNegative int ticks);
/**
* Gets the current border warning distance.
*
* @return The current border warning distance.
*/
public int getWarningDistance();
int getWarningDistance();
/**
* Sets the warning distance that causes the screen to be tinted red when the player is within the specified number of blocks from the border.
*
* @param distance The distance in blocks. (The default is 5 blocks.)
*/
public void setWarningDistance(int distance);
void setWarningDistance(int distance);
/**
* Check if the specified location is inside this border.
@@ -146,14 +196,14 @@ public interface WorldBorder {
* @param location the location to check
* @return if this location is inside the border or not
*/
public boolean isInside(@NotNull Location location);
boolean isInside(@NotNull Location location);
/**
* Gets the maximum possible size of a WorldBorder.
*
* @return The maximum size the WorldBorder
*/
public double getMaxSize();
double getMaxSize();
/**
* Gets the absolute value of the maximum x/z center coordinate of a
@@ -161,5 +211,5 @@ public interface WorldBorder {
*
* @return The absolute maximum center coordinate of the WorldBorder
*/
public double getMaxCenterCoordinate();
double getMaxCenterCoordinate();
}
@@ -7,7 +7,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.GameRule;
import org.bukkit.GameRules;
import org.bukkit.Location;
import org.bukkit.Server;
import org.bukkit.entity.Player;
@@ -477,14 +477,14 @@ public abstract class Command {
if (source instanceof BlockCommandSender) {
BlockCommandSender blockCommandSender = (BlockCommandSender) source;
if (!blockCommandSender.getBlock().getWorld().getGameRuleValue(GameRule.COMMAND_BLOCK_OUTPUT)) {
if (!blockCommandSender.getBlock().getWorld().getGameRuleValue(GameRules.COMMAND_BLOCK_OUTPUT)) {
Bukkit.getConsoleSender().sendMessage(result);
return;
}
} else if (source instanceof CommandMinecart) {
CommandMinecart commandMinecart = (CommandMinecart) source;
if (!commandMinecart.getWorld().getGameRuleValue(GameRule.COMMAND_BLOCK_OUTPUT)) {
if (!commandMinecart.getWorld().getGameRuleValue(GameRules.COMMAND_BLOCK_OUTPUT)) {
Bukkit.getConsoleSender().sendMessage(result);
return;
}
@@ -93,6 +93,8 @@ public interface DamageType extends Keyed, Translatable {
DamageType SONIC_BOOM = getDamageType("sonic_boom");
DamageType SPEAR = getDamageType("spear");
DamageType SPIT = getDamageType("spit");
DamageType STALAGMITE = getDamageType("stalagmite");
@@ -229,6 +229,11 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
*/
public static final Enchantment SWIFT_SNEAK = getEnchantment("swift_sneak");
/**
* Causes a jab attack from a spear to propel the user into the air
*/
public static final Enchantment LUNGE = getEnchantment("lunge");
@NotNull
private static Enchantment getEnchantment(@NotNull String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT).getOrThrow(NamespacedKey.minecraft(key));
@@ -82,12 +82,12 @@ public enum EnchantmentTarget {
},
/**
* Allows the Enchantment to be placed on weapons (swords)
* Allows the Enchantment to be placed on weapons (swords, spears)
*/
WEAPON {
@Override
public boolean includes(@NotNull Material item) {
return Tag.ITEMS_ENCHANTABLE_SWORD.isTagged(item);
return Tag.ITEMS_ENCHANTABLE_SHARP_WEAPON.isTagged(item);
}
},
@@ -0,0 +1,12 @@
package org.bukkit.entity;
import org.bukkit.inventory.ArmoredSaddledMountInventory;
import org.bukkit.inventory.InventoryHolder;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface AbstractNautilus extends Animals, InventoryHolder, Tameable {
@Override
ArmoredSaddledMountInventory getInventory();
}
@@ -0,0 +1,8 @@
package org.bukkit.entity;
/**
* Represents a Camel Husk.
*/
public interface CamelHusk extends Camel {
}
@@ -66,6 +66,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
BREEZE("breeze", Breeze.class, -1),
BREEZE_WIND_CHARGE("breeze_wind_charge", BreezeWindCharge.class, -1),
CAMEL("camel", Camel.class, -1),
CAMEL_HUSK("camel_husk", CamelHusk.class, -1),
CAT("cat", Cat.class, -1),
CAVE_SPIDER("cave_spider", CaveSpider.class, 59),
CHERRY_BOAT("cherry_boat", CherryBoat.class, -1),
@@ -135,6 +136,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
MINECART("minecart", RideableMinecart.class, 42),
MOOSHROOM("mooshroom", MushroomCow.class, 96),
MULE("mule", Mule.class, 32),
NAUTILUS("nautilus", Nautilus.class, -1),
OAK_BOAT("oak_boat", OakBoat.class, -1),
OAK_CHEST_BOAT("oak_chest_boat", OakChestBoat.class, -1),
OCELOT("ocelot", Ocelot.class, 98),
@@ -143,6 +145,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
PALE_OAK_BOAT("pale_oak_boat", PaleOakBoat.class, -1),
PALE_OAK_CHEST_BOAT("pale_oak_chest_boat", PaleOakChestBoat.class, -1),
PANDA("panda", Panda.class, -1),
PARCHED("parched", Parched.class, -1),
PARROT("parrot", Parrot.class, 105),
PHANTOM("phantom", Phantom.class, -1),
PIG("pig", Pig.class, 90),
@@ -197,6 +200,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
ZOGLIN("zoglin", Zoglin.class, -1),
ZOMBIE("zombie", Zombie.class, 54),
ZOMBIE_HORSE("zombie_horse", ZombieHorse.class, 29),
ZOMBIE_NAUTILUS("zombie_nautilus", ZombieNautilus.class, -1),
ZOMBIE_VILLAGER("zombie_villager", ZombieVillager.class, 27),
ZOMBIFIED_PIGLIN("zombified_piglin", PigZombie.class, 57),
// End generate - EntityType
@@ -1,6 +1,6 @@
package org.bukkit.entity;
import org.bukkit.GameRule;
import org.bukkit.GameRules;
import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.material.MaterialData;
@@ -37,7 +37,7 @@ public interface Minecart extends Vehicle, io.papermc.paper.entity.Frictional {
/**
* Sets the maximum speed of a minecart. Must be nonnegative. Default is
* 0.4D or {@link GameRule#MINECART_MAX_SPEED}.
* 0.4D or {@link GameRules#MAX_MINECART_SPEED}.
*
* @param speed The max speed
*/
@@ -0,0 +1,7 @@
package org.bukkit.entity;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface Nautilus extends AbstractNautilus {
}
@@ -0,0 +1,8 @@
package org.bukkit.entity;
/**
* Represents a parched Skeleton.
*/
public interface Parched extends AbstractSkeleton {
}
@@ -74,6 +74,10 @@ public interface Skeleton extends AbstractSkeleton {
/**
* Bogged skeleton.
*/
BOGGED;
BOGGED,
/**
* Parched skeleton.
*/
PARCHED;
}
}
@@ -0,0 +1,41 @@
package org.bukkit.entity;
import io.papermc.paper.registry.RegistryAccess;
import io.papermc.paper.registry.RegistryKey;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface ZombieNautilus extends AbstractNautilus {
/**
* Gets the variant of this zombie nautilus.
*
* @return the variant
*/
Variant getVariant();
/**
* Sets the variant of this zombie nautilus.
*
* @param variant the variant
*/
void setVariant(Variant variant);
/**
* Represents the variant of a Zombie Nautilus.
*/
interface Variant extends Keyed {
// Start generate - ZombieNautilusVariant
Variant TEMPERATE = getVariant("temperate");
Variant WARM = getVariant("warm");
// End generate - ZombieNautilusVariant
private static Variant getVariant(String key) {
return RegistryAccess.registryAccess().getRegistry(RegistryKey.ZOMBIE_NAUTILUS_VARIANT).getOrThrow(NamespacedKey.minecraft(key));
}
}
}
@@ -57,8 +57,12 @@ public final class MemoryKey<T> implements Keyed {
public static final MemoryKey<Boolean> ATTACK_COOLING_DOWN = new MemoryKey<>(NamespacedKey.minecraft("attack_cooling_down"), Boolean.class);
public static final MemoryKey<Integer> ATTACK_TARGET_COOLDOWN = new MemoryKey<>(NamespacedKey.minecraft("attack_target_cooldown"), Integer.class);
public static final MemoryKey<Long> CANT_REACH_WALK_TARGET_SINCE = new MemoryKey<>(NamespacedKey.minecraft("cant_reach_walk_target_since"), Long.class);
public static final MemoryKey<Integer> CHARGE_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("charge_cooldown_ticks"), Integer.class);
public static final MemoryKey<Boolean> DANCING = new MemoryKey<>(NamespacedKey.minecraft("dancing"), Boolean.class);
public static final MemoryKey<Boolean> DANGER_DETECTED_RECENTLY = new MemoryKey<>(NamespacedKey.minecraft("danger_detected_recently"), Boolean.class);
@@ -117,6 +121,10 @@ public final class MemoryKey<T> implements Keyed {
public static final MemoryKey<Boolean> SNIFFER_HAPPY = new MemoryKey<>(NamespacedKey.minecraft("sniffer_happy"), Boolean.class);
public static final MemoryKey<Integer> SPEAR_ENGAGE_TIME = new MemoryKey<>(NamespacedKey.minecraft("spear_engage_time"), Integer.class);
public static final MemoryKey<Integer> SPEAR_FLEEING_TIME = new MemoryKey<>(NamespacedKey.minecraft("spear_fleeing_time"), Integer.class);
public static final MemoryKey<Integer> TEMPTATION_COOLDOWN_TICKS = new MemoryKey<>(NamespacedKey.minecraft("temptation_cooldown_ticks"), Integer.class);
public static final MemoryKey<Integer> TIME_TRYING_TO_REACH_ADMIRE_ITEM = new MemoryKey<>(NamespacedKey.minecraft("time_trying_to_reach_admire_item"), Integer.class);
@@ -16,7 +16,7 @@ import org.jetbrains.annotations.NotNull;
* an air block. {@link #getExplodedBlockState()} should be used to get
* information about the block state that exploded.
* <p>
* The event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
* The event isn't called if the {@link org.bukkit.GameRules#MOB_GRIEFING}
* is disabled as no block interaction will occur.
*/
public class BlockExplodeEvent extends BlockEvent implements Cancellable {
@@ -476,7 +476,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
CAMPFIRE,
/**
* Damage caused when an entity is colliding with too many entities due
* to the {@link org.bukkit.GameRule#MAX_ENTITY_CRAMMING}.
* to the {@link org.bukkit.GameRules#MAX_ENTITY_CRAMMING}.
* <p>
* Damage: 6
*/
@@ -134,6 +134,12 @@ public class EntityExhaustionEvent extends EntityEvent implements Cancellable {
* Player regenerated health
*/
REGEN,
/**
* Player was affected by an enchantment
* @see <a href="https://minecraft.wiki/w/Enchantment_definition#apply_exhaustion">Minecraft Wiki: Enchantment Effects "apply_exhaustion"</a>
*/
// TODO - snapshot - In release check if this Wiki URL exists
ENCHANTMENT_EFFECT,
/**
* Unknown exhaustion reason
*/
@@ -12,7 +12,7 @@ import org.jetbrains.annotations.NotNull;
/**
* Called when an entity explodes interacting with blocks. The
* event isn't called if the {@link org.bukkit.GameRule#MOB_GRIEFING}
* event isn't called if the {@link org.bukkit.GameRules#MOB_GRIEFING}
* is disabled as no block interaction will occur.
*/
public class EntityExplodeEvent extends EntityEvent implements Cancellable {
@@ -218,6 +218,10 @@ public class EntityPotionEffectEvent extends EntityEvent implements Cancellable
* When all effects are removed due to a bucket of milk.
*/
MILK,
/**
* When the entity gets the effect from a nautilus.
*/
NAUTILUS,
/**
* When a player gets bad omen after killing a patrol captain.
*
@@ -92,7 +92,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
/**
* Get whether the death message should be shown.
* By default, this is determined by {@link org.bukkit.GameRule#SHOW_DEATH_MESSAGES}.
* By default, this is determined by {@link org.bukkit.GameRules#SHOW_DEATH_MESSAGES}.
*
* @return whether the death message should be shown
* @see #deathMessage()
@@ -104,7 +104,7 @@ public class PlayerDeathEvent extends EntityDeathEvent {
/**
* Set whether the death message should be shown.
* By default, this is determined by {@link org.bukkit.GameRule#SHOW_DEATH_MESSAGES}.
* By default, this is determined by {@link org.bukkit.GameRules#SHOW_DEATH_MESSAGES}.
*
* @param displayDeathMessage whether the death message should be shown
* @see #deathMessage()
@@ -50,8 +50,8 @@ public class InventoryOpenEvent extends InventoryEvent implements Cancellable {
* This is only the title sent to the client in the open packet, this doesn't change
* the title returned by {@link InventoryView#title()}, hence "override".
* <p>
* <b>NOTE:</b> Horse inventories are a special case where setting this will
* have no effect. Horse inventory titles are set by the horse display name.
* <b>NOTE:</b> Horse and nautilus inventories are a special case where setting this will
* have no effect. These inventory titles are set by the entity's display name.
*
* @param titleOverride the title override or {@code null}
*/
@@ -1,6 +1,7 @@
package org.bukkit.event.player;
import org.bukkit.World;
import io.papermc.paper.block.bed.BedEnterAction;
import io.papermc.paper.block.bed.BedRuleResult;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
@@ -17,19 +18,15 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
private final Block bed;
private final BedEnterResult bedEnterResult;
private final @NotNull BedEnterAction enterAction;
private Result useBed = Result.DEFAULT;
@ApiStatus.Internal
public PlayerBedEnterEvent(@NotNull Player player, @NotNull Block bed, @NotNull BedEnterResult bedEnterResult) {
public PlayerBedEnterEvent(@NotNull Player player, @NotNull Block bed, @NotNull BedEnterResult bedEnterResult, @NotNull BedEnterAction enterAction) {
super(player);
this.bed = bed;
this.bedEnterResult = bedEnterResult;
}
@ApiStatus.Internal
@Deprecated(since = "1.13.2", forRemoval = true)
public PlayerBedEnterEvent(@NotNull Player player, @NotNull Block bed) {
this(player, bed, BedEnterResult.OK);
this.enterAction = enterAction;
}
/**
@@ -46,17 +43,30 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
* This describes the default outcome of this event.
*
* @return the bed enter result representing the default outcome of this event
* @deprecated This enum has been replaced with a system that better
* represents how beds work. See {@link #enterAction}
*/
@NotNull
@ApiStatus.Obsolete(since = "1.21.11")
public BedEnterResult getBedEnterResult() {
return this.bedEnterResult;
}
/**
* This describes the default outcome of this event.
*
* @return the action representing the default outcome of this event
*/
@ApiStatus.Experimental
public @NotNull BedEnterAction enterAction() {
return this.enterAction;
}
/**
* This controls the action to take with the bed that was clicked on.
* <p>
* In case of {@link Result#DEFAULT}, the default outcome is described by
* {@link #getBedEnterResult()}.
* {@link #enterAction()}.
*
* @return the action to take with the interacted bed
* @see #setUseBed(Result)
@@ -70,13 +80,13 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
* Sets the action to take with the interacted bed.
* <p>
* {@link Result#ALLOW} will result in the player sleeping, regardless of
* the default outcome described by {@link #getBedEnterResult()}.
* the default outcome described by {@link #enterAction()}.
* <br>
* {@link Result#DENY} will prevent the player from sleeping. This has the
* same effect as canceling the event via {@link #setCancelled(boolean)}.
* <br>
* {@link Result#DEFAULT} will result in the outcome described by
* {@link #getBedEnterResult()}.
* {@link #enterAction()}.
*
* @param useBed the action to take with the interacted bed
* @see #useBed()
@@ -94,13 +104,13 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
* <p>
* For backwards compatibility reasons this also returns {@code true} if
* {@link #useBed()} is {@link Result#DEFAULT} and the
* {@link #getBedEnterResult() default action} is to prevent bed entering.
* {@link #enterAction() default action} is to prevent bed entering.
*
* @return boolean cancellation state
*/
@Override
public boolean isCancelled() {
return this.useBed == Result.DENY || this.useBed == Result.DEFAULT && this.bedEnterResult != BedEnterResult.OK;
return this.useBed == Result.DENY || this.useBed == Result.DEFAULT && this.enterAction.canSleep() != BedRuleResult.ALLOWED;
}
/**
@@ -126,19 +136,23 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
/**
* Represents the default possible outcomes of this event.
*
* @deprecated Enums no longer represents reliably how beds work and fail. This has been
* replaced with {@link BedEnterAction} that better fits the new beds
*/
@ApiStatus.Obsolete(since = "1.21.11")
public enum BedEnterResult {
/**
* The player will enter the bed.
*/
OK,
/**
* The world doesn't allow sleeping or saving the spawn point (eg,
* Nether, The End or Custom Worlds). This is based on
* {@link World#isBedWorks()} and {@link World#isNatural()}.
* The world doesn't allow sleeping (eg, Nether, The End or Custom Worlds), but
* saving the spawn point may still be allowed. See {@link com.destroystokyo.paper.event.player.PlayerSetSpawnEvent}.
* for spawn point changes. This is only called when sleeping isn't allowed and the bed
* doesn't explode. When the bed explodes, {@link #EXPLOSION} is called instead.
* <p>
* Entering the bed is prevented and if {@link World#isBedWorks()} is
* {@code false} then the bed explodes.
* Entering the bed is prevented
*/
NOT_POSSIBLE_HERE,
/**
@@ -165,6 +179,10 @@ public class PlayerBedEnterEvent extends PlayerEvent implements Cancellable {
/**
* Entering the bed is prevented due to there being some other problem.
*/
OTHER_PROBLEM;
OTHER_PROBLEM,
/**
* Entering the bed is prevented and the bed explodes.
*/
EXPLOSION;
}
}
@@ -6,20 +6,11 @@ import org.jetbrains.annotations.Nullable;
/**
* An interface to the inventory of an {@link AbstractHorse}.
*/
public interface AbstractHorseInventory extends Inventory {
public interface AbstractHorseInventory extends SaddledMountInventory {
/**
* Gets the item in the horse's saddle slot.
*
* @return the saddle item
*/
@Nullable
ItemStack getSaddle();
@Override
@Nullable ItemStack getSaddle();
/**
* Sets the item in the horse's saddle slot.
*
* @param stack the new item
*/
@Override
void setSaddle(@Nullable ItemStack stack);
}
@@ -4,19 +4,11 @@ import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
public interface ArmoredHorseInventory extends AbstractHorseInventory {
public interface ArmoredHorseInventory extends AbstractHorseInventory, ArmoredSaddledMountInventory {
/**
* Gets the item in the horse's armor slot.
*
* @return the armor item
*/
@Override
@Nullable ItemStack getArmor();
/**
* Sets the item in the horse's armor slot.
*
* @param stack the new item
*/
@Override
void setArmor(@Nullable ItemStack stack);
}
@@ -0,0 +1,22 @@
package org.bukkit.inventory;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
public interface ArmoredMountInventory extends MountInventory {
/**
* Gets the item in the mount's armor slot.
*
* @return the armor item
*/
@Nullable ItemStack getArmor();
/**
* Sets the item in the mount's armor slot.
*
* @param stack the new item
*/
void setArmor(@Nullable ItemStack stack);
}
@@ -0,0 +1,4 @@
package org.bukkit.inventory;
public interface ArmoredSaddledMountInventory extends ArmoredMountInventory, SaddledMountInventory {
}
@@ -13,11 +13,11 @@ public enum EquipmentSlot {
CHEST(() -> EquipmentSlotGroup.CHEST),
HEAD(() -> EquipmentSlotGroup.HEAD),
/**
* Only for certain entities such as horses, happy ghasts and wolves.
* Only for certain entities such as horses, wolves, happy ghasts and nautiluses.
*/
BODY(() -> EquipmentSlotGroup.BODY),
/**
* Only for certain entities such as pigs, horses, striders and copper golems.
* Only for certain entities such as pigs, horses, striders, copper golems and nautiluses.
*/
SADDLE(() -> EquipmentSlotGroup.SADDLE);
@@ -94,7 +94,6 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
//<editor-fold desc="ItemTypes" defaultstate="collapsed">
// Start generate - ItemType
// @GeneratedFrom 25w34b
ItemType.Typed<ItemMeta> ACACIA_BOAT = getItemType("acacia_boat");
ItemType.Typed<ItemMeta> ACACIA_BUTTON = getItemType("acacia_button");
@@ -483,6 +482,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<BlockStateMeta> CALIBRATED_SCULK_SENSOR = getItemType("calibrated_sculk_sensor");
ItemType.Typed<SpawnEggMeta> CAMEL_HUSK_SPAWN_EGG = getItemType("camel_husk_spawn_egg");
ItemType.Typed<SpawnEggMeta> CAMEL_SPAWN_EGG = getItemType("camel_spawn_egg");
ItemType.Typed<BlockStateMeta> CAMPFIRE = getItemType("campfire");
@@ -699,6 +700,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ArmorMeta> COPPER_LEGGINGS = getItemType("copper_leggings");
ItemType.Typed<ItemMeta> COPPER_NAUTILUS_ARMOR = getItemType("copper_nautilus_armor");
ItemType.Typed<ItemMeta> COPPER_NUGGET = getItemType("copper_nugget");
ItemType.Typed<ItemMeta> COPPER_ORE = getItemType("copper_ore");
@@ -707,6 +710,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> COPPER_SHOVEL = getItemType("copper_shovel");
ItemType.Typed<ItemMeta> COPPER_SPEAR = getItemType("copper_spear");
ItemType.Typed<ItemMeta> COPPER_SWORD = getItemType("copper_sword");
ItemType.Typed<ItemMeta> COPPER_TORCH = getItemType("copper_torch");
@@ -963,12 +968,16 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ArmorMeta> DIAMOND_LEGGINGS = getItemType("diamond_leggings");
ItemType.Typed<ItemMeta> DIAMOND_NAUTILUS_ARMOR = getItemType("diamond_nautilus_armor");
ItemType.Typed<ItemMeta> DIAMOND_ORE = getItemType("diamond_ore");
ItemType.Typed<ItemMeta> DIAMOND_PICKAXE = getItemType("diamond_pickaxe");
ItemType.Typed<ItemMeta> DIAMOND_SHOVEL = getItemType("diamond_shovel");
ItemType.Typed<ItemMeta> DIAMOND_SPEAR = getItemType("diamond_spear");
ItemType.Typed<ItemMeta> DIAMOND_SWORD = getItemType("diamond_sword");
ItemType.Typed<ItemMeta> DIORITE = getItemType("diorite");
@@ -1217,10 +1226,14 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ArmorMeta> GOLDEN_LEGGINGS = getItemType("golden_leggings");
ItemType.Typed<ItemMeta> GOLDEN_NAUTILUS_ARMOR = getItemType("golden_nautilus_armor");
ItemType.Typed<ItemMeta> GOLDEN_PICKAXE = getItemType("golden_pickaxe");
ItemType.Typed<ItemMeta> GOLDEN_SHOVEL = getItemType("golden_shovel");
ItemType.Typed<ItemMeta> GOLDEN_SPEAR = getItemType("golden_spear");
ItemType.Typed<ItemMeta> GOLDEN_SWORD = getItemType("golden_sword");
ItemType.Typed<ItemMeta> GRANITE = getItemType("granite");
@@ -1373,10 +1386,10 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> IRON_BLOCK = getItemType("iron_block");
ItemType.Typed<ItemMeta> IRON_CHAIN = getItemType("iron_chain");
ItemType.Typed<ArmorMeta> IRON_BOOTS = getItemType("iron_boots");
ItemType.Typed<ItemMeta> IRON_CHAIN = getItemType("iron_chain");
ItemType.Typed<ArmorMeta> IRON_CHESTPLATE = getItemType("iron_chestplate");
ItemType.Typed<ItemMeta> IRON_DOOR = getItemType("iron_door");
@@ -1393,6 +1406,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ArmorMeta> IRON_LEGGINGS = getItemType("iron_leggings");
ItemType.Typed<ItemMeta> IRON_NAUTILUS_ARMOR = getItemType("iron_nautilus_armor");
ItemType.Typed<ItemMeta> IRON_NUGGET = getItemType("iron_nugget");
ItemType.Typed<ItemMeta> IRON_ORE = getItemType("iron_ore");
@@ -1401,6 +1416,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> IRON_SHOVEL = getItemType("iron_shovel");
ItemType.Typed<ItemMeta> IRON_SPEAR = getItemType("iron_spear");
ItemType.Typed<ItemMeta> IRON_SWORD = getItemType("iron_sword");
ItemType.Typed<ItemMeta> IRON_TRAPDOOR = getItemType("iron_trapdoor");
@@ -1785,6 +1802,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> NAUTILUS_SHELL = getItemType("nautilus_shell");
ItemType.Typed<SpawnEggMeta> NAUTILUS_SPAWN_EGG = getItemType("nautilus_spawn_egg");
ItemType.Typed<ItemMeta> NETHER_BRICK = getItemType("nether_brick");
ItemType.Typed<ItemMeta> NETHER_BRICK_FENCE = getItemType("nether_brick_fence");
@@ -1821,16 +1840,22 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> NETHERITE_HOE = getItemType("netherite_hoe");
ItemType.Typed<ItemMeta> NETHERITE_HORSE_ARMOR = getItemType("netherite_horse_armor");
ItemType.Typed<ItemMeta> NETHERITE_INGOT = getItemType("netherite_ingot");
ItemType.Typed<ArmorMeta> NETHERITE_LEGGINGS = getItemType("netherite_leggings");
ItemType.Typed<ItemMeta> NETHERITE_NAUTILUS_ARMOR = getItemType("netherite_nautilus_armor");
ItemType.Typed<ItemMeta> NETHERITE_PICKAXE = getItemType("netherite_pickaxe");
ItemType.Typed<ItemMeta> NETHERITE_SCRAP = getItemType("netherite_scrap");
ItemType.Typed<ItemMeta> NETHERITE_SHOVEL = getItemType("netherite_shovel");
ItemType.Typed<ItemMeta> NETHERITE_SPEAR = getItemType("netherite_spear");
ItemType.Typed<ItemMeta> NETHERITE_SWORD = getItemType("netherite_sword");
ItemType.Typed<ItemMeta> NETHERITE_UPGRADE_SMITHING_TEMPLATE = getItemType("netherite_upgrade_smithing_template");
@@ -2005,6 +2030,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> PAPER = getItemType("paper");
ItemType.Typed<SpawnEggMeta> PARCHED_SPAWN_EGG = getItemType("parched_spawn_egg");
ItemType.Typed<SpawnEggMeta> PARROT_SPAWN_EGG = getItemType("parrot_spawn_egg");
ItemType.Typed<ItemMeta> PEARLESCENT_FROGLIGHT = getItemType("pearlescent_froglight");
@@ -2583,6 +2610,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> STONE_SLAB = getItemType("stone_slab");
ItemType.Typed<ItemMeta> STONE_SPEAR = getItemType("stone_spear");
ItemType.Typed<ItemMeta> STONE_STAIRS = getItemType("stone_stairs");
ItemType.Typed<ItemMeta> STONE_SWORD = getItemType("stone_sword");
@@ -3023,6 +3052,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<ItemMeta> WOODEN_SHOVEL = getItemType("wooden_shovel");
ItemType.Typed<ItemMeta> WOODEN_SPEAR = getItemType("wooden_spear");
ItemType.Typed<ItemMeta> WOODEN_SWORD = getItemType("wooden_sword");
ItemType.Typed<BookMeta> WRITABLE_BOOK = getItemType("writable_book");
@@ -3065,6 +3096,8 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
ItemType.Typed<SpawnEggMeta> ZOMBIE_HORSE_SPAWN_EGG = getItemType("zombie_horse_spawn_egg");
ItemType.Typed<SpawnEggMeta> ZOMBIE_NAUTILUS_SPAWN_EGG = getItemType("zombie_nautilus_spawn_egg");
ItemType.Typed<SpawnEggMeta> ZOMBIE_SPAWN_EGG = getItemType("zombie_spawn_egg");
ItemType.Typed<SpawnEggMeta> ZOMBIE_VILLAGER_SPAWN_EGG = getItemType("zombie_villager_spawn_egg");
@@ -0,0 +1,7 @@
package org.bukkit.inventory;
import org.jspecify.annotations.NullMarked;
@NullMarked
public interface MountInventory extends Inventory {
}
@@ -0,0 +1,22 @@
package org.bukkit.inventory;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
@NullMarked
public interface SaddledMountInventory extends MountInventory {
/**
* Gets the item in the mount's saddle slot.
*
* @return the saddle item
*/
@Nullable ItemStack getSaddle();
/**
* Sets the item in the mount's saddle slot.
*
* @param stack the new item
*/
void setSaddle(@Nullable ItemStack stack);
}
@@ -220,6 +220,11 @@ public abstract class PotionEffectType implements Keyed, Translatable, net.kyori
*/
public static final PotionEffectType INFESTED = getPotionEffectType(39, "infested");
/**
* Prevent the oxygen bar from depleting underwater.
*/
public static final PotionEffectType BREATH_OF_THE_NAUTILUS = getPotionEffectType(40, "breath_of_the_nautilus");
@NotNull
private static PotionEffectType getPotionEffectType(int typeId, @NotNull String key) {
PotionEffectType potionEffectType = Registry.EFFECT.getOrThrow(NamespacedKey.minecraft(key));
@@ -1,28 +0,0 @@
package org.bukkit;
import static org.bukkit.support.MatcherAssert.*;
import static org.hamcrest.CoreMatchers.*;
import org.junit.jupiter.api.Test;
public class EffectTest {
private static final org.apache.logging.log4j.Logger LOGGER = org.apache.logging.log4j.LogManager.getLogger(); // Paper
@Test
public void getById() {
for (Effect effect : Effect.values()) {
if (!isDeprecated(effect)) // Paper
assertThat(Effect.getById(effect.getId()), is(effect));
}
}
// Paper start
private static boolean isDeprecated(Effect effect) {
try {
return Effect.class.getDeclaredField(effect.name()).isAnnotationPresent(Deprecated.class);
} catch (NoSuchFieldException e) {
LOGGER.error("Error getting effect enum field {}", effect.name(), e);
return false;
}
}
// Paper end
}
+4 -4
View File
@@ -23,10 +23,10 @@ dependencies {
implementation("io.papermc.typewriter:typewriter:1.0.1") {
isTransitive = false // paper-api already have everything
}
implementation("info.picocli:picocli:4.7.6")
implementation("io.github.classgraph:classgraph:4.8.47")
implementation("org.jetbrains:annotations:26.0.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
implementation("info.picocli:picocli:4.7.7")
implementation("io.github.classgraph:classgraph:4.8.179")
implementation("org.jetbrains:annotations:26.0.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.12.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
serverRuntimeClasspath(project(":paper-server", "runtimeConfiguration"))
@@ -7,7 +7,7 @@ import io.papermc.generator.types.goal.MobGoalGenerator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import net.minecraft.Util;
import net.minecraft.util.Util;
import org.jspecify.annotations.NullMarked;
@NullMarked
@@ -17,14 +17,14 @@ import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.stream.Stream;
import net.minecraft.SharedConstants;
import net.minecraft.Util;
import net.minecraft.util.Util;
import net.minecraft.commands.Commands;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.RegistryDataLoader;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.server.Bootstrap;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.RegistryLayer;
@@ -34,6 +34,7 @@ import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.ServerPacksSource;
import net.minecraft.server.packs.resources.CloseableResourceManager;
import net.minecraft.server.packs.resources.MultiPackResourceManager;
import net.minecraft.server.permissions.LevelBasedPermissionSet;
import net.minecraft.tags.TagKey;
import net.minecraft.tags.TagLoader;
import net.minecraft.world.flag.FeatureFlagSet;
@@ -78,7 +79,7 @@ public class Main implements Callable<Integer> {
PackRepository packRepository = ServerPacksSource.createVanillaTrustedRepository();
FeatureFlagSet flags = FeatureFlags.REGISTRY.allFlags();
MinecraftServer.configurePackRepository(packRepository, new WorldDataConfiguration(new DataPackConfig(FeatureFlags.REGISTRY.toNames(flags).stream().map(ResourceLocation::getPath).toList(), List.of()), flags), true, false);
MinecraftServer.configurePackRepository(packRepository, new WorldDataConfiguration(new DataPackConfig(FeatureFlags.REGISTRY.toNames(flags).stream().map(Identifier::getPath).toList(), List.of()), flags), true, false);
CloseableResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, packRepository.openAllSelected());
LayeredRegistryAccess<RegistryLayer> layers = RegistryLayer.createRegistryAccess();
@@ -97,7 +98,7 @@ public class Main implements Callable<Integer> {
pendingTags,
flags,
Commands.CommandSelection.DEDICATED,
Commands.LEVEL_GAMEMASTERS,
LevelBasedPermissionSet.GAMEMASTER,
Util.backgroundExecutor(),
Runnable::run
).whenComplete((result, ex) -> {
@@ -23,6 +23,7 @@ import io.papermc.generator.rewriter.types.simple.StatisticRewriter;
import io.papermc.generator.rewriter.types.simple.trial.VillagerProfessionRewriter;
import io.papermc.generator.types.goal.MobGoalNames;
import io.papermc.generator.utils.Formatting;
import io.papermc.paper.datacomponent.item.SwingAnimation;
import io.papermc.paper.datacomponent.item.consumable.ItemUseAnimation;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.world.WeatheringCopperState;
@@ -36,16 +37,19 @@ import javax.lang.model.SourceVersion;
import net.kyori.adventure.text.format.NamedTextColor;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.contents.TranslatableContents;
import net.minecraft.server.level.ParticleStatus;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.player.ChatVisiblity;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.SwingAnimationType;
import net.minecraft.world.level.block.WeatheringCopper;
import org.bukkit.Art;
import org.bukkit.FeatureFlag;
import org.bukkit.Fluid;
import org.bukkit.GameEvent;
import org.bukkit.GameRules;
import org.bukkit.JukeboxSong;
import org.bukkit.Material;
import org.bukkit.MusicInstrument;
@@ -73,6 +77,7 @@ import org.bukkit.entity.Sniffer;
import org.bukkit.entity.TropicalFish;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.ZombieNautilus;
import org.bukkit.entity.memory.MemoryKey;
import org.bukkit.generator.structure.Structure;
import org.bukkit.generator.structure.StructureType;
@@ -121,18 +126,18 @@ public final class Rewriters {
}
})
.register("SnifferState", Sniffer.State.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.sniffer.Sniffer.State.class))
.register("PandaGene", Panda.Gene.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Panda.Gene.class) {
.register("PandaGene", Panda.Gene.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.panda.Panda.Gene.class) {
@Override
protected EnumValue.Builder rewriteEnumValue(net.minecraft.world.entity.animal.Panda.Gene gene) {
protected EnumValue.Builder rewriteEnumValue(net.minecraft.world.entity.animal.panda.Panda.Gene gene) {
return super.rewriteEnumValue(gene).argument(String.valueOf(gene.isRecessive()));
}
})
.register("CookingBookCategory", CookingBookCategory.class, new EnumCloneRewriter<>(net.minecraft.world.item.crafting.CookingBookCategory.class))
.register("CraftingBookCategory", CraftingBookCategory.class, new EnumCloneRewriter<>(net.minecraft.world.item.crafting.CraftingBookCategory.class))
.register("TropicalFishPattern", TropicalFish.Pattern.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.TropicalFish.Pattern.class))
.register("BoatStatus", Boat.Status.class, new EnumCloneRewriter<>(net.minecraft.world.entity.vehicle.Boat.Status.class))
.register("FoxType", Fox.Type.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Fox.Variant.class))
.register("SalmonVariant", Salmon.Variant.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.Salmon.Variant.class))
.register("TropicalFishPattern", TropicalFish.Pattern.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.fish.TropicalFish.Pattern.class))
.register("BoatStatus", Boat.Status.class, new EnumCloneRewriter<>(net.minecraft.world.entity.vehicle.boat.Boat.Status.class))
.register("FoxType", Fox.Type.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.fox.Fox.Variant.class))
.register("SalmonVariant", Salmon.Variant.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.fish.Salmon.Variant.class))
.register("ArmadilloState", Armadillo.State.class, new EnumCloneRewriter<>(net.minecraft.world.entity.animal.armadillo.Armadillo.ArmadilloState.class))
.register("SoundCategory", SoundCategory.class, new EnumCloneRewriter<>(SoundSource.class))
.register("AttributeSentiment", Attribute.Sentiment.class, new EnumCloneRewriter<>(net.minecraft.world.entity.ai.attributes.Attribute.Sentiment.class))
@@ -141,17 +146,18 @@ public final class Rewriters {
holder("ChatVisibility", ClientOption.ChatVisibility.class, new EnumCloneRewriter<>(ChatVisiblity.class) {
@Override
protected EnumValue.Builder rewriteEnumValue(ChatVisiblity visibility) {
return super.rewriteEnumValue(visibility).argument(quoted(visibility.getKey()));
return super.rewriteEnumValue(visibility).argument(quoted(((TranslatableContents) visibility.caption().getContents()).getKey()));
}
}.reachEnd(false)),
holder("ParticleVisibility", ClientOption.ParticleVisibility.class, new EnumCloneRewriter<>(ParticleStatus.class) {
@Override
protected EnumValue.Builder rewriteEnumValue(ParticleStatus status) {
return super.rewriteEnumValue(status).argument(quoted(status.getKey()));
return super.rewriteEnumValue(status).argument(quoted(((TranslatableContents) status.caption().getContents()).getKey()));
}
})
))
.register("ItemUseAnimation", ItemUseAnimation.class, new EnumCloneRewriter<>(net.minecraft.world.item.ItemUseAnimation.class))
.register("SwingAnimationType", SwingAnimation.Animation.class, new EnumCloneRewriter<>(SwingAnimationType.class))
.register("ItemRarity", ItemRarity.class, new EnumCloneRewriter<>(Rarity.class) {
@Override
protected EnumValue.Builder rewriteEnumValue(Rarity rarity) {
@@ -185,6 +191,14 @@ public final class Rewriters {
return keyedName;
}
})
.register("GameRules", GameRules.class, new RegistryFieldRewriter<>(Registries.GAME_RULE, "getRule") {
@Override
protected String rewriteFieldType(Holder.Reference<net.minecraft.world.level.gamerules.GameRule<?>> reference) {
return "%s<%s>".formatted(
this.registryEntry.apiClass().getSimpleName(), this.importCollector.getShortName(reference.value().valueClass())
);
}
})
.register("DamageTypeTags", DamageTypeTags.class, new RegistryTagRewriter<>(Registries.DAMAGE_TYPE, DamageType.class))
.register("MapCursorType", MapCursor.Type.class, new RegistryFieldRewriter<>(Registries.MAP_DECORATION_TYPE, "getType"))
.register("Structure", Structure.class, new RegistryFieldRewriter<>(Registries.STRUCTURE, "getStructure"))
@@ -207,6 +221,7 @@ public final class Rewriters {
.register("ChickenVariant", Chicken.Variant.class, new RegistryFieldRewriter<>(Registries.CHICKEN_VARIANT, "getVariant"))
.register("CowVariant", Cow.Variant.class, new RegistryFieldRewriter<>(Registries.COW_VARIANT, "getVariant"))
.register("PigVariant", Pig.Variant.class, new RegistryFieldRewriter<>(Registries.PIG_VARIANT, "getVariant"))
.register("ZombieNautilusVariant", ZombieNautilus.Variant.class, new RegistryFieldRewriter<>(Registries.ZOMBIE_NAUTILUS_VARIANT, "getVariant"))
.register("Dialog", Dialog.class, new RegistryFieldRewriter<>(Registries.DIALOG, "getDialog"))
.register("MemoryKey", MemoryKey.class, new MemoryKeyRewriter())
// .register("ItemType", org.bukkit.inventory.ItemType.class, new io.papermc.generator.rewriter.types.simple.ItemTypeRewriter()) - disable for now, lynx want the generic type
@@ -18,6 +18,7 @@ import io.papermc.paper.registry.data.PaintingVariantRegistryEntry;
import io.papermc.paper.registry.data.PigVariantRegistryEntry;
import io.papermc.paper.registry.data.SoundEventRegistryEntry;
import io.papermc.paper.registry.data.WolfVariantRegistryEntry;
import io.papermc.paper.registry.data.ZombieNautilusVariantRegistryEntry;
import io.papermc.paper.registry.data.dialog.DialogRegistryEntry;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
@@ -42,16 +43,17 @@ import net.minecraft.world.damagesource.DamageTypes;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.ai.attributes.Attributes;
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
import net.minecraft.world.entity.animal.CatVariants;
import net.minecraft.world.entity.animal.ChickenVariants;
import net.minecraft.world.entity.animal.CowVariants;
import net.minecraft.world.entity.animal.PigVariants;
import net.minecraft.world.entity.animal.feline.CatVariants;
import net.minecraft.world.entity.animal.chicken.ChickenVariants;
import net.minecraft.world.entity.animal.cow.CowVariants;
import net.minecraft.world.entity.animal.pig.PigVariants;
import net.minecraft.world.entity.animal.nautilus.ZombieNautilusVariants;
import net.minecraft.world.entity.animal.frog.FrogVariants;
import net.minecraft.world.entity.animal.wolf.WolfSoundVariants;
import net.minecraft.world.entity.animal.wolf.WolfVariants;
import net.minecraft.world.entity.decoration.PaintingVariants;
import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.entity.npc.VillagerType;
import net.minecraft.world.entity.decoration.painting.PaintingVariants;
import net.minecraft.world.entity.npc.villager.VillagerProfession;
import net.minecraft.world.entity.npc.villager.VillagerType;
import net.minecraft.world.item.Instruments;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.JukeboxSongs;
@@ -62,12 +64,14 @@ import net.minecraft.world.item.equipment.trim.TrimPatterns;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BannerPatterns;
import net.minecraft.world.level.gamerules.GameRules;
import net.minecraft.world.level.levelgen.structure.BuiltinStructures;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.saveddata.maps.MapDecorationTypes;
import org.bukkit.Art;
import org.bukkit.Fluid;
import org.bukkit.GameEvent;
import org.bukkit.GameRule;
import org.bukkit.JukeboxSong;
import org.bukkit.Keyed;
import org.bukkit.MusicInstrument;
@@ -87,6 +91,7 @@ import org.bukkit.entity.Frog;
import org.bukkit.entity.Pig;
import org.bukkit.entity.Villager;
import org.bukkit.entity.Wolf;
import org.bukkit.entity.ZombieNautilus;
import org.bukkit.entity.memory.MemoryKey;
import org.bukkit.generator.structure.Structure;
import org.bukkit.generator.structure.StructureType;
@@ -164,7 +169,8 @@ public final class RegistryEntries {
entry(Registries.ATTRIBUTE, Attributes.class, Attribute.class).serializationUpdater("ATTRIBUTE_RENAME"),
entry(Registries.FLUID, Fluids.class, Fluid.class),
entry(Registries.SOUND_EVENT, SoundEvents.class, Sound.class).allowDirect().apiRegistryField("SOUNDS").apiRegistryBuilder(SoundEventRegistryEntry.Builder.class, "PaperSoundEventRegistryEntry.PaperBuilder", RegistryEntry.RegistryModificationApiSupport.NONE),
entry(Registries.DATA_COMPONENT_TYPE, DataComponents.class, DataComponentType.class, "Paper").preload(DataComponentTypes.class).apiAccessName("of")
entry(Registries.DATA_COMPONENT_TYPE, DataComponents.class, DataComponentType.class, "Paper").preload(DataComponentTypes.class).apiAccessName("of"),
entry(Registries.GAME_RULE, GameRules.class, GameRule.class).genericArgCount(1)/*.preload(org.bukkit.GameRules.class)*/ // only preload once the old names are removed
);
public static final List<RegistryEntry<?>> DATA_DRIVEN = List.of(
@@ -185,6 +191,7 @@ public final class RegistryEntries {
entry(Registries.CHICKEN_VARIANT, ChickenVariants.class, Chicken.Variant.class).writableApiRegistryBuilder(ChickenVariantRegistryEntry.Builder.class, "PaperChickenVariantRegistryEntry.PaperBuilder"),
entry(Registries.COW_VARIANT, CowVariants.class, Cow.Variant.class).writableApiRegistryBuilder(CowVariantRegistryEntry.Builder.class, "PaperCowVariantRegistryEntry.PaperBuilder"),
entry(Registries.PIG_VARIANT, PigVariants.class, Pig.Variant.class).writableApiRegistryBuilder(PigVariantRegistryEntry.Builder.class, "PaperPigVariantRegistryEntry.PaperBuilder"),
entry(Registries.ZOMBIE_NAUTILUS_VARIANT, ZombieNautilusVariants.class, ZombieNautilus.Variant.class).writableApiRegistryBuilder(ZombieNautilusVariantRegistryEntry.Builder.class, "PaperZombieNautilusVariantRegistryEntry.PaperBuilder"),
entry(Registries.DIALOG, Dialogs.class, Dialog.class, "Paper").allowDirect().writableApiRegistryBuilder(DialogRegistryEntry.Builder.class, "PaperDialogRegistryEntry.PaperBuilder")
);
@@ -48,9 +48,9 @@ public class EnumRegistryRewriter<T> extends EnumRewriter<Holder.Reference<T>> {
@Override
protected EnumValue.Builder rewriteEnumValue(Holder.Reference<T> reference) {
EnumValue.Builder value = EnumValue.builder(Formatting.formatKeyAsField(reference.key().location().getPath()));
EnumValue.Builder value = EnumValue.builder(Formatting.formatKeyAsField(reference.key().identifier().getPath()));
if (this.hasKeyArgument) {
value.argument(quoted(reference.key().location().getPath()));
value.argument(quoted(reference.key().identifier().getPath()));
}
return value;
}
@@ -7,7 +7,7 @@ import io.papermc.typewriter.replace.SearchMetadata;
import io.papermc.typewriter.replace.SearchReplaceRewriter;
import java.util.Iterator;
import java.util.Map;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.world.flag.FeatureFlag;
import net.minecraft.world.flag.FeatureFlagSet;
import net.minecraft.world.flag.FeatureFlags;
@@ -37,10 +37,10 @@ public class FeatureFlagRewriter extends SearchReplaceRewriter {
@Override
protected void insert(SearchMetadata metadata, StringBuilder builder) {
Iterator<Map.Entry<ResourceLocation, FeatureFlag>> flagIterator = FeatureFlags.REGISTRY.names.entrySet().stream().sorted(Formatting.alphabeticKeyOrder(entry -> entry.getKey().getPath())).iterator();
Iterator<Map.Entry<Identifier, FeatureFlag>> flagIterator = FeatureFlags.REGISTRY.names.entrySet().stream().sorted(Formatting.alphabeticKeyOrder(entry -> entry.getKey().getPath())).iterator();
while (flagIterator.hasNext()) {
Map.Entry<ResourceLocation, FeatureFlag> entry = flagIterator.next();
ResourceLocation name = entry.getKey();
Map.Entry<Identifier, FeatureFlag> entry = flagIterator.next();
Identifier name = entry.getKey();
if (FeatureFlags.isExperimental(FeatureFlagSet.of(entry.getValue()))) {
builder.append(metadata.indent()).append(annotation(ApiStatus.Experimental.class, this.importCollector)).append('\n');
}
@@ -4,7 +4,7 @@ import io.papermc.generator.utils.Formatting;
import io.papermc.typewriter.replace.SearchMetadata;
import io.papermc.typewriter.replace.SearchReplaceRewriter;
import java.util.Iterator;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.resources.Identifier;
import net.minecraft.world.flag.FeatureFlags;
import org.bukkit.FeatureFlag;
import org.jspecify.annotations.NullMarked;
@@ -14,10 +14,10 @@ public class PaperFeatureFlagMapping extends SearchReplaceRewriter {
@Override
protected void insert(SearchMetadata metadata, StringBuilder builder) {
Iterator<ResourceLocation> flagIterator = FeatureFlags.REGISTRY.toNames(FeatureFlags.REGISTRY.allFlags()).stream().sorted(Formatting.alphabeticKeyOrder(ResourceLocation::getPath)).iterator();
Iterator<Identifier> flagIterator = FeatureFlags.REGISTRY.toNames(FeatureFlags.REGISTRY.allFlags()).stream().sorted(Formatting.alphabeticKeyOrder(Identifier::getPath)).iterator();
while (flagIterator.hasNext()) {
ResourceLocation name = flagIterator.next();
Identifier name = flagIterator.next();
String keyedName = Formatting.formatKeyAsField(name.getPath());
builder.append(metadata.indent());
builder.append("%s.%s, %s.%s".formatted(FeatureFlag.class.getSimpleName(), keyedName, FeatureFlags.class.getSimpleName(), keyedName));
@@ -30,7 +30,7 @@ public class PaperRegistriesRewriter extends SearchReplaceRewriter {
if (apiOnly) {
builder.append("apiOnly(");
if (entry.apiClass().isEnum()) {
builder.append(this.importCollector.getShortName(Types.PAPER_SIMPLE_REGISTRY)).append("::").append(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, entry.registryKey().location().getPath()));
builder.append(this.importCollector.getShortName(Types.PAPER_SIMPLE_REGISTRY)).append("::").append(CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, entry.registryKey().identifier().getPath()));
} else {
builder.append("() -> ");
builder.append(Registry.class.getCanonicalName()).append('.').append(entry.apiRegistryField().orElse(entry.registryKeyField()));
@@ -118,11 +118,11 @@ public class RegistryFieldRewriter<T> extends SearchReplaceRewriter {
}
protected String rewriteFieldName(Holder.Reference<T> reference) {
return Formatting.formatKeyAsField(reference.key().location().getPath());
return Formatting.formatKeyAsField(reference.key().identifier().getPath());
}
protected String rewriteFieldValue(Holder.Reference<T> reference) {
return "%s(%s)".formatted(this.fetchMethod, quoted(reference.key().location().getPath()));
return "%s(%s)".formatted(this.fetchMethod, quoted(reference.key().identifier().getPath()));
}
protected @Nullable SingleFlagHolder getRequiredFeature(Holder.Reference<T> reference) {

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