Copy the texture width/height with children

This commit is contained in:
Sollace 2018-04-28 12:29:26 +02:00
parent da3f14c85b
commit 9dd0c0dfb8
2 changed files with 8 additions and 5 deletions

View file

@ -22,8 +22,8 @@ public abstract class AbstractPonyRenderer<T extends AbstractPonyRenderer<T>> 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<T extends AbstractPonyRenderer<T>> 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);
}

View file

@ -8,8 +8,8 @@ public class PonyRenderer extends AbstractPonyRenderer<PonyRenderer> {
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