Interface ItemStack.Builder
- 
- All Superinterfaces:
- AbstractBuilder<ItemStack>,- Buildable.Builder<ItemStack>,- Builder<ItemStack,ItemStack.Builder>,- CopyableBuilder<ItemStack,ItemStack.Builder>,- DataHolderBuilder<ItemStack,ItemStack.Builder>,- DataHolderBuilder.Mutable<ItemStack,ItemStack.Builder>,- ResettableBuilder<ItemStack,ItemStack.Builder>
 - Enclosing interface:
- ItemStack
 
 public static interface ItemStack.Builder extends DataHolderBuilder.Mutable<ItemStack,ItemStack.Builder> 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolderBuilderDataHolderBuilder.Immutable<H extends DataHolder.Immutable<H>,B extends DataHolderBuilder.Immutable<H,B>>, DataHolderBuilder.Mutable<H extends DataHolder.Mutable,B extends DataHolderBuilder.Mutable<H,B>>
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ItemStack.Builderapply(Predicate<ItemStack.Builder> predicate, Consumer<ItemStack.Builder> consumer)default ItemStack.BuilderattributeModifier(Supplier<? extends AttributeType> attributeType, AttributeModifier modifier, DefaultedRegistryReference<? extends EquipmentType> equipmentType)Adds anAttributeModifierto this item stack.ItemStack.BuilderattributeModifier(AttributeType attributeType, AttributeModifier modifier, EquipmentType equipmentType)Adds anAttributeModifierto this item stack.ItemStackbuild()Builds an instance of an ItemStack.ItemTypecurrentItem()ItemStack.BuilderfromBlockSnapshot(BlockSnapshot blockSnapshot)Attempts to reconstruct aBlockSnapshotincluding all data andBlockEntityrelated data if necessary for creating anItemStackrepresentation.default ItemStack.BuilderfromBlockState(Supplier<? extends BlockState> blockState)Sets the data to recreate aBlockStatein a heldItemStackstate.ItemStack.BuilderfromBlockState(BlockState blockState)Sets the data to recreate aBlockStatein a heldItemStackstate.ItemStack.BuilderfromContainer(DataView container)Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()including all custom data.ItemStack.BuilderfromItemStack(ItemStack itemStack)Sets all the settings in this builder from the item stack blueprint.default ItemStack.BuilderfromSnapshot(ItemStackSnapshot snapshot)Reconstructs this builder to use theItemStackSnapshotfor all the values and data it may contain.default ItemStack.BuilderitemType(Supplier<? extends ItemType> itemType)Sets theItemTypeof the item stack.ItemStack.BuilderitemType(ItemType itemType)Sets theItemTypeof the item stack.ItemStack.Builderquantity(int quantity)Sets the quantity of the item stack.
 
- 
- 
- 
Method Detail- 
itemTypeItemStack.Builder itemType(ItemType itemType) Sets theItemTypeof the item stack.- Parameters:
- itemType- The type of item
- Returns:
- This builder, for chaining
 
 - 
itemTypedefault ItemStack.Builder itemType(Supplier<? extends ItemType> itemType) Sets theItemTypeof the item stack.- Parameters:
- itemType- The type of item
- Returns:
- This builder, for chaining
 
 - 
currentItemItemType currentItem() 
 - 
quantityItemStack.Builder quantity(int quantity) throws IllegalArgumentException Sets the quantity of the item stack.- Parameters:
- quantity- The quantity of the item stack
- Returns:
- This builder, for chaining
- Throws:
- IllegalArgumentException- If the quantity is outside the allowed bounds
 
 - 
fromItemStackItemStack.Builder fromItemStack(ItemStack itemStack) Sets all the settings in this builder from the item stack blueprint.- Parameters:
- itemStack- The item stack to copy
- Returns:
- This builder, for chaining
 
 - 
attributeModifierdefault ItemStack.Builder attributeModifier(Supplier<? extends AttributeType> attributeType, AttributeModifier modifier, DefaultedRegistryReference<? extends EquipmentType> equipmentType) Adds anAttributeModifierto this item stack.- Parameters:
- attributeType- The Attribute type.
- modifier- The Attribute modifier.
- equipmentType- The equipment type this- AttributeModifierwill apply to.
- Returns:
- This builder, for chaining
 
 - 
attributeModifierItemStack.Builder attributeModifier(AttributeType attributeType, AttributeModifier modifier, EquipmentType equipmentType) Adds anAttributeModifierto this item stack.- Parameters:
- attributeType- The Attribute type.
- modifier- The Attribute modifier.
- equipmentType- The equipment type this- AttributeModifierwill apply to.
- Returns:
- This builder, for chaining
 
 - 
fromBlockStateItemStack.Builder fromBlockState(BlockState blockState) Sets the data to recreate aBlockStatein a heldItemStackstate.- Parameters:
- blockState- The block state to use
- Returns:
- This builder, for chaining
 
 - 
fromBlockStatedefault ItemStack.Builder fromBlockState(Supplier<? extends BlockState> blockState) Sets the data to recreate aBlockStatein a heldItemStackstate.- Parameters:
- blockState- The block state to use
- Returns:
- This builder, for chaining
 
 - 
fromContainerItemStack.Builder fromContainer(DataView container) Attempts to reconstruct the builder with all of the data fromDataSerializable.toContainer()including all custom data.- Parameters:
- container- The container to translate
- Returns:
- This builder, for chaining
 
 - 
fromSnapshotdefault ItemStack.Builder fromSnapshot(ItemStackSnapshot snapshot) Reconstructs this builder to use theItemStackSnapshotfor all the values and data it may contain.- Parameters:
- snapshot- The snapshot
- Returns:
- This builder, for chaining
 
 - 
fromBlockSnapshotItemStack.Builder fromBlockSnapshot(BlockSnapshot blockSnapshot) Attempts to reconstruct aBlockSnapshotincluding all data andBlockEntityrelated data if necessary for creating anItemStackrepresentation.- Parameters:
- blockSnapshot- The snapshot to use
- Returns:
- This builder, for chaining
 
 - 
applydefault ItemStack.Builder apply(Predicate<ItemStack.Builder> predicate, Consumer<ItemStack.Builder> consumer) 
 - 
buildItemStack build() throws IllegalStateException Builds an instance of an ItemStack.- Specified by:
- buildin interface- AbstractBuilder<ItemStack>
- Specified by:
- buildin interface- Buildable.Builder<ItemStack>
- Returns:
- A new instance of an ItemStack
- Throws:
- IllegalStateException- If the item stack is not completed
 
 
- 
 
-