Tommsy64 / SmartMovingReloaded

A Minecraft mod that provides additional movement actions such as crawling and climbing.
GNU General Public License v3.0
51 stars 7 forks source link

Rendering of Modded Armor/Clothing Broken #5

Open SalmonSays opened 6 years ago

SalmonSays commented 6 years ago

I'm gunna make a separate issue for this if that's alright with you @Tommsy64 -

So here are visual samples of what goes wrong when using certain modded armors alongside SMR:

xxrktly

-The body fits more or less naturally when facing south. In these examples I'll be using Elementium Armor from Botania but it'll happen on a lot of modded armors like those from Construct's Armory, Jetpacks from SimplyJetpacks, Mekanism armors, etc. The only armors that I've seen work so far are ones implemented in a very "vanilla" way like TechReborn.

cxjsx0s

-When turning, the body maintains idle animations and action motions like when clicking/mining, but doesn't match the movement of the player rotationally.

ydldmha

-When crouching in the correct direction (South), the armor model crouches but clips through the body and is positioned incorrectly.

eybhmin

-When crawling the armor stays in the crouched position.

ifqwhz4

-And continues to not inherit rotation properly.

This has historically been a problem with the Render Player API used in previous versions of Smart Moving because of unexpected ways certain mods access RenderPlayer, ModelPlayer, and ModelBiped (cct, bqj, and bpx respectively). Lifted straight from the readme, Render Player API Enhancer for 1.12.x has attempted to fix this implementation by violently forcing all classes that:

to use Render Player API by

I'm hopeful there's a more tasteful way of fixing this issue than forcing classes like that, but I have yet to discover it- though admittedly I'm still wrapping my head around using mixins properly.

Tommsy64 commented 6 years ago

I believe using a transformer to change the superclass of classes that extend net.minecraft.client.model.ModelBiped (just like RenderPlayerAPI did) will be the best way to handle this.

SpongePowered does exactly this:

Disabling the custom armor model in Botania yields this.

Edit: Simply replacing the superclass of Botaina's custom armor model will not be enough.

Tommsy64 commented 6 years ago

Running SmartMoving (the port) 1.12 with RenderPlayerAPIEnhancer and Botania makes two sets of armor appear, one that is correct and one that remains facing only one direction.

2018-09-03_14 59 26

SalmonSays commented 5 years ago

@Tommsy64 Quick Update- I was poking around the repository for Resize Potion, whose source is available here:

https://github.com/CammiePone/Resize-Potion

I noticed that their solution for handling armor plays really nicely with Botania/custom armor models for scaling, rotation, translation, etc.

2018-11-30_17 23 08

It's my hope these methods can be retrofitted to SmartMovingReloaded, as I'm super confident this is enough of a fix/update to warrant a totally usable beta for end-users.

Tommsy64 commented 5 years ago

@SalmonSays I appreciate the help! Unfortunately, the Resize-Potion mod simply changes a "size" value built into all entities by Vanilla. (I believe this is used to control the size of slime mobs). This value acts as a simple multiplier for the entire rendering of the entity.

To add all the custom movement animations, SmartMoving completely replaces the rendering of the player entity. As other mods create their custom armor for the Vanilla player renderer, there is an inherent incompatibility.

Fortunately, MoBends appears to have a way of modifying the vanilla renderer to support custom animations rather than replacing it. Once I understand how it is done, I'll see if I can do something similar.