mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 04:59:57 +00:00
Fix Tint Rendering when Turt Damages
This commit is contained in:
1 parent
ee06de1854
commit
50c8224eb1
4 files changed
+17
-12
No files matched your search
@@ -388,16 +388,15 @@ public class ModelLegs extends ModelScaleRenderer{
|
||||
}
|
||||
}
|
||||
TintData tintData = entity.display.tintData;
|
||||
boolean bo = entity.hurtTime <= 0 && entity.deathTime <= 0 && !base.isArmor &&
|
||||
!(tintData.isTintEnabled() && tintData.isGeneralTintEnabled());
|
||||
if(bo){
|
||||
boolean showColor = !base.isArmor && tintData.processColor(entity.hurtTime > 0 || entity.deathTime > 0);
|
||||
if(showColor){
|
||||
float red = (entity.modelData.legParts.color >> 16 & 255) / 255f;
|
||||
float green = (entity.modelData.legParts.color >> 8 & 255) / 255f;
|
||||
float blue = (entity.modelData.legParts.color & 255) / 255f;
|
||||
GL11.glColor4f(red, green, blue, base.alpha);
|
||||
}
|
||||
super.render(par1);
|
||||
if(bo){
|
||||
if(showColor){
|
||||
GL11.glColor4f(1, 1, 1, base.alpha);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -183,16 +183,15 @@ public class ModelTail extends ModelScaleRenderer {
|
||||
}
|
||||
}
|
||||
TintData tintData = entity.display.tintData;
|
||||
boolean bo = entity.hurtTime <= 0 && entity.deathTime <= 0 && !base.isArmor &&
|
||||
!(tintData.isTintEnabled() && tintData.isGeneralTintEnabled());
|
||||
if(bo){
|
||||
boolean showColor = !base.isArmor && tintData.processColor(entity.hurtTime > 0 || entity.deathTime > 0);
|
||||
if(showColor){
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red, green, blue, base.alpha);
|
||||
}
|
||||
super.render(par1);
|
||||
if(bo){
|
||||
if(showColor){
|
||||
GL11.glColor4f(1, 1, 1, base.alpha);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,16 +61,15 @@ public abstract class ModelPartInterface extends ModelRenderer {
|
||||
}
|
||||
}
|
||||
TintData tintData = entity.display.tintData;
|
||||
boolean bo = entity.hurtTime <= 0 && entity.deathTime <= 0 && !base.isArmor &&
|
||||
!(tintData.isTintEnabled() && tintData.isGeneralTintEnabled());
|
||||
if(bo){
|
||||
boolean showColor = !base.isArmor && tintData.processColor(entity.hurtTime > 0 || entity.deathTime > 0);
|
||||
if(showColor){
|
||||
float red = (color >> 16 & 255) / 255f;
|
||||
float green = (color >> 8 & 255) / 255f;
|
||||
float blue = (color & 255) / 255f;
|
||||
GL11.glColor4f(red, green, blue, base.alpha);
|
||||
}
|
||||
super.render(par1);
|
||||
if(bo){
|
||||
if(showColor){
|
||||
GL11.glColor4f(1, 1, 1, base.alpha);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,4 +80,12 @@ public class TintData {
|
||||
public void setGeneralAlpha(int generalAlpha) {
|
||||
this.generalAlpha = generalAlpha;
|
||||
}
|
||||
|
||||
public boolean processColor(boolean isHurt){
|
||||
if(isHurt){
|
||||
return (isTintEnabled() && (!isHurtTintEnabled() && !isGeneralTintEnabled()));
|
||||
} else {
|
||||
return !(isTintEnabled() && isGeneralTintEnabled());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user