Class DynamicFluidContainerModel
java.lang.Object
net.neoforged.neoforge.client.model.item.DynamicFluidContainerModel
- All Implemented Interfaces:
ItemModel
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final record
Nested classes/interfaces inherited from interface net.minecraft.client.renderer.item.ItemModel
ItemModel.BakingContext
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ItemModel.BakingContext
private static final Transformation
private static final ModelDebugName
private static final Transformation
private final ItemTransforms
private final DynamicFluidContainerModel.Unbaked
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
DynamicFluidContainerModel
(DynamicFluidContainerModel.Unbaked unbakedModel, ItemModel.BakingContext bakingContext) -
Method Summary
Modifier and TypeMethodDescriptionprivate ItemModel
bakeModelForFluid
(Fluid fluid) private static RenderTypeGroup
getLayerRenderTypes
(boolean unlit) void
update
(ItemStackRenderState renderState, ItemStack stack, ItemModelResolver modelResolver, ItemDisplayContext displayContext, @Nullable ClientLevel level, @Nullable LivingEntity entity, int p_387820_)
-
Field Details
-
FLUID_TRANSFORM
-
COVER_TRANSFORM
-
DEBUG_NAME
-
unbakedModel
-
bakingContext
-
itemTransforms
-
cache
-
-
Constructor Details
-
DynamicFluidContainerModel
private DynamicFluidContainerModel(DynamicFluidContainerModel.Unbaked unbakedModel, ItemModel.BakingContext bakingContext)
-
-
Method Details
-
getLayerRenderTypes
-
bakeModelForFluid
-
update
public void update(ItemStackRenderState renderState, ItemStack stack, ItemModelResolver modelResolver, ItemDisplayContext displayContext, @Nullable @Nullable ClientLevel level, @Nullable @Nullable LivingEntity entity, int p_387820_)
-