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

It should be compiled against 1.8

This commit is contained in:
Zrips 2019-02-28 20:16:53 +02:00
parent 7d35127e6b
commit 0cada339d8
2 changed files with 15 additions and 15 deletions

View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>Jobs</groupId> <groupId>Jobs</groupId>
<artifactId>jobs</artifactId> <artifactId>jobs</artifactId>
<version>4.10.2</version> <version>4.10.3</version>
<name>Jobs</name> <name>Jobs</name>
<url>http://maven.apache.org</url> <url>http://maven.apache.org</url>
<properties> <properties>
@ -162,8 +162,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>2.4</version> <version>2.4</version>
<configuration> <configuration>
<source>1.7</source> <source>1.8</source>
<target>1.7</target> <target>1.8</target>
</configuration> </configuration>
</plugin> </plugin>
<!-- <plugin> --> <!-- <plugin> -->

View File

@ -331,11 +331,13 @@ public class Jobs extends JavaPlugin {
* @return the player manager * @return the player manager
*/ */
public static PlayerManager getPlayerManager() { public static PlayerManager getPlayerManager() {
if (pManager == null)
pManager = new PlayerManager();
return pManager; return pManager;
} }
public void setPlayerManager() { public void setPlayerManager() {
pManager = new PlayerManager();
} }
public static void setRestrictedBlockManager() { public static void setRestrictedBlockManager() {
@ -567,14 +569,14 @@ public class Jobs extends JavaPlugin {
loadAllPlayersData(); loadAllPlayersData();
// add all online players // add all online players
for (Player online : Bukkit.getServer().getOnlinePlayers()) { for (Player online : Bukkit.getServer().getOnlinePlayers()) {
pManager.playerJoin(online); getPlayerManager().playerJoin(online);
} }
} }
public static void loadAllPlayersData() { public static void loadAllPlayersData() {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
// Cloning to avoid issues // Cloning to avoid issues
HashMap<UUID, PlayerInfo> temp = new HashMap<>(pManager.getPlayersInfoUUIDMap()); HashMap<UUID, PlayerInfo> temp = new HashMap<>(getPlayerManager().getPlayersInfoUUIDMap());
HashMap<Integer, List<JobsDAOData>> playersJobs = dao.getAllJobs(); HashMap<Integer, List<JobsDAOData>> playersJobs = dao.getAllJobs();
HashMap<Integer, PlayerPoints> playersPoints = dao.getAllPoints(); HashMap<Integer, PlayerPoints> playersPoints = dao.getAllPoints();
HashMap<Integer, HashMap<String, Log>> playersLogs = dao.getAllLogs(); HashMap<Integer, HashMap<String, Log>> playersLogs = dao.getAllLogs();
@ -585,7 +587,7 @@ public class Jobs extends JavaPlugin {
Entry<UUID, PlayerInfo> one = it.next(); Entry<UUID, PlayerInfo> one = it.next();
try { try {
int id = one.getValue().getID(); int id = one.getValue().getID();
JobsPlayer jPlayer = pManager.getJobsPlayerOffline( JobsPlayer jPlayer = getPlayerManager().getJobsPlayerOffline(
one.getValue(), one.getValue(),
playersJobs.get(id), playersJobs.get(id),
playersPoints.get(id), playersPoints.get(id),
@ -594,15 +596,15 @@ public class Jobs extends JavaPlugin {
playersLimits.get(id)); playersLimits.get(id));
if (jPlayer == null) if (jPlayer == null)
continue; continue;
pManager.addPlayerToCache(jPlayer); getPlayerManager().addPlayerToCache(jPlayer);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
dao.getMap().clear(); dao.getMap().clear();
if (pManager.getPlayersCache().size() != 0) if (getPlayerManager().getPlayersCache().size() != 0)
consoleMsg("&e[Jobs] Preloaded " + pManager.getPlayersCache().size() + " players data in " + ((int) (((System.currentTimeMillis() - time) consoleMsg("&e[Jobs] Preloaded " + getPlayerManager().getPlayersCache().size() + " players data in " + ((int) (((System.currentTimeMillis() - time)
/ 1000d) * 100) / 100D)); / 1000d) * 100) / 100D));
} }
@ -635,7 +637,7 @@ public class Jobs extends JavaPlugin {
for (Job job : jobs) { for (Job job : jobs) {
usedSlots.put(job, dao.getSlotsTaken(job)); usedSlots.put(job, dao.getSlotsTaken(job));
} }
pManager.reload(); getPlayerManager().reload();
permissionHandler.registerPermissions(); permissionHandler.registerPermissions();
// set the system to auto save // set the system to auto save
@ -667,7 +669,7 @@ public class Jobs extends JavaPlugin {
if (paymentThread != null) if (paymentThread != null)
paymentThread.shutdown(); paymentThread.shutdown();
pManager.saveAll(); getPlayerManager().saveAll();
if (dao != null) { if (dao != null) {
dao.closeConnections(); dao.closeConnections();
@ -679,7 +681,7 @@ public class Jobs extends JavaPlugin {
*/ */
public static void ChangeDatabase() { public static void ChangeDatabase() {
DBManager.switchDataBase(); DBManager.switchDataBase();
pManager.reload(); getPlayerManager().reload();
} }
/** /**
@ -828,7 +830,6 @@ public class Jobs extends JavaPlugin {
setPermissionHandler(new PermissionHandler(this)); setPermissionHandler(new PermissionHandler(this));
setPluginLogger(getLogger()); setPluginLogger(getLogger());
setJobsClassloader(); setJobsClassloader();
setPlayerManager();
setLanguage(); setLanguage();
setGUIManager(); setGUIManager();
setExplore(); setExplore();
@ -853,7 +854,6 @@ public class Jobs extends JavaPlugin {
getServer().getPluginManager().registerEvents(new JobsListener(this), this); getServer().getPluginManager().registerEvents(new JobsListener(this), this);
getServer().getPluginManager().registerEvents(new JobsPaymentListener(this), this); getServer().getPluginManager().registerEvents(new JobsPaymentListener(this), this);
if (getMcMMOManager().CheckmcMMO()) if (getMcMMOManager().CheckmcMMO())
setMcMMOlistener(); setMcMMOlistener();