6,281 bytes added
, 23:06, 14 June 2022
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
* <code>FluidAttributes</code> -> <code>FluidType</code> (This is a Forge Registry ''forge:fluid_type'')
* <code>FluidAttributes#BUCKET_VOLUME</code> -> <code>FluidType#BUCKET_VOLUME</code>
* <code>FluidAttributes#getBucket</code> -> <code>FluidType#getBucket</code>
* <code>FluidAttributes#getBlock</code> -> <code>FluidType#getBlockForFluidState</code>
* <code>FluidAttributes#getStateForPlacement</code> -> <code>FluidType#getStateForPlacement</code>
* <code>FluidAttributes#canBePlacedInWorld</code> -> <code>FluidType#canBePlacedInLevel</code>
* <code>FluidAttributes#isLighterThanAir</code> -> <code>FluidType#isLighterThanAir</code>
* <code>FluidAttributes#doesVaporize</code> -> <code>FluidType#isVaporizedOnPlacement</code>
* <code>FluidAttributes#vaporize</code> -> <code>FluidType#onVaporize</code>
* <code>FluidAttributes#getDisplayName(FluidStack)</code> -> <code>FluidType#getDescription(FluidStack)</code>
* <code>FluidAttributes#getTranslationKey(FluidStack)</code> -> <code>FluidType#getDescriptionId(FluidStack)</code>
* <code>FluidAttributes#getTranslationKey</code> -> <code>FluidType#getDescriptionId</code>
* <code>FluidAttributes#getLuminosity</code> -> <code>FluidType#getLightLevel</code>
* <code>FluidAttributes#getDensity</code> -> <code>FluidType#getDensity</code>
* <code>FluidAttributes#getTemperature</code> -> <code>FluidType#getTemperature</code>
* <code>FluidAttributes#getViscosity</code> -> <code>FluidType#getViscosity</code>
* <code>FluidAttributes#isGaseous</code> -> <code>Tags$Fluids#GASEOUS</code>
* <code>FluidAttributes#getRarity</code> -> <code>FluidType#getRarity</code>
* <code>FluidAttributes#getColor</code> -> <code>IFluidTypeRenderProperties#getColorTint</code>
* <code>FluidAttributes#getStillTexture</code> -> <code>IFluidTypeRenderProperties#getStillTexture</code>
* <code>FluidAttributes#getFlowingTexture</code> -> <code>IFluidTypeRenderProperties#getFlowingTexture</code>
* <code>FluidAttributes#getOverlayTexture</code> -> <code>IFluidTypeRenderProperties#getOverlayTexture</code>
* <code>FluidAttributes#getFillSound</code> -> <code>FluidType#getSound(SoundActions.BUCKET_FILL)</code>
* <code>FluidAttributes#getEmptySound</code> -> <code>FluidType#getSound(SoundActions.BUCKET_EMPTY)</code>
* <code>FluidAttributes#getLuminosity(FluidStack)</code> -> <code>FluidType#getLightLevel(FluidStack)</code>
* <code>FluidAttributes#getDensity(FluidStack)</code> -> <code>FluidType#getDensity(FluidStack)</code>
* <code>FluidAttributes#getTemperature(FluidStack)</code> -> <code>FluidType#getTemperature(FluidStack)</code>
* <code>FluidAttributes#getViscosity(FluidStack)</code> -> <code>FluidType#getViscosity(FluidStack)</code>
* <code>FluidAttributes#isGaseous(FluidStack)</code> -> REMOVED
* <code>FluidAttributes#getColor(FluidStack)</code> -> <code>IFluidTypeRenderProperties#getColorTint(FluidStack)</code>
* <code>FluidAttributes#getStillTexture(FluidStack)</code> -> <code>IFluidTypeRenderProperties#getStillTexture(FluidStack)</code>
* <code>FluidAttributes#getFlowingTexture(FluidStack)</code> -> <code>IFluidTypeRenderProperties#getFlowingTexture(FluidStack)</code>
* <code>FluidAttributes#getFillSound(FluidStack)</code> -> <code>FluidType#getSound(FluidStack, SoundActions.BUCKET_FILL</code>
* <code>FluidAttributes#getEmptySound(FluidStack)</code> -> <code>FluidType#getSound(FluidStack, SoundActions.BUCKET_EMPTY)</code>
* <code>FluidAttributes#getLuminosity(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getLightLevel(FluidState, BlockAndTintGetter, BlockPos)</code>
* <code>FluidAttributes#getDensity(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getDensity(FluidState, BlockAndTintGetter, BlockPos)</code>
* <code>FluidAttributes#getTemperature(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getTemperature(FluidState, BlockAndTintGetter, BlockPos)</code>
* <code>FluidAttributes#getViscosity(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getViscosity(FluidState, BlockAndTintGetter, BlockPos)</code>
* <code>FluidAttributes#isGaseous(BlockAndTintGetter, BlockPos)</code> -> REMOVED
* <code>FluidAttributes#getRarity(BlockAndTintGetter, BlockPos)</code> -> REMOVED
* <code>FluidAttributes#getColor(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getColorTint(FluidState, BlockAndTintGetter, BlockPos)</code>
* <code>FluidAttributes#getStillTexture(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getStillTexture(FluidState, BlockAndTintGetter, BlockPos)</code>
* <code>FluidAttributes#getFlowingTexture(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getFlowingTexture(FluidState, BlockAndTintGetter, BlockPos)</code>
* <code>FluidAttributes#getFillSound(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getSound(Player, BlockGetter, BlockPos, SoundActions.BUCKET_FILL)</code>
* <code>FluidAttributes#getEmptySound(BlockAndTintGetter, BlockPos)</code> -> <code>FluidType#getSound(Player, BlockGetter, BlockPos, SoundActions.BUCKET_EMPTY)</code>
* <code>FluidAttributes#getTextures</code> -> <code>IFluidTypeRenderProperties#getTextures</code>
* <code>FluidAttributes$Builder</code> -> <code>FluidType$Properties</code>
* <code>IForgeBlock#getAiPathNodeType</code> -> <code>IForgeBlock#getBlockPathType</code>
* <code>IForgeEntity#canBeRiddenInWater</code> -> <code>IForgeEntity#canBeRiddenUnderFluidType</code>
* <code>IForgeFluid#isEntityInside</code> -> REMOVED
* <code>IForgeFluid#isAABBInsideMaterial</code> -> REMOVED
* <code>IForgeFluid#getAttributes</code> -> <code>IForgeFluid#getFluidType</code>
* <code>IForgeFluidState#isEntityInside</code> -> REMOVED
* <code>ForgeFlowingFluid$Properties(Fluid, Fluid, FluidAttributes)</code> -> <code>ForgeFlowingFluid$Properties(FluidType, Fluid, Fluid)</code>
* <code>ForgeFlowingFluid#canMultiply</code> -> <code>FluidType#canConvertToSource(FluidState, LevelReader, BlockPos)</code>