Class ModelEvent.ModifyBakingResult
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ModelEvent
net.neoforged.neoforge.client.event.ModelEvent.ModifyBakingResult
- All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
- Enclosing class:
ModelEvent
public static class ModelEvent.ModifyBakingResult
extends ModelEvent
implements net.neoforged.fml.event.IModBusEvent
Fired while the
ModelManager
is reloading models, after the model registry is set up, but before it's
passed to the BlockModelShaper
for caching.
This event is fired from a worker thread and it is therefore not safe to access anything outside the
model registry and ModelBakery
provided in this event.
The ModelManager
firing this event is not fully set up with the latest data when this event fires and
must therefore not be accessed in this event.
This event is not cancellable.
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.ModelEvent
ModelEvent.BakingCompleted, ModelEvent.ModifyBakingResult, ModelEvent.RegisterLoaders, ModelEvent.RegisterStandalone
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final net.minecraft.client.resources.model.ModelBakery.BakingResult
private final net.minecraft.client.resources.model.ModelBakery
private final Function
<net.minecraft.client.resources.model.Material, net.minecraft.client.renderer.texture.TextureAtlasSprite> -
Constructor Summary
ConstructorsConstructorDescriptionModifyBakingResult
(net.minecraft.client.resources.model.ModelBakery.BakingResult bakingResult, Function<net.minecraft.client.resources.model.Material, net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter, net.minecraft.client.resources.model.ModelBakery modelBakery) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.client.resources.model.ModelBakery.BakingResult
net.minecraft.client.resources.model.ModelBakery
Function
<net.minecraft.client.resources.model.Material, net.minecraft.client.renderer.texture.TextureAtlasSprite> Returns a lookup function to retrieveTextureAtlasSprite
s by name from any of the atlases handled by theModelManager
.
-
Field Details
-
bakingResult
private final net.minecraft.client.resources.model.ModelBakery.BakingResult bakingResult -
textureGetter
private final Function<net.minecraft.client.resources.model.Material,net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter -
modelBakery
private final net.minecraft.client.resources.model.ModelBakery modelBakery
-
-
Constructor Details
-
ModifyBakingResult
@Internal public ModifyBakingResult(net.minecraft.client.resources.model.ModelBakery.BakingResult bakingResult, Function<net.minecraft.client.resources.model.Material, net.minecraft.client.renderer.texture.TextureAtlasSprite> textureGetter, net.minecraft.client.resources.model.ModelBakery modelBakery)
-
-
Method Details
-
getBakingResult
public net.minecraft.client.resources.model.ModelBakery.BakingResult getBakingResult()- Returns:
- The result of the model baking
-
getTextureGetter
public Function<net.minecraft.client.resources.model.Material,net.minecraft.client.renderer.texture.TextureAtlasSprite> getTextureGetter()Returns a lookup function to retrieveTextureAtlasSprite
s by name from any of the atlases handled by theModelManager
. SeeModelManager.VANILLA_ATLASES
for the atlases accessible through the returned function- Returns:
- a function to lookup sprites from an atlas by name
-
getModelBakery
public net.minecraft.client.resources.model.ModelBakery getModelBakery()- Returns:
- the model loader
-