mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-22 13:10:04 +00:00
More Changes Attempted
Attempting to figure out how to render 2 versions of one EntityCustomNpc, all attempts failed thus far.
This commit is contained in:
1 parent
e7424227e8
commit
51b8e34c02
7 files changed
+14
-10
No files matched your search
@@ -61,7 +61,6 @@ public class ModelMPM extends ModelNPCMale{
|
||||
public boolean currentlyPlayerTexture;
|
||||
|
||||
public boolean isArmor;
|
||||
|
||||
public float alpha = 1;
|
||||
|
||||
public ModelMPM(float par1) {
|
||||
|
||||
@@ -42,7 +42,13 @@ public class ImageBufferDownloadAlt extends ImageBufferDownload
|
||||
g.dispose();
|
||||
imageData = ((DataBufferInt)bufferedimage1.getRaster().getDataBuffer()).getData();
|
||||
|
||||
setAreaTransparent(imageWidth / 2, 0, imageWidth, imageHeight / 2);
|
||||
if(NPC64){
|
||||
setAreaTransparent(imageWidth / 2, 0, imageWidth, imageHeight / 4);
|
||||
}
|
||||
else{
|
||||
setAreaTransparent(imageWidth / 2, 0, imageWidth, imageHeight / 2);
|
||||
}
|
||||
|
||||
|
||||
return bufferedimage1;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ public class RenderCustomNpc extends RenderNPCHumanMale{
|
||||
// False = Steve Arms
|
||||
public RenderCustomNpc(boolean arms) {
|
||||
super(new ModelMPM(0, arms), new ModelMPM(1, arms), new ModelMPM(0.5f, arms));
|
||||
this.setNewVersion(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,16 +35,11 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
|
||||
public class RenderNPCInterface extends RenderLiving{
|
||||
public static long LastTextureTick = 0;
|
||||
private boolean newVersion = false;
|
||||
|
||||
public RenderNPCInterface(ModelBase model, float f){
|
||||
super(model, f);
|
||||
}
|
||||
|
||||
protected void setNewVersion(boolean value){
|
||||
newVersion = value;
|
||||
}
|
||||
|
||||
protected void renderName(EntityNPCInterface npc, double d, double d1, double d2) {
|
||||
if (!this.func_110813_b(npc))
|
||||
return;
|
||||
@@ -289,8 +284,9 @@ public class RenderNPCInterface extends RenderLiving{
|
||||
|
||||
@Override
|
||||
public ResourceLocation getEntityTexture(Entity entity) {
|
||||
EntityNPCInterface npc = (EntityNPCInterface) entity;
|
||||
|
||||
EntityNPCInterface npc = (EntityNPCInterface) entity;
|
||||
boolean versionModel = npc.isUpdatedVersion; // DOES NOT WORK
|
||||
if(npc.textureLocation == null){
|
||||
if(npc.display.skinType == 0)
|
||||
npc.textureLocation = new ResourceLocation(npc.display.texture);
|
||||
@@ -314,7 +310,7 @@ 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, newVersion);
|
||||
loadSkin(null, npc.textureLocation, npc.display.url, versionModel);
|
||||
LastTextureTick = 0;
|
||||
}
|
||||
catch(Exception ex){
|
||||
|
||||
@@ -14,6 +14,7 @@ public class EntityCustomNpc extends EntityNPCInterface{
|
||||
|
||||
public EntityCustomNpc(World world) {
|
||||
super(world);
|
||||
isUpdatedVersion = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,6 +14,7 @@ public class EntityCustomNpc64 extends EntityCustomNpc{
|
||||
public EntityCustomNpc64(World world) {
|
||||
super(world);
|
||||
display.texture = "customnpcs:textures/entity/humanmale/Steve64.png";
|
||||
isUpdatedVersion = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -185,6 +185,8 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
public boolean updateClient = false;
|
||||
public boolean updateAI = false;
|
||||
|
||||
public boolean isUpdatedVersion = false;
|
||||
|
||||
public EntityNPCInterface(World world) {
|
||||
super(world);
|
||||
try{
|
||||
|
||||
Reference in new issue
Block a user