Skip to content

Commit

Permalink
version 1.2
Browse files Browse the repository at this point in the history
Today we learned that cookies have power levels higher than vegeta can
understand.
  • Loading branch information
RoboMWM committed Jul 25, 2017
1 parent 2305474 commit 0244bc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>to.us.mlgfort</groupId>
<artifactId>MLGDamageIndicators</artifactId>
<version>1.1</version>
<version>1.2</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand All @@ -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);
}
}

0 comments on commit 0244bc1

Please sign in to comment.