From f64fbf109c930bb6faf058d4f32ff995ff1a1a4a Mon Sep 17 00:00:00 2001 From: Artem226 Date: Thu, 21 Jan 2016 16:18:42 +0300 Subject: [PATCH 1/2] PlayerClone isn't clone,if it don't clone the skin! Player's clone is now not only copies the armor, but the skin! (If Player's account is legal and Mojang servers is online, else it looks like Steve). --- java/ec3/client/render/RenderPlayerClone.java | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/java/ec3/client/render/RenderPlayerClone.java b/java/ec3/client/render/RenderPlayerClone.java index c44e66b3..d922e5a5 100644 --- a/java/ec3/client/render/RenderPlayerClone.java +++ b/java/ec3/client/render/RenderPlayerClone.java @@ -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() { @@ -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_); } -} \ No newline at end of file +} From 5fcfde5f1b62504c87e86a2d03d017c7d27c7205 Mon Sep 17 00:00:00 2001 From: Artem226 Date: Thu, 21 Jan 2016 16:26:37 +0300 Subject: [PATCH 2/2] PlayerClone isn't clone,if it don't clone the skin! Player's clone is now not only copies the armor, but the skin! (If Player's account is legal and Mojang servers is online, else it looks like Steve). --- java/ec3/common/entity/EntityPlayerClone.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/java/ec3/common/entity/EntityPlayerClone.java b/java/ec3/common/entity/EntityPlayerClone.java index 9f92775d..ae742865 100644 --- a/java/ec3/common/entity/EntityPlayerClone.java +++ b/java/ec3/common/entity/EntityPlayerClone.java @@ -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); @@ -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() @@ -66,3 +70,4 @@ protected String getDeathSound() } } +