public class FluidStack
extends java.lang.Object
isFluidStackIdentical(FluidStack)
to determine if FluidID, Amount and NBT Tag are all
equal.Modifier and Type | Field and Description |
---|---|
private int |
amount |
static FluidStack |
EMPTY |
private IRegistryDelegate<Fluid> |
fluidDelegate |
private boolean |
isEmpty |
private static org.apache.logging.log4j.Logger |
LOGGER |
private CompoundNBT |
tag |
Constructor and Description |
---|
FluidStack(Fluid fluid,
int amount) |
FluidStack(Fluid fluid,
int amount,
CompoundNBT nbt) |
FluidStack(FluidStack stack,
int amount) |
Modifier and Type | Method and Description |
---|---|
static boolean |
areFluidStackTagsEqual(FluidStack stack1,
FluidStack stack2)
Determines if the NBT Tags are equal.
|
boolean |
containsFluid(FluidStack other)
Determines if the Fluids are equal and this stack is larger.
|
FluidStack |
copy() |
boolean |
equals(java.lang.Object o)
Default equality comparison for a FluidStack.
|
int |
getAmount() |
CompoundNBT |
getChildTag(java.lang.String childName) |
ITextComponent |
getDisplayName() |
Fluid |
getFluid() |
CompoundNBT |
getOrCreateChildTag(java.lang.String childName) |
CompoundNBT |
getOrCreateTag() |
Fluid |
getRawFluid() |
CompoundNBT |
getTag() |
java.lang.String |
getTranslationKey() |
void |
grow(int amount) |
int |
hashCode() |
boolean |
hasTag() |
boolean |
isEmpty() |
boolean |
isFluidEqual(FluidStack other)
Determines if the FluidIDs and NBT Tags are equal.
|
boolean |
isFluidEqual(ItemStack other)
Determines if the FluidIDs and NBT Tags are equal compared to a registered container
ItemStack.
|
boolean |
isFluidStackIdentical(FluidStack other)
Determines if the FluidIDs, Amounts, and NBT Tags are all equal.
|
private boolean |
isFluidStackTagEqual(FluidStack other) |
static FluidStack |
loadFluidStackFromNBT(CompoundNBT nbt)
This provides a safe method for retrieving a FluidStack - if the Fluid is invalid, the stack
will return as null.
|
static FluidStack |
readFromPacket(PacketBuffer buf) |
void |
removeChildTag(java.lang.String childName) |
void |
setAmount(int amount) |
void |
setTag(CompoundNBT tag) |
void |
shrink(int amount) |
protected void |
updateEmpty() |
CompoundNBT |
writeToNBT(CompoundNBT nbt) |
void |
writeToPacket(PacketBuffer buf) |
private static final org.apache.logging.log4j.Logger LOGGER
public static final FluidStack EMPTY
private boolean isEmpty
private int amount
private CompoundNBT tag
private IRegistryDelegate<Fluid> fluidDelegate
public FluidStack(Fluid fluid, int amount)
public FluidStack(Fluid fluid, int amount, CompoundNBT nbt)
public FluidStack(FluidStack stack, int amount)
public static FluidStack loadFluidStackFromNBT(CompoundNBT nbt)
public CompoundNBT writeToNBT(CompoundNBT nbt)
public void writeToPacket(PacketBuffer buf)
public static FluidStack readFromPacket(PacketBuffer buf)
public final Fluid getFluid()
public final Fluid getRawFluid()
public boolean isEmpty()
protected void updateEmpty()
public int getAmount()
public void setAmount(int amount)
public void grow(int amount)
public void shrink(int amount)
public boolean hasTag()
public CompoundNBT getTag()
public void setTag(CompoundNBT tag)
public CompoundNBT getOrCreateTag()
public CompoundNBT getChildTag(java.lang.String childName)
public CompoundNBT getOrCreateChildTag(java.lang.String childName)
public void removeChildTag(java.lang.String childName)
public ITextComponent getDisplayName()
public java.lang.String getTranslationKey()
public FluidStack copy()
public boolean isFluidEqual(@Nonnull FluidStack other)
other
- The FluidStack for comparisonprivate boolean isFluidStackTagEqual(FluidStack other)
public static boolean areFluidStackTagsEqual(@Nonnull FluidStack stack1, @Nonnull FluidStack stack2)
public boolean containsFluid(@Nonnull FluidStack other)
other
- public boolean isFluidStackIdentical(FluidStack other)
other
- - the FluidStack for comparisonpublic boolean isFluidEqual(@Nonnull ItemStack other)
other
- The ItemStack for comparisonpublic final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object