From 0244bc1038ca1398c84ae5bb60d8697d411277c8 Mon Sep 17 00:00:00 2001 From: RoboMWM Date: Mon, 24 Jul 2017 23:47:09 -0700 Subject: [PATCH] version 1.2 Today we learned that cookies have power levels higher than vegeta can understand. --- pom.xml | 2 +- .../mlgdamageindicators/MLGDamageIndicators.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 4fe528b..976e4f0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ to.us.mlgfort MLGDamageIndicators - 1.1 + 1.2 1.8 1.8 diff --git a/src/main/java/to/us/mlgfort/mlgdamageindicators/MLGDamageIndicators.java b/src/main/java/to/us/mlgfort/mlgdamageindicators/MLGDamageIndicators.java index 2a25be4..82a7630 100644 --- a/src/main/java/to/us/mlgfort/mlgdamageindicators/MLGDamageIndicators.java +++ b/src/main/java/to/us/mlgfort/mlgdamageindicators/MLGDamageIndicators.java @@ -97,6 +97,9 @@ public void displayIndicator(final Location location, final double value, final { double x = r4nd0m(-0.3D, 0.3D); double z = r4nd0m(-0.3D, 0.3D); + long duration = ((long)value / 2) + 20L; //Increase display duration by a second per 40 hearts of damage. + if (duration > 100L) duration = 100L; //Cap to 5 seconds max (cookiez r insanely op, y'uh know) + Hologram hologram = HologramsAPI.createHologram(instance, location.add(x, 2D, z)); if (isDamage) hologram.appendTextLine(color + "-" + df.format(value)); @@ -106,12 +109,12 @@ public void displayIndicator(final Location location, final double value, final new BukkitRunnable() { - int duration = 2; + int phase = 0; public void run() { - duration--; - if (duration <= 0) + phase++; + if (phase >= 2) { hologram.delete(); activeHolograms.remove(hologram); @@ -120,6 +123,6 @@ public void run() } hologram.teleport(hologram.getLocation().add(0D, 1D, 0D)); } - }.runTaskTimer(instance, 1L, ((long)value / 2) + 20L); //Increase display duration by a second per 40 hearts of damage. + }.runTaskTimer(instance, 1L, duration); } }