Package org.spongepowered.api.fluid
Interface FluidStack
- All Superinterfaces:
CopyableDataHolder,DataHolder,DataHolder.Mutable,DataSerializable,SerializableDataHolder,SerializableDataHolder.Mutable,ValueContainer
Represents a stack of a particular
FluidType and
volume measured in "milliBuckets" where 1000mB is equal to
1 ItemTypes.BUCKET.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.MutableNested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable -
Method Summary
Modifier and TypeMethodDescriptionstatic FluidStack.Builderbuilder()Creates a newFluidStack.Builderto make fluid stacks.copy()Creates a clone copy of thisCopyableDataHolderas a newCopyableDataHoldersuch that all theValues are safely duplicated to the new instance.Creates a snapshot of thisFluidStack.fluid()Gets theFluidTypefor this fluid stack.setVolume(int volume) Sets the desired volume for this stack.intvolume()Gets the "volume" of thisFluidStack.Methods inherited from interface org.spongepowered.api.data.DataHolder.Mutable
copyFrom, copyFrom, offer, offer, offer, offer, offerAll, offerAll, offerAll, offerAll, offerAll, offerAll, offerSingle, offerSingle, offerSingle, offerSingle, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeKey, removeKey, removeSingle, removeSingle, transform, transform, tryOffer, tryOffer, tryOffer, undoMethods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainerMethods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawDataMethods inherited from interface org.spongepowered.api.data.SerializableDataHolder.Mutable
setRawData
-
Method Details
-
builder
Creates a newFluidStack.Builderto make fluid stacks.- Returns:
- The newly created builder
-
fluid
FluidType fluid()Gets theFluidTypefor this fluid stack.- Returns:
- The fluid type of this stack
-
volume
int volume()Gets the "volume" of thisFluidStack.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.- Returns:
- The volume in milli buckets
-
setVolume
Sets the desired volume for this stack.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 to set- Returns:
- This fluid stack
-
createSnapshot
FluidStackSnapshot createSnapshot()Creates a snapshot of thisFluidStack.- Returns:
- The fluid stack snapshot
-
copy
FluidStack copy()Description copied from interface:CopyableDataHolderCreates a clone copy of thisCopyableDataHolderas a newCopyableDataHoldersuch that all theValues are safely duplicated to the new instance. It is not guaranteed that the returning container is of the same type as this container.- Specified by:
copyin interfaceCopyableDataHolder- Specified by:
copyin interfaceSerializableDataHolder- Specified by:
copyin interfaceSerializableDataHolder.Mutable- Returns:
- The new copy
-