Uses of Class
net.neoforged.neoforge.fluids.FluidStack
Packages that use FluidStack
Package
Description
-
Uses of FluidStack in net.neoforged.neoforge.client.fluid
Methods in net.neoforged.neoforge.client.fluid with parameters of type FluidStack -
Uses of FluidStack in net.neoforged.neoforge.common.extensions
Methods in net.neoforged.neoforge.common.extensions with parameters of type FluidStackModifier and TypeMethodDescriptiondefault voidIFluidExtension.appendHoverText(FluidStack fluidStack, Item.TooltipContext context, TooltipDisplay display, Consumer<Component> builder, TooltipFlag tooltipFlag) Adds additional tooltip components for the givenFluidStack. -
Uses of FluidStack in net.neoforged.neoforge.event
Methods in net.neoforged.neoforge.event with parameters of type FluidStackModifier and TypeMethodDescriptionstatic FluidTooltipEventEventHooks.onFluidTooltip(FluidStack fluidStack, @Nullable Player entityPlayer, List<Component> list, TooltipFlag flags, Item.TooltipContext context) -
Uses of FluidStack in net.neoforged.neoforge.event.entity.player
Fields in net.neoforged.neoforge.event.entity.player declared as FluidStackMethods in net.neoforged.neoforge.event.entity.player that return FluidStackModifier and TypeMethodDescriptionFluidTooltipEvent.getFluidStack()TheFluidStackwith the tooltip.Constructors in net.neoforged.neoforge.event.entity.player with parameters of type FluidStackModifierConstructorDescriptionFluidTooltipEvent(FluidStack fluidStack, @Nullable Player player, List<Component> list, TooltipFlag flags, Item.TooltipContext context) This event is fired inFluidStack.getTooltipLines(TooltipContext, Player, TooltipFlag), which in turn is called from its respective modded GUI. -
Uses of FluidStack in net.neoforged.neoforge.fluids
Fields in net.neoforged.neoforge.fluids declared as FluidStackModifier and TypeFieldDescriptionstatic final FluidStackFluidStack.EMPTYprivate final FluidStackSimpleFluidContent.fluidStackFields in net.neoforged.neoforge.fluids with type parameters of type FluidStackModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<FluidStack> FluidStack.CODECA standard codec for fluid stacks that does not accept empty stacks.static final com.mojang.serialization.MapCodec<FluidStack> FluidStack.MAP_CODECA standard map codec for fluid stacks that does not accept empty stacks.static final com.mojang.serialization.Codec<FluidStack> FluidStack.OPTIONAL_CODECA standard codec for fluid stacks that accepts empty stacks, serializing them as{}.static final StreamCodec<RegistryFriendlyByteBuf, FluidStack> FluidStack.OPTIONAL_STREAM_CODECA stream codec for fluid stacks that accepts empty stacks.static final StreamCodec<RegistryFriendlyByteBuf, FluidStack> FluidStack.STREAM_CODECA stream codec for fluid stacks that does not accept empty stacks.static final it.unimi.dsi.fastutil.Hash.Strategy<? super FluidStack> FluidStackLinkedSet.TYPE_AND_COMPONENTSMethods in net.neoforged.neoforge.fluids that return FluidStackModifier and TypeMethodDescriptionFluidStackTemplate.apply(int amount, DataComponentPatch additionalPatch) FluidStackTemplate.apply(DataComponentPatch additionalPatch) FluidStack.copy()Creates a copy of this fluid stack.SimpleFluidContent.copy()FluidStack.copyAndClear()Creates a copy of this stack with0amount.FluidStack.copyWithAmount(int amount) Creates a copy of this fluid stack with the given amount.FluidStackTemplate.create()FluidStack.split(int amount) Splits off a stack of the given amount of this stack and reduces this stack by the amount.FluidStack.transmuteCopy(Fluid newFluid) FluidStack.transmuteCopy(Fluid newFluid, int newAmount) private FluidStackFluidStack.transmuteCopyIgnoreEmpty(Fluid newFluid, int newAmount) Methods in net.neoforged.neoforge.fluids that return types with arguments of type FluidStackModifier and TypeMethodDescriptionstatic Set<FluidStack> FluidStackLinkedSet.createTypeAndComponentsSet()static 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 com.mojang.serialization.MapCodec<FluidStack> FluidStack.lenientOptionalFieldOf(String fieldName) Methods in net.neoforged.neoforge.fluids with parameters of type FluidStackModifier and TypeMethodDescriptionfinal booleanFluidType.canBePlacedInLevel(BlockAndLightGetter getter, BlockPos pos, FluidStack stack) Returns whether the fluid can be placed in the level.booleanFluidType.canConvertToSource(FluidStack stack) Returns whether the fluid can create a source.booleanFluidType.canHydrate(FluidStack stack) Returns whether the fluid can hydrate.static SimpleFluidContentSimpleFluidContent.copyOf(FluidStack fluidStack) static FluidStackTemplateFluidStackTemplate.fromNonEmptyStack(FluidStack stack) FluidType.getBucket(FluidStack stack) Returns the bucket containing the fluid.intFluidType.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.intFluidType.getLightLevel(FluidStack stack) Returns the light level emitted by the fluid.FluidType.getRarity(FluidStack stack) Returns the rarity of the fluid.FluidType.getSound(FluidStack stack, SoundAction action) Returns a sound to play when a certain action is performed.FluidType.getStateForPlacement(BlockAndLightGetter getter, BlockPos pos, FluidStack stack) Returns theFluidStatewhen aFluidStackis trying to place it.intFluidType.getTemperature(FluidStack stack) Returns the temperature of the fluid.intFluidType.getViscosity(FluidStack stack) Returns the viscosity, or thickness, of the fluid.static intFluidStack.hashFluidAndComponents(@Nullable FluidStack stack) Hashes the fluid and components of this stack, ignoring the amount.static booleanFluidStack.isSameFluid(FluidStack a, @Nullable FluidStackTemplate b) Returns true if a and b refer to the same fluid, or if a is empty and b is null.static booleanFluidStack.isSameFluid(FluidStack first, FluidStack second) Checks if the two fluid stacks have the same fluid.booleanSimpleFluidContent.isSameFluid(FluidStack other) static booleanFluidStack.isSameFluidSameComponents(FluidStack a, @Nullable FluidStackTemplate b) Compares the fluid and components of this stack against aFluidStackTemplate.static booleanFluidStack.isSameFluidSameComponents(FluidStack first, FluidStack second) Checks if the two fluid stacks have the same fluid and components.booleanSimpleFluidContent.isSameFluidSameComponents(FluidStack other) booleanFluidType.isVaporizedOnPlacement(Level level, BlockPos pos, FluidStack stack) Determines if this fluid should be vaporized when placed into a level.static booleanFluidStack.matches(FluidStack a, @Nullable FluidStackTemplate b) Compares a fluidstack with aFluidStackTemplateas perFluidStack.matches(FluidStack, FluidStack).static booleanFluidStack.matches(FluidStack first, FluidStack second) Checks if the two fluid stacks are equal.booleanSimpleFluidContent.matches(FluidStack other) voidFluidType.onVaporize(@Nullable LivingEntity entity, Level level, BlockPos pos, FluidStack stack) Performs an action when a fluid can be vaporized when placed into a level.Constructors in net.neoforged.neoforge.fluids with parameters of type FluidStack -
Uses of FluidStack in net.neoforged.neoforge.fluids.crafting
Classes in net.neoforged.neoforge.fluids.crafting that implement interfaces with type arguments of type FluidStackModifier and TypeClassDescriptionclassThis class serves as the fluid analogue of an itemIngredient, that is, a representation of both a predicate to testFluidStacks against, and a list of matching stacks for e.g. display purposes.Methods in net.neoforged.neoforge.fluids.crafting with parameters of type FluidStackModifier and TypeMethodDescriptionstatic FluidIngredientDataComponentFluidIngredient.of(boolean strict, FluidStack stack) Creates a new ingredient matching the given fluid, containing the given componentsstatic FluidIngredientFluidIngredient.of(FluidStack... fluids) booleanCompoundFluidIngredient.test(FluidStack stack) booleanCustomDisplayFluidIngredient.test(FluidStack stack) booleanDataComponentFluidIngredient.test(FluidStack stack) booleanDifferenceFluidIngredient.test(FluidStack stack) abstract booleanFluidIngredient.test(FluidStack fluidStack) Checks if a given fluid stack matches this ingredient.booleanIntersectionFluidIngredient.test(FluidStack stack) booleanSimpleFluidIngredient.test(FluidStack fluidStack) booleanSizedFluidIngredient.test(FluidStack stack) Performs a size-sensitive test on the given stack. -
Uses of FluidStack in net.neoforged.neoforge.fluids.crafting.display
Classes in net.neoforged.neoforge.fluids.crafting.display that implement interfaces with type arguments of type FluidStackModifier and TypeClassDescriptionclassBase fluid stack contents factory: directly returns the stacks.Methods in net.neoforged.neoforge.fluids.crafting.display that return FluidStackMethods in net.neoforged.neoforge.fluids.crafting.display with parameters of type FluidStackModifier and TypeMethodDescriptionFluidStackContentsFactory.forStack(FluidStack fluid) ForFluidStacks.forStack(FluidStack fluid) Returns display data for the given fluid stack. -
Uses of FluidStack in net.neoforged.neoforge.transfer.fluid
Subclasses with type arguments of type FluidStack in net.neoforged.neoforge.transfer.fluidModifier and TypeClassDescriptionclassBase implementation of aResourceHandler<FluidResource>backed by a list ofFluidStacks.Fields in net.neoforged.neoforge.transfer.fluid declared as FluidStackModifier and TypeFieldDescriptionprivate final FluidStackFluidResource.innerStackA wrappedFluidStackwhich must never be modified or exposed.Methods in net.neoforged.neoforge.transfer.fluid that return FluidStackModifier and TypeMethodDescriptionprotected FluidStackFluidStacksResourceHandler.copyOf(FluidStack stack) static FluidStackFluidUtil.getFirstStackContained(ItemStack stack) Returns a new fluid stack with the first fluid contents of the given item stack, ignoring the count of the stack.static FluidStackFluidUtil.getStack(ResourceHandler<FluidResource> handler, int index) Returns a new fluid stack with the contents of the handler at the given index.protected FluidStackFluidStacksResourceHandler.getStackFrom(FluidResource resource, int amount) FluidResource.toStack(int amount) Creates aFluidStackof the specified amount.static FluidStackFluidUtil.tryPickupFluid(@Nullable ResourceHandler<FluidResource> destination, @Nullable Player player, Level level, BlockPos pos, @Nullable Direction side, @Nullable TransactionContext transaction) Attempts to pick up a fluid in the level and put it into a fluid handler, first from aBucketPickupblock (such as fluid sources and waterlogged blocks), or second from aCapabilities.Fluid.BLOCKcapability instance.static FluidStackFluidUtil.tryPickupFluid(@Nullable ResourceHandler<FluidResource> destination, @Nullable Player player, Level level, BlockPos pos, @Nullable TransactionContext transaction) Attempts to pick up a fluid in the level from aBucketPickupblock (such as fluid sources and waterlogged blocks) and put it into a fluid handlerprivate static FluidStackFluidUtil.tryPickupFluid(ResourceHandler<FluidResource> destination, @Nullable Player player, Level level, BlockPos pos, BucketPickup bucketPickup, @Nullable TransactionContext transaction) static FluidStackFluidUtil.tryPlaceFluid(@Nullable ResourceHandler<FluidResource> source, @Nullable Player player, Level level, BlockPos pos, boolean validatePlaced, @Nullable TransactionContext transaction) Tries to extract one bucket of a fluid resource from a resource handler and place it into the level as a block.Methods in net.neoforged.neoforge.transfer.fluid with parameters of type FluidStackModifier and TypeMethodDescriptionprotected FluidStackFluidStacksResourceHandler.copyOf(FluidStack stack) intFluidStacksResourceHandler.getAmountFrom(FluidStack stack) FluidStacksResourceHandler.getResourceFrom(FluidStack stack) booleanFluidResource.matches(FluidStack stack) Returns true if this resource matches the fluid and components of the passed stack.booleanFluidStacksResourceHandler.matches(FluidStack stack, FluidResource resource) static FluidResourceFluidResource.of(FluidStack stack) Creates aFluidResourcefor the given fluid stack.Method parameters in net.neoforged.neoforge.transfer.fluid with type arguments of type FluidStackModifier and TypeMethodDescriptionbooleanFluidResource.test(Predicate<FluidStack> predicate) Tests aFluidStackpredicate with the inner stack.Constructors in net.neoforged.neoforge.transfer.fluid with parameters of type FluidStackConstructor parameters in net.neoforged.neoforge.transfer.fluid with type arguments of type FluidStackModifierConstructorDescriptionFluidStacksResourceHandler(NonNullList<FluidStack> stacks, int capacity)