Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rendering of Modded Armor/Clothing Broken #5

Open
SalmonSays opened this issue Sep 3, 2018 · 4 comments
Open

Rendering of Modded Armor/Clothing Broken #5

SalmonSays opened this issue Sep 3, 2018 · 4 comments

Comments

@SalmonSays
Copy link

SalmonSays commented Sep 3, 2018

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:

  • extend 'net.minecraft.client.model.ModelBiped' and
  • have a canonical name that matches at least one of the candidate class names or patterns

to use Render Player API by

  • changing their super class from 'net.minecraft.client.model.ModelBiped' to 'api.player.model.ModelPlayerArmor' and
  • removing all locally declared methods that overwrite methods used by Render Player API in case they dont't call their super method at least on one execution path.

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
Copy link
Owner

Tommsy64 commented Sep 3, 2018

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
Copy link
Owner

Tommsy64 commented Sep 3, 2018

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
Copy link
Author

@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
Copy link
Owner

Tommsy64 commented Dec 1, 2018

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants