User:ChampionAsh5357/Sandbox/Fluids API
In Forge 41.0.28, the Fluid API had been completely overhauled. These changes expanded the system to allow for custom physics logic and additional behavior not tied directly to the water and lava tags. This guide will go through all the changes and additions that Fluids now provide for you to use.
Quick Guide
This is a quick guide representing the one to one conversions that the Fluid API changed
FluidAttributes
->FluidType
(This is a Forge Registry forge:fluid_type)FluidAttributes#BUCKET_VOLUME
->FluidType#BUCKET_VOLUME
FluidAttributes#getBucket
->FluidType#getBucket
FluidAttributes#getBlock
->FluidType#getBlockForFluidState
FluidAttributes#getStateForPlacement
->FluidType#getStateForPlacement
FluidAttributes#canBePlacedInWorld
->FluidType#canBePlacedInLevel
FluidAttributes#isLighterThanAir
->FluidType#isLighterThanAir
FluidAttributes#doesVaporize
->FluidType#isVaporizedOnPlacement
FluidAttributes#vaporize
->FluidType#onVaporize
FluidAttributes#getDisplayName(FluidStack)
->FluidType#getDescription(FluidStack)
FluidAttributes#getTranslationKey(FluidStack)
->FluidType#getDescriptionId(FluidStack)
FluidAttributes#getTranslationKey
->FluidType#getDescriptionId
FluidAttributes#getLuminosity
->FluidType#getLightLevel
FluidAttributes#getDensity
->FluidType#getDensity
FluidAttributes#getTemperature
->FluidType#getTemperature
FluidAttributes#getViscosity
->FluidType#getViscosity
FluidAttributes#isGaseous
->Tags$Fluids#GASEOUS
FluidAttributes#getRarity
->FluidType#getRarity
FluidAttributes#getColor
->IFluidTypeRenderProperties#getColorTint
FluidAttributes#getStillTexture
->IFluidTypeRenderProperties#getStillTexture
FluidAttributes#getFlowingTexture
->IFluidTypeRenderProperties#getFlowingTexture
FluidAttributes#getOverlayTexture
->IFluidTypeRenderProperties#getOverlayTexture
FluidAttributes#getFillSound
->FluidType#getSound(SoundActions.BUCKET_FILL)
FluidAttributes#getEmptySound
->FluidType#getSound(SoundActions.BUCKET_EMPTY)
FluidAttributes#getLuminosity(FluidStack)
->FluidType#getLightLevel(FluidStack)
FluidAttributes#getDensity(FluidStack)
->FluidType#getDensity(FluidStack)
FluidAttributes#getTemperature(FluidStack)
->FluidType#getTemperature(FluidStack)
FluidAttributes#getViscosity(FluidStack)
->FluidType#getViscosity(FluidStack)
FluidAttributes#isGaseous(FluidStack)
-> REMOVEDFluidAttributes#getColor(FluidStack)
->IFluidTypeRenderProperties#getColorTint(FluidStack)
FluidAttributes#getStillTexture(FluidStack)
->IFluidTypeRenderProperties#getStillTexture(FluidStack)
FluidAttributes#getFlowingTexture(FluidStack)
->IFluidTypeRenderProperties#getFlowingTexture(FluidStack)
FluidAttributes#getFillSound(FluidStack)
->FluidType#getSound(FluidStack, SoundActions.BUCKET_FILL
FluidAttributes#getEmptySound(FluidStack)
->FluidType#getSound(FluidStack, SoundActions.BUCKET_EMPTY)
FluidAttributes#getLuminosity(BlockAndTintGetter, BlockPos)
->FluidType#getLightLevel(FluidState, BlockAndTintGetter, BlockPos)
FluidAttributes#getDensity(BlockAndTintGetter, BlockPos)
->FluidType#getDensity(FluidState, BlockAndTintGetter, BlockPos)
FluidAttributes#getTemperature(BlockAndTintGetter, BlockPos)
->FluidType#getTemperature(FluidState, BlockAndTintGetter, BlockPos)
FluidAttributes#getViscosity(BlockAndTintGetter, BlockPos)
->FluidType#getViscosity(FluidState, BlockAndTintGetter, BlockPos)
FluidAttributes#isGaseous(BlockAndTintGetter, BlockPos)
-> REMOVEDFluidAttributes#getRarity(BlockAndTintGetter, BlockPos)
-> REMOVEDFluidAttributes#getColor(BlockAndTintGetter, BlockPos)
->FluidType#getColorTint(FluidState, BlockAndTintGetter, BlockPos)
FluidAttributes#getStillTexture(BlockAndTintGetter, BlockPos)
->FluidType#getStillTexture(FluidState, BlockAndTintGetter, BlockPos)
FluidAttributes#getFlowingTexture(BlockAndTintGetter, BlockPos)
->FluidType#getFlowingTexture(FluidState, BlockAndTintGetter, BlockPos)
FluidAttributes#getFillSound(BlockAndTintGetter, BlockPos)
->FluidType#getSound(Player, BlockGetter, BlockPos, SoundActions.BUCKET_FILL)
FluidAttributes#getEmptySound(BlockAndTintGetter, BlockPos)
->FluidType#getSound(Player, BlockGetter, BlockPos, SoundActions.BUCKET_EMPTY)
FluidAttributes#getTextures
->IFluidTypeRenderProperties#getTextures
FluidAttributes$Builder
->FluidType$Properties
IForgeBlock#getAiPathNodeType
->IForgeBlock#getBlockPathType
IForgeEntity#canBeRiddenInWater
->IForgeEntity#canBeRiddenUnderFluidType
IForgeFluid#isEntityInside
-> REMOVEDIForgeFluid#isAABBInsideMaterial
-> REMOVEDIForgeFluid#getAttributes
->IForgeFluid#getFluidType
IForgeFluidState#isEntityInside
-> REMOVEDForgeFlowingFluid$Properties(Fluid, Fluid, FluidAttributes)
->ForgeFlowingFluid$Properties(FluidType, Fluid, Fluid)
ForgeFlowingFluid#canMultiply
->FluidType#canConvertToSource(FluidState, LevelReader, BlockPos)