add tons of javadocs

This commit is contained in:
Jake Potrebic 2024-08-10 18:35:36 -07:00
parent 6dbca43abd
commit 699e8f58eb
No known key found for this signature in database
GPG key ID: ECE0B3C133C016C5
2 changed files with 608 additions and 124 deletions

File diff suppressed because it is too large Load diff

View file

@ -657,7 +657,7 @@ index 0000000000000000000000000000000000000000..ac1fcacef8dc8bfb0487e4469d3e25b9
+}
diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PaperBlockItemDataProperties.java b/src/main/java/io/papermc/paper/datacomponent/item/PaperBlockItemDataProperties.java
new file mode 100644
index 0000000000000000000000000000000000000000..892ccd37fc17fa98134fda7867648bda5e170a71
index 0000000000000000000000000000000000000000..1d33a3baa7aedaf7b350835798f9cf4b34016b66
--- /dev/null
+++ b/src/main/java/io/papermc/paper/datacomponent/item/PaperBlockItemDataProperties.java
@@ -0,0 +1,57 @@
@ -693,7 +693,7 @@ index 0000000000000000000000000000000000000000..892ccd37fc17fa98134fda7867648bda
+ }
+
+ @Override
+ public BlockData applyToBlockData(final BlockData blockData) {
+ public BlockData applyTo(final BlockData blockData) {
+ final BlockState state = ((CraftBlockData) blockData).getState();
+ return this.impl.apply(state).createCraftBlockData();
+ }
@ -841,10 +841,10 @@ index 0000000000000000000000000000000000000000..db00e0d68dba2b844377248c8e70b5e2
+}
diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PaperCustomModelData.java b/src/main/java/io/papermc/paper/datacomponent/item/PaperCustomModelData.java
new file mode 100644
index 0000000000000000000000000000000000000000..fdc8b35d7611f4f4788f51cc55fd5dcbdbc1a282
index 0000000000000000000000000000000000000000..a68ae7a3c31094a579a8c307d275847c311e3f86
--- /dev/null
+++ b/src/main/java/io/papermc/paper/datacomponent/item/PaperCustomModelData.java
@@ -0,0 +1,22 @@
@@ -0,0 +1,21 @@
+package io.papermc.paper.datacomponent.item;
+
+import org.bukkit.craftbukkit.util.Handleable;
@ -862,10 +862,9 @@ index 0000000000000000000000000000000000000000..fdc8b35d7611f4f4788f51cc55fd5dcb
+ }
+
+ @Override
+ public int data() {
+ public int id() {
+ return this.impl.value();
+ }
+
+}
diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PaperDyedItemColor.java b/src/main/java/io/papermc/paper/datacomponent/item/PaperDyedItemColor.java
new file mode 100644
@ -930,7 +929,7 @@ index 0000000000000000000000000000000000000000..ff2a81366fcd554451e9b2aa438e9277
+}
diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PaperFireworks.java b/src/main/java/io/papermc/paper/datacomponent/item/PaperFireworks.java
new file mode 100644
index 0000000000000000000000000000000000000000..3cf0d6a24bc860018e3dfec6da09eb11f51272bd
index 0000000000000000000000000000000000000000..d61720f6316b2f7dee05fdb60640dbc600db3210
--- /dev/null
+++ b/src/main/java/io/papermc/paper/datacomponent/item/PaperFireworks.java
@@ -0,0 +1,81 @@
@ -976,7 +975,7 @@ index 0000000000000000000000000000000000000000..3cf0d6a24bc860018e3dfec6da09eb11
+ static final class BuilderImpl implements Fireworks.Builder {
+
+ private final List<FireworkExplosion> effects = new ArrayList<>();
+ private int duration;
+ private int duration = 0; // default set from nms Fireworks component
+
+ @Override
+ public Fireworks.Builder flightDuration(final int duration) {
@ -1959,7 +1958,7 @@ index 0000000000000000000000000000000000000000..104796a363d42c3dea7519e58b1ddafb
+}
diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PaperMapDecorations.java b/src/main/java/io/papermc/paper/datacomponent/item/PaperMapDecorations.java
new file mode 100644
index 0000000000000000000000000000000000000000..1970e41d600719be4352a9c73c04623c9fa2c1bd
index 0000000000000000000000000000000000000000..c6fb021149bf5e5db56bdac9efcc05a4037035d3
--- /dev/null
+++ b/src/main/java/io/papermc/paper/datacomponent/item/PaperMapDecorations.java
@@ -0,0 +1,100 @@
@ -1997,7 +1996,7 @@ index 0000000000000000000000000000000000000000..1970e41d600719be4352a9c73c04623c
+ }
+
+ @Override
+ public Map<String, DecorationEntry> getDecorations() {
+ public Map<String, DecorationEntry> decorations() {
+ if (this.impl.decorations().isEmpty()) {
+ return Collections.emptyMap();
+ }
@ -2451,16 +2450,17 @@ index 0000000000000000000000000000000000000000..c5e2f645d05c73f2a6a7902c8c3aaa92
+}
diff --git a/src/main/java/io/papermc/paper/datacomponent/item/PaperSeededContainerLoot.java b/src/main/java/io/papermc/paper/datacomponent/item/PaperSeededContainerLoot.java
new file mode 100644
index 0000000000000000000000000000000000000000..7c4ccebdbe1985fc0d42a639aa8c8e32f478d031
index 0000000000000000000000000000000000000000..8b8b86f656aba4d964fbdfb91c442962ed119da5
--- /dev/null
+++ b/src/main/java/io/papermc/paper/datacomponent/item/PaperSeededContainerLoot.java
@@ -0,0 +1,61 @@
@@ -0,0 +1,62 @@
+package io.papermc.paper.datacomponent.item;
+
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.key.Key;
+import net.minecraft.core.registries.Registries;
+import net.minecraft.resources.ResourceKey;
+import net.minecraft.world.level.storage.loot.LootTable;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+import org.bukkit.craftbukkit.util.Handleable;
+import org.checkerframework.checker.nullness.qual.NonNull;
@ -2488,7 +2488,7 @@ index 0000000000000000000000000000000000000000..7c4ccebdbe1985fc0d42a639aa8c8e32
+
+ static final class BuilderImpl implements SeededContainerLoot.Builder {
+
+ private long seed = 0;
+ private long seed = LootTable.RANDOMIZE_SEED;
+ private Key key;
+
+ BuilderImpl(final Key key) {
@ -3348,7 +3348,7 @@ index 0000000000000000000000000000000000000000..06476cdd7f8290846e86bdd3837488ca
+}
diff --git a/src/test/java/io/papermc/paper/item/ItemStackDataComponentTest.java b/src/test/java/io/papermc/paper/item/ItemStackDataComponentTest.java
new file mode 100644
index 0000000000000000000000000000000000000000..491397cc89683c75c9e711c40044222b0a53681f
index 0000000000000000000000000000000000000000..0769c462ca0defbe31c10fc7a6d3ba901b382fad
--- /dev/null
+++ b/src/test/java/io/papermc/paper/item/ItemStackDataComponentTest.java
@@ -0,0 +1,387 @@
@ -3527,7 +3527,7 @@ index 0000000000000000000000000000000000000000..491397cc89683c75c9e711c40044222b
+
+ @Test
+ void testCustomModelData() {
+ testWithMeta(new ItemStack(Material.STONE), DataComponentTypes.CUSTOM_MODEL_DATA, CustomModelData.customModelData(1), CustomModelData::data, ItemMeta.class, ItemMeta::getCustomModelData, ItemMeta::setCustomModelData);
+ testWithMeta(new ItemStack(Material.STONE), DataComponentTypes.CUSTOM_MODEL_DATA, CustomModelData.customModelData(1), CustomModelData::id, ItemMeta.class, ItemMeta::getCustomModelData, ItemMeta::setCustomModelData);
+ }
+
+ @Test
@ -3541,7 +3541,7 @@ index 0000000000000000000000000000000000000000..491397cc89683c75c9e711c40044222b
+ .canAlwaysEat(true)
+ .eatSeconds(1.3F)
+ .nutrition(1)
+ .addEffects(List.of(FoodProperties.PossibleEffect.of(new PotionEffect(PotionEffectType.SLOWNESS, 5, 10), 1F)))
+ .addEffects(List.of(FoodProperties.PossibleEffect.possibleEffect(new PotionEffect(PotionEffectType.SLOWNESS, 5, 10), 1F)))
+ .usingConvertsTo(new ItemStack(Material.STONE))
+ .build();
+
@ -3573,12 +3573,12 @@ index 0000000000000000000000000000000000000000..491397cc89683c75c9e711c40044222b
+ .damagePerBlock(1)
+ .defaultMiningSpeed(2F)
+ .addRules(List.of(
+ Tool.Rule.of(
+ Tool.Rule.rule(
+ RegistrySet.keySetFromValues(RegistryKey.BLOCK, List.of(BlockType.STONE, BlockType.GRAVEL)),
+ 2F,
+ TriState.TRUE
+ ),
+ Tool.Rule.of(
+ Tool.Rule.rule(
+ RegistryAccess.registryAccess().getRegistry(RegistryKey.BLOCK).getTag(TagKey.create(RegistryKey.BLOCK, NamespacedKey.minecraft("bamboo_blocks"))),
+ 2F,
+ TriState.TRUE