mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-20 15:11:20 +01:00
Fixing bossbar exp gain announcement
This commit is contained in:
parent
5c6a5dcaa3
commit
6acf9bee0a
@ -2,8 +2,6 @@ package com.gamingmesh.jobs.config;
|
|||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.boss.BarColor;
|
import org.bukkit.boss.BarColor;
|
||||||
@ -11,12 +9,12 @@ import org.bukkit.boss.BarStyle;
|
|||||||
import org.bukkit.boss.BossBar;
|
import org.bukkit.boss.BossBar;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
|
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
|
||||||
import com.gamingmesh.jobs.container.BossBarInfo;
|
import com.gamingmesh.jobs.container.BossBarInfo;
|
||||||
import com.gamingmesh.jobs.container.Job;
|
import com.gamingmesh.jobs.container.Job;
|
||||||
import com.gamingmesh.jobs.container.JobProgression;
|
import com.gamingmesh.jobs.container.JobProgression;
|
||||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||||
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
|
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
|
||||||
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
|
|
||||||
|
|
||||||
public class BossBarManager {
|
public class BossBarManager {
|
||||||
|
|
||||||
@ -32,16 +30,9 @@ public class BossBarManager {
|
|||||||
|
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
List<String> temp = new ArrayList<>();
|
|
||||||
temp.addAll(player.getUpdateBossBarFor());
|
|
||||||
|
|
||||||
for (String one : temp) {
|
|
||||||
for (JobProgression oneJob : player.getJobProgression()) {
|
for (JobProgression oneJob : player.getJobProgression()) {
|
||||||
if (one.equalsIgnoreCase(oneJob.getJob().getName())) {
|
if (oneJob.getLastExperience() != 0) {
|
||||||
ShowJobProgression(player, oneJob, oneJob.getLastExperience());
|
ShowJobProgression(player, oneJob, oneJob.getLastExperience());
|
||||||
oneJob.setLastExperience(0D);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
player.clearUpdateBossBarFor();
|
player.clearUpdateBossBarFor();
|
||||||
@ -114,7 +105,7 @@ public class BossBarManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BarStyle style = BarStyle.SOLID;
|
BarStyle style = BarStyle.SOLID;
|
||||||
switch(Jobs.getGCManager().SegementCount) {
|
switch (Jobs.getGCManager().SegementCount) {
|
||||||
case 6:
|
case 6:
|
||||||
style = BarStyle.SEGMENTED_6;
|
style = BarStyle.SEGMENTED_6;
|
||||||
break;
|
break;
|
||||||
@ -162,6 +153,7 @@ public class BossBarManager {
|
|||||||
}
|
}
|
||||||
}, Jobs.getGCManager().BossBarTimer * 20L));
|
}, Jobs.getGCManager().BossBarTimer * 20L));
|
||||||
|
|
||||||
|
jobProg.setLastExperience(0D);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BarColor getColor(Job job) {
|
private static BarColor getColor(Job job) {
|
||||||
|
@ -20,6 +20,7 @@ package com.gamingmesh.jobs.container;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.gamingmesh.jobs.stuff.Debug;
|
||||||
import com.gamingmesh.jobs.stuff.TimeManage;
|
import com.gamingmesh.jobs.stuff.TimeManage;
|
||||||
|
|
||||||
public class JobProgression {
|
public class JobProgression {
|
||||||
|
@ -23,6 +23,7 @@ import com.gamingmesh.jobs.Jobs;
|
|||||||
import com.gamingmesh.jobs.api.JobsPaymentEvent;
|
import com.gamingmesh.jobs.api.JobsPaymentEvent;
|
||||||
import com.gamingmesh.jobs.container.CurrencyType;
|
import com.gamingmesh.jobs.container.CurrencyType;
|
||||||
import com.gamingmesh.jobs.container.JobsPlayer;
|
import com.gamingmesh.jobs.container.JobsPlayer;
|
||||||
|
import com.gamingmesh.jobs.stuff.Debug;
|
||||||
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
|
import com.gamingmesh.jobs.stuff.ToggleBarHandling;
|
||||||
import com.gamingmesh.jobs.tasks.BufferedPaymentTask;
|
import com.gamingmesh.jobs.tasks.BufferedPaymentTask;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
Loading…
Reference in New Issue
Block a user