mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-12-02 08:48:00 +01:00
Fixed remote preview player not being scaled correctly
This commit is contained in:
parent
7d60a05317
commit
5635e9cd4c
2 changed files with 34 additions and 13 deletions
|
@ -115,13 +115,4 @@ public class RenderPlayerModel<M extends EntityPlayerModel> extends RenderLiving
|
|||
popAttrib();
|
||||
popMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(M entity, float partialTicks) {
|
||||
renderCloak(entity, partialTicks);
|
||||
}
|
||||
|
||||
protected void renderCloak(M entity, float partialTicks) {
|
||||
super.preRenderCallback(entity, partialTicks);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
package com.minelittlepony.hdskins.gui;
|
||||
|
||||
import com.minelittlepony.MineLittlePony;
|
||||
import com.minelittlepony.ducks.IRenderPony;
|
||||
import com.minelittlepony.model.ModelWrapper;
|
||||
import com.minelittlepony.model.capabilities.IModel;
|
||||
import com.minelittlepony.model.components.PonyElytra;
|
||||
import com.minelittlepony.model.player.PlayerModels;
|
||||
import com.minelittlepony.pony.data.Pony;
|
||||
import com.minelittlepony.pony.data.PonyRace;
|
||||
import com.minelittlepony.render.RenderPony;
|
||||
import com.minelittlepony.render.layer.AbstractPonyLayer;
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
import com.voxelmodpack.hdskins.gui.RenderPlayerModel;
|
||||
|
@ -26,14 +28,40 @@ import net.minecraft.util.ResourceLocation;
|
|||
/**
|
||||
* Renderer used for the dummy pony model when selecting a skin.
|
||||
*/
|
||||
public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
|
||||
public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> implements IRenderPony<EntityPonyModel> {
|
||||
|
||||
boolean renderingAsHuman = false;
|
||||
|
||||
protected final RenderPony<EntityPonyModel> renderPony = new RenderPony<>(this);
|
||||
|
||||
public RenderPonyModel(RenderManager manager) {
|
||||
super(manager);
|
||||
}
|
||||
|
||||
private ModelWrapper playerModel;
|
||||
|
||||
@Override
|
||||
public ModelWrapper getModelWrapper() {
|
||||
return playerModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pony getEntityPony(EntityPonyModel entity) {
|
||||
boolean slim = entity.usesThinSkin();
|
||||
ResourceLocation loc = getEntityTexture(entity);
|
||||
|
||||
return MineLittlePony.getInstance().getManager().getPony(loc, slim);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void preRenderCallback(EntityPonyModel entity, float ticks) {
|
||||
if (renderingAsHuman) {
|
||||
super.preRenderCallback(entity, ticks);
|
||||
} else {
|
||||
renderPony.preRenderCallback(entity, ticks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelPlayer getEntityModel(EntityPonyModel playermodel) {
|
||||
renderingAsHuman = true;
|
||||
|
@ -55,12 +83,14 @@ public class RenderPonyModel extends RenderPlayerModel<EntityPonyModel> {
|
|||
|
||||
boolean canWet = playermodel.wet && (loc == playermodel.getBlankSkin(Type.SKIN) || race == PonyRace.SEAPONY);
|
||||
|
||||
ModelWrapper pm = canWet ? PlayerModels.SEAPONY.getModel(slim) : thePony.getModel(true);
|
||||
pm.apply(thePony.getMetadata());
|
||||
playerModel = canWet ? PlayerModels.SEAPONY.getModel(slim) : thePony.getModel(true);
|
||||
playerModel.apply(thePony.getMetadata());
|
||||
|
||||
renderPony.setPonyModel(playerModel);
|
||||
|
||||
renderingAsHuman = false;
|
||||
|
||||
return pm.getBody();
|
||||
return playerModel.getBody();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue