mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-26 22:38:00 +01:00
Fixed the Proxy renderer not including layers. (Guardians can have arrows now! :D)
This commit is contained in:
parent
bf8025bdaf
commit
36015ba384
2 changed files with 9 additions and 3 deletions
|
@ -15,11 +15,14 @@ import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.entity.RenderLiving;
|
import net.minecraft.client.renderer.entity.RenderLiving;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.client.renderer.entity.layers.LayerArrow;
|
import net.minecraft.client.renderer.entity.layers.LayerArrow;
|
||||||
|
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
// TODO: A lot of this duplicates RenderPonyPlayer
|
// TODO: A lot of this duplicates RenderPonyPlayer
|
||||||
// and is the whole reason we had this scaling bug in the first place.
|
// and is the whole reason we had this scaling bug in the first place.
|
||||||
public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving<T> implements IRenderPony<T> {
|
public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving<T> implements IRenderPony<T> {
|
||||||
|
@ -86,13 +89,16 @@ public abstract class RenderPonyMob<T extends EntityLiving> extends RenderLiving
|
||||||
|
|
||||||
public abstract static class Proxy<T extends EntityLiving> extends RenderPonyMob<T> {
|
public abstract static class Proxy<T extends EntityLiving> extends RenderPonyMob<T> {
|
||||||
|
|
||||||
public Proxy(RenderManager manager, ModelWrapper model) {
|
public Proxy(List<LayerRenderer<T>> exportedLayers, RenderManager manager, ModelWrapper model) {
|
||||||
super(manager, model);
|
super(manager, model);
|
||||||
|
|
||||||
|
exportedLayers.addAll(layerRenderers);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addLayers() {
|
protected void addLayers() {
|
||||||
|
layerRenderers.clear();
|
||||||
|
super.addLayers();
|
||||||
}
|
}
|
||||||
|
|
||||||
public final ResourceLocation getTextureFor(T entity) {
|
public final ResourceLocation getTextureFor(T entity) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class RenderPonyGuardian extends RenderGuardian {
|
||||||
super(manager);
|
super(manager);
|
||||||
mainModel = PMAPI.seapony.getBody();
|
mainModel = PMAPI.seapony.getBody();
|
||||||
|
|
||||||
ponyRenderer = new RenderPonyMob.Proxy<EntityGuardian>(manager, PMAPI.seapony) {
|
ponyRenderer = new RenderPonyMob.Proxy<EntityGuardian>(layerRenderers, manager, PMAPI.seapony) {
|
||||||
@Override
|
@Override
|
||||||
protected ResourceLocation getTexture(EntityGuardian entity) {
|
protected ResourceLocation getTexture(EntityGuardian entity) {
|
||||||
return RenderPonyGuardian.this.getTexture(entity);
|
return RenderPonyGuardian.this.getTexture(entity);
|
||||||
|
|
Loading…
Reference in a new issue