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 particularFluidType
and volume measured in "milliBuckets" where1000
mB is equal to 1ItemTypes.BUCKET
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
FluidStack.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.Builder
builder()
Creates a newFluidStack.Builder
to make fluid stacks.FluidStack
copy()
Creates a clone copy of thisCopyableDataHolder
as a newCopyableDataHolder
such that all theValue
s are safely duplicated to the new instance.FluidStackSnapshot
createSnapshot()
Creates a snapshot of thisFluidStack
.FluidType
fluid()
Gets theFluidType
for this fluid stack.FluidStack
setVolume(int volume)
Sets the desired volume for this stack.int
volume()
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.Builder
to make fluid stacks.- Returns:
- The newly created builder
-
fluid
FluidType fluid()
Gets theFluidType
for 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:CopyableDataHolder
Creates a clone copy of thisCopyableDataHolder
as a newCopyableDataHolder
such that all theValue
s 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:
copy
in interfaceCopyableDataHolder
- Specified by:
copy
in interfaceSerializableDataHolder
- Specified by:
copy
in interfaceSerializableDataHolder.Mutable
- Returns:
- The new copy
-
-