mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Added parameters for texture translation when the NPC is powered, namely npc.display.poweredTranslateX, poweredTranslateY, and poweredTranslateZ, which can all be changed by setPoweredXYZ(x,y,z), and gotten with getPoweredX(), getPoweredY(), and getPoweredZ().
This commit is contained in:
1 parent
9560228ba8
commit
b7d2dab905
5 files changed
+50
-10
No files matched your search
@@ -37,7 +37,11 @@ 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 int visible = 0; //0:visible 1:Invisible 2:semi-invisible
|
||||
|
||||
@@ -106,6 +110,10 @@ public class DataDisplay {
|
||||
nbttagcompound.setString("PoweredTexture", poweredTexture);
|
||||
nbttagcompound.setByte("UsingSkinUrl", skinType);
|
||||
|
||||
nbttagcompound.setFloat("PoweredX",poweredTranslateX);
|
||||
nbttagcompound.setFloat("PoweredY",poweredTranslateY);
|
||||
nbttagcompound.setFloat("PoweredZ",poweredTranslateZ);
|
||||
|
||||
if (this.playerProfile != null)
|
||||
{
|
||||
NBTTagCompound nbttagcompound1 = new NBTTagCompound();
|
||||
@@ -160,6 +168,9 @@ 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");
|
||||
|
||||
modelSize = ValueUtil.CorrectInt(nbttagcompound.getInteger("Size"), 1, Integer.MAX_VALUE);
|
||||
modelType = nbttagcompound.getInteger("modelType");
|
||||
|
||||
@@ -108,14 +108,17 @@ public class RenderCustomNpc extends RenderNPCHumanMale{
|
||||
this.bindTexture(poweredNPCTexture);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
float f2 = f1 * 0.01F;
|
||||
float f3 = f1 * 0.01F;
|
||||
GL11.glTranslatef(f2, f3, 0.0F);
|
||||
|
||||
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 f4 = 0.5F;
|
||||
GL11.glColor4f(f4, f4, f4, 1.0F);
|
||||
float f5 = 0.5F;
|
||||
GL11.glColor4f(f5, f5, f5, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
return 1;
|
||||
|
||||
@@ -258,14 +258,17 @@ public class RenderNPCInterface extends RenderLiving{
|
||||
this.bindTexture(poweredNPCTexture);
|
||||
GL11.glMatrixMode(GL11.GL_TEXTURE);
|
||||
GL11.glLoadIdentity();
|
||||
float f2 = f1 * 0.01F;
|
||||
float f3 = f1 * 0.01F;
|
||||
GL11.glTranslatef(f2, f3, 0.0F);
|
||||
|
||||
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 f4 = 0.5F;
|
||||
GL11.glColor4f(f4, f4, f4, 1.0F);
|
||||
float f5 = 0.5F;
|
||||
GL11.glColor4f(f5, f5, f5, 1.0F);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
|
||||
|
||||
|
||||
@@ -1015,4 +1015,21 @@ 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;
|
||||
}
|
||||
}
|
||||
@@ -707,4 +707,10 @@ 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();
|
||||
}
|
||||
Reference in new issue
Block a user