diff options
author | Linnea Gräf <nea@nea.moe> | 2024-07-05 22:17:02 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-07-05 22:17:02 +0200 |
commit | 3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7 (patch) | |
tree | b383c2c584a96b93c46d1dae3efcd3c6571e3d05 /src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java | |
parent | 5ee4b8d925eb12e068038a1fd2e1f35cdd8ef87e (diff) | |
download | firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.tar.gz firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.tar.bz2 firmament-3d792dbef7c7e0f186e29f2e3999f99c2c14f5d7.zip |
Port to 1.21
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java b/src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java index 012a215..baffa4c 100644 --- a/src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java +++ b/src/main/java/moe/nea/firmament/mixins/CustomModelBakerPatch.java @@ -30,21 +30,21 @@ import java.util.function.BiFunction; public abstract class CustomModelBakerPatch { @Shadow - protected abstract void addModel(ModelIdentifier modelId); + protected abstract void loadItemModel(ModelIdentifier id); @Shadow - @Final - private Map<Identifier, UnbakedModel> modelsToBake; + abstract UnbakedModel getOrLoadModel(Identifier id); @Shadow - public abstract UnbakedModel getOrLoadModel(Identifier id); + @Final + private Map<ModelIdentifier, UnbakedModel> modelsToBake; @Inject(method = "bake", at = @At("HEAD")) - public void onBake(BiFunction<Identifier, SpriteIdentifier, Sprite> spriteLoader, CallbackInfo ci) { - BakeExtraModelsEvent.Companion.publish(new BakeExtraModelsEvent(this::addModel)); + public void onBake(ModelLoader.SpriteGetter spliteGetter, CallbackInfo ci) { + BakeExtraModelsEvent.Companion.publish(new BakeExtraModelsEvent(this::loadItemModel)); modelsToBake.values().forEach(model -> model.setParents(this::getOrLoadModel)); - modelsToBake.keySet().stream() - .filter(it -> !it.getNamespace().equals("minecraft")) - .forEach(it -> System.out.println("Non minecraft texture is being loaded: " + it)); +// modelsToBake.keySet().stream() +// .filter(it -> !it.id().getNamespace().equals("minecraft")) +// .forEach(it -> System.out.println("Non minecraft texture is being loaded: " + it)); } } |