Add support for third floor timer to Raids plugin (Challenge Mode) (#7871)

This commit is contained in:
Robert
2019-02-15 16:17:58 -06:00
committed by Tomas Slusny
parent ecfc8276b5
commit 5c546fd1d4
2 changed files with 16 additions and 3 deletions

View File

@@ -236,7 +236,7 @@ public class RaidsPlugin extends Plugin
{
if (timer != null)
{
timer.timeFloor();
timer.timeOlm();
timer.setStopped(true);
}

View File

@@ -41,6 +41,7 @@ public class RaidsTimer extends InfoBox
private LocalTime time;
private LocalTime firstFloorTime;
private LocalTime secondFloorTime;
private LocalTime thirdFloorTime;
private LocalTime olmTime;
@Setter
@@ -66,14 +67,20 @@ public class RaidsTimer extends InfoBox
{
secondFloorTime = LocalTime.ofSecondOfDay(elapsed.getSeconds());
}
else if (olmTime == null)
else if (thirdFloorTime == null)
{
olmTime = LocalTime.ofSecondOfDay(elapsed.getSeconds());
thirdFloorTime = LocalTime.ofSecondOfDay(elapsed.getSeconds());
}
floorTime = Instant.now();
}
public void timeOlm()
{
Duration elapsed = Duration.between(floorTime, Instant.now());
olmTime = LocalTime.ofSecondOfDay(elapsed.getSeconds());
}
@Override
public String getText()
{
@@ -126,6 +133,12 @@ public class RaidsTimer extends InfoBox
builder.append(secondFloorTime.format(DateTimeFormatter.ofPattern("mm:ss")));
}
if (thirdFloorTime != null)
{
builder.append("</br>Third floor: ");
builder.append(thirdFloorTime.format(DateTimeFormatter.ofPattern("mm:ss")));
}
if (olmTime != null)
{
builder.append("</br>Olm: ");