Package dev.architectury.core.fluid
Class SimpleArchitecturyFluidAttributes
java.lang.Object
dev.architectury.core.fluid.SimpleArchitecturyFluidAttributes
- All Implemented Interfaces:
ArchitecturyFluidAttributes
public class SimpleArchitecturyFluidAttributes
extends Object
implements ArchitecturyFluidAttributes
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSimpleArchitecturyFluidAttributes(Supplier<? extends net.minecraft.world.level.material.Fluid> flowingFluid, Supplier<? extends net.minecraft.world.level.material.Fluid> sourceFluid) -
Method Summary
Modifier and TypeMethodDescriptionblock(RegistrySupplier<? extends net.minecraft.world.level.block.LiquidBlock> block) blockSupplier(Supplier<RegistrySupplier<? extends net.minecraft.world.level.block.LiquidBlock>> block) bucketItem(RegistrySupplier<net.minecraft.world.item.Item> bucketItem) bucketItem(Supplier<? extends Optional<net.minecraft.world.item.Item>> bucketItem) bucketItemSupplier(Supplier<RegistrySupplier<net.minecraft.world.item.Item>> bucketItem) booleanReturns whether this fluid can be converted to a source block when a flowing fluid is adjacent to two source blocks.color(int color) convertToSource(boolean canConvertToSource) density(int density) dropOff(int dropOff) emptySound(net.minecraft.sounds.SoundEvent emptySound) explosionResistance(float explosionResistance) fillSound(net.minecraft.sounds.SoundEvent fillSound) flowingTexture(net.minecraft.resources.ResourceLocation flowingTexture) @Nullable net.minecraft.world.level.block.LiquidBlockgetBlock()Returns the block form of this fluid.@Nullable net.minecraft.world.item.ItemReturns the filled bucket item for this fluid.intgetColor(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the color of the fluid.intgetDensity(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the density of the fluid, this is 1000 for water and 3000 for lava on forge.intgetDropOff(@Nullable net.minecraft.world.level.LevelReader level) Returns the drop in fluid level per block travelled.@Nullable net.minecraft.sounds.SoundEventgetEmptySound(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the empty sound of the fluid.floatReturns the explosion resistance of this fluid.@Nullable net.minecraft.sounds.SoundEventgetFillSound(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the fill sound of the fluid.final net.minecraft.world.level.material.FluidReturns the flowing fluid.net.minecraft.resources.ResourceLocationgetFlowingTexture(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the texture location of this fluid in its flowing form.intgetLuminosity(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the luminosity of the fluid, this is between 0 and 15.net.minecraft.resources.ResourceLocationgetOverlayTexture(@Nullable net.minecraft.world.level.material.FluidState state, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the overlay texture location of this fluid behind transparent blocks.net.minecraft.world.item.RaritygetRarity(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the rarity of the fluid.intgetSlopeFindDistance(@Nullable net.minecraft.world.level.LevelReader level) Returns the maximum distance this fluid will consider as a flowable hole candidate.final net.minecraft.world.level.material.FluidReturns the still fluid.net.minecraft.resources.ResourceLocationgetSourceTexture(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the texture location of this fluid in its source form.intgetTemperature(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the temperature of the fluid.intgetTickDelay(@Nullable net.minecraft.world.level.LevelReader level) Returns the tick delay between each flow update.@Nullable StringgetTranslationKey(@Nullable FluidStack stack) Returns the translation key of the name of this fluid.intgetViscosity(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the viscosity of the fluid.booleanisLighterThanAir(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns whether this fluid is lighter than air.lighterThanAir(boolean lighterThanAir) luminosity(int luminosity) of(Supplier<? extends net.minecraft.world.level.material.Fluid> flowingFluid, Supplier<? extends net.minecraft.world.level.material.Fluid> sourceFluid) ofSupplier(Supplier<? extends Supplier<? extends net.minecraft.world.level.material.Fluid>> flowingFluid, Supplier<? extends Supplier<? extends net.minecraft.world.level.material.Fluid>> sourceFluid) overlayTexture(net.minecraft.resources.ResourceLocation overlayTexture) rarity(net.minecraft.world.item.Rarity rarity) slopeFindDistance(int slopeFindDistance) sourceTexture(net.minecraft.resources.ResourceLocation sourceTexture) temperature(int temperature) tickDelay(int tickDelay) viscosity(int viscosity) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.architectury.core.fluid.ArchitecturyFluidAttributes
getColor, getColor, getColor, getDensity, getDensity, getDropOff, getEmptySound, getEmptySound, getFillSound, getFillSound, getFlowingTexture, getFlowingTexture, getFlowingTexture, getLuminosity, getLuminosity, getName, getName, getOverlayTexture, getOverlayTexture, getRarity, getRarity, getSlopeFindDistance, getSourceTexture, getSourceTexture, getSourceTexture, getTemperature, getTemperature, getTickDelay, getTranslationKey, getViscosity, getViscosity, isLighterThanAir, isLighterThanAir
-
Constructor Details
-
SimpleArchitecturyFluidAttributes
-
-
Method Details
-
ofSupplier
public static SimpleArchitecturyFluidAttributes ofSupplier(Supplier<? extends Supplier<? extends net.minecraft.world.level.material.Fluid>> flowingFluid, Supplier<? extends Supplier<? extends net.minecraft.world.level.material.Fluid>> sourceFluid) -
of
public static SimpleArchitecturyFluidAttributes of(Supplier<? extends net.minecraft.world.level.material.Fluid> flowingFluid, Supplier<? extends net.minecraft.world.level.material.Fluid> sourceFluid) -
convertToSource
-
slopeFindDistance
-
dropOff
-
bucketItemSupplier
public SimpleArchitecturyFluidAttributes bucketItemSupplier(Supplier<RegistrySupplier<net.minecraft.world.item.Item>> bucketItem) -
bucketItem
public SimpleArchitecturyFluidAttributes bucketItem(RegistrySupplier<net.minecraft.world.item.Item> bucketItem) -
bucketItem
public SimpleArchitecturyFluidAttributes bucketItem(Supplier<? extends Optional<net.minecraft.world.item.Item>> bucketItem) -
tickDelay
-
explosionResistance
-
blockSupplier
public SimpleArchitecturyFluidAttributes blockSupplier(Supplier<RegistrySupplier<? extends net.minecraft.world.level.block.LiquidBlock>> block) - See Also:
-
block
public SimpleArchitecturyFluidAttributes block(RegistrySupplier<? extends net.minecraft.world.level.block.LiquidBlock> block) - See Also:
-
block
public SimpleArchitecturyFluidAttributes block(Supplier<? extends Optional<? extends net.minecraft.world.level.block.LiquidBlock>> block) - See Also:
-
sourceTexture
public SimpleArchitecturyFluidAttributes sourceTexture(net.minecraft.resources.ResourceLocation sourceTexture) -
flowingTexture
public SimpleArchitecturyFluidAttributes flowingTexture(net.minecraft.resources.ResourceLocation flowingTexture) -
overlayTexture
public SimpleArchitecturyFluidAttributes overlayTexture(net.minecraft.resources.ResourceLocation overlayTexture) -
color
-
luminosity
-
density
-
temperature
-
viscosity
-
lighterThanAir
-
rarity
-
fillSound
-
emptySound
-
getTranslationKey
Description copied from interface:ArchitecturyFluidAttributesReturns the translation key of the name of this fluid.- Specified by:
getTranslationKeyin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benull- Returns:
- the translation key
-
getFlowingFluid
public final net.minecraft.world.level.material.Fluid getFlowingFluid()Description copied from interface:ArchitecturyFluidAttributesReturns the flowing fluid.- Specified by:
getFlowingFluidin interfaceArchitecturyFluidAttributes- Returns:
- the flowing fluid
-
getSourceFluid
public final net.minecraft.world.level.material.Fluid getSourceFluid()Description copied from interface:ArchitecturyFluidAttributesReturns the still fluid.- Specified by:
getSourceFluidin interfaceArchitecturyFluidAttributes- Returns:
- the still fluid
-
canConvertToSource
public boolean canConvertToSource()Description copied from interface:ArchitecturyFluidAttributesReturns whether this fluid can be converted to a source block when a flowing fluid is adjacent to two source blocks. A fluid that can be converted to a source block means that the fluid can be multiplied infinitely.- Specified by:
canConvertToSourcein interfaceArchitecturyFluidAttributes- Returns:
- whether this fluid can be converted to a source block
-
getSlopeFindDistance
public int getSlopeFindDistance(@Nullable @Nullable net.minecraft.world.level.LevelReader level) Description copied from interface:ArchitecturyFluidAttributesReturns the maximum distance this fluid will consider as a flowable hole candidate.- Specified by:
getSlopeFindDistancein interfaceArchitecturyFluidAttributes- Parameters:
level- the level, can benull- Returns:
- the maximum distance
- See Also:
-
WaterFluid.getSlopeFindDistance(LevelReader)LavaFluid.getSlopeFindDistance(LevelReader)
-
getDropOff
public int getDropOff(@Nullable @Nullable net.minecraft.world.level.LevelReader level) Description copied from interface:ArchitecturyFluidAttributesReturns the drop in fluid level per block travelled.- Specified by:
getDropOffin interfaceArchitecturyFluidAttributes- Parameters:
level- the level, can benull- Returns:
- the drop in fluid level per block travelled
- See Also:
-
WaterFluid.getDropOff(LevelReader)LavaFluid.getDropOff(LevelReader)
-
getBucketItem
@Nullable public @Nullable net.minecraft.world.item.Item getBucketItem()Description copied from interface:ArchitecturyFluidAttributesReturns the filled bucket item for this fluid.- Specified by:
getBucketItemin interfaceArchitecturyFluidAttributes- Returns:
- the filled bucket item
-
getTickDelay
public int getTickDelay(@Nullable @Nullable net.minecraft.world.level.LevelReader level) Description copied from interface:ArchitecturyFluidAttributesReturns the tick delay between each flow update.- Specified by:
getTickDelayin interfaceArchitecturyFluidAttributes- Parameters:
level- the level, can benull- Returns:
- the tick delay
- See Also:
-
WaterFluid.getTickDelay(LevelReader)LavaFluid.getTickDelay(LevelReader)
-
getExplosionResistance
public float getExplosionResistance()Description copied from interface:ArchitecturyFluidAttributesReturns the explosion resistance of this fluid.- Specified by:
getExplosionResistancein interfaceArchitecturyFluidAttributes- Returns:
- the explosion resistance
- See Also:
-
WaterFluid.getExplosionResistance()LavaFluid.getExplosionResistance()
-
getBlock
@Nullable public @Nullable net.minecraft.world.level.block.LiquidBlock getBlock()Description copied from interface:ArchitecturyFluidAttributesReturns the block form of this fluid.- Specified by:
getBlockin interfaceArchitecturyFluidAttributes- Returns:
- the block form
- See Also:
-
Blocks.WATERBlocks.LAVA
-
getSourceTexture
public net.minecraft.resources.ResourceLocation getSourceTexture(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the texture location of this fluid in its source form.The vanilla water location is
"block/water_still".- Specified by:
getSourceTexturein interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the texture location
-
getFlowingTexture
public net.minecraft.resources.ResourceLocation getFlowingTexture(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the texture location of this fluid in its flowing form.The vanilla water location is
"block/water_flow".- Specified by:
getFlowingTexturein interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the texture location
-
getOverlayTexture
public net.minecraft.resources.ResourceLocation getOverlayTexture(@Nullable @Nullable net.minecraft.world.level.material.FluidState state, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the overlay texture location of this fluid behind transparent blocks.The vanilla water location is
"block/water_overlay".- Specified by:
getOverlayTexturein interfaceArchitecturyFluidAttributes- Parameters:
state- the fluid state, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the texture location, can be
null
-
getColor
public int getColor(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the color of the fluid.- Specified by:
getColorin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the color
-
getLuminosity
public int getLuminosity(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the luminosity of the fluid, this is between 0 and 15.- Specified by:
getLuminosityin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the luminosity
-
getDensity
public int getDensity(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the density of the fluid, this is 1000 for water and 3000 for lava on forge.- Specified by:
getDensityin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the density
-
getTemperature
public int getTemperature(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the temperature of the fluid. The temperature is in kelvin, for example, 300 kelvin is equal to room temperature.- Specified by:
getTemperaturein interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the temperature
-
getViscosity
public int getViscosity(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the viscosity of the fluid. A lower viscosity means that the fluid will flow faster. The default value is 1000 for water.- Specified by:
getViscosityin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the viscosity
-
isLighterThanAir
public boolean isLighterThanAir(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns whether this fluid is lighter than air. This is used to determine whether the fluid should be rendered upside down like gas.- Specified by:
isLighterThanAirin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
trueif the fluid is lighter than air
-
getRarity
public net.minecraft.world.item.Rarity getRarity(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the rarity of the fluid.- Specified by:
getRarityin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the rarity
-
getFillSound
@Nullable public @Nullable net.minecraft.sounds.SoundEvent getFillSound(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the fill sound of the fluid.- Specified by:
getFillSoundin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the fill sound
- See Also:
-
SoundEvents.BUCKET_FILLSoundEvents.BUCKET_FILL_LAVA
-
getEmptySound
@Nullable public @Nullable net.minecraft.sounds.SoundEvent getEmptySound(@Nullable @Nullable FluidStack stack, @Nullable @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable @Nullable net.minecraft.core.BlockPos pos) Description copied from interface:ArchitecturyFluidAttributesReturns the empty sound of the fluid.- Specified by:
getEmptySoundin interfaceArchitecturyFluidAttributes- Parameters:
stack- the fluid stack, can benulllevel- the level, can benullpos- the position, can benull- Returns:
- the empty sound
- See Also:
-
SoundEvents.BUCKET_EMPTYSoundEvents.BUCKET_EMPTY_LAVA
-