Revert "Fixed powered texture not showing up when changing NPC model attributes."

This reverts commit 9560228ba8.
This commit is contained in:
luisc committed 2021-12-11 08:38:38 -06:00
1 parent fc1c16032f
commit 743cdb9db7
5 files changed
+15 -147

No files matched your search

@@ -37,16 +37,7 @@ public class DataDisplay {
public String texture = "customnpcs:textures/entity/humanmale/Steve.png";
public String cloakTexture = "";
public String glowTexture = "";
public String poweredTexture = "";
public float poweredTranslateX = 0.01F;
public float poweredTranslateY = 0.01F;
public float poweredTranslateZ = 0.0F;
public float poweredRed = 1.0F;
public float poweredGreen = 1.0F;
public float poweredBlue = 1.0F;
public float poweredAlpha = 1.0F;
public int visible = 0; //0:visible 1:Invisible 2:semi-invisible
@@ -115,15 +106,6 @@ public class DataDisplay {
nbttagcompound.setString("PoweredTexture", poweredTexture);
nbttagcompound.setByte("UsingSkinUrl", skinType);
nbttagcompound.setFloat("PoweredX",poweredTranslateX);
nbttagcompound.setFloat("PoweredY",poweredTranslateY);
nbttagcompound.setFloat("PoweredZ",poweredTranslateZ);
nbttagcompound.setFloat("PoweredRed",poweredRed);
nbttagcompound.setFloat("PoweredGreen",poweredGreen);
nbttagcompound.setFloat("PoweredBlue",poweredBlue);
nbttagcompound.setFloat("PoweredAlpha",poweredAlpha);
if (this.playerProfile != null)
{
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
@@ -178,13 +160,6 @@ public class DataDisplay {
cloakTexture = nbttagcompound.getString("CloakTexture");
glowTexture = nbttagcompound.getString("GlowTexture");
poweredTexture = nbttagcompound.getString("PoweredTexture");
poweredTranslateX = nbttagcompound.getFloat("PoweredX");
poweredTranslateY = nbttagcompound.getFloat("PoweredY");
poweredTranslateZ = nbttagcompound.getFloat("PoweredZ");
poweredRed = nbttagcompound.getFloat("PoweredRed");
poweredGreen = nbttagcompound.getFloat("PoweredGreen");
poweredBlue = nbttagcompound.getFloat("PoweredBlue");
poweredAlpha = nbttagcompound.getFloat("PoweredAlpha");
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, Integer.MAX_VALUE);
modelType = nbttagcompound.getInteger("modelType");
@@ -108,22 +108,14 @@ public class RenderCustomNpc extends RenderNPCHumanMale{
this.bindTexture(poweredNPCTexture);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float f2 = f1 * npc.display.poweredTranslateX;
float f3 = f1 * npc.display.poweredTranslateY;
float f4 = f1 * npc.display.poweredTranslateZ;
GL11.glTranslatef(f2, f3, f4);
float f2 = f1 * 0.01F;
float f3 = f1 * 0.01F;
GL11.glTranslatef(f2, f3, 0.0F);
this.setRenderPassModel(this.originalModel);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_BLEND);
float f5 = npc.display.poweredRed;
float f6 = npc.display.poweredGreen;
float f7 = npc.display.poweredBlue;
float f8 = npc.display.poweredAlpha;
GL11.glColor4f(f5, f6, f7, f8);
float f4 = 0.5F;
GL11.glColor4f(f4, f4, f4, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
return 1;
@@ -231,71 +231,23 @@ public class RenderNPCInterface extends RenderLiving{
GL11.glDepthMask(true);
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPushMatrix();
GL11.glScalef(1.001f, 1.001f, 1.001f);
if(mainModel instanceof ModelMPM){
((ModelMPM)mainModel).isArmor = true;
mainModel.render(entityliving, par2, par3, par4, par5, par6, par7);
((ModelMPM)mainModel).isArmor = false;
}
else
mainModel.render(entityliving, par2, par3, par4, par5, par6, par7);
GL11.glScalef(1.001f, 1.001f, 1.001f);
if(mainModel instanceof ModelMPM){
((ModelMPM)mainModel).isArmor = true;
mainModel.render(entityliving, par2, par3, par4, par5, par6, par7);
((ModelMPM)mainModel).isArmor = false;
}
else
mainModel.render(entityliving, par2, par3, par4, par5, par6, par7);
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glDisable(GL11.GL_BLEND);
}
if (npc.hasPoweredTexture())
{
GL11.glDepthMask(!npc.isInvisible());
ResourceLocation poweredNPCTexture = new ResourceLocation(npc.display.poweredTexture);//customnpcs:textures/entity/npc_armor.png
float f1 = (float)npc.ticksExisted + par3;
this.bindTexture(poweredNPCTexture);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glLoadIdentity();
float f2 = f1 * npc.display.poweredTranslateX;
float f3 = f1 * npc.display.poweredTranslateY;
float f4 = f1 * npc.display.poweredTranslateZ;
GL11.glTranslatef(f2, f3, f4);
this.setRenderPassModel(this.originalModel);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glEnable(GL11.GL_BLEND);
float f5 = npc.display.poweredRed;
float f6 = npc.display.poweredGreen;
float f7 = npc.display.poweredBlue;
float f8 = npc.display.poweredAlpha;
GL11.glColor4f(f5, f6, f7, f8);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
GL11.glPushMatrix();
GL11.glScalef(1.001f, 1.001f, 1.001f);
if(mainModel instanceof ModelMPM){
((ModelMPM)mainModel).isArmor = true;
mainModel.render(entityliving, par2, par3, par4, par5, par6, par7);
((ModelMPM)mainModel).isArmor = false;
}
else
mainModel.render(entityliving, par2, par3, par4, par5, par6, par7);
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glColor4f(1.0F, 1.0F, 1.0F, f1);
GL11.glDepthFunc(GL11.GL_LEQUAL);
GL11.glDisable(GL11.GL_BLEND);
}
}
@Override
protected float handleRotationFloat(EntityLivingBase par1EntityLiving, float par2){
@@ -1015,42 +1015,4 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
public String getPoweredTexture() {
return npc.display.poweredTexture;
}
public void setPoweredXYZ(float x, float y, float z) {
npc.display.poweredTranslateX = x;
npc.display.poweredTranslateY = y;
npc.display.poweredTranslateZ = z;
npc.updateClient = true;
}
public float getPoweredX() {
return npc.display.poweredTranslateX;
}
public float getPoweredY() {
return npc.display.poweredTranslateY;
}
public float getPoweredZ() {
return npc.display.poweredTranslateZ;
}
public void setPoweredRGBA(float r, float g, float b, float alpha) {
npc.display.poweredRed = r;
npc.display.poweredGreen = g;
npc.display.poweredBlue = b;
npc.display.poweredAlpha = alpha;
npc.updateClient = true;
}
public float getPoweredR() {
return npc.display.poweredRed;
}
public float getPoweredG() {
return npc.display.poweredGreen;
}
public float getPoweredB() {
return npc.display.poweredBlue;
}
public float getPoweredAlpha() {
return npc.display.poweredAlpha;
}
}
@@ -707,17 +707,4 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
public void setPoweredTexture(String poweredTexture);
public String getPoweredTexture();
public void setPoweredXYZ(float x, float y, float z);
public float getPoweredX();
public float getPoweredY();
public float getPoweredZ();
public void setPoweredRGBA(float r, float g, float b, float alpha);
public float getPoweredR();
public float getPoweredG();
public float getPoweredB();
public float getPoweredAlpha();
}