illusivesoulworks / constructsarmory

A Tinkers' Construct add-on for those looking to enter the world of armor
https://www.curseforge.com/minecraft/mc-mods/constructs-armory
Other
54 stars 36 forks source link

[Question] Armor Models and Textures for Resourcepacks #235

Closed TwiliDiamondOcelot closed 4 years ago

TwiliDiamondOcelot commented 4 years ago

Due to a mod conflict, I'm making a resource pack to change the armor models and textures to that of vanilla armors.

The problem I'm having is that I can't find where in the code your assets tell the armor to render with your custom one.

I would just have taken the source and mod it to render the armor like vanilla ones, but gradlew always fails due to the listed dependencies, and the built code without does not work.

I want to know if there is anything that you can do to help with any of the options, like properly building the source, using some technique in a resource pack to force load the armors like vanilla models, or if I am doing this for no reason due to this not being possible.

TheIllusiveC4 commented 4 years ago

What is causing the build to fail with the dependencies? I'd need to know the error before I can offer a possible solution.

or if I am doing this for no reason due to this not being possible.

I technically wouldn't say it's not possible, but it might be a bigger endeavor than you expect and could cause a lot of potential issues (particularly with other mods that implement textures that do not expect the vanilla model). You would definitely need to modify and build a custom version of the mod for yourself, at the very least. I will note here that if you go that route then I cannot offer any technical support on that front, but I can guide you in the right direction.

The models and textures are designated here: https://github.com/TheIllusiveC4/ConstructsArmory/blob/a6c52ed614c540a250785434337712b73f01db74/src/main/java/c4/conarm/lib/tinkering/TinkersArmor.java#L156-L193

You would need to override these to circumvent the custom models and custom textures. You might be able to just point it to the vanilla model and replace the textures and have it work, but I'm really not sure since there are many layers to the model and texture code.

TwiliDiamondOcelot commented 4 years ago

I deleted the folder that had the src, so I re-downloaded it and now the gradlew setupDecompWorkspace command is now failing. output.txt

Main error listed is this:

[ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
[ERROR] [org.gradle.BuildExceptionReporter]
[ERROR] [org.gradle.BuildExceptionReporter] What went wrong:
[ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':extractDependencyATs'.
[ERROR] [org.gradle.BuildExceptionReporter] > java.util.zip.ZipException: zip file is empty

If I recall correctly, the original problem I had is that the commands could not download the dependencies, so I wonder if it has something to do with it failing to download from the web.

As for the mod that is conflicting, it is the Modern Warfare 2.0 mod, as it edits the player model. I'm wondering if instead of calling the default model, you just copy the default model code so it's protected. I did install moreplayermodels as I saw it could fix this, but having to move to zombie model back to player is tedious, and the mod glitches sneaking. An interesting thing I noticed with moreplayermodels is that after force reloading the default player model, Conarm armor would properly display as normal, and it rendered in first person when holding a MW gun just as other armors do.

TheIllusiveC4 commented 4 years ago

If I recall correctly, the original problem I had is that the commands could not download the dependencies, so I wonder if it has something to do with it failing to download from the web.

That's a possibility. It seems the error you listed is a result of not having Tinkers' Construct properly in the project so it fails to extract the access transformers from it. I really can't help much here as I don't know what's causing the issue and cloning Construct's Armory into a fresh instance works fine for me (although it's simpler for me since my dependencies are all cached on my system).

I'm wondering if instead of calling the default model, you just copy the default model code so it's protected

This would be a bad idea, generally speaking. Unless it's necessary, it's better to call or refactor existing code instead of just copying it.

TwiliDiamondOcelot commented 4 years ago

Would it be possible to download the src code for the dependencies manually and move them to the src code for Conarm?

TheIllusiveC4 commented 4 years ago

You could add jars directly to a libs folder and then set up your dependencies that way. But then you'd have to remove some of the current code in the build.gradle to accompany the alternate method.

TwiliDiamondOcelot commented 4 years ago

Ok, so that worked, and I'm now going to see what I can do.

If I find a fix, I'll let you know.