Uses of Class
net.neoforged.neoforge.fluids.FluidStack
Package
Description
-
Uses of FluidStack in net.neoforged.neoforge.client.extensions.common
Modifier and TypeMethodDescriptiondefault ResourceLocation
IClientFluidTypeExtensions.getFlowingTexture
(FluidStack stack) Returns the reference of the texture to apply to a flowing fluid.default ResourceLocation
IClientFluidTypeExtensions.getOverlayTexture
(FluidStack stack) Returns the reference of the texture to apply to a fluid directly touching a non-opaque block other than air.default ResourceLocation
IClientFluidTypeExtensions.getStillTexture
(FluidStack stack) Returns the reference of the texture to apply to a source fluid.default int
IClientFluidTypeExtensions.getTintColor
(FluidStack stack) Returns the tint applied to the fluid's textures. -
Uses of FluidStack in net.neoforged.neoforge.fluids
Modifier and TypeFieldDescriptionstatic final FluidStack
FluidStack.EMPTY
private final FluidStack
SimpleFluidContent.fluidStack
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<FluidStack> FluidStack.CODEC
A standard codec for fluid stacks that does not accept empty stacks.static final com.mojang.serialization.Codec
<FluidStack> FluidStack.OPTIONAL_CODEC
A standard codec for fluid stacks that accepts empty stacks, serializing them as{}
.static final StreamCodec
<RegistryFriendlyByteBuf, FluidStack> FluidStack.OPTIONAL_STREAM_CODEC
A stream codec for fluid stacks that accepts empty stacks.static final StreamCodec
<RegistryFriendlyByteBuf, FluidStack> FluidStack.STREAM_CODEC
A stream codec for fluid stacks that does not accept empty stacks.Modifier and TypeMethodDescriptionFluidStack.copy()
Creates a copy of this fluid stack.SimpleFluidContent.copy()
FluidStack.copyAndClear()
Creates a copy of this stack with0
amount.FluidStack.copyWithAmount
(int amount) Creates a copy of this fluid stack with the given amount.IFluidTank.drain
(int maxDrain, IFluidHandler.FluidAction action) IFluidTank.drain
(FluidStack resource, IFluidHandler.FluidAction action) IFluidTank.getFluid()
static FluidStack
FluidStack.parseOptional
(HolderLookup.Provider lookupProvider, CompoundTag tag) Tries to parse a fluid stack, defaulting toEMPTY
on parsing failure.FluidStack.split
(int amount) Splits off a stack of the given amount of this stack and reduces this stack by the amount.static FluidStack
FluidUtil.tryFluidTransfer
(IFluidHandler fluidDestination, IFluidHandler fluidSource, int maxAmount, boolean doTransfer) Fill a destination fluid handler from a source fluid handler with a max amount.static FluidStack
FluidUtil.tryFluidTransfer
(IFluidHandler fluidDestination, IFluidHandler fluidSource, FluidStack resource, boolean doTransfer) Fill a destination fluid handler from a source fluid handler using a specific fluid.private static FluidStack
FluidUtil.tryFluidTransfer_Internal
(IFluidHandler fluidDestination, IFluidHandler fluidSource, FluidStack drainable, boolean doTransfer) Internal method for filling a destination fluid handler from a source fluid handler using a specific fluid.Modifier and TypeMethodDescriptionstatic com.mojang.serialization.Codec
<FluidStack> FluidStack.fixedAmountCodec
(int amount) A standard codec for fluid stacks that always deserializes with a fixed amount, and does not accept empty stacks.static Optional
<FluidStack> FluidUtil.getFluidContained
(ItemStack container) Helper method to get the fluid contained in an itemStackstatic com.mojang.serialization.MapCodec
<FluidStack> FluidStack.lenientOtionalFieldOf
(String fieldName) static Optional
<FluidStack> FluidStack.parse
(HolderLookup.Provider lookupProvider, Tag tag) Tries to parse a fluid stack.Modifier and TypeMethodDescriptionstatic boolean
FluidStack.areFluidStackTagsEqual
(FluidStack first, FluidStack second) Deprecated, for removal: This API element is subject to removal in a future version.final boolean
FluidType.canBePlacedInLevel
(BlockAndTintGetter getter, BlockPos pos, FluidStack stack) Returns whether the fluid can be placed in the level.boolean
FluidType.canConvertToSource
(FluidStack stack) Returns whether the fluid can create a source.boolean
FluidType.canHydrate
(FluidStack stack) Returns whether the fluid can hydrate.boolean
FluidStack.containsFluid
(FluidStack other) Deprecated, for removal: This API element is subject to removal in a future version.static SimpleFluidContent
SimpleFluidContent.copyOf
(FluidStack fluidStack) IFluidTank.drain
(FluidStack resource, IFluidHandler.FluidAction action) int
IFluidTank.fill
(FluidStack resource, IFluidHandler.FluidAction action) FluidType.getBucket
(FluidStack stack) Returns the bucket containing the fluid.int
FluidType.getDensity
(FluidStack stack) Returns the density of the fluid.FluidType.getDescription
(FluidStack stack) Returns the component representing the name of the fluid type.FluidType.getDescriptionId
(FluidStack stack) Returns the identifier representing the name of the fluid.static ItemStack
FluidUtil.getFilledBucket
(FluidStack fluidStack) int
FluidType.getLightLevel
(FluidStack stack) Returns the light level emitted by the fluid.FluidType.getRarity
(FluidStack stack) Returns the rarity of the fluid.@Nullable SoundEvent
FluidType.getSound
(FluidStack stack, SoundAction action) Returns a sound to play when a certain action is performed.FluidType.getStateForPlacement
(BlockAndTintGetter getter, BlockPos pos, FluidStack stack) Returns theFluidState
when aFluidStack
is trying to place it.int
FluidType.getTemperature
(FluidStack stack) Returns the temperature of the fluid.int
FluidType.getViscosity
(FluidStack stack) Returns the viscosity, or thickness, of the fluid.static int
FluidStack.hashFluidAndComponents
(@Nullable FluidStack stack) Hashes the fluid and components of this stack, ignoring the amount.boolean
FluidStack.isFluidEqual
(FluidStack other) Deprecated, for removal: This API element is subject to removal in a future version.boolean
FluidStack.isFluidStackIdentical
(FluidStack other) Deprecated, for removal: This API element is subject to removal in a future version.boolean
IFluidTank.isFluidValid
(FluidStack stack) static boolean
FluidStack.isSameFluid
(FluidStack first, FluidStack second) Checks if the two fluid stacks have the same fluid.boolean
SimpleFluidContent.isSameFluid
(FluidStack other) static boolean
FluidStack.isSameFluidSameComponents
(FluidStack first, FluidStack second) Checks if the two fluid stacks have the same fluid and components.boolean
SimpleFluidContent.isSameFluidSameComponents
(FluidStack other) boolean
FluidType.isVaporizedOnPlacement
(Level level, BlockPos pos, FluidStack stack) Determines if this fluid should be vaporized when placed into a level.static boolean
FluidStack.matches
(FluidStack first, FluidStack second) Checks if the two fluid stacks are equal.boolean
SimpleFluidContent.matches
(FluidStack other) void
FluidType.onVaporize
(@Nullable Player player, Level level, BlockPos pos, FluidStack stack) Performs an action when a fluid can be vaporized when placed into a level.static FluidStack
FluidUtil.tryFluidTransfer
(IFluidHandler fluidDestination, IFluidHandler fluidSource, FluidStack resource, boolean doTransfer) Fill a destination fluid handler from a source fluid handler using a specific fluid.private static FluidStack
FluidUtil.tryFluidTransfer_Internal
(IFluidHandler fluidDestination, IFluidHandler fluidSource, FluidStack drainable, boolean doTransfer) Internal method for filling a destination fluid handler from a source fluid handler using a specific fluid.static FluidActionResult
FluidUtil.tryPlaceFluid
(@Nullable Player player, Level level, InteractionHand hand, BlockPos pos, ItemStack container, FluidStack resource) static boolean
FluidUtil.tryPlaceFluid
(@Nullable Player player, Level level, InteractionHand hand, BlockPos pos, IFluidHandler fluidSource, FluidStack resource) Tries to place a fluid resource into the level as a block and drains the fluidSource. -
Uses of FluidStack in net.neoforged.neoforge.fluids.capability
Modifier and TypeMethodDescriptionIFluidHandler.drain
(int maxDrain, IFluidHandler.FluidAction action) Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.IFluidHandler.drain
(FluidStack resource, IFluidHandler.FluidAction action) Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.IFluidHandler.getFluidInTank
(int tank) Returns the FluidStack in a given tank.Modifier and TypeMethodDescriptionIFluidHandler.drain
(FluidStack resource, IFluidHandler.FluidAction action) Drains fluid out of internal tanks, distribution is left entirely to the IFluidHandler.int
IFluidHandler.fill
(FluidStack resource, IFluidHandler.FluidAction action) Fills fluid into internal tanks, distribution is left entirely to the IFluidHandler.boolean
IFluidHandler.isFluidValid
(int tank, FluidStack stack) This function is a way to determine which fluids can exist inside a given handler. -
Uses of FluidStack in net.neoforged.neoforge.fluids.capability.templates
Modifier and TypeMethodDescriptionEmptyFluidHandler.drain
(int maxDrain, IFluidHandler.FluidAction action) EmptyFluidHandler.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidHandlerItemStack.drain
(int maxDrain, IFluidHandler.FluidAction action) FluidHandlerItemStack.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidHandlerItemStackSimple.drain
(int maxDrain, IFluidHandler.FluidAction action) FluidHandlerItemStackSimple.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidTank.drain
(int maxDrain, IFluidHandler.FluidAction action) FluidTank.drain
(FluidStack resource, IFluidHandler.FluidAction action) VoidFluidHandler.drain
(int maxDrain, IFluidHandler.FluidAction action) VoidFluidHandler.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidHandlerItemStack.getFluid()
FluidHandlerItemStackSimple.getFluid()
FluidTank.getFluid()
EmptyFluidHandler.getFluidInTank
(int tank) FluidHandlerItemStack.getFluidInTank
(int tank) FluidHandlerItemStackSimple.getFluidInTank
(int tank) FluidTank.getFluidInTank
(int tank) VoidFluidHandler.getFluidInTank
(int tank) Modifier and TypeMethodDescriptionboolean
FluidHandlerItemStack.canDrainFluidType
(FluidStack fluid) boolean
FluidHandlerItemStackSimple.canDrainFluidType
(FluidStack fluid) boolean
FluidHandlerItemStack.canFillFluidType
(FluidStack fluid) boolean
FluidHandlerItemStackSimple.canFillFluidType
(FluidStack fluid) EmptyFluidHandler.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidHandlerItemStack.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidHandlerItemStackSimple.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidTank.drain
(FluidStack resource, IFluidHandler.FluidAction action) VoidFluidHandler.drain
(FluidStack resource, IFluidHandler.FluidAction action) int
EmptyFluidHandler.fill
(FluidStack resource, IFluidHandler.FluidAction action) int
FluidHandlerItemStack.fill
(FluidStack resource, IFluidHandler.FluidAction doFill) int
FluidHandlerItemStackSimple.fill
(FluidStack resource, IFluidHandler.FluidAction action) int
FluidTank.fill
(FluidStack resource, IFluidHandler.FluidAction action) int
VoidFluidHandler.fill
(FluidStack resource, IFluidHandler.FluidAction action) boolean
EmptyFluidHandler.isFluidValid
(int tank, FluidStack stack) boolean
FluidHandlerItemStack.isFluidValid
(int tank, FluidStack stack) boolean
FluidHandlerItemStackSimple.isFluidValid
(int tank, FluidStack stack) boolean
FluidTank.isFluidValid
(int tank, FluidStack stack) boolean
FluidTank.isFluidValid
(FluidStack stack) boolean
VoidFluidHandler.isFluidValid
(int tank, FluidStack stack) protected void
FluidHandlerItemStack.setFluid
(FluidStack fluid) protected void
FluidHandlerItemStackSimple.setFluid
(FluidStack fluid) void
FluidTank.setFluid
(FluidStack stack) -
Uses of FluidStack in net.neoforged.neoforge.fluids.capability.wrappers
Modifier and TypeMethodDescriptionBucketPickupHandlerWrapper.drain
(int maxDrain, IFluidHandler.FluidAction action) BucketPickupHandlerWrapper.drain
(FluidStack resource, IFluidHandler.FluidAction action) CauldronWrapper.drain
(int maxDrain, IFluidHandler.FluidAction action) private FluidStack
CauldronWrapper.drain
(BlockState state, int maxDrain, IFluidHandler.FluidAction action) CauldronWrapper.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidBucketWrapper.drain
(int maxDrain, IFluidHandler.FluidAction action) FluidBucketWrapper.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidBucketWrapper.getFluid()
BucketPickupHandlerWrapper.getFluidInTank
(int tank) CauldronWrapper.getFluidInTank
(int tank) FluidBucketWrapper.getFluidInTank
(int tank) Modifier and TypeMethodDescriptionboolean
FluidBucketWrapper.canFillFluidType
(FluidStack fluid) BucketPickupHandlerWrapper.drain
(FluidStack resource, IFluidHandler.FluidAction action) CauldronWrapper.drain
(FluidStack resource, IFluidHandler.FluidAction action) FluidBucketWrapper.drain
(FluidStack resource, IFluidHandler.FluidAction action) int
BlockWrapper.fill
(FluidStack resource, IFluidHandler.FluidAction action) int
BlockWrapper.LiquidContainerBlockWrapper.fill
(FluidStack resource, IFluidHandler.FluidAction action) int
BucketPickupHandlerWrapper.fill
(FluidStack resource, IFluidHandler.FluidAction action) int
CauldronWrapper.fill
(FluidStack resource, IFluidHandler.FluidAction action) int
FluidBucketWrapper.fill
(FluidStack resource, IFluidHandler.FluidAction action) boolean
BucketPickupHandlerWrapper.isFluidValid
(int tank, FluidStack stack) boolean
CauldronWrapper.isFluidValid
(int tank, FluidStack stack) boolean
FluidBucketWrapper.isFluidValid
(int tank, FluidStack stack) protected void
FluidBucketWrapper.setFluid
(FluidStack fluidStack) -
Uses of FluidStack in net.neoforged.neoforge.fluids.crafting
Modifier and TypeFieldDescriptionprivate @Nullable FluidStack[]
SizedFluidIngredient.cachedStacks
private final FluidStack[]
DataComponentFluidIngredient.stacks
private @Nullable FluidStack[]
FluidIngredient.stacks
Modifier and TypeMethodDescriptionSizedFluidIngredient.getFluids()
Returns a list of the stacks from thisSizedFluidIngredient.ingredient
, with an updatedSizedFluidIngredient.amount
.final FluidStack[]
FluidIngredient.getStacks()
Returns an array of fluid stacks that this ingredient accepts.Modifier and TypeMethodDescriptionCompoundFluidIngredient.generateStacks()
DataComponentFluidIngredient.generateStacks()
DifferenceFluidIngredient.generateStacks()
protected Stream
<FluidStack> EmptyFluidIngredient.generateStacks()
protected abstract Stream
<FluidStack> FluidIngredient.generateStacks()
Generates a stream of all fluid stacks this ingredient matches against.IntersectionFluidIngredient.generateStacks()
protected Stream
<FluidStack> SingleFluidIngredient.generateStacks()
protected Stream
<FluidStack> TagFluidIngredient.generateStacks()
Modifier and TypeMethodDescriptionstatic FluidIngredient
DataComponentFluidIngredient.of
(boolean strict, FluidStack stack) Creates a new ingredient matching the given fluid, containing the given componentsstatic FluidIngredient
FluidIngredient.of
(FluidStack... fluids) static SizedFluidIngredient
SizedFluidIngredient.of
(FluidStack stack) Helper method to create a simple sized ingredient that matches the given fluid stackstatic FluidIngredient
FluidIngredient.single
(FluidStack stack) boolean
CompoundFluidIngredient.test
(FluidStack stack) boolean
DataComponentFluidIngredient.test
(FluidStack stack) boolean
DifferenceFluidIngredient.test
(FluidStack stack) boolean
EmptyFluidIngredient.test
(FluidStack fluidStack) abstract boolean
FluidIngredient.test
(FluidStack fluidStack) Checks if a given fluid stack matches this ingredient.boolean
IntersectionFluidIngredient.test
(FluidStack stack) boolean
SingleFluidIngredient.test
(FluidStack fluidStack) boolean
SizedFluidIngredient.test
(FluidStack stack) Performs a size-sensitive test on the given stack.boolean
TagFluidIngredient.test
(FluidStack fluidStack) -
Uses of FluidStack in net.neoforged.neoforge.oldtest
Modifier and TypeMethodDescriptionprivate static void
FluidUtilTest.checkFluidStack
(FluidStack stack, Fluid fluid, int amount)
isSameFluidSameComponents(net.neoforged.neoforge.fluids.FluidStack, net.neoforged.neoforge.fluids.FluidStack)
instead.