Give some leniency for hunger color bar for player list / name tags. Fix
armor penetration causing a showing of 0 damage for no armor targets in system damage messages.
This commit is contained in:
parent
bbc6537837
commit
575780c200
@ -2438,7 +2438,7 @@ public String healthbar(double curHP,double maxHP,int hunger) {
|
|||||||
//笆<EFBFBD>笆<EFBFBD>
|
//笆<EFBFBD>笆<EFBFBD>
|
||||||
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
||||||
String bar=" ";
|
String bar=" ";
|
||||||
if (hunger==20) {
|
if (hunger>=17) {
|
||||||
if (bits>6) {
|
if (bits>6) {
|
||||||
bar+=ChatColor.GREEN+"";
|
bar+=ChatColor.GREEN+"";
|
||||||
} else
|
} else
|
||||||
|
@ -57,7 +57,7 @@ public class PlayerBuffData {
|
|||||||
//笆<EFBFBD>笆<EFBFBD>
|
//笆<EFBFBD>笆<EFBFBD>
|
||||||
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
||||||
String bar=" ";
|
String bar=" ";
|
||||||
if (hunger==20) {
|
if (hunger>=17) {
|
||||||
if (bits>6) {
|
if (bits>6) {
|
||||||
bar+=ChatColor.GREEN+"";
|
bar+=ChatColor.GREEN+"";
|
||||||
} else
|
} else
|
||||||
|
@ -1346,7 +1346,7 @@ implements Listener
|
|||||||
//笆<EFBFBD>笆<EFBFBD>
|
//笆<EFBFBD>笆<EFBFBD>
|
||||||
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
int bits=(int)(Math.ceil(curHP/maxHP*10));
|
||||||
String bar=" ";
|
String bar=" ";
|
||||||
if (hunger==20) {
|
if (hunger>=17) {
|
||||||
if (bits>6) {
|
if (bits>6) {
|
||||||
bar+=ChatColor.GREEN+"";
|
bar+=ChatColor.GREEN+"";
|
||||||
} else
|
} else
|
||||||
@ -7887,6 +7887,10 @@ implements Listener
|
|||||||
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")>0) {
|
if (this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7")>0) {
|
||||||
e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7"))/2));
|
e.setDamage(e.getDamage()+(this.plugin.getStatBonus(6, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat7"))/2));
|
||||||
}
|
}
|
||||||
|
//Add Armor penetration from the stat point, if any.
|
||||||
|
if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)>0) {
|
||||||
|
armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4);
|
||||||
|
}
|
||||||
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && armor_pen>0) {
|
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && armor_pen>0) {
|
||||||
double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
||||||
double throughdmg=(this.plugin.DMGCALC.getDamage(new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
double throughdmg=(this.plugin.DMGCALC.getDamage(new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
||||||
@ -7911,7 +7915,8 @@ implements Listener
|
|||||||
} else {
|
} else {
|
||||||
//This means piercing would do extra damage. Just subtract throughdmg.
|
//This means piercing would do extra damage. Just subtract throughdmg.
|
||||||
if (f.getHealth()-throughdmg>0) {
|
if (f.getHealth()-throughdmg>0) {
|
||||||
f.setHealth(Warning(f,14));
|
f.setHealth(f.getHealth()-throughdmg);
|
||||||
|
armor_pen_dmg=throughdmg;
|
||||||
if (f!=null) {
|
if (f!=null) {
|
||||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
||||||
if (f.getCustomName()!=null) {
|
if (f.getCustomName()!=null) {
|
||||||
@ -7927,43 +7932,6 @@ implements Listener
|
|||||||
}
|
}
|
||||||
e.setDamage(0);
|
e.setDamage(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")>0) {
|
|
||||||
//e.setDamage(e.getDamage()+(this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5"))/4));
|
|
||||||
double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
|
||||||
double throughdmg=(this.plugin.DMGCALC.getDamage(new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
|
||||||
if (throughdmg>normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)) {
|
|
||||||
//This means some piercing can be done.
|
|
||||||
//e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4));
|
|
||||||
if (f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))>0) {
|
|
||||||
f.setHealth(Warning(f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)),15));
|
|
||||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
|
||||||
if (f.getCustomName()!=null) {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))+" damage to "+convertToItemName(f.getCustomName())+".");
|
|
||||||
} else {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))+" damage to "+convertToItemName(f.getType().getName())+".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
f.setHealth(0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//This means piercing would do extra damage. Just subtract throughdmg.
|
|
||||||
if (f.getHealth()-throughdmg>0) {
|
|
||||||
f.setHealth(Warning(f.getHealth()-throughdmg,16));
|
|
||||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
|
||||||
if (f.getCustomName()!=null) {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
|
|
||||||
} else {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getType().getName())+".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
f.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e.setDamage(0);
|
|
||||||
}
|
|
||||||
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && e.getDamage()!=0) {
|
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && e.getDamage()!=0) {
|
||||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
||||||
if (f.getCustomName()!=null) {
|
if (f.getCustomName()!=null) {
|
||||||
@ -8043,6 +8011,10 @@ implements Listener
|
|||||||
if (dmg>0) {
|
if (dmg>0) {
|
||||||
e.setDamage(e.getDamage()+dmg);
|
e.setDamage(e.getDamage()+dmg);
|
||||||
}
|
}
|
||||||
|
//Add Armor penetration from the stat point, if any.
|
||||||
|
if (this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)>0) {
|
||||||
|
armor_pen+=this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4);
|
||||||
|
}
|
||||||
if (e.getEntity() instanceof LivingEntity) {
|
if (e.getEntity() instanceof LivingEntity) {
|
||||||
LivingEntity enemy = (LivingEntity)e.getEntity();
|
LivingEntity enemy = (LivingEntity)e.getEntity();
|
||||||
if (enemy.getCustomName()!=null && (enemy.getCustomName().compareTo(ChatColor.GRAY+"Zombie Ninja")==0)) {
|
if (enemy.getCustomName()!=null && (enemy.getCustomName().compareTo(ChatColor.GRAY+"Zombie Ninja")==0)) {
|
||||||
@ -8113,43 +8085,8 @@ implements Listener
|
|||||||
} else {
|
} else {
|
||||||
//This means piercing would do extra damage. Just subtract throughdmg.
|
//This means piercing would do extra damage. Just subtract throughdmg.
|
||||||
if (f.getHealth()-throughdmg>0) {
|
if (f.getHealth()-throughdmg>0) {
|
||||||
f.setHealth(Warning(f.getHealth()-throughdmg,18));
|
f.setHealth(f.getHealth()-throughdmg);
|
||||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
armor_pen_dmg=throughdmg;
|
||||||
if (f.getCustomName()!=null) {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
|
|
||||||
} else {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getType().getName())+".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
f.setHealth(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e.setDamage(0);
|
|
||||||
}
|
|
||||||
if (f.getNoDamageTicks()<f.getMaximumNoDamageTicks()/2.0f && this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")>0) {
|
|
||||||
//e.setDamage(e.getDamage()+(this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5"))/4));
|
|
||||||
double normaldmg=(this.plugin.DMGCALC.getDamage(f.getEquipment().getHelmet(), f.getEquipment().getChestplate(), f.getEquipment().getLeggings(), f.getEquipment().getBoots(), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
|
||||||
double throughdmg=(this.plugin.DMGCALC.getDamage(new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), e.getDamage(), DamageCause.ENTITY_ATTACK, false));
|
|
||||||
if (throughdmg>normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)) {
|
|
||||||
//This means some piercing can be done.
|
|
||||||
//e.setDamage(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4));
|
|
||||||
if (f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))>0) {
|
|
||||||
f.setHealth(Warning(f.getHealth()-(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4)),19));
|
|
||||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
|
||||||
if (f.getCustomName()!=null) {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))+" damage to "+convertToItemName(f.getCustomName())+".");
|
|
||||||
} else {
|
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(normaldmg+this.plugin.getStatBonus(4, this.plugin.getAccountsConfig().getInt(p.getName()+".stats.stat5")/4))+" damage to "+convertToItemName(f.getType().getName())+".");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
f.setHealth(0);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//This means piercing would do extra damage. Just subtract throughdmg.
|
|
||||||
if (f.getHealth()-throughdmg>0) {
|
|
||||||
f.setHealth(Warning(f.getHealth()-throughdmg,20));
|
|
||||||
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
if (this.plugin.getAccountsConfig().getBoolean(p.getName()+".settings.notify4")) {
|
||||||
if (f.getCustomName()!=null) {
|
if (f.getCustomName()!=null) {
|
||||||
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
|
//p.sendMessage(ChatColor.RED+""+ChatColor.ITALIC+" Dealt "+(Math.round(throughdmg)*10)/10+" damage to "+convertToItemName(f.getCustomName())+".");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user