mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 12:15:11 +00:00
Added RGB and alpha powered texture modifiers:
setPoweredRGBA(r,g,b,alpha) getPoweredR(),getPoweredG(),getPoweredB(),getPoweredAlpha()
This commit is contained in:
1 parent
b7d2dab905
commit
fc1c16032f
5 files changed
+56
-4
No files matched your search
@@ -43,6 +43,11 @@ public class DataDisplay {
|
||||
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
|
||||
|
||||
public int modelSize = 5;
|
||||
@@ -114,6 +119,11 @@ public class DataDisplay {
|
||||
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();
|
||||
@@ -171,6 +181,10 @@ public class DataDisplay {
|
||||
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");
|
||||
|
||||
@@ -117,8 +117,13 @@ public class RenderCustomNpc extends RenderNPCHumanMale{
|
||||
this.setRenderPassModel(this.originalModel);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float f5 = 0.5F;
|
||||
GL11.glColor4f(f5, f5, f5, 1.0F);
|
||||
|
||||
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);
|
||||
return 1;
|
||||
|
||||
@@ -267,8 +267,13 @@ public class RenderNPCInterface extends RenderLiving{
|
||||
this.setRenderPassModel(this.originalModel);
|
||||
GL11.glMatrixMode(GL11.GL_MODELVIEW);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
float f5 = 0.5F;
|
||||
GL11.glColor4f(f5, f5, f5, 1.0F);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
@@ -1032,4 +1032,25 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -713,4 +713,11 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
|
||||
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();
|
||||
}
|
||||
Reference in new issue
Block a user