Skip to content

Commit 3a32e2d

Browse files
committed
Fix newbie protection issue
1 parent ae75b03 commit 3a32e2d

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

pvpmanager/src/main/java/me/chancesd/pvpmanager/tasks/NewbieTask.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ private void startBossBarDisplay() {
7676
final TimeProgressSource timeProgressSource = new TimeProgressSource() {
7777
@Override
7878
public long getGoal() {
79-
return Conf.NEWBIE_TIME.asInt();
79+
return getDuration() / 1000;
8080
}
8181

8282
@Override
8383
public double getProgress() {
84-
final long totalDuration = Conf.NEWBIE_TIME.asInt() * 1000L;
85-
final long timeLeft = getTimeleft();
86-
return (totalDuration - timeLeft) / 1000.0;
84+
return (getDuration() - getTimeleft()) / 1000.0;
8785
}
8886
};
8987

@@ -95,8 +93,7 @@ public double getProgress() {
9593
.replace("<time>", currentFormattedTime);
9694
return CombatUtils.processPlaceholders(player.getPlayer(), message);
9795
})
98-
.withTimeSource(timeProgressSource)
99-
.onFinish(this::stopBossBarDisplay);
96+
.withTimeSource(timeProgressSource);
10097

10198
countdownData = builder.build(player.getPlayer());
10299
displayManager.createCountdown(player.getPlayer(), countdownData);

0 commit comments

Comments
 (0)