From 694db391bb7fa35ba9c2d9982ba1d8bc6801295e Mon Sep 17 00:00:00 2001 From: Sollace Date: Thu, 12 Apr 2018 16:21:19 +0200 Subject: [PATCH] Giants are now ponies --- .../com/minelittlepony/MineLittlePony.java | 4 ++++ .../java/com/minelittlepony/PonyManager.java | 2 +- .../java/com/minelittlepony/PonyRace.java | 3 +-- .../renderer/RenderPonyZombie.java | 19 +++++++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/minelittlepony/MineLittlePony.java b/src/main/java/com/minelittlepony/MineLittlePony.java index 00ddc4aa..ea915028 100644 --- a/src/main/java/com/minelittlepony/MineLittlePony.java +++ b/src/main/java/com/minelittlepony/MineLittlePony.java @@ -27,6 +27,7 @@ import net.minecraft.client.resources.data.MetadataSerializer; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.Entity; import net.minecraft.entity.monster.EntityEvoker; +import net.minecraft.entity.monster.EntityGiantZombie; import net.minecraft.entity.monster.EntityHusk; import net.minecraft.entity.monster.EntityIllusionIllager; import net.minecraft.entity.monster.EntityPigZombie; @@ -108,6 +109,7 @@ public class MineLittlePony { saveRenderer(rm, EntityZombieVillager.class); // zombies saveRenderer(rm, EntityZombie.class); + saveRenderer(rm, EntityGiantZombie.class); saveRenderer(rm, EntityHusk.class); // pig zombie saveRenderer(rm, EntityPigZombie.class); @@ -147,10 +149,12 @@ public class MineLittlePony { if (this.config.zombies) { ModUtilities.addRenderer(EntityZombie.class, new RenderPonyZombie<>(rm)); ModUtilities.addRenderer(EntityHusk.class, new RenderPonyZombie.Husk(rm)); + ModUtilities.addRenderer(EntityGiantZombie.class, new RenderPonyZombie.Giant(rm)); logger.info("Zombies are now ponies."); } else { ModUtilities.addRenderer(EntityZombie.class, getRenderer(EntityZombie.class)); ModUtilities.addRenderer(EntityHusk.class, getRenderer(EntityHusk.class)); + ModUtilities.addRenderer(EntityGiantZombie.class, getRenderer(EntityGiantZombie.class)); } if (this.config.pigzombies) { diff --git a/src/main/java/com/minelittlepony/PonyManager.java b/src/main/java/com/minelittlepony/PonyManager.java index ed340954..8d52aa14 100644 --- a/src/main/java/com/minelittlepony/PonyManager.java +++ b/src/main/java/com/minelittlepony/PonyManager.java @@ -113,7 +113,7 @@ public class PonyManager implements IResourceManagerReloadListener { MineLittlePony.logger.error("Invalid bgponies.json in " + res.getResourcePackName(), e); } } - } catch (IOException e) { + } catch (IOException ignored) { // this isn't the exception you're looking for. } MineLittlePony.logger.info("Detected {} background ponies installed.", getNumberOfPonies()); diff --git a/src/main/java/com/minelittlepony/PonyRace.java b/src/main/java/com/minelittlepony/PonyRace.java index 7c775012..9fe4923d 100644 --- a/src/main/java/com/minelittlepony/PonyRace.java +++ b/src/main/java/com/minelittlepony/PonyRace.java @@ -11,8 +11,7 @@ public enum PonyRace { ZEBRA(false, false), REFORMED_CHANGELING(true, true), GRIFFIN(true, false), - HIPPOGRIFF(true, false), - ; + HIPPOGRIFF(true, false); private boolean wings; private boolean horn; diff --git a/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java b/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java index 23cc1df0..87936155 100644 --- a/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java +++ b/src/main/java/com/minelittlepony/renderer/RenderPonyZombie.java @@ -1,8 +1,10 @@ package com.minelittlepony.renderer; import com.minelittlepony.model.PMAPI; + import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderManager; +import net.minecraft.entity.monster.EntityGiantZombie; import net.minecraft.entity.monster.EntityHusk; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.util.ResourceLocation; @@ -39,5 +41,22 @@ public class RenderPonyZombie extends RenderPonyMob } } + + public static class Giant extends RenderPonyMob { + public Giant(RenderManager renderManager) { + super(renderManager, PMAPI.zombie); + } + + @Override + protected void preRenderCallback(EntityGiantZombie entitylivingbaseIn, float partialTickTime) { + GlStateManager.scale(3, 3, 3); + super.preRenderCallback(entitylivingbaseIn, partialTickTime); + } + + @Override + protected ResourceLocation getTexture(EntityGiantZombie zombie) { + return ZOMBIE; + } + } }