Skip to content
Permalink
Browse files

Fixed checking for render class being "too early (even during postini…

…t)" causing mobs from mods to render with no renderer. Fixes #75
  • Loading branch information...
iChun committed Sep 1, 2013
1 parent d16c7b2 commit 003c2ed1c13c93bfdf2651cab7adc55ad20dbd14
Showing with 23 additions and 8 deletions.
  1. +8 −6 morph/client/core/ClientProxy.java
  2. +15 −2 morph/common/core/EntityHelper.java
@@ -10,6 +10,7 @@
import morph.client.model.ModelList;
import morph.common.Morph;
import morph.common.core.CommonProxy;
import morph.common.core.EntityHelper;
import morph.common.core.ObfHelper;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.model.ModelBase;
@@ -72,8 +73,12 @@ else if(f.getType() == Class.class)

for(int i = compatibleEntities.size() - 1; i >= 0; i--)
{
Render rend = RenderManager.instance.getEntityClassRenderObject(compatibleEntities.get(i));
if(rend.getClass() == RenderEntity.class)
if(renders.containsKey(compatibleEntities.get(i)))
{
continue;
}
Render rend = EntityHelper.getEntityClassRenderObject(compatibleEntities.get(i));
if(rend != null && rend.getClass() == RenderEntity.class)
{
rend = renders.get(compatibleEntities.get(i));
}
@@ -82,10 +87,7 @@ else if(f.getType() == Class.class)
compatibleEntities.remove(i);
continue;
}
if(!renders.containsKey(compatibleEntities.get(i)))
{
renders.put(compatibleEntities.get(i), (RendererLivingEntity)rend);
}
renders.put(compatibleEntities.get(i), (RendererLivingEntity)rend);
}

for(Class clz : compatibleEntities)
@@ -9,6 +9,8 @@
import morph.common.morph.MorphHandler;
import morph.common.morph.MorphInfo;
import morph.common.morph.MorphState;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.IBossDisplayData;
@@ -17,14 +19,25 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.packet.Packet131MapData;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import cpw.mods.fml.common.network.PacketDispatcher;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class EntityHelper
{

@SideOnly(Side.CLIENT)
public static Render getEntityClassRenderObject(Class par1Class)
{
Render render = (Render)RenderManager.instance.entityRenderMap.get(par1Class);
if (render == null && par1Class != Entity.class)
{
render = getEntityClassRenderObject(par1Class.getSuperclass());
}
return render;
}

public static boolean morphPlayer(EntityPlayerMP player, EntityLivingBase living, boolean kill)
{
if(!(Morph.childMorphs != 0 || Morph.childMorphs == 0 && !living.isChild()) && (Morph.playerMorphs != 0 || Morph.playerMorphs == 0 && !(living instanceof EntityPlayer)) && (Morph.bossMorphs != 0 || Morph.bossMorphs == 0 && !(living instanceof IBossDisplayData)))

0 comments on commit 003c2ed

Please sign in to comment.
You can’t perform that action at this time.