Compare commits

..
Author SHA1 Message Date
Owen1212055 daa4fe5fb5 Use hasImpulse vs hurtMarked for setVelocity
This will prevent projectiles from using the less accurate path for updating motion when interfaced with the API. However, hasImpulse is the more proper way of marking that the entity needs its velocity updated anyways.

This seems to be fairly unused logic in vanilla
2025-06-23 22:39:41 -04:00
Owen1212055 068a1ccda1 Improve AbstractHurtingProjectile syncing
I am sure this has been reported before but I cannot search for any bugs due to Mojang's new bug tracker.

Projectiles at high velocities very obviously go off track from their original course when sent to the client. This is due to the aggressive downsizing of velocity when sent over the client, and these entities typically have large velocity and still work just fine. We workaround this by sending the velocity for these entities exactly by using a teleport packet with relative flags and zero positional data. This prevents any possible position syncing, but sends an accurate velocity.

Then, we properly send the ClientboundProjectilePowerPacket on the first tick the entity is created, as vanilla only updates this when the delta is updated typically.
2025-06-23 22:36:49 -04:00
Owen1212055 10c7914592 Remove move this.update() usages
These can be removed as these values can now be updated on the client through synched values, additionally remove the extra bit that triggered redstone on rotation update which is not vanilla behavior.
2025-06-23 22:28:24 -04:00
Owen1212055 c2e1beaec8 Fix MC-297817
This issue causes the item frame to move on the client erroneously, so we force the entity to resend its position the next tick.

This utilizes a moonrise patch which has a resync flag that can be triggered for the next tick, so we just utilize this. I stub out the method to ensure that it still compiles without the feature patch.
2025-06-23 22:27:17 -04:00
600 changed files with 32905 additions and 8262 deletions

No files matched your search

-6
View File
@@ -16,12 +16,6 @@ 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)
+2 -2
View File
@@ -40,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.21.7-R0.1-SNAPSHOT</version>
<version>1.21.6-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@@ -53,7 +53,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.7-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.21.6-R0.1-SNAPSHOT")
}
java {
-3
View File
@@ -104,9 +104,6 @@ public net.minecraft.server.level.ServerPlayer wardenSpawnTracker
public net.minecraft.server.level.ServerPlayer$RespawnPosAngle
public net.minecraft.server.level.ServerPlayerGameMode level
public net.minecraft.server.level.TicketType register(Ljava/lang/String;JZLnet/minecraft/server/level/TicketType$TicketUse;)Lnet/minecraft/server/level/TicketType;
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl clientInformation
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl currentTask
public net.minecraft.server.network.ServerConfigurationPacketListenerImpl finishCurrentTask(Lnet/minecraft/server/network/ConfigurationTask$Type;)V
public net.minecraft.server.network.ServerGamePacketListenerImpl isChatMessageIllegal(Ljava/lang/String;)Z
public net.minecraft.server.network.ServerLoginPacketListenerImpl authenticatedProfile
public net.minecraft.server.network.ServerLoginPacketListenerImpl connection
+5 -5
View File
@@ -2,7 +2,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id("io.papermc.paperweight.core") version "2.0.0-beta.18" apply false
id("io.papermc.paperweight.core") version "2.0.0-beta.17" apply false
}
subprojects {
@@ -24,19 +24,19 @@ subprojects {
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile>().configureEach {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release = 21
options.isFork = true
options.compilerArgs.addAll(listOf("-Xlint:-deprecation", "-Xlint:-removal"))
}
tasks.withType<Javadoc>().configureEach {
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources>().configureEach {
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test>().configureEach {
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
+2 -2
View File
@@ -1,6 +1,6 @@
group=io.papermc.paper
version=1.21.7-R0.1-SNAPSHOT
mcVersion=1.21.7
version=1.21.6-R0.1-SNAPSHOT
mcVersion=1.21.6
# Set to true while updating Minecraft version
updatingMinecraft=false
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+2 -2
View File
@@ -11,7 +11,7 @@ java {
val annotationsVersion = "26.0.2"
// Keep in sync with paper-server adventure-text-serializer-ansi dep
val adventureVersion = "4.23.0"
val adventureVersion = "4.21.0"
val bungeeCordChatVersion = "1.21-R0.2-deprecated+build.21"
val slf4jVersion = "2.0.16"
val log4jVersion = "2.24.1"
@@ -164,7 +164,7 @@ abstract class Services {
}
val services = objects.newInstance<Services>()
tasks.withType<Javadoc>().configureEach {
tasks.withType<Javadoc> {
val options = options as StandardJavadocDocletOptions
options.overview = "src/main/javadoc/overview.html"
options.use()
@@ -68,7 +68,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
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.7")
@GeneratedFrom("1.21.6")
public final class AttributeKeys {
/**
* {@code minecraft:armor}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class BannerPatternKeys {
/**
* {@code minecraft:base}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class BiomeKeys {
/**
* {@code minecraft:badlands}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class BlockTypeKeys {
/**
* {@code minecraft:acacia_button}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class CatVariantKeys {
/**
* {@code minecraft:all_black}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class ChickenVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class CowVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class DamageTypeKeys {
/**
* {@code minecraft:arrow}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class DataComponentTypeKeys {
/**
* {@code minecraft:attribute_modifiers}
@@ -1,61 +0,0 @@
package io.papermc.paper.registry.keys;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import net.kyori.adventure.key.Key;
import org.jspecify.annotations.NullMarked;
/**
* Vanilla keys for {@link RegistryKey#DIALOG}.
*
* @apiNote The fields provided here are a direct representation of
* what is available from the vanilla game source. They may be
* changed (including removals) on any Minecraft version
* bump, so cross-version compatibility is not provided on the
* same level as it is on most of the other API.
*/
@SuppressWarnings({
"unused",
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.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.7")
@GeneratedFrom("1.21.6")
public final class EnchantmentKeys {
/**
* {@code minecraft:aqua_affinity}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class FluidKeys {
/**
* {@code minecraft:empty}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class FrogVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class GameEventKeys {
/**
* {@code minecraft:block_activate}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class InstrumentKeys {
/**
* {@code minecraft:admire_goat_horn}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class ItemTypeKeys {
/**
* {@code minecraft:acacia_boat}
@@ -5604,13 +5604,6 @@ 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.7")
@GeneratedFrom("1.21.6")
public final class JukeboxSongKeys {
/**
* {@code minecraft:11}
@@ -88,13 +88,6 @@ public final class JukeboxSongKeys {
*/
public static final TypedKey<JukeboxSong> FAR = create(key("far"));
/**
* {@code minecraft:lava_chicken}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<JukeboxSong> LAVA_CHICKEN = create(key("lava_chicken"));
/**
* {@code minecraft:mall}
*
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class MapDecorationTypeKeys {
/**
* {@code minecraft:banner_black}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class MenuTypeKeys {
/**
* {@code minecraft:anvil}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class MobEffectKeys {
/**
* {@code minecraft:absorption}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class PaintingVariantKeys {
/**
* {@code minecraft:alban}
@@ -123,13 +123,6 @@ public final class PaintingVariantKeys {
*/
public static final TypedKey<Art> CREEBET = create(key("creebet"));
/**
* {@code minecraft:dennis}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Art> DENNIS = create(key("dennis"));
/**
* {@code minecraft:donkey_kong}
*
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class PigVariantKeys {
/**
* {@code minecraft:cold}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class SoundEventKeys {
/**
* {@code minecraft:ambient.basalt_deltas.additions}
@@ -11946,13 +11946,6 @@ public final class SoundEventKeys {
*/
public static final TypedKey<Sound> MUSIC_DISC_FAR = create(key("music_disc.far"));
/**
* {@code minecraft:music_disc.lava_chicken}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<Sound> MUSIC_DISC_LAVA_CHICKEN = create(key("music_disc.lava_chicken"));
/**
* {@code minecraft:music_disc.mall}
*
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class StructureKeys {
/**
* {@code minecraft:ancient_city}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class StructureTypeKeys {
/**
* {@code minecraft:buried_treasure}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class TrimMaterialKeys {
/**
* {@code minecraft:amethyst}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class VillagerProfessionKeys {
/**
* {@code minecraft:armorer}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class VillagerTypeKeys {
/**
* {@code minecraft:desert}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class WolfSoundVariantKeys {
/**
* {@code minecraft:angry}
@@ -23,7 +23,7 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
public final class WolfVariantKeys {
/**
* {@code minecraft:ashen}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.banner.PatternType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class BannerPatternTagKeys {
/**
* {@code #minecraft:no_item_required}
@@ -111,6 +113,7 @@ public final class BannerPatternTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<PatternType> create(final Key key) {
return TagKey.create(RegistryKey.BANNER_PATTERN, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.Biome;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class BiomeTagKeys {
/**
* {@code #minecraft:allows_surface_slime_spawns}
@@ -538,6 +540,7 @@ public final class BiomeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Biome> create(final Key key) {
return TagKey.create(RegistryKey.BIOME, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.block.BlockType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class BlockTypeTagKeys {
/**
* {@code #minecraft:acacia_logs}
@@ -1392,6 +1394,7 @@ public final class BlockTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<BlockType> create(final Key key) {
return TagKey.create(RegistryKey.BLOCK, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.damage.DamageType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class DamageTypeTagKeys {
/**
* {@code #minecraft:always_hurts_ender_dragons}
@@ -265,6 +267,7 @@ public final class DamageTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<DamageType> create(final Key key) {
return TagKey.create(RegistryKey.DAMAGE_TYPE, key);
}
@@ -1,57 +0,0 @@
package io.papermc.paper.registry.keys.tags;
import static net.kyori.adventure.key.Key.key;
import io.papermc.paper.dialog.Dialog;
import io.papermc.paper.generated.GeneratedFrom;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.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);
}
}
@@ -25,7 +25,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class EnchantmentTagKeys {
/**
* {@code #minecraft:curse}
@@ -316,6 +317,7 @@ public final class EnchantmentTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Enchantment> create(final Key key) {
return TagKey.create(RegistryKey.ENCHANTMENT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.entity.EntityType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class EntityTypeTagKeys {
/**
* {@code #minecraft:aquatic}
@@ -307,6 +309,7 @@ public final class EntityTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<EntityType> create(final Key key) {
return TagKey.create(RegistryKey.ENTITY_TYPE, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Fluid;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class FluidTagKeys {
/**
* {@code #minecraft:lava}
@@ -48,6 +50,7 @@ public final class FluidTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Fluid> create(final Key key) {
return TagKey.create(RegistryKey.FLUID, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.GameEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class GameEventTagKeys {
/**
* {@code #minecraft:allay_can_listen}
@@ -69,6 +71,7 @@ public final class GameEventTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<GameEvent> create(final Key key) {
return TagKey.create(RegistryKey.GAME_EVENT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.MusicInstrument;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class InstrumentTagKeys {
/**
* {@code #minecraft:goat_horns}
@@ -55,6 +57,7 @@ public final class InstrumentTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<MusicInstrument> create(final Key key) {
return TagKey.create(RegistryKey.INSTRUMENT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.inventory.ItemType;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class ItemTypeTagKeys {
/**
* {@code #minecraft:acacia_logs}
@@ -1287,6 +1289,7 @@ public final class ItemTypeTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<ItemType> create(final Key key) {
return TagKey.create(RegistryKey.ITEM, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.Art;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class PaintingVariantTagKeys {
/**
* {@code #minecraft:placeable}
@@ -41,6 +43,7 @@ public final class PaintingVariantTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Art> create(final Key key) {
return TagKey.create(RegistryKey.PAINTING_VARIANT, key);
}
@@ -7,6 +7,7 @@ import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.tag.TagKey;
import net.kyori.adventure.key.Key;
import org.bukkit.generator.structure.Structure;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
@@ -23,7 +24,8 @@ import org.jspecify.annotations.NullMarked;
"SpellCheckingInspection"
})
@NullMarked
@GeneratedFrom("1.21.7")
@GeneratedFrom("1.21.6")
@ApiStatus.Experimental
public final class StructureTagKeys {
/**
* {@code #minecraft:cats_spawn_as_black}
@@ -174,6 +176,7 @@ public final class StructureTagKeys {
* @param key the tag key's key
* @return a new tag key
*/
@ApiStatus.Experimental
public static TagKey<Structure> create(final Key key) {
return TagKey.create(RegistryKey.STRUCTURE, key);
}
@@ -9,6 +9,7 @@ import org.bukkit.command.Command;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.server.ServerEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
/**
@@ -18,8 +19,10 @@ import org.jetbrains.annotations.NotNull;
* This is done at Plugin Enable time after commands have been registered, but may also
* run at a later point in the server lifetime due to plugins, a server reload, etc.</p>
*
* <p>This is a draft/experimental API and is subject to change.</p>
* @deprecated For removal, use the new brigadier api.
*/
@ApiStatus.Experimental
@Deprecated(since = "1.20.6")
@Warning(reason = "This event has been superseded by the Commands API and will be removed in a future release. Listen to LifecycleEvents.COMMANDS instead.", value = true)
public class CommandRegisteredEvent<S extends com.destroystokyo.paper.brigadier.BukkitBrigadierCommandSource> extends ServerEvent implements Cancellable {
@@ -4,12 +4,15 @@ import java.util.Collection;
import java.util.Collections;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
* Implementing this interface allows for easily creating "Bukkit-style" {@code String[] args} commands.
* The implementation handles converting the command to a representation compatible with Brigadier on registration, usually in the form of {@literal /commandlabel <greedy_string>}.
*/
@ApiStatus.Experimental
@NullMarked
@FunctionalInterface
public interface BasicCommand {
@@ -6,6 +6,7 @@ import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
@@ -20,6 +21,8 @@ import org.jspecify.annotations.Nullable;
* exist yet, or no specific sender is available. Methods on such a {@link CommandSender}
* will either have no effect or throw an {@link UnsupportedOperationException}.</p>
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface CommandSourceStack {
@@ -17,6 +17,7 @@ import java.util.Set;
import java.util.function.Predicate;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Unmodifiable;
import org.jspecify.annotations.NullMarked;
import org.jspecify.annotations.Nullable;
/**
@@ -59,6 +60,8 @@ import org.jspecify.annotations.Nullable;
*
* @see io.papermc.paper.plugin.lifecycle.event.types.LifecycleEvents#COMMANDS
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface Commands extends Registrar {
@@ -1,15 +1,16 @@
package io.papermc.paper.command.brigadier;
import com.mojang.brigadier.Message;
import java.util.Optional;
import java.util.ServiceLoader;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.ComponentSerializer;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A component serializer for converting between {@link Message} and {@link Component}.
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface MessageComponentSerializer extends ComponentSerializer<Component, Component, Message> {
@@ -19,9 +20,6 @@ public interface MessageComponentSerializer extends ComponentSerializer<Componen
* @return serializer instance
*/
static MessageComponentSerializer message() {
final class Holder {
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class, MessageComponentSerializer.class.getClassLoader()).findFirst();
}
return Holder.PROVIDER.orElseThrow();
return MessageComponentSerializerHolder.PROVIDER.orElseThrow();
}
}
@@ -0,0 +1,12 @@
package io.papermc.paper.command.brigadier;
import java.util.Optional;
import java.util.ServiceLoader;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
final class MessageComponentSerializerHolder {
static final Optional<MessageComponentSerializer> PROVIDER = ServiceLoader.load(MessageComponentSerializer.class)
.findFirst();
}
@@ -18,7 +18,6 @@ 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;
@@ -29,6 +28,8 @@ 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;
@@ -40,6 +41,8 @@ import static io.papermc.paper.command.brigadier.argument.VanillaArgumentProvide
*
* <p>{@link CustomArgumentType} is provided for customizing parsing or result types server-side, while sending the vanilla argument type to the client.</p>
*/
@ApiStatus.Experimental
@NullMarked
public final class ArgumentTypes {
/**
@@ -168,15 +171,6 @@ public final class ArgumentTypes {
return provider().namedColor();
}
/**
* A hex color argument.
*
* @return argument
*/
public static ArgumentType<TextColor> hexColor() {
return provider().hexColor();
}
/**
* A component argument.
*
@@ -9,6 +9,7 @@ import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* An argument type that wraps around a native-to-vanilla argument type.
@@ -22,6 +23,8 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/
@ApiStatus.Experimental
@NullMarked
public interface CustomArgumentType<T, N> extends ArgumentType<T> {
/**
@@ -104,6 +107,7 @@ public interface CustomArgumentType<T, N> extends ArgumentType<T> {
* @param <T> custom type
* @param <N> type with an argument native to vanilla Minecraft (from {@link ArgumentTypes})
*/
@ApiStatus.Experimental
interface Converted<T, N> extends CustomArgumentType<T, N> {
@ApiStatus.NonExtendable
@@ -3,10 +3,12 @@ package io.papermc.paper.command.brigadier.argument;
import com.mojang.brigadier.context.CommandContext;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import org.jspecify.annotations.NullMarked;
/**
* Utilities for extracting registry-related arguments from a {@link CommandContext}.
*/
@NullMarked
public final class RegistryArgumentExtractor {
/**
@@ -6,12 +6,15 @@ import io.papermc.paper.command.brigadier.CommandSourceStack;
import java.util.concurrent.CompletableFuture;
import net.kyori.adventure.chat.SignedMessage;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A resolver for a {@link SignedMessage}
*
* @see ArgumentTypes#signedMessage()
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface SignedMessageResolver {
@@ -35,4 +38,5 @@ public interface SignedMessageResolver {
* @throws CommandSyntaxException syntax exception
*/
CompletableFuture<SignedMessage> resolveSignedMessage(String argumentName, CommandContext<CommandSourceStack> context) throws CommandSyntaxException;
}
@@ -20,7 +20,6 @@ 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;
@@ -32,11 +31,14 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scoreboard.Criteria;
import org.bukkit.scoreboard.DisplaySlot;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
@NullMarked
interface VanillaArgumentProvider {
Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class, VanillaArgumentProvider.class.getClassLoader()).findFirst();
Optional<VanillaArgumentProvider> PROVIDER = ServiceLoader.load(VanillaArgumentProvider.class)
.findFirst();
static VanillaArgumentProvider provider() {
return PROVIDER.orElseThrow();
@@ -66,8 +68,6 @@ interface VanillaArgumentProvider {
ArgumentType<NamedTextColor> namedColor();
ArgumentType<TextColor> hexColor();
ArgumentType<Component> component();
ArgumentType<Style> style();
@@ -1,7 +0,0 @@
/**
* Arguments.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument;
import org.jspecify.annotations.NullMarked;
@@ -9,6 +9,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#itemPredicate()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemStackPredicate extends Predicate<ItemStack> {
}
@@ -1,7 +0,0 @@
/**
* Predicates for argument types.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.predicate;
import org.jspecify.annotations.NullMarked;
@@ -7,6 +7,8 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#doubleRange()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public non-sealed interface DoubleRangeProvider extends RangeProvider<Double> {
}
@@ -7,6 +7,8 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#integerRange()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public non-sealed interface IntegerRangeProvider extends RangeProvider<Integer> {
}
@@ -1,6 +1,8 @@
package io.papermc.paper.command.brigadier.argument.range;
import com.google.common.collect.Range;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* A provider for a range of numbers
@@ -8,6 +10,8 @@ import com.google.common.collect.Range;
* @param <T>
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/
@ApiStatus.Experimental
@NullMarked
public sealed interface RangeProvider<T extends Comparable<?>> permits DoubleRangeProvider, IntegerRangeProvider {
/**
@@ -1,7 +0,0 @@
/**
* Range providers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.range;
import org.jspecify.annotations.NullMarked;
@@ -3,6 +3,7 @@ package io.papermc.paper.command.brigadier.argument.resolvers;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import io.papermc.paper.command.brigadier.CommandSourceStack;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* An {@link ArgumentResolver} is capable of resolving
@@ -11,6 +12,8 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> resolved type
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes
*/
@ApiStatus.Experimental
@NullMarked
@ApiStatus.NonExtendable
public interface ArgumentResolver<T> {
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#blockPosition()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface BlockPositionResolver extends ArgumentResolver<BlockPosition> {
}
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#finePosition(boolean)
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface FinePositionResolver extends ArgumentResolver<FinePosition> {
}
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#playerProfiles()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface PlayerProfileListResolver extends ArgumentResolver<Collection<PlayerProfile>> {
}
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.ApiStatus;
*
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#rotation()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface RotationResolver extends ArgumentResolver<Rotation> {
}
@@ -1,7 +0,0 @@
/**
* Argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers;
import org.jspecify.annotations.NullMarked;
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entity()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#entities()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface EntitySelectorArgumentResolver extends SelectorArgumentResolver<List<Entity>> {
}
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.ApiStatus;
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#player()
* @see io.papermc.paper.command.brigadier.argument.ArgumentTypes#players()
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface PlayerSelectorArgumentResolver extends SelectorArgumentResolver<List<Player>> {
}
@@ -11,6 +11,7 @@ import org.jetbrains.annotations.ApiStatus;
* @param <T> resolved type
* @see <a href="https://minecraft.wiki/w/Target_selectors">Target Selectors</a>
*/
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface SelectorArgumentResolver<T> extends ArgumentResolver<T> {
}
@@ -1,7 +0,0 @@
/**
* Entity selector argument resolvers.
*/
@NullMarked
package io.papermc.paper.command.brigadier.argument.resolvers.selector;
import org.jspecify.annotations.NullMarked;
@@ -1,7 +0,0 @@
/**
* Brigadier connection API.
*/
@NullMarked
package io.papermc.paper.command.brigadier;
import org.jspecify.annotations.NullMarked;
@@ -1,45 +0,0 @@
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);
}
@@ -1,37 +0,0 @@
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();
}
@@ -1,60 +0,0 @@
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();
}
@@ -1,21 +0,0 @@
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();
}
@@ -1,23 +0,0 @@
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();
}
@@ -1,18 +0,0 @@
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);
}
@@ -1,15 +0,0 @@
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);
}
@@ -1,9 +0,0 @@
/**
* 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,6 +15,7 @@ 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.
*
@@ -24,7 +24,7 @@ import org.jspecify.annotations.Nullable;
@ApiStatus.Internal
interface ItemComponentTypesBridge {
Optional<ItemComponentTypesBridge> BRIDGE = ServiceLoader.load(ItemComponentTypesBridge.class, ItemComponentTypesBridge.class.getClassLoader()).findFirst();
Optional<ItemComponentTypesBridge> BRIDGE = ServiceLoader.load(ItemComponentTypesBridge.class).findFirst();
static ItemComponentTypesBridge bridge() {
return BRIDGE.orElseThrow();
@@ -10,7 +10,7 @@ import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
interface AttributeModifierDisplayBridge {
Optional<AttributeModifierDisplayBridge> BRIDGE = ServiceLoader.load(AttributeModifierDisplayBridge.class, AttributeModifierDisplayBridge.class.getClassLoader()).findFirst();
Optional<AttributeModifierDisplayBridge> BRIDGE = ServiceLoader.load(AttributeModifierDisplayBridge.class).findFirst();
static AttributeModifierDisplayBridge bridge() {
return BRIDGE.orElseThrow();
@@ -9,7 +9,7 @@ import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
interface BlocksAttacksBridge {
Optional<BlocksAttacksBridge> BRIDGE = ServiceLoader.load(BlocksAttacksBridge.class, BlocksAttacksBridge.class.getClassLoader()).findFirst();
Optional<BlocksAttacksBridge> BRIDGE = ServiceLoader.load(BlocksAttacksBridge.class).findFirst();
static BlocksAttacksBridge bridge() {
return BRIDGE.orElseThrow();
@@ -14,7 +14,7 @@ import org.jspecify.annotations.NullMarked;
@ApiStatus.Internal
interface ConsumableTypesBridge {
Optional<ConsumableTypesBridge> BRIDGE = ServiceLoader.load(ConsumableTypesBridge.class, ConsumableTypesBridge.class.getClassLoader()).findFirst();
Optional<ConsumableTypesBridge> BRIDGE = ServiceLoader.load(ConsumableTypesBridge.class).findFirst();
static ConsumableTypesBridge bridge() {
return BRIDGE.orElseThrow();
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Experimental
public enum ItemUseAnimation {
// Start generate - ItemUseAnimation
// @GeneratedFrom 1.21.7
// @GeneratedFrom 1.21.6
NONE,
EAT,
DRINK,
@@ -1,47 +0,0 @@
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));
}
}
@@ -1,52 +0,0 @@
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);
}
@@ -1,7 +0,0 @@
/**
* This package contains classes and interfaces related to the dialog system in Paper.
*/
@NullMarked
package io.papermc.paper.dialog;
import org.jspecify.annotations.NullMarked;
@@ -1,86 +0,0 @@
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;
}
}
@@ -1,39 +0,0 @@
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 600 files, more files were not shown because too many files have changed in this diff. Show more