Package net.minecraftforge.client.event
Class EntityRenderersEvent.AddLayers
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.EntityRenderersEvent
net.minecraftforge.client.event.EntityRenderersEvent.AddLayers
- All Implemented Interfaces:
IModBusEvent
- Enclosing class:
EntityRenderersEvent
Fired for registering entity renderer layers at the appropriate time, after the entity and player renderers maps
have been created.
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.minecraftforge.client.event.EntityRenderersEvent
EntityRenderersEvent.AddLayers, EntityRenderersEvent.CreateSkullModels, EntityRenderersEvent.RegisterLayerDefinitions, EntityRenderersEvent.RegisterRenderers
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final EntityRendererProvider.Context
private final Map
<EntityType<?>, EntityRenderer<?>> private final Map
<PlayerSkin.Model, EntityRenderer<? extends Player>> -
Constructor Summary
ConstructorDescriptionAddLayers
(Map<EntityType<?>, EntityRenderer<?>> renderers, Map<PlayerSkin.Model, EntityRenderer<? extends Player>> playerRenderers, EntityRendererProvider.Context context) -
Method Summary
Modifier and TypeMethodDescriptionReturns the context for the entity renderer provider.Returns the set of entity models.<T extends LivingEntity,
R extends EntityRenderer<T>>
RgetEntityRenderer
(EntityType<? extends T> entityType) Returns an entity renderer for the given entity type.<R extends EntityRenderer<? extends Player>>
RgetPlayerSkin
(PlayerSkin.Model skinName) Returns a player skin renderer for the given skin name.getSkins()
Returns the set of player skin names which have a renderer.Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
renderers
-
skinMap
-
context
-
-
Constructor Details
-
AddLayers
@Internal public AddLayers(Map<EntityType<?>, EntityRenderer<?>> renderers, Map<PlayerSkin.Model, EntityRenderer<? extends Player>> playerRenderers, EntityRendererProvider.Context context)
-
-
Method Details
-
getSkins
Returns the set of player skin names which have a renderer.Minecraft provides two default skin names:
default
for the regular player model andslim
for the slim player model.- Returns:
- the set of player skin names which have a renderer
-
getPlayerSkin
@Nullable public <R extends EntityRenderer<? extends Player>> R getPlayerSkin(PlayerSkin.Model skinName) Returns a player skin renderer for the given skin name.- Type Parameters:
R
- the type of the skin renderer, usuallyPlayerRenderer
- Parameters:
skinName
- the name of the skin to get the renderer for- Returns:
- the skin renderer, or
null
if no renderer is registered for that skin name - See Also:
-
getEntityRenderer
@Nullable public <T extends LivingEntity,R extends EntityRenderer<T>> R getEntityRenderer(EntityType<? extends T> entityType) Returns an entity renderer for the given entity type.- Type Parameters:
T
- the type of entity the renderer is forR
- the type of the renderer- Parameters:
entityType
- the entity type to return a renderer for- Returns:
- the renderer, or
null
if no renderer is registered for that entity type
-
getEntityModels
Returns the set of entity models.- Returns:
- the set of entity models
-
getContext
Returns the context for the entity renderer provider.- Returns:
- the context for the entity renderer provider
-