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:
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>> private final Map<SkullBlock.Type, Identifier> -
Constructor Summary
ConstructorsConstructorDescriptionCreateSkullModels(Map<SkullBlock.Type, Function<EntityModelSet, SkullModelBase>> skullModels, Map<SkullBlock.Type, Identifier> skullTextures) -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterSkullModel(SkullBlock.Type type, Function<EntityModelSet, SkullModelBase> factory, @Nullable Identifier skullTexture) Registers the entity model for a skull block with the givenSkullBlock.Type, and optionally registers a skull texture to theSkullBlockRenderer.SKIN_BY_TYPEmap.voidregisterSkullModel(SkullBlock.Type type, ModelLayerLocation layerLocation, Function<ModelPart, SkullModelBase> factory, @Nullable Identifier skullTexture) Registers the entity model for a skull block with the givenSkullBlock.Type, and optionally registers a skull texture to theSkullBlockRenderer.SKIN_BY_TYPEmap.voidregisterSkullModel(SkullBlock.Type type, ModelLayerLocation layerLocation, @Nullable Identifier skullTexture) Registers aSkullModelfor a skull block with the givenSkullBlock.Type, and optionally registers a skull texture to theSkullBlockRenderer.SKIN_BY_TYPEmap.
-
Field Details
-
skullModels
-
skullTextures
-
-
Constructor Details
-
CreateSkullModels
@Internal public CreateSkullModels(Map<SkullBlock.Type, Function<EntityModelSet, SkullModelBase>> skullModels, Map<SkullBlock.Type, Identifier> skullTextures)
-
-
Method Details
-
registerSkullModel
public void registerSkullModel(SkullBlock.Type type, ModelLayerLocation layerLocation, @Nullable Identifier skullTexture) Registers aSkullModelfor a skull block with the givenSkullBlock.Type, and optionally registers a skull texture to theSkullBlockRenderer.SKIN_BY_TYPEmap.- 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 theLayerDefinitionused by the modelskullTexture- the skull texture to put in theSkullBlockRenderer.SKIN_BY_TYPEmap, if provided.
-
registerSkullModel
public void registerSkullModel(SkullBlock.Type type, ModelLayerLocation layerLocation, Function<ModelPart, SkullModelBase> factory, @Nullable Identifier skullTexture) Registers the entity model for a skull block with the givenSkullBlock.Type, and optionally registers a skull texture to theSkullBlockRenderer.SKIN_BY_TYPEmap.- 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 theLayerDefinitionused by the modelfactory- the factory to create the skull model instance, taking in the rootModelPartand returning the model.skullTexture- the skull texture to put in theSkullBlockRenderer.SKIN_BY_TYPEmap, if provided.
-
registerSkullModel
public void registerSkullModel(SkullBlock.Type type, Function<EntityModelSet, SkullModelBase> factory, @Nullable Identifier skullTexture) Registers the entity model for a skull block with the givenSkullBlock.Type, and optionally registers a skull texture to theSkullBlockRenderer.SKIN_BY_TYPEmap.- 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 forSkullModelskullTexture- the skull texture to put in theSkullBlockRenderer.SKIN_BY_TYPEmap, if provided.
-