mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-04 17:00:09 -05:00
Compare commits
129
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29c8822d90 | ||
|
|
19156cdd3b | ||
|
|
9aaaadffaa | ||
|
|
78aecfebaf | ||
|
|
65641d1006 | ||
|
|
49ca2d2d76 | ||
|
|
63cd4af408 | ||
|
|
704107c3dd | ||
|
|
9d1d0ef3f3 | ||
|
|
b6168b7ccc | ||
|
|
51706e5ac1 | ||
|
|
614e9acfca | ||
|
|
52d9a2216c | ||
|
|
42b653b197 | ||
|
|
5622c9dd73 | ||
|
|
a9e7674933 | ||
|
|
ea014f7a77 | ||
|
|
79cf1353b9 | ||
|
|
1922be9074 | ||
|
|
b0da38c278 | ||
|
|
38fe16b5f2 | ||
|
|
f866a5fd54 | ||
|
|
616a8795ea | ||
|
|
47f983f430 | ||
|
|
b200237c7d | ||
|
|
a22447a555 | ||
|
|
a743e6b1c7 | ||
|
|
2456ff26ed | ||
|
|
651fa124c5 | ||
|
|
f0c1f856f2 | ||
|
|
86b716bc5b | ||
|
|
4fe66e5800 | ||
|
|
3d1425f086 | ||
|
|
abf6b6c228 | ||
|
|
a664311f0f | ||
|
|
9694886daa | ||
|
|
6d0833ece5 | ||
|
|
846c64f4d1 | ||
|
|
e9380882f2 | ||
|
|
c60f4436f0 | ||
|
|
bf465e0029 | ||
|
|
ed31825a8d | ||
|
|
0c8efe4d02 | ||
|
|
ec9c83fa2b | ||
|
|
a4da45e3b2 | ||
|
|
4f79e9eeca | ||
|
|
4d44b5fd55 | ||
|
|
dbc367ba2d | ||
|
|
a57636189a | ||
|
|
57c13137e4 | ||
|
|
9ccc51df43 | ||
|
|
840dd9e1f8 | ||
|
|
6bb9dc6b73 | ||
|
|
103187750e | ||
|
|
a5f2f6140d | ||
|
|
c8a8c0ef89 | ||
|
|
602ea9f0e1 | ||
|
|
617e5a46a1 | ||
|
|
a2d37f12fb | ||
|
|
782ce950b8 | ||
|
|
0dad7f150b | ||
|
|
f7c59f914c | ||
|
|
aa4ef06748 | ||
|
|
6fb36e34b6 | ||
|
|
1f93f56670 | ||
|
|
d8cb3f5852 | ||
|
|
6db4bc01a6 | ||
|
|
a4feb28898 | ||
|
|
e792779dd8 | ||
|
|
a6e0c08fdf | ||
|
|
22d80a3b3b | ||
|
|
04f95191f1 | ||
|
|
21fb54246e | ||
|
|
94d60e15b3 | ||
|
|
bda84069b4 | ||
|
|
d9b5003fa1 | ||
|
|
533d93c758 | ||
|
|
ba7c982605 | ||
|
|
25d358cf01 | ||
|
|
4000fcc3d7 | ||
|
|
fcfc6c3fe8 | ||
|
|
76fb5060c1 | ||
|
|
1bf6364b97 | ||
|
|
40764534a2 | ||
|
|
cb47e01823 | ||
|
|
a939945148 | ||
|
|
b4466ec981 | ||
|
|
f7d5a0a017 | ||
|
|
6e598f8527 | ||
|
|
0cadaefc09 | ||
|
|
2141ca5273 | ||
|
|
108255cbbb | ||
|
|
3fec37a9c1 | ||
|
|
c3be00f0ec | ||
|
|
6ea679eb07 | ||
|
|
51d28af8fa | ||
|
|
5661fbbab9 | ||
|
|
6e021c8272 | ||
|
|
00e79dfb22 | ||
|
|
4cdcf00dca | ||
|
|
723510f9aa | ||
|
|
9686f8b34d | ||
|
|
4c47c76ecf | ||
|
|
4045339e4c | ||
|
|
a9f74cbf6e | ||
|
|
371a422567 | ||
|
|
7f60924390 | ||
|
|
dda39a0f05 | ||
|
|
4d854e66b8 | ||
|
|
57c202e015 | ||
|
|
bd79e20c66 | ||
|
|
35b2c6ece4 | ||
|
|
e382e6872c | ||
|
|
4e1a2555be | ||
|
|
7ec3174a33 | ||
|
|
c9e89f49b0 | ||
|
|
aa6cd74c03 | ||
|
|
ea10fa4a79 | ||
|
|
692e93a91f | ||
|
|
bee287927c | ||
|
|
0caf75f839 | ||
|
|
d7510efc16 | ||
|
|
aa6ee44a7a | ||
|
|
7c90c7c497 | ||
|
|
2f083acbed | ||
|
|
38c1ddb52a | ||
|
|
46b4b0b8d5 | ||
|
|
d0e808f44c | ||
|
|
e454fef40e |
No files matched your search
@@ -16,6 +16,12 @@ 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)
|
||||
|
||||
@@ -40,7 +40,7 @@ How To (Plugin Developers)
|
||||
<dependency>
|
||||
<groupId>io.papermc.paper</groupId>
|
||||
<artifactId>paper-api</artifactId>
|
||||
<version>1.21.6-R0.1-SNAPSHOT</version>
|
||||
<version>1.21.8-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
```
|
||||
@@ -53,7 +53,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.6-R0.1-SNAPSHOT")
|
||||
compileOnly("io.papermc.paper:paper-api:1.21.8-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
java {
|
||||
|
||||
@@ -5,10 +5,3 @@
|
||||
# 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
|
||||
#
|
||||
@@ -104,6 +104,9 @@ 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
|
||||
@@ -185,6 +188,7 @@ 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
|
||||
@@ -251,6 +255,7 @@ 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
|
||||
@@ -270,6 +275,7 @@ 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
|
||||
@@ -506,6 +512,8 @@ 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
|
||||
|
||||
+5
-5
@@ -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.17" apply false
|
||||
id("io.papermc.paperweight.core") version "2.0.0-beta.18" apply false
|
||||
}
|
||||
|
||||
subprojects {
|
||||
@@ -24,19 +24,19 @@ subprojects {
|
||||
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
|
||||
|
||||
subprojects {
|
||||
tasks.withType<JavaCompile> {
|
||||
tasks.withType<JavaCompile>().configureEach {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
options.release = 21
|
||||
options.isFork = true
|
||||
options.compilerArgs.addAll(listOf("-Xlint:-deprecation", "-Xlint:-removal"))
|
||||
}
|
||||
tasks.withType<Javadoc> {
|
||||
tasks.withType<Javadoc>().configureEach {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks.withType<ProcessResources> {
|
||||
tasks.withType<ProcessResources>().configureEach {
|
||||
filteringCharset = Charsets.UTF_8.name()
|
||||
}
|
||||
tasks.withType<Test> {
|
||||
tasks.withType<Test>().configureEach {
|
||||
testLogging {
|
||||
showStackTraces = true
|
||||
exceptionFormat = TestExceptionFormat.FULL
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
group=io.papermc.paper
|
||||
version=1.21.6-R0.1-SNAPSHOT
|
||||
mcVersion=1.21.6
|
||||
version=1.21.8-R0.1-SNAPSHOT
|
||||
mcVersion=1.21.8
|
||||
|
||||
# Set to true while updating Minecraft version
|
||||
updatingMinecraft=false
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -11,7 +11,7 @@ java {
|
||||
|
||||
val annotationsVersion = "26.0.2"
|
||||
// Keep in sync with paper-server adventure-text-serializer-ansi dep
|
||||
val adventureVersion = "4.21.0"
|
||||
val adventureVersion = "4.24.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
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
implementation("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
implementation("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> {
|
||||
tasks.withType<Javadoc>().configureEach {
|
||||
val options = options as StandardJavadocDocletOptions
|
||||
options.overview = "src/main/javadoc/overview.html"
|
||||
options.use()
|
||||
|
||||
@@ -68,7 +68,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public interface VanillaGoal<T extends Mob> extends Goal<T> {
|
||||
GoalKey<AbstractHorse> HORSE_RANDOM_STAND = create("horse_random_stand", AbstractHorse.class);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class AttributeKeys {
|
||||
/**
|
||||
* {@code minecraft:armor}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class BannerPatternKeys {
|
||||
/**
|
||||
* {@code minecraft:base}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class BiomeKeys {
|
||||
/**
|
||||
* {@code minecraft:badlands}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class BlockTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:acacia_button}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class CatVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:all_black}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class ChickenVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:cold}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class CowVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:cold}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class DamageTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:arrow}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class DataComponentTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:attribute_modifiers}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
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.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class EnchantmentKeys {
|
||||
/**
|
||||
* {@code minecraft:aqua_affinity}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class FluidKeys {
|
||||
/**
|
||||
* {@code minecraft:empty}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class FrogVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:cold}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class GameEventKeys {
|
||||
/**
|
||||
* {@code minecraft:block_activate}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class InstrumentKeys {
|
||||
/**
|
||||
* {@code minecraft:admire_goat_horn}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class ItemTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:acacia_boat}
|
||||
@@ -5604,6 +5604,13 @@ public final class ItemTypeKeys {
|
||||
*/
|
||||
public static final TypedKey<ItemType> 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<ItemType> MUSIC_DISC_LAVA_CHICKEN = create(key("music_disc_lava_chicken"));
|
||||
|
||||
/**
|
||||
* {@code minecraft:music_disc_mall}
|
||||
*
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class JukeboxSongKeys {
|
||||
/**
|
||||
* {@code minecraft:11}
|
||||
@@ -88,6 +88,13 @@ 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}
|
||||
*
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class MapDecorationTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:banner_black}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class MenuTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:anvil}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class MobEffectKeys {
|
||||
/**
|
||||
* {@code minecraft:absorption}
|
||||
|
||||
+8
-1
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class PaintingVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:alban}
|
||||
@@ -123,6 +123,13 @@ 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.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class PigVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:cold}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class SoundEventKeys {
|
||||
/**
|
||||
* {@code minecraft:ambient.basalt_deltas.additions}
|
||||
@@ -11946,6 +11946,13 @@ 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}
|
||||
*
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class StructureKeys {
|
||||
/**
|
||||
* {@code minecraft:ancient_city}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class StructureTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:buried_treasure}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class TrimMaterialKeys {
|
||||
/**
|
||||
* {@code minecraft:amethyst}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class TrimPatternKeys {
|
||||
/**
|
||||
* {@code minecraft:bolt}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class VillagerProfessionKeys {
|
||||
/**
|
||||
* {@code minecraft:armorer}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class VillagerTypeKeys {
|
||||
/**
|
||||
* {@code minecraft:desert}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class WolfSoundVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:angry}
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class WolfVariantKeys {
|
||||
/**
|
||||
* {@code minecraft:ashen}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class BannerPatternTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:no_item_required}
|
||||
@@ -113,7 +111,6 @@ 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,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class BiomeTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:allows_surface_slime_spawns}
|
||||
@@ -540,7 +538,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class BlockTypeTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:acacia_logs}
|
||||
@@ -1394,7 +1392,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class DamageTypeTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:always_hurts_ender_dragons}
|
||||
@@ -267,7 +265,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -25,8 +25,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class EnchantmentTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:curse}
|
||||
@@ -317,7 +316,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class EntityTypeTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:aquatic}
|
||||
@@ -309,7 +307,6 @@ 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,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class FluidTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:lava}
|
||||
@@ -50,7 +48,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class GameEventTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:allay_can_listen}
|
||||
@@ -71,7 +69,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class InstrumentTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:goat_horns}
|
||||
@@ -57,7 +55,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class ItemTypeTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:acacia_logs}
|
||||
@@ -1289,7 +1287,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class PaintingVariantTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:placeable}
|
||||
@@ -43,7 +41,6 @@ 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);
|
||||
}
|
||||
|
||||
+1
-4
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -24,8 +23,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
"SpellCheckingInspection"
|
||||
})
|
||||
@NullMarked
|
||||
@GeneratedFrom("1.21.6")
|
||||
@ApiStatus.Experimental
|
||||
@GeneratedFrom("1.21.8")
|
||||
public final class StructureTagKeys {
|
||||
/**
|
||||
* {@code #minecraft:cats_spawn_as_black}
|
||||
@@ -176,7 +174,6 @@ 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,18 +6,17 @@ 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;
|
||||
@@ -94,7 +93,8 @@ public class MaterialSetTag extends BaseTag<Material, MaterialSetTag> {
|
||||
return isTagged(item.getType());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTagged(@NotNull Material material) {
|
||||
return this.tagged.contains(material);
|
||||
return super.isTagged(material);
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
package com.destroystokyo.paper;
|
||||
|
||||
import java.util.Objects;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
import org.bukkit.Tag;
|
||||
@@ -38,19 +39,32 @@ import org.bukkit.Tag;
|
||||
public class MaterialTags {
|
||||
|
||||
private static NamespacedKey keyFor(String key) {
|
||||
//noinspection deprecation
|
||||
return new NamespacedKey("paper", key + "_settag");
|
||||
}
|
||||
public static final MaterialSetTag ARROWS = new MaterialSetTag(keyFor("arrows"))
|
||||
.endsWith("ARROW")
|
||||
.ensureSize("ARROWS", 3).lock();
|
||||
|
||||
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);
|
||||
|
||||
/**
|
||||
* Covers all colors of beds.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#BEDS}
|
||||
*/
|
||||
public static final MaterialSetTag BEDS = new MaterialSetTag(keyFor("beds"))
|
||||
.endsWith("_BED")
|
||||
.ensureSize("BEDS", 16).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag BEDS = replacedBy(Tag.BEDS);
|
||||
|
||||
/**
|
||||
* Covers all bucket items.
|
||||
@@ -61,9 +75,11 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers coal and charcoal.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_COALS}
|
||||
*/
|
||||
public static final MaterialSetTag COALS = new MaterialSetTag(keyFor("coals"))
|
||||
.add(Material.COAL, Material.CHARCOAL).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag COALS = replacedBy(Tag.ITEMS_COALS);
|
||||
|
||||
/**
|
||||
* Covers both cobblestone wall variants.
|
||||
@@ -87,10 +103,11 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers all colors of concrete powder.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#CONCRETE_POWDER}
|
||||
*/
|
||||
public static final MaterialSetTag CONCRETE_POWDER = new MaterialSetTag(keyFor("concrete_powder"))
|
||||
.endsWith("_CONCRETE_POWDER")
|
||||
.ensureSize("CONCRETE_POWDER", 16).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag CONCRETE_POWDER = replacedBy(Tag.CONCRETE_POWDER);
|
||||
|
||||
/**
|
||||
* Covers the two types of cooked fish.
|
||||
@@ -100,10 +117,11 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers all variants of doors.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#DOORS}
|
||||
*/
|
||||
public static final MaterialSetTag DOORS = new MaterialSetTag(keyFor("doors"))
|
||||
.endsWith("_DOOR")
|
||||
.ensureSize("DOORS", 21).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag DOORS = replacedBy(Tag.DOORS);
|
||||
|
||||
/**
|
||||
* Covers all dyes.
|
||||
@@ -114,17 +132,19 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers all variants of gates.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#FENCE_GATES}
|
||||
*/
|
||||
public static final MaterialSetTag FENCE_GATES = new MaterialSetTag(keyFor("fence_gates"))
|
||||
.endsWith("_GATE")
|
||||
.ensureSize("FENCE_GATES", 12).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag FENCE_GATES = replacedBy(Tag.FENCE_GATES);
|
||||
|
||||
/**
|
||||
* Covers all variants of fences.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#FENCES}
|
||||
*/
|
||||
public static final MaterialSetTag FENCES = new MaterialSetTag(keyFor("fences"))
|
||||
.endsWith("_FENCE")
|
||||
.ensureSize("FENCES", 13).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag FENCES = replacedBy(Tag.FENCES);
|
||||
|
||||
/**
|
||||
* Covers all variants of fish buckets.
|
||||
@@ -133,7 +153,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 glass (not panes).
|
||||
* Covers the non-colored glass and 16 stained glasses (not panes).
|
||||
*/
|
||||
public static final MaterialSetTag GLASS = new MaterialSetTag(keyFor("glass"))
|
||||
.endsWith("_GLASS")
|
||||
@@ -214,10 +234,11 @@ public class MaterialTags {
|
||||
/**
|
||||
* Covers all ores.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static final MaterialSetTag ORES = new MaterialSetTag(keyFor("ores"))
|
||||
.add(Material.ANCIENT_DEBRIS)
|
||||
.endsWith("_ORE")
|
||||
.ensureSize("ORES", 19).lock();
|
||||
.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();
|
||||
|
||||
/**
|
||||
* Covers all piston typed items and blocks including the piston head and moving piston.
|
||||
@@ -235,10 +256,11 @@ 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}
|
||||
*/
|
||||
public static final MaterialSetTag PRESSURE_PLATES = new MaterialSetTag(keyFor("pressure_plates"))
|
||||
.endsWith("_PRESSURE_PLATE")
|
||||
.ensureSize("PRESSURE_PLATES", 16).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag PRESSURE_PLATES = replacedBy(Tag.PRESSURE_PLATES);
|
||||
|
||||
/**
|
||||
* Covers the variants of prismarine blocks.
|
||||
@@ -298,10 +320,11 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers the non-colored and colored shulker boxes.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#SHULKER_BOXES}
|
||||
*/
|
||||
public static final MaterialSetTag SHULKER_BOXES = new MaterialSetTag(keyFor("shulker_boxes"))
|
||||
.endsWith("SHULKER_BOX")
|
||||
.ensureSize("SHULKER_BOXES", 17).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag SHULKER_BOXES = replacedBy(Tag.SHULKER_BOXES);
|
||||
|
||||
/**
|
||||
* Covers zombie, creeper, skeleton, dragon, and player heads.
|
||||
@@ -335,43 +358,43 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers all variants of trapdoors.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#TRAPDOORS}
|
||||
*/
|
||||
public static final MaterialSetTag TRAPDOORS = new MaterialSetTag(keyFor("trapdoors"))
|
||||
.endsWith("_TRAPDOOR")
|
||||
.ensureSize("TRAPDOORS", 21).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag TRAPDOORS = replacedBy(Tag.TRAPDOORS);
|
||||
|
||||
/**
|
||||
* Covers all wood variants of doors.
|
||||
*
|
||||
* @deprecated in favour of {@link 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();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag WOODEN_DOORS = replacedBy(Tag.WOODEN_DOORS);
|
||||
|
||||
/**
|
||||
* Covers all wood variants of fences.
|
||||
*
|
||||
* @deprecated in favour of {@link 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();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag WOODEN_FENCES = replacedBy(Tag.WOODEN_FENCES);
|
||||
|
||||
/**
|
||||
* Covers all wood variants of trapdoors.
|
||||
*
|
||||
* @deprecated in favour of {@link 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();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag WOODEN_TRAPDOORS = replacedBy(Tag.WOODEN_TRAPDOORS);
|
||||
|
||||
/**
|
||||
* Covers the wood variants of gates.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#FENCE_GATES}
|
||||
*/
|
||||
public static final MaterialSetTag WOODEN_GATES = new MaterialSetTag(keyFor("wooden_gates"))
|
||||
.endsWith("_GATE")
|
||||
.ensureSize("WOODEN_GATES", 12).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag WOODEN_GATES = replacedBy(Tag.FENCE_GATES, "wooden_gates");
|
||||
|
||||
/**
|
||||
* Covers the variants of purpur.
|
||||
@@ -382,10 +405,11 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers the variants of signs.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ALL_SIGNS}
|
||||
*/
|
||||
public static final MaterialSetTag SIGNS = new MaterialSetTag(keyFor("signs"))
|
||||
.endsWith("_SIGN")
|
||||
.ensureSize("SIGNS", 48).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag SIGNS = replacedBy(Tag.ALL_SIGNS, "signs");
|
||||
|
||||
/**
|
||||
* Covers the variants of a regular torch.
|
||||
@@ -424,96 +448,113 @@ public class MaterialTags {
|
||||
|
||||
/**
|
||||
* Covers the variants of rails.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#RAILS}
|
||||
*/
|
||||
public static final MaterialSetTag RAILS = new MaterialSetTag(keyFor("rails"))
|
||||
.endsWith("RAIL")
|
||||
.ensureSize("RAILS", 4).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag RAILS = replacedBy(Tag.RAILS);
|
||||
|
||||
/**
|
||||
* Covers the variants of swords.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_SWORDS}
|
||||
*/
|
||||
public static final MaterialSetTag SWORDS = new MaterialSetTag(keyFor("swords"))
|
||||
.endsWith("_SWORD")
|
||||
.ensureSize("SWORDS", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag SWORDS = replacedBy(Tag.ITEMS_SWORDS);
|
||||
|
||||
/**
|
||||
* Covers the variants of shovels.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_SHOVELS}
|
||||
*/
|
||||
public static final MaterialSetTag SHOVELS = new MaterialSetTag(keyFor("shovels"))
|
||||
.endsWith("_SHOVEL")
|
||||
.ensureSize("SHOVELS", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag SHOVELS = replacedBy(Tag.ITEMS_SHOVELS);
|
||||
|
||||
/**
|
||||
* Covers the variants of pickaxes.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_PICKAXES}
|
||||
*/
|
||||
public static final MaterialSetTag PICKAXES = new MaterialSetTag(keyFor("pickaxes"))
|
||||
.endsWith("_PICKAXE")
|
||||
.ensureSize("PICKAXES", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag PICKAXES = replacedBy(Tag.ITEMS_PICKAXES);
|
||||
|
||||
/**
|
||||
* Covers the variants of axes.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_AXES}
|
||||
*/
|
||||
public static final MaterialSetTag AXES = new MaterialSetTag(keyFor("axes"))
|
||||
.endsWith("_AXE")
|
||||
.ensureSize("AXES", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag AXES = replacedBy(Tag.ITEMS_AXES);
|
||||
|
||||
/**
|
||||
* Covers the variants of hoes.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_HOES}
|
||||
*/
|
||||
public static final MaterialSetTag HOES = new MaterialSetTag(keyFor("hoes"))
|
||||
.endsWith("_HOE")
|
||||
.ensureSize("HOES", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag HOES = replacedBy(Tag.ITEMS_HOES);
|
||||
|
||||
/**
|
||||
* Covers the variants of helmets.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_HEAD_ARMOR}
|
||||
*/
|
||||
public static final MaterialSetTag HELMETS = new MaterialSetTag(keyFor("helmets"))
|
||||
.endsWith("_HELMET")
|
||||
.ensureSize("HELMETS", 7).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag HELMETS = replacedBy(Tag.ITEMS_HEAD_ARMOR, "helmets");
|
||||
|
||||
/**
|
||||
* 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"))
|
||||
.endsWith("_HELMET")
|
||||
.add(SKULLS)
|
||||
.add(Material.CARVED_PUMPKIN)
|
||||
.ensureSize("HEAD_EQUIPPABLE", 22).lock();
|
||||
.add(Tag.ITEMS_HEAD_ARMOR, Tag.ITEMS_SKULLS)
|
||||
.add(Material.CARVED_PUMPKIN).lock();
|
||||
|
||||
/**
|
||||
* Covers the variants of chestplate.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_CHEST_ARMOR}
|
||||
*/
|
||||
public static final MaterialSetTag CHESTPLATES = new MaterialSetTag(keyFor("chestplates"))
|
||||
.endsWith("_CHESTPLATE")
|
||||
.ensureSize("CHESTPLATES", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag CHESTPLATES = replacedBy(Tag.ITEMS_CHEST_ARMOR, "chestplates");
|
||||
|
||||
/**
|
||||
* 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"))
|
||||
.endsWith("_CHESTPLATE")
|
||||
.add(Material.ELYTRA)
|
||||
.ensureSize("CHEST_EQUIPPABLE", 7).lock();
|
||||
.add(Tag.ITEMS_CHEST_ARMOR)
|
||||
.add(Material.ELYTRA).lock();
|
||||
|
||||
/**
|
||||
* Covers the variants of leggings.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_LEG_ARMOR}
|
||||
*/
|
||||
public static final MaterialSetTag LEGGINGS = new MaterialSetTag(keyFor("leggings"))
|
||||
.endsWith("_LEGGINGS")
|
||||
.ensureSize("LEGGINGS", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag LEGGINGS = replacedBy(Tag.ITEMS_LEG_ARMOR, "leggings");
|
||||
|
||||
/**
|
||||
* Covers the variants of boots.
|
||||
*
|
||||
* @deprecated in favour of {@link Tag#ITEMS_FOOT_ARMOR}
|
||||
*/
|
||||
public static final MaterialSetTag BOOTS = new MaterialSetTag(keyFor("boots"))
|
||||
.endsWith("_BOOTS")
|
||||
.ensureSize("BOOTS", 6).lock();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag BOOTS = replacedBy(Tag.ITEMS_FOOT_ARMOR, "boots");
|
||||
|
||||
/**
|
||||
* Covers all variants of armor.
|
||||
*/
|
||||
public static final MaterialSetTag ARMOR = new MaterialSetTag(keyFor("armor")).add(HELMETS, CHESTPLATES, LEGGINGS, BOOTS)
|
||||
.ensureSize("ARMOR", 25).lock();
|
||||
@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();
|
||||
|
||||
/**
|
||||
* Covers the variants of bows.
|
||||
@@ -521,21 +562,27 @@ public class MaterialTags {
|
||||
public static final MaterialSetTag BOWS = new MaterialSetTag(keyFor("bows"))
|
||||
.add(Material.BOW)
|
||||
.add(Material.CROSSBOW)
|
||||
.ensureSize("BOWS", 2).lock();
|
||||
.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(Material.EGG, Material.SNOWBALL, Material.SPLASH_POTION, Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET).lock();
|
||||
.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();
|
||||
|
||||
/**
|
||||
* Covers materials that can be colored, such as wool, shulker boxes, stained glass etc.
|
||||
* Covers materials that can be colored, such as wool, shulker boxes, stained glasses etc.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static final MaterialSetTag COLORABLE = new MaterialSetTag(keyFor("colorable"))
|
||||
.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
|
||||
.add(Tag.WOOL, Tag.WOOL_CARPETS, Tag.SHULKER_BOXES, Tag.BEDS)
|
||||
.add(STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES)
|
||||
.lock();
|
||||
|
||||
/**
|
||||
* Covers the variants of coral.
|
||||
@@ -561,15 +608,11 @@ 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
|
||||
*/
|
||||
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();
|
||||
@Deprecated(since = "1.21.8")
|
||||
public static final MaterialSetTag ENCHANTABLE = replacedBy(Tag.ITEMS_ENCHANTABLE_VANISHING, "enchantable"); // this tag already cover the others
|
||||
|
||||
/**
|
||||
* Covers the variants of raw ores.
|
||||
|
||||
-3
@@ -9,7 +9,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -19,10 +18,8 @@ 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 {
|
||||
|
||||
+1
-1
@@ -477,7 +477,7 @@ public class PaperServerListPingEvent extends ServerListPingEvent implements Can
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.profile.@NotNull PlayerProfile clone() {
|
||||
public @NotNull PlayerProfile clone() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@@ -243,4 +243,12 @@ public interface PlayerProfile extends org.bukkit.profile.PlayerProfile {
|
||||
default boolean hasTextures() {
|
||||
return this.hasProperty("textures");
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*
|
||||
* @return the cloned player profile.
|
||||
*/
|
||||
@Override
|
||||
PlayerProfile clone();
|
||||
}
|
||||
@@ -4,15 +4,12 @@ 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 {
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -21,8 +20,6 @@ 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 {
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -60,8 +59,6 @@ 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 {
|
||||
|
||||
|
||||
+6
-4
@@ -1,16 +1,15 @@
|
||||
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> {
|
||||
|
||||
@@ -20,6 +19,9 @@ public interface MessageComponentSerializer extends ComponentSerializer<Componen
|
||||
* @return serializer instance
|
||||
*/
|
||||
static MessageComponentSerializer message() {
|
||||
return MessageComponentSerializerHolder.PROVIDER.orElseThrow();
|
||||
final class Holder {
|
||||
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class, MessageComponentSerializer.class.getClassLoader()).findFirst();
|
||||
}
|
||||
return Holder.PROVIDER.orElseThrow();
|
||||
}
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
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();
|
||||
}
|
||||
+79
-3
@@ -1,10 +1,14 @@
|
||||
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;
|
||||
@@ -13,11 +17,14 @@ 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;
|
||||
@@ -29,7 +36,6 @@ 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;
|
||||
|
||||
@@ -41,8 +47,6 @@ 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 {
|
||||
|
||||
/**
|
||||
@@ -104,6 +108,26 @@ 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.
|
||||
*
|
||||
@@ -124,6 +148,28 @@ 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.
|
||||
*
|
||||
@@ -133,6 +179,27 @@ 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.
|
||||
@@ -171,6 +238,15 @@ public final class ArgumentTypes {
|
||||
return provider().namedColor();
|
||||
}
|
||||
|
||||
/**
|
||||
* A hex color argument.
|
||||
*
|
||||
* @return argument
|
||||
*/
|
||||
public static ArgumentType<TextColor> hexColor() {
|
||||
return provider().hexColor();
|
||||
}
|
||||
|
||||
/**
|
||||
* A component argument.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
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> {
|
||||
|
||||
}
|
||||
-4
@@ -9,7 +9,6 @@ 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.
|
||||
@@ -23,8 +22,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @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> {
|
||||
|
||||
/**
|
||||
@@ -107,7 +104,6 @@ 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
|
||||
|
||||
-2
@@ -3,12 +3,10 @@ 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 {
|
||||
|
||||
/**
|
||||
|
||||
-4
@@ -6,15 +6,12 @@ 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 {
|
||||
|
||||
@@ -38,5 +35,4 @@ public interface SignedMessageResolver {
|
||||
* @throws CommandSyntaxException syntax exception
|
||||
*/
|
||||
CompletableFuture<SignedMessage> resolveSignedMessage(String argumentName, CommandContext<CommandSourceStack> context) throws CommandSyntaxException;
|
||||
|
||||
}
|
||||
+20
-4
@@ -1,10 +1,14 @@
|
||||
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;
|
||||
@@ -15,11 +19,14 @@ 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;
|
||||
@@ -31,14 +38,11 @@ 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)
|
||||
.findFirst();
|
||||
Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class, VanillaArgumentProvider.class.getClassLoader()).findFirst();
|
||||
|
||||
static VanillaArgumentProvider provider() {
|
||||
return PROVIDER.orElseThrow();
|
||||
@@ -55,19 +59,31 @@ 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();
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Arguments.
|
||||
*/
|
||||
@NullMarked
|
||||
package io.papermc.paper.command.brigadier.argument;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
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());
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
-1
@@ -9,7 +9,6 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#itemPredicate()
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface ItemStackPredicate extends Predicate<ItemStack> {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Predicates for argument types.
|
||||
*/
|
||||
@NullMarked
|
||||
package io.papermc.paper.command.brigadier.argument.predicate;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
-2
@@ -7,8 +7,6 @@ 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> {
|
||||
|
||||
}
|
||||
-2
@@ -7,8 +7,6 @@ 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> {
|
||||
|
||||
}
|
||||
-4
@@ -1,8 +1,6 @@
|
||||
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
|
||||
@@ -10,8 +8,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <T>
|
||||
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
public sealed interface RangeProvider<T extends Comparable<?>> permits DoubleRangeProvider, IntegerRangeProvider {
|
||||
|
||||
/**
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Range providers.
|
||||
*/
|
||||
@NullMarked
|
||||
package io.papermc.paper.command.brigadier.argument.range;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
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
@@ -3,7 +3,6 @@ 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
|
||||
@@ -12,8 +11,6 @@ import org.jspecify.annotations.NullMarked;
|
||||
* @param <T> resolved type
|
||||
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface ArgumentResolver<T> {
|
||||
|
||||
|
||||
-1
@@ -10,7 +10,6 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#blockPosition()
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface BlockPositionResolver extends ArgumentResolver<BlockPosition> {
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
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> {
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
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> {
|
||||
}
|
||||
-1
@@ -11,7 +11,6 @@ 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> {
|
||||
}
|
||||
-1
@@ -11,7 +11,6 @@ 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>> {
|
||||
}
|
||||
-1
@@ -10,7 +10,6 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
*
|
||||
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#rotation()
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface RotationResolver extends ArgumentResolver<Rotation> {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Argument resolvers.
|
||||
*/
|
||||
@NullMarked
|
||||
package io.papermc.paper.command.brigadier.argument.resolvers;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
-1
@@ -13,7 +13,6 @@ 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>> {
|
||||
}
|
||||
-1
@@ -13,7 +13,6 @@ 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>> {
|
||||
}
|
||||
-1
@@ -11,7 +11,6 @@ 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> {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Entity selector argument resolvers.
|
||||
*/
|
||||
@NullMarked
|
||||
package io.papermc.paper.command.brigadier.argument.resolvers.selector;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Brigadier connection API.
|
||||
*/
|
||||
@NullMarked
|
||||
package io.papermc.paper.command.brigadier;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@@ -0,0 +1,46 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.destroystokyo.paper.ClientOption;
|
||||
import org.bukkit.ServerLinks;
|
||||
import org.bukkit.plugin.messaging.PluginMessageRecipient;
|
||||
|
||||
/**
|
||||
* Represents a connection that has properties shared between the GAME and CONFIG stage.
|
||||
*/
|
||||
public interface PlayerCommonConnection extends WritablePlayerCookieConnection, ReadablePlayerCookieConnection, PluginMessageRecipient {
|
||||
|
||||
/**
|
||||
* Sends data to appear in this connection's report logs.
|
||||
* This is useful for debugging server state that may be causing
|
||||
* player disconnects.
|
||||
* <p>
|
||||
* These are formatted as key - value, where keys are limited to a length of 128 characters,
|
||||
* values are limited to 4096, and 32 maximum entries can be sent.
|
||||
*
|
||||
* @param details report details
|
||||
*/
|
||||
void sendReportDetails(Map<String, String> details);
|
||||
|
||||
/**
|
||||
* Sends the given server links to this connection.
|
||||
*
|
||||
* @param links links to send
|
||||
*/
|
||||
void sendLinks(ServerLinks links);
|
||||
|
||||
/**
|
||||
* Transfers this connection to another server.
|
||||
*
|
||||
* @param host host
|
||||
* @param port port
|
||||
*/
|
||||
void transfer(String host, int port);
|
||||
|
||||
/**
|
||||
* @param type client option
|
||||
* @return the client option value of the player
|
||||
*/
|
||||
<T> T getClientOption(ClientOption<T> type);
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import com.destroystokyo.paper.ClientOption;
|
||||
import com.destroystokyo.paper.profile.PlayerProfile;
|
||||
import net.kyori.adventure.audience.Audience;
|
||||
|
||||
public interface PlayerConfigurationConnection extends PlayerCommonConnection {
|
||||
|
||||
/**
|
||||
* Returns the audience representing the player in configuration mode.
|
||||
* This can be used to interact with the Adventure API during the configuration stage.
|
||||
* This is guaranteed to be an instance of {@link PlayerConfigurationConnection}
|
||||
*
|
||||
* @return the configuring player audience
|
||||
*/
|
||||
Audience getAudience();
|
||||
|
||||
/**
|
||||
* Gets the profile for this connection.
|
||||
*
|
||||
* @return profile
|
||||
*/
|
||||
PlayerProfile getProfile();
|
||||
|
||||
/**
|
||||
* Clears the players chat history and their local chat.
|
||||
*/
|
||||
void clearChat();
|
||||
|
||||
/**
|
||||
* Completes the configuration for this player, which will cause this player to reenter the game.
|
||||
* <p>
|
||||
* Note, this should be only be called if you are reconfiguring the player.
|
||||
*/
|
||||
void completeReconfiguration();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.SocketAddress;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
public interface PlayerConnection {
|
||||
|
||||
/**
|
||||
* Disconnects the player connection.
|
||||
* <p>
|
||||
* Note that calling this during connection related events may caused undefined behavior.
|
||||
*
|
||||
* @param component disconnect reason
|
||||
*/
|
||||
void disconnect(Component component);
|
||||
|
||||
/**
|
||||
* Gets if this connection originated from a transferred connection.
|
||||
* <p>
|
||||
* Do note that this is sent and stored on the client.
|
||||
*
|
||||
* @return is transferred
|
||||
*/
|
||||
boolean isTransferred();
|
||||
|
||||
/**
|
||||
* Gets the raw remote address of the connection. This may be a proxy address
|
||||
* or a Unix domain socket address, depending on how the channel was established.
|
||||
*
|
||||
* @return the remote {@link SocketAddress} of the channel
|
||||
*/
|
||||
SocketAddress getAddress();
|
||||
|
||||
/**
|
||||
* Gets the real client address of the player. If the connection is behind a proxy,
|
||||
* this will be the actual player’s IP address extracted from the proxy handshake.
|
||||
*
|
||||
* @return the client {@link InetSocketAddress}
|
||||
*/
|
||||
InetSocketAddress getClientAddress();
|
||||
|
||||
/**
|
||||
* Returns the virtual host the client is connected to.
|
||||
*
|
||||
* <p>The virtual host refers to the hostname/port the client used to
|
||||
* connect to the server.</p>
|
||||
*
|
||||
* @return The client's virtual host, or {@code null} if unknown
|
||||
*/
|
||||
@Nullable InetSocketAddress getVirtualHost();
|
||||
|
||||
/**
|
||||
* Gets the socket address of this player's proxy
|
||||
*
|
||||
* @return the player's proxy address, null if the server doesn't have Proxy Protocol enabled, or the player didn't connect to an HAProxy instance
|
||||
*/
|
||||
@Nullable InetSocketAddress getHAProxyAddress();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface PlayerGameConnection extends PlayerCommonConnection {
|
||||
|
||||
/**
|
||||
* Bumps the player to the configuration stage.
|
||||
* <p>
|
||||
* This will, by default, cause the player to stay until their connection is released by
|
||||
* {@link PlayerConfigurationConnection#completeReconfiguration()}
|
||||
*/
|
||||
void reenterConfiguration();
|
||||
|
||||
/**
|
||||
* Gets the player that is associated with this game connection.
|
||||
*
|
||||
* @return player
|
||||
*/
|
||||
Player getPlayer();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import com.destroystokyo.paper.profile.PlayerProfile;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
public interface PlayerLoginConnection extends ReadablePlayerCookieConnection {
|
||||
|
||||
/**
|
||||
* Gets the authenticated profile for this connection.
|
||||
* This may return null depending on what stage this connection is at.
|
||||
*
|
||||
* @return authenticated profile, or null if not present
|
||||
*/
|
||||
@Nullable PlayerProfile getAuthenticatedProfile();
|
||||
|
||||
/**
|
||||
* Gets the player profile that this connection is requesting to authenticate as.
|
||||
*
|
||||
* @return the unsafe unauthenticated profile, or null if not sent
|
||||
*/
|
||||
@Nullable
|
||||
PlayerProfile getUnsafeProfile();
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import org.bukkit.NamespacedKey;
|
||||
|
||||
public interface ReadablePlayerCookieConnection extends PlayerConnection {
|
||||
|
||||
/**
|
||||
* Retrieves a cookie from this connection.
|
||||
*
|
||||
* @param key the key identifying the cookie
|
||||
* @return a {@link CompletableFuture} that will be completed when the
|
||||
* Cookie response is received or otherwise available. If the cookie is not
|
||||
* set in the client, the {@link CompletableFuture} will complete with a
|
||||
* null value.
|
||||
*/
|
||||
CompletableFuture<byte[]> retrieveCookie(NamespacedKey key);
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import org.bukkit.NamespacedKey;
|
||||
|
||||
public interface WritablePlayerCookieConnection extends PlayerConnection {
|
||||
|
||||
/**
|
||||
* Stores a cookie in this player's client.
|
||||
*
|
||||
* @param key the key identifying the cookie
|
||||
* @param value the data to store in the cookie
|
||||
* @throws IllegalStateException if a cookie cannot be stored at this time
|
||||
*/
|
||||
void storeCookie(NamespacedKey key, byte[] value);
|
||||
}
|
||||
Loaded 100 of 706 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user