Updated Upstream (Bukkit/CraftBukkit/Spigot) (#9861)

This commit is contained in:
Jake Potrebic 2023-10-26 14:56:40 -07:00 committed by GitHub
parent c1ac98328c
commit acc6d012b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 409 additions and 299 deletions

View file

@ -1091,10 +1091,10 @@ index b79daa857fc686f00ac06b8851e0ab68d83ae949..45d996878ba8d314a47078589b6da59d
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 c559f38fdb92cfee9f2e0ffb7088d1cf74a7f73d..a42f1d53340e4073038d46b7fabf5d44248d5b32 100644
index ae7b51341fb66c41b8a7c4604fd273d876e311be..4034fcb9abc39b12f0de47c4b679f2ef82353c89 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.Nullable;
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable;
* underscores, hyphens, and forward slashes.
*
*/
@ -1103,7 +1103,7 @@ index c559f38fdb92cfee9f2e0ffb7088d1cf74a7f73d..a42f1d53340e4073038d46b7fabf5d44
/**
* The namespace representing all inbuilt keys.
@@ -129,10 +129,11 @@ public final class NamespacedKey {
@@ -130,10 +130,11 @@ public final class NamespacedKey {
@Override
public int hashCode() {
@ -1119,7 +1119,7 @@ index c559f38fdb92cfee9f2e0ffb7088d1cf74a7f73d..a42f1d53340e4073038d46b7fabf5d44
}
@Override
@@ -140,11 +141,10 @@ public final class NamespacedKey {
@@ -141,11 +142,10 @@ public final class NamespacedKey {
if (obj == null) {
return false;
}
@ -1135,7 +1135,7 @@ index c559f38fdb92cfee9f2e0ffb7088d1cf74a7f73d..a42f1d53340e4073038d46b7fabf5d44
}
@Override
@@ -246,4 +246,24 @@ public final class NamespacedKey {
@@ -247,4 +247,24 @@ public final class NamespacedKey {
public static NamespacedKey fromString(@NotNull String key) {
return fromString(key, null);
}
@ -4007,10 +4007,10 @@ index e12996492c1558fed9fab30de9f8018e0ed7fac3..002acfbdce1db10f7ba1b6a013e678f5
/**
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index a66bec33fffd4e11d859efd8d17d274a5fa75f69..9578d6b0fa54feac75fa9a0727d878bd13b9e19e 100644
index 502a1fd398fb0dcfbaf82081a655e2efc3bf71dc..30770d03044da684aa8c79ca74796050c319f6be 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -171,4 +171,24 @@ public interface ItemFactory {
@@ -172,4 +172,24 @@ public interface ItemFactory {
*/
@Nullable
Material getSpawnEgg(@NotNull EntityType type);
@ -4317,10 +4317,10 @@ index 94852d50e88d0594b84b581cd627174043629995..be7c2cfc757e4dd15927be850739d401
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 2fbb0b7640dd9b9b0e70d4bc60fbb0310d5ec250..049c70c935fd7a781280d223f74bbbf87223f505 100644
index 8ca9605fc1193de9277407f02f755d81190472a4..d7fab2b856f6dfec4f9225c1bdb4254b238d98a4 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
@@ -32,6 +32,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasDisplayName();
@ -4345,7 +4345,7 @@ index 2fbb0b7640dd9b9b0e70d4bc60fbb0310d5ec250..049c70c935fd7a781280d223f74bbbf8
/**
* Gets the display name that is set.
* <p>
@@ -38,7 +56,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -39,7 +57,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* before calling this method.
*
* @return the display name that is set
@ -4355,7 +4355,7 @@ index 2fbb0b7640dd9b9b0e70d4bc60fbb0310d5ec250..049c70c935fd7a781280d223f74bbbf8
@NotNull
String getDisplayName();
@@ -46,7 +66,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -47,7 +67,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Sets the display name.
*
* @param name the name to set
@ -4365,7 +4365,7 @@ index 2fbb0b7640dd9b9b0e70d4bc60fbb0310d5ec250..049c70c935fd7a781280d223f74bbbf8
void setDisplayName(@Nullable String name);
/**
@@ -81,6 +103,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -82,6 +104,24 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
*/
boolean hasLore();
@ -4390,7 +4390,7 @@ index 2fbb0b7640dd9b9b0e70d4bc60fbb0310d5ec250..049c70c935fd7a781280d223f74bbbf8
/**
* Gets the lore that is set.
* <p>
@@ -88,7 +128,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -89,7 +129,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* calling this method.
*
* @return a list of lore that is set
@ -4400,7 +4400,7 @@ index 2fbb0b7640dd9b9b0e70d4bc60fbb0310d5ec250..049c70c935fd7a781280d223f74bbbf8
@Nullable
List<String> getLore();
@@ -97,7 +139,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -98,7 +140,9 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Removes lore when given null.
*
* @param lore the lore that will be set

View file

@ -1449,10 +1449,10 @@ index 94f8ceb965cecb5669a84a0ec61c0f706c2a2673..e773db6da357ad210eb24d4c389af2dc
}
}
diff --git a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
index 539df5665a7cc1406a358fc435e36365b9c14068..32986df9a9854e561a77eefab99c934efbcb5aac 100644
index f48bdeb628a82416d93f84a0a10141447482bf83..c0691a849831f99268fdcb7b0f471f80a1a2a70e 100644
--- a/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
+++ b/src/main/java/org/bukkit/plugin/PluginDescriptionFile.java
@@ -197,7 +197,7 @@ import org.yaml.snakeyaml.representer.Representer;
@@ -198,7 +198,7 @@ import org.yaml.snakeyaml.representer.Representer;
* inferno.burningdeaths: true
*</pre></blockquote>
*/
@ -1461,7 +1461,7 @@ index 539df5665a7cc1406a358fc435e36365b9c14068..32986df9a9854e561a77eefab99c934e
private static final Pattern VALID_NAME = Pattern.compile("^[A-Za-z0-9 _.-]+$");
private static final ThreadLocal<Yaml> YAML = new ThreadLocal<Yaml>() {
@Override
@@ -258,6 +258,70 @@ public final class PluginDescriptionFile {
@@ -259,6 +259,70 @@ public final class PluginDescriptionFile {
private Set<PluginAwareness> awareness = ImmutableSet.of();
private String apiVersion = null;
private List<String> libraries = ImmutableList.of();
@ -2088,10 +2088,10 @@ index 6d634b0ea813ccb19f1562a7d0e5a59cea4eab21..e4b6f278a811acbb0070e311c5c3bdaf
}
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fdadf45bdc 100644
index 64a294aeb6fb548794708b38c3707f9dd882b2ff..74b6581a97a092c44a0876e7981ff8a8e6153100 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;
@@ -31,7 +31,8 @@ import org.jetbrains.annotations.Nullable;
/**
* A ClassLoader for plugins, to allow shared classes across multiple plugins
*/
@ -2101,7 +2101,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
private final JavaPluginLoader loader;
private final Map<String, Class<?>> classes = new ConcurrentHashMap<String, Class<?>>();
private final PluginDescriptionFile description;
@@ -43,24 +44,32 @@ final class PluginClassLoader extends URLClassLoader {
@@ -45,24 +46,32 @@ final class PluginClassLoader extends URLClassLoader {
private JavaPlugin pluginInit;
private IllegalStateException pluginState;
private final Set<String> seenIllegalAccess = Collections.newSetFromMap(new ConcurrentHashMap<>());
@ -2130,15 +2130,15 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
this.url = file.toURI().toURL();
this.libraryLoader = libraryLoader;
+
+ // Paper start
+ this.dependencyContext = dependencyContext;
+ this.classLoaderGroup = io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage.instance().registerSpigotGroup(this);
+ // Paper end
+
Class<?> jarClass;
try {
Class<?> jarClass;
try {
@@ -94,6 +103,27 @@ final class PluginClassLoader extends URLClassLoader {
jarClass = Class.forName(description.getMain(), true, this);
@@ -107,6 +116,27 @@ final class PluginClassLoader extends URLClassLoader {
return findResources(name);
}
@ -2166,7 +2166,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
@Override
protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
return loadClass0(name, resolve, true, true);
@@ -119,26 +149,11 @@ final class PluginClassLoader extends URLClassLoader {
@@ -132,26 +162,11 @@ final class PluginClassLoader extends URLClassLoader {
if (checkGlobal) {
// This ignores the libraries of other plugins, unless they are transitive dependencies.
@ -2195,7 +2195,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
return result;
}
@@ -167,7 +182,7 @@ final class PluginClassLoader extends URLClassLoader {
@@ -180,7 +195,7 @@ final class PluginClassLoader extends URLClassLoader {
throw new ClassNotFoundException(name, ex);
}
@ -2204,7 +2204,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
int dot = name.lastIndexOf('.');
if (dot != -1) {
@@ -197,8 +212,8 @@ final class PluginClassLoader extends URLClassLoader {
@@ -210,8 +225,8 @@ final class PluginClassLoader extends URLClassLoader {
result = super.findClass(name);
}
@ -2214,7 +2214,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
}
return result;
@@ -207,6 +222,12 @@ final class PluginClassLoader extends URLClassLoader {
@@ -220,6 +235,12 @@ final class PluginClassLoader extends URLClassLoader {
@Override
public void close() throws IOException {
try {
@ -2227,7 +2227,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
super.close();
} finally {
jar.close();
@@ -218,7 +239,7 @@ final class PluginClassLoader extends URLClassLoader {
@@ -231,7 +252,7 @@ final class PluginClassLoader extends URLClassLoader {
return classes.values();
}
@ -2236,7 +2236,7 @@ index 2f74ec96ece706de23156ebabfe493211bc05391..302319acbc257a075adfb78d9f5c49fd
Preconditions.checkArgument(javaPlugin != null, "Initializing plugin cannot be null");
Preconditions.checkArgument(javaPlugin.getClass().getClassLoader() == this, "Cannot initialize plugin outside of this class loader");
if (this.plugin != null || this.pluginInit != null) {
@@ -228,6 +249,38 @@ final class PluginClassLoader extends URLClassLoader {
@@ -241,6 +262,38 @@ final class PluginClassLoader extends URLClassLoader {
pluginState = new IllegalStateException("Initial initialization");
this.pluginInit = javaPlugin;

View file

@ -74,25 +74,6 @@ index 0cf808356a1a5c6fc4bcf97a694ed9beb80a776a..dc765dea47a9a1c1520fb16ddb24f814
* @param z Z-coordinate (0-15)
* @return temperature at given coordinate
*/
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 73b782c3975ad13159b6236976783fcfabd20493..e9cbbdf310e48011ee538c5592baee2535965fee 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -120,8 +120,14 @@ public enum Particle {
SCRAPE,
SONIC_BOOM,
SCULK_SOUL,
+ /**
+ * Uses {@link Float} as DataType, representing the angle the particle displays at in radians
+ */
SCULK_CHARGE(Float.class),
SCULK_CHARGE_POP,
+ /**
+ * Uses {@link Integer} as DataType, representing the delay in ticks until the particle shows up
+ */
SHRIEK(Integer.class),
CHERRY_LEAVES,
EGG_CRACK,
diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java
index 02de62c083ceaa466c80cb732e8304b8cc3f07f8..7c2b1eff41dd43fda84d84e76c05bbbf37c186b8 100644
--- a/src/main/java/org/bukkit/RegionAccessor.java
@ -1222,10 +1203,10 @@ index 07c3dff4d6190ef388d9c1e1c36f67f00a3e8e66..597a18a767b68b47e81454b7d44613c7
* @param input The input choice.
* @return The changed recipe, so you can chain calls.
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 049c70c935fd7a781280d223f74bbbf87223f505..f78714c2a6d9da162c9802552984cbfad76ff728 100644
index d7fab2b856f6dfec4f9225c1bdb4254b238d98a4..9d40e6a5ce7adc377934cfc5ce663b5d9cb2e4dc 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -305,7 +305,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -306,7 +306,7 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
/**
* Return an immutable copy of all {@link Attribute}s and their
* {@link AttributeModifier}s for a given {@link EquipmentSlot}.<br>

View file

@ -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 9578d6b0fa54feac75fa9a0727d878bd13b9e19e..a6795b102c9678b122dfd3b36d02783b9e108b48 100644
index 30770d03044da684aa8c79ca74796050c319f6be..f0025ba978f4bdf1e6bab7d30466fc950bb2a13b 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -191,4 +191,20 @@ public interface ItemFactory {
@@ -192,4 +192,20 @@ public interface ItemFactory {
@NotNull
net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack);
// Paper end - Adventure

View file

@ -7,10 +7,10 @@ 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 a6795b102c9678b122dfd3b36d02783b9e108b48..74cd662d0594f2fbc5aa30ba64d9e4928145dbb9 100644
index f0025ba978f4bdf1e6bab7d30466fc950bb2a13b..d641a8293f3acd465d5fdde8507046647cb6c568 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -207,4 +207,18 @@ public interface ItemFactory {
@@ -208,4 +208,18 @@ public interface ItemFactory {
@Deprecated
String getI18NDisplayName(@Nullable ItemStack item);
// Paper end - add getI18NDisplayName

View file

@ -93,19 +93,18 @@ index 7cd9f98c042dc2bb80876af35c755f81bef34651..5cd236965de12392d8c7aa81307c0ff1
/**
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index 302319acbc257a075adfb78d9f5c49fdadf45bdc..a8ac1fb22a6fba50d69bf726b49c49ba190ab79a 100644
index 74b6581a97a092c44a0876e7981ff8a8e6153100..d6d3e1332e51adc5611543b2a6689efa5921a9f2 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -65,7 +65,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -67,6 +67,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
this.url = file.toURI().toURL();
this.libraryLoader = libraryLoader;
-
+ this.logger = com.destroystokyo.paper.utils.PaperPluginLogger.getLogger(description); // Paper - Register logger early
// Paper start
this.dependencyContext = dependencyContext;
this.classLoaderGroup = io.papermc.paper.plugin.provider.classloader.PaperClassLoaderStorage.instance().registerSpigotGroup(this);
@@ -249,7 +249,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -262,7 +263,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
pluginState = new IllegalStateException("Initial initialization");
this.pluginInit = javaPlugin;

View file

@ -500,11 +500,11 @@ index 0000000000000000000000000000000000000000..f45b8cfd1611345e8d81ecb8297a586f
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index e9cbbdf310e48011ee538c5592baee2535965fee..dbedaf6a92681bc32d74f067cd4686c8b609d568 100644
index e2adb9901cc92ede9d44ca9939c6a54d4762eb4b..81bd12c8addcee754c71e5e030c729c7e096fb4c 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -168,6 +168,17 @@ public enum Particle {
return dataType;
@@ -194,6 +194,18 @@ public enum Particle implements Keyed {
return key;
}
+ // Paper start - Particle API expansion
@ -518,6 +518,7 @@ index e9cbbdf310e48011ee538c5592baee2535965fee..dbedaf6a92681bc32d74f067cd4686c8
+ return new com.destroystokyo.paper.ParticleBuilder(this);
+ }
+ // Paper end
+
/**
* Options which can be applied to redstone dust particles - a particle
* color and size.

View file

@ -199,10 +199,10 @@ index 0000000000000000000000000000000000000000..28f3fda950999a9c964a3608042ca605
+ }
+}
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index a42f1d53340e4073038d46b7fabf5d44248d5b32..dbc22807a33606f8fe326cc2f5f755fee5edc7aa 100644
index 4034fcb9abc39b12f0de47c4b679f2ef82353c89..6fa219aef009f8dfb8a2b1e5ee0603b18cf3d0f5 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java
@@ -18,7 +18,7 @@ import org.jetbrains.annotations.Nullable;
@@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable;
* underscores, hyphens, and forward slashes.
*
*/
@ -211,7 +211,7 @@ index a42f1d53340e4073038d46b7fabf5d44248d5b32..dbc22807a33606f8fe326cc2f5f755fe
/**
* The namespace representing all inbuilt keys.
@@ -118,11 +118,13 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key { // Pap
@@ -119,11 +119,13 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key { // Pap
}
@NotNull
@ -226,10 +226,10 @@ index a42f1d53340e4073038d46b7fabf5d44248d5b32..dbc22807a33606f8fe326cc2f5f755fe
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 f78714c2a6d9da162c9802552984cbfad76ff728..55e9dc5d1d87fbc9d0dabbb7bd59584fe2c5f379 100644
index 9d40e6a5ce7adc377934cfc5ce663b5d9cb2e4dc..46ac120ed51274a2084719387e35e517981bbf4b 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
@@ -445,4 +445,87 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@SuppressWarnings("javadoc")
@NotNull
ItemMeta clone();

View file

@ -119,10 +119,10 @@ index d56d899ca7737b537ea55c13a384888a873f5da3..cbec3b145a44ceee20823ae0e9c8162b
Preconditions.checkArgument(legacy, "Cannot get data class of Modern Material");
return ctor.getDeclaringClass();
diff --git a/src/main/java/org/bukkit/NamespacedKey.java b/src/main/java/org/bukkit/NamespacedKey.java
index dbc22807a33606f8fe326cc2f5f755fee5edc7aa..1416918d1924b362a688635823484f16e6adf125 100644
index 6fa219aef009f8dfb8a2b1e5ee0603b18cf3d0f5..8ac72cb0b05e2c493d98310f2e87c3714d15c5e3 100644
--- a/src/main/java/org/bukkit/NamespacedKey.java
+++ b/src/main/java/org/bukkit/NamespacedKey.java
@@ -73,12 +73,14 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key, com.des
@@ -74,12 +74,14 @@ public final class NamespacedKey implements net.kyori.adventure.key.Key, com.des
/**
* Create a key in a specific namespace.
@ -132,10 +132,10 @@ index dbc22807a33606f8fe326cc2f5f755fee5edc7aa..1416918d1924b362a688635823484f16
*
* @param namespace namespace
* @param key key
- * @deprecated should never be used by plugins, for internal use only!!
- * @apiNote should never be used by plugins, for internal use only!!
+ * @see #NamespacedKey(Plugin, String)
*/
- @Deprecated
- @ApiStatus.Internal
public NamespacedKey(@NotNull String namespace, @NotNull String key) {
Preconditions.checkArgument(namespace != null && isValidNamespace(namespace), "Invalid namespace. Must be [a-z0-9._-]: %s", namespace);
Preconditions.checkArgument(key != null && isValidKey(key), "Invalid key. Must be [a-z0-9/._-]: %s", key);
@ -155,11 +155,47 @@ index f43209cf7b752c26718c303ca8c3e1c7d9912ad3..f0094e6fb05e526736629ad3181c8d2c
public enum NetherWartsState {
/**
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 81bd12c8addcee754c71e5e030c729c7e096fb4c..6992600d6cff9ed0a30d37ac4dc5dc0e56ecb2c7 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -54,7 +54,9 @@ public enum Particle implements Keyed {
BLOCK_CRACK("block", BlockData.class),
/**
* Uses {@link BlockData} as DataType
+ * @deprecated use {@link #BLOCK_CRACK}
*/
+ @Deprecated // Paper
BLOCK_DUST("block", BlockData.class, false),
WATER_DROP("rain"),
MOB_APPEARANCE("elder_guardian"),
@@ -138,15 +140,21 @@ public enum Particle implements Keyed {
// ----- Legacy Separator -----
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_BLOCK_CRACK(null, MaterialData.class, false),
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_BLOCK_DUST(null, MaterialData.class, false),
/**
* Uses {@link MaterialData} as DataType
+ * @deprecated {@link MaterialData} is deprecated API
*/
+ @Deprecated // Paper
LEGACY_FALLING_DUST(null, MaterialData.class, false);
private final NamespacedKey key;
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index f79f4f20ee9f1f2ca3d12984064fc7fe57a932ba..82a206bd3000bc8d601c6e7c0bd078b4bb7e962f 100644
index c373614a865d6df8a2fe265497cf0b5f074490b0..8e0f985e8a6af728376a85eef998f7881e50786c 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -191,14 +191,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -197,14 +197,14 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @see TrimMaterial
*/
@ -176,7 +212,7 @@ index f79f4f20ee9f1f2ca3d12984064fc7fe57a932ba..82a206bd3000bc8d601c6e7c0bd078b4
Registry<TrimPattern> TRIM_PATTERN = Bukkit.getRegistry(TrimPattern.class);
/**
* Villager profession.
@@ -280,8 +280,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -286,8 +286,11 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*
* @param input non-null input
* @return registered object or null if does not exist
@ -937,10 +973,10 @@ index 002acfbdce1db10f7ba1b6a013e678f504ac6e69..aac9180fa3bcbdb0c17dcf96c86647b5
return getPlayer().getItemOnCursor();
}
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 74cd662d0594f2fbc5aa30ba64d9e4928145dbb9..856751439b6599943d85203a59efd691ddbd89e9 100644
index d641a8293f3acd465d5fdde8507046647cb6c568..74aa058e0dee7ae858a2a1d0a48e3bb9093a53ea 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -27,7 +27,7 @@ public interface ItemFactory {
@@ -28,7 +28,7 @@ public interface ItemFactory {
* @return a new ItemMeta that could be applied to an item stack of the
* specified material
*/
@ -1146,10 +1182,10 @@ index 5ccae862dbac393805a47fe26c18a2f33f1e140d..72281899817c5c140cdca2afff75fbce
@Override
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 55e9dc5d1d87fbc9d0dabbb7bd59584fe2c5f379..5c1ca0e47f0ac1525c3d37b55f52874878f44c28 100644
index 46ac120ed51274a2084719387e35e517981bbf4b..420a91a834016d3af95efd79ca92ae45c4f081c4 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
@@ -75,8 +75,10 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
/**
* Checks for existence of a localized name.
*
@ -1160,7 +1196,7 @@ index 55e9dc5d1d87fbc9d0dabbb7bd59584fe2c5f379..5c1ca0e47f0ac1525c3d37b55f528748
boolean hasLocalizedName();
/**
@@ -84,16 +86,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -85,16 +87,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
* Plugins should check that hasLocalizedName() returns <code>true</code>
* before calling this method.
*

View file

@ -5,7 +5,7 @@ Subject: [PATCH] Support components in ItemMeta
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 5c1ca0e47f0ac1525c3d37b55f52874878f44c28..e33ec3eaa1cd520db8224250e886e6240fefe76f 100644
index 420a91a834016d3af95efd79ca92ae45c4f081c4..ea64d5b1ebaa652785ddbc7b515808174f636a62 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -5,6 +5,7 @@ import java.util.Collection;
@ -16,7 +16,7 @@ index 5c1ca0e47f0ac1525c3d37b55f52874878f44c28..e33ec3eaa1cd520db8224250e886e624
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.configuration.serialization.ConfigurationSerializable;
@@ -62,6 +63,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -63,6 +64,20 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@NotNull
String getDisplayName();
@ -37,7 +37,7 @@ index 5c1ca0e47f0ac1525c3d37b55f52874878f44c28..e33ec3eaa1cd520db8224250e886e624
/**
* Sets the display name.
*
@@ -71,6 +86,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -72,6 +87,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@Deprecated // Paper
void setDisplayName(@Nullable String name);
@ -54,7 +54,7 @@ index 5c1ca0e47f0ac1525c3d37b55f52874878f44c28..e33ec3eaa1cd520db8224250e886e624
/**
* Checks for existence of a localized name.
*
@@ -140,6 +165,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -141,6 +166,19 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@Nullable
List<String> getLore();
@ -74,7 +74,7 @@ index 5c1ca0e47f0ac1525c3d37b55f52874878f44c28..e33ec3eaa1cd520db8224250e886e624
/**
* Sets the lore for this item.
* Removes lore when given null.
@@ -150,6 +188,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@@ -151,6 +189,16 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable, Persiste
@Deprecated // Paper
void setLore(@Nullable List<String> lore);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 856751439b6599943d85203a59efd691ddbd89e9..77ca38e5edda55daf67ab8af9afd633efb4000b1 100644
index 74aa058e0dee7ae858a2a1d0a48e3bb9093a53ea..9045746aa3077c536173d4ac826e0bf49e732b32 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -221,4 +221,65 @@ public interface ItemFactory {
@@ -222,4 +222,65 @@ public interface ItemFactory {
@NotNull
ItemStack ensureServerConversions(@NotNull ItemStack item);
// Paper end - ensure server conversions API

View file

@ -505,10 +505,10 @@ index 0000000000000000000000000000000000000000..1e7b53f9bc13dcd5a0a4a40004591e4f
+ }
+}
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 82a206bd3000bc8d601c6e7c0bd078b4bb7e962f..3818f940b98488bd1068d941cfbbac3721677c7a 100644
index 8e0f985e8a6af728376a85eef998f7881e50786c..469ef0a9241fddbd869ac2c0662c98b3022cc8aa 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -255,6 +255,17 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -261,6 +261,17 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
* @see GameEvent
*/
Registry<GameEvent> GAME_EVENT = Objects.requireNonNull(Bukkit.getRegistry(GameEvent.class), "No registry present for GameEvent. This is a bug.");

View file

@ -93,10 +93,10 @@ index 96b66f4f6fb8637ab3ad275ddd980d5b71711a6c..27d5f37a9b2da92307e5b505e3b31cca
// Paper end
}
diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java
index f9fa287d25a0243de8d8d7b0d13144ce919750b0..29f0bb4d5bb1d5ef1b6bd64726ca84c25091f9e4 100644
index 27537aeabd3bd1b5383e6ecf775aa89e033aa2bc..afc0ce2eaa7cf48d1255fec7377103b1f7a99734 100644
--- a/src/main/java/org/bukkit/WorldCreator.java
+++ b/src/main/java/org/bukkit/WorldCreator.java
@@ -12,6 +12,7 @@ import org.jetbrains.annotations.Nullable;
@@ -13,6 +13,7 @@ import org.jetbrains.annotations.Nullable;
* Represents various types of options that may be used to create a world.
*/
public class WorldCreator {
@ -104,12 +104,11 @@ index f9fa287d25a0243de8d8d7b0d13144ce919750b0..29f0bb4d5bb1d5ef1b6bd64726ca84c2
private final String name;
private long seed;
private World.Environment environment = World.Environment.NORMAL;
@@ -28,13 +29,80 @@ public class WorldCreator {
@@ -30,11 +31,80 @@ public class WorldCreator {
* @param name Name of the world that will be created
*/
public WorldCreator(@NotNull String name) {
- if (name == null) {
- throw new IllegalArgumentException("World name cannot be null");
- Preconditions.checkArgument(name != null, "World name cannot be null");
+ // Paper start
+ this(name, getWorldKey(name));
+ }
@ -124,7 +123,7 @@ index f9fa287d25a0243de8d8d7b0d13144ce919750b0..29f0bb4d5bb1d5ef1b6bd64726ca84c2
+ return NamespacedKey.minecraft("the_end");
+ } else {
+ return NamespacedKey.minecraft(name.toLowerCase(java.util.Locale.ENGLISH).replace(" ", "_"));
}
+ }
+ }
- this.name = name;

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Rewrite LogEvents to contain the source jars in stack traces
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index a8ac1fb22a6fba50d69bf726b49c49ba190ab79a..b4732c8dd12134a094ef9afc1870077412ce0435 100644
index d6d3e1332e51adc5611543b2a6689efa5921a9f2..877bfe10b858145278133acbc7049f700d2b4f8a 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -54,7 +54,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -56,7 +56,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@org.jetbrains.annotations.ApiStatus.Internal // Paper
public PluginClassLoader(@Nullable final ClassLoader parent, @NotNull final PluginDescriptionFile description, @NotNull final File dataFolder, @NotNull final File file, @Nullable ClassLoader libraryLoader, JarFile jarFile, io.papermc.paper.plugin.provider.entrypoint.DependencyContext dependencyContext) throws IOException, InvalidPluginException, MalformedURLException { // Paper // Paper - use JarFile provided by SpigotPluginProvider

View file

@ -5,10 +5,10 @@ Subject: [PATCH] More PotionEffectType API
diff --git a/src/main/java/org/bukkit/Registry.java b/src/main/java/org/bukkit/Registry.java
index 3818f940b98488bd1068d941cfbbac3721677c7a..c936a6e193163f2af147484daf6accf24c2f3644 100644
index 469ef0a9241fddbd869ac2c0662c98b3022cc8aa..ba934feab58da978311c642408227a1fa686dfbb 100644
--- a/src/main/java/org/bukkit/Registry.java
+++ b/src/main/java/org/bukkit/Registry.java
@@ -264,6 +264,31 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
@@ -270,6 +270,31 @@ public interface Registry<T extends Keyed> extends Iterable<T> {
*/
@Deprecated(forRemoval = true)
Registry<io.papermc.paper.world.structure.ConfiguredStructure> CONFIGURED_STRUCTURE = Bukkit.getRegistry(io.papermc.paper.world.structure.ConfiguredStructure.class);

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Add enchantWithLevels API
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 77ca38e5edda55daf67ab8af9afd633efb4000b1..ab73893656932f54009340df59293df2a732be51 100644
index 9045746aa3077c536173d4ac826e0bf49e732b32..1c4e0c7356047163a38f5ac4dd544129d0b36271 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -173,6 +173,22 @@ public interface ItemFactory {
@@ -174,6 +174,22 @@ public interface ItemFactory {
Material getSpawnEgg(@NotNull EntityType type);
// Paper start - Adventure

View file

@ -5,24 +5,70 @@ Subject: [PATCH] WorldCreator#keepSpawnLoaded
diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java
index 29f0bb4d5bb1d5ef1b6bd64726ca84c25091f9e4..649256cb267bcf05ef4c15699cbf4e7e7e99b612 100644
index afc0ce2eaa7cf48d1255fec7377103b1f7a99734..58e3e3e0e772640b3944b4acb5a92d96431728a7 100644
--- a/src/main/java/org/bukkit/WorldCreator.java
+++ b/src/main/java/org/bukkit/WorldCreator.java
@@ -22,6 +22,7 @@ public class WorldCreator {
@@ -23,7 +23,7 @@ public class WorldCreator {
private boolean generateStructures = true;
private String generatorSettings = "";
private boolean hardcore = false;
- private boolean keepSpawnInMemory = true;
+ private net.kyori.adventure.util.TriState keepSpawnLoaded = net.kyori.adventure.util.TriState.NOT_SET; // Paper
/**
* Creates an empty WorldCreationOptions for the given world name
@@ -573,4 +574,32 @@ public class WorldCreator {
@@ -123,7 +123,7 @@ public class WorldCreator {
type = world.getWorldType();
generateStructures = world.canGenerateStructures();
hardcore = world.isHardcore();
- keepSpawnInMemory = world.getKeepSpawnInMemory();
+ this.keepSpawnLoaded = net.kyori.adventure.util.TriState.byBoolean(world.getKeepSpawnInMemory()); // Paper
return this;
}
@@ -146,7 +146,7 @@ public class WorldCreator {
generateStructures = creator.generateStructures();
generatorSettings = creator.generatorSettings();
hardcore = creator.hardcore();
- keepSpawnInMemory = creator.keepSpawnInMemory();
+ keepSpawnLoaded = creator.keepSpawnLoaded(); // Paper
return this;
}
@@ -470,21 +470,23 @@ public class WorldCreator {
*
* @param keepSpawnInMemory Whether the spawn chunks will be kept loaded
* @return This object, for chaining
+ * @deprecated use {@link #keepSpawnLoaded(net.kyori.adventure.util.TriState)}
*/
@NotNull
+ @Deprecated(forRemoval = true) // Paper
public WorldCreator keepSpawnInMemory(boolean keepSpawnInMemory) {
- this.keepSpawnInMemory = keepSpawnInMemory;
-
- return this;
+ return this.keepSpawnLoaded(net.kyori.adventure.util.TriState.byBoolean(keepSpawnInMemory)); // Paper
}
/**
* Gets whether or not the spawn chunks will be kept loaded.
*
* @return True if the spawn chunks will be kept loaded
+ * @deprecated use {@link #keepSpawnLoaded()}
*/
+ @Deprecated(forRemoval = true) // Paper
public boolean keepSpawnInMemory() {
- return keepSpawnInMemory;
+ return this.keepSpawnLoaded() == net.kyori.adventure.util.TriState.TRUE; // Paper
}
/**
@@ -594,4 +596,31 @@ public class WorldCreator {
return result;
}
+
+ // Paper start
+
+ // Paper start - keep spawn loaded tristate
+ /**
+ * Returns the current intent to keep the world loaded, @see {@link WorldCreator#keepSpawnLoaded(net.kyori.adventure.util.TriState)}
+ *
@ -42,10 +88,10 @@ index 29f0bb4d5bb1d5ef1b6bd64726ca84c25091f9e4..649256cb267bcf05ef4c15699cbf4e7e
+ */
+ @NotNull
+ public WorldCreator keepSpawnLoaded(@NotNull net.kyori.adventure.util.TriState keepSpawnLoaded) {
+ java.util.Objects.requireNonNull(keepSpawnLoaded, "keepSpawnLoaded");
+ Preconditions.checkArgument(keepSpawnLoaded != null, "keepSpawnLoaded");
+ this.keepSpawnLoaded = keepSpawnLoaded;
+ return this;
+ }
+
+ // Paper end
+ // Paper end - keep spawn loaded tristate
}

View file

@ -5,10 +5,10 @@ Subject: [PATCH] Also load resources from LibraryLoader
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index b4732c8dd12134a094ef9afc1870077412ce0435..13da387d3b59bc67c0d73e3fbd3a4034b1281527 100644
index 877bfe10b858145278133acbc7049f700d2b4f8a..f9b57b872780aa6b9b959494874b57c7a8ff0c53 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -95,14 +95,35 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@@ -109,14 +109,35 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
@Override
public URL getResource(String name) {