diff options
author | Lulu13022002 <[email protected]> | 2024-07-05 14:41:29 +0200 |
---|---|---|
committer | Owen1212055 <[email protected]> | 2024-11-18 14:50:38 -0500 |
commit | 2070844f8db410c151c1c1d5dec5d5057eb1b8f7 (patch) | |
tree | e174b0c62f8091637286cb1a1ee892cfaafe2269 /patches/api | |
parent | aaf2caf6d7ae7186c7c7d9308b91cb1296c3961c (diff) | |
download | Paper-2070844f8db410c151c1c1d5dec5d5057eb1b8f7.tar.gz Paper-2070844f8db410c151c1c1d5dec5d5057eb1b8f7.zip |
another change
Diffstat (limited to 'patches/api')
-rw-r--r-- | patches/api/0480-WIP-DataComponent-API.patch | 167 |
1 files changed, 79 insertions, 88 deletions
diff --git a/patches/api/0480-WIP-DataComponent-API.patch b/patches/api/0480-WIP-DataComponent-API.patch index 42d8067dfe..7c691c939b 100644 --- a/patches/api/0480-WIP-DataComponent-API.patch +++ b/patches/api/0480-WIP-DataComponent-API.patch @@ -455,15 +455,14 @@ index 0000000000000000000000000000000000000000..9f4e76e44ed34c57132494cad46b2fad +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/BannerPatternLayers.java b/src/main/java/io/papermc/paper/datacomponent/item/BannerPatternLayers.java new file mode 100644 -index 0000000000000000000000000000000000000000..a45b80e610588b8f3f6578ee47cf95b4596f5820 +index 0000000000000000000000000000000000000000..c628b5aed20c4d8781e0ad19fdbc4a926fcfc0fa --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/BannerPatternLayers.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,42 @@ +package io.papermc.paper.datacomponent.item; + +import io.papermc.paper.datacomponent.ComponentBuilder; +import java.util.Arrays; -+import java.util.Collection; +import java.util.List; +import org.bukkit.block.banner.Pattern; +import org.checkerframework.checker.nullness.qual.NonNull; @@ -480,7 +479,7 @@ index 0000000000000000000000000000000000000000..a45b80e610588b8f3f6578ee47cf95b4 + } + + @Contract(value = "_ -> new", pure = true) -+ static @NonNull BannerPatternLayers bannerPatternLayers(final @NonNull Collection<@NonNull Pattern> patterns) { ++ static @NonNull BannerPatternLayers bannerPatternLayers(final @NonNull List<@NonNull Pattern> patterns) { + return bannerPatternLayers().addAll(patterns).build(); + } + @@ -499,7 +498,7 @@ index 0000000000000000000000000000000000000000..a45b80e610588b8f3f6578ee47cf95b4 + @NonNull Builder add(@NonNull Pattern pattern); + + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder addAll(@NonNull Collection<@NonNull Pattern> patterns); ++ @NonNull Builder addAll(@NonNull List<@NonNull Pattern> patterns); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/BlockItemDataProperties.java b/src/main/java/io/papermc/paper/datacomponent/item/BlockItemDataProperties.java @@ -538,15 +537,14 @@ index 0000000000000000000000000000000000000000..270f98e95b1d0322a42bad52d492fa00 +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/BundleContents.java b/src/main/java/io/papermc/paper/datacomponent/item/BundleContents.java new file mode 100644 -index 0000000000000000000000000000000000000000..756a47b72c82901f89ef5498b8315e3e1b342143 +index 0000000000000000000000000000000000000000..d5b1718ae01d6ea73f75446240d169ba9f0d7778 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/BundleContents.java -@@ -0,0 +1,63 @@ +@@ -0,0 +1,62 @@ +package io.papermc.paper.datacomponent.item; + +import io.papermc.paper.datacomponent.ComponentBuilder; +import java.util.Arrays; -+import java.util.Collection; +import java.util.List; +import org.bukkit.inventory.ItemStack; +import org.checkerframework.checker.nullness.qual.NonNull; @@ -566,7 +564,7 @@ index 0000000000000000000000000000000000000000..756a47b72c82901f89ef5498b8315e3e + } + + @Contract(value = "_ -> new", pure = true) -+ static @NonNull BundleContents bundleContents(final @NonNull Collection<@NonNull ItemStack> contents) { ++ static @NonNull BundleContents bundleContents(final @NonNull List<@NonNull ItemStack> contents) { + return ComponentTypesBridge.bridge().bundleContents().addAll(contents).build(); + } + @@ -602,20 +600,19 @@ index 0000000000000000000000000000000000000000..756a47b72c82901f89ef5498b8315e3e + * @return the builder for chaining + */ + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder addAll(@NonNull Collection<@NonNull ItemStack> stacks); ++ @NonNull Builder addAll(@NonNull List<@NonNull ItemStack> stacks); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/ChargedProjectiles.java b/src/main/java/io/papermc/paper/datacomponent/item/ChargedProjectiles.java new file mode 100644 -index 0000000000000000000000000000000000000000..48319377a3038050ec4cebad73a3d5396c0008bd +index 0000000000000000000000000000000000000000..b8eea6dd890bfed0462cffb0aac48ee8010636f1 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/ChargedProjectiles.java -@@ -0,0 +1,63 @@ +@@ -0,0 +1,62 @@ +package io.papermc.paper.datacomponent.item; + +import io.papermc.paper.datacomponent.ComponentBuilder; +import java.util.Arrays; -+import java.util.Collection; +import java.util.List; +import org.bukkit.inventory.ItemStack; +import org.checkerframework.checker.nullness.qual.NonNull; @@ -635,7 +632,7 @@ index 0000000000000000000000000000000000000000..48319377a3038050ec4cebad73a3d539 + } + + @Contract(value = "_ -> new", pure = true) -+ static @NonNull ChargedProjectiles chargedProjectiles(final @NonNull Collection<@NonNull ItemStack> projectiles) { ++ static @NonNull ChargedProjectiles chargedProjectiles(final @NonNull List<@NonNull ItemStack> projectiles) { + return chargedProjectiles().addAll(projectiles).build(); + } + @@ -671,7 +668,7 @@ index 0000000000000000000000000000000000000000..48319377a3038050ec4cebad73a3d539 + * @return the builder for chaining + */ + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder addAll(@NonNull Collection<@NonNull ItemStack> stacks); ++ @NonNull Builder addAll(@NonNull List<@NonNull ItemStack> stacks); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/ComponentTypesBridge.java b/src/main/java/io/papermc/paper/datacomponent/item/ComponentTypesBridge.java @@ -774,12 +771,13 @@ index 0000000000000000000000000000000000000000..7412a4259140707fbf7545f7c8a3da0b +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/CustomModelData.java b/src/main/java/io/papermc/paper/datacomponent/item/CustomModelData.java new file mode 100644 -index 0000000000000000000000000000000000000000..90c9e272aaf6f122ec773da65a2366e9fb5be08f +index 0000000000000000000000000000000000000000..fec24c86091ddd752ea8449de2da97c4889fdd76 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/CustomModelData.java -@@ -0,0 +1,27 @@ +@@ -0,0 +1,25 @@ +package io.papermc.paper.datacomponent.item; + ++import io.papermc.paper.datacomponent.ComponentBuilder; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Contract; @@ -796,13 +794,10 @@ index 0000000000000000000000000000000000000000..90c9e272aaf6f122ec773da65a2366e9 + int data(); + + @ApiStatus.NonExtendable -+ interface Builder { ++ interface Builder extends ComponentBuilder<CustomModelData> { + + @Contract(value = "_ -> this", mutates = "this") + @NonNull Builder data(int data); -+ -+ @Contract(value = "-> new", pure = true) -+ @NonNull CustomModelData build(); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/DyedItemColor.java b/src/main/java/io/papermc/paper/datacomponent/item/DyedItemColor.java @@ -858,14 +853,13 @@ index 0000000000000000000000000000000000000000..93f419b8e4d9c87b3ad4fa570d3bfad4 +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/Fireworks.java b/src/main/java/io/papermc/paper/datacomponent/item/Fireworks.java new file mode 100644 -index 0000000000000000000000000000000000000000..3b9548c150f8592e171d7f9686baa3d6aec0720f +index 0000000000000000000000000000000000000000..feebbbb24190f70ef211aacdc659864a8e805060 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/Fireworks.java -@@ -0,0 +1,75 @@ +@@ -0,0 +1,74 @@ +package io.papermc.paper.datacomponent.item; + +import io.papermc.paper.datacomponent.ComponentBuilder; -+import java.util.Collection; +import java.util.List; +import org.bukkit.FireworkEffect; +import org.checkerframework.checker.nullness.qual.NonNull; @@ -881,7 +875,7 @@ index 0000000000000000000000000000000000000000..3b9548c150f8592e171d7f9686baa3d6 +public interface Fireworks { + + @Contract(value = "_, _ -> new", pure = true) -+ static @NonNull Fireworks fireworks(final @NonNull Collection<@NonNull FireworkEffect> effects, final int flightDuration) { ++ static @NonNull Fireworks fireworks(final @NonNull List<@NonNull FireworkEffect> effects, final int flightDuration) { + return fireworks().addEffects(effects).flightDuration(flightDuration).build(); + } + @@ -934,12 +928,12 @@ index 0000000000000000000000000000000000000000..3b9548c150f8592e171d7f9686baa3d6 + * @return the builder for chaining + */ + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder addEffects(@NonNull Collection<@NonNull FireworkEffect> effects); ++ @NonNull Builder addEffects(@NonNull List<@NonNull FireworkEffect> effects); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/FoodProperties.java b/src/main/java/io/papermc/paper/datacomponent/item/FoodProperties.java new file mode 100644 -index 0000000000000000000000000000000000000000..1a0ae9ba2451e89b113f1bbc729415b8415266ab +index 0000000000000000000000000000000000000000..a3efb2ba81889a0df0a383cd0a17567bef161984 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/FoodProperties.java @@ -0,0 +1,114 @@ @@ -1005,7 +999,7 @@ index 0000000000000000000000000000000000000000..1a0ae9ba2451e89b113f1bbc729415b8 + * + * @return effects + */ -+ @Unmodifiable @NonNull List<@NonNull PossibleEffect> effects(); ++ @NonNull @Unmodifiable List<@NonNull PossibleEffect> effects(); + + /** + * Effect to be applied when eaten. @@ -1045,7 +1039,7 @@ index 0000000000000000000000000000000000000000..1a0ae9ba2451e89b113f1bbc729415b8 + @NonNull Builder saturation(float saturation); + + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder nutrition(int nutrition); ++ @NonNull Builder nutrition(@NonNegative int nutrition); + + @Contract(value = "_ -> this", mutates = "this") + @NonNull Builder usingConvertsTo(@Nullable ItemStack stack); @@ -1221,15 +1215,14 @@ index 0000000000000000000000000000000000000000..633e9ea540cfff0bd270dc4ec4291ce9 +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/ItemContainerContents.java b/src/main/java/io/papermc/paper/datacomponent/item/ItemContainerContents.java new file mode 100644 -index 0000000000000000000000000000000000000000..e24079e44924584562cc092dc28ee559b8f06002 +index 0000000000000000000000000000000000000000..72426d41b62e88e512d73e17912a3046e4ad0682 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/ItemContainerContents.java -@@ -0,0 +1,43 @@ +@@ -0,0 +1,42 @@ +package io.papermc.paper.datacomponent.item; + +import io.papermc.paper.datacomponent.ComponentBuilder; +import java.util.Arrays; -+import java.util.Collection; +import java.util.List; +import org.bukkit.inventory.ItemStack; +import org.checkerframework.checker.nullness.qual.NonNull; @@ -1246,7 +1239,7 @@ index 0000000000000000000000000000000000000000..e24079e44924584562cc092dc28ee559 + } + + @Contract(value = "_ -> new", pure = true) -+ static @NonNull ItemContainerContents containerContents(final @NonNull Collection<@NonNull ItemStack> contents) { ++ static @NonNull ItemContainerContents containerContents(final @NonNull List<@NonNull ItemStack> contents) { + return containerContents().addAll(contents).build(); + } + @@ -1265,7 +1258,7 @@ index 0000000000000000000000000000000000000000..e24079e44924584562cc092dc28ee559 + @NonNull Builder add(@NonNull ItemStack stack); + + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder addAll(@NonNull Collection<@NonNull ItemStack> stacks); ++ @NonNull Builder addAll(@NonNull List<@NonNull ItemStack> stacks); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/ItemEnchantments.java b/src/main/java/io/papermc/paper/datacomponent/item/ItemEnchantments.java @@ -1446,12 +1439,13 @@ index 0000000000000000000000000000000000000000..1d2276a6522044f06713db5ab8495d8a +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/LockCode.java b/src/main/java/io/papermc/paper/datacomponent/item/LockCode.java new file mode 100644 -index 0000000000000000000000000000000000000000..999209e91587c429c830b859f47546cd67642530 +index 0000000000000000000000000000000000000000..6e7e05811a3e325757a7e44b2d6180c882ebb421 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/LockCode.java -@@ -0,0 +1,27 @@ +@@ -0,0 +1,25 @@ +package io.papermc.paper.datacomponent.item; + ++import io.papermc.paper.datacomponent.ComponentBuilder; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Contract; @@ -1465,16 +1459,13 @@ index 0000000000000000000000000000000000000000..999209e91587c429c830b859f47546cd + } + + @Contract(pure = true) -+ @NonNull String lock(); ++ @NonNull String key(); + + @ApiStatus.NonExtendable -+ interface Builder { ++ interface Builder extends ComponentBuilder<LockCode> { + + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder lock(@NonNull String key); -+ -+ @Contract(value = "-> new", pure = true) -+ @NonNull LockCode build(); ++ @NonNull Builder key(@NonNull String key); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/LodestoneTracker.java b/src/main/java/io/papermc/paper/datacomponent/item/LodestoneTracker.java @@ -1548,10 +1539,10 @@ index 0000000000000000000000000000000000000000..7b195f3cea91446fa75c1c0982b0ac70 +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/MapDecorations.java b/src/main/java/io/papermc/paper/datacomponent/item/MapDecorations.java new file mode 100644 -index 0000000000000000000000000000000000000000..3cf5e994ce00dcd1823b9fff5f0359316bbb647d +index 0000000000000000000000000000000000000000..d3702f5772bc05d91bc0d4ed2debd4b8f51e5c70 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/MapDecorations.java -@@ -0,0 +1,105 @@ +@@ -0,0 +1,111 @@ +package io.papermc.paper.datacomponent.item; + +import io.papermc.paper.datacomponent.ComponentBuilder; @@ -1561,6 +1552,7 @@ index 0000000000000000000000000000000000000000..3cf5e994ce00dcd1823b9fff5f035931 +import org.checkerframework.checker.nullness.qual.Nullable; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Contract; ++import org.jetbrains.annotations.Unmodifiable; + +/** + * Holds a list of markers to be placed on a Filled Map (used for Explorer Maps). @@ -1587,8 +1579,13 @@ index 0000000000000000000000000000000000000000..3cf5e994ce00dcd1823b9fff5f035931 + @Contract(pure = true) + @Nullable DecorationEntry getDecoration(@NonNull String id); + ++ /** ++ * Gets the decoration entries. ++ * ++ * @return the decoration entries ++ */ + @Contract(pure = true) -+ Map<String, DecorationEntry> getDecorations(); ++ @NonNull @Unmodifiable Map<@NonNull String, @NonNull DecorationEntry> getDecorations(); + + /** + * Decoration present on the map. @@ -1659,12 +1656,13 @@ index 0000000000000000000000000000000000000000..3cf5e994ce00dcd1823b9fff5f035931 +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/MapId.java b/src/main/java/io/papermc/paper/datacomponent/item/MapId.java new file mode 100644 -index 0000000000000000000000000000000000000000..e5e28d0af32cc76bb5ff615c886a1bca2bfb0bf5 +index 0000000000000000000000000000000000000000..a380ccfccf87e8ebf0bc40d93b375b406a6c2eb1 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/MapId.java -@@ -0,0 +1,42 @@ +@@ -0,0 +1,39 @@ +package io.papermc.paper.datacomponent.item; + ++import io.papermc.paper.datacomponent.ComponentBuilder; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Contract; @@ -1689,7 +1687,7 @@ index 0000000000000000000000000000000000000000..e5e28d0af32cc76bb5ff615c886a1bca + int id(); + + @ApiStatus.NonExtendable -+ interface Builder { ++ interface Builder extends ComponentBuilder<MapId> { + + /** + * Sets the map id of this builder. @@ -1699,20 +1697,17 @@ index 0000000000000000000000000000000000000000..e5e28d0af32cc76bb5ff615c886a1bca + */ + @Contract(value = "_ -> this", mutates = "this") + @NonNull Builder id(int id); -+ -+ @Contract(value = "-> new", pure = true) -+ @NonNull -+ MapId build(); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/MapItemColor.java b/src/main/java/io/papermc/paper/datacomponent/item/MapItemColor.java new file mode 100644 -index 0000000000000000000000000000000000000000..776a9f554519a0737b363a494e628e64a40bfe66 +index 0000000000000000000000000000000000000000..40268f83d0330cd1af2e5aa028d14af83f8088e1 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/MapItemColor.java -@@ -0,0 +1,41 @@ +@@ -0,0 +1,39 @@ +package io.papermc.paper.datacomponent.item; + ++import io.papermc.paper.datacomponent.ComponentBuilder; +import org.bukkit.Color; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.jetbrains.annotations.ApiStatus; @@ -1734,10 +1729,10 @@ index 0000000000000000000000000000000000000000..776a9f554519a0737b363a494e628e64 + * + * @return color + */ -+ @NonNull Color mapColor(); ++ @NonNull Color color(); + + @ApiStatus.NonExtendable -+ interface Builder { ++ interface Builder extends ComponentBuilder<MapItemColor> { + + /** + * Sets the tint color of this map. @@ -1746,15 +1741,12 @@ index 0000000000000000000000000000000000000000..776a9f554519a0737b363a494e628e64 + * @return the builder for chaining + */ + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder mapColor(@NonNull Color color); -+ -+ @Contract(value = "-> new", pure = true) -+ @NonNull MapItemColor build(); ++ @NonNull Builder color(@NonNull Color color); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PotDecorations.java b/src/main/java/io/papermc/paper/datacomponent/item/PotDecorations.java new file mode 100644 -index 0000000000000000000000000000000000000000..abd94c0c900f7c2bf936e0c5c28ec92847db39ec +index 0000000000000000000000000000000000000000..2f479feab1d5b0774a9388382eb8310c031fe4e2 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/PotDecorations.java @@ -0,0 +1,50 @@ @@ -1796,28 +1788,27 @@ index 0000000000000000000000000000000000000000..abd94c0c900f7c2bf936e0c5c28ec928 + interface Builder extends ComponentBuilder<PotDecorations> { + + @Contract(value = "_ -> this", mutates = "this") -+ Builder back(@Nullable Material back); ++ @NonNull Builder back(@Nullable Material back); + + @Contract(value = "_ -> this", mutates = "this") -+ Builder left(@Nullable Material left); ++ @NonNull Builder left(@Nullable Material left); + + @Contract(value = "_ -> this", mutates = "this") -+ Builder right(@Nullable Material right); ++ @NonNull Builder right(@Nullable Material right); + + @Contract(value = "_ -> this", mutates = "this") -+ Builder front(@Nullable Material font); ++ @NonNull Builder front(@Nullable Material font); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PotionContents.java b/src/main/java/io/papermc/paper/datacomponent/item/PotionContents.java new file mode 100644 -index 0000000000000000000000000000000000000000..fb2ad16d4506bdcc660e0e89075dca599505604d +index 0000000000000000000000000000000000000000..26fbd67366c9cf02991eb6a8ce2d278419aa91c2 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/PotionContents.java -@@ -0,0 +1,97 @@ +@@ -0,0 +1,96 @@ +package io.papermc.paper.datacomponent.item; + +import io.papermc.paper.datacomponent.ComponentBuilder; -+import java.util.Collection; +import java.util.List; +import org.bukkit.Color; +import org.bukkit.potion.PotionEffect; @@ -1863,7 +1854,7 @@ index 0000000000000000000000000000000000000000..fb2ad16d4506bdcc660e0e89075dca59 + * @return effects + */ + @Contract(pure = true) -+ @Unmodifiable @NonNull List<@NonNull PotionEffect> customEffects(); ++ @NonNull @Unmodifiable List<@NonNull PotionEffect> customEffects(); + + @ApiStatus.NonExtendable + interface Builder extends ComponentBuilder<PotionContents> { @@ -1908,12 +1899,12 @@ index 0000000000000000000000000000000000000000..fb2ad16d4506bdcc660e0e89075dca59 + * @return the builder for chaining + */ + @Contract(value = "_ -> this", mutates = "this") -+ @NonNull Builder addCustomEffects(@NonNull Collection<@NonNull PotionEffect> effects); ++ @NonNull Builder addCustomEffects(@NonNull List<@NonNull PotionEffect> effects); + } +} diff --git a/src/main/java/io/papermc/paper/datacomponent/item/ResolvableProfile.java b/src/main/java/io/papermc/paper/datacomponent/item/ResolvableProfile.java new file mode 100644 -index 0000000000000000000000000000000000000000..2cae652ae18fd52a4b932ca350e35c711c4612e4 +index 0000000000000000000000000000000000000000..a776b230b9b80debafd41c7700dfdf39db2a2481 --- /dev/null +++ b/src/main/java/io/papermc/paper/datacomponent/item/ResolvableProfile.java @@ -0,0 +1,55 @@ @@ -1951,7 +1942,7 @@ index 0000000000000000000000000000000000000000..2cae652ae18fd52a4b932ca350e35c71 + @Nullable String name(); + + @Contract(pure = true) -+ @Unmodifiable @NonNull Collection<@NonNull ProfileProperty> properties(); ++ @NonNull @Unmodifiable Collection<@NonNull ProfileProperty> properties(); + + @Contract(pure = true) + @NonNull CompletableFuture<@NonNull PlayerProfile> resolve(); @@ -2541,7 +2532,7 @@ index 0000000000000000000000000000000000000000..5c8cdf46bc12501e1f284b4760c48e79 + @Nullable T filtered(); +} diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index 54704da43cf9c429f3914f0580246dde99aa93c0..2c295ad8e3155d19fdac09d3a02d9274aba3bc62 100644 +index 54704da43cf9c429f3914f0580246dde99aa93c0..87bc4ce78350d95b9337262ba585b44c77213722 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -130,7 +130,7 @@ import org.jetbrains.annotations.Nullable; @@ -2576,7 +2567,7 @@ index 54704da43cf9c429f3914f0580246dde99aa93c0..2c295ad8e3155d19fdac09d3a02d9274 + + // Paper start - data component API + /** -+ * Gets the default data component value for the data type for this ItemType. ++ * Gets the default value of the data component type for this item type. + * + * @param type the data component type + * @param <T> the value type @@ -2590,7 +2581,7 @@ index 54704da43cf9c429f3914f0580246dde99aa93c0..2c295ad8e3155d19fdac09d3a02d9274 + } + + /** -+ * Checks if the data component type has a default value for this ItemType. ++ * Checks if the data component type has a default value for this item type. + * + * @param type the data component type + * @return {@code true} if there is a default value @@ -2602,7 +2593,7 @@ index 54704da43cf9c429f3914f0580246dde99aa93c0..2c295ad8e3155d19fdac09d3a02d9274 + } + + /** -+ * Gets the default data component types for this ItemType. ++ * Gets the default data component types for this item type. + * + * @return an immutable set of data component types + * @throws IllegalArgumentException if {@link #isItem()} is {@code false} @@ -2627,7 +2618,7 @@ index 9725580b6458e5d37fbc6059869604f9883bd6d1..966bbc686280a1b7f479a2ff755e4776 /** * Get the object by its key. diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java -index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a760a9600 100644 +index f603b5b6ba80af919f415322583a8345a5b1358a..2aa473fe063d53373c47a968735afb86f38044f7 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -1031,4 +1031,124 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat @@ -2669,7 +2660,7 @@ index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a + * Checks if the data component type is set on the itemstack. + * + * @param type the data component type -+ * @return true if set, false otherwise ++ * @return {@code true} if set, {@code false} otherwise + */ + @org.jetbrains.annotations.Contract(pure = true) + public boolean hasData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) { @@ -2692,7 +2683,7 @@ index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a + * {@link #resetData(io.papermc.paper.datacomponent.DataComponentType)}. To mark the data component type + * as removed, use {@link #unsetData(io.papermc.paper.datacomponent.DataComponentType)}. + * -+ * @param type component type ++ * @param type the data component type + * @param valueBuilder value builder + * @param <T> value type + */ @@ -2707,7 +2698,7 @@ index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a + * {@link #resetData(io.papermc.paper.datacomponent.DataComponentType)}. To mark the data component type + * as removed, use {@link #unsetData(io.papermc.paper.datacomponent.DataComponentType)}. + * -+ * @param type component type ++ * @param type the data component type + * @param value value to set + * @param <T> value type + */ @@ -2718,7 +2709,7 @@ index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a + /** + * Marks this non-valued data component type as present in this itemstack. + * -+ * @param type type ++ * @param type the data component type + */ + public void setData(final io.papermc.paper.datacomponent.DataComponentType.@NotNull NonValued type) { + this.craftDelegate.setData(type); @@ -2727,7 +2718,7 @@ index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a + /** + * Marks this data component as removed for this itemstack. + * -+ * @param type data component type ++ * @param type the data component type + */ + public void unsetData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) { + this.craftDelegate.unsetData(type); @@ -2737,7 +2728,7 @@ index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a + * Resets the value of this component to be the default + * value for the item type from {@link Material#getDefaultData(io.papermc.paper.datacomponent.DataComponentType.Valued)}. + * -+ * @param type data component type to reset ++ * @param type the data component type + */ + public void resetData(final io.papermc.paper.datacomponent.@NotNull DataComponentType type) { + this.craftDelegate.resetData(type); @@ -2756,7 +2747,7 @@ index f603b5b6ba80af919f415322583a8345a5b1358a..4ffa69f89b4ca15d9f4a53642eced10a + // 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 6bc1853ada3ea38bc36cb31fbb5ce246347fe5d4..955a09822f73a9343ef9bc20b6a27bc169fb5033 100644 +index 6bc1853ada3ea38bc36cb31fbb5ce246347fe5d4..e77b4aa901363bbe6e01579af6d830dfa91942c1 100644 --- a/src/main/java/org/bukkit/inventory/ItemType.java +++ b/src/main/java/org/bukkit/inventory/ItemType.java @@ -2326,4 +2326,31 @@ public interface ItemType extends Keyed, Translatable, net.kyori.adventure.trans @@ -2766,7 +2757,7 @@ index 6bc1853ada3ea38bc36cb31fbb5ce246347fe5d4..955a09822f73a9343ef9bc20b6a27bc1 + + // Paper start - data component API + /** -+ * Gets the default data component value for the data type for this ItemType. ++ * Gets the default value of the data component type for this item type. + * + * @param type the data component type + * @param <T> the value type @@ -2776,15 +2767,15 @@ index 6bc1853ada3ea38bc36cb31fbb5ce246347fe5d4..955a09822f73a9343ef9bc20b6a27bc1 + @Nullable <T> T getDefaultData(io.papermc.paper.datacomponent.DataComponentType.@NotNull Valued<T> type); + + /** -+ * Checks if the data component type has a default value for this ItemType. ++ * Checks if the data component type has a default value for this item type. + * + * @param type the data component type -+ * @return true if there is a default value ++ * @return {@code true} if there is a default value + */ + boolean hasDefaultData(io.papermc.paper.datacomponent.@NotNull DataComponentType type); + + /** -+ * Gets the default data component types for this ItemType. ++ * Gets the default data component types for this item type. + * + * @return an immutable set of data component types + */ |