aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-11-17 21:52:57 +0100
committerOwen1212055 <[email protected]>2024-11-18 14:50:39 -0500
commit330057ac0d2d869603b7cff5a42b9712e2e409d5 (patch)
tree2b9022063d9650460fdf733cf23e8aaefdef2bb1
parent59e0f4b9ef85955a942590e002bd6d247f7f5b32 (diff)
downloadPaper-330057ac0d2d869603b7cff5a42b9712e2e409d5.tar.gz
Paper-330057ac0d2d869603b7cff5a42b9712e2e409d5.zip
Add missing experimental annotations
-rw-r--r--patches/api/0496-WIP-DataComponent-API.patch48
-rw-r--r--patches/server/1065-WIP-DataComponent-API.patch4
2 files changed, 44 insertions, 8 deletions
diff --git a/patches/api/0496-WIP-DataComponent-API.patch b/patches/api/0496-WIP-DataComponent-API.patch
index 6857bf46e6..9c190e3243 100644
--- a/patches/api/0496-WIP-DataComponent-API.patch
+++ b/patches/api/0496-WIP-DataComponent-API.patch
@@ -3937,11 +3937,32 @@ index 7cf7c6d05aa6cbf3f0c8612831404552c6a7b84a..c60e31425efd7b863941f5538faef6c0
/**
* Get the object by its key.
*
+diff --git a/src/main/java/org/bukkit/block/BlockType.java b/src/main/java/org/bukkit/block/BlockType.java
+index ed534fe4983873a2d5f623f0d9d5e3ce254615eb..f019d490794b49d21057820bab047e2f909934a1 100644
+--- a/src/main/java/org/bukkit/block/BlockType.java
++++ b/src/main/java/org/bukkit/block/BlockType.java
+@@ -128,7 +128,7 @@ import org.jetbrains.annotations.Nullable;
+ * official replacement for the aforementioned enum. Entirely incompatible
+ * changes may occur. Do not use this API in plugins.
+ */
[email protected] // Paper - data component API - already required for data component API
+ public interface BlockType extends Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - add translatable & feature flag API
+
+ /**
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
-index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c13134c7ab 100644
+index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..9c5f61ea845237e78cc3da61c06506e14351f228 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
-@@ -1137,4 +1137,173 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
+@@ -1,7 +1,6 @@
+ package org.bukkit.inventory;
+
+ import com.google.common.base.Preconditions;
+-import com.google.common.collect.ImmutableMap;
+ import java.util.LinkedHashMap;
+ import java.util.Locale;
+ import java.util.Map;
+@@ -1137,4 +1136,185 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
return Bukkit.getUnsafe().computeTooltipLines(this, tooltipContext, player);
}
// Paper end - expose itemstack tooltip lines
@@ -3956,6 +3977,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @see #hasData(io.papermc.paper.datacomponent.DataComponentType) for DataComponentType.NonValued
+ */
+ @org.jetbrains.annotations.Contract(pure = true)
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public <T> @Nullable T getData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type) {
+ return this.craftDelegate.getData(type);
+ }
@@ -3971,6 +3993,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ */
+ @Utility
+ @org.jetbrains.annotations.Contract(value = "_, !null -> !null", pure = true)
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public <T> @Nullable T getDataOrDefault(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<? extends T> type, final @Nullable T fallback) {
+ final T object = this.getData(type);
+ return object != null ? object : fallback;
@@ -3983,6 +4006,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @return {@code true} if set, {@code false} otherwise
+ */
+ @org.jetbrains.annotations.Contract(pure = true)
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public boolean hasData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) {
+ return this.craftDelegate.hasData(type);
+ }
@@ -3993,6 +4017,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @return an immutable set of data component types
+ */
+ @org.jetbrains.annotations.Contract("-> new")
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public [email protected] Set<io.papermc.paper.datacomponent.@NotNull DataComponentType> getDataTypes() {
+ return this.craftDelegate.getDataTypes();
+ }
@@ -4008,6 +4033,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @param <T> value type
+ */
+ @Utility
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull io.papermc.paper.datacomponent.DataComponentBuilder<T> valueBuilder) {
+ this.setData(type, valueBuilder.build());
+ }
@@ -4046,6 +4072,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @param value value to set
+ * @param <T> value type
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public <T> void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type, final @NotNull T value) {
+ this.craftDelegate.setData(type, value);
+ }
@@ -4055,6 +4082,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ *
+ * @param type the data component type
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull NonValued type) {
+ this.craftDelegate.setData(type);
+ }
@@ -4064,6 +4092,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ *
+ * @param type the data component type
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public void unsetData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) {
+ this.craftDelegate.unsetData(type);
+ }
@@ -4074,6 +4103,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ *
+ * @param type the data component type
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public void resetData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) {
+ this.craftDelegate.resetData(type);
+ }
@@ -4085,8 +4115,9 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @param type the data component type
+ * @return {@code true} if the data type is overridden
+ */
-+ public boolean isOverridden(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) {
-+ return this.craftDelegate.isOverridden(type);
++ @org.jetbrains.annotations.ApiStatus.Experimental
++ public boolean isDataOverridden(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) {
++ return this.craftDelegate.isDataOverridden(type);
+ }
+
+ /**
@@ -4097,6 +4128,7 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @param excludeTypes the data component types to ignore
+ * @return {@code true} if the provided item is equal, ignoring the provided components
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public boolean matchesWithoutData(final @NotNull ItemStack item, final @NotNull java.util.Set<io.papermc.paper.datacomponent.@NotNull DataComponentType> excludeTypes) {
+ return this.matchesWithoutData(item, excludeTypes, false);
+ }
@@ -4110,16 +4142,17 @@ index b59222b8c262545d100a9fd28b3bf1d2a4cf4eb0..8aa3051be46fd560e8e28843ca6129c1
+ * @param ignoreCount ignore the count of the item
+ * @return {@code true} if the provided item is equal, ignoring the provided components
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ public boolean matchesWithoutData(final @NotNull ItemStack item, final @NotNull java.util.Set<io.papermc.paper.datacomponent.@NotNull DataComponentType> excludeTypes, final boolean ignoreCount) {
+ return this.craftDelegate.matchesWithoutData(item, excludeTypes, ignoreCount);
+ }
+ // Paper end - data component API
}
diff --git a/src/main/java/org/bukkit/inventory/ItemType.java b/src/main/java/org/bukkit/inventory/ItemType.java
-index 72803c00e4af576f286d2af34bf300ee554a7f3c..9769726ec1e227606a79ccab1e8e439ef9ec16c1 100644
+index 72803c00e4af576f286d2af34bf300ee554a7f3c..2a3c4f055d0e4ef009caed95152570660ab100d5 100644
--- a/src/main/java/org/bukkit/inventory/ItemType.java
+++ b/src/main/java/org/bukkit/inventory/ItemType.java
-@@ -2483,4 +2483,30 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
+@@ -2483,4 +2483,33 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans
*/
@Nullable ItemRarity getItemRarity();
// Paper end - expand ItemRarity API
@@ -4132,6 +4165,7 @@ index 72803c00e4af576f286d2af34bf300ee554a7f3c..9769726ec1e227606a79ccab1e8e439e
+ * @return the default value or {@code null} if there is none
+ * @see #hasDefaultData(io.papermc.paper.datacomponent.DataComponentType) for DataComponentType.NonValued
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ @Nullable <T> T getDefaultData(io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type);
+
+ /**
@@ -4140,6 +4174,7 @@ index 72803c00e4af576f286d2af34bf300ee554a7f3c..9769726ec1e227606a79ccab1e8e439e
+ * @param type the data component type
+ * @return {@code true} if there is a default value
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ boolean hasDefaultData(io.papermc.paper.datacomponent.@NotNull DataComponentType type);
+
+ /**
@@ -4147,6 +4182,7 @@ index 72803c00e4af576f286d2af34bf300ee554a7f3c..9769726ec1e227606a79ccab1e8e439e
+ *
+ * @return an immutable set of data component types
+ */
++ @org.jetbrains.annotations.ApiStatus.Experimental
+ [email protected] @NotNull Set<io.papermc.paper.datacomponent.DataComponentType> getDefaultDataTypes();
+ // Paper end - data component API
}
diff --git a/patches/server/1065-WIP-DataComponent-API.patch b/patches/server/1065-WIP-DataComponent-API.patch
index ac605eee7d..37ec8ae222 100644
--- a/patches/server/1065-WIP-DataComponent-API.patch
+++ b/patches/server/1065-WIP-DataComponent-API.patch
@@ -3672,7 +3672,7 @@ index f8c6da955e4bd0e480c7b581d2a4325738f9dd6f..ee1fce58c6e57dd93a30ee66e7488a92
// data-drivens
entry(Registries.BIOME, RegistryKey.BIOME, Biome.class, CraftBiome::new).delayed(),
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
-index 756c73a401437566258813946fa10c7caa8f2469..f89c660e07d791fbe06c11ae81f9eb638c0013d5 100644
+index 756c73a401437566258813946fa10c7caa8f2469..71c017fd98001c7f78b1bf19e9956703617c0e37 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
@@ -206,7 +206,7 @@ public final class CraftItemStack extends ItemStack {
@@ -3841,7 +3841,7 @@ index 756c73a401437566258813946fa10c7caa8f2469..f89c660e07d791fbe06c11ae81f9eb63
+ }
+
+ @Override
-+ public boolean isOverridden(final io.papermc.paper.datacomponent.DataComponentType type) {
++ public boolean isDataOverridden(final io.papermc.paper.datacomponent.DataComponentType type) {
+ if (this.isEmpty()) {
+ return false;
+ }