Package org.spongepowered.api.fluid
Interface FluidStack
-
- All Superinterfaces:
CopyableDataHolder,DataHolder,DataHolder.Mutable,DataSerializable,SerializableDataHolder,SerializableDataHolder.Mutable,ValueContainer
public interface FluidStack extends SerializableDataHolder.Mutable
Represents a stack of a particularFluidTypeand volume measured in "milliBuckets" where1000mB is equal to 1ItemTypes.BUCKET.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceFluidStack.Builder-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.DataHolder
DataHolder.Immutable<I extends DataHolder.Immutable<I>>, DataHolder.Mutable
-
Nested classes/interfaces inherited from interface org.spongepowered.api.data.SerializableDataHolder
SerializableDataHolder.Immutable<I extends SerializableDataHolder.Immutable<I>>, SerializableDataHolder.Mutable
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static FluidStack.Builderbuilder()Creates a newFluidStack.Builderto make fluid stacks.FluidStackcopy()Creates a clone copy of thisCopyableDataHolderas a newCopyableDataHoldersuch that all theValues are safely duplicated to the new instance.FluidStackSnapshotcreateSnapshot()Creates a snapshot of thisFluidStack.FluidTypefluid()Gets theFluidTypefor this fluid stack.FluidStacksetVolume(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, undo
-
Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder
validateRawData
-
Methods inherited from interface org.spongepowered.api.data.SerializableDataHolder.Mutable
setRawData
-
-
-
-
Method Detail
-
builder
static FluidStack.Builder 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
FluidStack setVolume(int volume)
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
-
-