diff --git a/src/main/java/noppes/npcs/CustomNpcs.java b/src/main/java/noppes/npcs/CustomNpcs.java index a2fec13a1..ba3fbfe13 100644 --- a/src/main/java/noppes/npcs/CustomNpcs.java +++ b/src/main/java/noppes/npcs/CustomNpcs.java @@ -201,7 +201,7 @@ public class CustomNpcs { registerNpc(EntityNpcDragon.class, "NpcDragon"); registerNpc(EntityNPCEnderman.class, "npcEnderman"); registerNpc(EntityNPCGolem.class, "npcGolem"); - registerNpc(EntityNPC64x64.class, "CustomNpc64"); + registerNpc(EntityCustomNpc64.class, "CustomNpc64"); registerNpc(EntityCustomNpc.class, "CustomNpc"); diff --git a/src/main/java/noppes/npcs/DataScript.java b/src/main/java/noppes/npcs/DataScript.java index 7699db313..d36b0be7c 100644 --- a/src/main/java/noppes/npcs/DataScript.java +++ b/src/main/java/noppes/npcs/DataScript.java @@ -14,7 +14,6 @@ import noppes.npcs.constants.EnumScriptType; import noppes.npcs.controllers.ScriptContainer; import noppes.npcs.controllers.ScriptController; import noppes.npcs.entity.EntityCustomNpc; -import noppes.npcs.entity.EntityNPC64x64; import noppes.npcs.entity.EntityNPCInterface; import noppes.npcs.scripted.ScriptEvent; import noppes.npcs.scripted.ScriptNpc; diff --git a/src/main/java/noppes/npcs/client/ClientProxy.java b/src/main/java/noppes/npcs/client/ClientProxy.java index fa48df938..d1cdc4543 100644 --- a/src/main/java/noppes/npcs/client/ClientProxy.java +++ b/src/main/java/noppes/npcs/client/ClientProxy.java @@ -183,7 +183,8 @@ public class ClientProxy extends CommonProxy { // Changes Made Here: RenderingRegistry.registerEntityRenderingHandler(EntityCustomNpc.class, new RenderCustomNpc()); - RenderingRegistry.registerEntityRenderingHandler(EntityNPC64x64.class, new RenderCustomNpc(false)); // False for Steve + RenderingRegistry.registerEntityRenderingHandler(EntityCustomNpc64.class, new RenderCustomNpc(false)); // False for Steve + // RenderingRegistry.registerEntityRenderingHandler(EntityNPCAlex.class, new RenderCustomNpc(true)); // False for Steve RenderingRegistry.registerEntityRenderingHandler(EntityNPCGolem.class, new RenderNPCHumanMale( diff --git a/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java b/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java index c12892c6f..aa9aecd32 100644 --- a/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java +++ b/src/main/java/noppes/npcs/client/gui/model/GuiCreationScreen.java @@ -32,7 +32,7 @@ import noppes.npcs.constants.EnumPacketServer; import noppes.npcs.controllers.PixelmonHelper; import noppes.npcs.entity.EntityCustomNpc; import noppes.npcs.entity.EntityFakeLiving; -import noppes.npcs.entity.EntityNPC64x64; +import noppes.npcs.entity.EntityCustomNpc64; import noppes.npcs.entity.EntityNPCInterface; public class GuiCreationScreen extends GuiModelInterface implements ICustomScrollListener{ @@ -54,7 +54,7 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol for(Object name : mapping.keySet()){ Class c = (Class) mapping.get(name); try { - if(!EntityCustomNpc.class.isAssignableFrom(c) && EntityLiving.class.isAssignableFrom(c) && c.getConstructor(new Class[] {World.class}) != null && !Modifier.isAbstract(c.getModifiers())){ + if( (!EntityCustomNpc.class.isAssignableFrom(c) && !EntityCustomNpc.class.isAssignableFrom(c)) && EntityLiving.class.isAssignableFrom(c) && c.getConstructor(new Class[] {World.class}) != null && !Modifier.isAbstract(c.getModifiers())){ if(RenderManager.instance.getEntityClassRenderObject(c) instanceof RendererLivingEntity) data.put(name.toString(),c.asSubclass(EntityLivingBase.class)); } @@ -63,7 +63,7 @@ public class GuiCreationScreen extends GuiModelInterface implements ICustomScrol } catch (NoSuchMethodException e) { } } - data.put("CustomNPC64x64", EntityNPC64x64.class); + data.put("CustomNPC64x64", EntityCustomNpc64.class); list = new ArrayList(data.keySet()); Collections.sort(list,String.CASE_INSENSITIVE_ORDER); } diff --git a/src/main/java/noppes/npcs/client/model/ModelMPM.java b/src/main/java/noppes/npcs/client/model/ModelMPM.java index cf52183cf..669086da8 100644 --- a/src/main/java/noppes/npcs/client/model/ModelMPM.java +++ b/src/main/java/noppes/npcs/client/model/ModelMPM.java @@ -161,7 +161,7 @@ public class ModelMPM extends ModelNPCMale{ this.bipedLeftLeg.addBox(-2.0F, 0.0F, -2.0F, 4, 12, 4, par1); this.bipedLeftLeg.setRotationPoint(1.9F, 12.0F + par2, 0.0F); - headwear = new ModelHeadwear(this); + headwear = new ModelHeadwear(this, arms); legs = new ModelLegs(this, (ModelScaleRenderer)bipedRightLeg, (ModelScaleRenderer)bipedLeftLeg); this.bipedBody.addChild(breasts = new ModelBreasts(this)); diff --git a/src/main/java/noppes/npcs/client/model/part/ModelHeadwear.java b/src/main/java/noppes/npcs/client/model/part/ModelHeadwear.java index a5f3cc479..eafd6337e 100644 --- a/src/main/java/noppes/npcs/client/model/part/ModelHeadwear.java +++ b/src/main/java/noppes/npcs/client/model/part/ModelHeadwear.java @@ -52,6 +52,51 @@ public class ModelHeadwear extends ModelScaleRenderer{ this.addChild(bottom); } + public ModelHeadwear(ModelBase base, boolean alex) { + super(base); + Model2DRenderer right = new Model2DRenderer(base, 32, 8, 8, 8, 64, 64); + right.setRotationPoint(-4.641F, .8f, 4.64f); + right.setScale(0.58f); + right.setThickness(0.65f); + setRotation(right, 0, (float)(Math.PI/2f), 0); + this.addChild(right); + + Model2DRenderer left = new Model2DRenderer(base, 48, 8, 8, 8, 64, 64); + left.setRotationPoint(4.639F, .8f, -4.64f); + left.setScale(0.58f); + left.setThickness(0.65f); + setRotation(left, 0, (float)(Math.PI/-2f), 0); + this.addChild(left); + + Model2DRenderer front = new Model2DRenderer(base, 40, 8, 8, 8, 64, 64); + front.setRotationPoint(-4.64F, .801f, -4.641f); + front.setScale(0.58f); + front.setThickness(0.65f); + setRotation(front, 0, 0, 0); + this.addChild(front); + + Model2DRenderer back = new Model2DRenderer(base, 56, 8, 8, 8, 64, 64); + back.setRotationPoint(4.64F, .801f, 4.639f); + back.setScale(0.58f); + back.setThickness(0.65f); + setRotation(back, 0, (float)(Math.PI), 0); + this.addChild(back); + + Model2DRenderer top = new Model2DRenderer(base, 40, 0, 8, 8, 64, 64); + top.setRotationPoint(-4.64F, -8.5f, -4.64f); + top.setScale(0.5799f); + top.setThickness(0.65f); + setRotation(top, (float)(Math.PI / -2), 0, 0); + this.addChild(top); + + Model2DRenderer bottom = new Model2DRenderer(base, 48, 0, 8, 8, 64, 64); + bottom.setRotationPoint(-4.64F, 0f, -4.64f); + bottom.setScale(0.5799f); + bottom.setThickness(0.65f); + setRotation(bottom, (float)(Math.PI / -2), 0, 0); + this.addChild(bottom); + } + public void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; diff --git a/src/main/java/noppes/npcs/client/renderer/ImageBufferDownloadAlt.java b/src/main/java/noppes/npcs/client/renderer/ImageBufferDownloadAlt.java index 63374eb02..893d5f38d 100644 --- a/src/main/java/noppes/npcs/client/renderer/ImageBufferDownloadAlt.java +++ b/src/main/java/noppes/npcs/client/renderer/ImageBufferDownloadAlt.java @@ -18,8 +18,8 @@ public class ImageBufferDownloadAlt extends ImageBufferDownload NPC64 = false; } - public ImageBufferDownloadAlt(boolean type){ - NPC64 = type; + public ImageBufferDownloadAlt(boolean newVersion){ + NPC64 = newVersion; } diff --git a/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java b/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java index eed473fef..23514d51c 100644 --- a/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java +++ b/src/main/java/noppes/npcs/client/renderer/RenderNPCInterface.java @@ -24,6 +24,7 @@ import noppes.npcs.client.model.ModelMPM; import noppes.npcs.constants.EnumAnimation; import noppes.npcs.constants.EnumStandingType; import noppes.npcs.entity.EntityCustomNpc; +import noppes.npcs.entity.EntityCustomNpc64; import noppes.npcs.entity.EntityNPCInterface; import org.lwjgl.opengl.GL11; @@ -306,7 +307,12 @@ public class RenderNPCInterface extends RenderLiving{ sb.append(String.format("%02x", b&0xff)); } npc.textureLocation = new ResourceLocation("skins/" + sb.toString()); - loadSkin(null, npc.textureLocation, npc.display.url); + + if(entity instanceof EntityCustomNpc64){ + loadSkin(null, npc.textureLocation, npc.display.url, true); + } + loadSkin(null, npc.textureLocation, npc.display.url, false); + LastTextureTick = 0; } catch(Exception ex){ @@ -319,9 +325,13 @@ public class RenderNPCInterface extends RenderLiving{ return npc.textureLocation; } - private void loadSkin(File file, ResourceLocation resource, String par1Str){ + // True = 64x64 Skin + private void loadSkin(File file, ResourceLocation resource, String par1Str, boolean newVersion){ TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); ITextureObject object = new ImageDownloadAlt(file, par1Str, SkinManager.field_152793_a, new ImageBufferDownloadAlt()); + if(newVersion){ + object = new ImageDownloadAlt(file, par1Str, SkinManager.field_152793_a, new ImageBufferDownloadAlt(newVersion)); + } texturemanager.loadTexture(resource, object); } diff --git a/src/main/java/noppes/npcs/entity/EntityNPC64x64.java b/src/main/java/noppes/npcs/entity/EntityCustomNpc64.java similarity index 81% rename from src/main/java/noppes/npcs/entity/EntityNPC64x64.java rename to src/main/java/noppes/npcs/entity/EntityCustomNpc64.java index 678478056..a4253a9fd 100644 --- a/src/main/java/noppes/npcs/entity/EntityNPC64x64.java +++ b/src/main/java/noppes/npcs/entity/EntityCustomNpc64.java @@ -9,9 +9,9 @@ import noppes.npcs.ModelData; import noppes.npcs.ModelPartData; import noppes.npcs.client.EntityUtil; -public class EntityNPC64x64 extends EntityCustomNpc{ +public class EntityCustomNpc64 extends EntityCustomNpc{ - public EntityNPC64x64(World world) { + public EntityCustomNpc64(World world) { super(world); display.texture = "customnpcs:textures/entity/humanmale/Steve64.png"; } diff --git a/src/main/resources/assets/customnpcs/textures/entity/humanmale/32test.png b/src/main/resources/assets/customnpcs/textures/entity/humanmale/32test.png new file mode 100644 index 000000000..955c582f0 Binary files /dev/null and b/src/main/resources/assets/customnpcs/textures/entity/humanmale/32test.png differ