Package net.minecraftforge.client.model
Class DynamicFluidContainerModel
java.lang.Object
net.minecraftforge.client.model.DynamicFluidContainerModel
- All Implemented Interfaces:
IUnbakedGeometry<DynamicFluidContainerModel>
public class DynamicFluidContainerModel
extends Object
implements IUnbakedGeometry<DynamicFluidContainerModel>
A dynamic fluid container model, capable of re-texturing itself at runtime to match the contained fluid.
Composed of a base layer, a fluid layer (applied with a mask) and a cover layer (optionally applied with a mask). The entire model may optionally be flipped if the fluid is gaseous, and the fluid layer may glow if light-emitting.
Fluid tinting requires registering a separate ItemColor
. An implementation is provided in DynamicFluidContainerModel.Colors
.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
private static final class
static final class
-
Field Summary
Modifier and TypeFieldDescriptionprivate final boolean
private static final Transformation
private final boolean
private final boolean
private final Fluid
private static final Transformation
-
Constructor Summary
ModifierConstructorDescriptionprivate
DynamicFluidContainerModel
(Fluid fluid, boolean flipGas, boolean coverIsMask, boolean applyFluidLuminosity) -
Method Summary
Modifier and TypeMethodDescriptionbake
(IGeometryBakingContext context, ModelBaker baker, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState, ItemOverrides overrides) static RenderTypeGroup
getLayerRenderTypes
(boolean unlit) Returns a new ModelDynBucket representing the given fluid, but with the same other properties (flipGas, tint, coverIsMask).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.client.model.geometry.IUnbakedGeometry
getConfigurableComponentNames, resolveParents
-
Field Details
-
FLUID_TRANSFORM
-
COVER_TRANSFORM
-
fluid
-
flipGas
private final boolean flipGas -
coverIsMask
private final boolean coverIsMask -
applyFluidLuminosity
private final boolean applyFluidLuminosity
-
-
Constructor Details
-
DynamicFluidContainerModel
private DynamicFluidContainerModel(Fluid fluid, boolean flipGas, boolean coverIsMask, boolean applyFluidLuminosity)
-
-
Method Details
-
getLayerRenderTypes
-
withFluid
Returns a new ModelDynBucket representing the given fluid, but with the same other properties (flipGas, tint, coverIsMask). -
bake
public BakedModel bake(IGeometryBakingContext context, ModelBaker baker, Function<Material, TextureAtlasSprite> spriteGetter, ModelState modelState, ItemOverrides overrides) - Specified by:
bake
in interfaceIUnbakedGeometry<DynamicFluidContainerModel>
-