Merge branch 'PaperMC:master' into paper-info

This commit is contained in:
masmc05 2024-04-28 17:31:08 +03:00 committed by GitHub
commit d0d5faf90b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2563 changed files with 183095 additions and 172977 deletions

View File

@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
java: [17]
java: [21]
fail-fast: true
steps:
- uses: actions/checkout@v4
@ -29,15 +29,15 @@ jobs:
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
distribution: 'zulu'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3
- name: Configure Build
uses: actions/github-script@v6
uses: actions/github-script@v7
id: determine
with:
script: |
@ -87,7 +87,7 @@ jobs:
- name: Create Paperclip Jar
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'
run: ./gradlew createReobfPaperclipJar --stacktrace
run: ./gradlew createMojmapPaperclipJar --stacktrace
- name: Upload Paperclip Jar
if: fromJSON(steps.determine.outputs.result).action == 'paperclip'

View File

@ -17,7 +17,7 @@ jobs:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
# This snippet is public-domain, taken from
# https://github.com/oprypin/nightly.link/blob/master/.github/workflows/pr-comment.yml

1
.gitignore vendored
View File

@ -61,6 +61,7 @@ out/
# other stuff
run/
logs/
Paper-Server
Paper-API

View File

@ -319,7 +319,7 @@ Subject: [PATCH] revert serverside behavior of keepalives
This patch intends to bump up the time that a client has to reply to the
server back to 30 seconds as per pre 1.12.2, which allowed clients
more than enough time to reply potentially allowing them to be less
tempermental due to lag spikes on the network thread, e.g. that caused
temperamental due to lag spikes on the network thread, e.g. that caused
by plugins that are interacting with netty.
We also add a system property to allow people to tweak how long the server

View File

@ -63,4 +63,5 @@ Ollie <69084614+olijeffers0n@users.noreply.github.com>
Oliwier Miodun <naczs@blueflow.pl>
aerulion <aerulion@gmail.com>
Lukas Planz <lukas.planz@web.de>
granny <contact@granny.dev>
```

View File

@ -17,7 +17,7 @@ dependencies {
testImplementation("junit:junit:4.13.2")
testImplementation("org.hamcrest:hamcrest-library:1.3")
testImplementation("org.ow2.asm:asm-tree:9.2")
testImplementation("org.ow2.asm:asm-tree:9.7")
}
configure<PublishingExtension> {

View File

@ -40,7 +40,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<version>1.20.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@ -53,19 +53,19 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.20.5-R0.1-SNAPSHOT")
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
```
How To (Compiling Jar From Source)
------
To compile Paper, you need JDK 17 and an internet connection.
To compile Paper, you need JDK 21 and an internet connection.
Clone this repo, run `./gradlew applyPatches`, then `./gradlew createReobfBundlerJar` from your terminal. You can find the compiled jar in the project root's `build/libs` directory.
Clone this repo, run `./gradlew applyPatches`, then `./gradlew createMojmapBundlerJar` from your terminal. You can find the compiled jar in the project root's `build/libs` directory.
To get a full list of tasks, run `./gradlew tasks`.

View File

@ -1,29 +0,0 @@
--- /dev/null 2024-01-13 10:03:30.400485704 -0800
+++ CraftBukkit-Patches/9999-re-add-asm-dependency.patch 2024-01-13 21:41:27.650692678 -0800
@@ -0,0 +1,26 @@
+From e5eb4fb3bfb61dfd2dc97411cfab5fa94033b90c Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <jake.m.potrebic@gmail.com>
+Date: Sat, 13 Jan 2024 21:41:02 -0800
+Subject: [PATCH] re add asm dependency
+
+
+diff --git a/pom.xml b/pom.xml
+index 266853a682..d18fdadf92 100644
+--- a/pom.xml
++++ b/pom.xml
+@@ -58,6 +58,12 @@
+ <version>2.19.0</version>
+ <scope>compile</scope>
+ </dependency>
++ <dependency>
++ <groupId>org.ow2.asm</groupId>
++ <artifactId>asm</artifactId>
++ <version>9.5</version>
++ <scope>compile</scope>
++ </dependency>
+ <dependency>
+ <groupId>org.ow2.asm</groupId>
+ <artifactId>asm-commons</artifactId>
+--
+2.43.0
+

View File

@ -1,3 +1,4 @@
import io.papermc.paperweight.PaperweightException
import io.papermc.paperweight.tasks.BaseTask
import io.papermc.paperweight.util.*
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
@ -10,8 +11,7 @@ import kotlin.io.path.*
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
id("io.papermc.paperweight.core") version "1.5.11"
id("io.papermc.paperweight.core") version "1.6.2"
}
allprojects {
@ -20,7 +20,7 @@ allprojects {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
}
}
}
@ -30,7 +30,7 @@ val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release = 17
options.release = 21
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
@ -49,6 +49,7 @@ subprojects {
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") // TODO - Adventure snapshot
}
}
@ -67,10 +68,10 @@ repositories {
}
dependencies {
paramMappings("net.fabricmc:yarn:1.20.4+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.8.10:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6")
paramMappings("net.fabricmc:yarn:1.20.5+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.10.2:fat")
decompiler("org.vineflower:vineflower:1.10.1")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.13")
paperclip("io.papermc:paperclip:3.0.3")
}
@ -93,8 +94,6 @@ paperweight {
mappingsPatch = layout.projectDirectory.file("build-data/mappings-patch.tiny")
reobfMappingsPatch = layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny")
spigotServerPatchPatchesDir = layout.projectDirectory.dir("build-data/spigot-server-patches")
reobfPackagesToFix.addAll(
"co.aikar.timings",
"com.destroystokyo.paper",
@ -115,7 +114,7 @@ tasks.generateDevelopmentBundle {
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
"https://s01.oss.sonatype.org/content/repositories/snapshots/", // todo Remove when updating adventure to release
"https://s01.oss.sonatype.org/content/repositories/snapshots/", // TODO - Adventure snapshot
)
}
@ -169,6 +168,7 @@ if (providers.gradleProperty("updatingMinecraft").getOrElse("false").toBoolean()
appliedPatches = file("patches/server")
unappliedPatches = file("patches/unapplied/server")
applyTaskName = "applyServerPatches"
patchedDir = "Paper-Server"
}
}
@ -186,6 +186,9 @@ abstract class RebasePatches : BaseTask() {
@get:Input
abstract val applyTaskName: Property<String>
@get:Input
abstract val patchedDir: Property<String>
private fun unapplied(): List<Path> =
unappliedPatches.path.listDirectoryEntries("*.patch").sortedBy { it.name }
@ -193,11 +196,20 @@ abstract class RebasePatches : BaseTask() {
companion object {
val regex = Pattern.compile("Patch failed at ([0-9]{4}) (.*)")
val continuationRegex = Pattern.compile("^\\s{1}.+\$")
const val subjectPrefix = "Subject: [PATCH] "
}
@TaskAction
fun run() {
val patchedDirPath = projectDir.path.resolve(patchedDir.get())
if (patchedDirPath.isDirectory()) {
val status = Git(patchedDirPath)("status").getText()
if (status.contains("You are in the middle of an am session.")) {
throw PaperweightException("Cannot continue update when $patchedDirPath is in the middle of an am session.")
}
}
val unapplied = unapplied()
for (patch in unapplied) {
patch.copyTo(appliedLoc(patch))
@ -222,8 +234,19 @@ abstract class RebasePatches : BaseTask() {
val failedSubjectFragment = matcher.group(2)
val failed = unapplied.single { p ->
p.useLines { lines ->
val subjectLine = lines.single { it.startsWith(subjectPrefix) }
.substringAfter(subjectPrefix)
val collect = mutableListOf<String>()
for (line in lines) {
if (line.startsWith(subjectPrefix)) {
collect += line
} else if (collect.size == 1) {
if (continuationRegex.matcher(line).matches()) {
collect += line
} else {
break
}
}
}
val subjectLine = collect.joinToString("").substringAfter(subjectPrefix)
subjectLine.startsWith(failedSubjectFragment)
}
}
@ -248,6 +271,8 @@ abstract class RebasePatches : BaseTask() {
}
}
// Delete the build file before resetting the AM session in case it has compilation errors
patchedDirPath.resolve("build.gradle.kts").deleteIfExists()
// Apply again to reset the am session (so it ends on the failed patch, to allow us to rebuild after fixing it)
val apply2 = ProcessBuilder()
.directory(projectDir.path)

View File

@ -1,6 +1,6 @@
group=io.papermc.paper
version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
version=1.20.5-R0.1-SNAPSHOT
mcVersion=1.20.5
# Set to true while updating Minecraft version
updatingMinecraft=false

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

20
gradlew.bat vendored
View File

@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail

View File

@ -1,29 +1,35 @@
import org.spongepowered.gradle.vanilla.repository.MinecraftPlatform
import io.papermc.paperweight.PaperweightSourceGeneratorHelper
import io.papermc.paperweight.extension.PaperweightSourceGeneratorExt
plugins {
java
id("org.spongepowered.gradle.vanilla") version "0.2.1-SNAPSHOT"
}
minecraft {
version(property("mcVersion").toString())
platform(MinecraftPlatform.SERVER)
plugins.apply(PaperweightSourceGeneratorHelper::class)
runs {
server("generate") {
mainClass("io.papermc.generator.Main")
accessWideners(projectDir.toPath().resolve("wideners.at"))
args(projectDir.toPath().resolve("generated").toString())
}
}
extensions.configure(PaperweightSourceGeneratorExt::class) {
atFile.set(projectDir.toPath().resolve("wideners.at").toFile())
}
dependencies {
implementation("com.squareup:javapoet:1.13.0")
implementation(project(":paper-api"))
implementation("io.github.classgraph:classgraph:4.8.47")
implementation("org.jetbrains:annotations:24.0.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
tasks.register<JavaExec>("generate") {
dependsOn(tasks.check)
mainClass.set("io.papermc.generator.Main")
classpath(sourceSets.main.map { it.runtimeClasspath })
args(projectDir.toPath().resolve("generated").toString())
}
tasks.test {
useJUnitPlatform()
}
group = "io.papermc.paper"
version = "1.0-SNAPSHOT"

View File

@ -70,7 +70,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.4")
@GeneratedFrom("1.20.5")
public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<AbstractHorse> RANDOM_STAND = create("random_stand", AbstractHorse.class);
@ -1122,7 +1122,8 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
)
GoalKey<Mob> UNIVERSAL_ANGER_RESET = create("universal_anger_reset", Mob.class);
private static @NotNull GoalKey create(final @NotNull String key, final @NotNull Class clazz) {
return GoalKey.of(clazz, NamespacedKey.minecraft(key));
private static <T extends Mob> @NotNull GoalKey<T> create(final @NotNull String key,
final @NotNull Class<T> type) {
return GoalKey.of(type, NamespacedKey.minecraft(key));
}
}

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.4")
@GeneratedFrom("1.20.5")
@ApiStatus.Experimental
public final class BiomeKeys {
/**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.4")
@GeneratedFrom("1.20.5")
@ApiStatus.Experimental
public final class GameEventKeys {
/**
@ -124,6 +124,13 @@ public final class GameEventKeys {
*/
public static final TypedKey<GameEvent> ELYTRA_GLIDE = create(key("elytra_glide"));
/**
* {@code minecraft:entity_action}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> ENTITY_ACTION = create(key("entity_action"));
/**
* {@code minecraft:entity_damage}
*
@ -166,13 +173,6 @@ public final class GameEventKeys {
*/
public static final TypedKey<GameEvent> ENTITY_PLACE = create(key("entity_place"));
/**
* {@code minecraft:entity_action}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> ENTITY_ACTION = create(key("entity_action"));
/**
* {@code minecraft:equip}
*
@ -285,62 +285,6 @@ public final class GameEventKeys {
*/
public static final TypedKey<GameEvent> PROJECTILE_SHOOT = create(key("projectile_shoot"));
/**
* {@code minecraft:sculk_sensor_tendrils_clicking}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SCULK_SENSOR_TENDRILS_CLICKING = create(key("sculk_sensor_tendrils_clicking"));
/**
* {@code minecraft:shear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SHEAR = create(key("shear"));
/**
* {@code minecraft:shriek}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SHRIEK = create(key("shriek"));
/**
* {@code minecraft:splash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SPLASH = create(key("splash"));
/**
* {@code minecraft:step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> STEP = create(key("step"));
/**
* {@code minecraft:swim}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SWIM = create(key("swim"));
/**
* {@code minecraft:teleport}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> TELEPORT = create(key("teleport"));
/**
* {@code minecraft:unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> UNEQUIP = create(key("unequip"));
/**
* {@code minecraft:resonate_1}
*
@ -446,6 +390,62 @@ public final class GameEventKeys {
*/
public static final TypedKey<GameEvent> RESONATE_15 = create(key("resonate_15"));
/**
* {@code minecraft:sculk_sensor_tendrils_clicking}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SCULK_SENSOR_TENDRILS_CLICKING = create(key("sculk_sensor_tendrils_clicking"));
/**
* {@code minecraft:shear}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SHEAR = create(key("shear"));
/**
* {@code minecraft:shriek}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SHRIEK = create(key("shriek"));
/**
* {@code minecraft:splash}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SPLASH = create(key("splash"));
/**
* {@code minecraft:step}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> STEP = create(key("step"));
/**
* {@code minecraft:swim}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> SWIM = create(key("swim"));
/**
* {@code minecraft:teleport}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> TELEPORT = create(key("teleport"));
/**
* {@code minecraft:unequip}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
public static final TypedKey<GameEvent> UNEQUIP = create(key("unequip"));
private GameEventKeys() {
}

View File

@ -24,7 +24,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.4")
@GeneratedFrom("1.20.5")
@ApiStatus.Experimental
public final class StructureKeys {
/**
@ -229,7 +229,7 @@ public final class StructureKeys {
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental("update 1.21")
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<Structure> TRIAL_CHAMBERS = create(key("trial_chambers"));
/**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.4")
@GeneratedFrom("1.20.5")
@ApiStatus.Experimental
public final class StructureTypeKeys {
/**

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.4")
@GeneratedFrom("1.20.5")
@ApiStatus.Experimental
public final class TrimMaterialKeys {
/**

View File

@ -6,6 +6,7 @@ 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.bukkit.MinecraftExperimental;
import org.bukkit.inventory.meta.trim.TrimPattern;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
@ -23,9 +24,18 @@ import org.jetbrains.annotations.NotNull;
"unused",
"SpellCheckingInspection"
})
@GeneratedFrom("1.20.4")
@GeneratedFrom("1.20.5")
@ApiStatus.Experimental
public final class TrimPatternKeys {
/**
* {@code minecraft:bolt}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<TrimPattern> BOLT = create(key("bolt"));
/**
* {@code minecraft:coast}
*
@ -47,6 +57,15 @@ public final class TrimPatternKeys {
*/
public static final TypedKey<TrimPattern> EYE = create(key("eye"));
/**
* {@code minecraft:flow}
*
* @apiNote This field is version-dependant and may be removed in future Minecraft versions
*/
@ApiStatus.Experimental
@MinecraftExperimental(MinecraftExperimental.Requires.UPDATE_1_21)
public static final TypedKey<TrimPattern> FLOW = create(key("flow"));
/**
* {@code minecraft:host}
*

View File

@ -1,20 +1,14 @@
package io.papermc.generator;
import com.mojang.logging.LogUtils;
import io.papermc.generator.types.GeneratedKeyType;
import io.papermc.generator.types.SourceGenerator;
import io.papermc.paper.registry.RegistryKey;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import net.minecraft.SharedConstants;
import net.minecraft.core.LayeredRegistryAccess;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.RegistryDataLoader;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.Bootstrap;
import net.minecraft.server.RegistryLayer;
import net.minecraft.server.WorldLoader;
@ -24,12 +18,6 @@ import net.minecraft.server.packs.repository.PackRepository;
import net.minecraft.server.packs.repository.ServerPacksSource;
import net.minecraft.server.packs.resources.MultiPackResourceManager;
import org.apache.commons.io.file.PathUtils;
import org.bukkit.GameEvent;
import org.bukkit.block.Biome;
import org.bukkit.generator.structure.Structure;
import org.bukkit.generator.structure.StructureType;
import org.bukkit.inventory.meta.trim.TrimMaterial;
import org.bukkit.inventory.meta.trim.TrimPattern;
import org.slf4j.Logger;
public final class Main {
@ -40,6 +28,8 @@ public final class Main {
static {
SharedConstants.tryDetectVersion();
Bootstrap.bootStrap();
Bootstrap.validate();
final PackRepository resourceRepository = ServerPacksSource.createVanillaTrustedRepository();
resourceRepository.reload();
final MultiPackResourceManager resourceManager = new MultiPackResourceManager(PackType.SERVER_DATA, resourceRepository.getAvailablePacks().stream().map(Pack::open).toList());

View File

@ -1,5 +1,6 @@
package io.papermc.generator.types;
import com.google.common.collect.Sets;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
import com.squareup.javapoet.MethodSpec;
@ -10,23 +11,26 @@ import com.squareup.javapoet.TypeSpec;
import io.papermc.generator.Main;
import io.papermc.generator.utils.Annotations;
import io.papermc.generator.utils.CollectingContext;
import io.papermc.generator.utils.Formatting;
import io.papermc.generator.utils.Javadocs;
import io.papermc.paper.registry.RegistryKey;
import io.papermc.paper.registry.TypedKey;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import net.kyori.adventure.key.Key;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistrySetBuilder;
import net.minecraft.data.registries.UpdateOneTwentyOneRegistries;
import net.minecraft.data.registries.VanillaRegistries;
import net.minecraft.resources.ResourceKey;
import org.bukkit.MinecraftExperimental;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.framework.qual.DefaultQualifier;
@ -44,6 +48,9 @@ import static javax.lang.model.element.Modifier.STATIC;
@DefaultQualifier(NonNull.class)
public class GeneratedKeyType<T, A> extends SimpleGenerator {
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> VANILLA_REGISTRY_ENTRIES = VanillaRegistries.BUILDER.entries.stream()
.collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap));
private static final Map<ResourceKey<? extends Registry<?>>, RegistrySetBuilder.RegistryBootstrap<?>> EXPERIMENTAL_REGISTRY_ENTRIES = UpdateOneTwentyOneRegistries.BUILDER.entries.stream()
.collect(Collectors.toMap(RegistrySetBuilder.RegistryStub::key, RegistrySetBuilder.RegistryStub::bootstrap));
@ -115,48 +122,57 @@ public class GeneratedKeyType<T, A> extends SimpleGenerator {
final TypeName typedKey = ParameterizedTypeName.get(TypedKey.class, this.apiType);
final TypeSpec.Builder typeBuilder = this.keyHolderType();
typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API
final MethodSpec.Builder createMethod = this.createMethod(typedKey);
final Registry<T> registry = Main.REGISTRY_ACCESS.registryOrThrow(this.registryKey);
final List<ResourceKey<T>> experimental = this.collectExperimentalKeys(registry);
final Set<ResourceKey<T>> experimental = this.collectExperimentalKeys(registry);
boolean allExperimental = true;
for (final T value : registry) {
final ResourceKey<T> key = registry.getResourceKey(value).orElseThrow();
for (final Holder.Reference<T> reference : registry.holders().sorted(Formatting.alphabeticKeyOrder(reference -> reference.key().location().getPath())).toList()) {
final ResourceKey<T> key = reference.key();
final String keyPath = key.location().getPath();
final String fieldName = keyPath.toUpperCase(Locale.ENGLISH).replaceAll("[.-/]", "_"); // replace invalid field name chars
final String fieldName = Formatting.formatKeyAsField(keyPath);
final FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL)
.initializer("$N(key($S))", createMethod.build(), keyPath)
.addJavadoc(Javadocs.getVersionDependentField("{@code $L}"), key.location().toString());
if (experimental.contains(key)) {
fieldBuilder.addAnnotations(experimentalAnnotations("update 1.21"));
fieldBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.UPDATE_1_21));
} else {
allExperimental = false;
}
typeBuilder.addField(fieldBuilder.build());
}
if (allExperimental) {
typeBuilder.addAnnotations(experimentalAnnotations("update 1.21"));
createMethod.addAnnotations(experimentalAnnotations("update 1.21"));
typeBuilder.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.UPDATE_1_21));
createMethod.addAnnotations(experimentalAnnotations(MinecraftExperimental.Requires.UPDATE_1_21));
} else {
typeBuilder.addAnnotation(EXPERIMENTAL_API_ANNOTATION); // TODO experimental API
}
return typeBuilder.addMethod(createMethod.build()).build();
}
@SuppressWarnings("unchecked")
private List<ResourceKey<T>> collectExperimentalKeys(final Registry<T> registry) {
final RegistrySetBuilder.@Nullable RegistryBootstrap<T> registryBootstrap = (RegistrySetBuilder.RegistryBootstrap<T>) EXPERIMENTAL_REGISTRY_ENTRIES.get(this.registryKey);
if (registryBootstrap == null) {
return Collections.emptyList();
private Set<ResourceKey<T>> collectExperimentalKeys(final Registry<T> registry) {
final RegistrySetBuilder.@Nullable RegistryBootstrap<T> experimentalBootstrap = (RegistrySetBuilder.RegistryBootstrap<T>) EXPERIMENTAL_REGISTRY_ENTRIES.get(this.registryKey);
if (experimentalBootstrap == null) {
return Collections.emptySet();
}
final Set<ResourceKey<T>> experimental = Collections.newSetFromMap(new IdentityHashMap<>());
final CollectingContext<T> experimentalCollector = new CollectingContext<>(experimental, registry);
experimentalBootstrap.run(experimentalCollector);
final RegistrySetBuilder.@Nullable RegistryBootstrap<T> vanillaBootstrap = (RegistrySetBuilder.RegistryBootstrap<T>) VANILLA_REGISTRY_ENTRIES.get(this.registryKey);
if (vanillaBootstrap != null) {
final Set<ResourceKey<T>> vanilla = Collections.newSetFromMap(new IdentityHashMap<>());
final CollectingContext<T> vanillaCollector = new CollectingContext<>(vanilla, registry);
vanillaBootstrap.run(vanillaCollector);
return Sets.difference(experimental, vanilla);
}
final List<ResourceKey<T>> experimental = new ArrayList<>();
final CollectingContext<T> context = new CollectingContext<>(experimental, registry);
registryBootstrap.run(context);
return experimental;
}
@Override
protected JavaFile.Builder file(JavaFile.Builder builder) {
protected JavaFile.Builder file(final JavaFile.Builder builder) {
return builder
.skipJavaLangImports(true)
.addStaticImport(Key.class, "key")

View File

@ -5,7 +5,6 @@ import com.squareup.javapoet.TypeSpec;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public abstract class SimpleGenerator implements SourceGenerator {
@ -24,14 +23,13 @@ public abstract class SimpleGenerator implements SourceGenerator {
@Override
public void writeToFile(Path parent) throws IOException {
Path packagePath = parent.resolve(this.packageName.replace('.', '/'));
Files.createDirectories(packagePath);
JavaFile.Builder builder = JavaFile.builder(this.packageName, this.getTypeSpec())
.indent(" ");
this.file(builder);
JavaFile.Builder builder = JavaFile.builder(this.packageName, this.getTypeSpec());
this.file(builder)
.indent(" ")
.skipJavaLangImports(true);
Files.writeString(packagePath.resolve(this.className + ".java"), this.file(builder).build().toString(), StandardCharsets.UTF_8);
builder.build().writeTo(parent, StandardCharsets.UTF_8);
}
}

View File

@ -2,7 +2,6 @@ package io.papermc.generator.types.goal;
import com.destroystokyo.paper.entity.RangedEntity;
import com.destroystokyo.paper.entity.ai.GoalKey;
import com.squareup.javapoet.AnnotationSpec;
import com.squareup.javapoet.ClassName;
import com.squareup.javapoet.FieldSpec;
import com.squareup.javapoet.JavaFile;
@ -19,12 +18,7 @@ import io.papermc.generator.utils.Annotations;
import io.papermc.generator.utils.Formatting;
import io.papermc.generator.utils.Javadocs;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import javax.lang.model.element.Modifier;
import net.minecraft.world.entity.ai.goal.Goal;
import net.minecraft.world.entity.ai.goal.WrappedGoal;
@ -65,9 +59,13 @@ import org.bukkit.entity.Vindicator;
import org.bukkit.entity.WanderingTrader;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.Nullable;
import static javax.lang.model.element.Modifier.FINAL;
import static javax.lang.model.element.Modifier.PRIVATE;
import static javax.lang.model.element.Modifier.PUBLIC;
import static javax.lang.model.element.Modifier.STATIC;
@DefaultQualifier(NonNull.class)
public class MobGoalGenerator extends SimpleGenerator {
@ -168,57 +166,53 @@ public class MobGoalGenerator extends SimpleGenerator {
@Override
protected TypeSpec getTypeSpec() {
TypeName clazzType = TypeName.get(Class.class)
.annotated(Annotations.NOT_NULL);
TypeName keyType = TypeName.get(String.class)
.annotated(Annotations.NOT_NULL);
MethodSpec.Builder createMethod = MethodSpec.methodBuilder("create")
.addModifiers(Modifier.PRIVATE, Modifier.STATIC)
.addParameter(ParameterSpec.builder(keyType, "key", Modifier.FINAL)
.build()
)
.addParameter(ParameterSpec.builder(clazzType, "clazz", Modifier.FINAL)
.build()
)
.addCode("return $T.of(clazz, $T.minecraft(key));", GoalKey.class, NamespacedKey.class)
.returns(ParameterizedTypeName.get(GoalKey.class).annotated(Annotations.NOT_NULL));
TypeVariableName type = TypeVariableName.get("T", Mob.class);
TypeSpec.Builder typeBuilder = TypeSpec.interfaceBuilder(this.className)
.addSuperinterface(ParameterizedTypeName.get(ClassName.get(com.destroystokyo.paper.entity.ai.Goal.class), type))
.addModifiers(Modifier.PUBLIC)
.addModifiers(PUBLIC)
.addTypeVariable(type)
.addAnnotations(Annotations.CLASS_HEADER)
.addJavadoc(CLASS_HEADER);
TypeName mobType = ParameterizedTypeName.get(ClassName.get(Class.class), type)
.annotated(Annotations.NOT_NULL);
TypeName keyType = TypeName.get(String.class)
.annotated(Annotations.NOT_NULL);
List<Class<?>> classes;
ParameterSpec keyParam = ParameterSpec.builder(keyType, "key", FINAL).build();
ParameterSpec typeParam = ParameterSpec.builder(mobType, "type", FINAL).build();
MethodSpec.Builder createMethod = MethodSpec.methodBuilder("create")
.addModifiers(PRIVATE, STATIC)
.addParameter(keyParam)
.addParameter(typeParam)
.addCode("return $T.of($N, $T.minecraft($N));", GoalKey.class, typeParam, NamespacedKey.class, keyParam)
.addTypeVariable(type)
.returns(ParameterizedTypeName.get(ClassName.get(GoalKey.class), type).annotated(Annotations.NOT_NULL));
List<Class<Goal>> classes;
try (ScanResult scanResult = new ClassGraph().enableAllInfo().whitelistPackages("net.minecraft").scan()) {
classes = scanResult.getSubclasses(net.minecraft.world.entity.ai.goal.Goal.class.getName()).loadClasses();
classes = scanResult.getSubclasses(Goal.class.getName()).loadClasses(Goal.class);
}
List<VanillaGoalKey> vanillaNames = classes.stream()
List<GoalKey<Mob>> vanillaNames = classes.stream()
.filter(clazz -> !java.lang.reflect.Modifier.isAbstract(clazz.getModifiers()))
.filter(clazz -> !WrappedGoal.class.equals(clazz)) // TODO - properly fix
.map(goalClass -> new VanillaGoalKey(goalClass, MobGoalNames.getKey(goalClass.getName(), (Class<? extends Goal>) goalClass)))
.filter((key) -> !MobGoalNames.isIgnored(key.key().getNamespacedKey().getKey()))
.sorted(Comparator.<VanillaGoalKey, String>comparing(o -> o.key().getEntityClass().getSimpleName())
.thenComparing(vanillaGoalKey -> vanillaGoalKey.key.getNamespacedKey().getKey())
.map(goalClass -> MobGoalNames.getKey(goalClass.getName(), goalClass))
.filter((key) -> !MobGoalNames.isIgnored(key.getNamespacedKey().getKey()))
.sorted(Comparator.<GoalKey<?>, String>comparing(o -> o.getEntityClass().getSimpleName())
.thenComparing(vanillaGoalKey -> vanillaGoalKey.getNamespacedKey().getKey())
)
.toList();
for (final VanillaGoalKey vanillaGoalKey : vanillaNames) {
GoalKey<?> value = vanillaGoalKey.key();
TypeName typedKey = ParameterizedTypeName.get(GoalKey.class, value.getEntityClass());
NamespacedKey key = value.getNamespacedKey();
for (final GoalKey<?> goalKey : vanillaNames) {
TypeName typedKey = ParameterizedTypeName.get(GoalKey.class, goalKey.getEntityClass());
NamespacedKey key = goalKey.getNamespacedKey();
String keyPath = key.getKey();
String fieldName = Formatting.formatKeyAsField(key);
FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL)
.initializer("$N($S, $T.class)", createMethod.build(), keyPath, value.getEntityClass());
String fieldName = Formatting.formatKeyAsField(keyPath);
FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL)
.initializer("$N($S, $T.class)", createMethod.build(), keyPath, goalKey.getEntityClass());
typeBuilder.addField(fieldBuilder.build());
}
@ -227,8 +221,8 @@ public class MobGoalGenerator extends SimpleGenerator {
NamespacedKey key = NamespacedKey.minecraft(value.entryName);
String keyPath = key.getKey();
String fieldName = Formatting.formatKeyAsField(key);
FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, Modifier.PUBLIC, Modifier.STATIC, Modifier.FINAL)
String fieldName = Formatting.formatKeyAsField(keyPath);
FieldSpec.Builder fieldBuilder = FieldSpec.builder(typedKey, fieldName, PUBLIC, STATIC, FINAL)
.addAnnotation(Annotations.deprecatedVersioned(value.removedVersion, value.removalVersion != null))
.initializer("$N($S, $T.class)", createMethod.build(), keyPath, value.entity);
@ -251,9 +245,6 @@ public class MobGoalGenerator extends SimpleGenerator {
.skipJavaLangImports(true);
}
record VanillaGoalKey(Class<?> clazz, GoalKey<?> key) {
}
record DeprecatedEntry(Class<?> entity, String entryName, @Nullable String removalVersion,
@Nullable String removedVersion) {

View File

@ -126,7 +126,7 @@ import java.util.Set;
public class MobGoalNames {
private static final Map<Class<? extends Goal>, Class<? extends Mob>> entityClassCache = new HashMap<>();
private static final Map<Class<? extends net.minecraft.world.entity.Mob>, Class<? extends Mob>> bukkitMap = new HashMap<>();
public static final Map<Class<? extends net.minecraft.world.entity.Mob>, Class<? extends Mob>> bukkitMap = new HashMap<>();
static {
@ -232,6 +232,9 @@ public class MobGoalNames {
bukkitMap.put(net.minecraft.world.entity.monster.warden.Warden.class, org.bukkit.entity.Warden.class);
bukkitMap.put(net.minecraft.world.entity.animal.allay.Allay.class, org.bukkit.entity.Allay.class);
bukkitMap.put(net.minecraft.world.entity.animal.sniffer.Sniffer.class, org.bukkit.entity.Sniffer.class);
bukkitMap.put(net.minecraft.world.entity.monster.breeze.Breeze.class, org.bukkit.entity.Breeze.class);
bukkitMap.put(net.minecraft.world.entity.animal.armadillo.Armadillo.class, org.bukkit.entity.Armadillo.class);
bukkitMap.put(net.minecraft.world.entity.monster.Bogged.class, org.bukkit.entity.Bogged.class);
//</editor-fold>
}

View File

@ -12,11 +12,11 @@ import org.jetbrains.annotations.Nullable;
public final class Annotations {
public static List<AnnotationSpec> experimentalAnnotations(final String version) {
public static List<AnnotationSpec> experimentalAnnotations(final MinecraftExperimental.Requires requiredFeatureFlag) {
return List.of(
AnnotationSpec.builder(ApiStatus.Experimental.class).build(),
AnnotationSpec.builder(MinecraftExperimental.class)
.addMember("value", "$S", version)
.addMember("value", "$T.$L", MinecraftExperimental.Requires.class, requiredFeatureFlag.name())
.build()
);
}

View File

@ -3,17 +3,18 @@ package io.papermc.generator.utils;
import com.mojang.serialization.Lifecycle;
import io.papermc.generator.Main;
import java.util.List;
import java.util.Set;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.Registry;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.resources.ResourceKey;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
@DefaultQualifier(NonNull.class)
public record CollectingContext<T>(List<ResourceKey<T>> registered,
Registry<T> registry) implements BootstapContext<T> {
public record CollectingContext<T>(Set<ResourceKey<T>> registered,
Registry<T> registry) implements BootstrapContext<T> {
@Override
public Holder.Reference<T> register(final ResourceKey<T> resourceKey, final @NonNull T t, final Lifecycle lifecycle) {

View File

@ -1,13 +1,47 @@
package io.papermc.generator.utils;
import net.kyori.adventure.key.Key;
import org.apache.commons.lang3.math.NumberUtils;
import java.util.Comparator;
import java.util.Locale;
import java.util.OptionalInt;
import java.util.function.Function;
import java.util.regex.Pattern;
public final class Formatting {
public static String formatKeyAsField(Key key) {
return key.value().toUpperCase(Locale.ENGLISH).replaceAll("[.-/]", "_"); // replace invalid field name chars
private static final Pattern ILLEGAL_FIELD_CHARACTERS = Pattern.compile("[.-/]");
public static String formatKeyAsField(String path) {
return ILLEGAL_FIELD_CHARACTERS.matcher(path.toUpperCase(Locale.ENGLISH)).replaceAll("_");
}
public static Comparator<String> ALPHABETIC_KEY_ORDER = alphabeticKeyOrder(path -> path);
public static <T> Comparator<T> alphabeticKeyOrder(Function<T, String> mapper) {
return (o1, o2) -> {
String path1 = mapper.apply(o1);
String path2 = mapper.apply(o2);
OptionalInt trailingInt1 = tryParseTrailingInt(path1);
OptionalInt trailingInt2 = tryParseTrailingInt(path2);
if (trailingInt1.isPresent() && trailingInt2.isPresent()) {
return Integer.compare(trailingInt1.getAsInt(), trailingInt2.getAsInt());
}
return path1.compareTo(path2);
};
}
private static OptionalInt tryParseTrailingInt(String path) {
int delimiterIndex = path.lastIndexOf('_');
if (delimiterIndex != -1) {
String score = path.substring(delimiterIndex + 1);
if (NumberUtils.isDigits(score)) {
return OptionalInt.of(Integer.parseInt(score));
}
}
return OptionalInt.empty();
}
private Formatting() {

View File

@ -0,0 +1,37 @@
package io.papermc.generator;
import io.github.classgraph.ClassGraph;
import io.github.classgraph.ScanResult;
import io.papermc.generator.types.goal.MobGoalNames;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.Mob;
import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.fail;
public class MobGoalConverterTest {
@Test
public void testBukkitMap() {
final List<Class<Mob>> classes;
try (ScanResult scanResult = new ClassGraph().enableAllInfo().whitelistPackages(Entity.class.getPackageName()).scan()) {
classes = scanResult.getSubclasses(Mob.class.getName()).loadClasses(Mob.class);
}
assertFalse(classes.isEmpty(), "There are supposed to be more than 0 mob classes!");
List<String> missingClasses = new ArrayList<>();
for (Class<Mob> nmsClass : classes) {
if (!MobGoalNames.bukkitMap.containsKey(nmsClass)) {
missingClasses.add(nmsClass.getCanonicalName());
}
}
if (!missingClasses.isEmpty()) {
fail("Missing some entity classes in the bukkit map: " + String.join(", ", missingClasses));
}
}
}

View File

@ -1,7 +1,7 @@
accessWidener v1 named
accessible method net/minecraft/server/WorldLoader loadAndReplaceLayer (Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/server/RegistryLayer;Ljava/util/List;)Lnet/minecraft/core/LayeredRegistryAccess;
public net/minecraft/server/WorldLoader loadAndReplaceLayer(Lnet/minecraft/server/packs/resources/ResourceManager;Lnet/minecraft/core/LayeredRegistryAccess;Lnet/minecraft/server/RegistryLayer;Ljava/util/List;)Lnet/minecraft/core/LayeredRegistryAccess;
# for auto-marking experimental stuff
accessible field net/minecraft/core/RegistrySetBuilder entries Ljava/util/List;
accessible class net/minecraft/core/RegistrySetBuilder$RegistryStub
accessible field net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER Lnet/minecraft/core/RegistrySetBuilder;
public net/minecraft/core/RegistrySetBuilder entries
public net/minecraft/core/RegistrySetBuilder$RegistryStub
public net/minecraft/data/registries/UpdateOneTwentyOneRegistries BUILDER
public net/minecraft/data/registries/VanillaRegistries BUILDER

View File

@ -27,7 +27,7 @@ index 5dd700a956e915c00b25d91dea8d6f285ddab72b..97e78e27ee0eea2c8b24886eeb19164d
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..4311f6dde7372a069f462158fba76d9d4b72e23a
index 0000000000000000000000000000000000000000..6271e2bad0ed937c2c46a8c8fdf186c46b0b620e
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,91 @@
@ -41,7 +41,7 @@ index 0000000000000000000000000000000000000000..4311f6dde7372a069f462158fba76d9d
+ withJavadocJar()
+}
+
+val annotationsVersion = "24.0.1"
+val annotationsVersion = "24.1.0"
+val bungeeCordChatVersion = "1.20-R0.2"
+
+dependencies {
@ -61,10 +61,10 @@ index 0000000000000000000000000000000000000000..4311f6dde7372a069f462158fba76d9d
+ testCompileOnly(annotations)
+
+ testImplementation("org.apache.commons:commons-lang3:3.12.0")
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
+ testImplementation("org.hamcrest:hamcrest:2.2")
+ testImplementation("org.mockito:mockito-core:5.5.0")
+ testImplementation("org.ow2.asm:asm-tree:9.5")
+ testImplementation("org.mockito:mockito-core:5.11.0")
+ testImplementation("org.ow2.asm:asm-tree:9.7")
+}
+
+configure<PublishingExtension> {
@ -124,10 +124,10 @@ index 0000000000000000000000000000000000000000..4311f6dde7372a069f462158fba76d9d
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 0861b44936958613beba670b0d82e21d3aaf388b..0000000000000000000000000000000000000000
index 278ecb12ecdb5e1fdf394a1c990a4d849e53e05e..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,277 +0,0 @@
@@ -1,267 +0,0 @@
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
@ -135,7 +135,7 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.20.4-R0.1-SNAPSHOT</version>
- <version>1.20.5-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
@ -144,8 +144,7 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
-
- <properties>
- <skipTests>true</skipTests>
- <maven.compiler.source>17</maven.compiler.source>
- <maven.compiler.target>17</maven.compiler.target>
- <maven.compiler.release>17</maven.compiler.release>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
-
@ -218,14 +217,14 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
- <dependency>
- <groupId>org.jetbrains</groupId>
- <artifactId>annotations-java5</artifactId>
- <version>24.0.1</version>
- <version>24.1.0</version>
- <scope>provided</scope>
- </dependency>
- <!-- testing -->
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <version>5.10.0</version>
- <version>5.10.2</version>
- <scope>test</scope>
- </dependency>
- <dependency>
@ -237,13 +236,13 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>5.5.0</version>
- <version>5.11.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.ow2.asm</groupId>
- <artifactId>asm-tree</artifactId>
- <version>9.5</version>
- <version>9.7</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
@ -266,25 +265,16 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.11.0</version>
- <version>3.13.0</version>
- <configuration>
- <!-- we use the Eclipse compiler as it doesn't need a JDK -->
- <compilerId>eclipse</compilerId>
- <!-- default changed with version 3.11.0 -->
- <showWarnings>false</showWarnings>
- </configuration>
- <dependencies>
- <dependency>
- <groupId>org.codehaus.plexus</groupId>
- <artifactId>plexus-compiler-eclipse</artifactId>
- <version>2.13.0</version>
- </dependency>
- </dependencies>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>3.3.0</version>
- <version>3.4.1</version>
- <configuration>
- <archive>
- <manifest>
@ -299,7 +289,7 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
- <version>3.5.0</version>
- <version>3.5.3</version>
- <executions>
- <execution>
- <phase>package</phase>
@ -326,10 +316,10 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>3.5.0</version>
- <version>3.6.3</version>
- <configuration>
- <links>
- <link>https://guava.dev/releases/31.1-jre/api/docs/</link>
- <link>https://guava.dev/releases/32.1.2-jre/api/docs/</link>
- </links>
- <tags>
- <tag>
@ -343,7 +333,7 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>3.1.0</version>
- <version>3.2.5</version>
- </plugin>
- </plugins>
- </build>
@ -359,7 +349,7 @@ index 0861b44936958613beba670b0d82e21d3aaf388b..00000000000000000000000000000000
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <version>3.3.0</version>
- <version>3.3.1</version>
- <executions>
- <execution>
- <phase>process-classes</phase>

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index fd076ab0df328818873028d333b0716d5b3796a9..4a62bb7c89c25e11e7f514fbcbc35a408ed83856 100644
index 6271e2bad0ed937c2c46a8c8fdf186c46b0b620e..a918fd14c95e714e935758d60bccd72755e00b11 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -18,15 +18,26 @@ dependencies {
@ -34,7 +34,7 @@ index fd076ab0df328818873028d333b0716d5b3796a9..4a62bb7c89c25e11e7f514fbcbc35a40
+ // Paper end
+
testImplementation("org.apache.commons:commons-lang3:3.12.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testImplementation("org.hamcrest:hamcrest:2.2")
@@ -69,8 +80,12 @@ tasks.withType<Javadoc> {
options.links(

View File

@ -12,7 +12,7 @@ Co-authored-by: Riley Park <rileysebastianpark@gmail.com>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index cc586ca58c9ef852d7154f29c2dc187047f2c64a..948bd84db9923ef43cf753b7b72bf4d0081ab43a 100644
index a918fd14c95e714e935758d60bccd72755e00b11..768024b2b4584fd7dd86f068c0e79c89ffc5faa1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -105,6 +105,12 @@ tasks.test {

View File

@ -7,7 +7,7 @@ Currently includes generated key holder classes for types
used in the Registry Modification API
diff --git a/build.gradle.kts b/build.gradle.kts
index 948bd84db9923ef43cf753b7b72bf4d0081ab43a..4ee1aed72727e911bff4ac91bcacfd8eee87ecfc 100644
index 768024b2b4584fd7dd86f068c0e79c89ffc5faa1..f11a22ab01e97e51619c96f2d8a78a99297efc59 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,6 +1,7 @@
@ -19,7 +19,7 @@ index 948bd84db9923ef43cf753b7b72bf4d0081ab43a..4ee1aed72727e911bff4ac91bcacfd8e
java {
@@ -45,6 +46,22 @@ dependencies {
testImplementation("org.ow2.asm:asm-tree:9.5")
testImplementation("org.ow2.asm:asm-tree:9.7")
}
+// Paper start
@ -246,12 +246,14 @@ index 0000000000000000000000000000000000000000..3c3fd73f7742bb8602e2f9164dd4c120
+record TypedKeyImpl<T extends Keyed>(@NotNull Key key, @NotNull RegistryKey<T> registryKey) implements TypedKey<T> {
+}
diff --git a/src/main/java/org/bukkit/MinecraftExperimental.java b/src/main/java/org/bukkit/MinecraftExperimental.java
index 2365a8c620be709b280fb08855752bb0995838fc..b63e24b3c4d2f1a08e39434caa527bb2e0edea22 100644
index b6f4810e387c22c4a70609ea1d605130245689a5..03824ae54e1bdb8b14f79b3c5e0294ae725e43f8 100644
--- a/src/main/java/org/bukkit/MinecraftExperimental.java
+++ b/src/main/java/org/bukkit/MinecraftExperimental.java
@@ -24,4 +24,5 @@ import org.jetbrains.annotations.ApiStatus;
})
@@ -47,6 +47,6 @@ public @interface MinecraftExperimental {
@ApiStatus.Internal
public @interface MinecraftExperimental {
+ String value() default ""; // Paper
public enum Requires {
- UPDATE_1_21
+ UPDATE_1_21, BUNDLE, TRADE_REBALANCE // Paper
}
}

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add FastUtil to Bukkit
Doesn't expose to plugins, just allows Paper-API to use it for optimization
diff --git a/build.gradle.kts b/build.gradle.kts
index b9bf992867115fe6e84091a1a0b1f220de751699..cc8f297a71eb75b3388ff1cb21a297e268894aac 100644
index f11a22ab01e97e51619c96f2d8a78a99297efc59..2f266350a787a4cfdfda1b0e760bfb7604cac43c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -23,6 +23,7 @@ dependencies {

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors.
Uses method handles for private or static methods.
diff --git a/build.gradle.kts b/build.gradle.kts
index b577114c2b89fe2053123d1a542d37dff7fa8d5a..af6c528ccc4356f5bba3ce0b9bf6de237d77376e 100644
index 106d4d5756dc579c446699106f52462085ea9a52..d6252c1ff21c92bf0d232d5bfdf828d1d2ce38c0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -47,6 +47,9 @@ dependencies {
@ -14,8 +14,8 @@ index b577114c2b89fe2053123d1a542d37dff7fa8d5a..af6c528ccc4356f5bba3ce0b9bf6de23
apiAndDocs("net.kyori:adventure-text-serializer-plain")
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
+
+ implementation("org.ow2.asm:asm:9.5")
+ implementation("org.ow2.asm:asm-commons:9.5")
+ implementation("org.ow2.asm:asm:9.7")
+ implementation("org.ow2.asm:asm-commons:9.7")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")

View File

@ -5,11 +5,11 @@ Subject: [PATCH] Paper Plugins
diff --git a/build.gradle.kts b/build.gradle.kts
index af6c528ccc4356f5bba3ce0b9bf6de237d77376e..f9ff7e3692d448e2a1e38d0aa26c2d934442e247 100644
index d6252c1ff21c92bf0d232d5bfdf828d1d2ce38c0..5ccdd695948d1d36173b0a4516cfe8494dd01b06 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -52,7 +52,7 @@ dependencies {
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm-commons:9.7")
// Paper end
- compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
@ -18,8 +18,8 @@ index af6c528ccc4356f5bba3ce0b9bf6de237d77376e..f9ff7e3692d448e2a1e38d0aa26c2d93
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
@@ -138,6 +138,7 @@ tasks.withType<Javadoc> {
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
//"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
//"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
// Paper end
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
)
@ -1347,10 +1347,10 @@ index 0000000000000000000000000000000000000000..6bf3d212a6156ad9ab0e82d1ca0a04f8
+
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 0f902aec66ec550f80709f7f314ca90d374ebb53..20efbec3eabb21806a532422130f7904d2c0967e 100644
index 913cf8308840ca1f365eb1f456f64b96046ed060..6e46302c272b468375f2de3f7f992f55f13805b8 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -127,4 +127,13 @@ public interface UnsafeValues {
@@ -129,4 +129,13 @@ public interface UnsafeValues {
@ApiStatus.Internal
@NotNull
DamageSource.Builder createDamageSourceBuilder(@NotNull DamageType damageType);
@ -1545,7 +1545,7 @@ index a88733f1cd1ddb5d85ab1b0e6af4fd5b80bbc1c6..cb530369e667c426c842da356c31304b
/**
diff --git a/src/main/java/org/bukkit/plugin/PluginManager.java b/src/main/java/org/bukkit/plugin/PluginManager.java
index 41e26451fe12d8e6e0ef73c85731b24b4e3f200c..03213fde8315384ec56c16031cfc606ade2e8091 100644
index ae3e68562c29992fab627428db3ff0006d8216f9..47153dee66782a00b980ecf15e8774ab6f3d887d 100644
--- a/src/main/java/org/bukkit/plugin/PluginManager.java
+++ b/src/main/java/org/bukkit/plugin/PluginManager.java
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
@ -1565,7 +1565,7 @@ index 41e26451fe12d8e6e0ef73c85731b24b4e3f200c..03213fde8315384ec56c16031cfc606a
public void registerInterface(@NotNull Class<? extends PluginLoader> loader) throws IllegalArgumentException;
/**
@@ -303,4 +304,17 @@ public interface PluginManager {
@@ -312,4 +313,17 @@ public interface PluginManager {
* @return True if event timings are to be used
*/
public boolean useTimings();
@ -1584,7 +1584,7 @@ index 41e26451fe12d8e6e0ef73c85731b24b4e3f200c..03213fde8315384ec56c16031cfc606a
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e7666711998eb4e 100644
index 34830d2815d331a1b611f22eca08f53d815ea08a..fb4cb36391e69fd997300b952b64fbd73ae9d675 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -43,6 +43,8 @@ import org.jetbrains.annotations.Nullable;
@ -1626,7 +1626,15 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
Preconditions.checkArgument(directory != null, "Directory cannot be null");
Preconditions.checkArgument(directory.isDirectory(), "Directory must be a directory");
@@ -378,6 +388,15 @@ public final class SimplePluginManager implements PluginManager {
@@ -129,6 +139,7 @@ public final class SimplePluginManager implements PluginManager {
*/
@NotNull
public Plugin[] loadPlugins(@NotNull File[] files) {
+ // TODO Replace with Paper plugin loader
Preconditions.checkArgument(files != null, "File list cannot be null");
List<Plugin> result = new ArrayList<Plugin>();
@@ -389,6 +400,15 @@ public final class SimplePluginManager implements PluginManager {
@Nullable
public synchronized Plugin loadPlugin(@NotNull File file) throws InvalidPluginException, UnknownDependencyException {
Preconditions.checkArgument(file != null, "File cannot be null");
@ -1642,7 +1650,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
checkUpdate(file);
@@ -428,12 +447,14 @@ public final class SimplePluginManager implements PluginManager {
@@ -439,12 +459,14 @@ public final class SimplePluginManager implements PluginManager {
@Override
@Nullable
public synchronized Plugin getPlugin(@NotNull String name) {
@ -1657,7 +1665,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
return plugins.toArray(new Plugin[plugins.size()]);
}
@@ -447,6 +468,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -458,6 +480,7 @@ public final class SimplePluginManager implements PluginManager {
*/
@Override
public boolean isPluginEnabled(@NotNull String name) {
@ -1665,7 +1673,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
Plugin plugin = getPlugin(name);
return isPluginEnabled(plugin);
@@ -460,6 +482,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -471,6 +494,7 @@ public final class SimplePluginManager implements PluginManager {
*/
@Override
public boolean isPluginEnabled(@Nullable Plugin plugin) {
@ -1673,7 +1681,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
if ((plugin != null) && (plugins.contains(plugin))) {
return plugin.isEnabled();
} else {
@@ -469,6 +492,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -480,6 +504,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void enablePlugin(@NotNull final Plugin plugin) {
@ -1681,7 +1689,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
if (!plugin.isEnabled()) {
List<Command> pluginCommands = PluginCommandYamlParser.parse(plugin);
@@ -488,6 +512,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -499,6 +524,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void disablePlugins() {
@ -1689,7 +1697,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
Plugin[] plugins = getPlugins();
for (int i = plugins.length - 1; i >= 0; i--) {
disablePlugin(plugins[i]);
@@ -496,6 +521,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -507,6 +533,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void disablePlugin(@NotNull final Plugin plugin) {
@ -1697,7 +1705,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
if (plugin.isEnabled()) {
try {
plugin.getPluginLoader().disablePlugin(plugin);
@@ -540,6 +566,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -551,6 +578,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void clearPlugins() {
@ -1705,7 +1713,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
synchronized (this) {
disablePlugins();
plugins.clear();
@@ -560,6 +587,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -571,6 +599,7 @@ public final class SimplePluginManager implements PluginManager {
*/
@Override
public void callEvent(@NotNull Event event) {
@ -1713,7 +1721,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
if (event.isAsynchronous()) {
if (Thread.holdsLock(this)) {
throw new IllegalStateException(event.getEventName() + " cannot be triggered asynchronously from inside synchronized code.");
@@ -608,6 +636,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -619,6 +648,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void registerEvents(@NotNull Listener listener, @NotNull Plugin plugin) {
@ -1721,7 +1729,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
if (!plugin.isEnabled()) {
throw new IllegalPluginAccessException("Plugin attempted to register " + listener + " while not enabled");
}
@@ -641,6 +670,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -652,6 +682,7 @@ public final class SimplePluginManager implements PluginManager {
Preconditions.checkArgument(priority != null, "Priority cannot be null");
Preconditions.checkArgument(executor != null, "Executor cannot be null");
Preconditions.checkArgument(plugin != null, "Plugin cannot be null");
@ -1729,7 +1737,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
if (!plugin.isEnabled()) {
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
@@ -688,16 +718,19 @@ public final class SimplePluginManager implements PluginManager {
@@ -699,16 +730,19 @@ public final class SimplePluginManager implements PluginManager {
@Override
@Nullable
public Permission getPermission(@NotNull String name) {
@ -1749,7 +1757,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
String name = perm.getName().toLowerCase(java.util.Locale.ENGLISH);
if (permissions.containsKey(name)) {
@@ -711,21 +744,25 @@ public final class SimplePluginManager implements PluginManager {
@@ -722,21 +756,25 @@ public final class SimplePluginManager implements PluginManager {
@Override
@NotNull
public Set<Permission> getDefaultPermissions(boolean op) {
@ -1775,7 +1783,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
if (perm != null && permissions.containsKey(perm.getName().toLowerCase(java.util.Locale.ENGLISH))) {
defaultPerms.get(true).remove(perm);
defaultPerms.get(false).remove(perm);
@@ -765,6 +802,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -776,6 +814,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void subscribeToPermission(@NotNull String permission, @NotNull Permissible permissible) {
@ -1783,7 +1791,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
String name = permission.toLowerCase(java.util.Locale.ENGLISH);
Map<Permissible, Boolean> map = permSubs.get(name);
@@ -778,6 +816,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -789,6 +828,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void unsubscribeFromPermission(@NotNull String permission, @NotNull Permissible permissible) {
@ -1791,7 +1799,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
String name = permission.toLowerCase(java.util.Locale.ENGLISH);
Map<Permissible, Boolean> map = permSubs.get(name);
@@ -793,6 +832,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -804,6 +844,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
@NotNull
public Set<Permissible> getPermissionSubscriptions(@NotNull String permission) {
@ -1799,7 +1807,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
String name = permission.toLowerCase(java.util.Locale.ENGLISH);
Map<Permissible, Boolean> map = permSubs.get(name);
@@ -805,6 +845,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -816,6 +857,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void subscribeToDefaultPerms(boolean op, @NotNull Permissible permissible) {
@ -1807,7 +1815,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
Map<Permissible, Boolean> map = defSubs.get(op);
if (map == null) {
@@ -817,6 +858,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -828,6 +870,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public void unsubscribeFromDefaultPerms(boolean op, @NotNull Permissible permissible) {
@ -1815,7 +1823,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
Map<Permissible, Boolean> map = defSubs.get(op);
if (map != null) {
@@ -831,6 +873,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -842,6 +885,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
@NotNull
public Set<Permissible> getDefaultPermSubscriptions(boolean op) {
@ -1823,7 +1831,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
Map<Permissible, Boolean> map = defSubs.get(op);
if (map == null) {
@@ -843,6 +886,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -854,6 +898,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
@NotNull
public Set<Permission> getPermissions() {
@ -1831,7 +1839,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
return new HashSet<Permission>(permissions.values());
}
@@ -866,6 +910,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -877,6 +922,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public boolean useTimings() {
@ -1839,7 +1847,7 @@ index a69c5d5cad6168aeaae41e8adc319dc8c976b1e2..77f9ebbe675cf1b6a17e98d98e766671
return useTimings;
}
@@ -877,4 +922,28 @@ public final class SimplePluginManager implements PluginManager {
@@ -888,4 +934,28 @@ public final class SimplePluginManager implements PluginManager {
public void useTimings(boolean use) {
useTimings = use;
}
@ -2054,7 +2062,7 @@ index 047c0304fd617cec990f80815b43916c6ef5a94c..ab04ffe4cd05315a2ee0f64c553b4c67
throw ex;
} catch (Throwable ex) {
diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
index 6d634b0ea813ccb19f1562a7d0e5a59cea4eab21..653135352c104a6ddeb74a1b6d4916c6952d6271 100644
index 160f8c348271154c672adf936b358ffeb3b63e69..f4d655a158410039305ac68cebe0d79000f73df8 100644
--- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
@@ -36,7 +36,10 @@ import org.eclipse.aether.transport.http.HttpTransporterFactory;
@ -2077,7 +2085,7 @@ index 6d634b0ea813ccb19f1562a7d0e5a59cea4eab21..653135352c104a6ddeb74a1b6d4916c6
session.setChecksumPolicy( RepositoryPolicy.CHECKSUM_POLICY_FAIL );
session.setLocalRepositoryManager( repository.newLocalRepositoryManager( session, new LocalRepository( "libraries" ) ) );
session.setTransferListener( new AbstractTransferListener()
@@ -79,7 +83,7 @@ class LibraryLoader
@@ -84,7 +88,7 @@ class LibraryLoader
}
logger.log( Level.INFO, "[{0}] Loading {1} libraries... please wait", new Object[]
{
@ -2086,7 +2094,7 @@ index 6d634b0ea813ccb19f1562a7d0e5a59cea4eab21..653135352c104a6ddeb74a1b6d4916c6
} );
List<Dependency> dependencies = new ArrayList<>();
@@ -117,7 +121,7 @@ class LibraryLoader
@@ -122,7 +126,7 @@ class LibraryLoader
jarFiles.add( url );
logger.log( Level.INFO, "[{0}] Loaded library {1}", new Object[]
{

View File

@ -2854,10 +2854,10 @@ index 0000000000000000000000000000000000000000..3e61a926620a67daec3af54b72a1b911
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index bd1a010bb4e18a16d02549d64333ce7641be7910..07d393152320270e38f495120dd19e35ece73149 100644
index 6425151b7003a1376977717dca6172efa1864648..e23be80c0ee7d7979b7c62ebce97ed0b2a0e146b 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -864,7 +864,6 @@ public final class Bukkit {
@@ -866,7 +866,6 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
@ -2866,10 +2866,10 @@ index bd1a010bb4e18a16d02549d64333ce7641be7910..07d393152320270e38f495120dd19e35
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 6aed59819cc3d70f1b5975c3c7df40cc0b0afd8a..baa02b5223769755670c611ca4d6acc7bf202116 100644
index 3bf7db7eac81e3cc6f5c6700637d10d1b4b7a47b..77f8b0889cd7039bf041fc052fba33b60aa77e17 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1928,6 +1928,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1947,6 +1947,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
throw new UnsupportedOperationException("Not supported yet.");
}
@ -2897,7 +2897,7 @@ index 6aed59819cc3d70f1b5975c3c7df40cc0b0afd8a..baa02b5223769755670c611ca4d6acc7
* Sends the component to the player
*
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 20efbec3eabb21806a532422130f7904d2c0967e..853ef6f7f0cd2e5679688c40ce715b30473c3ce3 100644
index 6e46302c272b468375f2de3f7f992f55f13805b8..01e796e487cc16710f51b457466a37ba70e1e665 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -40,6 +40,7 @@ public interface UnsafeValues {
@ -2908,7 +2908,7 @@ index 20efbec3eabb21806a532422130f7904d2c0967e..853ef6f7f0cd2e5679688c40ce715b30
Material toLegacy(Material material);
Material fromLegacy(Material material);
@@ -136,4 +137,12 @@ public interface UnsafeValues {
@@ -138,4 +139,12 @@ public interface UnsafeValues {
return !Bukkit.getUnsafe().isSupportedApiVersion(plugin.getDescription().getAPIVersion());
}
// Paper end
@ -2949,7 +2949,7 @@ index 0000000000000000000000000000000000000000..f9a00aecca5ec41b460bf41dfe1c6969
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 75759131bd94b672bec4cd8e271ebff1ad391cba..5cfd88eec9bf02e83d77b6fce1a5c14b7687f48b 100644
index f3cdf13f22aa789ee8cc235b61fda4035b254219..33c0a60e71f4bd29966c10ea60b22f14e56c1de4 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -33,7 +33,8 @@ public abstract class Command {
@ -3455,10 +3455,10 @@ index 516d7fc7812aac343782861d0d567f54aa578c2a..00000000000000000000000000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 5c55715c8cdd79f2214b265a81d94a8904c998ea..a714877c44e6a6c5e90d0e0c5bf6eb30937e1037 100644
index 4e9ba039669c7059180f5776ee2f7188f2dd01b5..5b526d602057ab70b4a058142e01a0195694c28f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2634,7 +2634,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2678,7 +2678,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@ -3479,10 +3479,10 @@ index 5c55715c8cdd79f2214b265a81d94a8904c998ea..a714877c44e6a6c5e90d0e0c5bf6eb30
@NotNull
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 77f9ebbe675cf1b6a17e98d98e7666711998eb4e..63389474a2b3f0e283b42e7004aa6a94904a3d17 100644
index fb4cb36391e69fd997300b952b64fbd73ae9d675..3465bd660999caa53582e9d56a4e93ec7701a1de 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -368,7 +368,6 @@ public final class SimplePluginManager implements PluginManager {
@@ -380,7 +380,6 @@ public final class SimplePluginManager implements PluginManager {
}
}
@ -3490,7 +3490,7 @@ index 77f9ebbe675cf1b6a17e98d98e7666711998eb4e..63389474a2b3f0e283b42e7004aa6a94
return result.toArray(new Plugin[result.size()]);
}
@@ -416,9 +415,9 @@ public final class SimplePluginManager implements PluginManager {
@@ -428,9 +427,9 @@ public final class SimplePluginManager implements PluginManager {
if (result != null) {
plugins.add(result);
@ -3502,7 +3502,7 @@ index 77f9ebbe675cf1b6a17e98d98e7666711998eb4e..63389474a2b3f0e283b42e7004aa6a94
}
}
@@ -448,7 +447,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -460,7 +459,7 @@ public final class SimplePluginManager implements PluginManager {
@Nullable
public synchronized Plugin getPlugin(@NotNull String name) {
if (true) {return this.paperPluginManager.getPlugin(name);} // Paper
@ -3511,7 +3511,7 @@ index 77f9ebbe675cf1b6a17e98d98e7666711998eb4e..63389474a2b3f0e283b42e7004aa6a94
}
@Override
@@ -676,7 +675,8 @@ public final class SimplePluginManager implements PluginManager {
@@ -688,7 +687,8 @@ public final class SimplePluginManager implements PluginManager {
throw new IllegalPluginAccessException("Plugin attempted to register " + event + " while not enabled");
}
@ -3521,7 +3521,7 @@ index 77f9ebbe675cf1b6a17e98d98e7666711998eb4e..63389474a2b3f0e283b42e7004aa6a94
getEventListeners(event).register(new TimedRegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
} else {
getEventListeners(event).register(new RegisteredListener(listener, executor, priority, plugin, ignoreCancelled));
@@ -911,7 +911,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -923,7 +923,7 @@ public final class SimplePluginManager implements PluginManager {
@Override
public boolean useTimings() {
if (true) {return this.paperPluginManager.useTimings();} // Paper
@ -3530,7 +3530,7 @@ index 77f9ebbe675cf1b6a17e98d98e7666711998eb4e..63389474a2b3f0e283b42e7004aa6a94
}
/**
@@ -920,7 +920,7 @@ public final class SimplePluginManager implements PluginManager {
@@ -932,7 +932,7 @@ public final class SimplePluginManager implements PluginManager {
* @param use True if per event timing code should be used
*/
public void useTimings(boolean use) {

View File

@ -7,10 +7,10 @@ Subject: [PATCH] Add command line option to load extra plugin jars not in the
ex: java -jar paperclip.jar nogui -add-plugin=/path/to/plugin.jar -add-plugin=/path/to/another/plugin_jar.jar
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 07d393152320270e38f495120dd19e35ece73149..026c1accb03bdd42981a2eaf9189d7b2fe6e7339 100644
index e23be80c0ee7d7979b7c62ebce97ed0b2a0e146b..336c0fb1fcde9efb7cb8d15a9fad8c4cbcf28744 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -80,6 +80,20 @@ public final class Bukkit {
@@ -82,6 +82,20 @@ public final class Bukkit {
return server;
}
@ -32,10 +32,10 @@ index 07d393152320270e38f495120dd19e35ece73149..026c1accb03bdd42981a2eaf9189d7b2
* Attempts to set the {@link Server} singleton.
* <p>
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index baa02b5223769755670c611ca4d6acc7bf202116..523f5ac54f7662c7c96182a352236732d2d3b122 100644
index 77f8b0889cd7039bf041fc052fba33b60aa77e17..09012ce27344c60730b9c5fcde85712a8e7a69fb 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -65,6 +65,18 @@ import org.jetbrains.annotations.Nullable;
@@ -67,6 +67,18 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
@ -55,7 +55,7 @@ index baa02b5223769755670c611ca4d6acc7bf202116..523f5ac54f7662c7c96182a352236732
* Used for all administrative messages, such as an operator using a
* command.
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 63389474a2b3f0e283b42e7004aa6a94904a3d17..974ff7116b294473ec450757e8a9341540f43dcd 100644
index 3465bd660999caa53582e9d56a4e93ec7701a1de..ca539930905531a4ce079529c4d456bcb6fc9e8c 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -116,9 +116,22 @@ public final class SimplePluginManager implements PluginManager {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Player affects spawning API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a714877c44e6a6c5e90d0e0c5bf6eb30937e1037..35de65a773146c4b4162df777a8ec594a22ca62c 100644
index 5b526d602057ab70b4a058142e01a0195694c28f..f868eb1609f7c905fe6ebcf088a0a3030af55e92 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2486,6 +2486,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2530,6 +2530,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public String getLocale();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add getTPS method
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 026c1accb03bdd42981a2eaf9189d7b2fe6e7339..d640d6e8e919e410b54920502d7e26f2519d9e3c 100644
index 336c0fb1fcde9efb7cb8d15a9fad8c4cbcf28744..ea5f1b4085fd2ec355c4c8036f3bc729e30fd1b7 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2070,6 +2070,17 @@ public final class Bukkit {
@@ -2093,6 +2093,17 @@ public final class Bukkit {
return server.getEntity(uuid);
}
@ -27,10 +27,10 @@ index 026c1accb03bdd42981a2eaf9189d7b2fe6e7339..d640d6e8e919e410b54920502d7e26f2
* Get the advancement specified by this key.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 523f5ac54f7662c7c96182a352236732d2d3b122..7ae7db87b8507e726b6c28400bd3e7eb9413ffb0 100644
index 09012ce27344c60730b9c5fcde85712a8e7a69fb..e37649ce4b3981f2cff96b64ed3bd4093c015346 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1765,6 +1765,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1784,6 +1784,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
Entity getEntity(@NotNull UUID uuid);

View File

@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..a736d7bcdc5861a01b66ba36158db1c7
+ }
+}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 853ef6f7f0cd2e5679688c40ce715b30473c3ce3..688fccdbc5cf831008ef2f27db9d15b0921a7561 100644
index 01e796e487cc16710f51b457466a37ba70e1e665..d69e5fa40702c283c370a2f712b51dc2ea3a1fa0 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -144,5 +144,12 @@ public interface UnsafeValues {
@@ -146,5 +146,12 @@ public interface UnsafeValues {
* @return name
*/
String getTimingsServerName();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 474765f40801a766c853018ea6e1adcd010375d2..b0967614bfdba06b5e11c910186aa66ac7e2d503 100644
index c78fb359bd28b8dc1ba242642ec612e856525993..4e1fb0974d061d5bb64899cac576318d2e6f8bf6 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -780,5 +780,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -791,5 +791,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
default net.kyori.adventure.text.event.HoverEvent<net.kyori.adventure.text.event.HoverEvent.ShowEntity> asHoverEvent(final @NotNull java.util.function.UnaryOperator<net.kyori.adventure.text.event.HoverEvent.ShowEntity> op) {
return net.kyori.adventure.text.event.HoverEvent.showEntity(op.apply(net.kyori.adventure.text.event.HoverEvent.ShowEntity.of(this.getType().getKey(), this.getUniqueId(), this.customName())));
}

View File

@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances.
Also add send/no-tick view distance to World.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index d76db156a7eeefaac3c96d2d547fddecefbd863e..41a181b890e029f99e52ae9aad28a86f28005f9e 100644
index a9858c2559f0921613b19710135cc6e060488e96..890ae536fdaff11055b72b1be0fbf3766a41812c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2916,6 +2916,66 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2941,6 +2941,66 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Set<FeatureFlag> getFeatureFlags();
@ -79,10 +79,10 @@ index d76db156a7eeefaac3c96d2d547fddecefbd863e..41a181b890e029f99e52ae9aad28a86f
* Gets all generated structures that intersect the chunk at the given
* coordinates. <br>
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 35de65a773146c4b4162df777a8ec594a22ca62c..b66f9264ceb38677d7422b47e379a0e860bcac07 100644
index f868eb1609f7c905fe6ebcf088a0a3030af55e92..5d5d37e2ebbbe4d2641177c7d174059ba29bb688 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2500,6 +2500,82 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2544,6 +2544,82 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param affects Whether the player can affect mob spawning
*/
public void setAffectsSpawning(boolean affects);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index d640d6e8e919e410b54920502d7e26f2519d9e3c..3d6c51fdd549a94a73fa3d19c0937aa2ec72b42e 100644
index ea5f1b4085fd2ec355c4c8036f3bc729e30fd1b7..c427d9dd916db6fe5078fb570eb57cfbd0766080 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2271,6 +2271,19 @@ public final class Bukkit {
@@ -2294,6 +2294,19 @@ public final class Bukkit {
return server.getUnsafe();
}
@ -29,10 +29,10 @@ index d640d6e8e919e410b54920502d7e26f2519d9e3c..3d6c51fdd549a94a73fa3d19c0937aa2
public static Server.Spigot spigot() {
return server.spigot();
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 7ae7db87b8507e726b6c28400bd3e7eb9413ffb0..95c9016e67c6c17ae8bac35fd01f62eae96ecf6a 100644
index e37649ce4b3981f2cff96b64ed3bd4093c015346..fbe2f6e349f242a2c4e64e63aa8ffdff7fa7dc81 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1775,6 +1775,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1794,6 +1794,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public double[] getTPS();
// Paper end

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Graduate bungeecord chat API from spigot subclasses
Change Javadoc to be accurate
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 3d6c51fdd549a94a73fa3d19c0937aa2ec72b42e..bafbb72996cb0cacf17b5741a7efbb1583277c6e 100644
index c427d9dd916db6fe5078fb570eb57cfbd0766080..19efe5cb6a8c2dcc5b293ff24caa58c9a57fc083 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -441,6 +441,30 @@ public final class Bukkit {
@@ -443,6 +443,30 @@ public final class Bukkit {
return server.broadcastMessage(message);
}
@ -41,10 +41,10 @@ index 3d6c51fdd549a94a73fa3d19c0937aa2ec72b42e..bafbb72996cb0cacf17b5741a7efbb15
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 95c9016e67c6c17ae8bac35fd01f62eae96ecf6a..7edac90aa6f37c9c3ebbe7260186ae3e279cea0b 100644
index fbe2f6e349f242a2c4e64e63aa8ffdff7fa7dc81..4c9c14b60eb6fd1d9845632c2c2fa765d882a741 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -370,6 +370,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -372,6 +372,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Deprecated // Paper
public int broadcastMessage(@NotNull String message);
@ -76,10 +76,10 @@ index 95c9016e67c6c17ae8bac35fd01f62eae96ecf6a..7edac90aa6f37c9c3ebbe7260186ae3e
* Gets the name of the update folder. The update folder is used to safely
* update plugins at the right moment on a plugin load.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index b66f9264ceb38677d7422b47e379a0e860bcac07..0ffe5812e2d59d3fbf56061eea0a2f391cde6758 100644
index 5d5d37e2ebbbe4d2641177c7d174059ba29bb688..881c75e84ef31390a3519549985af2711e2828b5 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1172,6 +1172,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1216,6 +1216,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendMap(@NotNull MapView map);

View File

@ -496,10 +496,10 @@ index 4205649948a9e2a72f64c3f007112245abac6d50..b3b32ce429edbf1ed040354dbe28ab86
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 974ff7116b294473ec450757e8a9341540f43dcd..fc2dae69165776d08274e34a69962cc70445f411 100644
index ca539930905531a4ce079529c4d456bcb6fc9e8c..07a9c9e254188c251165ca84c8e961fccda01175 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -515,7 +515,8 @@ public final class SimplePluginManager implements PluginManager {
@@ -527,7 +527,8 @@ public final class SimplePluginManager implements PluginManager {
try {
plugin.getPluginLoader().enablePlugin(plugin);
} catch (Throwable ex) {
@ -509,7 +509,7 @@ index 974ff7116b294473ec450757e8a9341540f43dcd..fc2dae69165776d08274e34a69962cc7
}
HandlerList.bakeAll();
@@ -538,32 +539,37 @@ public final class SimplePluginManager implements PluginManager {
@@ -550,32 +551,37 @@ public final class SimplePluginManager implements PluginManager {
try {
plugin.getPluginLoader().disablePlugin(plugin);
} catch (Throwable ex) {
@ -552,7 +552,7 @@ index 974ff7116b294473ec450757e8a9341540f43dcd..fc2dae69165776d08274e34a69962cc7
}
try {
@@ -576,6 +582,13 @@ public final class SimplePluginManager implements PluginManager {
@@ -588,6 +594,13 @@ public final class SimplePluginManager implements PluginManager {
}
}
@ -566,7 +566,7 @@ index 974ff7116b294473ec450757e8a9341540f43dcd..fc2dae69165776d08274e34a69962cc7
@Override
public void clearPlugins() {
if (true) {this.paperPluginManager.clearPlugins(); return;} // Paper
@@ -641,7 +654,13 @@ public final class SimplePluginManager implements PluginManager {
@@ -653,7 +666,13 @@ public final class SimplePluginManager implements PluginManager {
));
}
} catch (Throwable ex) {

View File

@ -432,10 +432,10 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 0ffe5812e2d59d3fbf56061eea0a2f391cde6758..ba58936116ce1e2e805a03251bb19484058e4f0f 100644
index 881c75e84ef31390a3519549985af2711e2828b5..fc8c807ae9793452bbf3fbab5e72d05676e6fa83 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1206,6 +1206,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1250,6 +1250,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
spigot().sendMessage(position, components);
}

View File

@ -7,10 +7,10 @@ Upstream added methods for this so the original methods
are now deprecated
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 7879082361d0f5ef8a0f15547ed7ce990b41acc0..eb8dcf3dc9acb171fec5b25342a9a38d7f9bcb36 100644
index 67115810d5e837f154c3accd92dbb5e4192d264f..32e89741ffd895e31af0104a0126c2f72742a1bb 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -217,12 +217,44 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -243,12 +243,44 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
public int getArrowsInBody();
@ -56,7 +56,7 @@ index 7879082361d0f5ef8a0f15547ed7ce990b41acc0..eb8dcf3dc9acb171fec5b25342a9a38d
/**
* Returns the living entity's current maximum no damage ticks.
@@ -749,4 +781,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -777,4 +809,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @return Whether the entity is invisible
*/
public boolean isInvisible();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index ba58936116ce1e2e805a03251bb19484058e4f0f..6a8f5720ef33b54b3a89d4299462827ab304e0d9 100644
index fc8c807ae9793452bbf3fbab5e72d05676e6fa83..6a7d63691fa3be09da0ade66cf07a41ae08d4190 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2163,6 +2163,180 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2207,6 +2207,180 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
void setResourcePack(@NotNull UUID uuid, @NotNull String url, byte @Nullable [] hash, net.kyori.adventure.text.@Nullable Component prompt, boolean force);
// Paper end

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add command to reload permissions.yml and require confirm to
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index bafbb72996cb0cacf17b5741a7efbb1583277c6e..0ce6fda182e4d87b1ef7abe4d8bd9e3a06891412 100644
index 19efe5cb6a8c2dcc5b293ff24caa58c9a57fc083..c9be84560ee18ffe1bb84f159b2ed61c79f9e971 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2306,6 +2306,13 @@ public final class Bukkit {
@@ -2329,6 +2329,13 @@ public final class Bukkit {
public static org.bukkit.command.CommandMap getCommandMap() {
return server.getCommandMap();
}
@ -24,10 +24,10 @@ index bafbb72996cb0cacf17b5741a7efbb1583277c6e..0ce6fda182e4d87b1ef7abe4d8bd9e3a
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 7edac90aa6f37c9c3ebbe7260186ae3e279cea0b..f9dcb6728afb646f9c27e6642bb3b0d91e4448e9 100644
index 4c9c14b60eb6fd1d9845632c2c2fa765d882a741..c0c61a29ba8d3c95ff76c36e4333740320302b4a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2036,4 +2036,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2055,4 +2055,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
Spigot spigot();
// Spigot end

View File

@ -7,7 +7,7 @@ Fires when an Entity decides to start moving to a location.
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..5804497f34bac9a9b6b16c6e5decb0119467df7b
index 0000000000000000000000000000000000000000..8267e8f1f0ade29a284831069e1268ee4b29e109
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityPathfindEvent.java
@@ -0,0 +1,87 @@
@ -74,7 +74,7 @@ index 0000000000000000000000000000000000000000..5804497f34bac9a9b6b16c6e5decb011
+ */
+ @NotNull
+ public Location getLoc() {
+ return this.location;
+ return this.location.clone();
+ }
+
+ @Override

View File

@ -10,7 +10,7 @@ Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..f64b253f1794c7987a32a4313df19d7512bea1bc
index 0000000000000000000000000000000000000000..dbb635686e9108b9d3df5d373e6972cca07c0621
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerUseUnknownEntityEvent.java
@@ -0,0 +1,86 @@
@ -28,7 +28,7 @@ index 0000000000000000000000000000000000000000..f64b253f1794c7987a32a4313df19d75
+
+/**
+ * Represents an event that is called when a player right-clicks an unknown entity.
+ * Useful for plugins dealing with virtual entities (entities that don't actually spawned on the server).
+ * Useful for plugins dealing with virtual entities (entities that aren't actually spawned on the server).
+ * <br>
+ * This event may be called multiple times per interaction with different interaction hands
+ * and with or without the clicked position.

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Arrow pickup rule API
diff --git a/src/main/java/org/bukkit/entity/AbstractArrow.java b/src/main/java/org/bukkit/entity/AbstractArrow.java
index 5b50a4e10e8ace8cc53ad3c8d7c3185f88d5c8db..e8e56e89e32d84af0639fe2e9b0eeabd747b6007 100644
index 9a0a1fa4b7a7e1e1174a75a388081b332d4bedbd..839e5b7df49f42b5fec7729997bef3370ba36d80 100644
--- a/src/main/java/org/bukkit/entity/AbstractArrow.java
+++ b/src/main/java/org/bukkit/entity/AbstractArrow.java
@@ -141,4 +141,38 @@ public interface AbstractArrow extends Projectile {
@@ -160,4 +160,38 @@ public interface AbstractArrow extends Projectile {
*/
CREATIVE_ONLY
}

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases
Reload the aliases stored in commands.yml
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 0ce6fda182e4d87b1ef7abe4d8bd9e3a06891412..cf5cf4375f3a0bd68bb00dc061a039c9c1de0b5e 100644
index c9be84560ee18ffe1bb84f159b2ed61c79f9e971..2dfd0080a0b0f05c5e5defa4326e0da9b85c2df5 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2313,6 +2313,15 @@ public final class Bukkit {
@@ -2336,6 +2336,15 @@ public final class Bukkit {
public static void reloadPermissions() {
server.reloadPermissions();
}
@ -26,10 +26,10 @@ index 0ce6fda182e4d87b1ef7abe4d8bd9e3a06891412..cf5cf4375f3a0bd68bb00dc061a039c9
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index f9dcb6728afb646f9c27e6642bb3b0d91e4448e9..d15b926de36f29ced80e0cfef7594ce0646b988e 100644
index c0c61a29ba8d3c95ff76c36e4333740320302b4a..422a000ec33163f2f07502a05302b5d8851b2318 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2038,4 +2038,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2057,4 +2057,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
// Spigot end
void reloadPermissions(); // Paper

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add String based Action Bar API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 6a8f5720ef33b54b3a89d4299462827ab304e0d9..83f9026e86223bc763990a90da5fda26dec2785f 100644
index 6a7d63691fa3be09da0ade66cf07a41ae08d4190..252390260f62ee945c21267cd8717b7725158a21 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1173,6 +1173,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1217,6 +1217,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@ -48,7 +48,7 @@ index 6a8f5720ef33b54b3a89d4299462827ab304e0d9..83f9026e86223bc763990a90da5fda26
/**
* Sends the component to the player
*
@@ -1200,9 +1233,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1244,9 +1277,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Sends an array of components as a single message to the specified screen position of this player
*

View File

@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size()
which creates copy of the collections.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 41a181b890e029f99e52ae9aad28a86f28005f9e..fa6f6c8eccd680a4e83443e472f37650e7cd05c5 100644
index 890ae536fdaff11055b72b1be0fbf3766a41812c..4dc687f16a8181876fb7b3e56b39a55ea5507408 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -49,6 +49,33 @@ import org.jetbrains.annotations.Nullable;

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index cf5cf4375f3a0bd68bb00dc061a039c9c1de0b5e..5f758640ae71bca8c5e532af21362011a0aafb89 100644
index 2dfd0080a0b0f05c5e5defa4326e0da9b85c2df5..6b3a332f556e7c49796a62f20fd33241bbcde09e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2322,6 +2322,16 @@ public final class Bukkit {
@@ -2345,6 +2345,16 @@ public final class Bukkit {
public static boolean reloadCommandAliases() {
return server.reloadCommandAliases();
}
@ -27,10 +27,10 @@ index cf5cf4375f3a0bd68bb00dc061a039c9c1de0b5e..5f758640ae71bca8c5e532af21362011
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index d15b926de36f29ced80e0cfef7594ce0646b988e..e3136651ce083e67a1a7cb976d27df5666843401 100644
index 422a000ec33163f2f07502a05302b5d8851b2318..9088bd9dfb515381d5df1c255ae3319f9cdde81e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2040,4 +2040,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2059,4 +2059,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
void reloadPermissions(); // Paper
boolean reloadCommandAliases(); // Paper
@ -46,7 +46,7 @@ index d15b926de36f29ced80e0cfef7594ce0646b988e..e3136651ce083e67a1a7cb976d27df56
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 5cfd88eec9bf02e83d77b6fce1a5c14b7687f48b..1c6205cc667bbec8f6aca479f13b3e9cfcd63ab2 100644
index 33c0a60e71f4bd29966c10ea60b22f14e56c1de4..f7b78198d9983610fc2185124c3080e6b1c0fa35 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -99,7 +99,7 @@ public abstract class Command {

View File

@ -49,10 +49,10 @@ index a04cde615f8c4bc593f8d9f8f6f1438008aaa707..548f6d28c28d74bed8b58ee828759093
* @param target the target to remove from this list
*/
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 5f758640ae71bca8c5e532af21362011a0aafb89..2bdba56855d3427a1c48bfada0e6416085386cdb 100644
index 6b3a332f556e7c49796a62f20fd33241bbcde09e..3b7087d5c71a498f513f67514db9e118780363c7 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1494,6 +1494,8 @@ public final class Bukkit {
@@ -1506,6 +1506,8 @@ public final class Bukkit {
/**
* Gets every player that has ever played on this server.
@ -114,10 +114,10 @@ index 4c9fd558fbf7f57a948fbb7f80f4651048c0fb57..458119a9ef7ce8e1f59bd47caa5b4bc6
* @param statePredicate The predicate which should get used to test if a block should be set or not.
* @return true if the tree was created successfully, otherwise false
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index e3136651ce083e67a1a7cb976d27df5666843401..50e8c25cc378b02b09ef57643cc753fa58ec1166 100644
index 9088bd9dfb515381d5df1c255ae3319f9cdde81e..012b5954a2f9dc61fb8ad29c4b8bce2648ddc681 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -568,13 +568,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -570,13 +570,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* </ul>
* <p>
* <b>Note:</b> If set to 0, {@link SpawnCategory} mobs spawning will be disabled.
@ -132,7 +132,7 @@ index e3136651ce083e67a1a7cb976d27df5666843401..50e8c25cc378b02b09ef57643cc753fa
*/
public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory);
@@ -1274,6 +1271,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1284,6 +1281,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
/**
* Gets every player that has ever played on this server.
@ -142,10 +142,10 @@ index e3136651ce083e67a1a7cb976d27df5666843401..50e8c25cc378b02b09ef57643cc753fa
* @return an array containing all previous players
*/
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index fa6f6c8eccd680a4e83443e472f37650e7cd05c5..6decacdf85827305dbee9d34dadef4bc7c69e20a 100644
index 4dc687f16a8181876fb7b3e56b39a55ea5507408..98e3c12801cc36c868f08b15d1188295ea4364e0 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2714,7 +2714,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2739,7 +2739,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Find the closest nearby structure of a given {@link StructureType}.
* Finding unexplored structures can, and will, block if the world is
@ -154,7 +154,7 @@ index fa6f6c8eccd680a4e83443e472f37650e7cd05c5..6decacdf85827305dbee9d34dadef4bc
* temporarily freezing while locating an unexplored structure.
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
@@ -2748,7 +2748,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2773,7 +2773,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Find the closest nearby structure of a given {@link StructureType}.
* Finding unexplored structures can, and will, block if the world is
@ -163,7 +163,7 @@ index fa6f6c8eccd680a4e83443e472f37650e7cd05c5..6decacdf85827305dbee9d34dadef4bc
* temporarily freezing while locating an unexplored structure.
* <p>
* The {@code radius} is not a rigid square radius. Each structure may alter
@@ -2781,7 +2781,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2806,7 +2806,7 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
/**
* Find the closest nearby structure of a given {@link Structure}. Finding
* unexplored structures can, and will, block if the world is looking in
@ -343,10 +343,10 @@ index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Arrow.java b/src/main/java/org/bukkit/entity/Arrow.java
index 8eb0cf31b1ce6d714a14cf65bbb117ff163ae2f3..8e57082e8b19a2fd9625816c2ea4a90d41f78ca5 100644
index bd1116adc891b2a4243da205127f5ece76089925..4d4c9efb81ac14950b24a07edcfe1c46ab3caf91 100644
--- a/src/main/java/org/bukkit/entity/Arrow.java
+++ b/src/main/java/org/bukkit/entity/Arrow.java
@@ -93,7 +93,7 @@ public interface Arrow extends AbstractArrow {
@@ -73,7 +73,7 @@ public interface Arrow extends AbstractArrow {
* Removes a custom potion effect from this arrow.
*
* @param type the potion effect type to remove
@ -369,7 +369,7 @@ index 1e56aef9188487d3e9c737e85025f601ab359a72..92cd35c87bad578c2b714761c93a5b72
*/
LAND_ON_PORTAL,
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 09936f3a2376a46721bbc8365c989581c2a789ef..3845a726adbd0e75d7bf2aeeb6da8cb571d51a8f 100644
index fffc478312566bc5c36dbacbdd86341d84d50054..8d97cf229ce1d14232d0342121b5db2230795a1d 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -22,6 +22,11 @@ import org.jetbrains.annotations.Nullable;
@ -426,10 +426,10 @@ index ae9eaaa8e38e1d9dfc459926c7fc51ddb89de84a..b2ec535bb1b0ce0c114ddd7638b90218
@Override
public int getConversionTime();
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ede1b0e7b6 100644
index 252390260f62ee945c21267cd8717b7725158a21..cd00d2a064ee4c86b394a7861182fba9cf79cfb3 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -434,15 +434,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -478,15 +478,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Saves the players current location, health, inventory, motion, and
@ -449,7 +449,7 @@ index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ed
* <p>
* Note: This will overwrite the players current inventory, health,
* motion, etc, with the state from the saved dat file.
@@ -779,7 +779,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -823,7 +823,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Plays an effect to just this player.
*
@ -458,7 +458,7 @@ index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ed
* @param loc the location to play the effect at
* @param effect the {@link Effect}
* @param data a data bit needed for some effects
@@ -1190,7 +1190,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1234,7 +1234,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* Use supplied alternative character to the section symbol to represent legacy color codes.
*
@ -467,7 +467,7 @@ index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ed
* @param message The message to send
* @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
*/
@@ -1656,7 +1656,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1700,7 +1700,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Allows this player to see a player that was previously hidden. If
@ -476,7 +476,7 @@ index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ed
* remain hidden until the other plugin calls this method too.
*
* @param plugin Plugin that wants to show the player
@@ -1683,7 +1683,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1727,7 +1727,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Allows this player to see an entity that was previously hidden. If
@ -485,7 +485,7 @@ index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ed
* remain hidden until the other plugin calls this method too.
*
* @param plugin Plugin that wants to show the entity
@@ -1766,9 +1766,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1810,9 +1810,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
@ -495,7 +495,7 @@ index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ed
* <li>The request is send with "null" as the hash. This might result
* in newer versions not loading the pack correctly.
* </ul>
@@ -1802,9 +1799,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1846,9 +1843,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
@ -505,7 +505,7 @@ index 83f9026e86223bc763990a90da5fda26dec2785f..d507aeb5b906b5b68d1daa5bfd2d98ed
* <li>The request is send with empty string as the hash. This might result
* in newer versions not loading the pack correctly.
* </ul>
@@ -1841,9 +1835,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1885,9 +1879,6 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* case this method will have no affect on them. Use the
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
* the player loaded the pack!
@ -641,10 +641,10 @@ index be0a2d1f234d8265d98e54e518a994957b1f3ab7..4e3c406ba883aae553e8d69b6b719b87
* than BLOCK_CANBUILD, as this refers to a player, not universe-physics
* rule like cactus on dirt.
diff --git a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
index 2ff1b1308571d8f8056d3359e8a8ba4a589c3726..e9a6e5be5f33a342f7e5c496f0f1c64b2f302ace 100644
index fc2120e03737f5882d6ae916db93fdcf4939b2ba..f2edd4a9357832e9dec3fb0aafa006335d7b289b 100644
--- a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
+++ b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
@@ -80,7 +80,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
@@ -81,7 +81,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
/**
* Get a list of available {@link EnchantmentOffer} for the player. You can
* modify the values to change the available offers for the player. An offer
@ -850,10 +850,16 @@ index 1440c6115520d692faf75455df35b92aa8734491..0808e7aeffb69160913344de5b5e21d5
public class FurnaceStartSmeltEvent extends InventoryBlockStartEvent {
private static final HandlerList handlers = new HandlerList();
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
index 79797a2be7fb139d528116d34d13e51d39b96e56..fe58058f9b5d29388d48115cc81dc48ab08c58c1 100644
index 79797a2be7fb139d528116d34d13e51d39b96e56..f2a2a2ad9930499c5bf624e73571a3294a90db14 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryClickEvent.java
@@ -19,9 +19,10 @@ import org.jetbrains.annotations.Nullable;
@@ -16,12 +16,16 @@ import org.jetbrains.annotations.Nullable;
/**
* This event is called when a player clicks in an inventory.
* <p>
+ * In case of a drag action within an inventory, InventoryClickEvent is never called.
+ * Instead, {@link InventoryDragEvent} is called at the end of the drag.
+ * <p>
* Because InventoryClickEvent occurs within a modification of the Inventory,
* not all Inventory related methods are safe to use.
* <p>
@ -867,7 +873,7 @@ index 79797a2be7fb139d528116d34d13e51d39b96e56..fe58058f9b5d29388d48115cc81dc48a
* <ul>
* <li>{@link HumanEntity#closeInventory()}
* <li>{@link HumanEntity#openInventory(Inventory)}
@@ -92,7 +93,7 @@ public class InventoryClickEvent extends InventoryInteractEvent {
@@ -92,7 +96,7 @@ public class InventoryClickEvent extends InventoryInteractEvent {
/**
* Gets the ItemStack currently in the clicked slot.
*
@ -976,7 +982,7 @@ index 0cc6e29a5af28e95f87f415d6b2424d4622a6f34..c0b749a5bbf4980d01fed74768bb6190
* @param z the z location in the chunk from 0-15 inclusive
* @return Biome value
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf22b50ab7e 100644
index 9adc827bc52eaa767a39c82e9cb0ff5a48e02b14..2dde946443fee1f6e79b882cbcb448549dc0c99c 100644
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
+++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java
@@ -37,9 +37,23 @@ public interface EntityEquipment {
@ -1160,13 +1166,10 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
ItemStack getBoots();
/**
@@ -202,12 +296,25 @@ public interface EntityEquipment {
void setBoots(@Nullable ItemStack boots, boolean silent);
@@ -204,12 +298,25 @@ public interface EntityEquipment {
/**
- * Gets a copy of all worn armor
+ * Gets all worn armor
+ *
* Gets all ItemStacks from the armor slots.
*
+ * <p>
+ * This returns a copy if this equipment instance is from a non-player,
+ * or it's an empty stack (has AIR as its type).
@ -1180,8 +1183,10 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
+ * equipment.getArmorContents(); // will return an array of copies
+ * }
+ * }</pre>
*
* @return The array of worn armor. Individual items may be null.
+ *
* @return all the ItemStacks from the armor slots. Individual items can be
* null and are returned in a fixed order starting from the boots and going
* up to the helmet
*/
- @NotNull
- ItemStack[] getArmorContents();
@ -1189,7 +1194,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
/**
* Sets the entities armor to the provided array of ItemStacks
@@ -247,7 +354,8 @@ public interface EntityEquipment {
@@ -249,7 +356,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1199,7 +1204,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @return chance of the currently held item being dropped (1 for non-{@link Mob})
@@ -260,7 +368,8 @@ public interface EntityEquipment {
@@ -262,7 +370,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1209,7 +1214,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @param chance the chance of the main hand item being dropped
@@ -274,7 +383,8 @@ public interface EntityEquipment {
@@ -276,7 +385,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1219,7 +1224,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @return chance of the off hand item being dropped (1 for non-{@link Mob})
@@ -287,7 +397,8 @@ public interface EntityEquipment {
@@ -289,7 +399,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1229,7 +1234,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @param chance the chance of off hand item being dropped
@@ -300,7 +411,8 @@ public interface EntityEquipment {
@@ -302,7 +413,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1239,7 +1244,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @return the chance of the helmet being dropped (1 for non-{@link Mob})
@@ -312,7 +424,8 @@ public interface EntityEquipment {
@@ -314,7 +426,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1249,7 +1254,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @param chance of the helmet being dropped
@@ -326,7 +439,8 @@ public interface EntityEquipment {
@@ -328,7 +441,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1259,7 +1264,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @return the chance of the chest plate being dropped (1 for non-{@link Mob})
@@ -339,7 +453,8 @@ public interface EntityEquipment {
@@ -341,7 +455,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1269,7 +1274,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @param chance of the chest plate being dropped
@@ -353,7 +468,8 @@ public interface EntityEquipment {
@@ -355,7 +470,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1279,7 +1284,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @return the chance of the leggings being dropped (1 for non-{@link Mob})
@@ -366,7 +482,8 @@ public interface EntityEquipment {
@@ -368,7 +484,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1289,7 +1294,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @param chance chance of the leggings being dropped
@@ -379,7 +496,8 @@ public interface EntityEquipment {
@@ -381,7 +498,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1299,7 +1304,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
* </ul>
*
* @return the chance of the boots being dropped (1 for non-{@link Mob})
@@ -391,7 +509,8 @@ public interface EntityEquipment {
@@ -393,7 +511,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
@ -1310,7 +1315,7 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf2
*
* @param chance of the boots being dropped
diff --git a/src/main/java/org/bukkit/inventory/ItemFlag.java b/src/main/java/org/bukkit/inventory/ItemFlag.java
index 42fcc31147934fd4ed6484b0729e938e7ae2f8e2..4e637420b9a39b822be19367a16da93f236549b3 100644
index 8453bd058d426c1088b04c55d2448d205f0a104b..1b3580d1861af402396121805715e4087b3bc587 100644
--- a/src/main/java/org/bukkit/inventory/ItemFlag.java
+++ b/src/main/java/org/bukkit/inventory/ItemFlag.java
@@ -35,7 +35,7 @@ public enum ItemFlag {
@ -1323,10 +1328,10 @@ index 42fcc31147934fd4ed6484b0729e938e7ae2f8e2..4e637420b9a39b822be19367a16da93f
HIDE_ARMOR_TRIM;
}
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..5461f7fa75f5a065bb333b4a113640b5fe1e3825 100644
index f1918027c3a8735b31566856218611656b56db20..476fe14faa39f02444cab8ad95d4401033dc6938 100644
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -158,7 +158,7 @@ public interface PlayerInventory extends Inventory {
@@ -160,7 +160,7 @@ public interface PlayerInventory extends Inventory {
public void setBoots(@Nullable ItemStack boots);
/**
@ -1335,7 +1340,7 @@ index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..5461f7fa75f5a065bb333b4a113640b5
* in their main hand.
*
* @return the currently held item
@@ -174,7 +174,7 @@ public interface PlayerInventory extends Inventory {
@@ -176,7 +176,7 @@ public interface PlayerInventory extends Inventory {
void setItemInMainHand(@Nullable ItemStack item);
/**
@ -1344,7 +1349,7 @@ index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..5461f7fa75f5a065bb333b4a113640b5
* in their off hand.
*
* @return the currently held item
@@ -190,7 +190,7 @@ public interface PlayerInventory extends Inventory {
@@ -192,7 +192,7 @@ public interface PlayerInventory extends Inventory {
void setItemInOffHand(@Nullable ItemStack item);
/**
@ -1433,10 +1438,10 @@ index 07c3dff4d6190ef388d9c1e1c36f67f00a3e8e66..597a18a767b68b47e81454b7d44613c7
* @param input The input choice.
* @return The changed recipe, so you can chain calls.
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index f1fcc844d563a0108230676dec84ef25485756b3..80836c5f87c15d688f27af5247b4e114cea7028d 100644
index d7c178b3584db5866a5a21c6ddaab876b94058b9..dff32cedf47e95fe14a865898d76b62748dee5f3 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -311,7 +311,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -483,7 +483,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
/**
* Return an immutable copy of all {@link Attribute}s and their
* {@link AttributeModifier}s for a given {@link EquipmentSlot}.<br>

View File

@ -321,10 +321,10 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 2bdba56855d3427a1c48bfada0e6416085386cdb..48cce5c4a31ce9df3f2fe0aba4dd50e0547493b6 100644
index 3b7087d5c71a498f513f67514db9e118780363c7..b165a4f99802ced243f1fb56af2bcf2c2ab7abf1 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2334,6 +2334,83 @@ public final class Bukkit {
@@ -2357,6 +2357,83 @@ public final class Bukkit {
public static boolean suggestPlayerNamesWhenNullTabCompletions() {
return server.suggestPlayerNamesWhenNullTabCompletions();
}
@ -409,10 +409,10 @@ index 2bdba56855d3427a1c48bfada0e6416085386cdb..48cce5c4a31ce9df3f2fe0aba4dd50e0
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 50e8c25cc378b02b09ef57643cc753fa58ec1166..7bbd014aa3ecbae15518d9ebe4e6ec03a870ed5e 100644
index 012b5954a2f9dc61fb8ad29c4b8bce2648ddc681..8e4bf531c0a2f7101c2a3733fe33733d31c611fd 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2048,5 +2048,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2067,5 +2067,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return true if player names should be suggested
*/
boolean suggestPlayerNamesWhenNullTabCompletions();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 3845a726adbd0e75d7bf2aeeb6da8cb571d51a8f..abdca9fe5acc90f167219eb769ece66c35682bb1 100644
index 8d97cf229ce1d14232d0342121b5db2230795a1d..c426bdea5ef71a095cf2af9a8a83a162db3c05b7 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -339,6 +339,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -329,6 +329,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
public int getExpToLevel();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner()
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index b0967614bfdba06b5e11c910186aa66ac7e2d503..b422a949b22edf412b518abb3e5ca0847c73d36b 100644
index 4e1fb0974d061d5bb64899cac576318d2e6f8bf6..45f475b42bbef1c5dc461b3891a48c8fb6feefd3 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -790,5 +790,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -801,5 +801,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@Nullable
Location getOrigin();

View File

@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this,
You must replace the language file embedded in the server jar.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 3e7f92dc0aea0ea555dd02c50a1102da46fe74c4..16131648915ad4065b82905ab7c799e7554cca2d 100644
index dbaf54018a7dd392378869a5a302a880c7a56338..213e3f3de731d85f788a4bfa8d912e1b59c3c045 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -235,4 +235,20 @@ public interface ItemFactory {
@ -33,10 +33,10 @@ index 3e7f92dc0aea0ea555dd02c50a1102da46fe74c4..16131648915ad4065b82905ab7c799e7
+ // Paper end - add getI18NDisplayName
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index e76c847e57f3d32757129d56922862a4202c9d07..8801a49b1ed6e21d9853f1290e52d6f90ce1211f 100644
index 53cc84d1ef6e281e8637ec7406236e1185ad7d82..22bb39a8f124d55b1dce1bcb981a94d763959e59 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -629,5 +629,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -633,5 +633,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
public net.kyori.adventure.text.@NotNull Component displayName() {
return Bukkit.getServer().getItemFactory().displayName(this);
}

View File

@ -7,7 +7,7 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr
to ensure it meets latest minecraft expectations.
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 16131648915ad4065b82905ab7c799e7554cca2d..a3d40ca984202a5fec0cfcc97266f32408c37638 100644
index 213e3f3de731d85f788a4bfa8d912e1b59c3c045..898c256140cc7fee2c0cc65cca33a0e86275f115 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -251,4 +251,18 @@ public interface ItemFactory {
@ -30,10 +30,10 @@ index 16131648915ad4065b82905ab7c799e7554cca2d..a3d40ca984202a5fec0cfcc97266f324
+ // Paper end - ensure server conversions API
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 8801a49b1ed6e21d9853f1290e52d6f90ce1211f..e175865e3149861583a38f4271375f7be020b6ff 100644
index 22bb39a8f124d55b1dce1bcb981a94d763959e59..0586a64b780f0dee9899a42ca4ee28d12efd749a 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -548,7 +548,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -552,7 +552,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
}
}
@ -42,7 +42,7 @@ index 8801a49b1ed6e21d9853f1290e52d6f90ce1211f..e175865e3149861583a38f4271375f7b
}
/**
@@ -630,6 +630,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -634,6 +634,19 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
return Bukkit.getServer().getItemFactory().displayName(this);
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] LivingEntity#setKiller
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index b67e6eca393b66c92fc62b35123bb3eb2f372b7c..c8c88c08d2f03cff267e76749156c584bf7adf42 100644
index 32e89741ffd895e31af0104a0126c2f72742a1bb..f154c5607b1dc3585052d9f02cf8b28cf8a3c886 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -339,6 +339,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -365,6 +365,15 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@Nullable
public Player getKiller();

View File

@ -14,13 +14,13 @@ it without having to shade it in the plugin and going through
several layers of logging abstraction.
diff --git a/build.gradle.kts b/build.gradle.kts
index f9ff7e3692d448e2a1e38d0aa26c2d934442e247..50dd795c67557c7d2668068af0bba87a1ec8dc43 100644
index 5ccdd695948d1d36173b0a4516cfe8494dd01b06..65e67b8726f1e19a6bcb1fe2f448e4ab68df11d1 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,6 +12,8 @@ java {
val annotationsVersion = "24.0.1"
val annotationsVersion = "24.1.0"
val bungeeCordChatVersion = "1.20-R0.2"
val adventureVersion = "4.15.0"
val adventureVersion = "4.17.0-SNAPSHOT"
+val slf4jVersion = "2.0.9"
+val log4jVersion = "2.17.1"
val apiAndDocs: Configuration by configurations.creating {
@ -33,12 +33,12 @@ index f9ff7e3692d448e2a1e38d0aa26c2d934442e247..50dd795c67557c7d2668068af0bba87a
+ api("org.apache.logging.log4j:log4j-api:$log4jVersion")
+ api("org.slf4j:slf4j-api:$slf4jVersion")
implementation("org.ow2.asm:asm:9.5")
implementation("org.ow2.asm:asm-commons:9.5")
implementation("org.ow2.asm:asm:9.7")
implementation("org.ow2.asm:asm-commons:9.7")
@@ -137,6 +141,8 @@ tasks.withType<Javadoc> {
"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
//"https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
//"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
//"https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
// Paper end

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add PlayerJumpEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..d3c319298d360967b853cf0168c0a1833f094779
index 0000000000000000000000000000000000000000..8c2fd2c1120d634052f9bc345365272ad3a67b6f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerJumpEvent.java
@@ -0,0 +1,106 @@
@ -102,7 +102,7 @@ index 0000000000000000000000000000000000000000..d3c319298d360967b853cf0168c0a183
+ */
+ @NotNull
+ public Location getTo() {
+ return this.to;
+ return this.to.clone();
+ }
+
+ @NotNull

View File

@ -93,7 +93,7 @@ index 7cd9f98c042dc2bb80876af35c755f81bef34651..5cd236965de12392d8c7aa81307c0ff1
/**
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 74b6581a97a092c44a0876e7981ff8a8e6153100..d6d3e1332e51adc5611543b2a6689efa5921a9f2 100644
index 58d20eff7e0da2d7fcb1609d55e4284715355634..8c5597e02d71c8db66e9cd11f0a41776eb471c46 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -67,6 +67,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm

View File

@ -9,7 +9,7 @@ on the real tile entity.
This is useful for where performance is needed
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index 870ad6cd930653e6248abcc0fce94ffafbe9ebde..9f4d383ea3d6b26d16b8b77ca4c29d2d839ad6dd 100644
index bda4ab21b3ac2acbe328c0c6887c33283399971e..f3b3606dc5881e931853fc2631aad9ca9083474d 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -272,6 +272,16 @@ public interface Block extends Metadatable, Translatable {

View File

@ -15,7 +15,7 @@ Co-authored-by: Aikar <aikar@aikar.co>
diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..e0847b6f0202bd8267c537f72a5e8c8cb7c6b1db
index 0000000000000000000000000000000000000000..8965974988ad20fbe1d45885f20a3a98d2e9595f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
@@ -0,0 +1,339 @@
@ -208,7 +208,7 @@ index 0000000000000000000000000000000000000000..e0847b6f0202bd8267c537f72a5e8c8c
+ */
+ @Nullable
+ public Location getLocation() {
+ return this.location;
+ return this.location != null ? this.location.clone() : null;
+ }
+
+ /**
@ -534,7 +534,7 @@ index 0000000000000000000000000000000000000000..6f560a51277ccbd46a9142cfa057d276
+ }
+}
diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
index 270e6d8ad4358baa256cee5f16cff281f063ce3b..4a3451af454295ac3e1b688e6665cad9fc594c82 100644
index 270e6d8ad4358baa256cee5f16cff281f063ce3b..b43c3cb5c88eada186d6f81712c244aaa18fb53e 100644
--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
+++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
@@ -29,6 +29,13 @@ public class TabCompleteEvent extends Event implements Cancellable {
@ -570,7 +570,7 @@ index 270e6d8ad4358baa256cee5f16cff281f063ce3b..4a3451af454295ac3e1b688e6665cad9
+ */
+ @org.jetbrains.annotations.Nullable
+ public org.bukkit.Location getLocation() {
+ return loc;
+ return this.loc != null ? this.loc.clone() : null;
+ }
+ // Paper end
+

View File

@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..7b2af1bd72dfbcf4e962a982940fc49b
+
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d507aeb5b906b5b68d1daa5bfd2d98ede1b0e7b6..74ccef3361a8089a2bf03cc3d2e0826f067b647e 100644
index cd00d2a064ee4c86b394a7861182fba9cf79cfb3..401a43573eb84c1192261377a8b58dd73b895d76 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -54,7 +54,7 @@ import org.jetbrains.annotations.Nullable;
@@ -56,7 +56,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a player, connected or not
*/

View File

@ -10,10 +10,10 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 74ccef3361a8089a2bf03cc3d2e0826f067b647e..8ec100779944579f83cfc1be4b124a4c780cdc07 100644
index 401a43573eb84c1192261377a8b58dd73b895d76..8b92f258a85b4184d67d0af396c18400ded38a67 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1499,6 +1499,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1543,6 +1543,15 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void resetPlayerWeather();
@ -29,7 +29,7 @@ index 74ccef3361a8089a2bf03cc3d2e0826f067b647e..8ec100779944579f83cfc1be4b124a4c
/**
* Gets the player's cooldown between picking up experience orbs.
*
@@ -1524,8 +1533,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1568,8 +1577,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Gives the player the amount of experience specified.
*
* @param amount Exp amount to give

View File

@ -16,7 +16,7 @@ See: https://github.com/PaperMC/Paper/issues/917
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..1d582118f19a41b499ee73b5e27ddb66ed34f06b
index 0000000000000000000000000000000000000000..633ef4dcc701916f2dbfefbbebd5994f93ffc2a4
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/PreCreatureSpawnEvent.java
@@ -0,0 +1,109 @@
@ -64,7 +64,7 @@ index 0000000000000000000000000000000000000000..1d582118f19a41b499ee73b5e27ddb66
+ */
+ @NotNull
+ public Location getSpawnLocation() {
+ return this.location;
+ return this.location.clone();
+ }
+
+ /**

View File

@ -7,50 +7,43 @@ Co-authored-by: Connor Linfoot <connorlinfoot@me.com>
Co-authored-by: MCMDEV <john-m.1@gmx.de>
diff --git a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
index 3432872303aa0df97b5d9090fe98b269ef3cb9f4..bdb7d2345e7d3a48a2f0561832ce126a16781e89 100644
index 004f1fd55c143e6c21be74d0a6b9ee8b2e12cc59..ae02788536d0c6736aba4ccf812844df4f9789f1 100644
--- a/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
+++ b/src/main/java/org/bukkit/event/player/AsyncPlayerPreLoginEvent.java
@@ -2,6 +2,8 @@ package org.bukkit.event.player;
import java.net.InetAddress;
import java.util.UUID;
+import com.destroystokyo.paper.profile.PlayerProfile;
+import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import org.jetbrains.annotations.NotNull;
@@ -22,9 +24,10 @@ public class AsyncPlayerPreLoginEvent extends Event {
@@ -22,9 +22,10 @@ public class AsyncPlayerPreLoginEvent extends Event {
private static final HandlerList handlers = new HandlerList();
private Result result;
private net.kyori.adventure.text.Component message; // Paper
- private final String name;
private final InetAddress ipAddress;
- private final UUID uniqueId;
+ private PlayerProfile profile; // Paper
+ private com.destroystokyo.paper.profile.PlayerProfile profile; // Paper
+ private final InetAddress rawAddress; // Paper
+ private final String hostname; // Paper
private final boolean transferred;
@Deprecated
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress) {
@@ -32,12 +35,29 @@ public class AsyncPlayerPreLoginEvent extends Event {
@@ -38,12 +39,30 @@ public class AsyncPlayerPreLoginEvent extends Event {
}
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId) {
public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, boolean transferred) {
+ // Paper start
+ this(name, ipAddress, uniqueId, Bukkit.createProfile(uniqueId, name));
+ this(name, ipAddress, uniqueId, transferred, org.bukkit.Bukkit.createProfile(uniqueId, name));
+ }
+
+ @Deprecated(forRemoval = true)
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) {
+ this(name, ipAddress, ipAddress, uniqueId, profile);
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final UUID uniqueId, boolean transferred, @NotNull com.destroystokyo.paper.profile.PlayerProfile profile) {
+ this(name, ipAddress, ipAddress, uniqueId, transferred, profile);
+ }
+
+ @Deprecated(forRemoval = true)
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile) {
+ this(name, ipAddress, rawAddress, uniqueId, profile, "");
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, boolean transferred, @NotNull com.destroystokyo.paper.profile.PlayerProfile profile) {
+ this(name, ipAddress, rawAddress, uniqueId, transferred, profile, "");
+ }
+
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, @NotNull PlayerProfile profile, @NotNull String hostname) {
+ @org.jetbrains.annotations.ApiStatus.Internal
+ public AsyncPlayerPreLoginEvent(@NotNull final String name, @NotNull final InetAddress ipAddress, @NotNull final InetAddress rawAddress, @NotNull final UUID uniqueId, boolean transferred, @NotNull com.destroystokyo.paper.profile.PlayerProfile profile, @NotNull String hostname) {
+ // Paper end
super(true);
this.result = Result.ALLOWED;
this.message = net.kyori.adventure.text.Component.empty(); // Paper
@ -58,13 +51,12 @@ index 3432872303aa0df97b5d9090fe98b269ef3cb9f4..bdb7d2345e7d3a48a2f0561832ce126a
+ this.profile = profile;
this.ipAddress = ipAddress;
- this.uniqueId = uniqueId;
+ this.rawAddress = rawAddress;
+ this.hostname = hostname;
+ // Paper end
+ this.rawAddress = rawAddress; // Paper
+ this.hostname = hostname; // Paper
this.transferred = transferred;
}
/**
@@ -200,7 +220,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
@@ -207,7 +226,7 @@ public class AsyncPlayerPreLoginEvent extends Event {
*/
@NotNull
public String getName() {
@ -73,7 +65,7 @@ index 3432872303aa0df97b5d9090fe98b269ef3cb9f4..bdb7d2345e7d3a48a2f0561832ce126a
}
/**
@@ -220,9 +240,48 @@ public class AsyncPlayerPreLoginEvent extends Event {
@@ -227,9 +246,48 @@ public class AsyncPlayerPreLoginEvent extends Event {
*/
@NotNull
public UUID getUniqueId() {
@ -87,7 +79,7 @@ index 3432872303aa0df97b5d9090fe98b269ef3cb9f4..bdb7d2345e7d3a48a2f0561832ce126a
+ * @return The Profile
+ */
+ @NotNull
+ public PlayerProfile getPlayerProfile() {
+ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() {
+ return profile;
+ }
+
@ -95,7 +87,7 @@ index 3432872303aa0df97b5d9090fe98b269ef3cb9f4..bdb7d2345e7d3a48a2f0561832ce126a
+ * Changes the PlayerProfile the player will login as
+ * @param profile The profile to use
+ */
+ public void setPlayerProfile(@NotNull PlayerProfile profile) {
+ public void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile) {
+ this.profile = profile;
+ }
+
@ -120,6 +112,6 @@ index 3432872303aa0df97b5d9090fe98b269ef3cb9f4..bdb7d2345e7d3a48a2f0561832ce126a
+ }
+ // Paper end
+
@NotNull
@Override
public HandlerList getHandlers() {
/**
* Gets if this connection has been transferred from another server.
*

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Player.setPlayerProfile API
This can be useful for changing name or skins after a player has logged in.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 48cce5c4a31ce9df3f2fe0aba4dd50e0547493b6..990436521c4d080d7adbd0a8c55f03690f17c1ec 100644
index b165a4f99802ced243f1fb56af2bcf2c2ab7abf1..3ea17583766a462317a6a609ac693b5e488e006d 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1336,8 +1336,10 @@ public final class Bukkit {
@@ -1348,8 +1348,10 @@ public final class Bukkit {
* @return the new PlayerProfile
* @throws IllegalArgumentException if both the unique id is
* <code>null</code> and the name is <code>null</code> or blank
@ -20,7 +20,7 @@ index 48cce5c4a31ce9df3f2fe0aba4dd50e0547493b6..990436521c4d080d7adbd0a8c55f0369
public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) {
return server.createPlayerProfile(uniqueId, name);
}
@@ -1348,8 +1350,10 @@ public final class Bukkit {
@@ -1360,8 +1362,10 @@ public final class Bukkit {
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
@ -31,7 +31,7 @@ index 48cce5c4a31ce9df3f2fe0aba4dd50e0547493b6..990436521c4d080d7adbd0a8c55f0369
public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) {
return server.createPlayerProfile(uniqueId);
}
@@ -1361,8 +1365,10 @@ public final class Bukkit {
@@ -1373,8 +1377,10 @@ public final class Bukkit {
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
@ -56,10 +56,10 @@ index ff59479f4782ac7726504aab239de79fdc840cde..abbf3d6f11350ab2dd47a277771d9f46
/**
* Checks if this player has had their profile banned.
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 7bbd014aa3ecbae15518d9ebe4e6ec03a870ed5e..c60be47a0ac646133211ab4bf17b4fad4d1893db 100644
index 8e4bf531c0a2f7101c2a3733fe33733d31c611fd..427b49836becbb0c9e1cb2e94fab7eb1db452ad9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1143,8 +1143,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1153,8 +1153,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the new PlayerProfile
* @throws IllegalArgumentException if both the unique id is
* <code>null</code> and the name is <code>null</code> or blank
@ -70,7 +70,7 @@ index 7bbd014aa3ecbae15518d9ebe4e6ec03a870ed5e..c60be47a0ac646133211ab4bf17b4fad
PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name);
/**
@@ -1153,8 +1155,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1163,8 +1165,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
@ -81,7 +81,7 @@ index 7bbd014aa3ecbae15518d9ebe4e6ec03a870ed5e..c60be47a0ac646133211ab4bf17b4fad
PlayerProfile createPlayerProfile(@NotNull UUID uniqueId);
/**
@@ -1164,8 +1168,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1174,8 +1178,10 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
@ -93,10 +93,10 @@ index 7bbd014aa3ecbae15518d9ebe4e6ec03a870ed5e..c60be47a0ac646133211ab4bf17b4fad
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 8ec100779944579f83cfc1be4b124a4c780cdc07..ecc99524f20e1d7072bfad3ac310cccc4514e40f 100644
index 8b92f258a85b4184d67d0af396c18400ded38a67..56eed06cd3dbb238330973c1428bffc6d5286019 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3017,6 +3017,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3061,6 +3061,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
}
// Paper end

View File

@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID
This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 990436521c4d080d7adbd0a8c55f03690f17c1ec..4f9ebcd991875d0bf486a8ebb39909f2ac32493b 100644
index 3ea17583766a462317a6a609ac693b5e488e006d..3e32a6bbf593b269f1af23c7e2fdafaccc0d2110 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -719,6 +719,20 @@ public final class Bukkit {
@@ -721,6 +721,20 @@ public final class Bukkit {
return server.getPlayer(id);
}
@ -34,10 +34,10 @@ index 990436521c4d080d7adbd0a8c55f03690f17c1ec..4f9ebcd991875d0bf486a8ebb39909f2
* Gets the plugin manager for interfacing with plugins.
*
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index c60be47a0ac646133211ab4bf17b4fad4d1893db..7c53979f407a6a24c6d16bbfb205a8ac0321e5dc 100644
index 427b49836becbb0c9e1cb2e94fab7eb1db452ad9..19e6cee94caabfe93c841da783c86a3c283ebcb9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -617,6 +617,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -619,6 +619,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
public Player getPlayer(@NotNull UUID id);

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add openSign method to HumanEntity
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f463c2234 100644
index c426bdea5ef71a095cf2af9a8a83a162db3c05b7..2308fa3ca898bcb6c0ac2d4853f82a3398bf51f3 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -500,6 +500,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -490,6 +490,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
@Deprecated
public void setShoulderEntityRight(@Nullable Entity entity);
@ -36,10 +36,10 @@ index abdca9fe5acc90f167219eb769ece66c35682bb1..b3aa3dc6aa5afbc36cc86741b4cba56f
/**
* Make the entity drop the item in their hand.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index ecc99524f20e1d7072bfad3ac310cccc4514e40f..d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b 100644
index 56eed06cd3dbb238330973c1428bffc6d5286019..d68a055ef2b309da6db2de385f27d841adca1f66 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2978,10 +2978,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -3022,10 +3022,12 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Open a Sign for editing by the Player.
*

View File

@ -8,22 +8,23 @@ Allows a more logical API for banning players.
player.banPlayer("Breaking the rules");
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index abbf3d6f11350ab2dd47a277771d9f46221036bd..d8a3b6cb2d0cb035b2ab09e0327bc4f0be457ff7 100644
index abbf3d6f11350ab2dd47a277771d9f46221036bd..ef85e57f812c501fac7abe7dd27c93702f66646f 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -67,6 +67,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -67,6 +67,73 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* @return true if banned, otherwise false
*/
public boolean isBanned();
+ // Paper start
+
+ /**
+ * Permanently Bans this player from the server
+ *
+ * @param reason Reason for Ban
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)}
+ */
+ @NotNull
+ @Deprecated
+ public default BanEntry banPlayer(@Nullable String reason) {
+ return banPlayer(reason, null, null);
+ }
@ -33,8 +34,10 @@ index abbf3d6f11350ab2dd47a277771d9f46221036bd..d8a3b6cb2d0cb035b2ab09e0327bc4f0
+ * @param reason Reason for Ban
+ * @param source Source of the ban, or null for default
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)}
+ */
+ @NotNull
+ @Deprecated
+ public default BanEntry banPlayer(@Nullable String reason, @Nullable String source) {
+ return banPlayer(reason, null, source);
+ }
@ -44,8 +47,10 @@ index abbf3d6f11350ab2dd47a277771d9f46221036bd..d8a3b6cb2d0cb035b2ab09e0327bc4f0
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)}
+ */
+ @NotNull
+ @Deprecated
+ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires) {
+ return banPlayer(reason, expires, null);
+ }
@ -56,12 +61,19 @@ index abbf3d6f11350ab2dd47a277771d9f46221036bd..d8a3b6cb2d0cb035b2ab09e0327bc4f0
+ * @param expires When to expire the ban
+ * @param source Source of the ban or null for default
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)}
+ */
+ @NotNull
+ @Deprecated
+ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) {
+ return banPlayer(reason, expires, source, true);
+ }
+
+ /**
+ * @deprecated use {@link #ban(String, Date, String)}
+ */
+ @NotNull
+ @Deprecated
+ public default BanEntry banPlayer(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source, boolean kickIfOnline) {
+ BanEntry banEntry = Bukkit.getServer().getBanList(BanList.Type.NAME).addBan(getName(), reason, expires, source);
+ if (kickIfOnline && isOnline()) {
@ -74,10 +86,10 @@ index abbf3d6f11350ab2dd47a277771d9f46221036bd..d8a3b6cb2d0cb035b2ab09e0327bc4f0
/**
* Adds this user to the {@link ProfileBanList}. If a previous ban exists, this will
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb4ee4a128 100644
index d68a055ef2b309da6db2de385f27d841adca1f66..9dcec906cea7d4eb6da99ef3100a98218a280594 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1173,6 +1173,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1217,6 +1217,186 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@ -86,9 +98,11 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ *
+ * @param reason Reason for ban
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ // For reference, Bukkit defines this as nullable, while they impl isn't, we'll follow API.
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason) {
+ return banPlayerFull(reason, null, null);
+ }
@ -99,8 +113,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param reason Reason for ban
+ * @param source Source of ban, or null for default
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) {
+ return banPlayerFull(reason, null, source);
+ }
@ -111,8 +127,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable java.util.Date expires) {
+ return banPlayerFull(reason, expires, null);
+ }
@ -124,8 +142,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param expires When to expire the ban
+ * @param source Source of the ban, or null for default
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) {
+ banPlayer(reason, expires, source);
+ return banPlayerIP(reason, expires, source, true);
@ -138,8 +158,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param reason Reason for ban
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) {
+ return banPlayerIP(reason, null, null, kickPlayer);
+ }
@ -151,8 +173,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param source Source of ban, or null for default
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) {
+ return banPlayerIP(reason, null, source, kickPlayer);
+ }
@ -164,8 +188,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param expires When to expire the ban
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, boolean kickPlayer) {
+ return banPlayerIP(reason, expires, null, kickPlayer);
+ }
@ -176,8 +202,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ *
+ * @param reason Reason for ban
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason) {
+ return banPlayerIP(reason, null, null);
+ }
@ -188,8 +216,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param reason Reason for ban
+ * @param source Source of ban, or null for default
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) {
+ return banPlayerIP(reason, null, source);
+ }
@ -200,8 +230,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires) {
+ return banPlayerIP(reason, expires, null);
+ }
@ -213,8 +245,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param expires When to expire the ban
+ * @param source Source of the ban or null for default
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) {
+ return banPlayerIP(reason, expires, source, true);
+ }
@ -227,8 +261,10 @@ index d06f9b4d0117515fb8fcf78d416dcd2b4ef6fb4b..07dde016220eef654901e3d78e2d37fb
+ * @param source Source of the ban or null for default
+ * @param kickPlayer if the targeted player should be kicked
+ * @return Ban Entry
+ * @deprecated use {@link #ban(String, Date, String)} and {@link #banIp(String, Date, String, boolean)}
+ */
+ @Nullable
+ @Deprecated
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source, boolean kickPlayer) {
+ org.bukkit.BanEntry banEntry = org.bukkit.Bukkit.getServer().getBanList(org.bukkit.BanList.Type.IP).addBan(getAddress().getAddress().getHostAddress(), reason, expires, source);
+ if (kickPlayer && isOnline()) {

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 6decacdf85827305dbee9d34dadef4bc7c69e20a..fa4081c62f86245fef5a273f01837f9ac6998faa 100644
index 98e3c12801cc36c868f08b15d1188295ea4364e0..c489140bffdfdfa1e34e71489d308ed10cf10b21 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1,6 +1,9 @@
@ -19,7 +19,7 @@ index 6decacdf85827305dbee9d34dadef4bc7c69e20a..fa4081c62f86245fef5a273f01837f9a
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -627,6 +630,238 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -636,6 +639,238 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes);

View File

@ -10,13 +10,15 @@ This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
new file mode 100644
index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f05eb5dc6
index 0000000000000000000000000000000000000000..e63aabacac12a153ee8f413b529629192cea6900
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
@@ -0,0 +1,485 @@
@@ -0,0 +1,579 @@
+package com.destroystokyo.paper;
+
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import it.unimi.dsi.fastutil.objects.ObjectArrayList;
+import org.bukkit.Color;
+import org.bukkit.Location;
+import org.bukkit.Particle;
@ -26,6 +28,7 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+
+import java.util.Collection;
+import java.util.List;
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
@ -34,7 +37,7 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ *
+ * Usage of the builder is preferred over the super long {@link World#spawnParticle(Particle, Location, int, double, double, double, double, Object)} API
+ */
+public class ParticleBuilder {
+public class ParticleBuilder implements Cloneable {
+
+ private Particle particle;
+ private List<Player> receivers;
@ -470,7 +473,7 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ */
+ @NotNull
+ public ParticleBuilder color(@Nullable Color color, float size) {
+ if (particle != Particle.REDSTONE && color != null) {
+ if (particle != Particle.DUST && color != null) {
+ throw new IllegalStateException("Color may only be set on REDSTONE");
+ }
+
@ -498,12 +501,103 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ public ParticleBuilder color(int r, int g, int b) {
+ return color(Color.fromRGB(r, g, b));
+ }
+
+ /**
+ * Sets the particle Color.
+ * Only valid for REDSTONE.
+ *
+ * @param rgb an integer representing the red, green, and blue color components
+ * @return a reference to this object.
+ * @throws IllegalArgumentException if called on a particle builder that does not have
+ */
+ @NotNull
+ public ParticleBuilder color(final int rgb) {
+ return color(Color.fromRGB(rgb));
+ }
+
+ /**
+ * Sets the particle Color Transition. Only valid for DUST_COLOR_TRANSITION.
+ *
+ * @param fromColor the new particle from color
+ * @param toColor the new particle to color
+ * @return a reference to this object.
+ * @throws IllegalArgumentException if the particle builder's {@link #particle()} isn't {@link Particle#DUST_COLOR_TRANSITION}.
+ */
+ @NotNull
+ public ParticleBuilder colorTransition(@NotNull final Color fromColor, @NotNull final Color toColor) {
+ return colorTransition(fromColor, toColor, 1);
+ }
+
+ /**
+ * Sets the particle Color Transition.
+ * Only valid for DUST_COLOR_TRANSITION.
+ *
+ * @param fromRed red color component for the from color
+ * @param fromGreen green color component for the from color
+ * @param fromBlue blue color component for the from color
+ * @param toRed red color component for the to color
+ * @param toGreen green color component for the to color
+ * @param toBlue blue color component for the to color
+ * @return a reference to this object.
+ * @throws IllegalArgumentException if the particle builder's {@link #particle()} isn't {@link Particle#DUST_COLOR_TRANSITION}.
+ */
+ @NotNull
+ public ParticleBuilder colorTransition(final int fromRed, final int fromGreen, final int fromBlue,
+ final int toRed, final int toGreen, final int toBlue) {
+ return colorTransition(Color.fromRGB(fromRed, fromGreen, fromBlue), Color.fromRGB(toRed, toGreen, toBlue));
+ }
+
+ /**
+ * Sets the particle Color Transition.
+ * Only valid for DUST_COLOR_TRANSITION.
+ *
+ * @param fromRgb an integer representing the red, green, and blue color components for the from color
+ * @param toRgb an integer representing the red, green, and blue color components for the to color
+ * @return a reference to this object.
+ * @throws IllegalArgumentException if the particle builder's {@link #particle()} isn't {@link Particle#DUST_COLOR_TRANSITION}.
+ */
+ @NotNull
+ public ParticleBuilder colorTransition(final int fromRgb, final int toRgb) {
+ return colorTransition(Color.fromRGB(fromRgb), Color.fromRGB(toRgb));
+ }
+
+ /**
+ * Sets the particle Color Transition and size. Only valid for DUST_COLOR_TRANSITION.
+ *
+ * @param fromColor the new particle color for the from color.
+ * @param toColor the new particle color for the to color.
+ * @param size the size of the particle
+ * @return a reference to this object.
+ * @throws IllegalArgumentException if the particle builder's {@link #particle()} isn't {@link Particle#DUST_COLOR_TRANSITION}.
+ */
+ @NotNull
+ public ParticleBuilder colorTransition(@NotNull final Color fromColor,
+ @NotNull final Color toColor,
+ final float size) {
+ Preconditions.checkArgument(fromColor != null, "Cannot define color transition with null fromColor.");
+ Preconditions.checkArgument(toColor != null, "Cannot define color transition with null toColor.");
+ Preconditions.checkArgument(this.particle() == Particle.DUST_COLOR_TRANSITION, "Can only define a color transition on particle DUST_COLOR_TRANSITION.");
+ return data(new Particle.DustTransition(fromColor, toColor, size));
+ }
+
+ @NotNull
+ @Override
+ public ParticleBuilder clone() {
+ try {
+ final ParticleBuilder builder = (ParticleBuilder) super.clone();
+ if (this.location != null) builder.location = this.location.clone();
+ if (this.receivers != null) builder.receivers = new ObjectArrayList<>(this.receivers);
+ return builder;
+ } catch (final CloneNotSupportedException e) {
+ throw new AssertionError();
+ }
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index ca6d0eaa9d9a37c07f3e1630b83a79bf98211edb..26d02aa5da444112f8fa84c07e3080bb669983a1 100644
index 3d636cb7f275df053d202356c5e9fad5b1112867..b0ccd263cabe911d43cc13261011b64cacaeb7bb 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -204,6 +204,18 @@ public enum Particle implements Keyed {
@@ -208,6 +208,18 @@ public enum Particle implements Keyed {
return key;
}
@ -523,10 +617,10 @@ index ca6d0eaa9d9a37c07f3e1630b83a79bf98211edb..26d02aa5da444112f8fa84c07e3080bb
* Options which can be applied to redstone dust particles - a particle
* color and size.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index fa4081c62f86245fef5a273f01837f9ac6998faa..fa31ba9d30cd0d1b23e15667c4c9bd9c13b5b9d3 100644
index c489140bffdfdfa1e34e71489d308ed10cf10b21..b6d08d50c26aa0e69d2479d188fc3c690e8ed357 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2896,7 +2896,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2921,7 +2921,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param data the data to use for the particle or null,
* the type of this depends on {@link Particle#getDataType()}
*/

View File

@ -6,10 +6,10 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration
Allows you to determine how long it takes to use a usable/consumable item
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index e175865e3149861583a38f4271375f7be020b6ff..9b38ba9bc7e72b60397476683c22d69e468d9353 100644
index 0586a64b780f0dee9899a42ca4ee28d12efd749a..b92a86e9d128b1ce6f02962574e30ced74e44bc8 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -657,5 +657,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -661,5 +661,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
public String getI18NDisplayName() {
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Make shield blocking delay configurable
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index c8c88c08d2f03cff267e76749156c584bf7adf42..dd5c5e0ec342cea1bf9efbd0aa28ae0e0ed2f6b9 100644
index f154c5607b1dc3585052d9f02cf8b28cf8a3c886..7b53064364e206bc1a0f4b7af4931f6c658b7c55 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -809,5 +809,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
@@ -837,5 +837,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
@Deprecated
void setArrowsStuck(int arrows);

View File

@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API
Adds ability to get what arrow was shot, and control if it should be consumed.
diff --git a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java
index d4d7ad9c3c953680342c121f39ddaef476549047..719d0d878320c1903b44076053989ba99fa0e92a 100644
index 1a8366f6757431baaba4f3d48abea3cf0ec1f1ad..1cde639c5dc7e746209488b1a58c2a81080ab3d7 100644
--- a/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java
+++ b/src/main/java/org/bukkit/event/entity/EntityShootBowEvent.java
@@ -22,7 +22,32 @@ public class EntityShootBowEvent extends EntityEvent implements Cancellable {

View File

@ -108,10 +108,10 @@ index 3161eae2fa5f03b7d3a5e9945ab659c15cf568c6..af737017ee397f80c44ee02c6cc60cef
/**
* Returns a list of entities within a bounding box centered around a Location.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index fa31ba9d30cd0d1b23e15667c4c9bd9c13b5b9d3..ab0f76c74205f2fe1faf9aecc57ac3fb57431b06 100644
index b6d08d50c26aa0e69d2479d188fc3c690e8ed357..a735dcdb9a0684accf81674b4810928ff20eb7e6 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1382,6 +1382,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -1397,6 +1397,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire);

View File

@ -5,7 +5,7 @@ Subject: [PATCH] ItemStack API additions for quantity/flags/lore
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 9b38ba9bc7e72b60397476683c22d69e468d9353..dbd0d0610f33105ee83ab589c84e73004f684fb5 100644
index b92a86e9d128b1ce6f02962574e30ced74e44bc8..e388239d6d960af2102111d2ae90b2a655b2a94a 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -3,6 +3,7 @@ package org.bukkit.inventory;
@ -16,7 +16,7 @@ index 9b38ba9bc7e72b60397476683c22d69e468d9353..dbd0d0610f33105ee83ab589c84e7300
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@@ -665,5 +666,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
@@ -669,5 +670,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
// Requires access to NMS
return ensureServerConversions().getMaxItemUseDuration();
}

View File

@ -0,0 +1,189 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:19:19 -0400
Subject: [PATCH] LivingEntity Active Item API
API relating to items being actively used by a LivingEntity
such as a bow or eating food.
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 2308fa3ca898bcb6c0ac2d4853f82a3398bf51f3..15115b1049bc5053796b84539acbf576bcba1a5f 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -319,7 +319,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
* blocking).
*
* @return Whether their hand is raised
+ * @see LivingEntity#hasActiveItem()
*/
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4") // Paper - active item API
public boolean isHandRaised();
/**
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 7b53064364e206bc1a0f4b7af4931f6c658b7c55..0ed64618b3f62ee984fe4f99dc6a52d5fad7b3cc 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -202,15 +202,19 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*
* @return the item being used by the player, or null if they are not using
* an item
+ * @deprecated Use {@link #getActiveItem()}
*/
@Nullable
+ @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public ItemStack getItemInUse();
/**
* Gets the number of ticks remaining for the current item's usage.
*
* @return The number of ticks remaining
+ * @deprecated use {@link #getActiveItemRemainingTime()}
*/
+ @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public int getItemInUseTicks();
/**
@@ -219,7 +223,9 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* or throwing a trident.
*
* @param ticks The number of ticks remaining
+ * @deprecated use {@link #setActiveItemRemainingTime(int)}
*/
+ @Deprecated(forRemoval = true, since = "1.20.4") // Paper
public void setItemInUseTicks(int ticks);
/**
@@ -852,4 +858,130 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setShieldBlockingDelay(int delay);
// Paper end
+
+ // Paper start - active item API
+ /**
+ * Starts using the item in the specified hand, making it the
+ * currently active item. When, for example, called on a skeleton,
+ * this will cause it to start drawing its bow.
+ * <p>
+ * Only HAND or OFF_HAND may be used for the hand parameter.
+ * <p>
+ * When used on a player, the client will stop using the item
+ * if right click is held down.
+ * <p>
+ * This method does not make any guarantees about the effect of this method
+ * as such depends on the entity and its state.
+ *
+ * @param hand the hand that contains the item to be used
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ void startUsingItem(@NotNull org.bukkit.inventory.EquipmentSlot hand);
+
+ /**
+ * Finishes using the currently active item. When, for example, a
+ * skeleton is drawing its bow, this will cause it to release and
+ * fire the arrow.
+ * <p>
+ * This method does not make any guarantees about the effect of this method
+ * as such depends on the entity and its state.
+ */
+ @org.jetbrains.annotations.ApiStatus.Experimental
+ void completeUsingActiveItem();
+
+ /**
+ * Gets the item being actively "used" or consumed.
+ *
+ * @return the item
+ */
+ org.bukkit.inventory.@NotNull ItemStack getActiveItem();
+
+ /**
+ * Gets the remaining number of ticks for {@link #getActiveItem()}'s usage.
+ *
+ * @return remaining ticks to use {@link #getActiveItem()}
+ */
+ int getActiveItemRemainingTime();
+
+ /**
+ * Sets the number of ticks that remain for {@link #getActiveItem()}'s
+ * usage.
+ * <p>
+ * Valid values are between 0 and the max item use duration for
+ * the specific item type.
+ *
+ * @param ticks time in ticks remaining
+ */
+ void setActiveItemRemainingTime(@org.jetbrains.annotations.Range(from = 0, to = Integer.MAX_VALUE) int ticks);
+
+ /**
+ * Gets if the entity is using an item (eating, drinking, etc).
+ *
+ * @return true if using an item
+ */
+ boolean hasActiveItem();
+
+ /**
+ * Get how long the {@link #getActiveItem()} has been in use for.
+ *
+ * @return time used in ticks
+ */
+ int getActiveItemUsedTime();
+
+ /**
+ * Get the hand using the active item. Will be either
+ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or
+ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}.
+ *
+ * @return the hand being used
+ */
+ org.bukkit.inventory.@NotNull EquipmentSlot getActiveItemHand();
+
+ /**
+ * Gets remaining time a player needs to keep hands raised with an item to finish using it.
+ *
+ * @return remaining ticks to use the item
+ * @see #getActiveItemRemainingTime()
+ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default int getItemUseRemainingTime() {
+ return this.getActiveItemRemainingTime();
+ }
+
+ /**
+ * Get how long the entity's hands have been raised (Charging Bow attack, using a potion, etc)
+ *
+ * @return Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ * @see #getActiveItemUsedTime()
+ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default int getHandRaisedTime() {
+ return this.getActiveItemUsedTime();
+ }
+
+ /**
+ * Whether this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ *
+ * @return whether this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ * @see #hasActiveItem()
+ */
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default boolean isHandRaised() {
+ return this.hasActiveItem();
+ }
+
+ /**
+ * Gets the hand raised by this living entity. Will be either
+ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or
+ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}.
+ *
+ * @return the hand raised
+ * @see #getActiveItemHand()
+ */
+ @NotNull
+ @org.jetbrains.annotations.ApiStatus.Obsolete(since = "1.20.4")
+ default org.bukkit.inventory.EquipmentSlot getHandRaised() {
+ return this.getActiveItemHand();
+ }
+ // Paper end - active item API
}

View File

@ -1,68 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:19:19 -0400
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index b3aa3dc6aa5afbc36cc86741b4cba56f463c2234..9e012c3c0671e5d0e55c243fdb4e14057038c153 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -328,7 +328,9 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*
* @return the item being used by the player, or null if they are not using
* an item
+ * @deprecated Deprecated in favor of {@link LivingEntity#getActiveItem()}
*/
+ @Deprecated // Paper
@Nullable
public ItemStack getItemInUse();
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index dd5c5e0ec342cea1bf9efbd0aa28ae0e0ed2f6b9..fd98b9de7714e2082e521f29dc162003e3d39ee2 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -823,5 +823,42 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
* @param delay Delay in ticks
*/
void setShieldBlockingDelay(int delay);
+
+ /**
+ * Get's the item being actively "used" or consumed.
+ * @return The item
+ */
+ @NotNull
+ org.bukkit.inventory.ItemStack getActiveItem();
+
+ /**
+ * Get's remaining time a player needs to keep hands raised with an item to finish using it.
+ * @return Remaining ticks to use the item
+ */
+ int getItemUseRemainingTime();
+
+ /**
+ * Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ *
+ * @return Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ */
+ int getHandRaisedTime();
+
+ /**
+ * Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ *
+ * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ */
+ boolean isHandRaised();
+
+ /**
+ * Gets the hand raised by this living entity. Will be either
+ * {@link org.bukkit.inventory.EquipmentSlot#HAND} or
+ * {@link org.bukkit.inventory.EquipmentSlot#OFF_HAND}.
+ *
+ * @return the hand raised
+ */
+ @NotNull
+ org.bukkit.inventory.EquipmentSlot getHandRaised();
// Paper end
}

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Add World.getEntity(UUID) API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index ab0f76c74205f2fe1faf9aecc57ac3fb57431b06..ad7e2b624d5929beee5268151bda3abe9dfbb786 100644
index a735dcdb9a0684accf81674b4810928ff20eb7e6..b34eca520c34c70152860f5bad978cf3bed044fa 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -896,6 +896,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -905,6 +905,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z);

View File

@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 9e012c3c0671e5d0e55c243fdb4e14057038c153..d44c5a3fda0b159dc541246cb2fca8427cb38243 100644
index 15115b1049bc5053796b84539acbf576bcba1a5f..c66130be13bf01b5834a6391864b865c0123fa5c 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -179,6 +179,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Entity#getChunk API
Get the chunk the entity is currently registered to
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index b422a949b22edf412b518abb3e5ca0847c73d36b..57a1d07d0430019fd38c72b9f58c7145927ecd02 100644
index 45f475b42bbef1c5dc461b3891a48c8fb6feefd3..1e43deadce5a1a0e97521b1f69fee3106f5a0b9e 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -3,6 +3,7 @@ package org.bukkit.entity;
@ -17,7 +17,7 @@ index b422a949b22edf412b518abb3e5ca0847c73d36b..57a1d07d0430019fd38c72b9f58c7145
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Nameable;
@@ -797,5 +798,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -808,5 +809,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return True if entity spawned from a mob spawner
*/
boolean fromMobSpawner();

View File

@ -6,10 +6,10 @@ Subject: [PATCH] PlayerElytraBoostEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..42375d44ed0db457b96165414e9b45a557bac1ab
index 0000000000000000000000000000000000000000..9ebac41c22b8866df616020d409e5e1a49cddca5
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerElytraBoostEvent.java
@@ -0,0 +1,90 @@
@@ -0,0 +1,104 @@
+package com.destroystokyo.paper.event.player;
+
+import org.bukkit.entity.Firework;
@ -17,6 +17,7 @@ index 0000000000000000000000000000000000000000..42375d44ed0db457b96165414e9b45a5
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
@ -31,14 +32,17 @@ index 0000000000000000000000000000000000000000..42375d44ed0db457b96165414e9b45a5
+ @NotNull private final ItemStack itemStack;
+ @NotNull private final Firework firework;
+ private boolean consume = true;
+ @NotNull
+ private final EquipmentSlot hand;
+
+ private boolean cancelled;
+
+ @ApiStatus.Internal
+ public PlayerElytraBoostEvent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull Firework firework) {
+ public PlayerElytraBoostEvent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull Firework firework, @NotNull EquipmentSlot hand) {
+ super(player);
+ this.itemStack = itemStack;
+ this.firework = firework;
+ this.hand = hand;
+ }
+
+ /**
@ -79,6 +83,16 @@ index 0000000000000000000000000000000000000000..42375d44ed0db457b96165414e9b45a5
+ this.consume = consume;
+ }
+
+ /**
+ * Gets the hand holding the firework used for boosting this player.
+ *
+ * @return interaction hand
+ */
+ @NotNull
+ public EquipmentSlot getHand() {
+ return this.hand;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return this.cancelled;

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add TNTPrimeEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..d8de7332b63feb16c855bf7ea1986fd229489c7c
index 0000000000000000000000000000000000000000..676c67d04cbbad0641c2760f9ea62246d248ac87
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/block/TNTPrimeEvent.java
@@ -0,0 +1,125 @@
@ -125,7 +125,7 @@ index 0000000000000000000000000000000000000000..d8de7332b63feb16c855bf7ea1986fd2
+
+ /**
+ * When TNT prime was caused by an {@link Entity} shooting TNT
+ * using a bow with {@link Enchantment#ARROW_FIRE} enchantment
+ * using a bow with {@link Enchantment#FLAME} enchantment
+ */
+ PROJECTILE,
+

View File

@ -44,7 +44,7 @@ index a25f112f4d679946ddcb5ec9b4d0a0e2d1795bd3..57976bbe682d2309f7d15d5dcd3ad7f8
* Gets the world containing this chunk
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index ad7e2b624d5929beee5268151bda3abe9dfbb786..9c22650c299ab063a7e558408ce6c203c79d11fd 100644
index b34eca520c34c70152860f5bad978cf3bed044fa..273c50b6e4f26457415779000cf09aeaffd21733 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -182,6 +182,37 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient

View File

@ -50,7 +50,7 @@ index 41125de49db8eafce4be59cc110ce5be06836a47..042d69e6d4584eb6d678b8ea13a3e4be
* @return A new location where X/Y/Z are the center of the block
*/
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 9c22650c299ab063a7e558408ce6c203c79d11fd..036a8ddc82a82800275d654d3fc00a9d30215350 100644
index 273c50b6e4f26457415779000cf09aeaffd21733..575fd50b8456beed7c5049a392fca011271a8fe4 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -99,6 +99,41 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient

View File

@ -37,7 +37,7 @@ index 042d69e6d4584eb6d678b8ea13a3e4bea78703b8..02b4ffa6b918269bd64f7c518fcceef1
/**
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 036a8ddc82a82800275d654d3fc00a9d30215350..25ff747e23e7373bb96ca9109df7e46cdefdcd2e 100644
index 575fd50b8456beed7c5049a392fca011271a8fe4..b3098ce9134acf24f49d23fc1babe79c6bf502f1 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -248,6 +248,19 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient

View File

@ -6,7 +6,7 @@ Subject: [PATCH] Add source block constructor and getChangedBlockData() to
diff --git a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
index e3a5f5824ed882058f5bac5003f66ce79733a868..1d496e5a3d1541bf0a257a4358b3943fd6415204 100644
index e3a5f5824ed882058f5bac5003f66ce79733a868..b23686d2e452dc0b8bde453b4a375f424cb7504a 100644
--- a/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
+++ b/src/main/java/org/bukkit/event/block/BlockPhysicsEvent.java
@@ -32,6 +32,13 @@ public class BlockPhysicsEvent extends BlockEvent implements Cancellable {
@ -46,7 +46,7 @@ index e3a5f5824ed882058f5bac5003f66ce79733a868..1d496e5a3d1541bf0a257a4358b3943f
+ */
+ @NotNull
+ public BlockData getChangedBlockData() {
+ return changed;
+ return changed.clone();
+ }
+ // Paper end
+

View File

@ -8,10 +8,10 @@ Adds API's to load or generate chunks asynchronously.
Also adds utility methods to Entity to teleport asynchronously.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 25ff747e23e7373bb96ca9109df7e46cdefdcd2e..116bad653e92efbfd576f3b146c0a9e40afbbe10 100644
index b3098ce9134acf24f49d23fc1babe79c6bf502f1..5efe33cef4d9c153d760fc71606721ff8abafbfc 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -941,6 +941,472 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -950,6 +950,472 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
// Paper end - additional getNearbyEntities API
@ -485,10 +485,10 @@ index 25ff747e23e7373bb96ca9109df7e46cdefdcd2e..116bad653e92efbfd576f3b146c0a9e4
* Get a list of all players in this World
*
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 77a706dde5995a8a6306b1d0a144dd37d580dea3..14e42959033919ff6409e48ddf01c0f15c28eb10 100644
index 1e43deadce5a1a0e97521b1f69fee3106f5a0b9e..f1fc42ad24648ee481b9a5d4c4cc58ae8c0a93c1 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -168,6 +168,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -168,6 +168,39 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
public boolean teleport(@NotNull Entity destination, @NotNull TeleportCause cause);
@ -498,25 +498,31 @@ index 77a706dde5995a8a6306b1d0a144dd37d580dea3..14e42959033919ff6409e48ddf01c0f1
+ * @param loc Location to teleport to
+ * @return A future that will be completed with the result of the teleport
+ */
+ @NotNull
+ public default java.util.concurrent.CompletableFuture<Boolean> teleportAsync(@NotNull Location loc) {
+ return teleportAsync(loc, TeleportCause.PLUGIN);
+ default java.util.concurrent.@NotNull CompletableFuture<Boolean> teleportAsync(final @NotNull Location loc) {
+ return this.teleportAsync(loc, TeleportCause.PLUGIN);
+ }
+
+ /**
+ * Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.
+ * @param loc Location to teleport to
+ * @param cause Reason for teleport
+ * @return A future that will be completed with the result of the teleport
+ */
+ @NotNull
+ public default java.util.concurrent.CompletableFuture<Boolean> teleportAsync(@NotNull Location loc, @NotNull TeleportCause cause) {
+ java.util.concurrent.CompletableFuture<Boolean> future = new java.util.concurrent.CompletableFuture<>();
+ loc.getWorld().getChunkAtAsyncUrgently(loc).thenAccept((chunk) -> future.complete(teleport(loc, cause))).exceptionally(ex -> {
+ future.completeExceptionally(ex);
+ return null;
+ });
+ return future;
+ default java.util.concurrent.@NotNull CompletableFuture<Boolean> teleportAsync(final @NotNull Location loc, final @NotNull TeleportCause cause) {
+ final class Holder {
+ static final io.papermc.paper.entity.TeleportFlag[] EMPTY_FLAGS = new io.papermc.paper.entity.TeleportFlag[0];
+ }
+ return this.teleportAsync(loc, cause, Holder.EMPTY_FLAGS);
+ }
+
+ /**
+ * Loads/Generates(in 1.13+) the Chunk asynchronously, and then teleports the entity when the chunk is ready.
+ * @param loc Location to teleport to
+ * @param cause Reason for teleport
+ * @param teleportFlags Flags to be used in this teleportation
+ * @return A future that will be completed with the result of the teleport
+ */
+ java.util.concurrent.@NotNull CompletableFuture<Boolean> teleportAsync(@NotNull Location loc, @NotNull TeleportCause cause, @NotNull io.papermc.paper.entity.TeleportFlag @NotNull... teleportFlags);
+ // Paper end
+
/**

View File

@ -78,7 +78,7 @@ index 0000000000000000000000000000000000000000..c896d172519a8552a132031cb956378d
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 3a2f5ba52c6be8930f7b411476b36afc161834c9..b7bf0cc404634693d03c6700dc50c92697951c37 100644
index 0ed64618b3f62ee984fe4f99dc6a52d5fad7b3cc..b41152d81c1ec89a65eaee2a606f4f1b0d421bc7 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -85,6 +85,98 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource

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