Add support for third floor timer to Raids plugin (Challenge Mode) (#7871)
This commit is contained in:
@@ -236,7 +236,7 @@ public class RaidsPlugin extends Plugin
|
||||
{
|
||||
if (timer != null)
|
||||
{
|
||||
timer.timeFloor();
|
||||
timer.timeOlm();
|
||||
timer.setStopped(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -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: ");
|
||||
|
||||
Reference in New Issue
Block a user