Package net.neoforged.neoforge.fluids
Class SimpleFluidContent
java.lang.Object
net.neoforged.neoforge.fluids.SimpleFluidContent
- All Implemented Interfaces:
net.minecraft.core.component.DataComponentGetter
,net.minecraft.core.component.DataComponentHolder
,IDataComponentHolderExtension
public class SimpleFluidContent
extends Object
implements net.minecraft.core.component.DataComponentHolder
Stock data component class to hold a
FluidStack
.
A corresponding DataComponentType
must be registered to use this class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<SimpleFluidContent> static final SimpleFluidContent
private final FluidStack
static final net.minecraft.network.codec.StreamCodec
<net.minecraft.network.RegistryFriendlyByteBuf, SimpleFluidContent> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()
static SimpleFluidContent
copyOf
(FluidStack fluidStack) boolean
int
net.minecraft.core.component.DataComponentMap
net.minecraft.world.level.material.Fluid
getFluid()
net.minecraft.core.Holder
<net.minecraft.world.level.material.Fluid> int
hashCode()
boolean
boolean
is
(net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> holder) boolean
is
(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> holders) boolean
is
(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> tag) boolean
is
(net.minecraft.world.level.material.Fluid fluid) boolean
boolean
isEmpty()
boolean
isSameFluid
(FluidStack other) boolean
boolean
boolean
matches
(FluidStack other) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.core.component.DataComponentGetter
get, getOrDefault, getTyped, has
Methods inherited from interface net.minecraft.core.component.DataComponentHolder
get, getAllOfType, getOrDefault, has
Methods inherited from interface net.neoforged.neoforge.common.extensions.IDataComponentHolderExtension
addToTooltip, addToTooltip
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,SimpleFluidContent> STREAM_CODEC -
fluidStack
-
-
Constructor Details
-
SimpleFluidContent
-
-
Method Details
-
copyOf
-
copy
-
isEmpty
public boolean isEmpty() -
getFluid
public net.minecraft.world.level.material.Fluid getFluid() -
getFluidHolder
public net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> getFluidHolder() -
is
public boolean is(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> tag) -
is
public boolean is(net.minecraft.world.level.material.Fluid fluid) -
is
public boolean is(Predicate<net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid>> predicate) -
is
public boolean is(net.minecraft.core.Holder<net.minecraft.world.level.material.Fluid> holder) -
is
public boolean is(net.minecraft.core.HolderSet<net.minecraft.world.level.material.Fluid> holders) -
getAmount
public int getAmount() -
getFluidType
-
is
-
matches
-
isSameFluid
-
isSameFluidSameComponents
-
isSameFluidSameComponents
-
getComponents
public net.minecraft.core.component.DataComponentMap getComponents()- Specified by:
getComponents
in interfacenet.minecraft.core.component.DataComponentHolder
-
equals
-
hashCode
public int hashCode()
-