public class FluidAttributes
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
FluidAttributes.Builder |
static class |
FluidAttributes.Water |
Modifier and Type | Field and Description |
---|---|
static int |
BUCKET_VOLUME |
private int |
color
Color used by universal bucket and the ModelFluid baked model.
|
private int |
density
Density of the fluid - completely arbitrary; negative density indicates that the fluid is
lighter than air.
|
private SoundEvent |
emptySound |
private SoundEvent |
fillSound |
private ResourceLocation |
flowingTexture |
private boolean |
isGaseous
This indicates if the fluid is gaseous.
|
private int |
luminosity
The light level emitted by this fluid.
|
private ResourceLocation |
overlayTexture |
private Rarity |
rarity
The rarity of the fluid.
|
private ResourceLocation |
stillTexture |
private int |
temperature
Temperature of the fluid - completely arbitrary; higher temperature indicates that the fluid is
hotter than air.
|
private java.lang.String |
translationKey |
private int |
viscosity
Viscosity ("thickness") of the fluid - completely arbitrary; negative values are not
permissible.
|
Modifier | Constructor and Description |
---|---|
protected |
FluidAttributes(FluidAttributes.Builder builder,
Fluid fluid) |
public static final int BUCKET_VOLUME
private java.lang.String translationKey
private final ResourceLocation stillTexture
private final ResourceLocation flowingTexture
@Nullable private final ResourceLocation overlayTexture
private final SoundEvent fillSound
private final SoundEvent emptySound
private final int luminosity
private final int density
private final int temperature
private final int viscosity
private final boolean isGaseous
private final Rarity rarity
private final int color
protected FluidAttributes(FluidAttributes.Builder builder, Fluid fluid)
public ItemStack getBucket(FluidStack stack)
public BlockState getBlock(ILightReader reader, BlockPos pos, IFluidState state)
public IFluidState getStateForPlacement(ILightReader reader, BlockPos pos, FluidStack state)
public final boolean canBePlacedInWorld(ILightReader reader, BlockPos pos, IFluidState state)
public final boolean canBePlacedInWorld(ILightReader reader, BlockPos pos, FluidStack state)
public final boolean isLighterThanAir()
public boolean doesVaporize(ILightReader reader, BlockPos pos, FluidStack fluidStack)
net.minecraft.item.BucketItem#tryPlaceContainedLiquid(PlayerEntity, World, BlockPos)
fluidStack
- The fluidStack is trying to be placed.public void vaporize(@Nullable PlayerEntity player, World worldIn, BlockPos pos, FluidStack fluidStack)
Dimension.doesWaterVaporize()
and #doesVaporize(FluidStack)
are true.
Override this to make your explosive liquid blow up instead of the default smoke, etc.
Based on net.minecraft.item.BucketItem#tryPlaceContainedLiquid(PlayerEntity, World, BlockPos)
player
- Player who tried to place the fluid. May be null for blocks like dispensers.worldIn
- World to vaporize the fluid in.pos
- The position in the world the fluid block was going to be placed.fluidStack
- The fluidStack that was going to be placed.public ITextComponent getDisplayName(FluidStack stack)
public java.lang.String getTranslationKey(FluidStack stack)
public java.lang.String getTranslationKey()
public final int getLuminosity()
public final int getDensity()
public final int getTemperature()
public final int getViscosity()
public final boolean isGaseous()
public Rarity getRarity()
public int getColor()
public ResourceLocation getStillTexture()
public ResourceLocation getFlowingTexture()
@Nullable public ResourceLocation getOverlayTexture()
public SoundEvent getFillSound()
public SoundEvent getEmptySound()
public int getLuminosity(FluidStack stack)
public int getDensity(FluidStack stack)
public int getTemperature(FluidStack stack)
public int getViscosity(FluidStack stack)
public boolean isGaseous(FluidStack stack)
public Rarity getRarity(FluidStack stack)
public int getColor(FluidStack stack)
public ResourceLocation getStillTexture(FluidStack stack)
public ResourceLocation getFlowingTexture(FluidStack stack)
public SoundEvent getFillSound(FluidStack stack)
public SoundEvent getEmptySound(FluidStack stack)
public int getLuminosity(ILightReader world, BlockPos pos)
public int getDensity(ILightReader world, BlockPos pos)
public int getTemperature(ILightReader world, BlockPos pos)
public int getViscosity(ILightReader world, BlockPos pos)
public boolean isGaseous(ILightReader world, BlockPos pos)
public Rarity getRarity(ILightReader world, BlockPos pos)
public int getColor(ILightReader world, BlockPos pos)
public ResourceLocation getStillTexture(ILightReader world, BlockPos pos)
public ResourceLocation getFlowingTexture(ILightReader world, BlockPos pos)
public SoundEvent getFillSound(ILightReader world, BlockPos pos)
public SoundEvent getEmptySound(ILightReader world, BlockPos pos)
public static FluidAttributes.Builder builder(ResourceLocation stillTexture, ResourceLocation flowingTexture)
public java.util.stream.Stream<ResourceLocation> getTextures()