From 1aa9a14eec09d2f2417806babcfc5bdf2c68a7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linnea=20Gr=C3=A4f?= Date: Mon, 9 Dec 2024 19:13:03 +0100 Subject: [PATCH] WIP: fix scissoring --- build.gradle.kts | 2 +- gradle/libs.versions.toml | 2 +- .../compat/rei/recipes/SBCraftingRecipe.kt | 2 +- .../ApplyHeadModelInItemRenderer.java | 18 +++++++++++++++--- .../custommodels/ReplaceItemModelPatch.java | 1 - .../custommodels/SupplyFakeModelPatch.java | 2 ++ 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 46fe2f7..e56d273 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -224,7 +224,7 @@ val explosiveEnhancementSourceSet = val wildfireGenderSourceSet = createIsolatedSourceSet("wildfireGender") val modmenuSourceSet = createIsolatedSourceSet("modmenu", isEnabled = false) val reiSourceSet = createIsolatedSourceSet("rei") -val moulconfigSourceSet = createIsolatedSourceSet("moulconfig", isEnabled = false) +val moulconfigSourceSet = createIsolatedSourceSet("moulconfig") val customTexturesSourceSet = createIsolatedSourceSet("texturePacks", "texturePacks") dependencies { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4c2aa52..43f9251 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -67,7 +67,7 @@ jarvis = "1.1.4" nealisp = "1.1.0" # Update from https://github.com/NotEnoughUpdates/MoulConfig/tags -moulconfig = "3.2.0" +moulconfig = "3.3.0" # Update from https://www.curseforge.com/minecraft/mc-mods/configured/files/all?page=1&pageSize=20 configured = "5441234" diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBCraftingRecipe.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBCraftingRecipe.kt index 0725b95..8db3d75 100644 --- a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBCraftingRecipe.kt +++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBCraftingRecipe.kt @@ -40,7 +40,7 @@ class SBCraftingRecipe(override val neuRecipe: NEUCraftingRecipe) : SBRecipe() { add(slot) val item = display.neuRecipe.inputs[i + j * 3] if (item == NEUIngredient.SENTINEL_EMPTY) continue - slot.entry(SBItemEntryDefinition.getEntry(item)) // TODO: make use of stackable item entries + slot.entry(SBItemEntryDefinition.getEntry(item)) } } add( 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> { // 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 @@ private void saveMissingModel(BakedModelManager bakedModelManager, CallbackInfo } @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 @@ private static ItemAssetsLoader.Result supplyExtraModels(ResourceManager resourc 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) ));