Updated Upstream (Bukkit/CraftBukkit)

Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
5dbedae1 PR-864: Fix Registry#match() failing namespaced inputs
49256865 PR-863: Fix boolean PersistentDataType
9f15450b SPIGOT-7195, SPIGOT-7197: Add DataPack API
ebef5b6a Disable InterfaceIsType Checkstyle check
01d577f5 Slight tweak to boolean PersistentDataType javadoc
d2b99e56 PR-857: Add boolean PersistentDataType

CraftBukkit Changes:
2270366cd PR-1196: Test Registry instances more thoroughly
863dacb7a PR-1191: Do not start on pre-release Java 17
1f2dd8e12 SPIGOT-7362: Properly handle null in CraftBlock#blockFaceToNotch()
dbc70bed5 SPIGOT-7195, SPIGOT-7197: Add DataPack API
This commit is contained in:
Nassim Jahnke 2023-06-06 11:09:19 +02:00
parent c137b5dc31
commit 1b571414da
10 changed files with 72 additions and 14 deletions

View File

@ -73,6 +73,18 @@ diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Buk
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Bukkit.java --- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java
@@ -0,0 +0,0 @@ public final class Bukkit {
/**
* Get the DataPack Manager.
*
+ * @deprecated use {@link #getDatapackManager()}
* @return the manager
*/
@NotNull
+ @Deprecated(forRemoval = true)
public static DataPackManager getDataPackManager() {
return server.getDataPackManager();
}
@@ -0,0 +0,0 @@ public final class Bukkit { @@ -0,0 +0,0 @@ public final class Bukkit {
public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
return server.getMobGoals(); return server.getMobGoals();
@ -92,6 +104,18 @@ diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Ser
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
/**
* Get the DataPack Manager.
*
+ * @deprecated use {@link #getDatapackManager()}
* @return the manager
*/
@NotNull
+ @Deprecated(forRemoval = true) // Paper
public DataPackManager getDataPackManager();
/**
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/ */
@NotNull @NotNull
@ -104,3 +128,33 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ io.papermc.paper.datapack.DatapackManager getDatapackManager(); + io.papermc.paper.datapack.DatapackManager getDatapackManager();
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/packs/DataPack.java b/src/main/java/org/bukkit/packs/DataPack.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/packs/DataPack.java
+++ b/src/main/java/org/bukkit/packs/DataPack.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.NotNull;
/**
* Represents a data pack.
+ * @deprecated use {@link io.papermc.paper.datapack.Datapack}
*/
@ApiStatus.Experimental
+@Deprecated(forRemoval = true) // Paper
public interface DataPack extends Keyed {
/**
diff --git a/src/main/java/org/bukkit/packs/DataPackManager.java b/src/main/java/org/bukkit/packs/DataPackManager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/packs/DataPackManager.java
+++ b/src/main/java/org/bukkit/packs/DataPackManager.java
@@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
/**
* Manager of data packs.
+ * @deprecated use {@link io.papermc.paper.datapack.DatapackManager}
*/
@ApiStatus.Experimental
+@Deprecated(forRemoval = true) // Paper
public interface DataPackManager {
/**

View File

@ -331,7 +331,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public String getTranslationKey() { public String getTranslationKey() {
return Bukkit.getUnsafe().getTranslationKey(this); return Bukkit.getUnsafe().getTranslationKey(this);
} }
+
+ // Paper start + // Paper start
+ /** + /**
+ * @throws IllegalArgumentException if the entity does not have a translation key (is probably a custom entity) + * @throws IllegalArgumentException if the entity does not have a translation key (is probably a custom entity)
@ -342,7 +342,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this); + return org.bukkit.Bukkit.getUnsafe().getTranslationKey(this);
+ } + }
+ // Paper end + // Paper end
} +
/**
* Gets if this EntityType is enabled by feature in a world.
*
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Villager.java --- a/src/main/java/org/bukkit/entity/Villager.java

View File

@ -1429,7 +1429,7 @@ diff --git a/src/main/java/org/bukkit/UnsafeValues.java b/src/main/java/org/bukk
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/UnsafeValues.java --- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -0,0 +0,0 @@ import org.bukkit.plugin.PluginDescriptionFile; @@ -0,0 +0,0 @@ import org.jetbrains.annotations.Nullable;
*/ */
@Deprecated @Deprecated
public interface UnsafeValues { public interface UnsafeValues {

View File

@ -59,4 +59,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return org.bukkit.Bukkit.getUnsafe().getDefaultEntityAttributes(this.key); + return org.bukkit.Bukkit.getUnsafe().getDefaultEntityAttributes(this.key);
+ } + }
// Paper end // Paper end
}
/**

View File

@ -1322,9 +1322,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/UnsafeValues.java --- a/src/main/java/org/bukkit/UnsafeValues.java
+++ b/src/main/java/org/bukkit/UnsafeValues.java +++ b/src/main/java/org/bukkit/UnsafeValues.java
@@ -0,0 +0,0 @@ public interface UnsafeValues { @@ -0,0 +0,0 @@ public interface UnsafeValues {
String getTranslationKey(EntityType entityType);
String getTranslationKey(ItemStack itemStack); @Nullable
FeatureFlag getFeatureFlag(@NotNull NamespacedKey key);
+ +
+ // Paper start + // Paper start
+ @Deprecated(forRemoval = true) + @Deprecated(forRemoval = true)

View File

@ -6853,8 +6853,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ } + }
+ // Paper end + // Paper end
/** @Override
* This helper class represents the different NBT Tags. public FeatureFlag getFeatureFlag(NamespacedKey namespacedKey) {
diff --git a/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier b/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier diff --git a/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier b/src/main/resources/META-INF/services/io.papermc.paper.plugin.entrypoint.classloader.ClassloaderBytecodeModifier
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000

View File

@ -16,6 +16,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 20 is supported."); - System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 20 is supported.");
- return; - return;
- } - }
String javaVersionName = System.getProperty("java.version");
try { // J2SE SDK/JRE Version String Naming Convention
// Paper start - Handled by TerminalConsoleAppender boolean isPreRelease = javaVersionName.contains("-");

View File

@ -2063,8 +2063,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public static byte toLegacyData(BlockState data) { public static byte toLegacyData(BlockState data) {
return CraftLegacy.toLegacyData(data); return CraftLegacy.toLegacyData(data);
@@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues { @@ -0,0 +0,0 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftFeatureFlag.getFromNMS(namespacedKey);
} }
// Paper end
+ // Paper start + // Paper start
+ @Override + @Override

@ -1 +1 @@
Subproject commit 4727d326da2bcd87ae2a6e6d6dd0cc5249c0288f Subproject commit 5dbedae1cbbc70791dcfc374c4c8da35db309a44

@ -1 +1 @@
Subproject commit b346a5f6dd890c8ecfff2323082a8178c4fffa62 Subproject commit 2270366cdd98ff02eaa62212b7881084feadd764