Search in sources :

Example 1 with ModelLoader

use of net.minecraft.client.render.model.ModelLoader 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