mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-31 12:56:43 +00:00
fix again
This commit is contained in:
@@ -74,6 +74,7 @@ public class ActionBarSender {
|
||||
|
||||
public void show() {
|
||||
this.isShown = true;
|
||||
this.refreshTimer = config.refreshRate();
|
||||
senderTask = BukkitCustomFishingPlugin.getInstance().getScheduler().asyncRepeating(() -> {
|
||||
switchTimer++;
|
||||
boolean forceUpdate = false;
|
||||
@@ -82,14 +83,14 @@ public class ActionBarSender {
|
||||
counter++;
|
||||
forceUpdate = true;
|
||||
}
|
||||
if (refreshTimer < config.refreshRate() && !forceUpdate){
|
||||
refreshTimer++;
|
||||
} else {
|
||||
if (forceUpdate || refreshTimer >= config.refreshRate()) {
|
||||
refreshTimer = 0;
|
||||
DynamicText text = texts[counter % (texts.length)];
|
||||
updatePrivatePlaceholders();
|
||||
text.update(this.privateContext.placeholderMap());
|
||||
audience.sendActionBar(AdventureHelper.miniMessage(text.getLatestValue()));
|
||||
} else {
|
||||
refreshTimer++;
|
||||
}
|
||||
}, 50, 50, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public class BossBarSender {
|
||||
public void show() {
|
||||
this.isShown = true;
|
||||
this.bossBar.addViewer(audience);
|
||||
this.refreshTimer = config.refreshRate();
|
||||
this.senderTask = BukkitCustomFishingPlugin.getInstance().getScheduler().asyncRepeating(() -> {
|
||||
switchTimer++;
|
||||
boolean forceUpdate = false;
|
||||
@@ -93,16 +94,16 @@ public class BossBarSender {
|
||||
counter++;
|
||||
forceUpdate= true;
|
||||
}
|
||||
if (refreshTimer < config.refreshRate() && !forceUpdate){
|
||||
refreshTimer++;
|
||||
} else {
|
||||
if (forceUpdate || refreshTimer >= config.refreshRate()) {
|
||||
refreshTimer = 0;
|
||||
DynamicText text = texts[counter % (texts.length)];
|
||||
updatePrivatePlaceholders();
|
||||
if (forceUpdate || text.update(privateContext.placeholderMap())) {
|
||||
if (text.update(privateContext.placeholderMap()) || forceUpdate) {
|
||||
bossBar.name(AdventureHelper.miniMessage(text.getLatestValue()));
|
||||
}
|
||||
bossBar.progress(competition.getProgress());
|
||||
} else {
|
||||
refreshTimer++;
|
||||
}
|
||||
}, 50, 50, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user