Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions java/ec3/client/render/RenderPlayerClone.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,29 @@

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ec3.common.entity.EntityPlayerClone;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;

import java.util.Map;

import org.lwjgl.opengl.GL11;

import com.mojang.authlib.GameProfile;
import com.mojang.authlib.minecraft.MinecraftProfileTexture;
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;

@SideOnly(Side.CLIENT)
public class RenderPlayerClone extends RenderBiped
{
private static final ResourceLocation textures = new ResourceLocation("textures/entity/steve.png");
/** The model of the enderman */
private static ResourceLocation textures = AbstractClientPlayer.locationStevePng;
/** The model of the Steve */
private ModelBiped model;
public RenderPlayerClone()
{
Expand Down Expand Up @@ -43,6 +53,23 @@ protected ResourceLocation getEntityTexture(Entity p_110775_1_)

public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_)
{
textures = AbstractClientPlayer.locationStevePng;
EntityPlayer player = (EntityPlayer) ((EntityPlayerClone)p_76986_1_).playerToAttack;
if(player != null)
{
GameProfile gp = player.getGameProfile();
if(gp != null)
{
Minecraft mine = Minecraft.getMinecraft();
Map map = mine.func_152342_ad().func_152788_a(gp);

if (map.containsKey(Type.SKIN))
{
textures = mine.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN);
}
}
}

super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
}
}
}
9 changes: 7 additions & 2 deletions java/ec3/common/entity/EntityPlayerClone.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;

public class EntityPlayerClone extends EntityZombie{

public EntityPlayer playerToAttack = null;

public EntityPlayerClone(World w)
{
super(w);
Expand All @@ -19,9 +22,10 @@ public EntityPlayerClone(World w)
this.equipmentDropChances[4] = 0;
}

protected Entity findPlayerToAttack()
public Entity findPlayerToAttack()
{
return this.worldObj.getClosestVulnerablePlayerToEntity(this, 16);
playerToAttack = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16);
return playerToAttack;
}

protected void applyEntityAttributes()
Expand Down Expand Up @@ -66,3 +70,4 @@ protected String getDeathSound()
}

}