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 DataHolder
DataHolder.Immutable<I>, DataHolder.MutableNested classes/interfaces inherited from interface SerializableDataHolder
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 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 DataSerializable
contentVersion, toContainer, toViewMethods inherited from interface SerializableDataHolder
validateRawDataMethods inherited from interface SerializableDataHolder.Mutable
setRawDataMethods inherited from interface ValueContainer
get, getDouble, getInt, getKeys, getLong, getOrElse, getOrNull, getValue, getValues, require, requireValue, streamKeys, streamValues, supports, supports
-
Method Details
-
builder
Creates a newFluidStack.Builderto make fluid stacks.- Returns:
- The newly created builder
-
fluid
-
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
-