Class EntityRenderersEvent.CreateSkullModels
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.EntityRenderersEvent
net.neoforged.neoforge.client.event.EntityRenderersEvent.CreateSkullModels
- All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
- Enclosing class:
EntityRenderersEvent
Fired for registering additional skull models.
This event is not cancellable, and does not have a result.
This event is fired on the mod-specific event bus, only on the logical client.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.client.event.EntityRenderersEvent
EntityRenderersEvent.AddLayers, EntityRenderersEvent.CreateSkullModels, EntityRenderersEvent.RegisterLayerDefinitions, EntityRenderersEvent.RegisterRenderers
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<SkullBlock.Type, Function<EntityModelSet, SkullModelBase>> -
Constructor Summary
ConstructorsConstructorDescriptionCreateSkullModels
(Map<SkullBlock.Type, Function<EntityModelSet, SkullModelBase>> skullModels) -
Method Summary
Modifier and TypeMethodDescriptionvoid
registerSkullModel
(SkullBlock.Type type, Function<EntityModelSet, SkullModelBase> factory) Registers the entity model for a skull block with the givenSkullBlock.Type
.void
registerSkullModel
(SkullBlock.Type type, ModelLayerLocation layerLocation) Registers aSkullModel
for a skull block with the givenSkullBlock.Type
.void
registerSkullModel
(SkullBlock.Type type, ModelLayerLocation layerLocation, Function<ModelPart, SkullModelBase> factory) Registers the entity model for a skull block with the givenSkullBlock.Type
.
-
Field Details
-
skullModels
-
-
Constructor Details
-
CreateSkullModels
@Internal public CreateSkullModels(Map<SkullBlock.Type, Function<EntityModelSet, SkullModelBase>> skullModels)
-
-
Method Details
-
registerSkullModel
Registers aSkullModel
for a skull block with the givenSkullBlock.Type
.- Parameters:
type
- a unique skull type; an exception will be thrown if multiple mods register models for the same type or a mod tries to register a model for a vanilla typelayerLocation
- the key that identifies theLayerDefinition
used by the model
-
registerSkullModel
public void registerSkullModel(SkullBlock.Type type, ModelLayerLocation layerLocation, Function<ModelPart, SkullModelBase> factory) Registers the entity model for a skull block with the givenSkullBlock.Type
.- Parameters:
type
- a unique skull type; an exception will be thrown if multiple mods register models for the same type or a mod tries to register a model for a vanilla typelayerLocation
- the key that identifies theLayerDefinition
used by the modelfactory
- the factory to create the skull model instance, taking in the rootModelPart
and returning the model.
-
registerSkullModel
public void registerSkullModel(SkullBlock.Type type, Function<EntityModelSet, SkullModelBase> factory) Registers the entity model for a skull block with the givenSkullBlock.Type
.- Parameters:
type
- a unique skull type; an exception will be thrown if multiple mods register models for the same type or a mod tries to register a model for a vanilla typefactory
- the factory to create the skull model instance. A typical implementation will simply bake a model usingEntityModelSet.bakeLayer(ModelLayerLocation)
and pass it to the constructor forSkullModel
-