WIP: fix scissoring

This commit is contained in:
Linnea Gräf
2024-12-09 19:13:03 +01:00
parent 911db95dd0
commit 1aa9a14eec
6 changed files with 20 additions and 7 deletions

View File

@@ -224,7 +224,7 @@ val explosiveEnhancementSourceSet =
val wildfireGenderSourceSet = createIsolatedSourceSet("wildfireGender") val wildfireGenderSourceSet = createIsolatedSourceSet("wildfireGender")
val modmenuSourceSet = createIsolatedSourceSet("modmenu", isEnabled = false) val modmenuSourceSet = createIsolatedSourceSet("modmenu", isEnabled = false)
val reiSourceSet = createIsolatedSourceSet("rei") val reiSourceSet = createIsolatedSourceSet("rei")
val moulconfigSourceSet = createIsolatedSourceSet("moulconfig", isEnabled = false) val moulconfigSourceSet = createIsolatedSourceSet("moulconfig")
val customTexturesSourceSet = createIsolatedSourceSet("texturePacks", "texturePacks") val customTexturesSourceSet = createIsolatedSourceSet("texturePacks", "texturePacks")
dependencies { dependencies {

View File

@@ -67,7 +67,7 @@ jarvis = "1.1.4"
nealisp = "1.1.0" nealisp = "1.1.0"
# Update from https://github.com/NotEnoughUpdates/MoulConfig/tags # 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 # Update from https://www.curseforge.com/minecraft/mc-mods/configured/files/all?page=1&pageSize=20
configured = "5441234" configured = "5441234"

View File

@@ -40,7 +40,7 @@ class SBCraftingRecipe(override val neuRecipe: NEUCraftingRecipe) : SBRecipe() {
add(slot) add(slot)
val item = display.neuRecipe.inputs[i + j * 3] val item = display.neuRecipe.inputs[i + j * 3]
if (item == NEUIngredient.SENTINEL_EMPTY) continue if (item == NEUIngredient.SENTINEL_EMPTY) continue
slot.entry(SBItemEntryDefinition.getEntry(item)) // TODO: make use of stackable item entries slot.entry(SBItemEntryDefinition.getEntry(item))
} }
} }
add( add(

View File

@@ -1,11 +1,23 @@
package moe.nea.firmament.mixins.custommodels; 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.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) @Mixin(LivingEntityRenderer.class)
public class ApplyHeadModelInItemRenderer { 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: replace head_model with a condition model (if possible, automatically)
// TODO: ItemAsset.CODEC should upgrade partials // 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) {
}
} }

View File

@@ -32,7 +32,6 @@ public class ReplaceItemModelPatch {
} }
@Unique @Unique
// TODO: Fix scissors
private boolean hasModel(Identifier identifier) { private boolean hasModel(Identifier identifier) {
return !(modelGetter.apply(identifier) instanceof MissingItemModel); return !(modelGetter.apply(identifier) instanceof MissingItemModel);
} }

View File

@@ -47,12 +47,14 @@ public class SupplyFakeModelPatch {
var resource = model.getValue(); var resource = model.getValue();
var itemModelId = model.getKey().withPath(it -> it.substring("models/item/".length(), it.length() - ".json".length())); 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: 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/"); var genericModelId = itemModelId.withPrefixedPath("item/");
if (resourceManager.getResource(itemModelId) if (resourceManager.getResource(itemModelId)
.map(Resource::getPack) .map(Resource::getPack)
.map(it -> isResourcePackNewer(resourceManager, it, resource.getPack())) .map(it -> isResourcePackNewer(resourceManager, it, resource.getPack()))
.orElse(true)) { .orElse(true)) {
newModels.put(itemModelId, new ItemAsset( newModels.put(itemModelId, new ItemAsset(
// TODO: inject tint indexes based on the json data here
new BasicItemModel.Unbaked(genericModelId, List.of()), new BasicItemModel.Unbaked(genericModelId, List.of()),
new ItemAsset.Properties(true) new ItemAsset.Properties(true)
)); ));