mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 06:37:34 +00:00
Merge branch 'dev' of https://github.com/KAMKEEL/CustomNPC-Plus into dev
This commit is contained in:
commit
23aa11e316
5 files changed
+41
-4
No files matched your search
@@ -422,7 +422,7 @@ public class ModelMPM extends ModelNPCMale {
|
||||
Minecraft.getMinecraft().entityRenderer.disableLightmap((double) 0);
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, overlayData.getAlpha());
|
||||
glColor(overlayData.getColor(), overlayData.getAlpha());
|
||||
|
||||
GL11.glDepthMask(!npc.isInvisible());
|
||||
|
||||
@@ -522,6 +522,14 @@ public class ModelMPM extends ModelNPCMale {
|
||||
|
||||
}
|
||||
|
||||
private static void glColor(int color, float alpha) {
|
||||
float r = ((color >> 16) & 0xFF) / 255.0F;
|
||||
float g = ((color >> 8) & 0xFF) / 255.0F;
|
||||
float b = (color & 0xFF) / 255.0F;
|
||||
|
||||
GL11.glColor4f(r, g, b, alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRotationAngles(float limbSwing, float limbSwingAmount,
|
||||
float ageInTicks, float netHeadYaw, float headPitch,
|
||||
|
||||
@@ -79,7 +79,7 @@ public class RenderCNPCPlayer extends RenderPlayer {
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, overlayData.alpha);
|
||||
glColor(overlayData.getColor(), overlayData.getAlpha());
|
||||
|
||||
GL11.glDepthMask(!player.isInvisible());
|
||||
|
||||
@@ -97,6 +97,14 @@ public class RenderCNPCPlayer extends RenderPlayer {
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void glColor(int color, float alpha) {
|
||||
float r = ((color >> 16) & 0xFF) / 255.0F;
|
||||
float g = ((color >> 8) & 0xFF) / 255.0F;
|
||||
float b = (color & 0xFF) / 255.0F;
|
||||
|
||||
GL11.glColor4f(r, g, b, alpha);
|
||||
}
|
||||
|
||||
public void postRenderOverlay() {
|
||||
GL11.glPopMatrix();
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ public class RenderNPCInterface extends RenderLiving {
|
||||
Minecraft.getMinecraft().entityRenderer.disableLightmap((double) 0);
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, overlayData.getAlpha());
|
||||
glColor(overlayData.getColor(), overlayData.getAlpha());
|
||||
|
||||
GL11.glDepthMask(!npc.isInvisible());
|
||||
|
||||
@@ -521,6 +521,14 @@ public class RenderNPCInterface extends RenderLiving {
|
||||
}
|
||||
}
|
||||
|
||||
private static void glColor(int color, float alpha) {
|
||||
float r = ((color >> 16) & 0xFF) / 255.0F;
|
||||
float g = ((color >> 8) & 0xFF) / 255.0F;
|
||||
float b = (color & 0xFF) / 255.0F;
|
||||
|
||||
GL11.glColor4f(r, g, b, alpha);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float handleRotationFloat(EntityLivingBase par1EntityLiving, float par2) {
|
||||
EntityNPCInterface npc = (EntityNPCInterface) par1EntityLiving;
|
||||
|
||||
@@ -10,8 +10,10 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
|
||||
public boolean glow = true;
|
||||
public boolean blend = true;
|
||||
|
||||
public float alpha = 1.0F;
|
||||
public float size = 1.0F;
|
||||
public int color = 0xFFFFFF;
|
||||
|
||||
public float speedX = 0.0F;
|
||||
public float speedY = 0.0F;
|
||||
@@ -78,6 +80,15 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setColor(int color) {
|
||||
this.color = Math.max(0, color);
|
||||
this.updateClient();
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setTextureScale(float scaleX, float scaleY) {
|
||||
this.scaleX = scaleX;
|
||||
this.scaleY = scaleY;
|
||||
@@ -131,6 +142,7 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
this.blend = compound.getBoolean("SkinOverlayBlend");
|
||||
this.alpha = compound.getFloat("SkinOverlayAlpha");
|
||||
this.size = compound.getFloat("SkinOverlaySize");
|
||||
this.color = compound.getInteger("SkinOverlayColor");
|
||||
this.speedX = compound.getFloat("SkinOverlaySpeedX");
|
||||
this.speedY = compound.getFloat("SkinOverlaySpeedY");
|
||||
this.scaleX = compound.getFloat("SkinOverlayScaleX");
|
||||
@@ -146,6 +158,7 @@ public class SkinOverlay implements ISkinOverlay {
|
||||
compound.setBoolean("SkinOverlayBlend", this.getBlend());
|
||||
compound.setFloat("SkinOverlayAlpha", this.getAlpha());
|
||||
compound.setFloat("SkinOverlaySize", this.getSize());
|
||||
compound.setInteger("SkinOverlayColor", this.getColor());
|
||||
compound.setFloat("SkinOverlaySpeedX", this.getSpeedX());
|
||||
compound.setFloat("SkinOverlaySpeedY", this.getSpeedY());
|
||||
compound.setFloat("SkinOverlayScaleX", this.getTextureScaleX());
|
||||
|
||||
Reference in new issue
Block a user