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_VOLUMEFluidAttributes#getBucket->FluidType#getBucketFluidAttributes#getBlock->FluidType#getBlockForFluidStateFluidAttributes#getStateForPlacement->FluidType#getStateForPlacementFluidAttributes#canBePlacedInWorld->FluidType#canBePlacedInLevelFluidAttributes#isLighterThanAir->FluidType#isLighterThanAirFluidAttributes#doesVaporize->FluidType#isVaporizedOnPlacementFluidAttributes#vaporize->FluidType#onVaporizeFluidAttributes#getDisplayName(FluidStack)->FluidType#getDescription(FluidStack)FluidAttributes#getTranslationKey(FluidStack)->FluidType#getDescriptionId(FluidStack)FluidAttributes#getTranslationKey->FluidType#getDescriptionIdFluidAttributes#getLuminosity->FluidType#getLightLevelFluidAttributes#getDensity->FluidType#getDensityFluidAttributes#getTemperature->FluidType#getTemperatureFluidAttributes#getViscosity->FluidType#getViscosityFluidAttributes#isGaseous->Tags$Fluids#GASEOUSFluidAttributes#getRarity->FluidType#getRarityFluidAttributes#getColor->IFluidTypeRenderProperties#getColorTintFluidAttributes#getStillTexture->IFluidTypeRenderProperties#getStillTextureFluidAttributes#getFlowingTexture->IFluidTypeRenderProperties#getFlowingTextureFluidAttributes#getOverlayTexture->IFluidTypeRenderProperties#getOverlayTextureFluidAttributes#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_FILLFluidAttributes#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#getTexturesFluidAttributes$Builder->FluidType$PropertiesIForgeBlock#getAiPathNodeType->IForgeBlock#getBlockPathTypeIForgeEntity#canBeRiddenInWater->IForgeEntity#canBeRiddenUnderFluidTypeIForgeFluid#isEntityInside-> REMOVEDIForgeFluid#isAABBInsideMaterial-> REMOVEDIForgeFluid#getAttributes->IForgeFluid#getFluidTypeIForgeFluidState#isEntityInside-> REMOVEDForgeFlowingFluid$Properties(Fluid, Fluid, FluidAttributes)->ForgeFlowingFluid$Properties(FluidType, Fluid, Fluid)ForgeFlowingFluid#canMultiply->FluidType#canConvertToSource(FluidState, LevelReader, BlockPos)