Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.block.banner.Pattern;
Expand All @@ -15,7 +16,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface BannerPatternLayers {
public interface BannerPatternLayers extends BuildableDataComponent<BannerPatternLayers, BannerPatternLayers.Builder> {

@Contract(value = "_ -> new", pure = true)
static BannerPatternLayers bannerPatternLayers(final List<Pattern> patterns) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.item.blocksattacks.DamageReduction;
import io.papermc.paper.datacomponent.item.blocksattacks.ItemDamageFunction;
Expand All @@ -20,7 +21,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface BlocksAttacks {
public interface BlocksAttacks extends BuildableDataComponent<BlocksAttacks, BlocksAttacks.Builder> {

@Contract(value = "-> new", pure = true)
static Builder blocksAttacks() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.inventory.ItemStack;
Expand All @@ -15,7 +16,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface BundleContents {
public interface BundleContents extends BuildableDataComponent<BundleContents, BundleContents.Builder> {

@Contract(value = "_ -> new", pure = true)
static BundleContents bundleContents(final List<ItemStack> contents) {
Expand Down Expand Up @@ -61,5 +62,15 @@ interface Builder extends DataComponentBuilder<BundleContents> {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder addAll(List<ItemStack> stacks);

/**
* Sets items to this builder.
*
* @param stacks items
* @return the builder for chaining
* @see #contents()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder stacks(List<ItemStack> stacks);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.inventory.ItemStack;
Expand All @@ -15,7 +16,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ChargedProjectiles {
public interface ChargedProjectiles extends BuildableDataComponent<ChargedProjectiles, ChargedProjectiles.Builder> {

@Contract(value = "_ -> new", pure = true)
static ChargedProjectiles chargedProjectiles(final List<ItemStack> projectiles) {
Expand Down Expand Up @@ -61,5 +62,15 @@ interface Builder extends DataComponentBuilder<ChargedProjectiles> {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder addAll(List<ItemStack> stacks);

/**
* Sets the projectiles to be loaded in this builder.
*
* @param stacks projectiles
* @return the builder for chaining
* @see #projectiles()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder stacks(List<ItemStack> stacks);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.Color;
Expand All @@ -16,7 +17,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface CustomModelData {
public interface CustomModelData extends BuildableDataComponent<CustomModelData, CustomModelData.Builder> {

@Contract(value = "-> new", pure = true)
static CustomModelData.Builder customModelData() {
Expand Down Expand Up @@ -82,6 +83,16 @@ interface Builder extends DataComponentBuilder<CustomModelData> {
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder addFloats(List<Float> floats);

/**
* Sets multiple floats to this custom model data.
*
* @param floats the floats
* @return the builder for chaining
* @see #floats()
*/
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder floats(List<Float> floats);

/**
* Adds a flag to this custom model data.
*
Expand All @@ -102,6 +113,16 @@ interface Builder extends DataComponentBuilder<CustomModelData> {
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder addFlags(List<Boolean> flags);

/**
* Sets multiple flags to this custom model data.
*
* @param flags the flags
* @return the builder for chaining
* @see #flags()
*/
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder flags(List<Boolean> flags);

/**
* Adds a string to this custom model data.
*
Expand All @@ -122,6 +143,16 @@ interface Builder extends DataComponentBuilder<CustomModelData> {
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder addStrings(List<String> strings);

/**
* Sets multiple strings to this custom model data.
*
* @param strings the strings
* @return the builder for chaining
* @see #strings()
*/
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder strings(List<String> strings);

/**
* Adds a color to this custom model data.
*
Expand All @@ -141,5 +172,15 @@ interface Builder extends DataComponentBuilder<CustomModelData> {
*/
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder addColors(List<Color> colors);

/**
* Sets multiple colors to this custom model data.
*
* @param colors the colors
* @return the builder for chaining
* @see #colors()
*/
@Contract(value = "_ -> this", mutates = "this")
CustomModelData.Builder colors(List<Color> colors);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.item.consumable.ConsumeEffect;
import java.util.List;
Expand All @@ -15,7 +16,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface DeathProtection {
public interface DeathProtection extends BuildableDataComponent<DeathProtection, DeathProtection.Builder> {

@Contract(value = "_ -> new", pure = true)
static DeathProtection deathProtection(final List<ConsumeEffect> deathEffects) {
Expand All @@ -42,5 +43,8 @@ interface Builder extends DataComponentBuilder<DeathProtection> {

@Contract(value = "_ -> this", mutates = "this")
Builder addEffects(List<ConsumeEffect> effects);

@Contract(value = "_ -> this", mutates = "this")
Builder effects(List<ConsumeEffect> effects);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import org.bukkit.Color;
import org.jetbrains.annotations.ApiStatus;
Expand All @@ -13,7 +14,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface DyedItemColor {
public interface DyedItemColor extends BuildableDataComponent<DyedItemColor, DyedItemColor.Builder> {

@Contract(value = "_, _ -> new", pure = true)
static DyedItemColor dyedItemColor(final Color color) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.FireworkEffect;
Expand All @@ -16,7 +17,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface Fireworks {
public interface Fireworks extends BuildableDataComponent<Fireworks, Fireworks.Builder> {

@Contract(value = "_, _ -> new", pure = true)
static Fireworks fireworks(final List<FireworkEffect> effects, final int flightDuration) {
Expand Down Expand Up @@ -80,5 +81,15 @@ interface Builder extends DataComponentBuilder<Fireworks> {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder addEffects(List<FireworkEffect> effects);

/**
* Sets explosions to this builder.
*
* @param effects effects
* @return the builder for chaining
* @see #effects()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder effects(List<FireworkEffect> effects);
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.block.BlockPredicate;
import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.jetbrains.annotations.ApiStatus;
Expand All @@ -16,7 +17,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemAdventurePredicate {
public interface ItemAdventurePredicate extends BuildableDataComponent<ItemAdventurePredicate, ItemAdventurePredicate.Builder> {

@Contract(value = "_ -> new", pure = true)
static ItemAdventurePredicate itemAdventurePredicate(final List<BlockPredicate> predicates) {
Expand Down Expand Up @@ -61,5 +62,15 @@ interface Builder extends DataComponentBuilder<ItemAdventurePredicate> {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder addPredicates(List<BlockPredicate> predicates);

/**
* Sets block predicates to this builder.
*
* @param predicates predicates
* @return the builder for chaining
* @see #predicates()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder predicates(List<BlockPredicate> predicates);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import org.bukkit.inventory.meta.trim.ArmorTrim;
import org.jetbrains.annotations.ApiStatus;
Expand All @@ -13,7 +14,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemArmorTrim {
public interface ItemArmorTrim extends BuildableDataComponent<ItemArmorTrim, ItemArmorTrim.Builder> {

@Contract(value = "_ -> new", pure = true)
static ItemArmorTrim.Builder itemArmorTrim(final ArmorTrim armorTrim) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import io.papermc.paper.datacomponent.item.attribute.AttributeModifierDisplay;
import java.util.List;
Expand All @@ -18,7 +19,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemAttributeModifiers {
public interface ItemAttributeModifiers extends BuildableDataComponent<ItemAttributeModifiers, ItemAttributeModifiers.Builder> {

@Contract(value = "-> new", pure = true)
static ItemAttributeModifiers.Builder itemAttributes() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import org.bukkit.inventory.ItemStack;
Expand All @@ -15,7 +16,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemContainerContents {
public interface ItemContainerContents extends BuildableDataComponent<ItemContainerContents, ItemContainerContents.Builder> {

@Contract(value = "_ -> new", pure = true)
static ItemContainerContents containerContents(final List<ItemStack> contents) {
Expand Down Expand Up @@ -58,5 +59,15 @@ interface Builder extends DataComponentBuilder<ItemContainerContents> {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder addAll(List<ItemStack> stacks);

/**
* Sets item stacks to the container.
*
* @param stacks the item stacks
* @return the builder for chaining
* @see #contents()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder stacks(List<ItemStack> stacks);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.Map;
import org.bukkit.enchantments.Enchantment;
Expand All @@ -17,7 +18,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemEnchantments {
public interface ItemEnchantments extends BuildableDataComponent<ItemEnchantments, ItemEnchantments.Builder> {

@Contract(value = "_, _ -> new", pure = true)
static ItemEnchantments itemEnchantments(final Map<Enchantment, @IntRange(from = 1, to = 255) Integer> enchantments) {
Expand Down Expand Up @@ -64,5 +65,15 @@ interface Builder extends DataComponentBuilder<ItemEnchantments> {
*/
@Contract(value = "_ -> this", mutates = "this")
Builder addAll(Map<Enchantment, @IntRange(from = 1, to = 255) Integer> enchantments);

/**
* Sets enchantments with the given level to this component.
*
* @param enchantments enchantments
* @return the builder for chaining
* @see #enchantments()
*/
@Contract(value = "_ -> this", mutates = "this")
Builder enchantments(Map<Enchantment, @IntRange(from = 1, to = 255) Integer> enchantments);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.papermc.paper.datacomponent.item;

import io.papermc.paper.datacomponent.BuildableDataComponent;
import io.papermc.paper.datacomponent.DataComponentBuilder;
import java.util.List;
import net.kyori.adventure.text.Component;
Expand All @@ -16,7 +17,7 @@
@NullMarked
@ApiStatus.Experimental
@ApiStatus.NonExtendable
public interface ItemLore {
public interface ItemLore extends BuildableDataComponent<ItemLore, ItemLore.Builder> {

@Contract(value = "_ -> new", pure = true)
static ItemLore lore(final List<? extends ComponentLike> lines) {
Expand Down
Loading