From 36015ba384060d86113038ebf5a0dac22a5c93d4 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 14 Aug 2018 19:06:46 +0200 Subject: [PATCH] Fixed the Proxy renderer not including layers. (Guardians can have arrows now! :D) --- .../java/com/minelittlepony/render/RenderPonyMob.java | 10 ++++++++-- .../render/ponies/RenderPonyGuardian.java | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minelittlepony/render/RenderPonyMob.java b/src/main/java/com/minelittlepony/render/RenderPonyMob.java index e07ddf75..3f4c3202 100644 --- a/src/main/java/com/minelittlepony/render/RenderPonyMob.java +++ b/src/main/java/com/minelittlepony/render/RenderPonyMob.java @@ -15,11 +15,14 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.layers.LayerArrow; +import net.minecraft.client.renderer.entity.layers.LayerRenderer; import net.minecraft.entity.EntityLiving; import net.minecraft.util.ResourceLocation; import javax.annotation.Nonnull; +import java.util.List; + // TODO: A lot of this duplicates RenderPonyPlayer // and is the whole reason we had this scaling bug in the first place. public abstract class RenderPonyMob extends RenderLiving implements IRenderPony { @@ -86,13 +89,16 @@ public abstract class RenderPonyMob extends RenderLiving public abstract static class Proxy extends RenderPonyMob { - public Proxy(RenderManager manager, ModelWrapper model) { + public Proxy(List> exportedLayers, RenderManager manager, ModelWrapper model) { super(manager, model); + + exportedLayers.addAll(layerRenderers); } @Override protected void addLayers() { - + layerRenderers.clear(); + super.addLayers(); } public final ResourceLocation getTextureFor(T entity) { diff --git a/src/main/java/com/minelittlepony/render/ponies/RenderPonyGuardian.java b/src/main/java/com/minelittlepony/render/ponies/RenderPonyGuardian.java index ffb35818..d1e20b6e 100644 --- a/src/main/java/com/minelittlepony/render/ponies/RenderPonyGuardian.java +++ b/src/main/java/com/minelittlepony/render/ponies/RenderPonyGuardian.java @@ -22,7 +22,7 @@ public class RenderPonyGuardian extends RenderGuardian { super(manager); mainModel = PMAPI.seapony.getBody(); - ponyRenderer = new RenderPonyMob.Proxy(manager, PMAPI.seapony) { + ponyRenderer = new RenderPonyMob.Proxy(layerRenderers, manager, PMAPI.seapony) { @Override protected ResourceLocation getTexture(EntityGuardian entity) { return RenderPonyGuardian.this.getTexture(entity);