Compare commits

..
Author SHA1 Message Date
Nassim Jahnke 065a01eb16 Move event down a little 2025-05-28 16:41:29 +02:00
Nassim Jahnke 3c257d3639 give up 2025-05-25 10:16:05 +02:00
Nassim Jahnke eb180d5aeb move early checks 2025-05-25 09:47:57 +02:00
Nassim Jahnke 5f210bb2d6 Put signed message decoding through the message chain
While this disrupts signed command handling a bit, general behavior stays the same, and most importantly chat can continue to be handled off-main. It is necessary for the message decoding to happen in order, which previously was not guaranteed with the method call being in the netty event loop for chat and on main for signed commands.
2025-05-25 09:47:56 +02:00
1154 changed files with 12868 additions and 24137 deletions

No files matched your search

+9 -23
View File
@@ -16,25 +16,21 @@ on:
jobs:
build:
env:
ORG_GRADLE_PROJECT_paperBuildCacheEnabled: true
ORG_GRADLE_PROJECT_paperBuildCacheUsername: ${{ secrets.PAPER_BUILD_CACHE_USERNAME }}
ORG_GRADLE_PROJECT_paperBuildCachePassword: ${{ secrets.PAPER_BUILD_CACHE_PASSWORD }}
ORG_GRADLE_PROJECT_paperBuildCachePush: true
# The goal of the build workflow is split into multiple requirements.
# 1. Run on pushes to same repo.
# 2. Run on PR open/reopen/syncs from repos that are not the same (PRs from the same repo are covered by 1)
# 3. Run on labeled PRs that have the publish-pr flag.
# 3. Run on labeled PRs that have the build-pr-jar flag.
if: >
(
(github.event_name == 'push')
|| (github.event_name == 'pull_request' && github.repository != github.event.pull_request.head.repo.full_name && contains(fromJSON('["opened", "reopened", "synchronize"]'), github.event.action))
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'publish-pr')
|| (github.event_name == 'pull_request' && github.event.action == 'labeled' && github.event.label.name == 'build-pr-jar')
)
runs-on: ubuntu-latest
strategy:
matrix:
java: [21]
fail-fast: true
steps:
- if: ${{ github.event_name == 'push' }}
@@ -47,17 +43,14 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: JDK 21
- name: JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: 21
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
# Allow cache writes on main and dev branches
cache-read-only: ${{ github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/dev/') }}
- name: Configure Build
uses: actions/github-script@v7
@@ -80,14 +73,14 @@ jobs:
if (event_name === "push" && ref_type === "branch") {
const {data: pulls} = await github.rest.pulls.list({ owner, repo, head: `${owner}:${ref_name}`, state: "open" });
const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "publish-pr"));
const pull = pulls.find((pr) => !!pr.labels.find((l) => l.name === "build-pr-jar"));
if (pull) {
result["pr"] = pull.number;
result["action"] = "paperclip";
core.notice(`This is a push action but to a branch with an open PR with the build paperclip label (${JSON.stringify(result)})`);
return result;
}
} else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "publish-pr")) {
} else if (event_name === "pull_request" && event.pull_request.labels.find((l) => l.name === "build-pr-jar")) {
result["pr"] = event.pull_request.number;
result["action"] = "paperclip";
core.notice(`This is a pull request action with a build paperclip label (${JSON.stringify(result)})`);
@@ -109,7 +102,7 @@ jobs:
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results
name: Test Results (${{ matrix.java }})
path: |
**/build/test-results/test/TEST-*.xml
@@ -123,13 +116,6 @@ jobs:
with:
name: paper-${{ fromJSON(steps.determine.outputs.result).pr }}
path: paper-server/build/libs/paper-paperclip-*-mojmap.jar
- name: Publish Artifacts
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
uses: PaperMC/action-pr-publishing/upload@paper
with:
# TODO fallback for failing javadoc
publishing-task: ":paper-api:publishAllPublicationsTo_githubPackages_PRsRepository publishDevBundlePublicationTo_githubPackages_PRsRepository -PpublishDevBundle"
event_file:
name: "Event File"
# Only run on PRs if the source branch is on someone else's repo
+84
View File
@@ -0,0 +1,84 @@
# This workflow run on the completion of the
# build workflow but only does anything if the
# triggering workflow uploaded an artifact.
#
# Do note that it is then the trigger workflow that
# determines if this will update the PR text body. All
# this workflow does is check if an uploaded artifact
# exists and there is a PR tied to the previous workflow.
name: Comment on pull request
on:
workflow_run:
workflows: ['Build Paper']
types: [completed]
jobs:
pr_comment:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
env:
BRANCH_NAME: "${{ github.event.workflow_run.head_branch }}"
PR_OWNER: "${{ github.event.workflow_run.head_repository.owner.login }}"
PR_SHA: "${{ github.event.workflow_run.head_sha }}"
RUN_ID: "${{ github.event.workflow_run.id }}"
REPO_ID: "${{ github.event.repository.id }}"
EVENT_TYPE: "${{ github.event.workflow_run.event}}"
PULL_REQUESTS: "${{ toJSON(github.event.workflow_run.pull_requests) }}"
with:
# This snippet is public-domain, taken from
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml
# Modified extensively by Machine_Maker
script: |
async function updatePR(owner, repo, issue_number, purpose, body) {
const { data } = await github.rest.issues.get({ owner, repo, issue_number });
core.debug(JSON.stringify(data, null, 2));
const marker = `<!-- bot: ${purpose} -->`;
let new_body = data.body ? data.body.trim().split(marker)[0].trim() : "";
new_body += `\n${marker}\n---\n${body}`;
core.info(`Updating the text body of PR #${issue_number} in ${owner}/${repo}`);
await github.rest.issues.update({ owner, repo, issue_number, body: new_body });
}
const { owner, repo } = context.repo;
const run_id = `${process.env.RUN_ID}`;
const repo_id = `${process.env.REPO_ID}`;
let pulls = [];
const event_type = `${process.env.EVENT_TYPE}`;
if (event_type === "push") { // if push, it's from the same repo which means `pull_requests` is populated
pulls = JSON.parse(`${process.env.PULL_REQUESTS}`);
} else {
const pr_branch = `${process.env.BRANCH_NAME}`;
const pr_sha = `${process.env.PR_SHA}`;
const pr_owner = `${process.env.PR_OWNER}`;
const { data } = await github.rest.pulls.list({ owner, repo, head: `${pr_owner}:${pr_branch}`, state: "open" });
core.debug(JSON.stringify(data, null, 2));
pulls = data.filter((pr) => pr.head.sha === pr_sha && pr.labels.find((l) => l.name === "build-pr-jar"));
}
if (!pulls.length) {
return core.notice("This workflow doesn't have any pull requests!");
} else if (pulls.length > 1) {
core.info(JSON.stringify(pulls, null, 2));
return core.error("Found multiple matching PRs");
}
const pull_request = pulls[0];
const artifacts = await github.paginate(github.rest.actions.listWorkflowRunArtifacts, { owner, repo, run_id });
if (!artifacts.length) {
return core.info("Skipping comment due to no artifact found");
}
const artifact = artifacts.find((art) => art.name === `paper-${pull_request.number}`);
if (!artifact) {
return core.info("Skipping comment to no matching artifact found");
}
const link = `https://nightly.link/${owner}/${repo}/actions/artifacts/${artifact.id}.zip`;
const body = `Download the paperclip jar for this pull request: [${artifact.name}.zip](${link})`;
core.info(`Adding a link to ${link}`);
await updatePR(owner, repo, pull_request.number, "paperclip-pr-build", body);
-36
View File
@@ -1,36 +0,0 @@
name: Publish PR
on:
workflow_run:
workflows: [ "Build Paper" ]
types:
- completed
permissions:
packages: write # To upload the PR
actions: write # To get information about the uploading workflow run and to delete the run artifacts
contents: write # To download the `maven-publish` artifact, and to be able to create commit comments
issues: write # To be able to create PR comments
pull-requests: write # To be able to create PR comments
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Generate an Application repository access token
id: gen_repo_token
uses: kattecon/gh-app-access-token-gen@v1
with:
app_id: 1408328
private_key: ${{ secrets.PR_PUBLISHING_GH_APP_KEY }}
repository: ${{ github.repository }}
- name: Publish PR
uses: PaperMC/action-pr-publishing@paper
env:
GITHUB_TOKEN: ${{ steps.gen_repo_token.outputs.token }}
with:
publishing-token: ${{ github.token }}
uploader-workflow-name: Build Paper
artifacts-base-path: io/papermc/paper
base-maven-url: 'https://maven-prs.papermc.io'
self-name: 'papermc-pr-publishing[bot]'
+3 -5
View File
@@ -21,14 +21,12 @@ jobs:
uses: dawidd6/action-download-artifact@v6
with:
run_id: ${{ github.event.workflow_run.id }}
path: test_artifacts
name: "Test Results|Event File"
name_is_regexp: true
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: test_artifacts/Event File/event.json
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "test_artifacts/**/*.xml"
files: "artifacts/**/*.xml"
comment_mode: off
+2 -2
View File
@@ -40,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.8-R0.1-SNAPSHOT</version>
<version>1.21.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@@ -53,7 +53,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.5-R0.1-SNAPSHOT")
}
java {
+7
View File
@@ -5,3 +5,10 @@
# authlib com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
# datafixerupper com.mojang.datafixers.DataFixerBuilder
# datafixerupper com/mojang/datafixers/util/Either.java
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
# To import minecraft data files, like the default chat type, use `mc_data` as the prefix:
# mc_data chat_type/chat.json
# mc_data dimension_type/overworld.json
#
+27 -23
View File
@@ -104,9 +104,6 @@ public net.minecraft.server.level.ServerPlayer wardenSpawnTracker
public net.minecraft.server.level.ServerPlayer$RespawnPosAngle
public net.minecraft.server.level.ServerPlayerGameMode level
public net.minecraft.server.level.TicketType register(Ljava/lang/String;JZLnet/minecraft/server/level/TicketType$TicketUse;)Lnet/minecraft/server/level/TicketType;
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl clientInformation
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl currentTask
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl finishCurrentTask(Lnet/minecraft/server/network/ConfigurationTask$Type;)V
public net.minecraft.server.network.ServerGamePacketListenerImpl isChatMessageIllegal(Ljava/lang/String;)Z
public net.minecraft.server.network.ServerLoginPacketListenerImpl authenticatedProfile
public net.minecraft.server.network.ServerLoginPacketListenerImpl connection
@@ -143,11 +140,12 @@ public net.minecraft.world.effect.MobEffect attributeModifiers
public net.minecraft.world.effect.MobEffect$AttributeTemplate
public net.minecraft.world.effect.MobEffectInstance hiddenEffect
public net.minecraft.world.entity.AreaEffectCloud durationOnUse
public net.minecraft.world.entity.AreaEffectCloud owner
public net.minecraft.world.entity.AreaEffectCloud ownerUUID
public net.minecraft.world.entity.AreaEffectCloud potionContents
public net.minecraft.world.entity.AreaEffectCloud radiusOnUse
public net.minecraft.world.entity.AreaEffectCloud radiusPerTick
public net.minecraft.world.entity.AreaEffectCloud reapplicationDelay
public net.minecraft.world.entity.AreaEffectCloud updateColor()V
public net.minecraft.world.entity.AreaEffectCloud waitTime
public net.minecraft.world.entity.Display DATA_POS_ROT_INTERPOLATION_DURATION_ID
public net.minecraft.world.entity.Display createTransformation(Lnet/minecraft/network/syncher/SynchedEntityData;)Lcom/mojang/math/Transformation;
@@ -188,7 +186,6 @@ public net.minecraft.world.entity.Display$TextDisplay getTextOpacity()B
public net.minecraft.world.entity.Display$TextDisplay setFlags(B)V
public net.minecraft.world.entity.Display$TextDisplay setText(Lnet/minecraft/network/chat/Component;)V
public net.minecraft.world.entity.Display$TextDisplay setTextOpacity(B)V
public net.minecraft.world.entity.Entity DATA_TICKS_FROZEN
public net.minecraft.world.entity.Entity FLAG_INVISIBLE
public net.minecraft.world.entity.Entity getEncodeId()Ljava/lang/String;
public net.minecraft.world.entity.Entity getFireImmuneTicks()I
@@ -255,7 +252,6 @@ public net.minecraft.world.entity.Mob lootTable
public net.minecraft.world.entity.Mob lootTableSeed
public net.minecraft.world.entity.OminousItemSpawner setItem(Lnet/minecraft/world/item/ItemStack;)V
public net.minecraft.world.entity.OminousItemSpawner spawnItemAfterTicks
public net.minecraft.world.entity.ai.attributes.Attribute sentiment
public net.minecraft.world.entity.ai.attributes.AttributeSupplier getAttributeInstance(Lnet/minecraft/core/Holder;)Lnet/minecraft/world/entity/ai/attributes/AttributeInstance;
public net.minecraft.world.entity.ai.control.MoveControl$Operation
public net.minecraft.world.entity.ai.gossip.GossipContainer gossips
@@ -275,7 +271,6 @@ 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
@@ -335,8 +330,14 @@ public net.minecraft.world.entity.animal.wolf.Wolf setSoundVariant(Lnet/minecraf
public net.minecraft.world.entity.animal.wolf.Wolf setVariant(Lnet/minecraft/core/Holder;)V
public net.minecraft.world.entity.boss.enderdragon.EnderDragon subEntities
public net.minecraft.world.entity.boss.wither.WitherBoss bossEvent
public net.minecraft.world.entity.decoration.ArmorStand bodyPose
public net.minecraft.world.entity.decoration.ArmorStand disabledSlots
public net.minecraft.world.entity.decoration.ArmorStand headPose
public net.minecraft.world.entity.decoration.ArmorStand isDisabled(Lnet/minecraft/world/entity/EquipmentSlot;)Z
public net.minecraft.world.entity.decoration.ArmorStand leftArmPose
public net.minecraft.world.entity.decoration.ArmorStand leftLegPose
public net.minecraft.world.entity.decoration.ArmorStand rightArmPose
public net.minecraft.world.entity.decoration.ArmorStand rightLegPose
public net.minecraft.world.entity.decoration.ArmorStand setMarker(Z)V
public net.minecraft.world.entity.decoration.ArmorStand setSmall(Z)V
public net.minecraft.world.entity.decoration.HangingEntity setDirection(Lnet/minecraft/core/Direction;)V
@@ -363,6 +364,8 @@ public net.minecraft.world.entity.monster.Creeper explodeCreeper()V
public net.minecraft.world.entity.monster.Creeper explosionRadius
public net.minecraft.world.entity.monster.Creeper maxSwell
public net.minecraft.world.entity.monster.Creeper swell
public net.minecraft.world.entity.monster.Drowned groundNavigation
public net.minecraft.world.entity.monster.Drowned waterNavigation
public net.minecraft.world.entity.monster.EnderMan teleport()Z
public net.minecraft.world.entity.monster.EnderMan teleportTowards(Lnet/minecraft/world/entity/Entity;)Z
public net.minecraft.world.entity.monster.Endermite life
@@ -389,7 +392,6 @@ 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
@@ -417,7 +419,6 @@ public net.minecraft.world.entity.npc.Villager increaseMerchantCareer()V
public net.minecraft.world.entity.npc.Villager numberOfRestocksToday
public net.minecraft.world.entity.npc.Villager releaseAllPois()V
public net.minecraft.world.entity.npc.Villager setUnhappy()V
public net.minecraft.world.entity.npc.Villager updateDemand()V
public net.minecraft.world.entity.npc.WanderingTrader getWanderTarget()Lnet/minecraft/core/BlockPos;
public net.minecraft.world.entity.player.Abilities flyingSpeed
public net.minecraft.world.entity.player.Abilities walkingSpeed
@@ -448,7 +449,9 @@ public net.minecraft.world.entity.projectile.Arrow updateColor()V
public net.minecraft.world.entity.projectile.EvokerFangs warmupDelayTicks
public net.minecraft.world.entity.projectile.EyeOfEnder life
public net.minecraft.world.entity.projectile.EyeOfEnder surviveAfterDeath
public net.minecraft.world.entity.projectile.EyeOfEnder target
public net.minecraft.world.entity.projectile.EyeOfEnder tx
public net.minecraft.world.entity.projectile.EyeOfEnder ty
public net.minecraft.world.entity.projectile.EyeOfEnder tz
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_ATTACHED_TO_TARGET
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_ID_FIREWORKS_ITEM
public net.minecraft.world.entity.projectile.FireworkRocketEntity DATA_SHOT_AT_ANGLE
@@ -468,9 +471,10 @@ public net.minecraft.world.entity.projectile.FishingHook timeUntilHooked
public net.minecraft.world.entity.projectile.FishingHook timeUntilLured
public net.minecraft.world.entity.projectile.FishingHook$FishHookState
public net.minecraft.world.entity.projectile.LargeFireball explosionPower
public net.minecraft.world.entity.projectile.Projectile cachedOwner
public net.minecraft.world.entity.projectile.Projectile hasBeenShot
public net.minecraft.world.entity.projectile.Projectile leftOwner
public net.minecraft.world.entity.projectile.Projectile owner
public net.minecraft.world.entity.projectile.Projectile ownerUUID
public net.minecraft.world.entity.projectile.ShulkerBullet currentMoveDirection
public net.minecraft.world.entity.projectile.ShulkerBullet flightSteps
public net.minecraft.world.entity.projectile.ShulkerBullet targetDeltaX
@@ -512,8 +516,6 @@ public net.minecraft.world.inventory.AbstractContainerMenu quickcraftSlots
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftStatus
public net.minecraft.world.inventory.AbstractContainerMenu quickcraftType
public net.minecraft.world.inventory.AbstractContainerMenu resetQuickCraft()V
public net.minecraft.world.inventory.AbstractContainerMenu synchronizeSlotToRemote(ILnet/minecraft/world/item/ItemStack;Ljava/util/function/Supplier;)V
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.AnvilMenu cost
@@ -613,7 +615,7 @@ public net.minecraft.world.level.block.entity.BedBlockEntity color
public net.minecraft.world.level.block.entity.BeehiveBlockEntity savedFlowerPos
public net.minecraft.world.level.block.entity.BellBlockEntity resonating
public net.minecraft.world.level.block.entity.BellBlockEntity resonationTicks
public net.minecraft.world.level.block.entity.BlockEntity saveId(Lnet/minecraft/world/level/storage/ValueOutput;)V
public net.minecraft.world.level.block.entity.BlockEntity saveId(Lnet/minecraft/nbt/CompoundTag;)V
public net.minecraft.world.level.block.entity.BlockEntityType validBlocks
public net.minecraft.world.level.block.entity.BrewingStandBlockEntity brewTime
public net.minecraft.world.level.block.entity.BrewingStandBlockEntity fuel
@@ -625,11 +627,10 @@ public net.minecraft.world.level.block.entity.CampfireBlockEntity cookingTime
public net.minecraft.world.level.block.entity.ChestBlockEntity openersCounter
public net.minecraft.world.level.block.entity.ChestBlockEntity playSound(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/sounds/SoundEvent;)V
public net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity lastInteractedSlot
public net.minecraft.world.level.block.entity.ConduitBlockEntity MIN_KILL_SIZE
public net.minecraft.world.level.block.entity.ConduitBlockEntity destroyTarget
public net.minecraft.world.level.block.entity.ConduitBlockEntity destroyTargetUUID
public net.minecraft.world.level.block.entity.ConduitBlockEntity effectBlocks
public net.minecraft.world.level.block.entity.ConduitBlockEntity getDestroyRangeAABB(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/phys/AABB;
public net.minecraft.world.level.block.entity.ConduitBlockEntity updateDestroyTarget(Lnet/minecraft/world/entity/EntityReference;Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/core/BlockPos;Z)Lnet/minecraft/world/entity/EntityReference;
public net.minecraft.world.level.block.entity.CrafterBlockEntity craftingTicksRemaining
public net.minecraft.world.level.block.entity.DecoratedPotBlockEntity decorations
public net.minecraft.world.level.block.entity.EnderChestBlockEntity openersCounter
@@ -663,14 +664,13 @@ public net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity age
public net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity exactTeleport
public net.minecraft.world.level.block.entity.TheEndGatewayBlockEntity exitPortal
public net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity trialSpawner
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawner config
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawner isOminous
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawner stateAccessor
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData cooldownEndsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData currentMobs
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData detectedPlayers
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData nextMobSpawnsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerStateData nextSpawnData
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData cooldownEndsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData currentMobs
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData detectedPlayers
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData nextMobSpawnsAt
public net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData nextSpawnData
public net.minecraft.world.level.block.entity.vault.VaultBlockEntity serverData
public net.minecraft.world.level.block.entity.vault.VaultServerData getRewardedPlayers()Ljava/util/Set;
public net.minecraft.world.level.block.entity.vault.VaultServerData pauseStateUpdatingUntil(J)V
@@ -689,7 +689,7 @@ public net.minecraft.world.level.chunk.LevelChunk level
public net.minecraft.world.level.chunk.LevelChunk loaded
public net.minecraft.world.level.chunk.LevelChunkSection states
public net.minecraft.world.level.chunk.PalettedContainer registry
public net.minecraft.world.level.chunk.status.ChunkStatusTasks postLoadProtoChunk(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/level/storage/ValueInput$ValueInputList;)V
public net.minecraft.world.level.chunk.status.ChunkStatusTasks postLoadProtoChunk(Lnet/minecraft/server/level/ServerLevel;Ljava/util/List;)V
public net.minecraft.world.level.chunk.storage.EntityStorage entityDeserializerQueue
public net.minecraft.world.level.chunk.storage.EntityStorage level
public net.minecraft.world.level.chunk.storage.RegionFileStorage regionCache
@@ -776,6 +776,10 @@ public-f net.minecraft.world.level.LevelSettings hardcore
public-f net.minecraft.world.level.LevelSettings levelName
public-f net.minecraft.world.level.block.ChestBlock MENU_PROVIDER_COMBINER
public-f net.minecraft.world.level.block.entity.BannerBlockEntity baseColor
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner normalConfig
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner ominousConfig
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner requiredPlayerRange
public-f net.minecraft.world.level.block.entity.trialspawner.TrialSpawner targetCooldownLength
public-f net.minecraft.world.level.saveddata.maps.MapItemSavedData centerX
public-f net.minecraft.world.level.saveddata.maps.MapItemSavedData centerZ
public-f net.minecraft.world.level.saveddata.maps.MapItemSavedData dimension
+1 -1
View File
@@ -21,7 +21,7 @@ c net/minecraft/world/level/chunk/LevelChunk net/minecraft/world/level/chunk/Chu
# See mappings-patch.tiny
c net/minecraft/server/level/ChunkMap net/minecraft/server/level/PlayerChunkMap
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager H
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager G
# The method is made public by Spigot, which then causes accidental overrides
c net/minecraft/world/entity/Entity net/minecraft/world/entity/Entity
+5 -5
View File
@@ -2,7 +2,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id("io.papermc.paperweight.core") version "2.0.0-beta.18" apply false
id("io.papermc.paperweight.core") version "2.0.0-beta.17" apply false
}
subprojects {
@@ -24,19 +24,19 @@ subprojects {
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile>().configureEach {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release = 21
options.isFork = true
options.compilerArgs.addAll(listOf("-Xlint:-deprecation", "-Xlint:-removal"))
}
tasks.withType<Javadoc>().configureEach {
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources>().configureEach {
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test>().configureEach {
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
+4 -3
View File
@@ -1,9 +1,10 @@
group=io.papermc.paper
version=1.21.8-R0.1-SNAPSHOT
mcVersion=1.21.8
version=1.21.5-R0.1-SNAPSHOT
mcVersion=1.21.5
# Set to true while updating Minecraft version
updatingMinecraft=false
updatingMinecraft=true
updateTaskListIssue=https://github.com/PaperMC/Paper/issues/11736
org.gradle.configuration-cache=true
org.gradle.caching=true
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+4 -4
View File
@@ -11,7 +11,7 @@ java {
val annotationsVersion = "26.0.2"
// Keep in sync with paper-server adventure-text-serializer-ansi dep
val adventureVersion = "4.24.0"
val adventureVersion = "4.21.0"
val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
val slf4jVersion = "2.0.16"
val log4jVersion = "2.24.1"
@@ -66,8 +66,8 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
api("org.apache.maven:maven-resolver-provider:3.9.6") // make API dependency for Paper Plugins
implementation("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
implementation("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
// Annotations - Slowly migrate to jspecify
val annotations = "org.jetbrains:annotations:$annotationsVersion"
@@ -164,7 +164,7 @@ abstract class Services {
}
val services = objects.newInstance<Services>()
tasks.withType<Javadoc>().configureEach {
tasks.withType<Javadoc> {
val options = options as StandardJavadocDocletOptions
options.overview = "src/main/javadoc/overview.html"
options.use()
@@ -21,7 +21,6 @@ import org.bukkit.entity.Fish;
import org.bukkit.entity.Fox;
import org.bukkit.entity.Ghast;
import org.bukkit.entity.Guardian;
import org.bukkit.entity.HappyGhast;
import org.bukkit.entity.Illager;
import org.bukkit.entity.Illusioner;
import org.bukkit.entity.IronGolem;
@@ -68,17 +67,17 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> HORSE_RANDOM_STAND = create("horse_random_stand", AbstractHorse.class);
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
GoalKey<AbstractHorse> HORSE_RUN_AROUND_LIKE_CRAZY = create("horse_run_around_like_crazy", AbstractHorse.class);
GoalKey<AbstractHorse> RUN_AROUND_LIKE_CRAZY = create("run_around_like_crazy", AbstractHorse.class);
GoalKey<AbstractSkeleton> SKELETON_MELEE = create("skeleton_melee", AbstractSkeleton.class);
GoalKey<AbstractSkeleton> ABSTRACT_SKELETON_MELEE = create("abstract_skeleton_melee", AbstractSkeleton.class);
GoalKey<AbstractVillager> VILLAGER_LOOK_AT_TRADING_PLAYER = create("villager_look_at_trading_player", AbstractVillager.class);
GoalKey<AbstractVillager> LOOK_AT_TRADING_PLAYER = create("look_at_trading_player", AbstractVillager.class);
GoalKey<AbstractVillager> VILLAGER_TRADE_WITH_PLAYER = create("villager_trade_with_player", AbstractVillager.class);
GoalKey<AbstractVillager> TRADE_WITH_PLAYER = create("trade_with_player", AbstractVillager.class);
GoalKey<Animals> BREED = create("breed", Animals.class);
@@ -102,12 +101,12 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Bee> BEE_POLLINATE = create("bee_pollinate", Bee.class);
GoalKey<Bee> BEE_VALIDATE_FLOWER = create("bee_validate_flower", Bee.class);
GoalKey<Bee> BEE_VALIDATE_HIVE = create("bee_validate_hive", Bee.class);
GoalKey<Bee> BEE_WANDER = create("bee_wander", Bee.class);
GoalKey<Bee> VALIDATE_FLOWER = create("validate_flower", Bee.class);
GoalKey<Bee> VALIDATE_HIVE = create("validate_hive", Bee.class);
GoalKey<Blaze> BLAZE_ATTACK = create("blaze_attack", Blaze.class);
GoalKey<Cat> CAT_AVOID_ENTITY = create("cat_avoid_entity", Cat.class);
@@ -166,16 +165,16 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Creature> WATER_AVOIDING_RANDOM_STROLL = create("water_avoiding_random_stroll", Creature.class);
GoalKey<Creeper> CREEPER_SWELL = create("creeper_swell", Creeper.class);
GoalKey<Creeper> SWELL = create("swell", Creeper.class);
GoalKey<Dolphin> DOLPHIN_JUMP = create("dolphin_jump", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_PLAY_WITH_ITEMS = create("dolphin_play_with_items", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_SWIM_TO_TREASURE = create("dolphin_swim_to_treasure", Dolphin.class);
GoalKey<Dolphin> DOLPHIN_SWIM_WITH_PLAYER = create("dolphin_swim_with_player", Dolphin.class);
GoalKey<Dolphin> PLAY_WITH_ITEMS = create("play_with_items", Dolphin.class);
GoalKey<Drowned> DROWNED_ATTACK = create("drowned_attack", Drowned.class);
GoalKey<Drowned> DROWNED_GO_TO_BEACH = create("drowned_go_to_beach", Drowned.class);
@@ -200,14 +199,14 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Fish> FISH_SWIM = create("fish_swim", Fish.class);
GoalKey<Fox> DEFEND_TRUSTED = create("defend_trusted", Fox.class);
GoalKey<Fox> FACEPLANT = create("faceplant", Fox.class);
GoalKey<Fox> FOX_BREED = create("fox_breed", Fox.class);
GoalKey<Fox> FOX_DEFEND_TRUSTED = create("fox_defend_trusted", Fox.class);
GoalKey<Fox> FOX_EAT_BERRIES = create("fox_eat_berries", Fox.class);
GoalKey<Fox> FOX_FACEPLANT = create("fox_faceplant", Fox.class);
GoalKey<Fox> FOX_FLOAT = create("fox_float", Fox.class);
GoalKey<Fox> FOX_FOLLOW_PARENT = create("fox_follow_parent", Fox.class);
@@ -218,27 +217,29 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Fox> FOX_PANIC = create("fox_panic", Fox.class);
GoalKey<Fox> FOX_PERCH_AND_SEARCH = create("fox_perch_and_search", Fox.class);
GoalKey<Fox> FOX_POUNCE = create("fox_pounce", Fox.class);
GoalKey<Fox> FOX_SEARCH_FOR_ITEMS = create("fox_search_for_items", Fox.class);
GoalKey<Fox> FOX_SEEK_SHELTER = create("fox_seek_shelter", Fox.class);
GoalKey<Fox> FOX_SLEEP = create("fox_sleep", Fox.class);
GoalKey<Fox> FOX_STALK_PREY = create("fox_stalk_prey", Fox.class);
GoalKey<Fox> FOX_STROLL_THROUGH_VILLAGE = create("fox_stroll_through_village", Fox.class);
GoalKey<Fox> PERCH_AND_SEARCH = create("perch_and_search", Fox.class);
GoalKey<Fox> SEEK_SHELTER = create("seek_shelter", Fox.class);
GoalKey<Fox> SLEEP = create("sleep", Fox.class);
GoalKey<Fox> STALK_PREY = create("stalk_prey", Fox.class);
GoalKey<Ghast> GHAST_LOOK = create("ghast_look", Ghast.class);
GoalKey<Ghast> GHAST_SHOOT_FIREBALL = create("ghast_shoot_fireball", Ghast.class);
GoalKey<Ghast> RANDOM_FLOAT_AROUND = create("random_float_around", Ghast.class);
GoalKey<Guardian> GUARDIAN_ATTACK = create("guardian_attack", Guardian.class);
GoalKey<HappyGhast> HAPPY_GHAST_FLOAT = create("happy_ghast_float", HappyGhast.class);
GoalKey<Illager> ILLAGER_HOLD_GROUND_ATTACK = create("illager_hold_ground_attack", Illager.class);
GoalKey<Illager> HOLD_GROUND_ATTACK = create("hold_ground_attack", Illager.class);
GoalKey<Illager> RAIDER_OPEN_DOOR = create("raider_open_door", Illager.class);
@@ -246,9 +247,9 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Illusioner> ILLUSIONER_MIRROR_SPELL = create("illusioner_mirror_spell", Illusioner.class);
GoalKey<IronGolem> IRON_GOLEM_DEFEND_VILLAGE = create("iron_golem_defend_village", IronGolem.class);
GoalKey<IronGolem> DEFEND_VILLAGE = create("defend_village", IronGolem.class);
GoalKey<IronGolem> IRON_GOLEM_OFFER_FLOWER = create("iron_golem_offer_flower", IronGolem.class);
GoalKey<IronGolem> OFFER_FLOWER = create("offer_flower", IronGolem.class);
GoalKey<Llama> LLAMA_ATTACK_WOLF = create("llama_attack_wolf", Llama.class);
@@ -268,8 +269,6 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> FOLLOW_MOB = create("follow_mob", Mob.class);
GoalKey<Mob> GHAST_LOOK = create("ghast_look", Mob.class);
GoalKey<Mob> INTERACT = create("interact", Mob.class);
GoalKey<Mob> LEAP_AT = create("leap_at", Mob.class);
@@ -282,14 +281,10 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Mob> OPEN_DOOR = create("open_door", Mob.class);
GoalKey<Mob> RANDOM_FLOAT_AROUND = create("random_float_around", Mob.class);
GoalKey<Mob> RANDOM_LOOK_AROUND = create("random_look_around", Mob.class);
GoalKey<Mob> RESET_UNIVERSAL_ANGER = create("reset_universal_anger", Mob.class);
GoalKey<Mob> TEMPT_FOR_NON_PATHFINDERS = create("tempt_for_non_pathfinders", Mob.class);
GoalKey<Mob> USE_ITEM = create("use_item", Mob.class);
GoalKey<Mob> VINDICATOR_BREAK_DOOR = create("vindicator_break_door", Mob.class);
@@ -322,7 +317,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Panda> PANDA_SNEEZE = create("panda_sneeze", Panda.class);
GoalKey<Parrot> PARROT_LAND_ON_OWNERS_SHOULDER = create("parrot_land_on_owners_shoulder", Parrot.class);
GoalKey<Parrot> LAND_ON_OWNERS_SHOULDER = create("land_on_owners_shoulder", Parrot.class);
GoalKey<Phantom> PHANTOM_ATTACK_PLAYER = create("phantom_attack_player", Phantom.class);
@@ -344,27 +339,27 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Rabbit> RABBIT_PANIC = create("rabbit_panic", Rabbit.class);
GoalKey<Rabbit> RABBIT_RAID_GARDEN = create("rabbit_raid_garden", Rabbit.class);
GoalKey<Rabbit> RAID_GARDEN = create("raid_garden", Rabbit.class);
GoalKey<Raider> LONG_DISTANCE_PATROL = create("long_distance_patrol", Raider.class);
GoalKey<Raider> NEAREST_ATTACKABLE_WITCH = create("nearest_attackable_witch", Raider.class);
GoalKey<Raider> NEAREST_HEALABLE_RAIDER = create("nearest_healable_raider", Raider.class);
GoalKey<Raider> OBTAIN_RAID_LEADER_BANNER = create("obtain_raid_leader_banner", Raider.class);
GoalKey<Raider> PATHFIND_TO_RAID = create("pathfind_to_raid", Raider.class);
GoalKey<Raider> RAIDER_CELEBRATION = create("raider_celebration", Raider.class);
GoalKey<Raider> RAIDER_LONG_DISTANCE_PATROL = create("raider_long_distance_patrol", Raider.class);
GoalKey<Raider> RAIDER_MOVE_THROUGH_VILLAGE = create("raider_move_through_village", Raider.class);
GoalKey<Raider> RAIDER_NEAREST_ATTACKABLE_WITCH = create("raider_nearest_attackable_witch", Raider.class);
GoalKey<Raider> RAIDER_NEAREST_HEALABLE_RAIDER = create("raider_nearest_healable_raider", Raider.class);
GoalKey<Raider> RAIDER_OBTAIN_RAID_LEADER_BANNER = create("raider_obtain_raid_leader_banner", Raider.class);
GoalKey<Raider> RAIDER_PATHFIND_TO_RAID = create("raider_pathfind_to_raid", Raider.class);
GoalKey<RangedEntity> DROWNED_TRIDENT_ATTACK = create("drowned_trident_attack", RangedEntity.class);
GoalKey<RangedEntity> RANGED_ATTACK = create("ranged_attack", RangedEntity.class);
GoalKey<SchoolableFish> SCHOOLABLE_FISH_FOLLOW_FLOCK_LEADER = create("schoolable_fish_follow_flock_leader", SchoolableFish.class);
GoalKey<SchoolableFish> FOLLOW_FLOCK_LEADER = create("follow_flock_leader", SchoolableFish.class);
GoalKey<Shulker> SHULKER_ATTACK = create("shulker_attack", Shulker.class);
@@ -378,7 +373,7 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Silverfish> SILVERFISH_WAKE_UP_FRIENDS = create("silverfish_wake_up_friends", Silverfish.class);
GoalKey<SkeletonHorse> SKELETON_HORSE_SKELETON_TRAP = create("skeleton_horse_skeleton_trap", SkeletonHorse.class);
GoalKey<SkeletonHorse> SKELETON_TRAP = create("skeleton_trap", SkeletonHorse.class);
GoalKey<Slime> SLIME_ATTACK = create("slime_attack", Slime.class);
@@ -434,13 +429,13 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Vindicator> VINDICATOR_JOHNNY_ATTACK = create("vindicator_johnny_attack", Vindicator.class);
GoalKey<WanderingTrader> WANDERING_TRADER_WANDER_TO_POSITION = create("wandering_trader_wander_to_position", WanderingTrader.class);
GoalKey<WanderingTrader> WANDER_TO_POSITION = create("wander_to_position", WanderingTrader.class);
GoalKey<Wither> WITHER_DO_NOTHING = create("wither_do_nothing", Wither.class);
GoalKey<Wolf> WOLF_AVOID_ENTITY = create("wolf_avoid_entity", Wolf.class);
GoalKey<Wolf> BEG = create("beg", Wolf.class);
GoalKey<Wolf> WOLF_BEG = create("wolf_beg", Wolf.class);
GoalKey<Wolf> WOLF_AVOID_ENTITY = create("wolf_avoid_entity", Wolf.class);
GoalKey<Zombie> ZOMBIE_ATTACK = create("zombie_attack", Zombie.class);
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class AttributeKeys {
/**
* {@code minecraft:armor}
@@ -81,13 +81,6 @@ public final class AttributeKeys {
*/
public static final TypedKey<Attribute> BURNING_TIME = create(key("burning_time"));
/**
* {@code minecraft:camera_distance}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> CAMERA_DISTANCE = create(key("camera_distance"));
/**
* {@code minecraft:entity_interaction_range}
*
@@ -256,20 +249,6 @@ public final class AttributeKeys {
*/
public static final TypedKey<Attribute> WATER_MOVEMENT_EFFICIENCY = create(key("water_movement_efficiency"));
/**
* {@code minecraft:waypoint_receive_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> WAYPOINT_RECEIVE_RANGE = create(key("waypoint_receive_range"));
/**
* {@code minecraft:waypoint_transmit_range}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Attribute> WAYPOINT_TRANSMIT_RANGE = create(key("waypoint_transmit_range"));
private AttributeKeys() {
}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class BannerPatternKeys {
/**
* {@code minecraft:base}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class BiomeKeys {
/**
* {@code minecraft:badlands}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class BlockTypeKeys {
/**
* {@code minecraft:acacia_button}
@@ -2475,13 +2475,6 @@ public final class BlockTypeKeys {
*/
public static final TypedKey<BlockType> DRAGON_WALL_HEAD = create(key("dragon_wall_head"));
/**
* {@code minecraft:dried_ghast}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<BlockType> DRIED_GHAST = create(key("dried_ghast"));
/**
* {@code minecraft:dried_kelp_block}
*
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class CatVariantKeys {
/**
* {@code minecraft:all_black}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class ChickenVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class CowVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class DamageTypeKeys {
/**
* {@code minecraft:arrow}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class DataComponentTypeKeys {
/**
* {@code minecraft:attribute_modifiers}
@@ -1,61 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#DIALOG}.
*
* @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
@GeneratedFrom("1.21.8")
public final class DialogKeys {
/**
* {@code minecraft:custom_options}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Dialog> CUSTOM_OPTIONS = create(key("custom_options"));
/**
* {@code minecraft:quick_actions}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Dialog> QUICK_ACTIONS = create(key("quick_actions"));
/**
* {@code minecraft:server_links}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Dialog> SERVER_LINKS = create(key("server_links"));
private DialogKeys() {
}
/**
* Creates a typed key for {@link Dialog} in the registry {@code minecraft:dialog}.
*
* @param key the value's key in the registry
* @return a new typed key
*/
public static TypedKey<Dialog> create(final Key key) {
return TypedKey.create(RegistryKey.DIALOG, key);
}
}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class EnchantmentKeys {
/**
* {@code minecraft:aqua_affinity}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class FluidKeys {
/**
* {@code minecraft:empty}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class FrogVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class GameEventKeys {
/**
* {@code minecraft:block_activate}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class InstrumentKeys {
/**
* {@code minecraft:admire_goat_horn}
File diff suppressed because it is too large. Load diff
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class JukeboxSongKeys {
/**
* {@code minecraft:11}
@@ -88,13 +88,6 @@ public final class JukeboxSongKeys {
*/
public static final TypedKey<JukeboxSong> FAR = create(key("far"));
/**
* {@code minecraft:lava_chicken}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> LAVA_CHICKEN = create(key("lava_chicken"));
/**
* {@code minecraft:mall}
*
@@ -151,13 +144,6 @@ public final class JukeboxSongKeys {
*/
public static final TypedKey<JukeboxSong> STRAD = create(key("strad"));
/**
* {@code minecraft:tears}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> TEARS = create(key("tears"));
/**
* {@code minecraft:wait}
*
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class MapDecorationTypeKeys {
/**
* {@code minecraft:banner_black}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class MenuTypeKeys {
/**
* {@code minecraft:anvil}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class MobEffectKeys {
/**
* {@code minecraft:absorption}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class PaintingVariantKeys {
/**
* {@code minecraft:alban}
@@ -123,13 +123,6 @@ public final class PaintingVariantKeys {
*/
public static final TypedKey<Art> CREEBET = create(key("creebet"));
/**
* {@code minecraft:dennis}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> DENNIS = create(key("dennis"));
/**
* {@code minecraft:donkey_kong}
*
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class PigVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class SoundEventKeys {
/**
* {@code minecraft:ambient.basalt_deltas.additions}
@@ -1929,62 +1929,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_DISPENSER_LAUNCH = create(key("block.dispenser.launch"));
/**
* {@code minecraft:block.dried_ghast.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_AMBIENT = create(key("block.dried_ghast.ambient"));
/**
* {@code minecraft:block.dried_ghast.ambient_water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_AMBIENT_WATER = create(key("block.dried_ghast.ambient_water"));
/**
* {@code minecraft:block.dried_ghast.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_BREAK = create(key("block.dried_ghast.break"));
/**
* {@code minecraft:block.dried_ghast.fall}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_FALL = create(key("block.dried_ghast.fall"));
/**
* {@code minecraft:block.dried_ghast.place}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_PLACE = create(key("block.dried_ghast.place"));
/**
* {@code minecraft:block.dried_ghast.place_in_water}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_PLACE_IN_WATER = create(key("block.dried_ghast.place_in_water"));
/**
* {@code minecraft:block.dried_ghast.step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_STEP = create(key("block.dried_ghast.step"));
/**
* {@code minecraft:block.dried_ghast.transition}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRIED_GHAST_TRANSITION = create(key("block.dried_ghast.transition"));
/**
* {@code minecraft:block.dripstone_block.break}
*
@@ -2020,13 +1964,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_DRIPSTONE_BLOCK_STEP = create(key("block.dripstone_block.step"));
/**
* {@code minecraft:block.dry_grass.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_DRY_GRASS_AMBIENT = create(key("block.dry_grass.ambient"));
/**
* {@code minecraft:block.enchantment_table.use}
*
@@ -4176,6 +4113,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> BLOCK_SAND_STEP = create(key("block.sand.step"));
/**
* {@code minecraft:block.sand.wind}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> BLOCK_SAND_WIND = create(key("block.sand.wind"));
/**
* {@code minecraft:block.scaffolding.break}
*
@@ -7263,34 +7207,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_GHAST_WARN = create(key("entity.ghast.warn"));
/**
* {@code minecraft:entity.ghastling.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_AMBIENT = create(key("entity.ghastling.ambient"));
/**
* {@code minecraft:entity.ghastling.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_DEATH = create(key("entity.ghastling.death"));
/**
* {@code minecraft:entity.ghastling.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_HURT = create(key("entity.ghastling.hurt"));
/**
* {@code minecraft:entity.ghastling.spawn}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_GHASTLING_SPAWN = create(key("entity.ghastling.spawn"));
/**
* {@code minecraft:entity.glow_item_frame.add_item}
*
@@ -7536,62 +7452,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_GUARDIAN_HURT_LAND = create(key("entity.guardian.hurt_land"));
/**
* {@code minecraft:entity.happy_ghast.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_AMBIENT = create(key("entity.happy_ghast.ambient"));
/**
* {@code minecraft:entity.happy_ghast.death}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_DEATH = create(key("entity.happy_ghast.death"));
/**
* {@code minecraft:entity.happy_ghast.equip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_EQUIP = create(key("entity.happy_ghast.equip"));
/**
* {@code minecraft:entity.happy_ghast.harness_goggles_down}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_DOWN = create(key("entity.happy_ghast.harness_goggles_down"));
/**
* {@code minecraft:entity.happy_ghast.harness_goggles_up}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HARNESS_GOGGLES_UP = create(key("entity.happy_ghast.harness_goggles_up"));
/**
* {@code minecraft:entity.happy_ghast.hurt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_HURT = create(key("entity.happy_ghast.hurt"));
/**
* {@code minecraft:entity.happy_ghast.riding}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_RIDING = create(key("entity.happy_ghast.riding"));
/**
* {@code minecraft:entity.happy_ghast.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_HAPPY_GHAST_UNEQUIP = create(key("entity.happy_ghast.unequip"));
/**
* {@code minecraft:entity.hoglin.ambient}
*
@@ -7956,6 +7816,20 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_ITEM_FRAME_ROTATE_ITEM = create(key("entity.item_frame.rotate_item"));
/**
* {@code minecraft:entity.leash_knot.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_LEASH_KNOT_BREAK = create(key("entity.leash_knot.break"));
/**
* {@code minecraft:entity.leash_knot.place}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_LEASH_KNOT_PLACE = create(key("entity.leash_knot.place"));
/**
* {@code minecraft:entity.lightning_bolt.impact}
*
@@ -9006,6 +8880,13 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ENTITY_POLAR_BEAR_WARNING = create(key("entity.polar_bear.warning"));
/**
* {@code minecraft:entity.puffer_fish.ambient}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ENTITY_PUFFER_FISH_AMBIENT = create(key("entity.puffer_fish.ambient"));
/**
* {@code minecraft:entity.puffer_fish.blow_out}
*
@@ -11442,13 +11323,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_HONEYCOMB_WAX_ON = create(key("item.honeycomb.wax_on"));
/**
* {@code minecraft:item.horse_armor.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_HORSE_ARMOR_UNEQUIP = create(key("item.horse_armor.unequip"));
/**
* {@code minecraft:item.ink_sac.use}
*
@@ -11456,34 +11330,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_INK_SAC_USE = create(key("item.ink_sac.use"));
/**
* {@code minecraft:item.lead.break}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_BREAK = create(key("item.lead.break"));
/**
* {@code minecraft:item.lead.tied}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_TIED = create(key("item.lead.tied"));
/**
* {@code minecraft:item.lead.untied}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LEAD_UNTIED = create(key("item.lead.untied"));
/**
* {@code minecraft:item.llama_carpet.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_LLAMA_CARPET_UNEQUIP = create(key("item.llama_carpet.unequip"));
/**
* {@code minecraft:item.lodestone_compass.lock}
*
@@ -11526,20 +11372,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> ITEM_OMINOUS_BOTTLE_DISPOSE = create(key("item.ominous_bottle.dispose"));
/**
* {@code minecraft:item.saddle.unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SADDLE_UNEQUIP = create(key("item.saddle.unequip"));
/**
* {@code minecraft:item.shears.snip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> ITEM_SHEARS_SNIP = create(key("item.shears.snip"));
/**
* {@code minecraft:item.shield.block}
*
@@ -11946,13 +11778,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> MUSIC_DISC_FAR = create(key("music_disc.far"));
/**
* {@code minecraft:music_disc.lava_chicken}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> MUSIC_DISC_LAVA_CHICKEN = create(key("music_disc.lava_chicken"));
/**
* {@code minecraft:music_disc.mall}
*
@@ -12009,13 +11834,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> MUSIC_DISC_STRAD = create(key("music_disc.strad"));
/**
* {@code minecraft:music_disc.tears}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> MUSIC_DISC_TEARS = create(key("music_disc.tears"));
/**
* {@code minecraft:music_disc.wait}
*
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class StructureKeys {
/**
* {@code minecraft:ancient_city}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class StructureTypeKeys {
/**
* {@code minecraft:buried_treasure}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class TrimMaterialKeys {
/**
* {@code minecraft:amethyst}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class VillagerProfessionKeys {
/**
* {@code minecraft:armorer}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class VillagerTypeKeys {
/**
* {@code minecraft:desert}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class WolfSoundVariantKeys {
/**
* {@code minecraft:angry}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
public final class WolfVariantKeys {
/**
* {@code minecraft:ashen}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.banner.PatternType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class BannerPatternTagKeys {
/**
* {@code #minecraft:no_item_required}
@@ -111,6 +113,7 @@ public final class BannerPatternTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<PatternType> create(final Key key) {
return TagKey.create(RegistryKey.BANNER_PATTERN, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.Biome;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class BiomeTagKeys {
/**
* {@code #minecraft:allows_surface_slime_spawns}
@@ -538,6 +540,7 @@ public final class BiomeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Biome> create(final Key key) {
return TagKey.create(RegistryKey.BIOME, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.BlockType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class BlockTypeTagKeys {
/**
* {@code #minecraft:acacia_logs}
@@ -578,13 +580,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> GUARDED_BY_PIGLINS = create(key("guarded_by_piglins"));
/**
* {@code #minecraft:happy_ghast_avoids}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> HAPPY_GHAST_AVOIDS = create(key("happy_ghast_avoids"));
/**
* {@code #minecraft:hoglin_repellents}
*
@@ -914,6 +909,13 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> PLANKS = create(key("planks"));
/**
* {@code #minecraft:plays_ambient_desert_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> PLAYS_AMBIENT_DESERT_BLOCK_SOUNDS = create(key("plays_ambient_desert_block_sounds"));
/**
* {@code #minecraft:polar_bears_spawnable_on_alternate}
*
@@ -1201,27 +1203,6 @@ public final class BlockTypeTagKeys {
*/
public static final TagKey<BlockType> TRAPDOORS = create(key("trapdoors"));
/**
* {@code #minecraft:triggers_ambient_desert_dry_vegetation_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DESERT_DRY_VEGETATION_BLOCK_SOUNDS = create(key("triggers_ambient_desert_dry_vegetation_block_sounds"));
/**
* {@code #minecraft:triggers_ambient_desert_sand_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DESERT_SAND_BLOCK_SOUNDS = create(key("triggers_ambient_desert_sand_block_sounds"));
/**
* {@code #minecraft:triggers_ambient_dried_ghast_block_sounds}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<BlockType> TRIGGERS_AMBIENT_DRIED_GHAST_BLOCK_SOUNDS = create(key("triggers_ambient_dried_ghast_block_sounds"));
/**
* {@code #minecraft:underwater_bonemeals}
*
@@ -1392,6 +1373,7 @@ public final class BlockTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<BlockType> create(final Key key) {
return TagKey.create(RegistryKey.BLOCK, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class DamageTypeTagKeys {
/**
* {@code #minecraft:always_hurts_ender_dragons}
@@ -265,6 +267,7 @@ public final class DamageTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<DamageType> create(final Key key) {
return TagKey.create(RegistryKey.DAMAGE_TYPE, key);
}
@@ -1,54 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla tag keys for {@link RegistryKey#DIALOG}.
*
* @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
@GeneratedFrom("1.21.8")
public final class DialogTagKeys {
/**
* {@code #minecraft:pause_screen_additions}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Dialog> PAUSE_SCREEN_ADDITIONS = create(key("pause_screen_additions"));
/**
* {@code #minecraft:quick_actions}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<Dialog> QUICK_ACTIONS = create(key("quick_actions"));
private DialogTagKeys() {
}
/**
* Creates a tag key for {@link Dialog} in the registry {@code minecraft:dialog}.
*
* @param key the tag key's key
* @return a new tag key
*/
public static TagKey<Dialog> create(final Key key) {
return TagKey.create(RegistryKey.DIALOG, key);
}
}
@@ -25,7 +25,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class EnchantmentTagKeys {
/**
* {@code #minecraft:curse}
@@ -316,6 +317,7 @@ public final class EnchantmentTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Enchantment> create(final Key key) {
return TagKey.create(RegistryKey.ENCHANTMENT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.EntityType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class EntityTypeTagKeys {
/**
* {@code #minecraft:aquatic}
@@ -81,13 +83,6 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> CAN_BREATHE_UNDER_WATER = create(key("can_breathe_under_water"));
/**
* {@code #minecraft:can_equip_harness}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> CAN_EQUIP_HARNESS = create(key("can_equip_harness"));
/**
* {@code #minecraft:can_equip_saddle}
*
@@ -130,13 +125,6 @@ public final class EntityTypeTagKeys {
*/
public static final TagKey<EntityType> FALL_DAMAGE_IMMUNE = create(key("fall_damage_immune"));
/**
* {@code #minecraft:followable_friendly_mobs}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<EntityType> FOLLOWABLE_FRIENDLY_MOBS = create(key("followable_friendly_mobs"));
/**
* {@code #minecraft:freeze_hurts_extra_types}
*
@@ -307,6 +295,7 @@ public final class EntityTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<EntityType> create(final Key key) {
return TagKey.create(RegistryKey.ENTITY_TYPE, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Fluid;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class FluidTagKeys {
/**
* {@code #minecraft:lava}
@@ -48,6 +50,7 @@ public final class FluidTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Fluid> create(final Key key) {
return TagKey.create(RegistryKey.FLUID, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.GameEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class GameEventTagKeys {
/**
* {@code #minecraft:allay_can_listen}
@@ -69,6 +71,7 @@ public final class GameEventTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<GameEvent> create(final Key key) {
return TagKey.create(RegistryKey.GAME_EVENT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.MusicInstrument;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class InstrumentTagKeys {
/**
* {@code #minecraft:goat_horns}
@@ -55,6 +57,7 @@ public final class InstrumentTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<MusicInstrument> create(final Key key) {
return TagKey.create(RegistryKey.INSTRUMENT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class ItemTypeTagKeys {
/**
* {@code #minecraft:acacia_logs}
@@ -599,27 +601,6 @@ public final class ItemTypeTagKeys {
*/
public static final TagKey<ItemType> HANGING_SIGNS = create(key("hanging_signs"));
/**
* {@code #minecraft:happy_ghast_food}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HAPPY_GHAST_FOOD = create(key("happy_ghast_food"));
/**
* {@code #minecraft:happy_ghast_tempt_items}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HAPPY_GHAST_TEMPT_ITEMS = create(key("happy_ghast_tempt_items"));
/**
* {@code #minecraft:harnesses}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TagKey<ItemType> HARNESSES = create(key("harnesses"));
/**
* {@code #minecraft:head_armor}
*
@@ -1287,6 +1268,7 @@ public final class ItemTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<ItemType> create(final Key key) {
return TagKey.create(RegistryKey.ITEM, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Art;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class PaintingVariantTagKeys {
/**
* {@code #minecraft:placeable}
@@ -41,6 +43,7 @@ public final class PaintingVariantTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Art> create(final Key key) {
return TagKey.create(RegistryKey.PAINTING_VARIANT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.Structure;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.8")
@GeneratedFrom("1.21.5")
@ApiStatus.Experimental
public final class StructureTagKeys {
/**
* {@code #minecraft:cats_spawn_as_black}
@@ -174,6 +176,7 @@ public final class StructureTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Structure> create(final Key key) {
return TagKey.create(RegistryKey.STRUCTURE, key);
}
@@ -6,17 +6,18 @@ package com.destroystokyo.paper;
import com.google.common.collect.Lists;
import io.papermc.paper.tag.BaseTag;
import java.util.Collection;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.BlockData;
import org.bukkit.inventory.ItemStack;
import java.util.Collection;
import java.util.Set;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -93,8 +94,7 @@ public class MaterialSetTag extends BaseTag<Material, MaterialSetTag> {
return isTagged(item.getType());
}
@Override
public boolean isTagged(@NotNull Material material) {
return super.isTagged(material);
return this.tagged.contains(material);
}
}
@@ -23,7 +23,6 @@
package com.destroystokyo.paper;
import java.util.Objects;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Tag;
@@ -39,32 +38,19 @@ import org.bukkit.Tag;
public class MaterialTags {
private static NamespacedKey keyFor(String key) {
//noinspection deprecation
return new NamespacedKey("paper", key + "_settag");
}
private static MaterialSetTag replacedBy(Tag<Material> vanillaTag) {
return replacedBy(vanillaTag, Objects.requireNonNull(vanillaTag).key().value());
}
@SuppressWarnings("unchecked")
private static MaterialSetTag replacedBy(Tag<Material> vanillaTag, String legacyKey) {
Objects.requireNonNull(vanillaTag);
return new MaterialSetTag(keyFor(legacyKey)).add(vanillaTag).lock();
}
/**
* @deprecated in favour of {@link Tag#ITEMS_ARROWS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag ARROWS = replacedBy(Tag.ITEMS_ARROWS);
public static final MaterialSetTag ARROWS = new MaterialSetTag(keyFor("arrows"))
.endsWith("ARROW")
.ensureSize("ARROWS", 3).lock();
/**
* Covers all colors of beds.
*
* @deprecated in favour of {@link Tag#BEDS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag BEDS = replacedBy(Tag.BEDS);
public static final MaterialSetTag BEDS = new MaterialSetTag(keyFor("beds"))
.endsWith("_BED")
.ensureSize("BEDS", 16).lock();
/**
* Covers all bucket items.
@@ -75,11 +61,9 @@ public class MaterialTags {
/**
* Covers coal and charcoal.
*
* @deprecated in favour of {@link Tag#ITEMS_COALS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag COALS = replacedBy(Tag.ITEMS_COALS);
public static final MaterialSetTag COALS = new MaterialSetTag(keyFor("coals"))
.add(Material.COAL, Material.CHARCOAL).lock();
/**
* Covers both cobblestone wall variants.
@@ -103,11 +87,10 @@ public class MaterialTags {
/**
* Covers all colors of concrete powder.
*
* @deprecated in favour of {@link Tag#CONCRETE_POWDER}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag CONCRETE_POWDER = replacedBy(Tag.CONCRETE_POWDER);
public static final MaterialSetTag CONCRETE_POWDER = new MaterialSetTag(keyFor("concrete_powder"))
.endsWith("_CONCRETE_POWDER")
.ensureSize("CONCRETE_POWDER", 16).lock();
/**
* Covers the two types of cooked fish.
@@ -117,11 +100,10 @@ public class MaterialTags {
/**
* Covers all variants of doors.
*
* @deprecated in favour of {@link Tag#DOORS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag DOORS = replacedBy(Tag.DOORS);
public static final MaterialSetTag DOORS = new MaterialSetTag(keyFor("doors"))
.endsWith("_DOOR")
.ensureSize("DOORS", 21).lock();
/**
* Covers all dyes.
@@ -132,19 +114,17 @@ public class MaterialTags {
/**
* Covers all variants of gates.
*
* @deprecated in favour of {@link Tag#FENCE_GATES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag FENCE_GATES = replacedBy(Tag.FENCE_GATES);
public static final MaterialSetTag FENCE_GATES = new MaterialSetTag(keyFor("fence_gates"))
.endsWith("_GATE")
.ensureSize("FENCE_GATES", 12).lock();
/**
* Covers all variants of fences.
*
* @deprecated in favour of {@link Tag#FENCES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag FENCES = replacedBy(Tag.FENCES);
public static final MaterialSetTag FENCES = new MaterialSetTag(keyFor("fences"))
.endsWith("_FENCE")
.ensureSize("FENCES", 13).lock();
/**
* Covers all variants of fish buckets.
@@ -153,7 +133,7 @@ public class MaterialTags {
.add(Material.COD_BUCKET, Material.PUFFERFISH_BUCKET, Material.SALMON_BUCKET, Material.TROPICAL_FISH_BUCKET).lock();
/**
* Covers the non-colored glass and 16 stained glasses (not panes).
* Covers the non-colored glass and 16 stained glass (not panes).
*/
public static final MaterialSetTag GLASS = new MaterialSetTag(keyFor("glass"))
.endsWith("_GLASS")
@@ -234,11 +214,10 @@ public class MaterialTags {
/**
* Covers all ores.
*/
@SuppressWarnings("unchecked")
public static final MaterialSetTag ORES = new MaterialSetTag(keyFor("ores"))
.add(Tag.COAL_ORES, Tag.COPPER_ORES, Tag.IRON_ORES, Tag.GOLD_ORES,
Tag.LAPIS_ORES, Tag.REDSTONE_ORES, Tag.DIAMOND_ORES, Tag.EMERALD_ORES)
.add(Material.ANCIENT_DEBRIS, Material.NETHER_QUARTZ_ORE).lock();
.add(Material.ANCIENT_DEBRIS)
.endsWith("_ORE")
.ensureSize("ORES", 19).lock();
/**
* Covers all piston typed items and blocks including the piston head and moving piston.
@@ -256,11 +235,10 @@ public class MaterialTags {
/**
* Covers all wooden pressure plates and the weighted pressure plates and the stone pressure plate.
*
* @deprecated in favour of {@link Tag#PRESSURE_PLATES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag PRESSURE_PLATES = replacedBy(Tag.PRESSURE_PLATES);
public static final MaterialSetTag PRESSURE_PLATES = new MaterialSetTag(keyFor("pressure_plates"))
.endsWith("_PRESSURE_PLATE")
.ensureSize("PRESSURE_PLATES", 16).lock();
/**
* Covers the variants of prismarine blocks.
@@ -320,11 +298,10 @@ public class MaterialTags {
/**
* Covers the non-colored and colored shulker boxes.
*
* @deprecated in favour of {@link Tag#SHULKER_BOXES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag SHULKER_BOXES = replacedBy(Tag.SHULKER_BOXES);
public static final MaterialSetTag SHULKER_BOXES = new MaterialSetTag(keyFor("shulker_boxes"))
.endsWith("SHULKER_BOX")
.ensureSize("SHULKER_BOXES", 17).lock();
/**
* Covers zombie, creeper, skeleton, dragon, and player heads.
@@ -340,7 +317,7 @@ public class MaterialTags {
*/
public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
.endsWith("_SPAWN_EGG")
.ensureSize("SPAWN_EGGS", 82).lock();
.ensureSize("SPAWN_EGGS", 81).lock();
/**
* Covers all colors of stained glass.
@@ -358,43 +335,43 @@ public class MaterialTags {
/**
* Covers all variants of trapdoors.
*
* @deprecated in favour of {@link Tag#TRAPDOORS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag TRAPDOORS = replacedBy(Tag.TRAPDOORS);
public static final MaterialSetTag TRAPDOORS = new MaterialSetTag(keyFor("trapdoors"))
.endsWith("_TRAPDOOR")
.ensureSize("TRAPDOORS", 21).lock();
/**
* Covers all wood variants of doors.
*
* @deprecated in favour of {@link Tag#WOODEN_DOORS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag WOODEN_DOORS = replacedBy(Tag.WOODEN_DOORS);
public static final MaterialSetTag WOODEN_DOORS = new MaterialSetTag(keyFor("wooden_doors"))
.endsWith("_DOOR")
.not(Material.IRON_DOOR)
.notContains("COPPER")
.ensureSize("WOODEN_DOORS", 12).lock();
/**
* Covers all wood variants of fences.
*
* @deprecated in favour of {@link Tag#WOODEN_FENCES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag WOODEN_FENCES = replacedBy(Tag.WOODEN_FENCES);
public static final MaterialSetTag WOODEN_FENCES = new MaterialSetTag(keyFor("wooden_fences"))
.endsWith("_FENCE")
.not(Material.NETHER_BRICK_FENCE)
.ensureSize("WOODEN_FENCES", 12).lock();
/**
* Covers all wood variants of trapdoors.
*
* @deprecated in favour of {@link Tag#WOODEN_TRAPDOORS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag WOODEN_TRAPDOORS = replacedBy(Tag.WOODEN_TRAPDOORS);
public static final MaterialSetTag WOODEN_TRAPDOORS = new MaterialSetTag(keyFor("wooden_trapdoors"))
.endsWith("_TRAPDOOR")
.not(Material.IRON_TRAPDOOR)
.notContains("COPPER")
.ensureSize("WOODEN_TRAPDOORS", 12).lock();
/**
* Covers the wood variants of gates.
*
* @deprecated in favour of {@link Tag#FENCE_GATES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag WOODEN_GATES = replacedBy(Tag.FENCE_GATES, "wooden_gates");
public static final MaterialSetTag WOODEN_GATES = new MaterialSetTag(keyFor("wooden_gates"))
.endsWith("_GATE")
.ensureSize("WOODEN_GATES", 12).lock();
/**
* Covers the variants of purpur.
@@ -405,11 +382,10 @@ public class MaterialTags {
/**
* Covers the variants of signs.
*
* @deprecated in favour of {@link Tag#ALL_SIGNS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag SIGNS = replacedBy(Tag.ALL_SIGNS, "signs");
public static final MaterialSetTag SIGNS = new MaterialSetTag(keyFor("signs"))
.endsWith("_SIGN")
.ensureSize("SIGNS", 48).lock();
/**
* Covers the variants of a regular torch.
@@ -448,113 +424,96 @@ public class MaterialTags {
/**
* Covers the variants of rails.
*
* @deprecated in favour of {@link Tag#RAILS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag RAILS = replacedBy(Tag.RAILS);
public static final MaterialSetTag RAILS = new MaterialSetTag(keyFor("rails"))
.endsWith("RAIL")
.ensureSize("RAILS", 4).lock();
/**
* Covers the variants of swords.
*
* @deprecated in favour of {@link Tag#ITEMS_SWORDS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag SWORDS = replacedBy(Tag.ITEMS_SWORDS);
public static final MaterialSetTag SWORDS = new MaterialSetTag(keyFor("swords"))
.endsWith("_SWORD")
.ensureSize("SWORDS", 6).lock();
/**
* Covers the variants of shovels.
*
* @deprecated in favour of {@link Tag#ITEMS_SHOVELS}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag SHOVELS = replacedBy(Tag.ITEMS_SHOVELS);
public static final MaterialSetTag SHOVELS = new MaterialSetTag(keyFor("shovels"))
.endsWith("_SHOVEL")
.ensureSize("SHOVELS", 6).lock();
/**
* Covers the variants of pickaxes.
*
* @deprecated in favour of {@link Tag#ITEMS_PICKAXES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag PICKAXES = replacedBy(Tag.ITEMS_PICKAXES);
public static final MaterialSetTag PICKAXES = new MaterialSetTag(keyFor("pickaxes"))
.endsWith("_PICKAXE")
.ensureSize("PICKAXES", 6).lock();
/**
* Covers the variants of axes.
*
* @deprecated in favour of {@link Tag#ITEMS_AXES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag AXES = replacedBy(Tag.ITEMS_AXES);
public static final MaterialSetTag AXES = new MaterialSetTag(keyFor("axes"))
.endsWith("_AXE")
.ensureSize("AXES", 6).lock();
/**
* Covers the variants of hoes.
*
* @deprecated in favour of {@link Tag#ITEMS_HOES}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag HOES = replacedBy(Tag.ITEMS_HOES);
public static final MaterialSetTag HOES = new MaterialSetTag(keyFor("hoes"))
.endsWith("_HOE")
.ensureSize("HOES", 6).lock();
/**
* Covers the variants of helmets.
*
* @deprecated in favour of {@link Tag#ITEMS_HEAD_ARMOR}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag HELMETS = replacedBy(Tag.ITEMS_HEAD_ARMOR, "helmets");
public static final MaterialSetTag HELMETS = new MaterialSetTag(keyFor("helmets"))
.endsWith("_HELMET")
.ensureSize("HELMETS", 7).lock();
/**
* Covers the variants of items that can be equipped in the helmet slot.
*
* @deprecated any item can be equippable with the right data component set on it
*/
@Deprecated(since = "1.21.8")
@SuppressWarnings("unchecked")
public static final MaterialSetTag HEAD_EQUIPPABLE = new MaterialSetTag(keyFor("head_equippable"))
.add(Tag.ITEMS_HEAD_ARMOR, Tag.ITEMS_SKULLS)
.add(Material.CARVED_PUMPKIN).lock();
.endsWith("_HELMET")
.add(SKULLS)
.add(Material.CARVED_PUMPKIN)
.ensureSize("HEAD_EQUIPPABLE", 22).lock();
/**
* Covers the variants of chestplate.
*
* @deprecated in favour of {@link Tag#ITEMS_CHEST_ARMOR}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag CHESTPLATES = replacedBy(Tag.ITEMS_CHEST_ARMOR, "chestplates");
public static final MaterialSetTag CHESTPLATES = new MaterialSetTag(keyFor("chestplates"))
.endsWith("_CHESTPLATE")
.ensureSize("CHESTPLATES", 6).lock();
/**
* Covers the variants of items that can be equipped in the chest slot.
*
* @deprecated any item can be equippable with the right data component set on it
*/
@Deprecated(since = "1.21.8")
@SuppressWarnings("unchecked")
public static final MaterialSetTag CHEST_EQUIPPABLE = new MaterialSetTag(keyFor("chest_equippable"))
.add(Tag.ITEMS_CHEST_ARMOR)
.add(Material.ELYTRA).lock();
.endsWith("_CHESTPLATE")
.add(Material.ELYTRA)
.ensureSize("CHEST_EQUIPPABLE", 7).lock();
/**
* Covers the variants of leggings.
*
* @deprecated in favour of {@link Tag#ITEMS_LEG_ARMOR}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag LEGGINGS = replacedBy(Tag.ITEMS_LEG_ARMOR, "leggings");
public static final MaterialSetTag LEGGINGS = new MaterialSetTag(keyFor("leggings"))
.endsWith("_LEGGINGS")
.ensureSize("LEGGINGS", 6).lock();
/**
* Covers the variants of boots.
*
* @deprecated in favour of {@link Tag#ITEMS_FOOT_ARMOR}
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag BOOTS = replacedBy(Tag.ITEMS_FOOT_ARMOR, "boots");
public static final MaterialSetTag BOOTS = new MaterialSetTag(keyFor("boots"))
.endsWith("_BOOTS")
.ensureSize("BOOTS", 6).lock();
/**
* Covers all variants of armor.
*/
@SuppressWarnings("unchecked")
public static final MaterialSetTag ARMOR = new MaterialSetTag(keyFor("armor"))
.add(Tag.ITEMS_HEAD_ARMOR, Tag.ITEMS_CHEST_ARMOR, Tag.ITEMS_LEG_ARMOR, Tag.ITEMS_FOOT_ARMOR)
.lock();
public static final MaterialSetTag ARMOR = new MaterialSetTag(keyFor("armor")).add(HELMETS, CHESTPLATES, LEGGINGS, BOOTS)
.ensureSize("ARMOR", 25).lock();
/**
* Covers the variants of bows.
@@ -562,27 +521,21 @@ public class MaterialTags {
public static final MaterialSetTag BOWS = new MaterialSetTag(keyFor("bows"))
.add(Material.BOW)
.add(Material.CROSSBOW)
.lock();
.ensureSize("BOWS", 2).lock();
/**
* Covers the variants of player-throwable projectiles (not requiring a bow or any other "assistance").
*/
@SuppressWarnings("unchecked")
public static final MaterialSetTag THROWABLE_PROJECTILES = new MaterialSetTag(keyFor("throwable_projectiles"))
.add(Tag.ITEMS_EGGS)
.add(Material.SNOWBALL, Material.SPLASH_POTION, Material.LINGERING_POTION,
Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET,
Material.WIND_CHARGE)
.lock();
.add(Material.EGG, Material.SNOWBALL, Material.SPLASH_POTION, Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET).lock();
/**
* Covers materials that can be colored, such as wool, shulker boxes, stained glasses etc.
* Covers materials that can be colored, such as wool, shulker boxes, stained glass etc.
*/
@SuppressWarnings("unchecked")
public static final MaterialSetTag COLORABLE = new MaterialSetTag(keyFor("colorable"))
.add(Tag.WOOL, Tag.WOOL_CARPETS, Tag.SHULKER_BOXES, Tag.BEDS)
.add(STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES)
.lock();
.add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS).lock();
//.ensureSize("COLORABLE", 81).lock(); unit test don't have the vanilla item tags, so counts don't line up for real
/**
* Covers the variants of coral.
@@ -608,11 +561,15 @@ public class MaterialTags {
/**
* Covers all items that can be enchanted from the enchantment table or anvil.
*
* @deprecated in favour of {@link Tag#ITEMS_ENCHANTABLE_VANISHING} and other similar enchantable tags
*/
@Deprecated(since = "1.21.8")
public static final MaterialSetTag ENCHANTABLE = replacedBy(Tag.ITEMS_ENCHANTABLE_VANISHING, "enchantable"); // this tag already cover the others
public static final MaterialSetTag ENCHANTABLE = new MaterialSetTag(keyFor("enchantable"))
.add(PICKAXES, SWORDS, SHOVELS, AXES, HOES, HELMETS, CHEST_EQUIPPABLE, LEGGINGS, BOOTS, BOWS)
.add(Material.TRIDENT, Material.SHIELD, Material.FISHING_ROD, Material.SHEARS,
Material.FLINT_AND_STEEL, Material.CARROT_ON_A_STICK, Material.WARPED_FUNGUS_ON_A_STICK,
Material.BRUSH, Material.CARVED_PUMPKIN, Material.COMPASS, Material.SKELETON_SKULL,
Material.WITHER_SKELETON_SKULL, Material.PLAYER_HEAD, Material.ZOMBIE_HEAD,
Material.CREEPER_HEAD, Material.DRAGON_HEAD, Material.PIGLIN_HEAD, Material.MACE)
.ensureSize("ENCHANTABLE", 76).lock();
/**
* Covers the variants of raw ores.
@@ -15,46 +15,45 @@ import org.jspecify.annotations.Nullable;
@NullMarked
public final class GoalKey<T extends Mob> {
private final Class<T> type;
private final NamespacedKey key;
private final Class<T> entityClass;
private final NamespacedKey namespacedKey;
private GoalKey(Class<T> type, NamespacedKey key) {
this.type = type;
this.key = key;
private GoalKey(Class<T> entityClass, NamespacedKey namespacedKey) {
this.entityClass = entityClass;
this.namespacedKey = namespacedKey;
}
public Class<T> getEntityClass() {
return this.type;
return this.entityClass;
}
public NamespacedKey getNamespacedKey() {
return this.key;
return this.namespacedKey;
}
@Override
public boolean equals(@Nullable Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
GoalKey<?> goalKey = (GoalKey<?>) o;
return Objects.equals(this.type, goalKey.type) &&
Objects.equals(this.key, goalKey.key);
return Objects.equals(this.entityClass, goalKey.entityClass) &&
Objects.equals(this.namespacedKey, goalKey.namespacedKey);
}
@Override
public int hashCode() {
return Objects.hash(this.type, this.key);
return Objects.hash(this.entityClass, this.namespacedKey);
}
@Override
public String toString() {
return new StringJoiner(", ", GoalKey.class.getSimpleName() + "[", "]")
.add("type=" + this.type)
.add("key=" + this.key)
.add("entityClass=" + this.entityClass)
.add("namespacedKey=" + this.namespacedKey)
.toString();
}
public static <A extends Mob> GoalKey<A> of(Class<A> type, NamespacedKey key) {
return new GoalKey<>(type, key);
public static <A extends Mob> GoalKey<A> of(Class<A> entityClass, NamespacedKey namespacedKey) {
return new GoalKey<>(entityClass, namespacedKey);
}
}
@@ -9,6 +9,7 @@ import org.bukkit.command.Command;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.server.ServerEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -18,8 +19,10 @@ import org.jetbrains.annotations.NotNull;
* This is done at Plugin Enable time after commands have been registered, but may also
* run at a later point in the server lifetime due to plugins, a server reload, etc.</p>
*
* <p>This is a draft/experimental API and is subject to change.</p>
* @deprecated For removal, use the new brigadier api.
*/
@ApiStatus.Experimental
@Deprecated(since = "1.20.6")
@Warning(reason = "This event has been superseded by the Commands API and will be removed in a future release. Listen to LifecycleEvents.COMMANDS instead.", value = true)
public class CommandRegisteredEvent<S extends com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource> extends ServerEvent implements Cancellable {
@@ -477,7 +477,7 @@ public class PaperServerListPingEvent extends ServerListPingEvent implements Can
}
@Override
public @NotNull PlayerProfile clone() {
public org.bukkit.profile.@NotNull PlayerProfile clone() {
throw new UnsupportedOperationException();
}
@@ -243,12 +243,4 @@ public interface PlayerProfile extends org.bukkit.profile.PlayerProfile {
default boolean hasTextures() {
return this.hasProperty("textures");
}
/**
* {@inheritDoc}
*
* @return the cloned player profile.
*/
@Override
PlayerProfile clone();
}
@@ -1,6 +1,5 @@
package io.papermc.paper;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.world.damagesource.CombatEntry;
import io.papermc.paper.world.damagesource.FallLocationType;
import net.kyori.adventure.util.Services;
@@ -12,8 +11,6 @@ import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
import java.util.function.Predicate;
/**
* Static bridge to the server internals.
* <p>
@@ -76,15 +73,5 @@ public interface InternalAPIBridge {
* @return combat entry
*/
CombatEntry createCombatEntry(DamageSource damageSource, float damage, @Nullable FallLocationType fallLocationType, float fallDistance);
/**
* Causes this predicate to be considered restricted.
* Applying this to a command node prevents this command from being executed from an
* unattended context, such as click events.
*
* @param predicate wrapped predicate
* @return wrapped predicate
*/
Predicate<CommandSourceStack> restricted(Predicate<CommandSourceStack> predicate);
}
@@ -4,12 +4,15 @@ import java.util.Collection;
import java.util.Collections;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* Implementing this interface allows for easily creating "Bukkit-style" {@code String[] args} commands.
* The implementation handles converting the command to a representation compatible with Brigadier on registration, usually in the form of {@literal /commandlabel <greedy_string>}.
*/
@ApiStatus.Experimental
@NullMarked
@FunctionalInterface
public interface BasicCommand {
@@ -17,8 +17,7 @@ public enum CommandRegistrationFlag {
@Deprecated(since = "1.21.4")
FLATTEN_ALIASES,
/**
* @deprecated Removed as it causes a warning to appear on the client now.
* Prevents this command from being sent to the client.
*/
@Deprecated(since = "1.21.6", forRemoval = true)
SERVER_ONLY
}
@@ -6,6 +6,7 @@ import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
@@ -20,6 +21,8 @@ import org.jspecify.annotations.Nullable;
* exist yet, or no specific sender is available. Methods on such a {@link CommandSender}
* will either have no effect or throw an {@link UnsupportedOperationException}.</p>
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface CommandSourceStack {
@@ -5,7 +5,6 @@ import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import com.mojang.brigadier.tree.LiteralCommandNode;
import io.papermc.paper.InternalAPIBridge;
import io.papermc.paper.plugin.bootstrap.BootstrapContext;
import io.papermc.paper.plugin.bootstrap.PluginBootstrap;
import io.papermc.paper.plugin.configuration.PluginMeta;
@@ -14,9 +13,9 @@ import io.papermc.paper.plugin.lifecycle.event.registrar.Registrar;
import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.function.Predicate;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
@@ -59,6 +58,8 @@ import org.jspecify.annotations.Nullable;
*
* @see io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents#COMMANDS
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface Commands extends Registrar {
@@ -84,22 +85,6 @@ public interface Commands extends Registrar {
return RequiredArgumentBuilder.argument(name, argumentType);
}
/**
* Creates a restricted {@link Predicate} that wraps the given predicate.
* <p>
* A restricted predicate prevents execution in unattended contexts, such as from
* chat click events. A warning is shown on the client before executing the command.
* <p>
* This is used by vanilla to prevent invocation of sensitive commands (like op) from
* players without their knowledge.
*
* @param predicate the original predicate to wrap
* @return a new predicate with restricted execution behavior
*/
static Predicate<CommandSourceStack> restricted(final Predicate<CommandSourceStack> predicate) {
return InternalAPIBridge.get().restricted(predicate);
}
/**
* Gets the underlying {@link CommandDispatcher}.
*
@@ -1,15 +1,16 @@
package io.papermc.paper.command.brigadier;
import com.mojang.brigadier.Message;
import java.util.Optional;
import java.util.ServiceLoader;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.ComponentSerializer;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A component serializer for converting between {@link Message} and {@link Component}.
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface MessageComponentSerializer extends ComponentSerializer<Component, Component, Message> {
@@ -19,9 +20,6 @@ public interface MessageComponentSerializer extends ComponentSerializer<Componen
* @return serializer instance
*/
static MessageComponentSerializer message() {
final class Holder {
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class, MessageComponentSerializer.class.getClassLoader()).findFirst();
}
return Holder.PROVIDER.orElseThrow();
return MessageComponentSerializerHolder.PROVIDER.orElseThrow();
}
}
@@ -0,0 +1,12 @@
package io.papermc.paper.command.brigadier;
import java.util.Optional;
import java.util.ServiceLoader;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
final class MessageComponentSerializerHolder {
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class)
.findFirst();
}
@@ -1,14 +1,10 @@
package io.papermc.paper.command.brigadier.argument;
import com.mojang.brigadier.arguments.ArgumentType;
import io.papermc.paper.command.brigadier.argument.predicate.BlockInWorldPredicate;
import io.papermc.paper.command.brigadier.argument.predicate.ItemStackPredicate;
import io.papermc.paper.command.brigadier.argument.range.DoubleRangeProvider;
import io.papermc.paper.command.brigadier.argument.range.IntegerRangeProvider;
import io.papermc.paper.command.brigadier.argument.resolvers.AngleResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.BlockPositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.ColumnBlockPositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.ColumnFinePositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.FinePositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.PlayerProfileListResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.RotationResolver;
@@ -17,14 +13,11 @@ import io.papermc.paper.command.brigadier.argument.resolvers.selector.PlayerSele
import io.papermc.paper.entity.LookAnchor;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import java.util.Set;
import java.util.UUID;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextColor;
import org.bukkit.Axis;
import org.bukkit.GameMode;
import org.bukkit.HeightMap;
import org.bukkit.NamespacedKey;
@@ -36,6 +29,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scoreboard.Criteria;
import org.bukkit.scoreboard.DisplaySlot;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import static io.papermc.paper.command.brigadier.argument.VanillaArgumentProvider.provider;
@@ -47,6 +41,8 @@ import static io.papermc.paper.command.brigadier.argument.VanillaArgumentProvide
*
* <p>{@link CustomArgumentType} is provided for customizing parsing or result types server-side, while sending the vanilla argument type to the client.</p>
*/
@ApiStatus.Experimental
@NullMarked
public final class ArgumentTypes {
/**
@@ -108,26 +104,6 @@ public final class ArgumentTypes {
return provider().blockPosition();
}
/**
* A column block position argument.
*
* @return column block position argument
*/
@ApiStatus.Experimental
public static ArgumentType<ColumnBlockPositionResolver> columnBlockPosition() {
return provider().columnBlockPosition();
}
/**
* A block predicate argument.
*
* @return block predicate argument
*/
@ApiStatus.Experimental
public static ArgumentType<BlockInWorldPredicate> blockInWorldPredicate() {
return provider().blockInWorldPredicate();
}
/**
* A fine position argument.
*
@@ -148,28 +124,6 @@ public final class ArgumentTypes {
return provider().finePosition(centerIntegers);
}
/**
* A column fine position argument.
*
* @return column fine position argument
* @see #columnFinePosition(boolean) to center whole numbers
*/
@ApiStatus.Experimental
public static ArgumentType<ColumnFinePositionResolver> columnFinePosition() {
return columnFinePosition(false);
}
/**
* A column fine position argument.
*
* @param centerIntegers if whole numbers should be centered (+0.5)
* @return column fine position argument
*/
@ApiStatus.Experimental
public static ArgumentType<ColumnFinePositionResolver> columnFinePosition(final boolean centerIntegers) {
return provider().columnFinePosition(centerIntegers);
}
/**
* A rotation argument.
*
@@ -179,27 +133,6 @@ public final class ArgumentTypes {
return provider().rotation();
}
/**
* An angle argument.
*
* @return angle argument
*/
@ApiStatus.Experimental
public static ArgumentType<AngleResolver> angle() {
return provider().angle();
}
/**
* An argument used to resolve a set of axes.
*
* @return a set of axes.
* @see org.bukkit.Axis
*/
@ApiStatus.Experimental
public static ArgumentType<AxisSet> axes() {
return provider().axes();
}
/**
* A blockstate argument which will provide rich parsing for specifying
* the specific block variant and then the block entity NBT if applicable.
@@ -238,15 +171,6 @@ public final class ArgumentTypes {
return provider().namedColor();
}
/**
* A hex color argument.
*
* @return argument
*/
public static ArgumentType<TextColor> hexColor() {
return provider().hexColor();
}
/**
* A component argument.
*
@@ -1,12 +0,0 @@
package io.papermc.paper.command.brigadier.argument;
import com.mojang.brigadier.context.CommandContext;
import org.bukkit.Axis;
import java.util.Set;
/**
* A set of {@link Axis} intended for use in {@link CommandContext#getArgument(String, Class)} instead of a raw {@link Set}.
*/
public interface AxisSet extends Set<Axis> {
}
@@ -9,6 +9,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* An argument type that wraps around a native-to-vanilla argument type.
@@ -22,6 +23,8 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/
@ApiStatus.Experimental
@NullMarked
public interface CustomArgumentType<T, N> extends ArgumentType<T> {
/**
@@ -104,6 +107,7 @@ public interface CustomArgumentType<T, N> extends ArgumentType<T> {
* @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/
@ApiStatus.Experimental
interface Converted<T, N> extends CustomArgumentType<T, N> {
@ApiStatus.NonExtendable
@@ -3,10 +3,12 @@ package io.papermc.paper.command.brigadier.argument;
import com.mojang.brigadier.context.CommandContext;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import org.jspecify.annotations.NullMarked;
/**
* Utilities for extracting registry-related arguments from a {@link CommandContext}.
*/
@NullMarked
public final class RegistryArgumentExtractor {
/**
@@ -6,12 +6,15 @@ import io.papermc.paper.command.brigadier.CommandSourceStack;
import java.util.concurrent.CompletableFuture;
import net.kyori.adventure.chat.SignedMessage;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A resolver for a {@link SignedMessage}
*
* @see ArgumentTypes#signedMessage()
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface SignedMessageResolver {
@@ -35,4 +38,5 @@ public interface SignedMessageResolver {
* @throws CommandSyntaxException syntax exception
*/
CompletableFuture<SignedMessage> resolveSignedMessage(String argumentName, CommandContext<CommandSourceStack> context) throws CommandSyntaxException;
}
@@ -1,14 +1,10 @@
package io.papermc.paper.command.brigadier.argument;
import com.mojang.brigadier.arguments.ArgumentType;
import io.papermc.paper.command.brigadier.argument.predicate.BlockInWorldPredicate;
import io.papermc.paper.command.brigadier.argument.predicate.ItemStackPredicate;
import io.papermc.paper.command.brigadier.argument.range.DoubleRangeProvider;
import io.papermc.paper.command.brigadier.argument.range.IntegerRangeProvider;
import io.papermc.paper.command.brigadier.argument.resolvers.AngleResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.BlockPositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.ColumnBlockPositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.ColumnFinePositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.FinePositionResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.PlayerProfileListResolver;
import io.papermc.paper.command.brigadier.argument.resolvers.RotationResolver;
@@ -19,14 +15,11 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import java.util.Optional;
import java.util.ServiceLoader;
import java.util.Set;
import java.util.UUID;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.Style;
import net.kyori.adventure.text.format.TextColor;
import org.bukkit.Axis;
import org.bukkit.GameMode;
import org.bukkit.HeightMap;
import org.bukkit.NamespacedKey;
@@ -38,11 +31,14 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scoreboard.Criteria;
import org.bukkit.scoreboard.DisplaySlot;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
@NullMarked
interface VanillaArgumentProvider {
Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class, VanillaArgumentProvider.class.getClassLoader()).findFirst();
Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class)
.findFirst();
static VanillaArgumentProvider provider() {
return PROVIDER.orElseThrow();
@@ -59,31 +55,19 @@ interface VanillaArgumentProvider {
ArgumentType<PlayerProfileListResolver> playerProfiles();
ArgumentType<BlockPositionResolver> blockPosition();
ArgumentType<ColumnBlockPositionResolver> columnBlockPosition();
ArgumentType<FinePositionResolver> finePosition(boolean centerIntegers);
ArgumentType<ColumnFinePositionResolver> columnFinePosition(boolean centerIntegers);
ArgumentType<RotationResolver> rotation();
ArgumentType<AngleResolver> angle();
ArgumentType<AxisSet> axes();
ArgumentType<BlockState> blockState();
ArgumentType<BlockInWorldPredicate> blockInWorldPredicate();
ArgumentType<ItemStack> itemStack();
ArgumentType<ItemStackPredicate> itemStackPredicate();
ArgumentType<NamedTextColor> namedColor();
ArgumentType<TextColor> hexColor();
ArgumentType<Component> component();
ArgumentType<Style> style();
@@ -1,7 +0,0 @@
/**
* Arguments.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument;
import org.jspecify.annotations.NullMarked;
@@ -1,40 +0,0 @@
package io.papermc.paper.command.brigadier.argument.position;
import io.papermc.paper.math.BlockPosition;
import io.papermc.paper.math.Position;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A block position, which does not have a y value.
*/
@ApiStatus.Experimental
@NullMarked
public interface ColumnBlockPosition {
/**
* Gets the X-coordinate of the block position.
*
* @return the block's X-coordinate
*/
int blockX();
/**
* Gets the Z-coordinate of the block position.
*
* @return the block's Z-coordinate
*/
int blockZ();
/**
* Converts this column-based position into a full 3D {@link BlockPosition}
* by supplying a Y-coordinate.
*
* @param y the Y-coordinate to include in the new position
* @return a {@link BlockPosition} representing the full 3D position
*/
default BlockPosition toPosition(final int y) {
return Position.block(this.blockX(), y, this.blockZ());
}
}
@@ -1,39 +0,0 @@
package io.papermc.paper.command.brigadier.argument.position;
import io.papermc.paper.math.FinePosition;
import io.papermc.paper.math.Position;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A fine position, which does not hold a y value.
*/
@ApiStatus.Experimental
@NullMarked
public interface ColumnFinePosition {
/**
* Gets the X-coordinate of this position.
*
* @return the X-coordinate as a double
*/
double x();
/**
* Gets the Z-coordinate of this position.
*
* @return the Z-coordinate as a double
*/
double z();
/**
* Converts this column-based position into a full 3D {@link FinePosition}
* by supplying a Y-coordinate.
*
* @param y the Y-coordinate to include in the new position
* @return a {@link FinePosition} representing the full 3D position
*/
default FinePosition toPosition(final double y) {
return Position.fine(this.x(), y, this.z());
}
}
@@ -1,75 +0,0 @@
package io.papermc.paper.command.brigadier.argument.predicate;
import io.papermc.paper.command.brigadier.argument.ArgumentTypes;
import org.bukkit.block.Block;
import org.jetbrains.annotations.ApiStatus;
/**
* A predicate for a {@link Block}.
*
* @see ArgumentTypes#blockInWorldPredicate()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface BlockInWorldPredicate {
/**
* Checks if the passed block matches the block predicate.
* <p>
* This method will load the chunk the block is at in a synchronous manner.
*
* @param block the block instance to check
* @return the predicate result.
*/
default Result testBlock(final Block block) {
return this.testBlock(block, true);
}
/**
* Checks if the passed block matches the block predicate.
*
* @param block the block instance to check
* @param loadChunk if the chunk the block is located at should be loaded.
* @return the predicate result.
*/
Result testBlock(Block block, boolean loadChunk);
/**
* The predicate result is yielded by the {@link BlockInWorldPredicate} when applied to a block.
*
* @see #testBlock(Block)
* @see #testBlock(Block, boolean)
*/
enum Result {
/**
* The block passed to the predicate matches the predicate.
*/
TRUE,
/**
* The block passed to the predicate does not match the predicate.
*/
FALSE,
/**
* The block passed to the predicate was in an unloaded chunk and the {@code loadChunk} flag was false.
*/
UNLOADED_CHUNK,
;
/**
* Converts the result into an approximated boolean representation.
* Specifically, the following mappings are applied:
* <ul>
* <li>{@link #TRUE} -> {@code true}</li>
* <li>{@link #FALSE} -> {@code false}</li>
* <li>{@link #UNLOADED_CHUNK} -> {@code false}</li>
* </ul>
*
* @return the boolean representation.
*/
public boolean asBoolean() {
return this == TRUE;
}
}
}
@@ -9,6 +9,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#itemPredicate()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemStackPredicate extends Predicate<ItemStack> {
}
@@ -1,7 +0,0 @@
/**
* Predicates for argument types.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.predicate;
import org.jspecify.annotations.NullMarked;
@@ -7,6 +7,8 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#doubleRange()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public non-sealed interface DoubleRangeProvider extends RangeProvider<Double> {
}
@@ -7,6 +7,8 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#integerRange()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public non-sealed interface IntegerRangeProvider extends RangeProvider<Integer> {
}
@@ -1,6 +1,8 @@
package io.papermc.paper.command.brigadier.argument.range;
import com.google.common.collect.Range;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A provider for a range of numbers
@@ -8,6 +10,8 @@ import com.google.common.collect.Range;
* @param <T>
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/
@ApiStatus.Experimental
@NullMarked
public sealed interface RangeProvider<T extends Comparable<?>> permits DoubleRangeProvider, IntegerRangeProvider {
/**
@@ -1,7 +0,0 @@
/**
* Range providers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.range;
import org.jspecify.annotations.NullMarked;
@@ -1,28 +0,0 @@
package io.papermc.paper.command.brigadier.argument.resolvers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.command.brigadier.argument.ArgumentTypes;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* An {@link ArgumentResolver} capable of resolving
* an angle value using a {@link CommandSourceStack}.
*
* @see ArgumentTypes#angle()
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface AngleResolver {
/**
* Resolves the argument with the given
* command source stack.
*
* @param sourceStack source stack
* @return the resolved angle in degrees.
*/
float resolve(CommandSourceStack sourceStack) throws CommandSyntaxException;
}
@@ -3,6 +3,7 @@ package io.papermc.paper.command.brigadier.argument.resolvers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* An {@link ArgumentResolver} is capable of resolving
@@ -11,6 +12,8 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> resolved type
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface ArgumentResolver<T> {
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#blockPosition()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface BlockPositionResolver extends ArgumentResolver<BlockPosition> {
}
@@ -1,17 +0,0 @@
package io.papermc.paper.command.brigadier.argument.resolvers;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.command.brigadier.argument.ArgumentTypes;
import io.papermc.paper.command.brigadier.argument.position.ColumnBlockPosition;
import org.jetbrains.annotations.ApiStatus;
/**
* An {@link ArgumentResolver} that's capable of resolving
* a column block position argument value using a {@link CommandSourceStack}.
*
* @see ArgumentTypes#columnBlockPosition()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ColumnBlockPositionResolver extends ArgumentResolver<ColumnBlockPosition> {
}
@@ -1,17 +0,0 @@
package io.papermc.paper.command.brigadier.argument.resolvers;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import io.papermc.paper.command.brigadier.argument.position.ColumnFinePosition;
import org.jetbrains.annotations.ApiStatus;
/**
* An {@link ArgumentResolver} that's capable of resolving
* a column fine position argument value using a {@link CommandSourceStack}.
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#columnFinePosition()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#columnFinePosition(boolean)
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ColumnFinePositionResolver extends ArgumentResolver<ColumnFinePosition> {
}
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition(boolean)
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface FinePositionResolver extends ArgumentResolver<FinePosition> {
}
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#playerProfiles()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface PlayerProfileListResolver extends ArgumentResolver<Collection<PlayerProfile>> {
}
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#rotation()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface RotationResolver extends ArgumentResolver<Rotation> {
}
@@ -1,7 +0,0 @@
/**
* Argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers;
import org.jspecify.annotations.NullMarked;
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entity()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entities()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface EntitySelectorArgumentResolver extends SelectorArgumentResolver<List<Entity>> {
}
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#player()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#players()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface PlayerSelectorArgumentResolver extends SelectorArgumentResolver<List<Player>> {
}
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> resolved type
* @see <a href="https://minecraft.wiki/w/Target_selectors">Target Selectors</a>
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface SelectorArgumentResolver<T> extends ArgumentResolver<T> {
}
@@ -1,7 +0,0 @@
/**
* Entity selector argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers.selector;
import org.jspecify.annotations.NullMarked;
@@ -1,7 +0,0 @@
/**
* Brigadier connection API.
*/
@NullMarked
package io.papermc.paper.command.brigadier;
import org.jspecify.annotations.NullMarked;
Loaded 100 of 1154 files, more files were not shown because too many files have changed in this diff. Show more