Search in sources :

Example 1 with ModelLoaderHooks

use of net.fabricmc.fabric.impl.client.model.ModelLoaderHooks in project fabric by FabricMC.

the class MixinModelLoader method addModelHook.

@Inject(at = @At("HEAD"), method = "addModel")
private void addModelHook(ModelIdentifier id, CallbackInfo info) {
    if (id == MISSING) {
        // noinspection RedundantCast
        ModelLoaderHooks hooks = (ModelLoaderHooks) (Object) this;
        fabric_mlrLoaderInstance = ModelLoadingRegistryImpl.begin((ModelLoader) (Object) this, resourceManager);
        fabric_mlrLoaderInstance.onModelPopulation(hooks::fabric_addModel);
    }
}
Also used : ModelLoader(net.minecraft.client.render.model.ModelLoader) ModelLoaderHooks(net.fabricmc.fabric.impl.client.model.ModelLoaderHooks) Inject(org.spongepowered.asm.mixin.injection.Inject)

Aggregations

ModelLoaderHooks (net.fabricmc.fabric.impl.client.model.ModelLoaderHooks)1 ModelLoader (net.minecraft.client.render.model.ModelLoader)1 Inject (org.spongepowered.asm.mixin.injection.Inject)1