Package org.spongepowered.api.fluid
Interface FluidStack.Builder
- All Superinterfaces:
AbstractBuilder<FluidStack>
,Builder<FluidStack,
,FluidStack.Builder> CopyableBuilder<FluidStack,
,FluidStack.Builder> DataBuilder<FluidStack>
,DataHolderBuilder<FluidStack,
,FluidStack.Builder> DataHolderBuilder.Mutable<FluidStack,
,FluidStack.Builder> ResettableBuilder<FluidStack,
,FluidStack.Builder> SerializableDataHolderBuilder<FluidStack,
,FluidStack.Builder> SerializableDataHolderBuilder.Mutable<FluidStack,
FluidStack.Builder>
- Enclosing interface:
- FluidStack
public static interface FluidStack.Builder
extends SerializableDataHolderBuilder.Mutable<FluidStack,FluidStack.Builder>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolderBuilder
DataHolderBuilder.Immutable<H extends DataHolder.Immutable<H>,
B extends DataHolderBuilder.Immutable<H, B>>, DataHolderBuilder.Mutable<H extends DataHolder.Mutable, B extends DataHolderBuilder.Mutable<H, B>> Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolderBuilder
SerializableDataHolderBuilder.Immutable<H extends SerializableDataHolder.Immutable<H>,
B extends SerializableDataHolderBuilder.Immutable<H, B>>, SerializableDataHolderBuilder.Mutable<H extends SerializableDataHolder.Mutable, B extends SerializableDataHolderBuilder.Mutable<H, B>> -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newFluidStack
based on the desired volume andFluidType
.default FluidStack.Builder
Sets theFluidType
to use to build theFluidStack
.Sets theFluidType
to use to build theFluidStack
.from
(FluidStackSnapshot fluidStackSnapshot) Resets and fills this builder with all the information from the providedFluidStackSnapshot
.volume
(int volume) Sets the desired volume of theFluidStack
.Methods inherited from interface org.spongepowered.api.data.persistence.DataBuilder
build
-
Method Details
-
fluid
Sets theFluidType
to use to build theFluidStack
.- Parameters:
fluidType
- The fluid type- Returns:
- This builder, for chaining
-
fluid
Sets theFluidType
to use to build theFluidStack
.- Parameters:
fluidType
- The fluid type- Returns:
- This builder, for chaining
-
volume
Sets the desired volume of theFluidStack
.Note that the volume is measured in "milli buckets", otherwise read as
mB
. The scaling is as follows: 1 bucket = 1000mB, whereas 1 block usually equals 1000mB.- Parameters:
volume
- The volume- Returns:
- This builder, for chaining
-
build
FluidStack build()Builds a newFluidStack
based on the desired volume andFluidType
. If either are not set (invalid), anIllegalStateException
may be thrown.- Specified by:
build
in interfaceAbstractBuilder<FluidStack>
- Returns:
- The newly created fluid stack
-
from
Resets and fills this builder with all the information from the providedFluidStackSnapshot
.- Parameters:
fluidStackSnapshot
- The fluid stack snapshot to copy data from- Returns:
- This builder, for chaining
-