1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-20 07:01:22 +01:00

Fixing bossbar exp gain announcement

This commit is contained in:
Zrips 2020-05-11 15:56:07 +03:00
parent 5c6a5dcaa3
commit 6acf9bee0a
3 changed files with 13 additions and 19 deletions

View File

@ -2,8 +2,6 @@ package com.gamingmesh.jobs.config;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.boss.BarColor;
@ -11,12 +9,12 @@ import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.container.BossBarInfo;
import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobProgression;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
public class BossBarManager {
@ -32,16 +30,9 @@ public class BossBarManager {
if (player == null)
return;
List<String> temp = new ArrayList<>();
temp.addAll(player.getUpdateBossBarFor());
for (String one : temp) {
for (JobProgression oneJob : player.getJobProgression()) {
if (one.equalsIgnoreCase(oneJob.getJob().getName())) {
if (oneJob.getLastExperience() != 0) {
ShowJobProgression(player, oneJob, oneJob.getLastExperience());
oneJob.setLastExperience(0D);
}
}
}
player.clearUpdateBossBarFor();
@ -162,6 +153,7 @@ public class BossBarManager {
}
}, Jobs.getGCManager().BossBarTimer * 20L));
jobProg.setLastExperience(0D);
}
private static BarColor getColor(Job job) {

View File

@ -20,6 +20,7 @@ package com.gamingmesh.jobs.container;
import java.util.HashMap;
import com.gamingmesh.jobs.stuff.Debug;
import com.gamingmesh.jobs.stuff.TimeManage;
public class JobProgression {

View File

@ -23,6 +23,7 @@ import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.api.JobsPaymentEvent;
import com.gamingmesh.jobs.container.CurrencyType;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.gamingmesh.jobs.stuff.Debug;
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
import com.gamingmesh.jobs.tasks.BufferedPaymentTask;
import org.bukkit.Bukkit;