diff options
author | Linnea Gräf <nea@nea.moe> | 2024-12-09 19:13:03 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-12-09 19:13:03 +0100 |
commit | 1aa9a14eec09d2f2417806babcfc5bdf2c68a7fb (patch) | |
tree | ac2571dfdbd7d7c25ae61f5e048e521fdd0a7ab3 /src/texturePacks/java/moe/nea | |
parent | 911db95dd026194ee6324c83e8f183479242f2b5 (diff) | |
download | Firmament-1aa9a14eec09d2f2417806babcfc5bdf2c68a7fb.tar.gz Firmament-1aa9a14eec09d2f2417806babcfc5bdf2c68a7fb.tar.bz2 Firmament-1aa9a14eec09d2f2417806babcfc5bdf2c68a7fb.zip |
Diffstat (limited to 'src/texturePacks/java/moe/nea')
3 files changed, 17 insertions, 4 deletions
diff --git a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ApplyHeadModelInItemRenderer.java b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ApplyHeadModelInItemRenderer.java index cf5cf59..4665829 100644 --- a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ApplyHeadModelInItemRenderer.java +++ b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ApplyHeadModelInItemRenderer.java @@ -1,11 +1,23 @@ package moe.nea.firmament.mixins.custommodels; -import net.minecraft.client.item.ItemModelManager; +import net.minecraft.client.render.entity.LivingEntityRenderer; +import net.minecraft.client.render.entity.model.EntityModel; +import net.minecraft.client.render.entity.state.LivingEntityRenderState; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.decoration.DisplayEntity; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -@Mixin(ItemModelManager.class) -public class ApplyHeadModelInItemRenderer { +@Mixin(LivingEntityRenderer.class) +public class ApplyHeadModelInItemRenderer<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> { // TODO: replace head_model with a condition model (if possible, automatically) // TODO: ItemAsset.CODEC should upgrade partials + @Inject(method = "updateRenderState(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/client/render/entity/state/LivingEntityRenderState;F)V", + at = @At("TAIL")) + private void updateHeadState(T livingEntity, S livingEntityRenderState, float f, CallbackInfo ci) { + + } } diff --git a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceItemModelPatch.java b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceItemModelPatch.java index ffa23f7..dfc87a0 100644 --- a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceItemModelPatch.java +++ b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReplaceItemModelPatch.java @@ -32,7 +32,6 @@ public class ReplaceItemModelPatch { } @Unique - // TODO: Fix scissors private boolean hasModel(Identifier identifier) { return !(modelGetter.apply(identifier) instanceof MissingItemModel); } diff --git a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java index 3f4cc44..ddfb9ad 100644 --- a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java +++ b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/SupplyFakeModelPatch.java @@ -47,12 +47,14 @@ public class SupplyFakeModelPatch { var resource = model.getValue(); var itemModelId = model.getKey().withPath(it -> it.substring("models/item/".length(), it.length() - ".json".length())); // TODO: parse json file here and make use of it in order to generate predicate files. + // TODO: add a filter using the pack.mcmeta to opt out of this behaviour var genericModelId = itemModelId.withPrefixedPath("item/"); if (resourceManager.getResource(itemModelId) .map(Resource::getPack) .map(it -> isResourcePackNewer(resourceManager, it, resource.getPack())) .orElse(true)) { newModels.put(itemModelId, new ItemAsset( + // TODO: inject tint indexes based on the json data here new BasicItemModel.Unbaked(genericModelId, List.of()), new ItemAsset.Properties(true) )); |