aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament/mixins/custommodels/ProvideBakerToJsonUnbakedModelPatch.java
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-11-03 14:51:29 +0100
committerLinnea Gräf <nea@nea.moe>2024-11-03 14:51:29 +0100
commited3e9f0d70a758ac1c23c6c8d67eeb7105d13817 (patch)
tree1a7a3202994a10a4242a83fdef72440dc6da7771 /src/main/java/moe/nea/firmament/mixins/custommodels/ProvideBakerToJsonUnbakedModelPatch.java
parente2677d6ee5c3f74d5f547ca48bf6641f047a2a1e (diff)
downloadFirmament-ed3e9f0d70a758ac1c23c6c8d67eeb7105d13817.tar.gz
Firmament-ed3e9f0d70a758ac1c23c6c8d67eeb7105d13817.tar.bz2
Firmament-ed3e9f0d70a758ac1c23c6c8d67eeb7105d13817.zip
Fix tint overrides
Diffstat (limited to 'src/main/java/moe/nea/firmament/mixins/custommodels/ProvideBakerToJsonUnbakedModelPatch.java')
-rw-r--r--src/main/java/moe/nea/firmament/mixins/custommodels/ProvideBakerToJsonUnbakedModelPatch.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/custommodels/ProvideBakerToJsonUnbakedModelPatch.java b/src/main/java/moe/nea/firmament/mixins/custommodels/ProvideBakerToJsonUnbakedModelPatch.java
new file mode 100644
index 0000000..c1ac119
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/custommodels/ProvideBakerToJsonUnbakedModelPatch.java
@@ -0,0 +1,27 @@
+package moe.nea.firmament.mixins.custommodels;
+
+import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
+import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
+import moe.nea.firmament.features.texturepack.JsonUnbakedModelFirmExtra;
+import net.minecraft.client.render.model.BakedModel;
+import net.minecraft.client.render.model.Baker;
+import net.minecraft.client.render.model.ModelBakeSettings;
+import net.minecraft.client.render.model.json.JsonUnbakedModel;
+import net.minecraft.client.texture.Sprite;
+import net.minecraft.client.util.SpriteIdentifier;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+
+import java.util.function.Function;
+
+/**
+ * @see JsonUnbakedModelDataHolder#storeExtraBaker_firmament
+ */
+@Mixin(targets = "net.minecraft.client.render.model.ModelBaker$BakerImpl")
+public abstract class ProvideBakerToJsonUnbakedModelPatch implements Baker {
+ @WrapOperation(method = "bake(Lnet/minecraft/client/render/model/UnbakedModel;Lnet/minecraft/client/render/model/ModelBakeSettings;)Lnet/minecraft/client/render/model/BakedModel;", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/json/JsonUnbakedModel;bake(Ljava/util/function/Function;Lnet/minecraft/client/render/model/ModelBakeSettings;Z)Lnet/minecraft/client/render/model/BakedModel;"))
+ private BakedModel provideExtraBakerToModel(JsonUnbakedModel instance, Function<SpriteIdentifier, Sprite> function, ModelBakeSettings modelBakeSettings, boolean bl, Operation<BakedModel> original) {
+ ((JsonUnbakedModelFirmExtra) instance).storeExtraBaker_firmament(this);
+ return original.call(instance, function, modelBakeSettings, bl);
+ }
+}