Compare commits

..
Author SHA1 Message Date
MiniDigger fa64402087 rework bstats 2021-12-30 13:35:55 +01:00
1257 changed files with 9526 additions and 21689 deletions

No files matched your search

+1 -1
View File
@@ -41,4 +41,4 @@ body:
attributes:
value: |
Before submitting this feature request, please search our issue tracker to ensure your feature has not
already been requested.
alerady been requested.
+2 -2
View File
@@ -18,9 +18,9 @@ jobs:
java: [17]
fail-fast: true
steps:
- uses: actions/checkout@v2.4.0
- uses: actions/checkout@v2.3.5
- name: JDK ${{ matrix.java }}
uses: actions/setup-java@v3.1.0
uses: actions/setup-java@v2.3.1
with:
java-version: ${{ matrix.java }}
cache: 'gradle'
-1
View File
@@ -49,5 +49,4 @@ MeFisto94 <MeFisto94@users.noreply.github.com>
Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
LemonCaramel <admin@caramel.moe>
Noah van der Aa <ndvdaa@gmail.com>
Doc <nachito94@msn.com>
```
+5
View File
@@ -8,6 +8,11 @@ java {
withJavadocJar()
}
repositories {
mavenCentral()
maven("https://libraries.minecraft.net")
}
dependencies {
implementation(project(":paper-api"))
api("com.mojang:brigadier:1.0.18")
+4 -4
View File
@@ -8,7 +8,7 @@ High performance Spigot fork that aims to fix gameplay and mechanics inconsisten
**Support and Project Discussion:**
- [Our forums](https://forums.papermc.io/), [Discord](https://discord.gg/papermc), or [IRC](https://webchat.esper.net/?channels=paper)
- [IRC](https://webchat.esper.net/?channels=paper) or [Discord](https://discord.gg/papermc)
How To (Server Admins)
------
@@ -18,7 +18,7 @@ Download Paper from our [downloads page](https://papermc.io/downloads).
Run the Paperclip jar directly from your server. Just like old times
* Documentation on using Paper: [docs.papermc.io](https://docs.papermc.io)
* Documentation on using Paper: [paper.readthedocs.io](https://paper.readthedocs.io/)
* For a sneak peek on upcoming features, [see here](https://github.com/PaperMC/Paper/projects)
How To (Plugin Developers)
@@ -38,7 +38,7 @@ How To (Plugin Developers)
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<version>1.18.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
```
@@ -54,7 +54,7 @@ repositories {
}
dependencies {
compileOnly("io.papermc.paper:paper-api:1.18.2-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.18.1-R0.1-SNAPSHOT")
}
java {
+9 -46
View File
@@ -54,6 +54,9 @@ public net.minecraft.world.entity.player.Player removeEntitiesOnShoulder()V
# LivingEntity setkiller
public net.minecraft.world.entity.LivingEntity lastHurtByPlayerTime
# SkeletonHorse Additions
public net.minecraft.world.entity.animal.horse.SkeletonHorse trapTime
# Fix client rendering skulls
public net.minecraft.world.item.ItemStack tag
@@ -72,6 +75,8 @@ public net.minecraft.server.level.ChunkMap getPoiManager()Lnet/minecraft/world/e
# Improve death events
public net.minecraft.world.entity.LivingEntity getDeathSound()Lnet/minecraft/sounds/SoundEvent;
public net.minecraft.world.entity.LivingEntity getSoundVolume()F
public net.minecraft.world.entity.Mob handItems
public net.minecraft.world.entity.Mob armorItems
# Add sun related api
public net.minecraft.world.entity.Mob isSunBurnTick()Z
@@ -184,6 +189,8 @@ public net.minecraft.server.level.ServerLevel players
# Chunk priority urgency system
public net.minecraft.server.level.ChunkMap$ChunkDistanceManager
# Here's Johnny
public net.minecraft.world.entity.monster.Vindicator isJohnny
# Chunk debug command
public net.minecraft.server.level.Ticket createdTick
@@ -219,13 +226,6 @@ public net.minecraft.world.entity.animal.Fox isDefending()Z
public net.minecraft.world.entity.animal.Fox setDefending(Z)V
public net.minecraft.world.entity.animal.Fox isFaceplanted()Z
public net.minecraft.world.entity.animal.Fox setFaceplanted(Z)V
public net.minecraft.world.entity.animal.Panda getEatCounter()I
public net.minecraft.world.entity.animal.Panda setEatCounter(I)V
public net.minecraft.world.entity.animal.Bee isRolling()Z
public net.minecraft.world.entity.animal.Bee setRolling(Z)V
public net.minecraft.world.entity.monster.piglin.Piglin isChargingCrossbow()Z
public net.minecraft.world.entity.monster.Vex hasLimitedLife
public net.minecraft.world.entity.monster.Vex limitedLifeTicks
# Cook speed multipler API
public net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity recipeType
@@ -270,19 +270,10 @@ public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
# Optimize isValidLocation
public net.minecraft.world.level.chunk.LevelChunkSection states
# Player Profile API
# Player.setPlayerProfile API
public-f net.minecraft.world.entity.player.Player gameProfile
public org.bukkit.craftbukkit.profile.CraftProfileProperty
public org.bukkit.craftbukkit.profile.CraftPlayerTextures
public org.bukkit.craftbukkit.profile.CraftPlayerTextures copyFrom(Lorg/bukkit/profile/PlayerTextures;)V
public org.bukkit.craftbukkit.profile.CraftPlayerTextures rebuildPropertyIfDirty()V
public org.bukkit.craftbukkit.profile.CraftPlayerProfile getProperty(Ljava/lang/String;)Lcom/mojang/authlib/properties/Property;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile setProperty(Ljava/lang/String;Lcom/mojang/authlib/properties/Property;)V
public org.bukkit.craftbukkit.profile.CraftPlayerProfile toString(Lcom/mojang/authlib/properties/PropertyMap;)Ljava/lang/String;
public org.bukkit.craftbukkit.profile.CraftPlayerProfile equals(Lcom/mojang/authlib/properties/PropertyMap;Lcom/mojang/authlib/properties/PropertyMap;)Z
public org.bukkit.craftbukkit.profile.CraftPlayerProfile hashCode(Lcom/mojang/authlib/properties/PropertyMap;)I
# Flat bedrock generator settings
# Generator Settings
public net.minecraft.world.level.levelgen.SurfaceRules$Condition
public net.minecraft.world.level.levelgen.SurfaceRules$Context
public net.minecraft.world.level.levelgen.SurfaceRules$Context blockX
@@ -304,31 +295,3 @@ public net.minecraft.world.entity.monster.Skeleton inPowderSnowTime
# Add health methods for item entities
public net.minecraft.world.entity.item.ItemEntity health
# Fix riding distance statistics
public net.minecraft.world.entity.player.Player checkRidingStatistics(DDD)V
# Fix NotePlayEvent
public org.bukkit.craftbukkit.block.data.CraftBlockData toNMS(Ljava/lang/Enum;Ljava/lang/Class;)Ljava/lang/Enum;
# Stronghold seed configuration
public-f net.minecraft.world.level.chunk.ChunkGenerator strongholdSeed
# More Sculk Sensor API
public-f net.minecraft.world.level.gameevent.vibrations.VibrationListener listenerRange
# Fix custom inventory holders
public-f net.minecraft.world.inventory.AbstractContainerMenu dataSlots
public-f net.minecraft.world.inventory.AbstractContainerMenu remoteDataSlots
# Fix falling block spawn methods
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
# Fix cancelling ProjectileHitEvent for piercing arrows
protected net.minecraft.world.entity.projectile.Projectile hitCancelled
# Expose firework item directly + manually setting flight ticks
public net.minecraft.world.entity.projectile.FireworkRocketEntity life
# More Projectile API
public net.minecraft.world.entity.projectile.FishingHook timeUntilLured
+4 -3
View File
@@ -14,15 +14,16 @@ tiny 2 0 mojang+yarn spigot
# CraftBukkit changes type
c net/minecraft/server/level/ServerLevel net/minecraft/server/level/WorldServer
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData M
f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData N
c net/minecraft/world/level/chunk/LevelChunk net/minecraft/world/level/chunk/Chunk
f Lnet/minecraft/server/level/ServerLevel; level q
# See mappings-patch.tiny
c net/minecraft/server/level/ChunkMap net/minecraft/server/level/PlayerChunkMap
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager E
f Lnet/minecraft/server/level/ChunkMap$ChunkDistanceManager; distanceManager D
# 1.18 todo: verify paper still changes this
# Paper changes type
c net/minecraft/core/MappedRegistry net/minecraft/core/RegistryMaterials
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId bE
f Lit/unimi/dsi/fastutil/objects/Reference2IntOpenHashMap; toId bA
+18 -42
View File
@@ -1,11 +1,8 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.1.2" apply false
id("io.papermc.paperweight.core") version "1.3.6"
id("com.github.johnrengelman.shadow") version "7.1.1" apply false
id("io.papermc.paperweight.core") version "1.3.3"
}
allprojects {
@@ -19,8 +16,6 @@ allprojects {
}
}
val paperMavenPublicUrl = "https://papermc.io/repo/repository/maven-public/"
subprojects {
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
@@ -32,39 +27,28 @@ subprojects {
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
if (name == "Paper-MojangAPI") {
return@subprojects
}
repositories {
mavenCentral()
maven(paperMavenPublicUrl)
maven("https://papermc.io/repo/repository/maven-public/")
}
}
val spigotDecompiler: Configuration by configurations.creating
repositories {
mavenCentral()
maven(paperMavenPublicUrl) {
content {
onlyForConfigurations(
configurations.paperclip.name,
spigotDecompiler.name,
)
}
maven("https://papermc.io/repo/repository/maven-public/") {
content { onlyForConfigurations("paperclip") }
}
}
dependencies {
paramMappings("net.fabricmc:yarn:1.18.2+build.2:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.8.2:fat")
decompiler("net.minecraftforge:forgeflower:1.5.498.29")
spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.4")
paramMappings("net.fabricmc:yarn:1.18.1+build.1:mergedv2")
remapper("net.fabricmc:tiny-remapper:0.7.0:fat")
decompiler("net.minecraftforge:forgeflower:1.5.498.22")
paperclip("io.papermc:paperclip:3.0.2")
}
@@ -72,13 +56,9 @@ paperweight {
minecraftVersion.set(providers.gradleProperty("mcVersion"))
serverProject.set(project(":paper-server"))
paramMappingsRepo.set(paperMavenPublicUrl)
remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl)
craftBukkit {
fernFlowerJar.set(layout.file(spigotDecompiler.elements.map { it.single().asFile }))
}
paramMappingsRepo.set("https://maven.fabricmc.net/")
remapRepo.set("https://maven.fabricmc.net/")
decompileRepo.set("https://files.minecraftforge.net/maven/")
paper {
spigotApiPatchDir.set(layout.projectDirectory.dir("patches/api"))
@@ -106,12 +86,14 @@ tasks.generateDevelopmentBundle {
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
"https://libraries.minecraft.net/",
"https://papermc.io/repo/repository/maven-public/",
"https://maven.fabricmc.net/",
)
}
publishing {
if (project.providers.gradleProperty("publishDevBundle").isPresent) {
if (project.providers.gradleProperty("publishDevBundle").forUseAtConfigurationTime().isPresent) {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
@@ -136,9 +118,3 @@ tasks.register("printMinecraftVersion") {
println(providers.gradleProperty("mcVersion").get().trim())
}
}
tasks.register("printPaperVersion") {
doLast {
println(project.version)
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
group=io.papermc.paper
version=1.18.2-R0.1-SNAPSHOT
version=1.18.1-R0.1-SNAPSHOT
mcVersion=1.18.2
mcVersion=1.18.1
org.gradle.caching=true
org.gradle.parallel=true
Binary file not shown.
+1 -1
View File
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
@@ -27,10 +27,10 @@ index e431e3435737e28394d81b56568a08b3c3148b9b..b23bde3b5e881f146539a307d0a59f21
+/.factorypath
diff --git a/build.gradle.kts b/build.gradle.kts
new file mode 100644
index 0000000000000000000000000000000000000000..d6b99d37c960a7d8de1852dbc74c3ce671101b14
index 0000000000000000000000000000000000000000..c76bfbcfbe034700bdbd9396643cfca625273a14
--- /dev/null
+++ b/build.gradle.kts
@@ -0,0 +1,80 @@
@@ -0,0 +1,66 @@
+plugins {
+ `java-library`
+ `maven-publish`
@@ -45,7 +45,7 @@ index 0000000000000000000000000000000000000000..d6b99d37c960a7d8de1852dbc74c3ce6
+ // api dependencies are listed transitively to API consumers
+ api("commons-lang:commons-lang:2.6")
+ api("com.google.guava:guava:31.0.1-jre")
+ api("com.google.code.gson:gson:2.8.9")
+ api("com.google.code.gson:gson:2.8.8")
+ api("net.md-5:bungeecord-chat:1.16-R0.4")
+ api("org.yaml:snakeyaml:1.30")
+
@@ -90,33 +90,19 @@ index 0000000000000000000000000000000000000000..d6b99d37c960a7d8de1852dbc74c3ce6
+}
+
+tasks.withType<Javadoc> {
+ val options = options as StandardJavadocDocletOptions
+ options.overview = "src/main/javadoc/overview.html"
+ options.isDocFilesSubDirs = true
+ options.links(
+ (options as StandardJavadocDocletOptions).links(
+ "https://guava.dev/releases/31.0.1-jre/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
+ "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ )
+
+ // workaround for https://github.com/gradle/gradle/issues/4046
+ inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
+ doLast {
+ copy {
+ from("src/main/javadoc") {
+ include("**/doc-files/**")
+ }
+ into("build/docs/javadoc")
+ }
+ }
+}
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index 7a34ef5514a30bcb61e657970bf087bdf9c2db90..0000000000000000000000000000000000000000
index 9c130bf7fe7ec4b6b5d4f4c30cdbe6dc75b0f9a0..0000000000000000000000000000000000000000
--- a/pom.xml
+++ /dev/null
@@ -1,263 +0,0 @@
@@ -1,262 +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">
@@ -124,7 +110,7 @@ index 7a34ef5514a30bcb61e657970bf087bdf9c2db90..00000000000000000000000000000000
-
- <groupId>org.spigotmc</groupId>
- <artifactId>spigot-api</artifactId>
- <version>1.18.2-R0.1-SNAPSHOT</version>
- <version>1.18.1-R0.1-SNAPSHOT</version>
- <packaging>jar</packaging>
-
- <name>Spigot-API</name>
@@ -167,7 +153,7 @@ index 7a34ef5514a30bcb61e657970bf087bdf9c2db90..00000000000000000000000000000000
- <dependency>
- <groupId>com.google.code.gson</groupId>
- <artifactId>gson</artifactId>
- <version>2.8.9</version>
- <version>2.8.8</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
@@ -344,7 +330,6 @@ index 7a34ef5514a30bcb61e657970bf087bdf9c2db90..00000000000000000000000000000000
- </executions>
- <configuration>
- <configLocation>checkstyle.xml</configLocation>
- <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
- <includeTestSourceDirectory>true</includeTestSourceDirectory>
- </configuration>
- <dependencies>
+5 -5
View File
@@ -5,11 +5,11 @@ Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index d6b99d37c960a7d8de1852dbc74c3ce671101b14..e49f4853e36f493754841231eeb5dd093b3788e0 100644
index c76bfbcfbe034700bdbd9396643cfca625273a14..1f680baffba17265e8ce38b3516624bffd034075 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -15,15 +15,27 @@ dependencies {
api("com.google.code.gson:gson:2.8.9")
api("com.google.code.gson:gson:2.8.8")
api("net.md-5:bungeecord-chat:1.16-R0.4")
api("org.yaml:snakeyaml:1.30")
+ // Paper start
@@ -37,12 +37,12 @@ index d6b99d37c960a7d8de1852dbc74c3ce671101b14..e49f4853e36f493754841231eeb5dd09
testImplementation("junit:junit:4.13.2")
testImplementation("org.hamcrest:hamcrest-library:1.3")
testImplementation("org.ow2.asm:asm-tree:9.2")
@@ -63,7 +75,7 @@ tasks.withType<Javadoc> {
options.links(
@@ -60,7 +72,7 @@ tasks.withType<Javadoc> {
(options as StandardJavadocDocletOptions).links(
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
- "https://javadoc.io/doc/org.jetbrains/annotations-java5/23.0.0/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
)
}
File renamed without changes.
@@ -1878,10 +1878,10 @@ index 0000000000000000000000000000000000000000..a92925d41110226f7fda055b71ce7be6
+}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
new file mode 100644
index 0000000000000000000000000000000000000000..73452e53afc68061245a915c863067f47a1d99f9
index 0000000000000000000000000000000000000000..ef58a6c00f444bd498a2d8fc4e457236f393954f
--- /dev/null
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -0,0 +1,87 @@
@@ -0,0 +1,77 @@
+package co.aikar.timings;
+
+import com.google.common.collect.Lists;
@@ -1893,12 +1893,13 @@ index 0000000000000000000000000000000000000000..73452e53afc68061245a915c863067f4
+import org.bukkit.command.RemoteConsoleCommandSender;
+
+import java.util.List;
+import java.util.UUID;
+
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+@SuppressWarnings("WeakerAccess")
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender {
+public class TimingsReportListener implements MessageCommandSender {
+ private final List<CommandSender> senders;
+ private final Runnable onDone;
+ private String timingsURL;
@@ -1942,17 +1943,6 @@ index 0000000000000000000000000000000000000000..73452e53afc68061245a915c863067f4
+ }
+
+ @Override
+ public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
+ }
+
+ @NotNull
+ @Override
+ public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
+ return this.senders;
+ }
+
+ @Override
+ public void sendMessage(@NotNull String message) {
+ senders.forEach((sender) -> sender.sendMessage(message));
+ }
@@ -2792,10 +2782,10 @@ index 0000000000000000000000000000000000000000..5989ee21297935651b0edd44b8239e65
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index d5fdc57ffcfac4eb18d7fbf44ce13257915b4afb..35de49ea52b507dd925ed3c118518a335035a710 100644
index 072bcbbbf167e02ce5014b672f2cf63122d29b21..de7f303bce9e2454eaec12131cd1439a54281c7e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -801,7 +801,6 @@ public final class Bukkit {
@@ -747,7 +747,6 @@ public final class Bukkit {
*/
public static void reload() {
server.reload();
@@ -2804,10 +2794,10 @@ index d5fdc57ffcfac4eb18d7fbf44ce13257915b4afb..35de49ea52b507dd925ed3c118518a33
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 14b078e8fa4347dd0e186e5847693904e4ceb9df..bbb4eb3c4e46ade7dd939c2b0e4436161d6f8a1e 100644
index 2bfccae871b92749fa5893b5a7ff327fc93695ad..31e989bdaf60d38e14c84c4a0a31ede6e1a72e86 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1715,6 +1715,26 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1500,6 +1500,26 @@ public interface Server extends PluginMessageRecipient {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2835,21 +2825,21 @@ index 14b078e8fa4347dd0e186e5847693904e4ceb9df..bbb4eb3c4e46ade7dd939c2b0e443616
* 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 f43ad19a44f3b7368a1a110cc55247277f4d3751..ce5794d684a1126ec9acbf4af17f5d6fa783f551 100644
index 247d194f86c00db11acbc58e7d163b2606db4f07..945b8b030d1b2a13afc0c4efad76997eb7bf00ba 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -31,6 +31,7 @@ public interface UnsafeValues {
net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
// Paper end
@@ -18,6 +18,7 @@ import org.bukkit.plugin.PluginDescriptionFile;
@Deprecated
public interface UnsafeValues {
+ void reportTimings(); // Paper
Material toLegacy(Material material);
Material fromLegacy(Material material);
@@ -86,4 +87,12 @@ public interface UnsafeValues {
Multimap<Attribute, AttributeModifier> getDefaultAttributeModifiers(Material material, EquipmentSlot slot);
CreativeCategory getCreativeCategory(Material material);
@@ -69,4 +70,12 @@ public interface UnsafeValues {
* @return true if a file matching this key was found and deleted
*/
boolean removeAdvancement(NamespacedKey key);
+
+ // Paper start
+ /**
@@ -2887,19 +2877,20 @@ index 0000000000000000000000000000000000000000..f9a00aecca5ec41b460bf41dfe1c6969
+ }
+}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 50e6d45ec9349b56d20e2ffc664eca15ba936cc6..c4dcafac892169a7bfcc065701fffb43c6cfdf44 100644
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..03bdc1622791e1206406c87065978688d602e39e 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -33,6 +33,8 @@ public abstract class Command {
@@ -33,7 +33,8 @@ public abstract class Command {
protected String usageMessage;
private String permission;
private net.kyori.adventure.text.Component permissionMessage; // Paper
private String permissionMessage;
- public org.spigotmc.CustomTimingsHandler timings; // Spigot
+ public co.aikar.timings.Timing timings; // Paper
+ @NotNull public String getTimingName() {return getName();} // Paper
protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -46,7 +48,6 @@ public abstract class Command {
@@ -47,7 +48,6 @@ public abstract class Command {
this.usageMessage = (usageMessage == null) ? "/" + name : usageMessage;
this.aliases = aliases;
this.activeAliases = new ArrayList<String>(aliases);
@@ -2907,7 +2898,7 @@ index 50e6d45ec9349b56d20e2ffc664eca15ba936cc6..c4dcafac892169a7bfcc065701fffb43
}
/**
@@ -244,7 +245,6 @@ public abstract class Command {
@@ -245,7 +245,6 @@ public abstract class Command {
}
this.nextLabel = name;
if (!isRegistered()) {
@@ -2940,10 +2931,10 @@ index d6c8938b1e13b63116b7b0e074ea8ef5997f8dc3..a6ad94ef98a1df1d2842635d850bc990
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
new file mode 100644
index 0000000000000000000000000000000000000000..f8f0aa688e337222f305fb07f57eec474e3a3a2b
index 0000000000000000000000000000000000000000..a7ef1f51c2b96617a32e6e7b1723e8770ba8a6a8
--- /dev/null
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -0,0 +1,136 @@
@@ -0,0 +1,129 @@
+package org.bukkit.command;
+
+import org.apache.commons.lang.NotImplementedException;
@@ -2990,13 +2981,6 @@ index 0000000000000000000000000000000000000000..f8f0aa688e337222f305fb07f57eec47
+ return Bukkit.getServer();
+ }
+
+ // Paper start
+ @Override
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
+ throw new NotImplementedException();
+ }
+ // Paper end
+
+ @NotNull
+ @Override
+ default String getName() {
@@ -3393,11 +3377,11 @@ index 2a145d851ce30360aa39549745bd87590c034584..00000000000000000000000000000000
- // Spigot end
-}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index dc7e32a6f3be974a1d9c367d6b0f840ce98aed8b..71e696eadf7c9290791c8b50d666dc501621f24e 100644
index 709016bdc30d5502765af842d4fc83af53779a9e..c36e4ceb1094aa9469f976e0952e2725358ff761 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1968,7 +1968,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
@@ -1610,7 +1610,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
+
@@ -3515,7 +3499,7 @@ index a09c3f71ca563b6f40a118ce1344d0eb273bed40..cf2f517765d8f2a23cc4a17d9ee2dcd8
eventSet.add(new TimedRegisteredListener(listener, executor, eh.priority(), plugin, eh.ignoreCancelled()));
} else {
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 930f3fe08c2acd70eaf7850d0b1b2890512defa0..24e3eaa008e53af8d77439e4f2ab9007285d7826 100644
index 6bdd9f1dcc4c69c1811622cddc82526d2f8d9e52..657243776c8a2abb5a57e5c407212a8387d649eb 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -29,7 +29,8 @@ import org.jetbrains.annotations.Nullable;
@@ -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 b1d770a62e499d909de4352303409fcfdc5d58a9..fc7d17fd3028f790ff9e034e8234bf0506f017c2 100644
index a238302f2a12194aa30a88867070705dc749b36b..cc42bfa74b41ef6d6374efa7b882f71677fb0824 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -75,6 +75,20 @@ public final class Bukkit {
@@ -73,6 +73,20 @@ public final class Bukkit {
return server;
}
@@ -32,12 +32,12 @@ index b1d770a62e499d909de4352303409fcfdc5d58a9..fc7d17fd3028f790ff9e034e8234bf05
* 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 465a7f5312a5d5b65f7366f476b7c42795f53105..dd79325a8f52190c44b833870043d167641211a6 100644
index 3e91c4000c468fd8bdcb938e942a7bbf4988cab2..1fb1d4f32af8150711ca766fcd7d0a0c177df7c4 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -60,6 +60,18 @@ import org.jetbrains.annotations.Nullable;
@@ -58,6 +58,18 @@ import org.jetbrains.annotations.Nullable;
*/
public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
public interface Server extends PluginMessageRecipient {
+ /**
+ * Returns the de facto plugins directory, generally used for storing plugin jars to be loaded,
@@ -7,14 +7,14 @@ Co-authored-by: zml <zml@stellardrift.ca>
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
diff --git a/build.gradle.kts b/build.gradle.kts
index 98afa6a25131dc626ea7a5122f33df6bd2d39178..eefc024acc3e14ae21855df7f2f358bd1e0a9e38 100644
index 55ee0c6330e4dbba22b4044346d1e1dd39c745ce..80fdd05dd593455ca89b66636ed30f1d9facf4ed 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,18 +8,37 @@ java {
@@ -8,6 +8,19 @@ java {
withJavadocJar()
}
+val adventureVersion = "4.10.1"
+val adventureVersion = "4.9.3"
+val apiAndDocs: Configuration by configurations.creating {
+ attributes {
+ attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -30,64 +30,87 @@ index 98afa6a25131dc626ea7a5122f33df6bd2d39178..eefc024acc3e14ae21855df7f2f358bd
dependencies {
// api dependencies are listed transitively to API consumers
api("commons-lang:commons-lang:2.6")
api("com.google.guava:guava:31.0.1-jre")
api("com.google.code.gson:gson:2.8.9")
- api("net.md-5:bungeecord-chat:1.16-R0.4")
+ api("net.md-5:bungeecord-chat:1.16-R0.4-deprecated+build.6") // Paper
api("org.yaml:snakeyaml:1.30")
// Paper start
api("com.googlecode.json-simple:json-simple:1.1.1") {
@@ -20,6 +33,11 @@ dependencies {
isTransitive = false // includes junit
}
api("it.unimi.dsi:fastutil:8.5.6")
+ apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
+ apiAndDocs("net.kyori:adventure-api")
+ apiAndDocs("net.kyori:adventure-text-minimessage")
+ apiAndDocs("net.kyori:adventure-text-serializer-gson")
+ apiAndDocs("net.kyori:adventure-text-serializer-legacy")
+ apiAndDocs("net.kyori:adventure-text-serializer-plain")
// Paper end
compileOnly("org.apache.maven:maven-resolver-provider:3.8.4")
@@ -77,9 +96,24 @@ tasks.withType<Javadoc> {
@@ -70,10 +88,25 @@ tasks.jar {
}
tasks.withType<Javadoc> {
+ inputs.files(apiAndDocs)
+ .ignoreEmptyDirectories()
+ .withPropertyName(apiAndDocs.name + "-configuration")
+ doFirst {
+ (options as CoreJavadocOptions).addStringOption(
+ "sourcepath",
+ apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath)
+ )
+ }
(options as StandardJavadocDocletOptions).links(
"https://guava.dev/releases/31.0.1-jre/api/docs/",
"https://javadoc.io/doc/org.yaml/snakeyaml/1.30/",
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0/", // Paper - we don't want Java 5 annotations
- "https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/",
+ // Paper start
+ //"https://javadoc.io/doc/net.md-5/bungeecord-chat/1.16-R0.4/", // don't link to bungee chat
+ "https://jd.adventure.kyori.net/api/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-minimessage/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-serializer-gson/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-serializer-legacy/$adventureVersion/",
+ "https://jd.adventure.kyori.net/text-serializer-plain/$adventureVersion/",
+ // Paper end
)
}
diff --git a/src/main/java/co/aikar/timings/TimingsReportListener.java b/src/main/java/co/aikar/timings/TimingsReportListener.java
index ef58a6c00f444bd498a2d8fc4e457236f393954f..ecd149157d4fb80444f34bf5633d74bcdb63dec5 100644
--- a/src/main/java/co/aikar/timings/TimingsReportListener.java
+++ b/src/main/java/co/aikar/timings/TimingsReportListener.java
@@ -15,7 +15,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+ inputs.files(apiAndDocs).ignoreEmptyDirectories().withPropertyName(apiAndDocs.name + "-configuration")
+ doFirst {
+ options.addStringOption(
+ "sourcepath",
+ apiAndDocs.resolvedConfiguration.files.joinToString(separator = File.pathSeparator, transform = File::getPath)
+ )
@SuppressWarnings("WeakerAccess")
-public class TimingsReportListener implements MessageCommandSender {
+public class TimingsReportListener implements net.kyori.adventure.audience.ForwardingAudience, MessageCommandSender { // Paper
private final List<CommandSender> senders;
private final Runnable onDone;
private String timingsURL;
@@ -74,4 +74,17 @@ public class TimingsReportListener implements MessageCommandSender {
this.senders.add(Bukkit.getConsoleSender());
}
}
+
+ // Paper start
+ @Override
+ public void sendMessage(final @NotNull net.kyori.adventure.identity.Identity source, final @NotNull net.kyori.adventure.text.Component message, final @NotNull net.kyori.adventure.audience.MessageType type) {
+ net.kyori.adventure.audience.ForwardingAudience.super.sendMessage(source, message, type);
+ }
+
// workaround for https://github.com/gradle/gradle/issues/4046
inputs.dir("src/main/javadoc").withPropertyName("javadoc-sourceset")
doLast {
+ @NotNull
+ @Override
+ public Iterable<? extends net.kyori.adventure.audience.Audience> audiences() {
+ return this.senders;
+ }
+ // Paper end
}
diff --git a/src/main/java/io/papermc/paper/chat/ChatRenderer.java b/src/main/java/io/papermc/paper/chat/ChatRenderer.java
new file mode 100644
index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88ad3bab097
index 0000000000000000000000000000000000000000..85fd5d6777b53bab09cc54c360bb75141635bdd3
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chat/ChatRenderer.java
@@ -0,0 +1,78 @@
@@ -0,0 +1,75 @@
+package io.papermc.paper.chat;
+
+import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.text.Component;
+import org.bukkit.entity.Player;
+import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
@@ -104,7 +127,6 @@ index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88a
+ * @param viewer the receiving {@link Audience}
+ * @return a rendered chat message
+ */
+ @ApiStatus.OverrideOnly
+ @NotNull
+ Component render(@NotNull Player source, @NotNull Component sourceDisplayName, @NotNull Component message, @NotNull Audience viewer);
+
@@ -154,7 +176,6 @@ index 0000000000000000000000000000000000000000..2fc47afbb233e6e5727a7b672f61b88a
+ * @param message the chat message
+ * @return a rendered chat message
+ */
+ @ApiStatus.OverrideOnly
+ @NotNull
+ Component render(@NotNull Player source, @NotNull Component sourceDisplayName, @NotNull Component message);
+ }
@@ -467,10 +488,10 @@ index 0000000000000000000000000000000000000000..15ecb12fd2fefcac96edbaef7cdd487a
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257915b4afb 100644
index 0d96b6bdc744a23cc7322f2bd6a7a7b38acb6830..84a620bbbc24ded4075bce0209caed7fa03a92eb 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -357,7 +357,9 @@ public final class Bukkit {
@@ -369,7 +369,9 @@ public final class Bukkit {
*
* @param message the message
* @return the number of players
@@ -480,7 +501,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
public static int broadcastMessage(@NotNull String message) {
return server.broadcastMessage(message);
}
@@ -1051,6 +1053,19 @@ public final class Bukkit {
@@ -1012,6 +1014,19 @@ public final class Bukkit {
server.shutdown();
}
@@ -500,7 +521,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
/**
* Broadcasts the specified message to every user with the given
* permission name.
@@ -1060,6 +1075,21 @@ public final class Bukkit {
@@ -1021,6 +1036,21 @@ public final class Bukkit {
* permissibles} must have to receive the broadcast
* @return number of message recipients
*/
@@ -522,7 +543,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
public static int broadcast(@NotNull String message, @NotNull String permission) {
return server.broadcast(message, permission);
}
@@ -1298,6 +1328,7 @@ public final class Bukkit {
@@ -1220,6 +1250,7 @@ public final class Bukkit {
return server.createInventory(owner, type);
}
@@ -530,7 +551,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
/**
* Creates an empty inventory with the specified type and title. If the type
* is {@link InventoryType#CHEST}, the new inventory has a size of 27;
@@ -1323,6 +1354,38 @@ public final class Bukkit {
@@ -1245,6 +1276,38 @@ public final class Bukkit {
* @see InventoryType#isCreatable()
*/
@NotNull
@@ -569,7 +590,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
public static Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title) {
return server.createInventory(owner, type, title);
}
@@ -1341,6 +1404,7 @@ public final class Bukkit {
@@ -1263,6 +1326,7 @@ public final class Bukkit {
return server.createInventory(owner, size);
}
@@ -577,7 +598,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
/**
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
* specified size and title.
@@ -1353,10 +1417,30 @@ public final class Bukkit {
@@ -1275,10 +1339,30 @@ public final class Bukkit {
* @throws IllegalArgumentException if the size is not a multiple of 9
*/
@NotNull
@@ -608,7 +629,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
/**
* Creates an empty merchant.
*
@@ -1364,7 +1448,20 @@ public final class Bukkit {
@@ -1286,7 +1370,20 @@ public final class Bukkit {
* when the merchant inventory is viewed
* @return a new merchant
*/
@@ -629,7 +650,7 @@ index c15861905d7af679c4f6ffc27719a900b0fe4284..d5fdc57ffcfac4eb18d7fbf44ce13257
public static Merchant createMerchant(@Nullable String title) {
return server.createMerchant(title);
}
@@ -1470,22 +1567,47 @@ public final class Bukkit {
@@ -1366,22 +1463,47 @@ public final class Bukkit {
return server.isPrimaryThread();
}
@@ -708,7 +729,7 @@ index 32c92621c2c15eec14c50965f5ecda00c46e6c80..e076d447da62445764a9776ee2554c07
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Nameable.java b/src/main/java/org/bukkit/Nameable.java
index fee814e01a653d2b53c56e8b566383ca44aa5346..b71b780792b672b37c8fe65d43489b860a227381 100644
index fee814e01a653d2b53c56e8b566383ca44aa5346..2acdf2a6d3955923c721222b9da784f3278f6418 100644
--- a/src/main/java/org/bukkit/Nameable.java
+++ b/src/main/java/org/bukkit/Nameable.java
@@ -4,6 +4,30 @@ import org.jetbrains.annotations.Nullable;
@@ -742,27 +763,6 @@ index fee814e01a653d2b53c56e8b566383ca44aa5346..b71b780792b672b37c8fe65d43489b86
/**
* Gets the custom name on a mob or block. If there is no name this method
* will return null.
@@ -11,8 +35,10 @@ public interface Nameable {
* This value has no effect on players, they will always use their real
* name.
*
+ * @deprecated in favour of {@link #customName()}
* @return name of the mob/block or null
*/
+ @Deprecated // Paper
@Nullable
public String getCustomName();
@@ -25,7 +51,9 @@ public interface Nameable {
* This value has no effect on players, they will always use their real
* name.
*
+ * @deprecated in favour of {@link #customName(net.kyori.adventure.text.Component)}
* @param name the name to set
*/
+ @Deprecated // Paper
public void setCustomName(@Nullable String name);
}
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af6427f1f030 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
@@ -802,10 +802,10 @@ index 803fa0019869127ee8c7e4fb1777a59c43e66f8a..c65f0d6569c130b4920a9e71ad24af64
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904e4ceb9df 100644
index 7f4d6d605934e47ec97b8ad7cca3c48460bc0082..ede5de4c310a93989608bf48b3e5116f380589dd 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -58,13 +58,13 @@ import org.jetbrains.annotations.Nullable;
@@ -56,7 +56,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a server implementation.
*/
@@ -813,6 +813,8 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
+public interface Server extends PluginMessageRecipient, net.kyori.adventure.audience.ForwardingAudience { // Paper
/**
* Returns the de facto plugins directory, generally used for storing plugin jars to be loaded,
@@ -74,7 +74,7 @@ public interface Server extends PluginMessageRecipient {
* Used for all administrative messages, such as an operator using a
* command.
* <p>
@@ -821,7 +823,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
*/
public static final String BROADCAST_CHANNEL_ADMINISTRATIVE = "bukkit.broadcast.admin";
@@ -72,7 +72,7 @@ public interface Server extends PluginMessageRecipient {
@@ -82,7 +82,7 @@ public interface Server extends PluginMessageRecipient {
* Used for all announcement messages, such as informing users that a
* player has joined.
* <p>
@@ -830,7 +832,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
*/
public static final String BROADCAST_CHANNEL_USERS = "bukkit.broadcast.user";
@@ -294,7 +294,9 @@ public interface Server extends PluginMessageRecipient {
@@ -304,7 +304,9 @@ public interface Server extends PluginMessageRecipient {
*
* @param message the message
* @return the number of players
@@ -840,7 +842,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
public int broadcastMessage(@NotNull String message);
/**
@@ -894,8 +896,33 @@ public interface Server extends PluginMessageRecipient {
@@ -856,8 +858,33 @@ public interface Server extends PluginMessageRecipient {
* @param permission the required permission {@link Permissible
* permissibles} must have to receive the broadcast
* @return number of message recipients
@@ -874,7 +876,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
/**
* Gets the player by the given name, regardless if they are offline or
@@ -1093,6 +1120,7 @@ public interface Server extends PluginMessageRecipient {
@@ -1022,6 +1049,7 @@ public interface Server extends PluginMessageRecipient {
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type);
@@ -882,7 +884,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
/**
* Creates an empty inventory with the specified type and title. If the type
* is {@link InventoryType#CHEST}, the new inventory has a size of 27;
@@ -1118,6 +1146,36 @@ public interface Server extends PluginMessageRecipient {
@@ -1047,6 +1075,36 @@ public interface Server extends PluginMessageRecipient {
* @see InventoryType#isCreatable()
*/
@NotNull
@@ -919,7 +921,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
Inventory createInventory(@Nullable InventoryHolder owner, @NotNull InventoryType type, @NotNull String title);
/**
@@ -1132,6 +1190,22 @@ public interface Server extends PluginMessageRecipient {
@@ -1061,6 +1119,22 @@ public interface Server extends PluginMessageRecipient {
@NotNull
Inventory createInventory(@Nullable InventoryHolder owner, int size) throws IllegalArgumentException;
@@ -942,7 +944,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
/**
* Creates an empty inventory of type {@link InventoryType#CHEST} with the
* specified size and title.
@@ -1142,10 +1216,13 @@ public interface Server extends PluginMessageRecipient {
@@ -1071,10 +1145,13 @@ public interface Server extends PluginMessageRecipient {
* viewed
* @return a new inventory
* @throws IllegalArgumentException if the size is not a multiple of 9
@@ -956,7 +958,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
/**
* Creates an empty merchant.
*
@@ -1153,7 +1230,18 @@ public interface Server extends PluginMessageRecipient {
@@ -1082,7 +1159,18 @@ public interface Server extends PluginMessageRecipient {
* when the merchant inventory is viewed
* @return a new merchant
*/
@@ -975,7 +977,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
Merchant createMerchant(@Nullable String title);
/**
@@ -1240,20 +1328,41 @@ public interface Server extends PluginMessageRecipient {
@@ -1146,20 +1234,41 @@ public interface Server extends PluginMessageRecipient {
*/
boolean isPrimaryThread();
@@ -1017,7 +1019,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
String getShutdownMessage();
/**
@@ -1610,7 +1719,9 @@ public interface Server extends PluginMessageRecipient {
@@ -1536,7 +1645,9 @@ public interface Server extends PluginMessageRecipient {
* Sends the component to the player
*
* @param component the components to send
@@ -1027,7 +1029,7 @@ index cf53aead2eb5a52f1505ca694e95108fce28aa18..14b078e8fa4347dd0e186e5847693904
public void broadcast(@NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1619,7 +1730,9 @@ public interface Server extends PluginMessageRecipient {
@@ -1545,7 +1656,9 @@ public interface Server extends PluginMessageRecipient {
* Sends an array of components as a single message to the player
*
* @param components the components to send
@@ -1100,24 +1102,24 @@ index ac5e263d737973af077e3406a84a84baca4370db..2d91924b7f5ef16a91d40cdc1bfc3d68
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 01e11f882abb6c631f810584aa23646042688435..f43ad19a44f3b7368a1a110cc55247277f4d3751 100644
index 945b8b030d1b2a13afc0c4efad76997eb7bf00ba..e464769f72bf7d8e0f0630fd4f03011f8ac80dc7 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -22,6 +22,14 @@ import org.bukkit.plugin.PluginDescriptionFile;
@@ -17,6 +17,14 @@ import org.bukkit.plugin.PluginDescriptionFile;
*/
@Deprecated
public interface UnsafeValues {
+ // Paper start
+ net.kyori.adventure.text.flattener.ComponentFlattener componentFlattener();
+ @Deprecated net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
+ net.kyori.adventure.text.serializer.plain.PlainComponentSerializer plainComponentSerializer();
+ net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer plainTextSerializer();
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer gsonComponentSerializer();
+ net.kyori.adventure.text.serializer.gson.GsonComponentSerializer colorDownsamplingGsonComponentSerializer();
+ net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer legacyComponentSerializer();
+ // Paper end
void reportTimings(); // Paper
Material toLegacy(Material material);
diff --git a/src/main/java/org/bukkit/Warning.java b/src/main/java/org/bukkit/Warning.java
index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb1e09f3f4 100644
--- a/src/main/java/org/bukkit/Warning.java
@@ -1131,19 +1133,19 @@ index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb
return warning == null || warning.value();
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 81adea0efd380b7452f5f573e7a6ea378b071eab..cf6fe1b5a1531e8d30c0386e36c023d003458b7e 100644
index 8ab8515c55ba5944469084b3b4f093cb9f9648fb..c58b1885662c6a234ffee75995051c9750c1a512 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -40,7 +40,7 @@ import org.jetbrains.annotations.Nullable;
@@ -38,7 +38,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a world, which may contain entities, chunks and blocks
*/
-public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder {
+public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience { // Paper
-public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable {
+public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience { // Paper
/**
* Gets the {@link Block} at the given coordinates
@@ -635,6 +635,14 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -633,6 +633,14 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public List<Player> getPlayers();
@@ -1276,20 +1278,19 @@ index ab6b0ec328e94bf65a0dafd0403e5ee3b870296c..c8d37184d8e882a4084a1bfef85faa33
/**
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15ba936cc6 100644
index 03bdc1622791e1206406c87065978688d602e39e..c4dcafac892169a7bfcc065701fffb43c6cfdf44 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -32,8 +32,7 @@ public abstract class Command {
@@ -32,7 +32,7 @@ public abstract class Command {
protected String description;
protected String usageMessage;
private String permission;
- private String permissionMessage;
- public org.spigotmc.CustomTimingsHandler timings; // Spigot
+ private net.kyori.adventure.text.Component permissionMessage; // Paper
public co.aikar.timings.Timing timings; // Paper
@NotNull public String getTimingName() {return getName();} // Paper
protected Command(@NotNull String name) {
this(name, "", "/" + name, new ArrayList<String>());
@@ -186,10 +185,10 @@ public abstract class Command {
@@ -186,10 +186,10 @@ public abstract class Command {
if (permissionMessage == null) {
target.sendMessage(ChatColor.RED + "I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is a mistake.");
@@ -1304,7 +1305,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15
}
return false;
@@ -317,10 +316,12 @@ public abstract class Command {
@@ -316,10 +316,12 @@ public abstract class Command {
* command
*
* @return Permission check failed message
@@ -1318,7 +1319,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15
}
/**
@@ -381,10 +382,12 @@ public abstract class Command {
@@ -380,10 +382,12 @@ public abstract class Command {
* @param permissionMessage new permission message, null to indicate
* default message, or an empty string to indicate no message
* @return this command object, for chaining
@@ -1332,7 +1333,7 @@ index 4bfc214685164a38ba4261b2bae7faa8a3bd297e..50e6d45ec9349b56d20e2ffc664eca15
return this;
}
@@ -399,6 +402,25 @@ public abstract class Command {
@@ -398,6 +402,25 @@ public abstract class Command {
this.usageMessage = (usage == null) ? "" : usage;
return this;
}
@@ -1460,6 +1461,23 @@ index 284be63a125624a8ae43d2c164aede810ce6bfe5..f98d46fa45bb7c842d791b09f082a096
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/command/MessageCommandSender.java b/src/main/java/org/bukkit/command/MessageCommandSender.java
index a7ef1f51c2b96617a32e6e7b1723e8770ba8a6a8..68daa56546d00089d7d6c13ee897d828c377bbc3 100644
--- a/src/main/java/org/bukkit/command/MessageCommandSender.java
+++ b/src/main/java/org/bukkit/command/MessageCommandSender.java
@@ -49,6 +49,12 @@ public interface MessageCommandSender extends CommandSender {
default String getName() {
throw new NotImplementedException();
}
+ // Paper start
+ @Override
+ default net.kyori.adventure.text.@org.jetbrains.annotations.NotNull Component name() {
+ throw new NotImplementedException();
+ }
+ // Paper end
@Override
default boolean isOp() {
diff --git a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java b/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
index a542c4bb3c973bbe4b976642feccde6a4d90cb7b..614cba22c0997dbb45576f800675db4053a9831c 100644
--- a/src/main/java/org/bukkit/command/PluginCommandYamlParser.java
@@ -1544,7 +1562,7 @@ index 9566e4306ada5e82dede0f002aa06da12c44996b..4d5f0837bd0e02a30c943d8969fb6b13
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index 922d33ff4fa9d901d3c5c0a9f8399ad8aef62c37..cd287978c34873c7122794e4f3e762915978a1f0 100644
index 25a6f9313a1953def7470e411b53016f2ca14bef..10cb6088c4618f228c757f4e592b44edab81c2dc 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -25,7 +25,7 @@ import org.jetbrains.annotations.Nullable;
@@ -1556,7 +1574,7 @@ index 922d33ff4fa9d901d3c5c0a9f8399ad8aef62c37..cd287978c34873c7122794e4f3e76291
/**
* Gets the entity's current position
@@ -656,4 +656,20 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -648,4 +648,20 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@Override
Spigot spigot();
// Spigot end
@@ -1578,10 +1596,10 @@ index 922d33ff4fa9d901d3c5c0a9f8399ad8aef62c37..cd287978c34873c7122794e4f3e76291
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840ce98aed8b 100644
index c36e4ceb1094aa9469f976e0952e2725358ff761..e3cc40a54b48e8a90ccc93c272c1a2dca1da9595 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -37,7 +37,28 @@ import org.jetbrains.annotations.Nullable;
@@ -35,7 +35,28 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a player, connected or not
*/
@@ -1611,7 +1629,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
/**
* Gets the "friendly" name to display of this player. This may include
@@ -47,7 +68,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -45,7 +66,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* places defined by plugins.
*
* @return the friendly name
@@ -1621,7 +1639,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
@NotNull
public String getDisplayName();
@@ -59,15 +82,50 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -57,15 +80,50 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* places defined by plugins.
*
* @param name The new display name.
@@ -1672,7 +1690,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public String getPlayerListName();
/**
@@ -76,14 +134,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -74,14 +132,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* If the value is null, the name will be identical to {@link #getName()}.
*
* @param name new player list name
@@ -1691,7 +1709,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
@Nullable
public String getPlayerListHeader();
@@ -91,7 +153,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -89,7 +151,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Gets the currently displayed player list footer for this player.
*
* @return player list header or null
@@ -1701,7 +1719,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
@Nullable
public String getPlayerListFooter();
@@ -99,14 +163,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -97,14 +161,18 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Sets the currently displayed player list header for this player.
*
* @param header player list header, null for empty
@@ -1720,7 +1738,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void setPlayerListFooter(@Nullable String footer);
/**
@@ -115,7 +183,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -113,7 +181,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param header player list header, null for empty
* @param footer player list footer, null for empty
@@ -1730,7 +1748,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void setPlayerListHeaderFooter(@Nullable String header, @Nullable String footer);
/**
@@ -153,9 +223,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -151,9 +221,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* Kicks player with custom kick message.
*
* @param message kick message
@@ -1751,7 +1769,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
/**
* Says a message (or runs a command).
*
@@ -500,6 +581,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -473,6 +554,90 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull EquipmentSlot slot, @NotNull ItemStack item);
@@ -1842,7 +1860,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
/**
* Send a sign change. This fakes a sign change packet for a user at
* a certain location. This will not actually change the world in any way.
@@ -514,7 +679,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -487,7 +652,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param lines the new text on the sign or null to clear it
* @throws IllegalArgumentException if location is null
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
@@ -1852,7 +1870,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines) throws IllegalArgumentException;
/**
@@ -533,7 +700,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -506,7 +673,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException if location is null
* @throws IllegalArgumentException if dyeColor is null
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
@@ -1862,7 +1880,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor) throws IllegalArgumentException;
/**
@@ -553,7 +722,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -526,7 +695,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException if location is null
* @throws IllegalArgumentException if dyeColor is null
* @throws IllegalArgumentException if lines is non-null and has a length less than 4
@@ -1872,19 +1890,8 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText) throws IllegalArgumentException;
/**
@@ -1028,6 +1199,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1041,8 +1213,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
@@ -1008,6 +1179,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
+ @Deprecated // Paper
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt);
+ // Paper start
@@ -1938,22 +1945,11 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -1117,6 +1338,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component, boolean)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1132,8 +1354,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
@@ -1099,6 +1318,54 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
+ @Deprecated // Paper
public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force);
+ // Paper start
+ // Paper end
+ /**
+ * Request that the player's client download and switch resource packs.
+ * <p>
@@ -2004,7 +2000,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
/**
* Gets the Scoreboard displayed to this player
*
@@ -1249,7 +1520,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1192,7 +1459,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param title Title text
* @param subtitle Subtitle text
@@ -2013,7 +2009,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
*/
@Deprecated
public void sendTitle(@Nullable String title, @Nullable String subtitle);
@@ -1268,7 +1539,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1211,7 +1478,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param fadeIn time in ticks for titles to fade in. Defaults to 10.
* @param stay time in ticks for titles to stay. Defaults to 70.
* @param fadeOut time in ticks for titles to fade out. Defaults to 20.
@@ -2023,7 +2019,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
/**
@@ -1495,6 +1768,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1438,6 +1707,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public int getClientViewDistance();
@@ -2038,7 +2034,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
/**
* Gets the player's estimated ping in milliseconds.
*
@@ -1520,8 +1801,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1463,8 +1740,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* they wish.
*
* @return the player's locale
@@ -2049,7 +2045,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public String getLocale();
/**
@@ -1563,6 +1846,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1506,6 +1785,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public boolean isAllowingServerListings();
@@ -2064,7 +2060,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
// Spigot start
public class Spigot extends Entity.Spigot {
@@ -1617,11 +1908,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1560,11 +1847,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2078,7 +2074,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
@Override
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -1632,7 +1925,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1575,7 +1864,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param component the components to send
@@ -2088,7 +2084,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1642,7 +1937,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1585,7 +1876,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param components the components to send
@@ -2098,7 +2094,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1653,7 +1950,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1596,7 +1889,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param component the components to send
@@ -2108,7 +2104,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1664,7 +1963,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1607,7 +1902,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param components the components to send
@@ -2117,7 +2113,7 @@ index e0f9ba3da29261823d48042b74a33acb9f48d597..dc7e32a6f3be974a1d9c367d6b0f840c
+ @Deprecated // Paper
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java b/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
index 63c80b4ee1f7adc8a9efc3b607993104b1991f90..91cab8b13d5bba34007f124838b32a1df58c5ac7 100644
--- a/src/main/java/org/bukkit/entity/minecart/CommandMinecart.java
@@ -3307,10 +3303,10 @@ index 14346d83bc99581b18e53d19af03708c0bf22cf7..664de64b020cf9090a2fbee0afe2bfaf
public abstract String getTitle();
}
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index f89d71b77d1200314df6ca23614d5ca6fb15ceb3..af4a7ce37eb10bab06eadb6583c7894b3ec55ae6 100644
index 4ff149fd98895dd8ba45939a37c223b1f8d7281f..6cc4bad2ecd19f44a680ff03cbfb99d48ea5c337 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -159,4 +159,24 @@ public interface ItemFactory {
@@ -141,4 +141,24 @@ public interface ItemFactory {
@Deprecated
@NotNull
Material updateMaterial(@NotNull final ItemMeta meta, @NotNull final Material material) throws IllegalArgumentException;
@@ -3371,10 +3367,23 @@ index f70a6a22b85ff0da76e67e9b223ad4e0b020b5c4..a15abec467bac70116a6fc21a300d493
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/meta/BookMeta.java b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64af0edfb2 100644
index 94852d50e88d0594b84b581cd627174043629995..4947251f347d83fa326a67735293401c10d87ba4 100644
--- a/src/main/java/org/bukkit/inventory/meta/BookMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/BookMeta.java
@@ -10,7 +10,7 @@ import org.jetbrains.annotations.Nullable;
@@ -1,8 +1,12 @@
package org.bukkit.inventory.meta;
import java.util.List;
+
+import net.kyori.adventure.inventory.Book;
import net.md_5.bungee.api.chat.BaseComponent;
import org.bukkit.Material;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.common.returnsreceiver.qual.This;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -10,7 +14,7 @@ import org.jetbrains.annotations.Nullable;
* Represents a book ({@link Material#WRITABLE_BOOK} or {@link
* Material#WRITTEN_BOOK}) that can have a title, an author, and pages.
*/
@@ -3383,7 +3392,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
/**
* Represents the generation (or level of copying) of a written book
@@ -119,6 +119,118 @@ public interface BookMeta extends ItemMeta {
@@ -119,6 +123,117 @@ public interface BookMeta extends ItemMeta {
*/
boolean hasPages();
@@ -3410,7 +3419,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
+ */
+ @NotNull
+ @Override
+ @org.checkerframework.common.returnsreceiver.qual.This BookMeta title(@Nullable net.kyori.adventure.text.Component title);
+ @This BookMeta title(@Nullable net.kyori.adventure.text.Component title);
+
+ /**
+ * Gets the author of the book.
@@ -3432,8 +3441,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
+ */
+ @NotNull
+ @Override
+ @org.checkerframework.common.returnsreceiver.qual.This BookMeta author(@Nullable net.kyori.adventure.text.Component author);
+
+ @This BookMeta author(@Nullable net.kyori.adventure.text.Component author);
+ /**
+ * Gets the specified page in the book. The page must exist.
+ * <p>
@@ -3494,7 +3502,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
+ }
+
+ @Override
+ @org.checkerframework.checker.nullness.qual.NonNull
+ @NonNull
+ BookMetaBuilder toBuilder();
+
+ // Paper end
@@ -3502,7 +3510,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
/**
* Gets the specified page in the book. The given page must exist.
* <p>
@@ -126,8 +238,10 @@ public interface BookMeta extends ItemMeta {
@@ -126,8 +241,10 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to get, in range [1, getPageCount()]
* @return the page from the book
@@ -3513,7 +3521,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
String getPage(int page);
/**
@@ -141,15 +255,19 @@ public interface BookMeta extends ItemMeta {
@@ -141,15 +258,19 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to set, in range [1, getPageCount()]
* @param data the data to set for that page
@@ -3533,7 +3541,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
List<String> getPages();
/**
@@ -157,7 +275,9 @@ public interface BookMeta extends ItemMeta {
@@ -157,7 +278,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 100 pages with 256 characters per page.
*
* @param pages A list of pages to set the book to use
@@ -3543,7 +3551,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
void setPages(@NotNull List<String> pages);
/**
@@ -165,7 +285,9 @@ public interface BookMeta extends ItemMeta {
@@ -165,7 +288,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of strings, each being a page
@@ -3553,7 +3561,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
void setPages(@NotNull String... pages);
/**
@@ -173,7 +295,9 @@ public interface BookMeta extends ItemMeta {
@@ -173,7 +298,9 @@ public interface BookMeta extends ItemMeta {
* 256 characters per page.
*
* @param pages A list of strings, each being a page
@@ -3563,7 +3571,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
void addPage(@NotNull String... pages);
/**
@@ -195,8 +319,10 @@ public interface BookMeta extends ItemMeta {
@@ -195,8 +322,10 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to get
* @return the page from the book
@@ -3574,7 +3582,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
public BaseComponent[] getPage(int page) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -210,7 +336,9 @@ public interface BookMeta extends ItemMeta {
@@ -210,7 +339,9 @@ public interface BookMeta extends ItemMeta {
*
* @param page the page number to set
* @param data the data to set for that page
@@ -3584,7 +3592,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
public void setPage(int page, @Nullable BaseComponent... data) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -219,8 +347,10 @@ public interface BookMeta extends ItemMeta {
@@ -219,8 +350,10 @@ public interface BookMeta extends ItemMeta {
* Gets all the pages in the book.
*
* @return list of all the pages in the book
@@ -3595,7 +3603,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
public List<BaseComponent[]> getPages() {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -230,7 +360,9 @@ public interface BookMeta extends ItemMeta {
@@ -230,7 +363,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of pages to set the book to use
@@ -3605,7 +3613,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
public void setPages(@NotNull List<BaseComponent[]> pages) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -240,7 +372,9 @@ public interface BookMeta extends ItemMeta {
@@ -240,7 +375,9 @@ public interface BookMeta extends ItemMeta {
* pages. Maximum 50 pages with 256 characters per page.
*
* @param pages A list of component arrays, each being a page
@@ -3615,7 +3623,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
public void setPages(@NotNull BaseComponent[]... pages) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -250,7 +384,9 @@ public interface BookMeta extends ItemMeta {
@@ -250,7 +387,9 @@ public interface BookMeta extends ItemMeta {
* with 256 characters per page.
*
* @param pages A list of component arrays, each being a page
@@ -3626,7 +3634,7 @@ index 94852d50e88d0594b84b581cd627174043629995..36bcbb3f3acedf7ebecbf6f6b358cf64
throw new UnsupportedOperationException("Not supported yet.");
}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 91eee1470f0969e9eef0753c0c700ae5354f1acc..69f68ca2d62c2cfe07a193776054c14c352a5942 100644
index f2e9f2753ec92aa4a3e3f06ca6053bd70b9091d7..1c362636c56db0e6c118171ba367c43c4f7cff33 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -31,6 +31,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -3977,7 +3985,7 @@ index ff3fcb2697eb00736238d0efdcaefe43043334d3..75acd6f8f3d774bb79e8e513125e801c
/**
diff --git a/src/main/java/org/bukkit/scoreboard/Scoreboard.java b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d78560f15 100644
index 5c855dbd0da895392f7a6e92cdc90782baf614ad..f7754ab421c7b452a53c28d1e2fafdccfbba24bf 100644
--- a/src/main/java/org/bukkit/scoreboard/Scoreboard.java
+++ b/src/main/java/org/bukkit/scoreboard/Scoreboard.java
@@ -27,6 +27,48 @@ public interface Scoreboard {
@@ -3993,7 +4001,7 @@ index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d
+ * @param displayName Name displayed to players for the Objective.
+ * @return The registered Objective
+ * @throws IllegalArgumentException if name is null
+ * @throws IllegalArgumentException if name is longer than 32767
+ * @throws IllegalArgumentException if name is longer than 16
+ * characters.
+ * @throws IllegalArgumentException if criteria is null
+ * @throws IllegalArgumentException if displayName is null
@@ -4013,7 +4021,7 @@ index 5c855dbd0da895392f7a6e92cdc90782baf614ad..1ada91d790abedbc9b3aeb6e96467a0d
+ * @param renderType Manner of rendering the Objective
+ * @return The registered Objective
+ * @throws IllegalArgumentException if name is null
+ * @throws IllegalArgumentException if name is longer than 32767
+ * @throws IllegalArgumentException if name is longer than 16
+ * characters.
+ * @throws IllegalArgumentException if criteria is null
+ * @throws IllegalArgumentException if displayName is null
@@ -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 71e696eadf7c9290791c8b50d666dc501621f24e..4b24f217742497c0674952eb4eb73f00a0ce4069 100644
index e3cc40a54b48e8a90ccc93c272c1a2dca1da9595..a6f6dea965eee2de2183f189580d1b7141a9308f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1807,6 +1807,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1746,6 +1746,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@Deprecated // Paper
public String getLocale();
+4 -4
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 5c6b7f5095a5bb7290e1edefb0c9e985123f80d8..595d368bc88b6217f1fb2e074de7fd5b07fa96df 100644
index 84a620bbbc24ded4075bce0209caed7fa03a92eb..bbee4e40917cca4e692c3d60c1c513b4c847160f 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1845,6 +1845,17 @@ public final class Bukkit {
@@ -1728,6 +1728,17 @@ public final class Bukkit {
return server.getEntity(uuid);
}
@@ -27,10 +27,10 @@ index 5c6b7f5095a5bb7290e1edefb0c9e985123f80d8..595d368bc88b6217f1fb2e074de7fd5b
* 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 1dedbea03e259679e101a8443b662b20375adfd0..5aa2040dc51f65ad57329a5a235a22c50c62f1b2 100644
index ede5de4c310a93989608bf48b3e5116f380589dd..835041d2ab6545e52d963d96d558f9a7e52d279a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1567,6 +1567,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1461,6 +1461,16 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
Entity getEntity(@NotNull UUID uuid);
+2 -2
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 ce5794d684a1126ec9acbf4af17f5d6fa783f551..5ba6c7a69937badd64256248560268fb695d5f74 100644
index e464769f72bf7d8e0f0630fd4f03011f8ac80dc7..bfeec56e83229dbfc8625b3b90bd6c138c73bc1d 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -94,5 +94,12 @@ public interface UnsafeValues {
@@ -85,5 +85,12 @@ public interface UnsafeValues {
* @return name
*/
String getTimingsServerName();
+2 -2
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 cd287978c34873c7122794e4f3e762915978a1f0..c315d2494969190f8b53236f905ad5c5cf1bfc39 100644
index 10cb6088c4618f228c757f4e592b44edab81c2dc..65088203d29798efe211612dfadb356f457ed466 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -671,5 +671,15 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -663,5 +663,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())));
}
+8 -34
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 cf6fe1b5a1531e8d30c0386e36c023d003458b7e..ad342ecd8b86903276c62644624cff55cf190026 100644
index c58b1885662c6a234ffee75995051c9750c1a512..7b1fb280a86ab44756fc233b085f878d2a27ad66 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2597,6 +2597,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2450,6 +2450,52 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
int getSimulationDistance();
// Spigot end
@@ -23,21 +23,13 @@ index cf6fe1b5a1531e8d30c0386e36c023d003458b7e..ad342ecd8b86903276c62644624cff55
+ void setViewDistance(int viewDistance);
+
+ /**
+ * Sets the simulation distance for this world.
+ * @param simulationDistance simulation distance in [2, 32]
+ */
+ void setSimulationDistance(int simulationDistance);
+
+ /**
+ * Returns the no-tick view distance for this world.
+ * <p>
+ * No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not
+ * be set to tick.
+ * </p>
+ * @return The no-tick view distance for this world.
+ * @deprecated Use {@link #getViewDistance()}
+ */
+ @Deprecated
+ int getNoTickViewDistance();
+
+ /**
@@ -47,9 +39,7 @@ index cf6fe1b5a1531e8d30c0386e36c023d003458b7e..ad342ecd8b86903276c62644624cff55
+ * be set to tick.
+ * </p>
+ * @param viewDistance view distance in [2, 32]
+ * @deprecated Use {@link #setViewDistance(int)}
+ */
+ @Deprecated
+ void setNoTickViewDistance(int viewDistance);
+
+ /**
@@ -59,7 +49,7 @@ index cf6fe1b5a1531e8d30c0386e36c023d003458b7e..ad342ecd8b86903276c62644624cff55
+ * </p>
+ * @return The sending view distance for this world.
+ */
+ int getSendViewDistance();
+ public int getSendViewDistance();
+
+ /**
+ * Sets the sending view distance for this world.
@@ -68,17 +58,17 @@ index cf6fe1b5a1531e8d30c0386e36c023d003458b7e..ad342ecd8b86903276c62644624cff55
+ * </p>
+ * @param viewDistance view distance in [2, 32] or -1
+ */
+ void setSendViewDistance(int viewDistance);
+ public void setSendViewDistance(int viewDistance);
+ // Paper end - view distance api
+
// Spigot start
public class Spigot {
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 4b24f217742497c0674952eb4eb73f00a0ce4069..621ab05b0cecc8c21c5bcac8956082d138a006ae 100644
index a6f6dea965eee2de2183f189580d1b7141a9308f..bf60cc1beed41f6dc30b0df0bae9b937ddfa5553 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1821,6 +1821,78 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1760,6 +1760,62 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param affects Whether the player can affect mob spawning
*/
public void setAffectsSpawning(boolean affects);
@@ -88,6 +78,7 @@ index 4b24f217742497c0674952eb4eb73f00a0ce4069..621ab05b0cecc8c21c5bcac8956082d1
+ *
+ * @return the player's view distance
+ * @see org.bukkit.World#getViewDistance()
+ * @see org.bukkit.World#getNoTickViewDistance()
+ */
+ public int getViewDistance();
+
@@ -96,22 +87,9 @@ index 4b24f217742497c0674952eb4eb73f00a0ce4069..621ab05b0cecc8c21c5bcac8956082d1
+ *
+ * @param viewDistance the player's view distance
+ * @see org.bukkit.World#setViewDistance(int)
+ * @see org.bukkit.World#setNoTickViewDistance(int)
+ */
+ public void setViewDistance(int viewDistance);
+
+ /**
+ * Gets the simulation distance for this player
+ *
+ * @return the player's simulation distance
+ */
+ public int getSimulationDistance();
+
+ /**
+ * Sets the simulation distance for this player
+ *
+ * @param simulationDistance the player's new simulation distance
+ */
+ public void setSimulationDistance(int simulationDistance);
+
+ /**
+ * Gets the no-ticking view distance for this player.
@@ -120,9 +98,7 @@ index 4b24f217742497c0674952eb4eb73f00a0ce4069..621ab05b0cecc8c21c5bcac8956082d1
+ * be set to tick.
+ * </p>
+ * @return The no-tick view distance for this player.
+ * @deprecated Use {@link #getViewDistance()}
+ */
+ @Deprecated
+ public int getNoTickViewDistance();
+
+ /**
@@ -132,9 +108,7 @@ index 4b24f217742497c0674952eb4eb73f00a0ce4069..621ab05b0cecc8c21c5bcac8956082d1
+ * be set to tick.
+ * </p>
+ * @param viewDistance view distance in [2, 32] or -1
+ * @deprecated Use {@link #setViewDistance(int)}
+ */
+ @Deprecated
+ public void setNoTickViewDistance(int viewDistance);
+
+ /**
@@ -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 595d368bc88b6217f1fb2e074de7fd5b07fa96df..4486e8ddcfc3aa1403bbfce28c0356c174709a9b 100644
index bbee4e40917cca4e692c3d60c1c513b4c847160f..259c15ada05115b9fc86f1de06649d5cec2ef137 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2029,6 +2029,19 @@ public final class Bukkit {
@@ -1912,6 +1912,19 @@ public final class Bukkit {
return server.getUnsafe();
}
@@ -29,10 +29,10 @@ index 595d368bc88b6217f1fb2e074de7fd5b07fa96df..4486e8ddcfc3aa1403bbfce28c0356c1
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 5aa2040dc51f65ad57329a5a235a22c50c62f1b2..96d6b49d609142fe93d5d07e65dd126adb5c2bde 100644
index 835041d2ab6545e52d963d96d558f9a7e52d279a..66211ef974b9e091983bfda108f6e420c01a9d78 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1577,6 +1577,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1471,6 +1471,15 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
public double[] getTPS();
// Paper end
@@ -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 4486e8ddcfc3aa1403bbfce28c0356c174709a9b..1bd3780f8331074b24f9f4e2bbeeb2b37514aaa3 100644
index 259c15ada05115b9fc86f1de06649d5cec2ef137..5fc71e24f1562ff0d448b964f29fd109d4d9bb4d 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -378,6 +378,30 @@ public final class Bukkit {
@@ -376,6 +376,30 @@ public final class Bukkit {
return server.broadcastMessage(message);
}
@@ -41,10 +41,10 @@ index 4486e8ddcfc3aa1403bbfce28c0356c174709a9b..1bd3780f8331074b24f9f4e2bbeeb2b3
* 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 96d6b49d609142fe93d5d07e65dd126adb5c2bde..75bc4937f7a895c1bbf0a0800035ad8f7e0c5f46 100644
index 66211ef974b9e091983bfda108f6e420c01a9d78..8fb6545406ab6029d82c903856bda6c6d6fa0636 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -311,6 +311,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -309,6 +309,30 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Deprecated // Paper
public int broadcastMessage(@NotNull String message);
@@ -76,10 +76,10 @@ index 96d6b49d609142fe93d5d07e65dd126adb5c2bde..75bc4937f7a895c1bbf0a0800035ad8f
* 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 621ab05b0cecc8c21c5bcac8956082d138a006ae..9d26a1ed696d78895df216b3f94d419963b4b1c6 100644
index 152f848d2f93a52999f093bd83b4732af9aab8d8..771682aa1c5e1bfb9670cc98ce99439014d0d31c 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -735,6 +735,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -708,6 +708,42 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void sendMap(@NotNull MapView map);
@@ -432,7 +432,7 @@ index 0000000000000000000000000000000000000000..9e90c3df567a65b48a0b9341f784eb90
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 9d26a1ed696d78895df216b3f94d419963b4b1c6..f7acb33e31172eed213801acf54ce6e88042f70d 100644
index b6a848261f7c136cbcb4a4f40223d2f248d546c2..1df2ff828aee7dac50d63fe1d51104e9fb2ed264 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2,6 +2,7 @@ package org.bukkit.entity;
@@ -443,7 +443,7 @@ index 9d26a1ed696d78895df216b3f94d419963b4b1c6..f7acb33e31172eed213801acf54ce6e8
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -769,6 +770,131 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -742,6 +743,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);
}
@@ -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 f7acb33e31172eed213801acf54ce6e88042f70d..89ffcc20e94d166397f5794ee14515051c790dc4 100644
index cd2c4ff23cdbcc3e4e9ae94477a372d25ad31e39..422f322b9623dcb33472744ddfd91d7dba817471 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1286,7 +1286,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1251,7 +1251,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the URL is null.
* @throws IllegalArgumentException Thrown if the URL is too long. The
* length restriction is an implementation specific arbitrary value.
@@ -18,7 +18,7 @@ index f7acb33e31172eed213801acf54ce6e88042f70d..89ffcc20e94d166397f5794ee1451505
public void setResourcePack(@NotNull String url);
/**
@@ -2102,6 +2104,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2025,6 +2027,124 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
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.displayName())));
}
@@ -6,10 +6,10 @@ 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 19b65a9b56b73f873ef646d14a6cf091b69d3873..bc6f68a0cadeec865401e9cb0dce89460484b148 100644
index 0e8e827b5a05ac9423386eaea4188d132cc7f954..70d6503745942ea8637146369aeab8f9357c42d5 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -39,6 +39,9 @@ dependencies {
@@ -38,6 +38,9 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
@@ -118,10 +118,10 @@ index 0000000000000000000000000000000000000000..c83672427324bd068ed52916f700b684
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
new file mode 100644
index 0000000000000000000000000000000000000000..b8d5c13980858dc27fb5383726b7ebcaf14adcb8
index 0000000000000000000000000000000000000000..b6e7d8ee8d903ebf975d60bec0e08603d9a49fdb
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/executor/asm/ASMEventExecutorGenerator.java
@@ -0,0 +1,51 @@
@@ -0,0 +1,47 @@
+package com.destroystokyo.paper.event.executor.asm;
+
+import java.lang.reflect.Method;
@@ -147,18 +147,14 @@ index 0000000000000000000000000000000000000000..b8d5c13980858dc27fb5383726b7ebca
+ methodGenerator.returnValue();
+ methodGenerator.endMethod();
+ // Generate the execute method
+ methodGenerator = new GeneratorAdapter(writer.visitMethod(ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event;)V", null, null), ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Listener;)V");
+ methodGenerator = new GeneratorAdapter(writer.visitMethod(ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Event;)V", null, null), ACC_PUBLIC, "execute", "(Lorg/bukkit/event/Listener;Lorg/bukkit/event/Listener;)V");;
+ methodGenerator.loadArg(0);
+ methodGenerator.checkCast(Type.getType(m.getDeclaringClass()));
+ methodGenerator.loadArg(1);
+ methodGenerator.checkCast(Type.getType(m.getParameterTypes()[0]));
+ methodGenerator.visitMethodInsn(m.getDeclaringClass().isInterface() ? INVOKEINTERFACE : INVOKEVIRTUAL, Type.getInternalName(m.getDeclaringClass()), m.getName(), Type.getMethodDescriptor(m), m.getDeclaringClass().isInterface());
+ // The only purpose of this switch statement is to generate the correct pop instruction, should the event handler method return something other than void.
+ // Non-void event handlers will be unsupported in a future release.
+ switch (Type.getType(m.getReturnType()).getSize()) {
+ // case 0 is omitted because the only type that has size 0 is void - no pop instruction needed.
+ case 1 -> methodGenerator.pop(); // handles reference types and most primitives
+ case 2 -> methodGenerator.pop2(); // handles long and double
+ if (m.getReturnType() != void.class) {
+ methodGenerator.pop();
+ }
+ methodGenerator.returnValue();
+ methodGenerator.endMethod();
@@ -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 1bd3780f8331074b24f9f4e2bbeeb2b37514aaa3..2b3ced048a48f660ca0859425583d342e7847744 100644
index 5fc71e24f1562ff0d448b964f29fd109d4d9bb4d..191e9985fc17ffbdb9b6bdadbea46da54f5f7599 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2064,6 +2064,13 @@ public final class Bukkit {
@@ -1947,6 +1947,13 @@ public final class Bukkit {
public static org.bukkit.command.CommandMap getCommandMap() {
return server.getCommandMap();
}
@@ -24,10 +24,10 @@ index 1bd3780f8331074b24f9f4e2bbeeb2b37514aaa3..2b3ced048a48f660ca0859425583d342
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 75bc4937f7a895c1bbf0a0800035ad8f7e0c5f46..be5f25a51a12082cb6732445c221d61246da89e9 100644
index 8fb6545406ab6029d82c903856bda6c6d6fa0636..731679a0893635f5cb71a19fd9ee8562795230b8 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1823,4 +1823,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1717,4 +1717,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@NotNull
Spigot spigot();
// Spigot end
@@ -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 2b3ced048a48f660ca0859425583d342e7847744..012b656a43cc0cf33597b835d045f8b5f3d309dd 100644
index 191e9985fc17ffbdb9b6bdadbea46da54f5f7599..3f58ffb4c59a92259fc5dde3d220658b6e54896f 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2071,6 +2071,15 @@ public final class Bukkit {
@@ -1954,6 +1954,15 @@ public final class Bukkit {
public static void reloadPermissions() {
server.reloadPermissions();
}
@@ -26,10 +26,10 @@ index 2b3ced048a48f660ca0859425583d342e7847744..012b656a43cc0cf33597b835d045f8b5
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index be5f25a51a12082cb6732445c221d61246da89e9..9c1cd95e125b1d7677daea1575a466a1b955053a 100644
index 731679a0893635f5cb71a19fd9ee8562795230b8..01df6fc54078901a9195dd2bb45eaef1706ba036 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1825,4 +1825,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1719,4 +1719,6 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
// Spigot end
void reloadPermissions(); // Paper
@@ -5,7 +5,7 @@ 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 89ffcc20e94d166397f5794ee14515051c790dc4..a8ace9646ebcb70a5247a7d25c411a0bcf2d9185 100644
index 422f322b9623dcb33472744ddfd91d7dba817471..9d9dd1f73b4c3ff143fbba87d8b5630017affd08 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -3,6 +3,7 @@ package org.bukkit.entity;
@@ -16,7 +16,7 @@ index 89ffcc20e94d166397f5794ee14515051c790dc4..a8ace9646ebcb70a5247a7d25c411a0b
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -737,6 +738,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -710,6 +711,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@@ -56,7 +56,7 @@ index 89ffcc20e94d166397f5794ee14515051c790dc4..a8ace9646ebcb70a5247a7d25c411a0b
/**
* Sends the component to the player
*
@@ -764,9 +798,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -737,9 +771,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
*
@@ -68,7 +68,7 @@ index 89ffcc20e94d166397f5794ee14515051c790dc4..a8ace9646ebcb70a5247a7d25c411a0b
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
spigot().sendMessage(position, components);
}
@@ -2293,6 +2329,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2216,6 +2252,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Sends the component to the specified screen position of this player
*
@@ -76,7 +76,7 @@ index 89ffcc20e94d166397f5794ee14515051c790dc4..a8ace9646ebcb70a5247a7d25c411a0b
* @param position the screen position
* @param component the components to send
* @deprecated use {@code sendMessage} methods that accept {@link net.kyori.adventure.text.Component}
@@ -2305,6 +2342,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2228,6 +2265,7 @@ 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
*
@@ -7,12 +7,12 @@ 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 bf23ef001fb5177b7aab0b3ed8752f58641bb840..8a2ca11be9ebde91268b20d25a35e1d6842f49de 100644
index 7b1fb280a86ab44756fc233b085f878d2a27ad66..cec39714294127478b6e73452354ba7ccab78b25 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -42,6 +42,33 @@ import org.jetbrains.annotations.Nullable;
@@ -40,6 +40,33 @@ import org.jetbrains.annotations.Nullable;
*/
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, PersistentDataHolder, net.kyori.adventure.audience.ForwardingAudience { // Paper
public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient, Metadatable, net.kyori.adventure.audience.ForwardingAudience { // Paper
+ // Paper start
+ /**
@@ -5,10 +5,10 @@ Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check
diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java
index 95bb16185514e0b894f407028997ce7d4504f8fb..238b9e2309d633623d35a1dbded6edadf20831f3 100644
index 7e8f5649ce0eb0090899514b1e228601eb644613..afb7b136b461202026290624836446cff9f9e45d 100644
--- a/src/main/java/org/bukkit/WorldBorder.java
+++ b/src/main/java/org/bukkit/WorldBorder.java
@@ -127,4 +127,18 @@ public interface WorldBorder {
@@ -117,4 +117,18 @@ public interface WorldBorder {
* @return if this location is inside the border or not
*/
public boolean isInside(@NotNull Location location);
@@ -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 012b656a43cc0cf33597b835d045f8b5f3d309dd..a5868c0bdee345195e279467b526d5d9ff7f64d2 100644
index 3f58ffb4c59a92259fc5dde3d220658b6e54896f..45c4fddb8562736eaf98810d70d002ae6e3664e7 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2080,6 +2080,16 @@ public final class Bukkit {
@@ -1963,6 +1963,16 @@ public final class Bukkit {
public static boolean reloadCommandAliases() {
return server.reloadCommandAliases();
}
@@ -27,10 +27,10 @@ index 012b656a43cc0cf33597b835d045f8b5f3d309dd..a5868c0bdee345195e279467b526d5d9
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 9c1cd95e125b1d7677daea1575a466a1b955053a..acd69a5d946974e0b50439a98712750698768ce5 100644
index 01df6fc54078901a9195dd2bb45eaef1706ba036..1db8f63d9207330acc1b403adce0773149bc879f 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1827,4 +1827,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1721,4 +1721,14 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
void reloadPermissions(); // Paper
boolean reloadCommandAliases(); // Paper
+20 -7
View File
@@ -6,10 +6,10 @@ Subject: [PATCH] Fix upstream javadocs
Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index a5868c0bdee345195e279467b526d5d9ff7f64d2..ece84330d2700db8708d2ae2ab7badf4acb428a8 100644
index 45c4fddb8562736eaf98810d70d002ae6e3664e7..9838557d874e498e1f7cef8f219000dcaea7a263 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1311,6 +1311,8 @@ public final class Bukkit {
@@ -1220,6 +1220,8 @@ public final class Bukkit {
/**
* Gets every player that has ever played on this server.
@@ -19,10 +19,10 @@ index a5868c0bdee345195e279467b526d5d9ff7f64d2..ece84330d2700db8708d2ae2ab7badf4
* @return an array containing all previous players
*/
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index acd69a5d946974e0b50439a98712750698768ce5..3c987b2fb0f748ce92a87c4ee54a4e9722e1910e 100644
index 1db8f63d9207330acc1b403adce0773149bc879f..ad11f8271d5b6f44d7d5cf0c122b51b2b8d1af3b 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1110,6 +1110,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1027,6 +1027,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
/**
* Gets every player that has ever played on this server.
@@ -45,7 +45,7 @@ index 91fc11dda99de506be83d40df8929bf7cd8e8d85..7dc631ebd009f5f5c3ac1699c3f3515c
// Paper end
}
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index 50ac6f0374da5697a38ef5ec7625da91d4a4276c..f607c57275958bf1cbf8e77b4d7efa936064c228 100644
index db4ba67618d29f72d695c66c27d771795565a1d0..0ab94ddd3b88eee8040233a89823bd2fadc78d55 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -21,6 +21,11 @@ import org.jetbrains.annotations.Nullable;
@@ -76,10 +76,10 @@ index be9334a8b5fba9181ad63c211697e798be63da25..0514a141cb93a650be38c63d4336d46e
* Instructs this Mob to set the specified LivingEntity as its target.
* <p>
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index a8ace9646ebcb70a5247a7d25c411a0bcf2d9185..f32eaa35d9152564300455a24c811e15d3ab694f 100644
index d98029f01bc81c5bf33545fee54bdbce17960b50..dae5ffe9ed6ea43b269d14a6aaf08929fb90570f 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -755,7 +755,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -728,7 +728,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* Use supplied alternative character to the section symbol to represent legacy color codes.
*
@@ -122,3 +122,16 @@ index 1b2267f4e8ebded198773ec80e2bff2c861c7084..1a58734d919fae247eeb85dd785fd599
public Location getTo() {
return to;
}
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
index 99d900b2394b6c210ccf845768dae72864f32270..515587a958041e94f03c48ae87812abc39e1791c 100644
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -106,7 +106,7 @@ public interface PlayerInventory extends Inventory {
*
* @return the ItemStack in the given slot
*/
- @NotNull
+ @Nullable
public ItemStack getItem(@NotNull EquipmentSlot slot);
/**
+2 -2
View File
@@ -5,10 +5,10 @@ Subject: [PATCH] Item#canEntityPickup
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
index 65dd4554c6cc0801fcbc0ef6809b794dcebd1124..ab06c640cef1309ab44b0fae8d95df48cdc869a7 100644
index 3f2736fbddd8661e764bc2f8d0499bd13ca91df5..c404a5b8efea7c780db5ddae19456753808abb3d 100644
--- a/src/main/java/org/bukkit/entity/Item.java
+++ b/src/main/java/org/bukkit/entity/Item.java
@@ -89,4 +89,20 @@ public interface Item extends Entity {
@@ -75,4 +75,20 @@ public interface Item extends Entity {
*/
@Nullable
public UUID getThrower();
+11 -117
View File
@@ -7,24 +7,22 @@ Provides basic elements of a PlayerProfile to be used by future API/events
diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
new file mode 100644
index 0000000000000000000000000000000000000000..d4766e2116c2202d84080637a2832bef0ab3f718
index 0000000000000000000000000000000000000000..2ef9a7bd55e2c9cf8cb20d5f77282676ae11181f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
@@ -0,0 +1,199 @@
@@ -0,0 +1,177 @@
+package com.destroystokyo.paper.profile;
+
+import java.util.Collection;
+import java.util.Set;
+import java.util.UUID;
+
+import org.bukkit.profile.PlayerTextures;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Represents a players profile for the game, such as UUID, Name, and textures.
+ */
+public interface PlayerProfile extends org.bukkit.profile.PlayerProfile {
+public interface PlayerProfile {
+
+ /**
+ * @return The players name, if set
@@ -39,7 +37,6 @@ index 0000000000000000000000000000000000000000..d4766e2116c2202d84080637a2832bef
+ * @return The previous Name
+ */
+ @NotNull
+ @Deprecated(forRemoval = true)
+ String setName(@Nullable String name);
+
+ /**
@@ -54,28 +51,9 @@ index 0000000000000000000000000000000000000000..d4766e2116c2202d84080637a2832bef
+ * @return The previous UUID
+ */
+ @Nullable
+ @Deprecated(forRemoval = true)
+ UUID setId(@Nullable UUID uuid);
+
+ /**
+ * Gets the {@link PlayerTextures} of this profile.
+ * This will build a snapshot of the current texture data once
+ * requested inside PlayerTextures.
+ *
+ * @return the textures, not <code>null</code>
+ */
+ @NotNull
+ PlayerTextures getTextures();
+
+ /**
+ * Copies the given textures.
+ *
+ * @param textures the textures to copy, or <code>null</code> to clear the
+ * textures
+ */
+ void setTextures(@Nullable PlayerTextures textures);
+
+ /**
+ * @return A Mutable set of this players properties, such as textures.
+ * Values specified here are subject to implementation details.
+ */
@@ -289,20 +267,16 @@ index 0000000000000000000000000000000000000000..7b3b6ef533d32169fbeca389bd61cfc6
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ece84330d2700db8708d2ae2ab7badf4acb428a8..90c875ad60e473c3ec25f209933d48615d0fd6c0 100644
index 9838557d874e498e1f7cef8f219000dcaea7a263..c7daa7c9f85c62d0effd5c3f406568d77fd8cd78 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2092,6 +2092,83 @@ public final class Bukkit {
@@ -1975,6 +1975,40 @@ public final class Bukkit {
public static boolean suggestPlayerNamesWhenNullTabCompletions() {
return server.suggestPlayerNamesWhenNullTabCompletions();
}
+
+ /**
+ * Creates a PlayerProfile for the specified uuid, with name as null.
+ *
+ * If a player with the passed uuid exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ *
+ * Creates a PlayerProfile for the specified uuid, with name as null
+ * @param uuid UUID to create profile for
+ * @return A PlayerProfile object
+ */
@@ -312,16 +286,7 @@ index ece84330d2700db8708d2ae2ab7badf4acb428a8..90c875ad60e473c3ec25f209933d4861
+ }
+
+ /**
+ * Creates a PlayerProfile for the specified name, with UUID as null.
+ *
+ * If a player with the passed name exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile("JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on a case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * Creates a PlayerProfile for the specified name, with UUID as null
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
@@ -334,16 +299,6 @@ index ece84330d2700db8708d2ae2ab7badf4acb428a8..90c875ad60e473c3ec25f209933d4861
+ * Creates a PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile(null, "JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on an case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * The name comparison will compare the {@link String#toLowerCase()} version of both the passed name parameter and
+ * a players name to honour the case-insensitive nature of a mojang profile lookup.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
@@ -352,45 +307,21 @@ index ece84330d2700db8708d2ae2ab7badf4acb428a8..90c875ad60e473c3ec25f209933d4861
+ @NotNull
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name) {
+ return server.createProfile(uuid, name);
+ }
+
+ /**
+ * Creates an exact PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player.
+ * <p>
+ * Compared to {@link #createProfile(UUID, String)}, this method will never mutate the passed uuid or name.
+ * If a player with either the same uuid or a matching name (case-insensitive) is found on the server, their
+ * properties, such as textures, will be pre-populated in the profile, however the passed uuid and name stay intact.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
+ @NotNull
+ public static com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name) {
+ return server.createProfileExact(uuid, name);
+ }
// Paper end
@NotNull
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..9796ae6fcf605af88c1e5c1d29d77ea6857632cc 100644
index ad11f8271d5b6f44d7d5cf0c122b51b2b8d1af3b..fb5c308d82e9103a212deea2a6fa2e158cddb931 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1838,5 +1838,74 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1732,5 +1732,33 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
* @return true if player names should be suggested
*/
boolean suggestPlayerNamesWhenNullTabCompletions();
+
+ /**
+ * Creates a PlayerProfile for the specified uuid, with name as null.
+ *
+ * If a player with the passed uuid exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ *
+ * Creates a PlayerProfile for the specified uuid, with name as null
+ * @param uuid UUID to create profile for
+ * @return A PlayerProfile object
+ */
@@ -398,16 +329,7 @@ index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..9796ae6fcf605af88c1e5c1d29d77ea6
+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@NotNull UUID uuid);
+
+ /**
+ * Creates a PlayerProfile for the specified name, with UUID as null.
+ *
+ * If a player with the passed name exists on the server at the time of creation, the returned player profile will
+ * be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile("JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on a case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * Creates a PlayerProfile for the specified name, with UUID as null
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
@@ -418,16 +340,6 @@ index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..9796ae6fcf605af88c1e5c1d29d77ea6
+ * Creates a PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player (including their uuid and name).
+ * <p>
+ * E.g. if the player 'jeb_' is currently playing on the server, calling {@code createProfile(null, "JEB_")} will
+ * yield a profile with the name 'jeb_', their uuid and their textures.
+ * To bypass this pre-population on an case-insensitive name match, see {@link #createProfileExact(UUID, String)}.
+ * <p>
+ *
+ * The name comparison will compare the {@link String#toLowerCase()} version of both the passed name parameter and
+ * a players name to honour the case-insensitive nature of a mojang profile lookup.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
@@ -435,23 +347,5 @@ index 3c987b2fb0f748ce92a87c4ee54a4e9722e1910e..9796ae6fcf605af88c1e5c1d29d77ea6
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nullable UUID uuid, @Nullable String name);
+
+ /**
+ * Creates an exact PlayerProfile for the specified name/uuid
+ *
+ * Both UUID and Name can not be null at same time. One must be supplied.
+ * If a player with the passed uuid or name exists on the server at the time of creation, the returned player
+ * profile will be populated with the properties of said player.
+ * <p>
+ * Compared to {@link #createProfile(UUID, String)}, this method will never mutate the passed uuid or name.
+ * If a player with either the same uuid or a matching name (case-insensitive) is found on the server, their
+ * properties, such as textures, will be pre-populated in the profile, however the passed uuid and name stay intact.
+ *
+ * @param uuid UUID to create profile for
+ * @param name Name to create profile for
+ * @return A PlayerProfile object
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile createProfileExact(@Nullable UUID uuid, @Nullable String name);
// Paper end
}
@@ -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 f607c57275958bf1cbf8e77b4d7efa936064c228..8a479c7dfd3825fab8bb057d8afa5ae0cb01b071 100644
index 0ab94ddd3b88eee8040233a89823bd2fadc78d55..396092fd249928ca01133eeeeb61f0ad90b2e332 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -318,6 +318,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -315,6 +315,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
public int getExpToLevel();
+2 -2
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 c315d2494969190f8b53236f905ad5c5cf1bfc39..b9a61d06d72831dc0c591e129553453a537d3785 100644
index 65088203d29798efe211612dfadb356f457ed466..71f519b8f03d2a52f2c5a9283a18c74c1ca52328 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -681,5 +681,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -673,5 +673,12 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
*/
@Nullable
Location getOrigin();
@@ -8,10 +8,10 @@ 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 af4a7ce37eb10bab06eadb6583c7894b3ec55ae6..159e5a908b35b84b7fabc36581e093d9aa4c4b67 100644
index 6cc4bad2ecd19f44a680ff03cbfb99d48ea5c337..b1fbb931148a87f29e8b8796b13851d767cc1d68 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -178,5 +178,19 @@ public interface ItemFactory {
@@ -160,5 +160,16 @@ public interface ItemFactory {
*/
@NotNull
net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack);
@@ -23,19 +23,16 @@ index af4a7ce37eb10bab06eadb6583c7894b3ec55ae6..159e5a908b35b84b7fabc36581e093d9
+ *
+ * @param item Item to return Display name of
+ * @return Display name of Item
+ * @deprecated {@link ItemStack} implements {@link net.kyori.adventure.translation.Translatable}; use that and
+ * {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
+ */
+ @Nullable
+ @Deprecated
+ String getI18NDisplayName(@Nullable ItemStack item);
// Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index a15abec467bac70116a6fc21a300d4930b909f15..dfd16531926e639231e93cb295de3d802d17413d 100644
index a15abec467bac70116a6fc21a300d4930b909f15..de5bcdb7b84acdd5e22500e367df292f35a86e19 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -611,5 +611,20 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -611,5 +611,17 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
public @NotNull net.kyori.adventure.text.Component displayName() {
return Bukkit.getServer().getItemFactory().displayName(this);
}
@@ -46,11 +43,8 @@ index a15abec467bac70116a6fc21a300d4930b909f15..dfd16531926e639231e93cb295de3d80
+ * You must replace the language file embedded in the server jar.
+ *
+ * @return Display name of Item
+ * @deprecated {@link ItemStack} implements {@link net.kyori.adventure.translation.Translatable}; use that and
+ * {@link net.kyori.adventure.text.Component#translatable(net.kyori.adventure.translation.Translatable)} instead.
+ */
+ @Nullable
+ @Deprecated
+ public String getI18NDisplayName() {
+ return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
+ }
@@ -7,12 +7,12 @@ 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 159e5a908b35b84b7fabc36581e093d9aa4c4b67..66ffc658dba85942f179760dc6c50258e24ab903 100644
index b1fbb931148a87f29e8b8796b13851d767cc1d68..71e5ee496a947fbd8e3ec579833b157c76b51833 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -192,5 +192,17 @@ public interface ItemFactory {
@@ -171,5 +171,17 @@ public interface ItemFactory {
*/
@Nullable
@Deprecated
String getI18NDisplayName(@Nullable ItemStack item);
+
+ /**
@@ -29,7 +29,7 @@ index 159e5a908b35b84b7fabc36581e093d9aa4c4b67..66ffc658dba85942f179760dc6c50258
// Paper end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index dfd16531926e639231e93cb295de3d802d17413d..2581117ded5d91070bc9416eee53383e915a1564 100644
index de5bcdb7b84acdd5e22500e367df292f35a86e19..e8783b0116f4efd5447a5f6f260506000983ffd2 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -536,7 +536,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -14,23 +14,23 @@ 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 bc6f68a0cadeec865401e9cb0dce89460484b148..d6c4abc30af2b535644707a240b60d1b613785e9 100644
index d8d459561cc75935136f8f9888ff27b45ad98f9e..a23b2bd8e1ca1ff8d0ad5ed5d5e41c89e4795090 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -39,6 +39,8 @@ dependencies {
@@ -38,6 +38,8 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-serializer-gson")
apiAndDocs("net.kyori:adventure-text-serializer-legacy")
apiAndDocs("net.kyori:adventure-text-serializer-plain")
+ api("org.apache.logging.log4j:log4j-api:2.17.1")
+ api("org.apache.logging.log4j:log4j-api:2.17.0")
+ api("org.slf4j:slf4j-api:1.8.0-beta4")
implementation("org.ow2.asm:asm:9.2")
implementation("org.ow2.asm:asm-commons:9.2")
diff --git a/src/main/java/org/bukkit/plugin/Plugin.java b/src/main/java/org/bukkit/plugin/Plugin.java
index 03ca87a1cbace2459174bb7bb8847bda766e80c5..34438b5362b0ba0949625d81e8371fe0d1f76fdf 100644
index 03ca87a1cbace2459174bb7bb8847bda766e80c5..c25fc646be750d3a3b2f4fb3f1c53daee5254107 100644
--- a/src/main/java/org/bukkit/plugin/Plugin.java
+++ b/src/main/java/org/bukkit/plugin/Plugin.java
@@ -179,6 +179,22 @@ public interface Plugin extends TabExecutor {
@@ -179,6 +179,18 @@ public interface Plugin extends TabExecutor {
@NotNull
public Logger getLogger();
@@ -40,10 +40,6 @@ index 03ca87a1cbace2459174bb7bb8847bda766e80c5..34438b5362b0ba0949625d81e8371fe0
+ return org.slf4j.LoggerFactory.getLogger(getLogger().getName());
+ }
+
+ /**
+ * @deprecated use {@link #getSLF4JLogger()}
+ */
+ @Deprecated
+ @NotNull
+ default org.apache.logging.log4j.Logger getLog4JLogger() {
+ return org.apache.logging.log4j.LogManager.getLogger(getLogger().getName());
@@ -29,26 +29,3 @@ index ce1e1e6cc6740d568fbf859c7e2c014fab5a59cd..62ab55729e69bfac8eb4b40d877b945d
/**
* Returns the biome that this block resides in
*
diff --git a/src/main/java/org/bukkit/block/TileState.java b/src/main/java/org/bukkit/block/TileState.java
index 3b10fcc13893403b29f0260b8605144679e89b82..5c8517c5bcae10161952c104b6a4ff7c713bcdbd 100644
--- a/src/main/java/org/bukkit/block/TileState.java
+++ b/src/main/java/org/bukkit/block/TileState.java
@@ -36,4 +36,18 @@ public interface TileState extends BlockState, PersistentDataHolder {
@NotNull
@Override
PersistentDataContainer getPersistentDataContainer();
+
+ // Paper start
+ /**
+ * Checks if this TileState is a snapshot or a live
+ * representation of the underlying tile entity.
+ * <p>
+ * NOTE: You may still have to call {@link BlockState#update()} on
+ * live representations to update any visuals on the block.
+ *
+ * @return true if this is a snapshot
+ * @see Block#getState(boolean)
+ */
+ boolean isSnapshot();
+ // Paper end
}
@@ -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 f32eaa35d9152564300455a24c811e15d3ab694f..204c337558e84304de4f511473be8cccb2a8cd4f 100644
index 48b127cafe6fecb1849b176df43cbf26e5a1db79..b621f693379aedc23a90b03e724ba8a2ffeb283e 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -39,7 +39,7 @@ import org.jetbrains.annotations.Nullable;
@@ -37,7 +37,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents a player, connected or not
*/
@@ -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 204c337558e84304de4f511473be8cccb2a8cd4f..cb7bce8072dfcccfc3aba8f85d7d722faf560a55 100644
index b621f693379aedc23a90b03e724ba8a2ffeb283e..1e3a56ff656cdfe18cf665eecd8f126275f29715 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1021,12 +1021,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -986,12 +986,33 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public void resetPlayerWeather();
@@ -7,10 +7,18 @@ This allows you to create already filled textures on Skulls to avoid texture loo
which commonly cause rate limit issues with Mojang API
diff --git a/src/main/java/org/bukkit/block/Skull.java b/src/main/java/org/bukkit/block/Skull.java
index 83ca284e02f0c2229126d8f40cb33b18f44524d3..d89da5e370d95cfbc4dac776a64e402c5c1f5fc1 100644
index 943d751fb3e48212fbe258845beba03c25fa22d9..a6914f01e01e9103702185f92b0209b3c84c152a 100644
--- a/src/main/java/org/bukkit/block/Skull.java
+++ b/src/main/java/org/bukkit/block/Skull.java
@@ -62,6 +62,20 @@ public interface Skull extends TileState {
@@ -7,6 +7,7 @@ import org.bukkit.block.data.BlockData;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import com.destroystokyo.paper.profile.PlayerProfile; // Paper
/**
* Represents a captured state of a skull block.
@@ -61,6 +62,20 @@ public interface Skull extends TileState {
*/
public void setOwningPlayer(@NotNull OfflinePlayer player);
@@ -19,39 +27,35 @@ index 83ca284e02f0c2229126d8f40cb33b18f44524d3..d89da5e370d95cfbc4dac776a64e402c
+ * Sets this skull to use the supplied Player Profile, which can include textures already prefilled.
+ * @param profile The profile to set this Skull to use, may not be null
+ */
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
+ void setPlayerProfile(@NotNull PlayerProfile profile);
+
+ /**
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link com.destroystokyo.paper.profile.PlayerProfile}
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link PlayerProfile}
+ * @return The profile of the owner, if set
+ */
+ @Nullable com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
+ @Nullable PlayerProfile getPlayerProfile();
+ // Paper end
+
/**
* Gets the profile of the player who owns the skull. This player profile
* may appear as the texture depending on skull type.
@@ -69,6 +83,7 @@ public interface Skull extends TileState {
* @return the profile of the owning player
*/
@Nullable
+ @Deprecated // Paper
PlayerProfile getOwnerProfile();
/**
@@ -83,6 +98,7 @@ public interface Skull extends TileState {
* @throws IllegalArgumentException if the profile does not contain the
* necessary information
*/
+ @Deprecated // Paper
void setOwnerProfile(@Nullable PlayerProfile profile);
/**
* Gets the rotation of the skull in the world (or facing direction if this
* is a wall mounted skull).
diff --git a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
index dcefd0eea9461441c4209d587896d704389487d0..9ad062968335ee02bff5353d8c63c330d9338cd7 100644
index 496254f959345d74167a9b44d160ea1bb428c5a1..88d1c889c09adb91abb09a8e43a30c871b217da2 100644
--- a/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/SkullMeta.java
@@ -37,6 +37,20 @@ public interface SkullMeta extends ItemMeta {
@@ -1,9 +1,11 @@
package org.bukkit.inventory.meta;
+import com.destroystokyo.paper.profile.PlayerProfile;
import org.bukkit.OfflinePlayer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+
/**
* Represents a skull that can have an owner.
*/
@@ -36,6 +38,20 @@ public interface SkullMeta extends ItemMeta {
@Deprecated
boolean setOwner(@Nullable String owner);
@@ -60,31 +64,15 @@ index dcefd0eea9461441c4209d587896d704389487d0..9ad062968335ee02bff5353d8c63c330
+ * Sets this skull to use the supplied Player Profile, which can include textures already prefilled.
+ * @param profile The profile to set this Skull to use, or null to clear owner
+ */
+ void setPlayerProfile(@Nullable com.destroystokyo.paper.profile.PlayerProfile profile);
+ void setPlayerProfile(@Nullable PlayerProfile profile);
+
+ /**
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link com.destroystokyo.paper.profile.PlayerProfile}
+ * If the skull has an owner, per {@link #hasOwner()}, return the owners {@link PlayerProfile}
+ * @return The profile of the owner, if set
+ */
+ @Nullable com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
+ @Nullable PlayerProfile getPlayerProfile();
+ // Paper end
+
/**
* Gets the owner of the skull.
*
@@ -63,6 +77,7 @@ public interface SkullMeta extends ItemMeta {
* @return the profile of the owning player
*/
@Nullable
+ @Deprecated // Paper
PlayerProfile getOwnerProfile();
/**
@@ -77,6 +92,7 @@ public interface SkullMeta extends ItemMeta {
* @throws IllegalArgumentException if the profile does not contain the
* necessary information
*/
+ @Deprecated // Paper
void setOwnerProfile(@Nullable PlayerProfile profile);
@Override
@@ -5,85 +5,19 @@ 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 621420d35378e0038c33892c185216894912f023..82387e0c8477f5baa6bd473505b0e0aad6e78268 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1176,8 +1176,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
+ * @deprecated use {@link #createProfile(UUID, String)}
*/
@NotNull
+ @Deprecated // Paper
public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) {
return server.createPlayerProfile(uniqueId, name);
}
@@ -1188,8 +1190,10 @@ public final class Bukkit {
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
+ * @deprecated use {@link #createProfile(UUID)}
*/
@NotNull
+ @Deprecated // Paper
public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) {
return server.createPlayerProfile(uniqueId);
}
@@ -1201,8 +1205,10 @@ public final class Bukkit {
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
+ * @deprecated use {@link #createProfile(String)}
*/
@NotNull
+ @Deprecated // Paper
public static PlayerProfile createPlayerProfile(@NotNull String name) {
return server.createPlayerProfile(name);
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 58c8e74b61dd4d952919a854a374ae7b4c3e02c0..e196903e2e4d619603f445713cee36ea402fc55e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1001,8 +1001,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
+ * @deprecated use {@link #createProfile(UUID, String)}
*/
@NotNull
+ @Deprecated // Paper
PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name);
/**
@@ -1011,8 +1013,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>
+ * @deprecated use {@link #createProfile(UUID)}
*/
@NotNull
+ @Deprecated // Paper
PlayerProfile createPlayerProfile(@NotNull UUID uniqueId);
/**
@@ -1022,8 +1026,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
+ * @deprecated use {@link #createProfile(String)}
*/
@NotNull
+ @Deprecated
PlayerProfile createPlayerProfile(@NotNull String name);
/**
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index cb7bce8072dfcccfc3aba8f85d7d722faf560a55..3ec3b05acb30432b9e16d8a2028ae587850fec75 100644
index 7e390f5d7438f292ddd849f47964282a1ad889d1..ac94189b7bc76e1de0ae7d46fe581af57594ef64 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2279,6 +2279,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -4,6 +4,7 @@ import java.net.InetSocketAddress;
import java.util.UUID;
import com.destroystokyo.paper.Title; // Paper
import net.kyori.adventure.text.Component;
+import com.destroystokyo.paper.profile.PlayerProfile; // Paper
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -2202,6 +2203,20 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* was {@link org.bukkit.event.player.PlayerResourcePackStatusEvent.Status#SUCCESSFULLY_LOADED}
*/
boolean hasResourcePack();
@@ -93,36 +27,14 @@ index cb7bce8072dfcccfc3aba8f85d7d722faf560a55..3ec3b05acb30432b9e16d8a2028ae587
+ * @return The players profile object
+ */
+ @NotNull
+ com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile();
+ PlayerProfile getPlayerProfile();
+
+ /**
+ * Changes the PlayerProfile for this player. This will cause this player
+ * to be reregistered to all clients that can currently see this player
+ * @param profile The new profile to use
+ */
+ void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
+ void setPlayerProfile(@NotNull PlayerProfile profile);
// Paper end
// Spigot start
diff --git a/src/main/java/org/bukkit/profile/PlayerProfile.java b/src/main/java/org/bukkit/profile/PlayerProfile.java
index 16ae1282f3178e8873483a25a5d5cce16b2c21a9..c4aa20fbb0865a0b43ece475ee115ad6a7c65a48 100644
--- a/src/main/java/org/bukkit/profile/PlayerProfile.java
+++ b/src/main/java/org/bukkit/profile/PlayerProfile.java
@@ -16,7 +16,9 @@ import org.jetbrains.annotations.Nullable;
* <p>
* New profiles can be created via
* {@link Server#createPlayerProfile(UUID, String)}.
+ * @deprecated see {@link com.destroystokyo.paper.profile.PlayerProfile}
*/
+@Deprecated // Paper
public interface PlayerProfile extends Cloneable, ConfigurationSerializable {
/**
@@ -25,6 +27,7 @@ public interface PlayerProfile extends Cloneable, ConfigurationSerializable {
* @return the player's unique id, or <code>null</code> if not available
*/
@Nullable
+ @Deprecated // Paper
UUID getUniqueId();
/**
+4 -4
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 aae3eec8d28a0047bc590ecc55d87d11ee6d08f0..8875c963e358d1db37ecef7312e7608c89040013 100644
index c7daa7c9f85c62d0effd5c3f406568d77fd8cd78..23960534cbb83cfca08ccc1e37bc7a713728b791 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -656,6 +656,20 @@ public final class Bukkit {
@@ -616,6 +616,20 @@ public final class Bukkit {
return server.getPlayer(id);
}
@@ -34,10 +34,10 @@ index aae3eec8d28a0047bc590ecc55d87d11ee6d08f0..8875c963e358d1db37ecef7312e7608c
* 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 51c96a0b6645cf31f4ca051f6a8c75b5f188484c..30d905685b336c7127445ac1d1946334ee954416 100644
index fb5c308d82e9103a212deea2a6fa2e158cddb931..f7320c0797f31cc9609a6764d886bdb6dbd082af 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -561,6 +561,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -524,6 +524,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@Nullable
public Player getPlayer(@NotNull UUID id);
@@ -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 8a479c7dfd3825fab8bb057d8afa5ae0cb01b071..6ef0d7f3dcb779fb7dc5786e7433262092908eaa 100644
index 396092fd249928ca01133eeeeb61f0ad90b2e332..5cc025b69c4f405be8f7098d0dcef40fa522b39f 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -479,6 +479,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
@@ -476,6 +476,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
*/
@Deprecated
public void setShoulderEntityRight(@Nullable Entity entity);
@@ -24,10 +24,10 @@ index 8a479c7dfd3825fab8bb057d8afa5ae0cb01b071..6ef0d7f3dcb779fb7dc5786e74332620
/**
* 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 3ec3b05acb30432b9e16d8a2028ae587850fec75..18ce1833e8fa2c255b915755ef6d3d61e4d0007f 100644
index ac94189b7bc76e1de0ae7d46fe581af57594ef64..dbfd062792b0cc1d8fbfc8a30b0143467e7aaef7 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2134,7 +2134,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2058,7 +2058,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* Open a Sign for editing by the Player.
*
@@ -8,10 +8,10 @@ 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 76e511e7f619960ab50d534c17489e2bc87ebf5a..9d774a10b9543e9293cb10ee9d7c9adebbfef34c 100644
index 58313929f81509030216a0e5e3869da63e11108e..6cf05fed701c67a2c797a4e0839c795802a238a1 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -58,6 +58,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -45,6 +45,61 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* @return true if banned, otherwise false
*/
public boolean isBanned();
@@ -74,10 +74,21 @@ index 76e511e7f619960ab50d534c17489e2bc87ebf5a..9d774a10b9543e9293cb10ee9d7c9ade
/**
* Checks if this player is whitelisted or not
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 18ce1833e8fa2c255b915755ef6d3d61e4d0007f..c0fed694f66acc623eaef2f3d53bcd32180b09af 100644
index da5dd22e75b998495258a482557221ebd52e0c39..07ae612268a5857cedf8c646a09eb30c9b0a036b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -738,6 +738,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -5,6 +5,10 @@ import java.util.UUID;
import com.destroystokyo.paper.Title; // Paper
import net.kyori.adventure.text.Component;
import com.destroystokyo.paper.profile.PlayerProfile; // Paper
+import java.util.Date; // Paper
+import org.bukkit.BanEntry; // Paper
+import org.bukkit.BanList; // Paper
+import org.bukkit.Bukkit; // Paper
import org.bukkit.DyeColor;
import org.bukkit.Effect;
import org.bukkit.GameMode;
@@ -712,6 +716,162 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
public void sendMap(@NotNull MapView map);
// Paper start
@@ -89,7 +100,7 @@ index 18ce1833e8fa2c255b915755ef6d3d61e4d0007f..c0fed694f66acc623eaef2f3d53bcd32
+ */
+ // For reference, Bukkit defines this as nullable, while they impl isn't, we'll follow API.
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason) {
+ public default BanEntry banPlayerFull(@Nullable String reason) {
+ return banPlayerFull(reason, null, null);
+ }
+
@@ -101,7 +112,7 @@ index 18ce1833e8fa2c255b915755ef6d3d61e4d0007f..c0fed694f66acc623eaef2f3d53bcd32
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) {
+ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable String source) {
+ return banPlayerFull(reason, null, source);
+ }
+
@@ -113,7 +124,7 @@ index 18ce1833e8fa2c255b915755ef6d3d61e4d0007f..c0fed694f66acc623eaef2f3d53bcd32
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable java.util.Date expires) {
+ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires) {
+ return banPlayerFull(reason, expires, null);
+ }
+
@@ -126,102 +137,102 @@ index 18ce1833e8fa2c255b915755ef6d3d61e4d0007f..c0fed694f66acc623eaef2f3d53bcd32
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerFull(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) {
+ public default BanEntry banPlayerFull(@Nullable String reason, @Nullable Date expires, @Nullable String source) {
+ banPlayer(reason, expires, source);
+ return banPlayerIP(reason, expires, source, true);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ *
+ * @param reason Reason for ban
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) {
+ public default BanEntry banPlayerIP(@Nullable String reason, boolean kickPlayer) {
+ return banPlayerIP(reason, null, null, kickPlayer);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * @param reason Reason for ban
+ * @param source Source of ban, or null for default
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) {
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source, boolean kickPlayer) {
+ return banPlayerIP(reason, null, source, kickPlayer);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @param kickPlayer Whether or not to kick the player afterwards
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, boolean kickPlayer) {
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, boolean kickPlayer) {
+ return banPlayerIP(reason, expires, null, kickPlayer);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ *
+ * @param reason Reason for ban
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason) {
+ public default BanEntry banPlayerIP(@Nullable String reason) {
+ return banPlayerIP(reason, null, null);
+ }
+
+ /**
+ * Permanently Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * @param reason Reason for ban
+ * @param source Source of ban, or null for default
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) {
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable String source) {
+ return banPlayerIP(reason, null, source);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires) {
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires) {
+ return banPlayerIP(reason, expires, null);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @param source Source of the banm or null for default
+ * @return Ban Entry
+ */
+ @Nullable
+ public default org.bukkit.BanEntry banPlayerIP(@Nullable String reason, @Nullable java.util.Date expires, @Nullable String source) {
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source) {
+ return banPlayerIP(reason, expires, source, true);
+ }
+
+ /**
+ * Bans the IP address currently used by the player.
+ * Does not ban the Profile, use {@link #banPlayerFull(String, java.util.Date, String)}
+ * Does not ban the Profile, use {@link #banPlayerFull(String, Date, String)}
+ * @param reason Reason for Ban
+ * @param expires When to expire the ban
+ * @param source Source of the banm or null for default
@@ -229,8 +240,8 @@ index 18ce1833e8fa2c255b915755ef6d3d61e4d0007f..c0fed694f66acc623eaef2f3d53bcd32
+ * @return Ban Entry
+ */
+ @Nullable
+ 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);
+ public default BanEntry banPlayerIP(@Nullable String reason, @Nullable Date expires, @Nullable String source, boolean kickPlayer) {
+ BanEntry banEntry = Bukkit.getServer().getBanList(BanList.Type.IP).addBan(getAddress().getAddress().getHostAddress(), reason, expires, source);
+ if (kickPlayer && isOnline()) {
+ getPlayer().kickPlayer(reason);
+ }
@@ -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 8a2ca11be9ebde91268b20d25a35e1d6842f49de..e6d6283f3dd76b6c5af34374a05a5ab966419d06 100644
index cec39714294127478b6e73452354ba7ccab78b25..bd1e64d03d601d55bab3f1de367792544ed802b1 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 8a2ca11be9ebde91268b20d25a35e1d6842f49de..e6d6283f3dd76b6c5af34374a05a5ab9
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
@@ -654,6 +657,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -652,6 +655,256 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getEntitiesByClasses(@NotNull Class<?>... classes);
@@ -500,10 +500,10 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 8d048a8f1446f862dcc61952971b54bab9bb2ac3..60a70b9e7a613e64a31a127264f17485ed2aa76f 100644
index dc5142460a711ee79aed30276382b92c82cbef00..40a3a54fc82252692fc8710cabb243d0984ccf4f 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -155,6 +155,17 @@ public enum Particle {
@@ -122,6 +122,17 @@ public enum Particle {
return dataType;
}
@@ -522,10 +522,10 @@ index 8d048a8f1446f862dcc61952971b54bab9bb2ac3..60a70b9e7a613e64a31a127264f17485
* 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 e6d6283f3dd76b6c5af34374a05a5ab966419d06..d4c55682f6b2433808a2f0542189a5672d4991ea 100644
index e8b94ae777cad907dbb31c9ea5a3c1690b178777..6156fb9827400cb6c1c0a96e0b6fed180a12d610 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2784,7 +2784,57 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -2637,7 +2637,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()}
*/
@@ -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 2581117ded5d91070bc9416eee53383e915a1564..9376c6a02731c71798aaf3361b2e30c521547874 100644
index e8783b0116f4efd5447a5f6f260506000983ffd2..9fee2f157ac5149cd65136bf8468deaca410fbf4 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -639,5 +639,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -636,5 +636,13 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
public String getI18NDisplayName() {
return Bukkit.getServer().getItemFactory().getI18NDisplayName(this);
}
+2 -2
View File
@@ -106,10 +106,10 @@ index bbc636baef2e2b0586c7d517be428438ca26ab66..a8d4f7972d07ddde171b4a1ec470a4c6
* 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 d4c55682f6b2433808a2f0542189a5672d4991ea..68b10c8643e9c2c873e627b2185f983a9c1023aa 100644
index 6156fb9827400cb6c1c0a96e0b6fed180a12d610..1e29c0e69973a1f7422852a04f97a6e7c19a3e54 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1421,6 +1421,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -1419,6 +1419,88 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
public boolean createExplosion(@NotNull Location loc, float power, boolean setFire);
@@ -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 9376c6a02731c71798aaf3361b2e30c521547874..487e6a6391123a4792c3bdeba869aa2bcb5922cc 100644
index 9fee2f157ac5149cd65136bf8468deaca410fbf4..686e2a0b9fe061816b41435ef2337870dbdca8e5 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -2,7 +2,9 @@ package org.bukkit.inventory;
@@ -18,7 +18,7 @@ index 9376c6a02731c71798aaf3361b2e30c521547874..487e6a6391123a4792c3bdeba869aa2b
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@@ -647,5 +649,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
@@ -644,5 +646,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
// Requires access to NMS
return ensureServerConversions().getMaxItemUseDuration();
}
@@ -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 68b10c8643e9c2c873e627b2185f983a9c1023aa..057b7ace5428d2799d33d91097f6cec786c7bd58 100644
index 1e29c0e69973a1f7422852a04f97a6e7c19a3e54..91755d27b84abad516d891d4b0b7869124cb263e 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -941,6 +941,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -939,6 +939,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z);
@@ -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 6ef0d7f3dcb779fb7dc5786e7433262092908eaa..b007b582d344b79ee67751fd1e21f6cef6a1a950 100644
index 5cc025b69c4f405be8f7098d0dcef40fa522b39f..1d573d33304e9c15a9949af68dab0626ae04dce4 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -158,6 +158,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder
+2 -2
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 b9a61d06d72831dc0c591e129553453a537d3785..df07eb07896790a09d1022daef5cffc6a435f739 100644
index 71f519b8f03d2a52f2c5a9283a18c74c1ca52328..c0d6dc1b584c34c541bf9a2549016b4e29818d45 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 b9a61d06d72831dc0c591e129553453a537d3785..df07eb07896790a09d1022daef5cffc6
import org.bukkit.EntityEffect;
import org.bukkit.Location;
import org.bukkit.Nameable;
@@ -688,5 +689,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -680,5 +681,16 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
* @return True if entity spawned from a mob spawner
*/
boolean fromMobSpawner();
@@ -7,10 +7,10 @@ Not here to name and shame, only so server admins can be aware of which
plugins have and haven't been updated.
diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukkit/UnsafeValues.java
index 5ba6c7a69937badd64256248560268fb695d5f74..db272568d7dee924083e37c55bdbf90f05fafc69 100644
index bfeec56e83229dbfc8625b3b90bd6c138c73bc1d..9341c7fbf619a42ed5329136b7fb4f52fb81a922 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -101,5 +101,11 @@ public interface UnsafeValues {
@@ -92,5 +92,11 @@ public interface UnsafeValues {
default com.destroystokyo.paper.util.VersionFetcher getVersionFetcher() {
return new com.destroystokyo.paper.util.VersionFetcher.DummyVersionFetcher();
}
+10 -15
View File
@@ -73,25 +73,20 @@ index 0000000000000000000000000000000000000000..9ce2948dfaa56d0adf53fe9b6117a90d
+}
+
diff --git a/src/main/java/org/bukkit/entity/SkeletonHorse.java b/src/main/java/org/bukkit/entity/SkeletonHorse.java
index a34ad28fc43bde224c39253e8479bf7bb7e8df1c..38539d5b77e06865aa65b8db0c1a3b6eaa914d03 100644
index b2c6b6a8689f6bd6ce784bbe6f571f756dd700c1..ba9983463263f77db3d3487bc12f01db4508a32b 100644
--- a/src/main/java/org/bukkit/entity/SkeletonHorse.java
+++ b/src/main/java/org/bukkit/entity/SkeletonHorse.java
@@ -43,4 +43,18 @@ public interface SkeletonHorse extends AbstractHorse {
* @param trapTime new trap time
*/
void setTrapTime(int trapTime);
+
@@ -3,4 +3,12 @@ package org.bukkit.entity;
/**
* Represents a SkeletonHorse - variant of {@link AbstractHorse}.
*/
-public interface SkeletonHorse extends AbstractHorse { }
+public interface SkeletonHorse extends AbstractHorse {
+ // Paper start
+ /**
+ * @deprecated use {@link #isTrapped()}
+ */
+ @Deprecated
+ int getTrapTime();
+
+ boolean isTrap();
+
+ /**
+ * @deprecated use {@link #setTrapped(boolean)}
+ */
+ @Deprecated
+ void setTrap(boolean trap);
+ // Paper end
}
+}
@@ -7,7 +7,7 @@ Allows you to easily access the chunks X/z as a long, and a method
to look up by the long key too.
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
index 06737962b844275a74ee2407cc09918599cbaea4..1a4b6922c0a881b60ddf305b1e2b3af0dfde46c3 100644
index 5fd6030b2693d793951ed632ad4870e1a6f909aa..40ddeb7abd49eeece531a8e90b4508f3831cc3e9 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -28,6 +28,32 @@ public interface Chunk extends PersistentDataHolder {
@@ -44,10 +44,10 @@ index 06737962b844275a74ee2407cc09918599cbaea4..1a4b6922c0a881b60ddf305b1e2b3af0
* 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 057b7ace5428d2799d33d91097f6cec786c7bd58..ee277a464b1ecaaa7948c333a04e347e6255c904 100644
index 91755d27b84abad516d891d4b0b7869124cb263e..d3d0e4448135f6c0440c15e0dd3fc15c2616263a 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -209,6 +209,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -207,6 +207,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Chunk getChunkAt(@NotNull Block block);
@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 10 Aug 2018 22:08:34 -0400
Subject: [PATCH] Make EnderDragon extend Mob
diff --git a/src/main/java/org/bukkit/entity/EnderDragon.java b/src/main/java/org/bukkit/entity/EnderDragon.java
index c14278d2c99deedddfd9c8afdc900760b0331546..92da609fb2bdf7c6396ba868410a40725fda05f0 100644
--- a/src/main/java/org/bukkit/entity/EnderDragon.java
+++ b/src/main/java/org/bukkit/entity/EnderDragon.java
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.Nullable;
/**
* Represents an Ender Dragon
*/
-public interface EnderDragon extends ComplexLivingEntity, Boss {
+public interface EnderDragon extends ComplexLivingEntity, Boss, org.bukkit.entity.Mob { // Paper - add Mob
/**
* Represents a phase or action that an Ender Dragon can perform.
@@ -5,7 +5,7 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots
diff --git a/src/main/java/org/bukkit/Chunk.java b/src/main/java/org/bukkit/Chunk.java
index 1a4b6922c0a881b60ddf305b1e2b3af0dfde46c3..049c36807d2a970842442c1b7517c06f3f150041 100644
index 40ddeb7abd49eeece531a8e90b4508f3831cc3e9..5a4884db36d448c885e49c965ae329a0638dd628 100644
--- a/src/main/java/org/bukkit/Chunk.java
+++ b/src/main/java/org/bukkit/Chunk.java
@@ -1,6 +1,8 @@
@@ -18,7 +18,7 @@ Y range: [0, 1023]
X, Z range: [-67 108 864, 67 108 863]
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..5c5e05673e0912f4dbd6c728f4c3b7fcdae8f0e8 100644
index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..58728a0f0722b378efa129e26f0c822b63d1af36 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -15,7 +15,6 @@ import org.jetbrains.annotations.Nullable;
@@ -29,7 +29,7 @@ index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..5c5e05673e0912f4dbd6c728f4c3b7fc
import java.util.function.Predicate;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
@@ -605,6 +604,19 @@ public class Location implements Cloneable, ConfigurationSerializable {
@@ -605,6 +604,17 @@ public class Location implements Cloneable, ConfigurationSerializable {
blockLoc.setZ(getBlockZ());
return blockLoc;
}
@@ -38,9 +38,7 @@ index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..5c5e05673e0912f4dbd6c728f4c3b7fc
+ /**
+ * @return The block key for this location's block location.
+ * @see Block#getBlockKey(int, int, int)
+ * @deprecated only encodes y block ranges from -512 to 511 and represents an already changed implementation detail
+ */
+ @Deprecated
+ public long toBlockKey() {
+ return Block.getBlockKey(getBlockX(), getBlockY(), getBlockZ());
+ }
@@ -50,10 +48,10 @@ index 36ed248f0716f2cc465c08ab851b7d83d4c7c0a7..5c5e05673e0912f4dbd6c728f4c3b7fc
* @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 a501384906fa01ddc83476ef2dbbb8d11a03fb8c..449d6882c8f41d9e0f46436c430e071b85eb2775 100644
index dbfa490c997c515007fc0d86ee5e2b4b98d174e5..4789dafc716c3db63983d49d7af75e3f374f4f51 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -92,6 +92,40 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -90,6 +90,38 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@NotNull
public Block getBlockAt(@NotNull Location location);
@@ -64,10 +62,8 @@ index a501384906fa01ddc83476ef2dbbb8d11a03fb8c..449d6882c8f41d9e0f46436c430e071b
+ * @param key The block key. See {@link Block#getBlockKey()}
+ * @return Block at the key
+ * @see Block#getBlockKey(int, int, int)
+ * @deprecated only encodes y block ranges from -512 to 511 and represents an already changed implementation detail
+ */
+ @NotNull
+ @Deprecated
+ public default Block getBlockAtKey(long key) {
+ int x = Block.getBlockKeyX(key);
+ int y = Block.getBlockKeyY(key);
@@ -95,7 +91,7 @@ index a501384906fa01ddc83476ef2dbbb8d11a03fb8c..449d6882c8f41d9e0f46436c430e071b
* Gets the highest non-empty (impassable) coordinate at the given
* coordinates.
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index d29bdc125dba0128d93d57e8d9393b970e6c00a9..b101f5264bdde8bd14913d5161c1047020830f8d 100644
index 62ab55729e69bfac8eb4b40d877b945d95df27cd..50fb2c8cbed7a3875a81cf409238912d9b38d820 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -155,6 +155,82 @@ public interface Block extends Metadatable {
@@ -5,7 +5,7 @@ Subject: [PATCH] isChunkGenerated API
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 5c5e05673e0912f4dbd6c728f4c3b7fcdae8f0e8..57cb548683f7b2972c998afd34176952426f8b47 100644
index 58728a0f0722b378efa129e26f0c822b63d1af36..88b3e0323dbc4f0fce31b147c7aaa08d65745852 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -3,6 +3,7 @@ package org.bukkit;
@@ -34,10 +34,10 @@ index 5c5e05673e0912f4dbd6c728f4c3b7fcdae8f0e8..57cb548683f7b2972c998afd34176952
/**
* Sets the position of this Location and returns itself
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 449d6882c8f41d9e0f46436c430e071b85eb2775..dcca66c345b3c51d7b9956ddd3ac2bf0b789899c 100644
index 7ed2442031cdcc429aabe91d639871566359ba53..59c796ec6b33b282d1f1ee769bc802a3fe7061b1 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -257,6 +257,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -253,6 +253,17 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
public default Chunk getChunkAt(long chunkKey) {
return getChunkAt((int) chunkKey, (int) (chunkKey >> 32));
}
@@ -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 dcca66c345b3c51d7b9956ddd3ac2bf0b789899c..04583189f7ed9a446ed649780e2b99cb5e1ab3ad 100644
index 59c796ec6b33b282d1f1ee769bc802a3fe7061b1..a0a4d0f143303bd449494ec1479db1e449836595 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -966,6 +966,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -962,6 +962,482 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
}
return nearby;
}
@@ -495,7 +495,7 @@ index dcca66c345b3c51d7b9956ddd3ac2bf0b789899c..04583189f7ed9a446ed649780e2b99cb
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
index df07eb07896790a09d1022daef5cffc6a435f739..7a05615ec7678338801bcae2ec9a029b13d323d2 100644
index c0d6dc1b584c34c541bf9a2549016b4e29818d45..23a3bf005a21cd417f9b2d8ecd64c2887d1e979e 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -163,6 +163,33 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -5,13 +5,13 @@ Subject: [PATCH] Expose attack cooldown methods for Player
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index c0fed694f66acc623eaef2f3d53bcd32180b09af..98b856d068c765a277d1e218a04e05588e18fdcb 100644
index 62b41c809cec18b75ee83371f0ca97ccde141e30..fc44e75c52354d95fa7422e1d08ac4cba455be74 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2449,6 +2449,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2377,6 +2377,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param profile The new profile to use
*/
void setPlayerProfile(@NotNull com.destroystokyo.paper.profile.PlayerProfile profile);
void setPlayerProfile(@NotNull PlayerProfile profile);
+
+ /**
+ * Returns the amount of ticks the current cooldown lasts
@@ -13,7 +13,7 @@ You can use EntityPathfindEvent to cancel new pathfinds from overriding your cur
diff --git a/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
new file mode 100644
index 0000000000000000000000000000000000000000..43f062257472a06e9e64c2feef6c3b1012aee00e
index 0000000000000000000000000000000000000000..e2a6f9c3881ff9d7373ac30e60009200432555aa
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/Pathfinder.java
@@ -0,0 +1,212 @@
@@ -214,7 +214,7 @@ index 0000000000000000000000000000000000000000..43f062257472a06e9e64c2feef6c3b10
+
+ /**
+ * @return Returns the index of the current point along the points returned in {@link #getPoints()} the entity
+ * is trying to reach. This value will be higher than the maximum index of {@link #getPoints()} if this path finding is done.
+ * is trying to reach, or null if we are done with this pathfinding.
+ */
+ int getNextPointIndex();
+
@@ -226,10 +226,10 @@ index c65f0d6569c130b4920a9e71ad24af6427f1f030..01bcb3a1bdb5accdf844d0178cec3d25
return key;
}
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 69f68ca2d62c2cfe07a193776054c14c352a5942..45baebc97f0aec8abc9a894bc135e4767d7c9e35 100644
index 1c362636c56db0e6c118171ba367c43c4f7cff33..01b462fccce71cef3398dd43944046f322b8e57e 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -444,4 +444,87 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -432,4 +432,87 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@SuppressWarnings("javadoc")
@NotNull
ItemMeta clone();
@@ -6,12 +6,12 @@ Subject: [PATCH] Implement furnace cook speed multiplier API
Signed-off-by: Tassu <git@tassu.me>
diff --git a/src/main/java/org/bukkit/block/Furnace.java b/src/main/java/org/bukkit/block/Furnace.java
index ac3b24c5c99eeb1435d785efade728dd40947da5..dbdf3dbe9517b09a7965cf9d65cae1edd87af67d 100644
index c5a8c96fa2204d6b4d2409b1bfc97697d39d964e..9063cf370a0fe66c2a27086e125f9111b77366ae 100644
--- a/src/main/java/org/bukkit/block/Furnace.java
+++ b/src/main/java/org/bukkit/block/Furnace.java
@@ -74,6 +74,26 @@ public interface Furnace extends Container {
@NotNull
public Map<CookingRecipe<?>, Integer> getRecipesUsed();
@@ -61,6 +61,26 @@ public interface Furnace extends Container {
*/
public void setCookTimeTotal(int cookTimeTotal);
+ // Paper start
+ /**
@@ -5,10 +5,10 @@ Subject: [PATCH] Material API additions
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index df3f24066022e2381a87d27338dec173199388c7..53d1609e2a75c007cb7e5e8f963b0deb53bae5f7 100644
index 2a0773e0981f8470eb897ffd9178bb97e8365050..58c3ab444d484ac781810e26e04b9919eaff3bf2 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -103,6 +103,7 @@ import org.jetbrains.annotations.Nullable;
@@ -99,6 +99,7 @@ import org.jetbrains.annotations.Nullable;
/**
* An enum of all material IDs accepted by the official server and client
*/
@@ -16,7 +16,7 @@ index df3f24066022e2381a87d27338dec173199388c7..53d1609e2a75c007cb7e5e8f963b0deb
public enum Material implements Keyed {
//<editor-fold desc="Materials" defaultstate="collapsed">
AIR(9648, 0),
@@ -3973,6 +3974,22 @@ public enum Material implements Keyed {
@@ -3969,6 +3970,22 @@ public enum Material implements Keyed {
}
}
@@ -113,10 +113,10 @@ index 0000000000000000000000000000000000000000..a02a02aa0c87e0f0ed9e509e4dcab015
+}
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
new file mode 100644
index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd585fea27
index 0000000000000000000000000000000000000000..a5fc48df2f1f04d836c5ae3dae7dce8acdb2de32
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
@@ -0,0 +1,655 @@
@@ -0,0 +1,646 @@
+/*
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
+ *
@@ -149,9 +149,6 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+/**
+ * Represents a collection tags to identify materials that share common properties.
+ * Will map to minecraft for missing tags, as well as custom ones that may be useful.
+ * <p>
+ * All tags in this class are unmodifiable, attempting to modify them will throw an
+ * {@link UnsupportedOperationException}.
+ */
+@SuppressWarnings({"NonFinalUtilityClass", "unused", "WeakerAccess"})
+public class MaterialTags {
@@ -162,94 +159,94 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ }
+ public static final MaterialSetTag ARROWS = new MaterialSetTag(keyFor("arrows"))
+ .endsWith("ARROW")
+ .ensureSize("ARROWS", 3).lock();
+ .ensureSize("ARROWS", 3);
+
+ /**
+ * Covers all colors of beds.
+ */
+ public static final MaterialSetTag BEDS = new MaterialSetTag(keyFor("beds"))
+ .endsWith("_BED")
+ .ensureSize("BEDS", 16).lock();
+ .ensureSize("BEDS", 16);
+
+ /**
+ * Covers all bucket items.
+ */
+ public static final MaterialSetTag BUCKETS = new MaterialSetTag(keyFor("buckets"))
+ .endsWith("BUCKET")
+ .ensureSize("BUCKETS", 10).lock();
+ .ensureSize("BUCKETS", 10);
+
+ /**
+ * Covers coal and charcoal.
+ */
+ public static final MaterialSetTag COALS = new MaterialSetTag(keyFor("coals"))
+ .add(Material.COAL, Material.CHARCOAL).lock();
+ .add(Material.COAL, Material.CHARCOAL);
+
+ /**
+ * Covers both cobblestone wall variants.
+ */
+ public static final MaterialSetTag COBBLESTONE_WALLS = new MaterialSetTag(keyFor("cobblestone_walls"))
+ .endsWith("COBBLESTONE_WALL")
+ .ensureSize("COBBLESTONE_WALLS", 2).lock();
+ .ensureSize("COBBLESTONE_WALLS", 2);
+
+ /**
+ * Covers both cobblestone and mossy Cobblestone.
+ */
+ public static final MaterialSetTag COBBLESTONES = new MaterialSetTag(keyFor("cobblestones"))
+ .add(Material.COBBLESTONE, Material.MOSSY_COBBLESTONE).lock();
+ .add(Material.COBBLESTONE, Material.MOSSY_COBBLESTONE);
+
+ /**
+ * Covers all colors of concrete.
+ */
+ public static final MaterialSetTag CONCRETES = new MaterialSetTag(keyFor("concretes"))
+ .endsWith("_CONCRETE")
+ .ensureSize("CONCRETES", 16).lock();
+ .ensureSize("CONCRETES", 16);
+
+ /**
+ * Covers all colors of concrete powder.
+ */
+ public static final MaterialSetTag CONCRETE_POWDER = new MaterialSetTag(keyFor("concrete_powder"))
+ .endsWith("_CONCRETE_POWDER")
+ .ensureSize("CONCRETE_POWDER", 16).lock();
+ .ensureSize("CONCRETE_POWDER", 16);
+
+ /**
+ * Covers the two types of cooked fish.
+ */
+ public static final MaterialSetTag COOKED_FISH = new MaterialSetTag(keyFor("cooked_fish"))
+ .add(Material.COOKED_COD, Material.COOKED_SALMON).lock();
+ .add(Material.COOKED_COD, Material.COOKED_SALMON);
+
+ /**
+ * Covers all variants of doors.
+ */
+ public static final MaterialSetTag DOORS = new MaterialSetTag(keyFor("doors"))
+ .endsWith("_DOOR")
+ .ensureSize("DOORS", 9).lock();
+ .ensureSize("DOORS", 9);
+
+ /**
+ * Covers all dyes.
+ */
+ public static final MaterialSetTag DYES = new MaterialSetTag(keyFor("dyes"))
+ .endsWith("_DYE")
+ .ensureSize("DYES", 16).lock();
+ .ensureSize("DYES", 16);
+
+ /**
+ * Covers all variants of gates.
+ */
+ public static final MaterialSetTag FENCE_GATES = new MaterialSetTag(keyFor("fence_gates"))
+ .endsWith("_GATE")
+ .ensureSize("FENCE_GATES", 8).lock();
+ .ensureSize("FENCE_GATES", 8);
+
+ /**
+ * Covers all variants of fences.
+ */
+ public static final MaterialSetTag FENCES = new MaterialSetTag(keyFor("fences"))
+ .endsWith("_FENCE")
+ .ensureSize("FENCES", 9).lock();
+ .ensureSize("FENCES", 9);
+
+ /**
+ * Covers all variants of fish buckets.
+ */
+ public static final MaterialSetTag FISH_BUCKETS = new MaterialSetTag(keyFor("fish_buckets"))
+ .add(Material.COD_BUCKET, Material.PUFFERFISH_BUCKET, Material.SALMON_BUCKET, Material.TROPICAL_FISH_BUCKET).lock();
+ .add(Material.COD_BUCKET, Material.PUFFERFISH_BUCKET, Material.SALMON_BUCKET, Material.TROPICAL_FISH_BUCKET);
+
+ /**
+ * Covers the non-colored glass and 16 stained glass (not panes).
@@ -257,21 +254,21 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag GLASS = new MaterialSetTag(keyFor("glass"))
+ .endsWith("_GLASS")
+ .add(Material.GLASS)
+ .ensureSize("GLASS", 18).lock();
+ .ensureSize("GLASS", 18);
+
+ /**
+ * Covers the non-colored glass panes and stained glass panes (panes only).
+ */
+ public static final MaterialSetTag GLASS_PANES = new MaterialSetTag(keyFor("glass_panes"))
+ .endsWith("GLASS_PANE")
+ .ensureSize("GLASS_PANES", 17).lock();
+ .ensureSize("GLASS_PANES", 17);
+
+ /**
+ * Covers all glazed terracotta blocks.
+ */
+ public static final MaterialSetTag GLAZED_TERRACOTTA = new MaterialSetTag(keyFor("glazed_terracotta"))
+ .endsWith("GLAZED_TERRACOTTA")
+ .ensureSize("GLAZED_TERRACOTTA", 16).lock();
+ .ensureSize("GLAZED_TERRACOTTA", 16);
+
+ /**
+ * Covers the colors of stained terracotta.
@@ -280,35 +277,35 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ .endsWith("TERRACOTTA")
+ .not(Material.TERRACOTTA)
+ .notEndsWith("GLAZED_TERRACOTTA")
+ .ensureSize("STAINED_TERRACOTTA", 16).lock();
+ .ensureSize("STAINED_TERRACOTTA", 16);
+
+ /**
+ * Covers terracotta along with the stained variants.
+ */
+ public static final MaterialSetTag TERRACOTTA = new MaterialSetTag(keyFor("terracotta"))
+ .endsWith("TERRACOTTA")
+ .ensureSize("TERRACOTTA", 33).lock();
+ .ensureSize("TERRACOTTA", 33);
+
+ /**
+ * Covers both golden apples.
+ */
+ public static final MaterialSetTag GOLDEN_APPLES = new MaterialSetTag(keyFor("golden_apples"))
+ .endsWith("GOLDEN_APPLE")
+ .ensureSize("GOLDEN_APPLES", 2).lock();
+ .ensureSize("GOLDEN_APPLES", 2);
+
+ /**
+ * Covers the variants of horse armor.
+ */
+ public static final MaterialSetTag HORSE_ARMORS = new MaterialSetTag(keyFor("horse_armors"))
+ .endsWith("_HORSE_ARMOR")
+ .ensureSize("HORSE_ARMORS", 4).lock();
+ .ensureSize("HORSE_ARMORS", 4);
+
+ /**
+ * Covers the variants of infested blocks.
+ */
+ public static final MaterialSetTag INFESTED_BLOCKS = new MaterialSetTag(keyFor("infested_blocks"))
+ .startsWith("INFESTED_")
+ .ensureSize("INFESTED_BLOCKS", 7).lock();
+ .ensureSize("INFESTED_BLOCKS", 7);
+
+ /**
+ * Covers the variants of mushroom blocks.
@@ -316,19 +313,19 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag MUSHROOM_BLOCKS = new MaterialSetTag(keyFor("mushroom_blocks"))
+ .endsWith("MUSHROOM_BLOCK")
+ .add(Material.MUSHROOM_STEM)
+ .ensureSize("MUSHROOM_BLOCKS", 3).lock();
+ .ensureSize("MUSHROOM_BLOCKS", 3);
+
+ /**
+ * Covers all mushrooms.
+ */
+ public static final MaterialSetTag MUSHROOMS = new MaterialSetTag(keyFor("mushrooms"))
+ .add(Material.BROWN_MUSHROOM, Material.RED_MUSHROOM).lock();
+ .add(Material.BROWN_MUSHROOM, Material.RED_MUSHROOM);
+
+ /**
+ * Covers all music disc items.
+ */
+ public static final MaterialSetTag MUSIC_DISCS = new MaterialSetTag(keyFor("music_discs"))
+ .startsWith("MUSIC_DISC_").lock();
+ .startsWith("MUSIC_DISC_");
+
+ /**
+ * Covers all ores.
@@ -336,91 +333,91 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag ORES = new MaterialSetTag(keyFor("ores"))
+ .add(Material.ANCIENT_DEBRIS)
+ .endsWith("_ORE")
+ .ensureSize("ORES", 19).lock();
+ .ensureSize("ORES", 19);
+
+ /**
+ * Covers all piston typed items and blocks including the piston head and moving piston.
+ */
+ public static final MaterialSetTag PISTONS = new MaterialSetTag(keyFor("pistons"))
+ .contains("PISTON")
+ .ensureSize("PISTONS", 4).lock();
+ .ensureSize("PISTONS", 4);
+
+ /**
+ * Covers all potato items.
+ */
+ public static final MaterialSetTag POTATOES = new MaterialSetTag(keyFor("potatoes"))
+ .endsWith("POTATO")
+ .ensureSize("POTATOES", 3).lock();
+ .ensureSize("POTATOES", 3);
+
+ /**
+ * Covers all wooden pressure plates and the weighted pressure plates and the stone pressure plate.
+ */
+ public static final MaterialSetTag PRESSURE_PLATES = new MaterialSetTag(keyFor("pressure_plates"))
+ .endsWith("_PRESSURE_PLATE")
+ .ensureSize("PRESSURE_PLATES", 12).lock();
+ .ensureSize("PRESSURE_PLATES", 12);
+
+ /**
+ * Covers the variants of prismarine blocks.
+ */
+ public static final MaterialSetTag PRISMARINE = new MaterialSetTag(keyFor("prismarine"))
+ .add(Material.PRISMARINE, Material.PRISMARINE_BRICKS, Material.DARK_PRISMARINE).lock();
+ .add(Material.PRISMARINE, Material.PRISMARINE_BRICKS, Material.DARK_PRISMARINE);
+
+ /**
+ * Covers the variants of prismarine slabs.
+ */
+ public static final MaterialSetTag PRISMARINE_SLABS = new MaterialSetTag(keyFor("prismarine_slabs"))
+ .add(Material.PRISMARINE_SLAB, Material.PRISMARINE_BRICK_SLAB, Material.DARK_PRISMARINE_SLAB).lock();
+ .add(Material.PRISMARINE_SLAB, Material.PRISMARINE_BRICK_SLAB, Material.DARK_PRISMARINE_SLAB);
+
+ /**
+ * Covers the variants of prismarine stairs.
+ */
+ public static final MaterialSetTag PRISMARINE_STAIRS = new MaterialSetTag(keyFor("prismarine_stairs"))
+ .add(Material.PRISMARINE_STAIRS, Material.PRISMARINE_BRICK_STAIRS, Material.DARK_PRISMARINE_STAIRS).lock();
+ .add(Material.PRISMARINE_STAIRS, Material.PRISMARINE_BRICK_STAIRS, Material.DARK_PRISMARINE_STAIRS);
+
+ /**
+ * Covers the variants of pumpkins.
+ */
+ public static final MaterialSetTag PUMPKINS = new MaterialSetTag(keyFor("pumpkins"))
+ .add(Material.CARVED_PUMPKIN, Material.JACK_O_LANTERN, Material.PUMPKIN).lock();
+ .add(Material.CARVED_PUMPKIN, Material.JACK_O_LANTERN, Material.PUMPKIN);
+
+ /**
+ * Covers the variants of quartz blocks.
+ */
+ public static final MaterialSetTag QUARTZ_BLOCKS = new MaterialSetTag(keyFor("quartz_blocks"))
+ .add(Material.QUARTZ_BLOCK, Material.QUARTZ_PILLAR, Material.CHISELED_QUARTZ_BLOCK, Material.SMOOTH_QUARTZ).lock();
+ .add(Material.QUARTZ_BLOCK, Material.QUARTZ_PILLAR, Material.CHISELED_QUARTZ_BLOCK, Material.SMOOTH_QUARTZ);
+
+ /**
+ * Covers all uncooked fish items.
+ */
+ public static final MaterialSetTag RAW_FISH = new MaterialSetTag(keyFor("raw_fish"))
+ .add(Material.COD, Material.PUFFERFISH, Material.SALMON, Material.TROPICAL_FISH).lock();
+ .add(Material.COD, Material.PUFFERFISH, Material.SALMON, Material.TROPICAL_FISH);
+
+ /**
+ * Covers the variants of red sandstone blocks.
+ */
+ public static final MaterialSetTag RED_SANDSTONES = new MaterialSetTag(keyFor("red_sandstones"))
+ .endsWith("RED_SANDSTONE")
+ .ensureSize("RED_SANDSTONES", 4).lock();
+ .ensureSize("RED_SANDSTONES", 4);
+
+ /**
+ * Covers the variants of sandstone blocks.
+ */
+ public static final MaterialSetTag SANDSTONES = new MaterialSetTag(keyFor("sandstones"))
+ .add(Material.SANDSTONE, Material.CHISELED_SANDSTONE, Material.CUT_SANDSTONE, Material.SMOOTH_SANDSTONE).lock();
+ .add(Material.SANDSTONE, Material.CHISELED_SANDSTONE, Material.CUT_SANDSTONE, Material.SMOOTH_SANDSTONE);
+
+ /**
+ * Covers sponge and wet sponge.
+ */
+ public static final MaterialSetTag SPONGES = new MaterialSetTag(keyFor("sponges"))
+ .endsWith("SPONGE")
+ .ensureSize("SPONGES", 2).lock();
+ .ensureSize("SPONGES", 2);
+
+ /**
+ * Covers the non-colored and colored shulker boxes.
+ */
+ public static final MaterialSetTag SHULKER_BOXES = new MaterialSetTag(keyFor("shulker_boxes"))
+ .endsWith("SHULKER_BOX")
+ .ensureSize("SHULKER_BOXES", 17).lock();
+ .ensureSize("SHULKER_BOXES", 17);
+
+ /**
+ * Covers zombie, creeper, skeleton, dragon, and player heads.
@@ -429,35 +426,35 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ .endsWith("_HEAD")
+ .endsWith("_SKULL")
+ .not(Material.PISTON_HEAD)
+ .ensureSize("SKULLS", 12).lock();
+ .ensureSize("SKULLS", 12);
+
+ /**
+ * Covers all spawn egg items.
+ */
+ public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs"))
+ .endsWith("_SPAWN_EGG")
+ .ensureSize("SPAWN_EGGS", 67).lock();
+ .ensureSize("SPAWN_EGGS", 67);
+
+ /**
+ * Covers all colors of stained glass.
+ */
+ public static final MaterialSetTag STAINED_GLASS = new MaterialSetTag(keyFor("stained_glass"))
+ .endsWith("_STAINED_GLASS")
+ .ensureSize("STAINED_GLASS", 16).lock();
+ .ensureSize("STAINED_GLASS", 16);
+
+ /**
+ * Covers all colors of stained glass panes.
+ */
+ public static final MaterialSetTag STAINED_GLASS_PANES = new MaterialSetTag(keyFor("stained_glass_panes"))
+ .endsWith("STAINED_GLASS_PANE")
+ .ensureSize("STAINED_GLASS_PANES", 16).lock();
+ .ensureSize("STAINED_GLASS_PANES", 16);
+
+ /**
+ * Covers all variants of trapdoors.
+ */
+ public static final MaterialSetTag TRAPDOORS = new MaterialSetTag(keyFor("trapdoors"))
+ .endsWith("_TRAPDOOR")
+ .ensureSize("TRAPDOORS", 9).lock();
+ .ensureSize("TRAPDOORS", 9);
+
+ /**
+ * Covers all wood variants of doors.
@@ -465,7 +462,7 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag WOODEN_DOORS = new MaterialSetTag(keyFor("wooden_doors"))
+ .endsWith("_DOOR")
+ .not(Material.IRON_DOOR)
+ .ensureSize("WOODEN_DOORS", 8).lock();
+ .ensureSize("WOODEN_DOORS", 8);
+
+ /**
+ * Covers all wood variants of fences.
@@ -473,7 +470,7 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag WOODEN_FENCES = new MaterialSetTag(keyFor("wooden_fences"))
+ .endsWith("_FENCE")
+ .not(Material.NETHER_BRICK_FENCE)
+ .ensureSize("WOODEN_FENCES", 8).lock();
+ .ensureSize("WOODEN_FENCES", 8);
+
+ /**
+ * Covers all wood variants of trapdoors.
@@ -481,112 +478,112 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag WOODEN_TRAPDOORS = new MaterialSetTag(keyFor("wooden_trapdoors"))
+ .endsWith("_TRAPDOOR")
+ .not(Material.IRON_TRAPDOOR)
+ .ensureSize("WOODEN_TRAPDOORS", 8).lock();
+ .ensureSize("WOODEN_TRAPDOORS", 8);
+
+ /**
+ * Covers the wood variants of gates.
+ */
+ public static final MaterialSetTag WOODEN_GATES = new MaterialSetTag(keyFor("wooden_gates"))
+ .endsWith("_GATE")
+ .ensureSize("WOODEN_GATES", 8).lock();
+ .ensureSize("WOODEN_GATES", 8);
+
+ /**
+ * Covers the variants of purpur.
+ */
+ public static final MaterialSetTag PURPUR = new MaterialSetTag(keyFor("purpur"))
+ .startsWith("PURPUR_")
+ .ensureSize("PURPUR", 4).lock();
+ .ensureSize("PURPUR", 4);
+
+ /**
+ * Covers the variants of signs.
+ */
+ public static final MaterialSetTag SIGNS = new MaterialSetTag(keyFor("signs"))
+ .endsWith("_SIGN")
+ .ensureSize("SIGNS", 16).lock();
+ .ensureSize("SIGNS", 16);
+
+ /**
+ * Covers the variants of a regular torch.
+ */
+ public static final MaterialSetTag TORCH = new MaterialSetTag(keyFor("torch"))
+ .add(Material.TORCH, Material.WALL_TORCH)
+ .ensureSize("TORCH", 2).lock();
+ .ensureSize("TORCH", 2);
+
+ /**
+ * Covers the variants of a redstone torch.
+ */
+ public static final MaterialSetTag REDSTONE_TORCH = new MaterialSetTag(keyFor("restone_torch"))
+ .add(Material.REDSTONE_TORCH, Material.REDSTONE_WALL_TORCH)
+ .ensureSize("REDSTONE_TORCH", 2).lock();
+ .ensureSize("REDSTONE_TORCH", 2);
+
+ /**
+ * Covers the variants of a soul torch.
+ */
+ public static final MaterialSetTag SOUL_TORCH = new MaterialSetTag(keyFor("soul_torch"))
+ .add(Material.SOUL_TORCH, Material.SOUL_WALL_TORCH)
+ .ensureSize("SOUL_TORCH", 2).lock();
+ .ensureSize("SOUL_TORCH", 2);
+
+ /**
+ * Covers the variants of torches.
+ */
+ public static final MaterialSetTag TORCHES = new MaterialSetTag(keyFor("torches"))
+ .add(TORCH, REDSTONE_TORCH, SOUL_TORCH)
+ .ensureSize("TORCHES", 6).lock();
+ .ensureSize("TORCHES", 6);
+
+ /**
+ * Covers the variants of lanterns.
+ */
+ public static final MaterialSetTag LANTERNS = new MaterialSetTag(keyFor("lanterns"))
+ .add(Material.LANTERN, Material.SOUL_LANTERN)
+ .ensureSize("LANTERNS", 2).lock();
+ .ensureSize("LANTERNS", 2);
+
+ /**
+ * Covers the variants of rails.
+ */
+ public static final MaterialSetTag RAILS = new MaterialSetTag(keyFor("rails"))
+ .endsWith("RAIL")
+ .ensureSize("RAILS", 4).lock();
+ .ensureSize("RAILS", 4);
+
+ /**
+ * Covers the variants of swords.
+ */
+ public static final MaterialSetTag SWORDS = new MaterialSetTag(keyFor("swords"))
+ .endsWith("_SWORD")
+ .ensureSize("SWORDS", 6).lock();
+ .ensureSize("SWORDS", 6);
+
+ /**
+ * Covers the variants of shovels.
+ */
+ public static final MaterialSetTag SHOVELS = new MaterialSetTag(keyFor("shovels"))
+ .endsWith("_SHOVEL")
+ .ensureSize("SHOVELS", 6).lock();
+ .ensureSize("SHOVELS", 6);
+
+ /**
+ * Covers the variants of pickaxes.
+ */
+ public static final MaterialSetTag PICKAXES = new MaterialSetTag(keyFor("pickaxes"))
+ .endsWith("_PICKAXE")
+ .ensureSize("PICKAXES", 6).lock();
+ .ensureSize("PICKAXES", 6);
+
+ /**
+ * Covers the variants of axes.
+ */
+ public static final MaterialSetTag AXES = new MaterialSetTag(keyFor("axes"))
+ .endsWith("_AXE")
+ .ensureSize("AXES", 6).lock();
+ .ensureSize("AXES", 6);
+
+ /**
+ * Covers the variants of hoes.
+ */
+ public static final MaterialSetTag HOES = new MaterialSetTag(keyFor("hoes"))
+ .endsWith("_HOE")
+ .ensureSize("HOES", 6).lock();
+ .ensureSize("HOES", 6);
+
+ /**
+ * Covers the variants of helmets.
+ */
+ public static final MaterialSetTag HELMETS = new MaterialSetTag(keyFor("helmets"))
+ .endsWith("_HELMET")
+ .ensureSize("HELMETS", 7).lock();
+ .ensureSize("HELMETS", 7);
+
+ /**
+ * Covers the variants of items that can be equipped in the helmet slot.
@@ -595,14 +592,14 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ .endsWith("_HELMET")
+ .add(SKULLS)
+ .add(Material.CARVED_PUMPKIN)
+ .ensureSize("HEAD_EQUIPPABLE", 20).lock();
+ .ensureSize("HEAD_EQUIPPABLE", 20);
+
+ /**
+ * Covers the variants of chestplate.
+ */
+ public static final MaterialSetTag CHESTPLATES = new MaterialSetTag(keyFor("chestplates"))
+ .endsWith("_CHESTPLATE")
+ .ensureSize("CHESTPLATES", 6).lock();
+ .ensureSize("CHESTPLATES", 6);
+
+ /**
+ * Covers the variants of items that can be equipped in the chest slot.
@@ -610,21 +607,21 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag CHEST_EQUIPPABLE = new MaterialSetTag(keyFor("chest_equippable"))
+ .endsWith("_CHESTPLATE")
+ .add(Material.ELYTRA)
+ .ensureSize("CHEST_EQUIPPABLE", 7).lock();
+ .ensureSize("CHEST_EQUIPPABLE", 7);
+
+ /**
+ * Covers the variants of leggings.
+ */
+ public static final MaterialSetTag LEGGINGS = new MaterialSetTag(keyFor("leggings"))
+ .endsWith("_LEGGINGS")
+ .ensureSize("LEGGINGS", 6).lock();
+ .ensureSize("LEGGINGS", 6);
+
+ /**
+ * Covers the variants of boots.
+ */
+ public static final MaterialSetTag BOOTS = new MaterialSetTag(keyFor("boots"))
+ .endsWith("_BOOTS")
+ .ensureSize("BOOTS", 6).lock();
+ .ensureSize("BOOTS", 6);
+
+ /**
+ * Covers the variants of bows.
@@ -632,28 +629,28 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag BOWS = new MaterialSetTag(keyFor("bows"))
+ .add(Material.BOW)
+ .add(Material.CROSSBOW)
+ .ensureSize("BOWS", 2).lock();
+ .ensureSize("BOWS", 2);
+
+ /**
+ * Covers the variants of player-throwable projectiles (not requiring a bow or any other "assistance").
+ */
+ public static final MaterialSetTag THROWABLE_PROJECTILES = new MaterialSetTag(keyFor("throwable_projectiles"))
+ .add(Material.EGG, Material.SNOWBALL, Material.SPLASH_POTION, Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET).lock();
+ .add(Material.EGG, Material.SNOWBALL, Material.SPLASH_POTION, Material.TRIDENT, Material.ENDER_PEARL, Material.EXPERIENCE_BOTTLE, Material.FIREWORK_ROCKET);
+
+ /**
+ * Covers materials that can be colored, such as wool, shulker boxes, stained glass etc.
+ */
+ @SuppressWarnings("unchecked")
+ public static final MaterialSetTag COLORABLE = new MaterialSetTag(keyFor("colorable"))
+ .add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS).lock();
+ //.ensureSize("COLORABLE", 81).lock(); unit test don't have the vanilla item tags, so counts don't line up for real
+ .add(Tag.WOOL, Tag.CARPETS).add(SHULKER_BOXES, STAINED_GLASS, STAINED_GLASS_PANES, CONCRETES, BEDS);
+ //.ensureSize("COLORABLE", 81); unit test don't have the vanilla item tags, so counts don't line up for real
+
+ /**
+ * Covers the variants of coral.
+ */
+ public static final MaterialSetTag CORAL = new MaterialSetTag(keyFor("coral"))
+ .endsWith("_CORAL")
+ .ensureSize("CORAL", 10).lock();
+ .ensureSize("CORAL", 10);
+
+ /**
+ * Covers the variants of coral fans.
@@ -661,14 +658,14 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag CORAL_FANS = new MaterialSetTag(keyFor("coral_fans"))
+ .endsWith("_CORAL_FAN")
+ .endsWith("_CORAL_WALL_FAN")
+ .ensureSize("CORAL_FANS", 20).lock();
+ .ensureSize("CORAL_FANS", 20);
+
+ /**
+ * Covers the variants of coral blocks.
+ */
+ public static final MaterialSetTag CORAL_BLOCKS = new MaterialSetTag(keyFor("coral_blocks"))
+ .endsWith("_CORAL_BLOCK")
+ .ensureSize("CORAL_BLOCKS", 10).lock();
+ .ensureSize("CORAL_BLOCKS", 10);
+
+ /**
+ * Covers all items that can be enchanted from the enchantment table or anvil.
@@ -676,50 +673,44 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ public static final MaterialSetTag ENCHANTABLE = new MaterialSetTag(keyFor("enchantable"))
+ .add(PICKAXES, SWORDS, SHOVELS, AXES, HOES, HELMETS, CHEST_EQUIPPABLE, LEGGINGS, BOOTS, BOWS)
+ .add(Material.TRIDENT, Material.SHIELD, Material.FISHING_ROD, Material.SHEARS, Material.FLINT_AND_STEEL, Material.CARROT_ON_A_STICK, Material.WARPED_FUNGUS_ON_A_STICK)
+ .ensureSize("ENCHANTABLE", 65).lock();
+ .ensureSize("ENCHANTABLE", 65);
+
+ /**
+ * Covers the variants of raw ores.
+ */
+ public static final MaterialSetTag RAW_ORES = new MaterialSetTag(keyFor("raw_ores"))
+ .add(Material.RAW_COPPER, Material.RAW_GOLD, Material.RAW_IRON).lock();
+
+ /**
+ * Covers the variants of deepslate ores.
+ */
+ public static final MaterialSetTag DEEPSLATE_ORES = new MaterialSetTag(keyFor("deepslate_ores"))
+ .add(material -> material.name().startsWith("DEEPSLATE_") && material.name().endsWith("_ORE"))
+ .ensureSize("DEEPSLATE_ORES", 8).lock();
+ .add(Material.RAW_COPPER, Material.RAW_GOLD, Material.RAW_IRON);
+
+ /**
+ * Covers the variants of raw ore blocks.
+ */
+ public static final MaterialSetTag RAW_ORE_BLOCKS = new MaterialSetTag(keyFor("raw_ore_blocks"))
+ .add(Material.RAW_COPPER_BLOCK, Material.RAW_GOLD_BLOCK, Material.RAW_IRON_BLOCK).lock();
+ .add(Material.RAW_COPPER_BLOCK, Material.RAW_GOLD_BLOCK, Material.RAW_IRON_BLOCK);
+
+
+ /**
+ * Covers all oxidized copper blocks.
+ */
+ public static final MaterialSetTag OXIDIZED_COPPER_BLOCKS = new MaterialSetTag(keyFor("oxidized_copper_blocks"))
+ .startsWith("OXIDIZED_").startsWith("WAXED_OXIDIZED_").ensureSize("OXIDIZED_COPPER_BLOCKS", 8).lock();
+ .startsWith("OXIDIZED_").startsWith("WAXED_OXIDIZED_").ensureSize("OXIDIZED_COPPER_BLOCKS", 8);
+
+ /**
+ * Covers all weathered copper blocks.
+ */
+ public static final MaterialSetTag WEATHERED_COPPER_BLOCKS = new MaterialSetTag(keyFor("weathered_copper_blocks"))
+ .startsWith("WEATHERED_").startsWith("WAXED_WEATHERED_").ensureSize("WEATHERED_COPPER_BLOCKS", 8).lock();
+ .startsWith("WEATHERED_").startsWith("WAXED_WEATHERED_").ensureSize("WEATHERED_COPPER_BLOCKS", 8);
+
+ /**
+ * Covers all exposed copper blocks.
+ */
+ public static final MaterialSetTag EXPOSED_COPPER_BLOCKS = new MaterialSetTag(keyFor("exposed_copper_blocks"))
+ .startsWith("EXPOSED_").startsWith("WAXED_EXPOSED_").ensureSize("EXPOSED_COPPER_BLOCKS", 8).lock();
+ .startsWith("EXPOSED_").startsWith("WAXED_EXPOSED_").ensureSize("EXPOSED_COPPER_BLOCKS", 8);
+
+ /**
+ * Covers all un-weathered copper blocks.
+ */
+ public static final MaterialSetTag UNAFFECTED_COPPER_BLOCKS = new MaterialSetTag(keyFor("unaffected_copper_blocks"))
+ .startsWith("CUT_COPPER").startsWith("WAXED_CUT_COPPER").add(Material.COPPER_BLOCK).add(Material.WAXED_COPPER_BLOCK).ensureSize("UNAFFECTED_COPPER_BLOCKS", 8).lock();
+ .startsWith("CUT_COPPER").startsWith("WAXED_CUT_COPPER").add(Material.COPPER_BLOCK).add(Material.WAXED_COPPER_BLOCK).ensureSize("UNAFFECTED_COPPER_BLOCKS", 8);
+
+ /**
+ * Covers all waxed copper blocks.
@@ -727,7 +718,7 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ * Combine with other copper-related tags to filter is-waxed or not.
+ */
+ public static final MaterialSetTag WAXED_COPPER_BLOCKS = new MaterialSetTag(keyFor("waxed_copper_blocks"))
+ .add(m -> m.name().startsWith("WAXED_") && m.name().contains("COPPER")).ensureSize("WAXED_COPPER_BLOCKS", 16).lock();
+ .add(m -> m.name().startsWith("WAXED_") && m.name().contains("COPPER")).ensureSize("WAXED_COPPER_BLOCKS", 16);
+
+ /**
+ * Covers all un-waxed copper blocks.
@@ -735,13 +726,13 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ * Combine with other copper-related tags to filter is-un-waxed or not.
+ */
+ public static final MaterialSetTag UNWAXED_COPPER_BLOCKS = new MaterialSetTag(keyFor("unwaxed_copper_blocks"))
+ .contains("CUT_COPPER").endsWith("_COPPER").notContains("WAXED").ensureSize("UNWAXED_COPPER_BLOCKS", 16).lock();
+ .contains("CUT_COPPER").endsWith("_COPPER").notContains("WAXED").ensureSize("UNWAXED_COPPER_BLOCKS", 16);
+
+ /**
+ * Covers all copper block variants.
+ */
+ public static final MaterialSetTag COPPER_BLOCKS = new MaterialSetTag(keyFor("copper_blocks"))
+ .add(WAXED_COPPER_BLOCKS).add(UNWAXED_COPPER_BLOCKS).ensureSize("COPPER_BLOCKS", 32).lock();
+ .add(WAXED_COPPER_BLOCKS).add(UNWAXED_COPPER_BLOCKS).ensureSize("COPPER_BLOCKS", 32);
+
+ /**
+ * Covers all weathering/waxed states of the plain copper block.
@@ -752,32 +743,32 @@ index 0000000000000000000000000000000000000000..f5ae132cef01666bacda11422c0b73dd
+ .contains("EXPOSED_COPPER")
+ .contains("COPPER_BLOCK")
+ .not(Material.RAW_COPPER_BLOCK)
+ .ensureSize("FULL_COPPER_BLOCKS", 8).lock();
+ .ensureSize("FULL_COPPER_BLOCKS", 8);
+
+ /**
+ * Covers all weathering/waxed states of the cut copper block.
+ */
+ public static final MaterialSetTag CUT_COPPER_BLOCKS = new MaterialSetTag(keyFor("cut_copper_blocks"))
+ .endsWith("CUT_COPPER").ensureSize("CUT_COPPER_BLOCKS", 8).lock();
+ .endsWith("CUT_COPPER").ensureSize("CUT_COPPER_BLOCKS", 8);
+
+ /**
+ * Covers all weathering/waxed states of the cut copper stairs.
+ */
+ public static final MaterialSetTag CUT_COPPER_STAIRS = new MaterialSetTag(keyFor("cut_copper_stairs"))
+ .endsWith("CUT_COPPER_STAIRS").ensureSize("CUT_COPPER_STAIRS", 8).lock();
+ .endsWith("CUT_COPPER_STAIRS").ensureSize("CUT_COPPER_STAIRS", 8);
+
+ /**
+ * Covers all weathering/waxed states of the cut copper slab.
+ */
+ public static final MaterialSetTag CUT_COPPER_SLABS = new MaterialSetTag(keyFor("cut_copper_slabs"))
+ .endsWith("CUT_COPPER_SLAB").ensureSize("CUT_COPPER_SLABS", 8).lock();
+ .endsWith("CUT_COPPER_SLAB").ensureSize("CUT_COPPER_SLABS", 8);
+}
diff --git a/src/main/java/io/papermc/paper/tag/BaseTag.java b/src/main/java/io/papermc/paper/tag/BaseTag.java
new file mode 100644
index 0000000000000000000000000000000000000000..71484259de4783b861803c48850317eb2d60bda0
index 0000000000000000000000000000000000000000..4b8552e4e4c07b197fa9431fa911535b0222561e
--- /dev/null
+++ b/src/main/java/io/papermc/paper/tag/BaseTag.java
@@ -0,0 +1,180 @@
@@ -0,0 +1,160 @@
+package io.papermc.paper.tag;
+
+import com.google.common.collect.Lists;
@@ -799,7 +790,6 @@ index 0000000000000000000000000000000000000000..71484259de4783b861803c48850317eb
+ protected final NamespacedKey key;
+ protected final Set<T> tagged;
+ private final List<Predicate<T>> globalPredicates;
+ private boolean locked = false;
+
+ public BaseTag(@NotNull Class<T> clazz, @NotNull NamespacedKey key, @NotNull Predicate<T> filter) {
+ this(clazz, key);
@@ -826,21 +816,6 @@ index 0000000000000000000000000000000000000000..71484259de4783b861803c48850317eb
+ return (Set<E>) EnumSet.noneOf((Class<Enum>) enumClass);
+ }
+
+ public @NotNull C lock() {
+ this.locked = true;
+ return (C) this;
+ }
+
+ public boolean isLocked() {
+ return this.locked;
+ }
+
+ private void checkLock() {
+ if (this.locked) {
+ throw new UnsupportedOperationException("Tag (" + this.key + ") is locked");
+ }
+ }
+
+ @NotNull
+ @Override
+ public NamespacedKey getKey() {
@@ -868,14 +843,12 @@ index 0000000000000000000000000000000000000000..71484259de4783b861803c48850317eb
+
+ @NotNull
+ public C add(@NotNull T...values) {
+ this.checkLock();
+ this.tagged.addAll(Lists.newArrayList(values));
+ return (C) this;
+ }
+
+ @NotNull
+ public C add(@NotNull Collection<T> collection) {
+ this.checkLock();
+ this.tagged.addAll(collection);
+ return (C) this;
+ }
@@ -910,14 +883,12 @@ index 0000000000000000000000000000000000000000..71484259de4783b861803c48850317eb
+
+ @NotNull
+ public C not(@NotNull T...values) {
+ this.checkLock();
+ this.tagged.removeAll(Lists.newArrayList(values));
+ return (C) this;
+ }
+
+ @NotNull
+ public C not(@NotNull Collection<T> values) {
+ this.checkLock();
+ this.tagged.removeAll(values);
+ return (C) this;
+ }
@@ -1008,20 +979,16 @@ index 0000000000000000000000000000000000000000..c89c4619aaf388197834d98eb95af2f1
+}
diff --git a/src/main/java/io/papermc/paper/tag/EntityTags.java b/src/main/java/io/papermc/paper/tag/EntityTags.java
new file mode 100644
index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5e988de0f
index 0000000000000000000000000000000000000000..683688edff2c86d92f6b3e15271c3289b39e42d7
--- /dev/null
+++ b/src/main/java/io/papermc/paper/tag/EntityTags.java
@@ -0,0 +1,54 @@
@@ -0,0 +1,50 @@
+package io.papermc.paper.tag;
+
+import org.bukkit.NamespacedKey;
+
+import static org.bukkit.entity.EntityType.*;
+
+/**
+ * All tags in this class are unmodifiable, attempting to modify them will throw an
+ * {@link UnsupportedOperationException}.
+ */
+public class EntityTags {
+
+ private static NamespacedKey keyFor(String key) {
@@ -1035,28 +1002,28 @@ index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5
+ */
+ public static final EntitySetTag UNDEADS = new EntitySetTag(keyFor("undeads"))
+ .add(DROWNED, HUSK, PHANTOM, SKELETON, SKELETON_HORSE, STRAY, WITHER, WITHER_SKELETON, ZOGLIN, ZOMBIE, ZOMBIE_HORSE, ZOMBIE_VILLAGER, ZOMBIFIED_PIGLIN)
+ .ensureSize("UNDEADS", 13).lock();
+ .ensureSize("UNDEADS", 13);
+
+ /**
+ * Covers all horses
+ */
+ public static final EntitySetTag HORSES = new EntitySetTag(keyFor("horses"))
+ .contains("HORSE")
+ .ensureSize("HORSES", 3).lock();
+ .ensureSize("HORSES", 3);
+
+ /**
+ * Covers all minecarts
+ */
+ public static final EntitySetTag MINECARTS = new EntitySetTag(keyFor("minecarts"))
+ .contains("MINECART")
+ .ensureSize("MINECARTS", 7).lock();
+ .ensureSize("MINECARTS", 7);
+
+ /**
+ * Covers mobs that split into smaller mobs
+ */
+ public static final EntitySetTag SPLITTING_MOBS = new EntitySetTag(keyFor("splitting_mobs"))
+ .add(SLIME, MAGMA_CUBE)
+ .ensureSize("SLIMES", 2).lock();
+ .ensureSize("SLIMES", 2);
+
+ /**
+ * Covers all water based mobs
@@ -1064,7 +1031,7 @@ index 0000000000000000000000000000000000000000..d7eb49a05c3f0cacf285f8995433c5d5
+ */
+ public static final EntitySetTag WATER_BASED = new EntitySetTag(keyFor("water_based"))
+ .add(AXOLOTL, DOLPHIN, SQUID, GLOW_SQUID, GUARDIAN, ELDER_GUARDIAN, TURTLE, COD, SALMON, PUFFERFISH, TROPICAL_FISH)
+ .ensureSize("WATER_BASED", 11).lock();
+ .ensureSize("WATER_BASED", 11);
+}
diff --git a/src/main/java/org/bukkit/Tag.java b/src/main/java/org/bukkit/Tag.java
index 5a25301a81b0e88a4891cbc4710289544d44105c..34d23f53acf00620223731c4fdacffde9cff41a8 100644
@@ -1083,41 +1050,27 @@ index 5a25301a81b0e88a4891cbc4710289544d44105c..34d23f53acf00620223731c4fdacffde
public interface Tag<T extends Keyed> extends Keyed {
diff --git a/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..f849d8b12a7e3d1606698408ab4bb140a3b370e4
index 0000000000000000000000000000000000000000..328c51471dc12e81c1a1b643455337b3fef4d14a
--- /dev/null
+++ b/src/test/java/com/destroystokyo/paper/MaterialTagsTest.java
@@ -0,0 +1,65 @@
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
+ */
+
+package com.destroystokyo.paper;
+
+import io.papermc.paper.tag.BaseTag;
+import io.papermc.paper.tag.EntityTags;
+import org.bukkit.Bukkit;
+import org.bukkit.TestServer;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.logging.Level;
+
+import static org.junit.Assert.assertTrue;
+
+public class MaterialTagsTest {
+
+ @Before
+ public void before() {
+ TestServer.getInstance();
+ }
+
+ @Test
+ public void testInitialize() {
+ try {
+ TestServer.getInstance();
+ MaterialTags.SHULKER_BOXES.getValues();
+ assert true;
+ } catch (Throwable e) {
@@ -1125,32 +1078,6 @@ index 0000000000000000000000000000000000000000..f849d8b12a7e3d1606698408ab4bb140
+ assert false;
+ }
+ }
+
+ @Test
+ public void testLocked() {
+ testLocked(MaterialTags.class);
+ testLocked(EntityTags.class);
+ }
+
+ private static void testLocked(Class<?> clazz) {
+ for (BaseTag<?, ?> tag : collectTags(clazz)) {
+ assertTrue("Tag " + tag.key() + " is not locked", tag.isLocked());
+ }
+ }
+
+ private static Set<BaseTag<?, ?>> collectTags(Class<?> clazz) {
+ Set<BaseTag<?, ?>> tags = new HashSet<>();
+ try {
+ for (Field field : clazz.getDeclaredFields()) {
+ if (Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers()) && BaseTag.class.isAssignableFrom(field.getType())) {
+ tags.add((BaseTag<?, ?>) field.get(null));
+ }
+ }
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ return tags;
+ }
+}
diff --git a/src/test/java/io/papermc/paper/EntityTagsTest.java b/src/test/java/io/papermc/paper/EntityTagsTest.java
new file mode 100644
@@ -5,10 +5,10 @@ Subject: [PATCH] Add sun related API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 04583189f7ed9a446ed649780e2b99cb5e1ab3ad..f36eb8896ee84c1d3bbce17b11ed05c5f99f2e29 100644
index a0a4d0f143303bd449494ec1479db1e449836595..614c04c31c95e9a404b5caac3e07285ce2c58367 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1793,6 +1793,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@@ -1789,6 +1789,16 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
*/
public void setFullTime(long time);
+42
View File
@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Fri, 12 Oct 2018 01:37:16 -0500
Subject: [PATCH] Here's Johnny!
diff --git a/src/main/java/org/bukkit/entity/Vindicator.java b/src/main/java/org/bukkit/entity/Vindicator.java
index b8ea68a8f420c1ba99c0621a15e654d3ee48c8d6..c5d9e76a6a4125eb0409967a57e3836b8f2d24a0 100644
--- a/src/main/java/org/bukkit/entity/Vindicator.java
+++ b/src/main/java/org/bukkit/entity/Vindicator.java
@@ -3,4 +3,30 @@ package org.bukkit.entity;
/**
* Represents a Vindicator.
*/
-public interface Vindicator extends Illager { }
+public interface Vindicator extends Illager {
+ // Paper start
+ /**
+ * Check if this Vindicator is set to Johnny mode.
+ * <p>
+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except
+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile
+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and
+ * magma cubes, will try to attack the vindicator in return.
+ *
+ * @return True if in Johnny mode
+ */
+ boolean isJohnny();
+
+ /**
+ * Set this Vindicator's Johnny mode.
+ * <p>
+ * When in Johnny mode the Vindicator will be hostile to any kind of mob, except
+ * for evokers, ghasts, illusioners and other vindicators. It will even be hostile
+ * to vexes. All mobs, except for endermites, phantoms, guardians, slimes and
+ * magma cubes, will try to attack the vindicator in return.
+ *
+ * @param johnny True to enable Johnny mode
+ */
+ void setJohnny(boolean johnny);
+ // Paper end
+}
@@ -221,10 +221,10 @@ index 0000000000000000000000000000000000000000..abeb24fccda2acfdb0dfdadacb8fe688
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Turtle.java b/src/main/java/org/bukkit/entity/Turtle.java
index 0a4cd29930c2f1c28f5a3e6884c7dec45b5cac11..8bee07c81172e189fab9b82b398983f509099474 100644
index 0a4cd29930c2f1c28f5a3e6884c7dec45b5cac11..5375ea14097f4f10b2294488b92924a35a72d4d7 100644
--- a/src/main/java/org/bukkit/entity/Turtle.java
+++ b/src/main/java/org/bukkit/entity/Turtle.java
@@ -1,6 +1,62 @@
@@ -1,6 +1,55 @@
package org.bukkit.entity;
+import org.bukkit.Location;
@@ -279,12 +279,5 @@ index 0a4cd29930c2f1c28f5a3e6884c7dec45b5cac11..8bee07c81172e189fab9b82b398983f5
+ * @param hasEgg True if carrying egg
+ */
+ void setHasEgg(boolean hasEgg);
+
+ /**
+ * Returns whether the turtle is currently laying an egg.
+ *
+ * @return whether the turtle is laying an egg
+ */
+ boolean isLayingEgg();
+ // Paper end
+}
@@ -5,10 +5,10 @@ Subject: [PATCH] Make the default permission message configurable
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 098a09baa481f76e63991268d3dfabc413626fcf..ca6f3a18ca8902b99c1c8c21b6da5def7fdb2aa8 100644
index 23960534cbb83cfca08ccc1e37bc7a713728b791..53a361b2f6d8d8e79f215e64d3b42fcbe54b0d81 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -2113,6 +2113,15 @@ public final class Bukkit {
@@ -1990,6 +1990,15 @@ public final class Bukkit {
return server.suggestPlayerNamesWhenNullTabCompletions();
}
@@ -22,13 +22,13 @@ index 098a09baa481f76e63991268d3dfabc413626fcf..ca6f3a18ca8902b99c1c8c21b6da5def
+ }
+
/**
* Creates a PlayerProfile for the specified uuid, with name as null.
*
* Creates a PlayerProfile for the specified uuid, with name as null
* @param uuid UUID to create profile for
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 2642be263b4201ce572386bbaf3434b5af836e8d..28be40d6844f801c26e8359e509afc5e3dedd71f 100644
index f7320c0797f31cc9609a6764d886bdb6dbd082af..963edbb1e7d47410b7474b8e0ce6774a76ea9d88 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1857,6 +1857,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -1745,6 +1745,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
boolean suggestPlayerNamesWhenNullTabCompletions();
@@ -40,8 +40,8 @@ index 2642be263b4201ce572386bbaf3434b5af836e8d..28be40d6844f801c26e8359e509afc5e
+ String getPermissionMessage();
+
/**
* Creates a PlayerProfile for the specified uuid, with name as null.
*
* Creates a PlayerProfile for the specified uuid, with name as null
* @param uuid UUID to create profile for
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index b1152f4dede61383232cc6713d448840612eac13..95847fcb1ac2e430ee192f4f7ac94e981151c5db 100644
--- a/src/main/java/org/bukkit/command/Command.java
@@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and
documented as to their purpose.
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index 9d774a10b9543e9293cb10ee9d7c9adebbfef34c..23e853bae0e051cd43deb9eb24c54e74a56d8ab0 100644
index 6cf05fed701c67a2c797a4e0839c795802a238a1..3afd5f5c0208a4ee93b5dbfc2aab2b9d2e8a7544 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -160,7 +160,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -147,7 +147,9 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* UTC.
*
* @return Date of last log-in for this player, or 0
@@ -29,7 +29,7 @@ index 9d774a10b9543e9293cb10ee9d7c9adebbfef34c..23e853bae0e051cd43deb9eb24c54e74
public long getLastPlayed();
/**
@@ -178,6 +180,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@@ -165,6 +167,30 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
*/
@Nullable
public Location getBedSpawnLocation();
@@ -1,429 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 24 Mar 2019 18:39:01 -0400
Subject: [PATCH] Fix Spigot annotation mistakes
while some of these may of been true, they are extreme cases and cause
a ton of noise to plugin developers.
These do not help plugin developers if they bring moise noise than value.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ca6f3a18ca8902b99c1c8c21b6da5def7fdb2aa8..b2acdd8bf213b779ac3afaac7026bc22eb5cdb8d 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -1699,7 +1699,7 @@ public final class Bukkit {
*
* @return the scoreboard manager or null if no worlds are loaded.
*/
- @Nullable
+ @NotNull // Paper
public static ScoreboardManager getScoreboardManager() {
return server.getScoreboardManager();
}
@@ -1996,7 +1996,7 @@ public final class Bukkit {
* @param clazz the class of the tag entries
* @return the tag or null
*/
- @Nullable
+ @UndefinedNullability // Paper
public static <T extends Keyed> Tag<T> getTag(@NotNull String registry, @NotNull NamespacedKey tag, @NotNull Class<T> clazz) {
return server.getTag(registry, tag, clazz);
}
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 57cb548683f7b2972c998afd34176952426f8b47..d4c87bfed81b2d73919705912f59fab05c0ee61b 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -46,7 +46,7 @@ public class Location implements Cloneable, ConfigurationSerializable {
* @param y The y-coordinate of this new location
* @param z The z-coordinate of this new location
*/
- public Location(@Nullable final World world, final double x, final double y, final double z) {
+ public Location(@UndefinedNullability final World world, final double x, final double y, final double z) { // Paper
this(world, x, y, z, 0, 0);
}
@@ -60,7 +60,7 @@ public class Location implements Cloneable, ConfigurationSerializable {
* @param yaw The absolute rotation on the x-plane, in degrees
* @param pitch The absolute rotation on the y-plane, in degrees
*/
- public Location(@Nullable final World world, final double x, final double y, final double z, final float yaw, final float pitch) {
+ public Location(@UndefinedNullability final World world, final double x, final double y, final double z, final float yaw, final float pitch) { // Paper
if (world != null) {
this.world = new WeakReference<>(world);
}
@@ -102,7 +102,7 @@ public class Location implements Cloneable, ConfigurationSerializable {
* @throws IllegalArgumentException when world is unloaded
* @see #isWorldLoaded()
*/
- @Nullable
+ @UndefinedNullability // Paper
public World getWorld() {
if (this.world == null) {
return null;
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
index 53d1609e2a75c007cb7e5e8f963b0deb53bae5f7..a8561434d56f7db7e4f52283759b282e9c2116a2 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
@@ -4003,11 +4003,11 @@ public enum Material implements Keyed {
}
/**
- * Do not use for any reason.
+ * Checks if this constant is a legacy material.
*
* @return legacy status
*/
- @Deprecated
+ // @Deprecated // Paper - this is useful, don't deprecate
public boolean isLegacy() {
return legacy;
}
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index 01bcb3a1bdb5accdf844d0178cec3d25746b3eaa..236c9aea9ffc36269e5c32eacc9f1fd6bd039c88 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java
@@ -39,12 +39,14 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key, com.des
/**
* Create a key in a specific namespace.
+ * <p>
+ * For most plugin related code, you should prefer using the
+ * {@link NamespacedKey#NamespacedKey(Plugin, String)} constructor.
*
* @param namespace namespace
* @param key key
- * @deprecated should never be used by plugins, for internal use only!!
+ * @see #NamespacedKey(Plugin, String)
*/
- @Deprecated
public NamespacedKey(@NotNull String namespace, @NotNull String key) {
Preconditions.checkArgument(namespace != null && VALID_NAMESPACE.matcher(namespace).matches(), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace);
Preconditions.checkArgument(key != null && VALID_KEY.matcher(key).matches(), "Invalid key. Must be [a-z0-9/._-]: %s", key);
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 28be40d6844f801c26e8359e509afc5e3dedd71f..cd2cfaf24c794bb0c64cd613d933b6fba92ed723 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -1445,7 +1445,7 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*
* @return the scoreboard manager or null if no worlds are loaded.
*/
- @Nullable
+ @NotNull // Paper
ScoreboardManager getScoreboardManager();
/**
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index f36eb8896ee84c1d3bbce17b11ed05c5f99f2e29..b8c4d25d49ea65d36b052faba8863efa813d9bc5 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -427,9 +427,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
* @param z Z-coordinate of the chunk
* @return Whether the chunk was actually refreshed
*
- * @deprecated This method is not guaranteed to work suitably across all client implementations.
*/
- @Deprecated
+ //@Deprecated // Paper
public boolean refreshChunk(int x, int z);
/**
diff --git a/src/main/java/org/bukkit/entity/LingeringPotion.java b/src/main/java/org/bukkit/entity/LingeringPotion.java
index f124b35ec76e6cb6a1a0dc464005087043c3efd0..94a2fef0dc9e13c754cd31d5eabc1bde2dbbe6a5 100644
--- a/src/main/java/org/bukkit/entity/LingeringPotion.java
+++ b/src/main/java/org/bukkit/entity/LingeringPotion.java
@@ -5,4 +5,5 @@ package org.bukkit.entity;
*
* @deprecated lingering status depends on only on the potion item.
*/
+@Deprecated // Paper
public interface LingeringPotion extends ThrownPotion { }
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 98b856d068c765a277d1e218a04e05588e18fdcb..2c3aba0b8d89d74bfa22ae01232712c8e3516b6b 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1356,9 +1356,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param plugin Plugin that wants to hide the entity
* @param entity Entity to hide
- * @deprecated draft API
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
public void hideEntity(@NotNull Plugin plugin, @NotNull Entity entity);
/**
@@ -1368,9 +1367,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param plugin Plugin that wants to show the entity
* @param entity Entity to show
- * @deprecated draft API
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
public void showEntity(@NotNull Plugin plugin, @NotNull Entity entity);
/**
@@ -1379,9 +1377,8 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param entity Entity to check
* @return True if the provided entity is not being hidden from this
* player
- * @deprecated draft API
*/
- @Deprecated
+ @org.jetbrains.annotations.ApiStatus.Experimental // Paper
public boolean canSee(@NotNull Entity entity);
/**
diff --git a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
index 2ff1b1308571d8f8056d3359e8a8ba4a589c3726..8eb6f4090578d9e1b12aff813840108fdeece730 100644
--- a/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
+++ b/src/main/java/org/bukkit/event/enchantment/PrepareItemEnchantEvent.java
@@ -23,7 +23,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
private boolean cancelled;
private final Player enchanter;
- public PrepareItemEnchantEvent(@NotNull final Player enchanter, @NotNull InventoryView view, @NotNull final Block table, @NotNull final ItemStack item, @NotNull final EnchantmentOffer[] offers, final int bonus) {
+ public PrepareItemEnchantEvent(@NotNull final Player enchanter, @NotNull InventoryView view, @NotNull final Block table, @NotNull final ItemStack item, @org.jetbrains.annotations.Nullable final EnchantmentOffer @NotNull [] offers, final int bonus) { // Paper - offers can contain null values
super(view);
this.enchanter = enchanter;
this.table = table;
@@ -68,6 +68,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
* @return experience level costs offered
* @deprecated Use {@link #getOffers()} instead of this method
*/
+ @Deprecated // Paper
@NotNull
public int[] getExpLevelCostsOffered() {
int[] levelOffers = new int[offers.length];
@@ -85,8 +86,7 @@ public class PrepareItemEnchantEvent extends InventoryEvent implements Cancellab
*
* @return list of available enchantment offers
*/
- @NotNull
- public EnchantmentOffer[] getOffers() {
+ public @org.jetbrains.annotations.Nullable EnchantmentOffer @NotNull [] getOffers() { // Paper offers can contain null values
return offers;
}
diff --git a/src/main/java/org/bukkit/event/player/PlayerHideEntityEvent.java b/src/main/java/org/bukkit/event/player/PlayerHideEntityEvent.java
index d8a73cd22268e90eb438f522b9019f826f343275..78869fdb9cf4c541dff7d67b51866914987abf18 100644
--- a/src/main/java/org/bukkit/event/player/PlayerHideEntityEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerHideEntityEvent.java
@@ -15,9 +15,8 @@ import org.jetbrains.annotations.NotNull;
* This event is called regardless of if the entity was within tracking range.
*
* @see Player#hideEntity(org.bukkit.plugin.Plugin, org.bukkit.entity.Entity)
- * @deprecated draft API
*/
-@Deprecated
+@org.jetbrains.annotations.ApiStatus.Experimental // Paper
@Warning(false)
public class PlayerHideEntityEvent extends PlayerEvent {
diff --git a/src/main/java/org/bukkit/event/player/PlayerShowEntityEvent.java b/src/main/java/org/bukkit/event/player/PlayerShowEntityEvent.java
index 5408a8c123942a56ef11597ae6cdb77e14f741e3..29bb84145be18ef9162abdfc8820f2b3f7fd0db5 100644
--- a/src/main/java/org/bukkit/event/player/PlayerShowEntityEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerShowEntityEvent.java
@@ -16,9 +16,8 @@ import org.jetbrains.annotations.NotNull;
* range.
*
* @see Player#showEntity(org.bukkit.plugin.Plugin, org.bukkit.entity.Entity)
- * @deprecated draft API
*/
-@Deprecated
+@org.jetbrains.annotations.ApiStatus.Experimental // Paper
@Warning(false)
public class PlayerShowEntityEvent extends PlayerEvent {
diff --git a/src/main/java/org/bukkit/inventory/CraftingInventory.java b/src/main/java/org/bukkit/inventory/CraftingInventory.java
index df81bac9ecff697f98941e5c8490e10391e90090..a32977ba3ba60a1c9aee6e469d5d6cd1887c55a2 100644
--- a/src/main/java/org/bukkit/inventory/CraftingInventory.java
+++ b/src/main/java/org/bukkit/inventory/CraftingInventory.java
@@ -21,8 +21,7 @@ public interface CraftingInventory extends Inventory {
*
* @return The contents. Individual entries may be null.
*/
- @NotNull
- ItemStack[] getMatrix();
+ @Nullable ItemStack @NotNull [] getMatrix(); // Paper - make array elements nullable instead array
/**
* Set the item in the result slot of the crafting inventory.
@@ -38,7 +37,7 @@ public interface CraftingInventory extends Inventory {
* @throws IllegalArgumentException if the length of contents is greater
* than the size of the crafting matrix.
*/
- void setMatrix(@NotNull ItemStack[] contents);
+ void setMatrix(@Nullable ItemStack @NotNull [] contents); // Paper - make array elements nullable instead array
/**
* Get the current recipe formed on the crafting inventory, if any.
diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java
index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..875c401153349b0f2468525e54cf10ca86430087 100644
--- a/src/main/java/org/bukkit/inventory/Inventory.java
+++ b/src/main/java/org/bukkit/inventory/Inventory.java
@@ -158,8 +158,7 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @return An array of ItemStacks from the inventory. Individual items may be null.
*/
- @NotNull
- public ItemStack[] getContents();
+ public @Nullable ItemStack @NotNull [] getContents(); // Paper - make array elements nullable instead array
/**
* Completely replaces the inventory's contents. Removes all existing
@@ -170,7 +169,7 @@ public interface Inventory extends Iterable<ItemStack> {
* @throws IllegalArgumentException If the array has more items than the
* inventory.
*/
- public void setContents(@NotNull ItemStack[] items) throws IllegalArgumentException;
+ public void setContents(@Nullable ItemStack @NotNull [] items) throws IllegalArgumentException; // Paper - make array elements nullable instead array
/**
* Return the contents from the section of the inventory where items can
@@ -183,8 +182,7 @@ public interface Inventory extends Iterable<ItemStack> {
*
* @return inventory storage contents. Individual items may be null.
*/
- @NotNull
- public ItemStack[] getStorageContents();
+ public @Nullable ItemStack @NotNull [] getStorageContents(); // Paper - make array elements nullable instead array
/**
* Put the given ItemStacks into the storage slots
@@ -193,7 +191,7 @@ public interface Inventory extends Iterable<ItemStack> {
* @throws IllegalArgumentException If the array has more items than the
* inventory.
*/
- public void setStorageContents(@NotNull ItemStack[] items) throws IllegalArgumentException;
+ public void setStorageContents(@Nullable ItemStack @NotNull [] items) throws IllegalArgumentException; // Paper - make array elements nullable instead array
/**
* Checks if the inventory contains any ItemStacks with the given
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 66ffc658dba85942f179760dc6c50258e24ab903..50fe28b48d885c782278bdb53a0bbae303f4a32d 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -26,7 +26,7 @@ public interface ItemFactory {
* @return a new ItemMeta that could be applied to an item stack of the
* specified material
*/
- @Nullable
+ @org.bukkit.UndefinedNullability // Paper
ItemMeta getItemMeta(@NotNull final Material material);
/**
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 487e6a6391123a4792c3bdeba869aa2bcb5922cc..3dd8205dd070901be82c2bef390df5df58b2a9a0 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -8,6 +8,7 @@ import java.util.Set; // Paper
import org.apache.commons.lang.Validate;
import org.bukkit.Bukkit;
import org.bukkit.Material;
+import org.bukkit.UndefinedNullability;
import org.bukkit.Utility;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
import org.bukkit.enchantments.Enchantment;
@@ -68,6 +69,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
* @param damage durability / damage
* @deprecated see {@link #setDurability(short)}
*/
+ @Deprecated // Paper
public ItemStack(@NotNull final Material type, final int amount, final short damage) {
this(type, amount, damage, null);
}
@@ -546,7 +548,7 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, net.kyor
*
* @return a copy of the current ItemStack's ItemData
*/
- @Nullable
+ @UndefinedNullability // Paper
public ItemMeta getItemMeta() {
return this.meta == null ? Bukkit.getItemFactory().getItemMeta(this.type) : this.meta.clone();
}
diff --git a/src/main/java/org/bukkit/inventory/PlayerInventory.java b/src/main/java/org/bukkit/inventory/PlayerInventory.java
index 62fbd7f6d8195bebcab7f704a0a485a1bbeca26c..8b5385e39f64c4df8e235a8832d91e55642421ce 100644
--- a/src/main/java/org/bukkit/inventory/PlayerInventory.java
+++ b/src/main/java/org/bukkit/inventory/PlayerInventory.java
@@ -14,8 +14,7 @@ public interface PlayerInventory extends Inventory {
*
* @return All the ItemStacks from the armor slots. Individual items can be null.
*/
- @NotNull
- public ItemStack[] getArmorContents();
+ public @Nullable ItemStack @NotNull [] getArmorContents(); // Paper - make array elements nullable instead array
/**
* Get all additional ItemStacks stored in this inventory.
@@ -26,8 +25,7 @@ public interface PlayerInventory extends Inventory {
*
* @return All additional ItemStacks. Individual items can be null.
*/
- @NotNull
- public ItemStack[] getExtraContents();
+ public @Nullable ItemStack @NotNull [] getExtraContents(); // Paper - make array elements nullable instead array
/**
* Return the ItemStack from the helmet slot
@@ -104,9 +102,9 @@ public interface PlayerInventory extends Inventory {
*
* @param slot the slot to get the ItemStack
*
- * @return the ItemStack in the given slot or null if there is not one
+ * @return the ItemStack in the given slot
*/
- @Nullable
+ @NotNull // Paper
public ItemStack getItem(@NotNull EquipmentSlot slot);
/**
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 45baebc97f0aec8abc9a894bc135e4767d7c9e35..a761b8369e1f78b28146b0a4cce121e507d4a738 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -74,8 +74,10 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
/**
* Checks for existence of a localized name.
*
+ * @deprecated Use {@link ItemMeta#displayName()} and check if it is instanceof a {@link net.kyori.adventure.text.TranslatableComponent}.
* @return true if this has a localized name
*/
+ @Deprecated // Paper - Deprecate old localized API
boolean hasLocalizedName();
/**
@@ -84,16 +86,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Plugins should check that hasLocalizedName() returns <code>true</code>
* before calling this method.
*
+ * @deprecated Use {@link ItemMeta#displayName()} and cast it to a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
* @return the localized name that is set
*/
+ @Deprecated // Paper - Deprecate old localized API
@NotNull
String getLocalizedName();
/**
* Sets the localized name.
*
+ * @deprecated Use {@link ItemMeta#displayName(Component)} with a {@link net.kyori.adventure.text.TranslatableComponent}. No longer used by the client.
* @param name the name to set
*/
+ @Deprecated // Paper - Deprecate old localized API
void setLocalizedName(@Nullable String name);
/**
diff --git a/src/main/java/org/bukkit/material/Step.java b/src/main/java/org/bukkit/material/Step.java
index 9f502e7ee05d0512e190a1722cc112ece068c4e2..10c0465cf58d680bfa9a0f9233f94e8b6d5a9b93 100644
--- a/src/main/java/org/bukkit/material/Step.java
+++ b/src/main/java/org/bukkit/material/Step.java
@@ -78,6 +78,7 @@ public class Step extends TexturedMaterial {
*
* @deprecated Magic value
*/
+ @Deprecated // Paper
@Override
protected int getTextureIndex() {
return getData() & 0x7;
Loaded 100 of 1257 files, more files were not shown because too many files have changed in this diff. Show more