mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-04 17:00:09 -05:00
Compare commits
61
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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.7-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.7-R0.1-SNAPSHOT")
|
||||
}
|
||||
|
||||
java {
|
||||
|
||||
@@ -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
|
||||
|
||||
+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.7-R0.1-SNAPSHOT
|
||||
mcVersion=1.21.7
|
||||
|
||||
# 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.23.0"
|
||||
val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
|
||||
val slf4jVersion = "2.0.16"
|
||||
val log4jVersion = "2.24.1"
|
||||
@@ -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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7-rc2")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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,57 @@
|
||||
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.jetbrains.annotations.ApiStatus;
|
||||
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.7-rc2")
|
||||
@ApiStatus.Experimental
|
||||
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
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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.7")
|
||||
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);
|
||||
}
|
||||
|
||||
-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 {
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
+10
-4
@@ -18,6 +18,7 @@ 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.GameMode;
|
||||
import org.bukkit.HeightMap;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@@ -28,8 +29,6 @@ import org.bukkit.block.structure.StructureRotation;
|
||||
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 +40,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 {
|
||||
|
||||
/**
|
||||
@@ -171,6 +168,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.
|
||||
*
|
||||
|
||||
-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;
|
||||
|
||||
}
|
||||
+4
-4
@@ -20,6 +20,7 @@ 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.GameMode;
|
||||
import org.bukkit.HeightMap;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@@ -31,14 +32,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();
|
||||
@@ -68,6 +66,8 @@ interface VanillaArgumentProvider {
|
||||
|
||||
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;
|
||||
-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;
|
||||
-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> {
|
||||
}
|
||||
-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,45 @@
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.destroystokyo.paper.ClientOption;
|
||||
import org.bukkit.ServerLinks;
|
||||
|
||||
/**
|
||||
* Represents a connection that has properties shared between the GAME and CONFIG stage.
|
||||
*/
|
||||
public interface PlayerCommonConnection extends WritablePlayerCookieConnection, ReadablePlayerCookieConnection {
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* This package contains events related to player connections, such as joining and leaving the server.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@NullMarked
|
||||
package io.papermc.paper.connection;
|
||||
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
@@ -15,7 +15,6 @@ import org.jspecify.annotations.Nullable;
|
||||
@NullMarked
|
||||
@ApiStatus.NonExtendable
|
||||
public interface DataComponentView {
|
||||
// Paper start - data component API
|
||||
/**
|
||||
* Gets the value for the data component type on this stack.
|
||||
*
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ import org.jspecify.annotations.Nullable;
|
||||
@ApiStatus.Internal
|
||||
interface ItemComponentTypesBridge {
|
||||
|
||||
Optional<ItemComponentTypesBridge> BRIDGE = ServiceLoader.load(ItemComponentTypesBridge.class).findFirst();
|
||||
Optional<ItemComponentTypesBridge> BRIDGE = ServiceLoader.load(ItemComponentTypesBridge.class, ItemComponentTypesBridge.class.getClassLoader()).findFirst();
|
||||
|
||||
static ItemComponentTypesBridge bridge() {
|
||||
return BRIDGE.orElseThrow();
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
@ApiStatus.Internal
|
||||
interface AttributeModifierDisplayBridge {
|
||||
|
||||
Optional<AttributeModifierDisplayBridge> BRIDGE = ServiceLoader.load(AttributeModifierDisplayBridge.class).findFirst();
|
||||
Optional<AttributeModifierDisplayBridge> BRIDGE = ServiceLoader.load(AttributeModifierDisplayBridge.class, AttributeModifierDisplayBridge.class.getClassLoader()).findFirst();
|
||||
|
||||
static AttributeModifierDisplayBridge bridge() {
|
||||
return BRIDGE.orElseThrow();
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
@ApiStatus.Internal
|
||||
interface BlocksAttacksBridge {
|
||||
|
||||
Optional<BlocksAttacksBridge> BRIDGE = ServiceLoader.load(BlocksAttacksBridge.class).findFirst();
|
||||
Optional<BlocksAttacksBridge> BRIDGE = ServiceLoader.load(BlocksAttacksBridge.class, BlocksAttacksBridge.class.getClassLoader()).findFirst();
|
||||
|
||||
static BlocksAttacksBridge bridge() {
|
||||
return BRIDGE.orElseThrow();
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ import org.jspecify.annotations.NullMarked;
|
||||
@ApiStatus.Internal
|
||||
interface ConsumableTypesBridge {
|
||||
|
||||
Optional<ConsumableTypesBridge> BRIDGE = ServiceLoader.load(ConsumableTypesBridge.class).findFirst();
|
||||
Optional<ConsumableTypesBridge> BRIDGE = ServiceLoader.load(ConsumableTypesBridge.class, ConsumableTypesBridge.class.getClassLoader()).findFirst();
|
||||
|
||||
static ConsumableTypesBridge bridge() {
|
||||
return BRIDGE.orElseThrow();
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.ApiStatus;
|
||||
@ApiStatus.Experimental
|
||||
public enum ItemUseAnimation {
|
||||
// Start generate - ItemUseAnimation
|
||||
// @GeneratedFrom 1.21.6
|
||||
// @GeneratedFrom 1.21.7
|
||||
NONE,
|
||||
EAT,
|
||||
DRINK,
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package io.papermc.paper.dialog;
|
||||
|
||||
import io.papermc.paper.registry.RegistryAccess;
|
||||
import io.papermc.paper.registry.RegistryBuilderFactory;
|
||||
import io.papermc.paper.registry.RegistryKey;
|
||||
import io.papermc.paper.registry.data.InlinedRegistryBuilderProvider;
|
||||
import io.papermc.paper.registry.data.dialog.DialogRegistryEntry;
|
||||
import java.util.function.Consumer;
|
||||
import net.kyori.adventure.dialog.DialogLike;
|
||||
import net.kyori.adventure.key.Key;
|
||||
import net.kyori.adventure.key.KeyPattern;
|
||||
import org.bukkit.Keyed;
|
||||
import org.bukkit.Registry;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* Represents a dialog. Can be created during normal server operation via {@link #create(Consumer)}.
|
||||
* Can also be created during bootstrap via {@link io.papermc.paper.registry.event.RegistryEvents#DIALOG}.
|
||||
*/
|
||||
@ApiStatus.NonExtendable
|
||||
public interface Dialog extends Keyed, DialogLike {
|
||||
|
||||
/**
|
||||
* Creates a new dialog using the provided builder.
|
||||
*
|
||||
* @param value the builder to use for creating the dialog
|
||||
* @return a new dialog instance
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
static Dialog create(final Consumer<RegistryBuilderFactory<Dialog, ? extends DialogRegistryEntry.Builder>> value) {
|
||||
return InlinedRegistryBuilderProvider.instance().createDialog(value);
|
||||
}
|
||||
|
||||
// Start generate - Dialog
|
||||
// @GeneratedFrom 1.21.7-rc2
|
||||
Dialog CUSTOM_OPTIONS = getDialog("custom_options");
|
||||
|
||||
Dialog QUICK_ACTIONS = getDialog("quick_actions");
|
||||
|
||||
Dialog SERVER_LINKS = getDialog("server_links");
|
||||
// End generate - Dialog
|
||||
|
||||
private static Dialog getDialog(@KeyPattern.Value final String value) {
|
||||
final Registry<Dialog> registry = RegistryAccess.registryAccess().getRegistry(RegistryKey.DIALOG);
|
||||
return registry.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, value));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package io.papermc.paper.dialog;
|
||||
|
||||
import net.kyori.adventure.nbt.api.BinaryTagHolder;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* A view for a possible response to a dialog.
|
||||
* There are no guarantees that this is an actual response to a
|
||||
* dialog form. It is on the plugin to validate that the response
|
||||
* is valid.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
@ApiStatus.NonExtendable
|
||||
public interface DialogResponseView {
|
||||
|
||||
/**
|
||||
* Gets the raw payload of the response.
|
||||
*
|
||||
* @return the raw payload
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
BinaryTagHolder payload();
|
||||
|
||||
/**
|
||||
* Gets a text value at a key.
|
||||
*
|
||||
* @param key the key
|
||||
* @return the value (or null if it doesn't exist)
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@Nullable String getText(String key);
|
||||
|
||||
/**
|
||||
* Gets a boolean value at a key.
|
||||
*
|
||||
* @param key the key
|
||||
* @return the value (or null if it doesn't exist)
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@Nullable Boolean getBoolean(String key);
|
||||
|
||||
/**
|
||||
* Gets a float value at a key.
|
||||
*
|
||||
* @param key the key
|
||||
* @return the value (or null if it doesn't exist)
|
||||
*/
|
||||
@Contract(pure = true)
|
||||
@Nullable Float getFloat(String key);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* This package contains classes and interfaces related to the dialog system in Paper.
|
||||
*/
|
||||
@NullMarked
|
||||
package io.papermc.paper.dialog;
|
||||
|
||||
import org.jspecify.annotations.NullMarked;
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
package io.papermc.paper.event.connection;
|
||||
|
||||
import io.papermc.paper.connection.PlayerConnection;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jspecify.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Validates whether a player connection is able to log in.
|
||||
* <p>
|
||||
* Called when is attempting to log in for the first time, or is finishing up
|
||||
* being configured.
|
||||
*/
|
||||
public class PlayerConnectionValidateLoginEvent extends Event {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
private final PlayerConnection connection;
|
||||
private @Nullable Component kickMessage;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public PlayerConnectionValidateLoginEvent(final PlayerConnection connection, final @Nullable Component kickMessage) {
|
||||
super(false);
|
||||
this.connection = connection;
|
||||
this.kickMessage = kickMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the connection of the player in this event.
|
||||
* Note, the type of this connection is not guaranteed to be stable across versions.
|
||||
* Additionally, disconnecting the player through this connection / using any methods that may send packets
|
||||
* is not supported.
|
||||
*
|
||||
* @return connection
|
||||
*/
|
||||
public PlayerConnection getConnection() {
|
||||
return this.connection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows the player to log in.
|
||||
* This skips any login validation checks.
|
||||
*/
|
||||
public void allow() {
|
||||
this.kickMessage = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disallows the player from logging in, with the given reason
|
||||
*
|
||||
* @param message Kick message to display to the user
|
||||
*/
|
||||
public void kickMessage(final Component message) {
|
||||
this.kickMessage = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the reason for why a player is not allowed to join the server.
|
||||
* This will be null in the case that the player is allowed to log in.
|
||||
*
|
||||
* @return disallow reason
|
||||
*/
|
||||
public @Nullable Component getKickMessage() {
|
||||
return this.kickMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets if the player is allowed to enter the next stage.
|
||||
*
|
||||
* @return if allowed
|
||||
*/
|
||||
public boolean isAllowed() {
|
||||
return this.kickMessage == null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package io.papermc.paper.event.connection.configuration;
|
||||
|
||||
import io.papermc.paper.connection.PlayerConfigurationConnection;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
|
||||
/**
|
||||
* An event that allows you to configure the player.
|
||||
* This is async and allows you to run configuration code on the player.
|
||||
* Once this event has finished execution, the player connection will continue.
|
||||
* <p>
|
||||
* This occurs after configuration, but before the player has entered the world.
|
||||
*/
|
||||
public class AsyncPlayerConnectionConfigureEvent extends Event {
|
||||
|
||||
private static final HandlerList HANDLER_LIST = new HandlerList();
|
||||
|
||||
private final PlayerConfigurationConnection connection;
|
||||
|
||||
@ApiStatus.Internal
|
||||
public AsyncPlayerConnectionConfigureEvent(final PlayerConfigurationConnection connection) {
|
||||
super(true);
|
||||
this.connection = connection;
|
||||
}
|
||||
|
||||
public PlayerConfigurationConnection getConnection() {
|
||||
return this.connection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return HANDLER_LIST;
|
||||
}
|
||||
}
|
||||
Loaded 100 of 593 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user