1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-29 14:05:25 +01:00

We dont need separate option for scheduler enable option

This commit is contained in:
Zrips 2018-02-11 13:30:19 +02:00
parent 7c43bc94e3
commit 3af38fdaa4
5 changed files with 24 additions and 23 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>Jobs</groupId>
<artifactId>jobs</artifactId>
<version>4.3.1</version>
<version>4.4.0</version>
<name>Jobs</name>
<url>http://maven.apache.org</url>
<properties>

View File

@ -618,7 +618,6 @@ public class Jobs extends JavaPlugin {
// Schedule
Jobs.getScheduleManager().load();
if (GconfigManager.useGlobalBoostScheduler)
Jobs.getScheduleManager().start();
permissionManager = new PermissionManager();
@ -782,7 +781,6 @@ public class Jobs extends JavaPlugin {
YmlMaker jobShopItems = new YmlMaker(this, "shopItems.yml");
jobShopItems.saveDefaultConfig();
setPermissionHandler(new PermissionHandler(this));
setJobsClassloader();
setPlayerManager();
@ -842,7 +840,6 @@ public class Jobs extends JavaPlugin {
cManager.fillCommands();
} catch (Exception e) {
System.out.println("There was some issues when starting plugin. Please contact dev about this. Plugin will be disabled.");
e.printStackTrace();

View File

@ -101,7 +101,7 @@ public class GeneralConfigManager {
public boolean fixAtMaxLevel, ToggleActionBar, TitleChangeChat, TitleChangeActionBar, LevelChangeChat,
LevelChangeActionBar, SoundLevelupUse, SoundTitleChangeUse, UseServerAccount, EmptyServerAcountChat,
EmptyServerAcountActionBar, ActionBarsMessageByDefault, ShowTotalWorkers, ShowPenaltyBonus, useDynamicPayment,
useGlobalBoostScheduler, JobsGUIOpenOnBrowse, JobsGUIShowChatBrowse, JobsGUISwitcheButtons, JobsGUIOpenOnJoin;
JobsGUIOpenOnBrowse, JobsGUIShowChatBrowse, JobsGUISwitcheButtons, JobsGUIOpenOnJoin;
private int JobsGUIRows, JobsGUIBackButton,
JobsGUIStartPosition,
@ -913,8 +913,8 @@ public class GeneralConfigManager {
tmat = Material.getMaterial(c.get("JobsGUI.Filler.Material", "STAINED_GLASS_PANE"));
guiFiller = new ItemStack(tmat == null ? Material.STAINED_GLASS_PANE : tmat, 1, (byte) c.get("JobsGUI.Filler.Data", 15));
c.getW().addComment("Schedule.Boost.Enable", "Do you want to enable scheduler for global boost");
useGlobalBoostScheduler = c.get("Schedule.Boost.Enable", false);
// c.getW().addComment("Schedule.Boost.Enable", "Do you want to enable scheduler for global boost");
// useGlobalBoostScheduler = c.get("Schedule.Boost.Enable", false);
try {
c.getW().save(f);

View File

@ -20,6 +20,7 @@ import com.gamingmesh.jobs.container.CurrencyType;
import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.Schedule;
import com.gamingmesh.jobs.stuff.ChatColor;
import com.gamingmesh.jobs.stuff.Debug;
import com.gamingmesh.jobs.stuff.TimeManage;
public class ScheduleManager {
@ -32,6 +33,8 @@ public class ScheduleManager {
}
public void start() {
if (Jobs.getGCManager().BoostSchedule.isEmpty())
return;
autoTimerBukkitId = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, autoTimer, 20, 30 * 20L);
}
@ -55,7 +58,7 @@ public class ScheduleManager {
}
private boolean scheduler() {
if (Jobs.getGCManager().BoostSchedule.isEmpty() || !Jobs.getGCManager().useGlobalBoostScheduler)
if (Jobs.getGCManager().BoostSchedule.isEmpty())
return false;
DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
@ -87,7 +90,7 @@ public class ScheduleManager {
JobsScheduleStartEvent event = new JobsScheduleStartEvent(one);
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled()){
if (event.isCancelled()) {
continue;
}
if (one.isBroadcastOnStart())
@ -111,7 +114,7 @@ public class ScheduleManager {
&& ((days.contains(CurrentDayName)) || days.contains("all"))) && !one.isStoped()) {
JobsScheduleStopEvent event = new JobsScheduleStopEvent(one);
Bukkit.getPluginManager().callEvent(event);
if(event.isCancelled()){
if (event.isCancelled()) {
continue;
}
if (one.isBroadcastOnStop())
@ -232,6 +235,7 @@ public class ScheduleManager {
sched.setBoost(CurrencyType.MONEY, path.getDouble("Money", 0D));
if (path.contains("Points") && path.isDouble("Points"))
sched.setBoost(CurrencyType.POINTS, path.getDouble("Points", 0D));
Jobs.getGCManager().BoostSchedule.add(sched);
}
Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded " + Jobs.getGCManager().BoostSchedule.size() + " schedulers!");

View File

@ -1,7 +1,7 @@
name: Jobs
description: Jobs Plugin for the BukkitAPI
main: com.gamingmesh.jobs.Jobs
version: 4.3.1
version: 4.4.0
website: https://www.spigotmc.org/resources/jobs-reborn.4216/
author: phrstbrn
softdepend: [Vault, iConomy, MythicMobs, McMMO, WorldGuard, MyPet]