mirror of
https://github.com/Zrips/Jobs.git
synced 2024-11-25 20:16:13 +01:00
Should need to get actionbar message if the exp, points or money 0
The player should receive the payment message if one, such as points, money, or exp 0 is received. If the value 0 will not get any message.
This commit is contained in:
parent
ee85da3761
commit
a07cbb246d
@ -422,6 +422,10 @@ public class Jobs extends JavaPlugin {
|
||||
}
|
||||
|
||||
public static JobsCommands getCommandManager() {
|
||||
if (cManager == null) {
|
||||
cManager = new JobsCommands(getInstance());
|
||||
}
|
||||
|
||||
return cManager;
|
||||
}
|
||||
|
||||
@ -890,7 +894,7 @@ public class Jobs extends JavaPlugin {
|
||||
setBpManager();
|
||||
setActionBar();
|
||||
|
||||
getCommand("jobs").setExecutor(cManager);
|
||||
getCommand("jobs").setExecutor(getCommandManager());
|
||||
getCommand("jobs").setTabCompleter(new TabComplete());
|
||||
|
||||
startup();
|
||||
@ -1207,13 +1211,13 @@ public class Jobs extends JavaPlugin {
|
||||
continue;
|
||||
|
||||
// JobsPayment event
|
||||
JobsExpGainEvent JobsExpGainEvent = new JobsExpGainEvent(jPlayer.getPlayer(), prog.getJob(), expAmount);
|
||||
Bukkit.getServer().getPluginManager().callEvent(JobsExpGainEvent);
|
||||
// If event is canceled, don't do anything
|
||||
if (JobsExpGainEvent.isCancelled())
|
||||
expAmount = 0D;
|
||||
else
|
||||
expAmount = JobsExpGainEvent.getExp();
|
||||
JobsExpGainEvent JobsExpGainEvent = new JobsExpGainEvent(jPlayer.getPlayer(), prog.getJob(), expAmount);
|
||||
Bukkit.getServer().getPluginManager().callEvent(JobsExpGainEvent);
|
||||
// If event is canceled, don't do anything
|
||||
if (JobsExpGainEvent.isCancelled())
|
||||
expAmount = 0D;
|
||||
else
|
||||
expAmount = JobsExpGainEvent.getExp();
|
||||
|
||||
try {
|
||||
if (expAmount != 0D && GconfigManager.BossBarEnabled)
|
||||
|
@ -209,22 +209,17 @@ public class BufferedEconomy {
|
||||
}
|
||||
|
||||
public void ShowActionBar(BufferedPayment payment) {
|
||||
if (!payment.getOfflinePlayer().isOnline())
|
||||
if (payment.getOfflinePlayer() == null || !payment.getOfflinePlayer().isOnline())
|
||||
return;
|
||||
|
||||
String playername = payment.getOfflinePlayer().getName();
|
||||
if ((!ToggleBarHandling.getActionBarToggle().containsKey(playername)) && (Jobs.getGCManager().ActionBarsMessageByDefault))
|
||||
ToggleBarHandling.getActionBarToggle().put(playername, Boolean.valueOf(true));
|
||||
|
||||
if (playername == null)
|
||||
return;
|
||||
if (Jobs.getGCManager().ActionBarsMessageByDefault && !ToggleBarHandling.getActionBarToggle().containsKey(playername))
|
||||
ToggleBarHandling.getActionBarToggle().put(playername, true);
|
||||
|
||||
if (!ToggleBarHandling.getActionBarToggle().containsKey(playername))
|
||||
return;
|
||||
|
||||
if (payment.getAmount() == 0.0D && payment.getPoints() == 0.0D && payment.getExp() == 0.0D)
|
||||
return;
|
||||
|
||||
Boolean show = ToggleBarHandling.getActionBarToggle().get(playername);
|
||||
Player abp = Bukkit.getPlayer(payment.getOfflinePlayer().getUniqueId());
|
||||
if ((abp != null) && (show.booleanValue())) {
|
||||
|
Loading…
Reference in New Issue
Block a user