Interface IFluidStack
- All Superinterfaces:
CommandStringDisplayable,ComponentAccess<IFluidStack>,net.minecraft.core.component.DataComponentHolder
@ZenRegister
public interface IFluidStack
extends CommandStringDisplayable, net.minecraft.core.component.DataComponentHolder, ComponentAccess<IFluidStack>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <U> U_get(net.minecraft.core.component.DataComponentType<? extends U> componentType) default <U> boolean_has(net.minecraft.core.component.DataComponentType<U> componentType) default <U> IFluidStack_with(net.minecraft.core.component.DataComponentType<U> componentType, U value) default <U> IFluidStack_without(net.minecraft.core.component.DataComponentType<U> componentType) applyComponents(net.minecraft.core.component.DataComponentMap map) applyComponents(net.minecraft.core.component.DataComponentPatch patch) default CTFluidIngredientdefault IDataasIData()default IFluidStackdefault CTFluidIngredientasList(CTFluidIngredient other) default IFluidStackMakes this stack mutablecom.mojang.serialization.Codec<IFluidStack> codec()default IFluidStackcopy()Copies the stack.static IFluidStackempty()Gets the empty IFluidStacklongGets the fluid amount in MilliBuckets (mB).default StringReturns the BEP to get this thingynet.minecraft.core.component.PatchedDataComponentMapnet.minecraft.world.level.material.FluidgetFluid()Retrieves this fluid stack's fluid.<T> TGets a copy of the internal FluidStack that this IFluidStack is based on.<T> TGets the internal FluidStack that this IFluidStack is based on.default net.minecraft.resources.ResourceLocationGets the registry name for the fluid this stack is representing.booleanisEmpty()Gets whether this fluid stack is empty.default booleanisFluidEqual(IFluidStack other) booleandefault booleanmatches(IFluidStack other) Checks if this IFluidStack, matches the given IFluidStack by checking if the fluids are the same, and if this fluid's amount is bigger than the given fluid's amountstatic IFluidStackof(net.minecraft.world.level.material.Fluid fluid, long amount) static IFluidStackof(net.minecraft.world.level.material.Fluid fluid, long amount, boolean mutable) static IFluidStackof(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch components) static IFluidStackof(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch components, boolean mutable) static <T> IFluidStackof(T convertable) Gets an IFluidStack from the given T type.static <T> IFluidStackof(T convertable, boolean mutable) Gets an IFluidStack from the given T type.static IFluidStackofMutable(net.minecraft.world.level.material.Fluid fluid, long amount) static IFluidStackofMutable(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch components) static <T> IFluidStackofMutable(T convertable) Gets a mutable IFluidStack from the given T type.<T> IFluidStackremove(net.minecraft.core.component.DataComponentType<T> type) setAmount(int amount) Sets the fluid amount in MilliBuckets (mB)<T> IFluidStackupdate(net.minecraft.core.component.DataComponentType<T> type, T defaultValue, UnaryOperator<T> operator) <T,U> IFluidStack update(net.minecraft.core.component.DataComponentType<T> type, T defaultValue, U data, BiFunction<T, U, T> operator) <T> IFluidStackwith(net.minecraft.core.component.DataComponentType<T> type, T value) withJsonComponent(net.minecraft.core.component.DataComponentType type, IData value) withJsonComponents(IData value) default <T> IFluidStackwithout(net.minecraft.core.component.DataComponentType<T> type) Methods inherited from interface com.blamejared.crafttweaker.api.component.ComponentAccess
creativeSlotLock, getAttributeModifiers, getBannerPatterns, getBaseColor, getBees, getBlockEntityData, getBlockState, getBucketEntityData, getBundleContents, getCanBreak, getCanPlaceOn, getChargedProjectiles, getContainer, getContainerLoot, getCustomData, getCustomModelData, getCustomName, getDamage, getDebugStickState, getDyedColor, getEnchantmentGlintOverride, getEnchantments, getEntityData, getFireworkExplosion, getFireworks, getFood, getInstrument, getItemName, getLock, getLodestoneTracker, getLore, getMapColor, getMapDecorations, getMapId, getMapPostProcessing, getMaxDamage, getMaxStackSize, getNoteBlockSound, getOminousBottleAmplifier, getPotDecorations, getPotionContents, getProfile, getRarity, getRecipes, getStoredEnchantments, getSuspiciousStewEffects, getTool, getTrim, getUnbreakable, getWritableBookContent, getWrittenBookContent, hasAttributeModifiers, hasBannerPatterns, hasBaseColor, hasBees, hasBlockEntityData, hasBlockState, hasBucketEntityData, hasBundleContents, hasCanBreak, hasCanPlaceOn, hasChargedProjectiles, hasContainer, hasContainerLoot, hasCustomData, hasCustomModelData, hasCustomName, hasDamage, hasDebugStickState, hasDyedColor, hasEnchantmentGlintOverride, hasEnchantments, hasEntityData, hasFireworkExplosion, hasFireworks, hasFood, hasInstrument, hasItemName, hasLock, hasLodestoneTracker, hasLore, hasMapColor, hasMapDecorations, hasMapId, hasMapPostProcessing, hasMaxDamage, hasMaxStackSize, hasNoteBlockSound, hasOminousBottleAmplifier, hasPotDecorations, hasPotionContents, hasProfile, hasRarity, hasRecipes, hasRepairCost, hasStoredEnchantments, hasSuspiciousStewEffects, hasTool, hasTrim, hasUnbreakable, hasWritableBookContent, hasWrittenBookContent, hideAdditionalTooltip, hideTooltip, isFireResistant, isIntangibleProjectile, repairCost, withAttributeModifiers, withAttributeModifiers, withAttributeModifiers, withBannerPatterns, withBannerPatterns, withBaseColor, withBees, withBlockEntityData, withBlockEntityData, withBlockState, withBucketEntityData, withBucketEntityData, withBundleContents, withBundleContents, withCanBreak, withCanBreak, withCanPlaceOn, withCanPlaceOn, withChargedProjectiles, withChargedProjectiles, withChargedProjectiles, withContainer, withContainer, withContainerLoot, withContainerLoot, withCreativeSlotLock, withCustomData, withCustomData, withCustomModelData, withCustomModelData, withCustomName, withDamage, withDebugStickState, withDyedColor, withDyedColor, withEnchantment, withEnchantmentGlintOverride, withEnchantments, withEntityData, withEntityData, withFireResistant, withFireworkExplosion, withFireworks, withFireworks, withFood, withHideAdditionalTooltip, withHideTooltip, withInstrument, withIntangibleProjectile, withItemName, withLock, withLock, withLodestoneTracker, withLore, withLore, withLore, withMapColor, withMapColor, withMapDecorations, withMapDecorations, withMapId, withMapId, withMapPostProcessing, withMaxDamage, withMaxStackSize, withNoteBlockSound, withOminousBottleAmplifier, withoutAttributeModifiers, withoutBannerPatterns, withoutBaseColor, withoutBees, withoutBlockEntityData, withoutBlockState, withoutBucketEntityData, withoutBundleContents, withoutCanBreak, withoutCanPlaceOn, withoutChargedProjectiles, withoutContainer, withoutContainerLoot, withoutCreativeSlotLock, withoutCustomData, withoutCustomModelData, withoutCustomName, withoutDamage, withoutDebugStickState, withoutDyedColor, withoutEnchantment, withoutEnchantmentGlintOverride, withoutEnchantments, withoutEntityDate, withoutFireResistant, withoutFireworkExplosion, withoutFireworks, withoutFood, withoutHideAdditionalTooltip, withoutHideTooltip, withoutInstrument, withoutIntangibleProjectile, withoutItemName, withoutLock, withoutLodestoneTracker, withoutLore, withoutMapColor, withoutMapDecorations, withoutMapId, withoutMapPostProcessing, withoutMaxDamage, withoutMaxStackSize, withoutNoteBlockSound, withoutOminousBottleAmplifier, withoutPotDecorations, withoutPotionContents, withoutProfile, withoutRarity, withoutRecipes, withoutRepairCost, withoutStoredEnchantments, withoutSuspiciousStewEffects, withoutTool, withoutTrim, withoutUnbreakable, withoutWritableBookContent, withoutWrittenBookContent, withPotDecorations, withPotDecorations, withPotionContents, withPotionContents, withPotionContents, withPotionContents, withProfile, withRarity, withRecipes, withRepairCost, withStoredEnchantments, withSuspiciousStewEffects, withSuspiciousStewEffects, withTool, withTool, withTrim, withUnbreakable, withUnbreakable, withWritableBookContent, withWritableBookContent, withWrittenBookContentMethods inherited from interface net.minecraft.core.component.DataComponentHolder
get, getOrDefault, has
-
Method Details
-
empty
Gets the empty IFluidStack- Returns:
- The empty IFluidStack
-
of
Gets an IFluidStack from the given T type. On Forge, the only supported T type isnet.minecraftforge.fluids.FluidStack. On Fabric, the only supported T type iscom.blamejared.crafttweaker.impl.fluid.SimpleFluidStack- Parameters:
convertable- An instance of T to convert.- Returns:
- An IFluidStack created from the given T.
- Throws:
IllegalArgumentException- if convertable is not a known type that can be converted
-
of
-
of
static IFluidStack of(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch components) -
of
Gets an IFluidStack from the given T type. On Forge, the only supported T type isnet.minecraftforge.fluids.FluidStack. On Fabric, the only supported T type iscom.blamejared.crafttweaker.impl.fluid.SimpleFluidStack- Parameters:
convertable- An instance of T to convert.mutable- If the returned IFluidStack should be mutable or not- Returns:
- A IFluidStack created from the given T.
- Throws:
IllegalArgumentException- if convertable is not a known type that can be converted
-
of
-
of
static IFluidStack of(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch components, boolean mutable) -
ofMutable
Gets a mutable IFluidStack from the given T type. On Forge, the only supported T type isnet.minecraftforge.fluids.FluidStack. On Fabric, the only supported T type iscom.blamejared.crafttweaker.impl.fluid.SimpleFluidStack- Parameters:
convertable- An instance of T to convert.- Returns:
- A mutable IFluidStack created from the given T.
- Throws:
IllegalArgumentException- if convertable is not a known type that can be converted
-
ofMutable
-
ofMutable
static IFluidStack ofMutable(net.minecraft.world.level.material.Fluid fluid, long amount, net.minecraft.core.component.DataComponentPatch components) -
getRegistryName
default net.minecraft.resources.ResourceLocation getRegistryName()Gets the registry name for the fluid this stack is representing.- Returns:
- A MCResourceLocation representing the registry name.
-
matches
Checks if this IFluidStack, matches the given IFluidStack by checking if the fluids are the same, and if this fluid's amount is bigger than the given fluid's amount- Parameters:
other- other IFluidStack to compare against- Returns:
- true if this fluid contains the other fluid
-
isFluidEqual
-
isEmpty
boolean isEmpty()Gets whether this fluid stack is empty.- Returns:
trueif this stack is empty,falseotherwise.
-
getAmount
long getAmount()Gets the fluid amount in MilliBuckets (mB).- Returns:
- The amount of this fluid
-
setAmount
Sets the fluid amount in MilliBuckets (mB)- Parameters:
amount- The amount to multiply this stack- Returns:
- A new stack, or this stack, depending on if this stack is mutable
- DocParam:
- amount 1000
-
asMutable
Makes this stack mutable- Returns:
- A new Stack, that is mutable.
-
asImmutable
-
isImmutable
boolean isImmutable() -
copy
Copies the stack. Only needed when mutable stacks are involved.- Returns:
- A new stack, that contains the same info as this one
-
getFluid
net.minecraft.world.level.material.Fluid getFluid()Retrieves this fluid stack's fluid.- Returns:
- The fluid.
-
asFluidIngredient
-
asList
-
asIData
-
codec
com.mojang.serialization.Codec<IFluidStack> codec() -
getCommandString
Description copied from interface:CommandStringDisplayableReturns the BEP to get this thingy- Specified by:
getCommandStringin interfaceCommandStringDisplayable
-
getComponents
net.minecraft.core.component.PatchedDataComponentMap getComponents()- Specified by:
getComponentsin interfacenet.minecraft.core.component.DataComponentHolder
-
with
-
without
-
withJsonComponent
-
withJsonComponents
-
remove
-
update
<T,U> IFluidStack update(net.minecraft.core.component.DataComponentType<T> type, T defaultValue, U data, BiFunction<T, U, T> operator) -
update
<T> IFluidStack update(net.minecraft.core.component.DataComponentType<T> type, T defaultValue, UnaryOperator<T> operator) -
applyComponents
-
applyComponents
-
getInternal
<T> T getInternal()Gets the internal FluidStack that this IFluidStack is based on. On Forge, this will be anet.minecraftforge.fluids.FluidStack. On Fabric, this will be acom.blamejared.crafttweaker.impl.fluid.SimpleFluidStackYou may need to specify the type in the call itself at times, like soiFluidStack.<FluidStack>getInternal().getFluid()oriFluidStack.<SimpleFluidStack>getInternal().fluid()- Returns:
- The internal FluidStack that this IFluidStack is based on.
-
getImmutableInternal
<T> T getImmutableInternal()Gets a copy of the internal FluidStack that this IFluidStack is based on. On Forge, this will be anet.minecraftforge.fluids.FluidStack. On Fabric, this will be acom.blamejared.crafttweaker.impl.fluid.SimpleFluidStackYou may need to specify the type in the call itself at times, like soiFluidStack.<FluidStack>getInternal().getFluid()oriFluidStack.<SimpleFluidStack>getInternal().fluid()- Returns:
- A copy of the FluidStack that this IFluidStack is based on.
-
_without
- Specified by:
_withoutin interfaceComponentAccess<IFluidStack>
-
_with
default <U> IFluidStack _with(net.minecraft.core.component.DataComponentType<U> componentType, @Nullable U value) - Specified by:
_within interfaceComponentAccess<IFluidStack>
-
_get
default <U> U _get(net.minecraft.core.component.DataComponentType<? extends U> componentType) - Specified by:
_getin interfaceComponentAccess<IFluidStack>
-
_has
default <U> boolean _has(net.minecraft.core.component.DataComponentType<U> componentType) - Specified by:
_hasin interfaceComponentAccess<IFluidStack>
-