Fix dps display for /dps.

This commit is contained in:
sigonasr2 2016-08-05 00:18:18 -05:00
parent 4528d33446
commit 0161c73dea
5 changed files with 14 additions and 6 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
name: TwosideKeeper name: TwosideKeeper
main: sig.plugin.TwosideKeeper.TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper
version: 3.7.3cr1 version: 3.7.3cr2
commands: commands:
money: money:
description: Tells the player the amount of money they are holding. description: Tells the player the amount of money they are holding.

View File

@ -3015,9 +3015,8 @@ public class GenericFunctions {
p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,20,0)); p.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION,20,0));
} }
@Deprecated
public static void DealExplosionDamageToEntities(Location l, double basedmg, double range) { public static void DealExplosionDamageToEntities(Location l, double basedmg, double range) {
/*List<Entity> nearbyentities = new ArrayList<Entity>(); List<Entity> nearbyentities = new ArrayList<Entity>();
nearbyentities.addAll(l.getWorld().getNearbyEntities(l, range, range, range)); nearbyentities.addAll(l.getWorld().getNearbyEntities(l, range, range, range));
for (int i=0;i<nearbyentities.size();i++) { for (int i=0;i<nearbyentities.size();i++) {
Entity ent = nearbyentities.get(i); Entity ent = nearbyentities.get(i);
@ -3038,7 +3037,7 @@ public class GenericFunctions {
dodgechance = NewCombat.CalculateDodgeChance(p); dodgechance = NewCombat.CalculateDodgeChance(p);
} }
DealDamageToMob(dmg,(LivingEntity)nearbyentities.get(i),null,null,"Explosion"); DealDamageToMob(dmg,(LivingEntity)nearbyentities.get(i),null,null,"Explosion");
}*/ }
} }
private static double CalculateBlastResistance(LivingEntity l) { private static double CalculateBlastResistance(LivingEntity l) {

View File

@ -612,7 +612,7 @@ public class NewCombat {
if (pd.damagelogging) { if (pd.damagelogging) {
DecimalFormat df = new DecimalFormat("0.0"); DecimalFormat df = new DecimalFormat("0.0");
TwosideKeeper.updateTitle(pl,ChatColor.AQUA+df.format(pd.damagedata.getLastDamageDealt())); TwosideKeeper.updateTitle(pl,pd);
} else { } else {
TwosideKeeper.updateTitle(pl,headshot,preemptive); TwosideKeeper.updateTitle(pl,headshot,preemptive);
} }

View File

@ -5986,6 +5986,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
} }
public static void updateTitle(final Player p, PlayerStructure pd) {
Bukkit.getScheduler().scheduleSyncDelayedTask(TwosideKeeper.plugin, new Runnable() {
public void run() {
DecimalFormat df = new DecimalFormat("0.0");
updateTitle(p,ChatColor.AQUA+""+df.format(pd.damagedata.getLastDamageDealt()));
}
},1);
}
public static void updateTitle(final Player p) { public static void updateTitle(final Player p) {
updateTitle(p, ""); updateTitle(p, "");
} }