From 9dd0c0dfb8533abbff6df6de3041df7ace0e99bf Mon Sep 17 00:00:00 2001 From: Sollace Date: Sat, 28 Apr 2018 12:29:26 +0200 Subject: [PATCH] Copy the texture width/height with children --- .../com/minelittlepony/render/AbstractPonyRenderer.java | 9 ++++++--- .../java/com/minelittlepony/render/PonyRenderer.java | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/minelittlepony/render/AbstractPonyRenderer.java b/src/main/java/com/minelittlepony/render/AbstractPonyRenderer.java index ea9796cf..b13caa00 100644 --- a/src/main/java/com/minelittlepony/render/AbstractPonyRenderer.java +++ b/src/main/java/com/minelittlepony/render/AbstractPonyRenderer.java @@ -22,8 +22,8 @@ public abstract class AbstractPonyRenderer> ex baseModel = model; } - public AbstractPonyRenderer(ModelBase model, int x, int y) { - super(model, x, y); + public AbstractPonyRenderer(ModelBase model, int texX, int texY) { + super(model, texX, texY); baseModel = model; } @@ -119,7 +119,10 @@ public abstract class AbstractPonyRenderer> ex */ public T child(int index) { if (childModels == null || index >= childModels.size()) { - child(copySelf().offset(modelOffsetX, modelOffsetY, modelOffsetZ)); + T copy = copySelf(); + child(copy.offset(modelOffsetX, modelOffsetY, modelOffsetZ)); + copy.textureHeight = textureHeight; + copy.textureWidth = textureWidth; } return (T)childModels.get(index); } diff --git a/src/main/java/com/minelittlepony/render/PonyRenderer.java b/src/main/java/com/minelittlepony/render/PonyRenderer.java index ce483fab..c2031230 100644 --- a/src/main/java/com/minelittlepony/render/PonyRenderer.java +++ b/src/main/java/com/minelittlepony/render/PonyRenderer.java @@ -8,8 +8,8 @@ public class PonyRenderer extends AbstractPonyRenderer { super(model); } - public PonyRenderer(ModelBase model, int x, int y) { - super(model, x, y); + public PonyRenderer(ModelBase model, int texX, int texY) { + super(model, texX, texY); } @Override