public class Fluid extends java.lang.Object implements Identifiable, Storable, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
static int |
bucketVolume
1000 liters = 1 cubic meter
|
FluidFactory |
factory |
| Constructor and Description |
|---|
Fluid() |
| Modifier and Type | Method and Description |
|---|---|
int |
add(int amount)
Adds fluid to this FluidStack
|
int |
amount() |
Fluid |
clone() |
boolean |
equals(java.lang.Object o) |
java.util.Optional<BlockFactory> |
getBlockFactory()
Gets the block associated with this fluid.
|
java.lang.String |
getID()
Get the ID to identify this object by
|
int |
hashCode() |
void |
load(Data data)
Loads all the data for this object.
|
int |
remove(int amount)
Removes fluid to this FluidStack
|
boolean |
sameType(Fluid stack)
Check if this FluidStack is of type of another FluidStack
|
void |
save(Data data)
Saves all the data of this object.
|
Fluid |
setAmount(int amount)
Sets new size of this FluidStack
Note that there can never be fluid with "zero" amount.
|
Fluid |
withAmount(int amount)
Returns new FluidStack of the same
Fluid with specified fluid |
finalize, getClass, notify, notifyAll, toString, wait, wait, waitsameTypepublic static final int bucketVolume
public FluidFactory factory
public int amount()
public Fluid setAmount(int amount)
amount - New sizethis instancepublic int add(int amount)
amount - Amount of fluid to addpublic int remove(int amount)
amount - Amount of fluid to removepublic Fluid clone()
clone in class java.lang.Objectpublic Fluid withAmount(int amount)
Fluid with specified fluidamount - Amount of fluid in cloned FluidStackpublic java.util.Optional<BlockFactory> getBlockFactory()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic boolean sameType(Fluid stack)
stack - The another Fluidpublic final java.lang.String getID()
IdentifiablegetID in interface Identifiablepublic int hashCode()
hashCode in class java.lang.Object