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
ModifierConstructorDescriptionprotected
SimpleArchitecturyFluidAttributes
(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) boolean
Returns 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.LiquidBlock
getBlock()
Returns the block form of this fluid.@Nullable net.minecraft.world.item.Item
Returns the filled bucket item for this fluid.int
getColor
(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the color of the fluid.int
getDensity
(@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.int
getDropOff
(@Nullable net.minecraft.world.level.LevelReader level) Returns the drop in fluid level per block travelled.@Nullable net.minecraft.sounds.SoundEvent
getEmptySound
(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the empty sound of the fluid.float
Returns the explosion resistance of this fluid.@Nullable net.minecraft.sounds.SoundEvent
getFillSound
(@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.Fluid
Returns the flowing fluid.net.minecraft.resources.ResourceLocation
getFlowingTexture
(@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.int
getLuminosity
(@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.ResourceLocation
getOverlayTexture
(@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.Rarity
getRarity
(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the rarity of the fluid.int
getSlopeFindDistance
(@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.Fluid
Returns the still fluid.net.minecraft.resources.ResourceLocation
getSourceTexture
(@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.int
getTemperature
(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the temperature of the fluid.int
getTickDelay
(@Nullable net.minecraft.world.level.LevelReader level) Returns the tick delay between each flow update.@Nullable String
getTranslationKey
(@Nullable FluidStack stack) Returns the translation key of the name of this fluid.int
getViscosity
(@Nullable FluidStack stack, @Nullable net.minecraft.world.level.BlockAndTintGetter level, @Nullable net.minecraft.core.BlockPos pos) Returns the viscosity of the fluid.boolean
isLighterThanAir
(@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, wait
Methods 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:ArchitecturyFluidAttributes
Returns the translation key of the name of this fluid.- Specified by:
getTranslationKey
in 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:ArchitecturyFluidAttributes
Returns the flowing fluid.- Specified by:
getFlowingFluid
in interfaceArchitecturyFluidAttributes
- Returns:
- the flowing fluid
-
getSourceFluid
public final net.minecraft.world.level.material.Fluid getSourceFluid()Description copied from interface:ArchitecturyFluidAttributes
Returns the still fluid.- Specified by:
getSourceFluid
in interfaceArchitecturyFluidAttributes
- Returns:
- the still fluid
-
canConvertToSource
public boolean canConvertToSource()Description copied from interface:ArchitecturyFluidAttributes
Returns 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:
canConvertToSource
in 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:ArchitecturyFluidAttributes
Returns the maximum distance this fluid will consider as a flowable hole candidate.- Specified by:
getSlopeFindDistance
in 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:ArchitecturyFluidAttributes
Returns the drop in fluid level per block travelled.- Specified by:
getDropOff
in 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:ArchitecturyFluidAttributes
Returns the filled bucket item for this fluid.- Specified by:
getBucketItem
in interfaceArchitecturyFluidAttributes
- Returns:
- the filled bucket item
-
getTickDelay
public int getTickDelay(@Nullable @Nullable net.minecraft.world.level.LevelReader level) Description copied from interface:ArchitecturyFluidAttributes
Returns the tick delay between each flow update.- Specified by:
getTickDelay
in 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:ArchitecturyFluidAttributes
Returns the explosion resistance of this fluid.- Specified by:
getExplosionResistance
in 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:ArchitecturyFluidAttributes
Returns the block form of this fluid.- Specified by:
getBlock
in interfaceArchitecturyFluidAttributes
- Returns:
- the block form
- See Also:
-
Blocks.WATER
Blocks.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:ArchitecturyFluidAttributes
Returns the texture location of this fluid in its source form.The vanilla water location is
"block/water_still"
.- Specified by:
getSourceTexture
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the texture location of this fluid in its flowing form.The vanilla water location is
"block/water_flow"
.- Specified by:
getFlowingTexture
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the overlay texture location of this fluid behind transparent blocks.The vanilla water location is
"block/water_overlay"
.- Specified by:
getOverlayTexture
in interfaceArchitecturyFluidAttributes
- Parameters:
state
- the fluid state, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the color of the fluid.- Specified by:
getColor
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the luminosity of the fluid, this is between 0 and 15.- Specified by:
getLuminosity
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the density of the fluid, this is 1000 for water and 3000 for lava on forge.- Specified by:
getDensity
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the temperature of the fluid. The temperature is in kelvin, for example, 300 kelvin is equal to room temperature.- Specified by:
getTemperature
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the viscosity of the fluid. A lower viscosity means that the fluid will flow faster. The default value is 1000 for water.- Specified by:
getViscosity
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns whether this fluid is lighter than air. This is used to determine whether the fluid should be rendered upside down like gas.- Specified by:
isLighterThanAir
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- the position, can benull
- Returns:
true
if 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:ArchitecturyFluidAttributes
Returns the rarity of the fluid.- Specified by:
getRarity
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- 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:ArchitecturyFluidAttributes
Returns the fill sound of the fluid.- Specified by:
getFillSound
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- the position, can benull
- Returns:
- the fill sound
- See Also:
-
SoundEvents.BUCKET_FILL
SoundEvents.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:ArchitecturyFluidAttributes
Returns the empty sound of the fluid.- Specified by:
getEmptySound
in interfaceArchitecturyFluidAttributes
- Parameters:
stack
- the fluid stack, can benull
level
- the level, can benull
pos
- the position, can benull
- Returns:
- the empty sound
- See Also:
-
SoundEvents.BUCKET_EMPTY
SoundEvents.BUCKET_EMPTY_LAVA
-