diff --git a/pom.xml b/pom.xml
index b6afa987..15c2c5c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
4.0.0
Jobs
jobs
- 5.0.1.0
+ 5.0.1.4
Jobs
http://maven.apache.org
@@ -191,7 +191,7 @@
CMILib
latest
system
- ${basedir}/libs/CMILib1.0.2.12.jar
+ ${basedir}/libs/CMILib1.1.0.2.jar
@@ -275,14 +275,14 @@
1.8
-
-
-
-
-
-
-
-
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 2.3.1
+
+ D:\MC\Server 1.18\plugins\
+
+
diff --git a/src/main/java/com/gamingmesh/jobs/Jobs.java b/src/main/java/com/gamingmesh/jobs/Jobs.java
index 66fb3c88..f4560d6a 100644
--- a/src/main/java/com/gamingmesh/jobs/Jobs.java
+++ b/src/main/java/com/gamingmesh/jobs/Jobs.java
@@ -387,9 +387,14 @@ public final class Jobs extends JavaPlugin {
return cManager;
}
- public static ExploreManager getExplore() {
+// @Deprecated
+// public static ExploreManager getExplore() {
+// return getExploreManager();
+// }
+
+ public static ExploreManager getExploreManager() {
if (exploreManager == null)
- exploreManager = ExploreManager.getInstane();
+ exploreManager = new ExploreManager();
return exploreManager;
}
@@ -776,7 +781,7 @@ public final class Jobs extends JavaPlugin {
getServer().getScheduler().runTask(this, new HookEconomyTask(this));
dao.loadBlockProtection();
- getExplore().load();
+ getExploreManager().load();
getCommandManager().fillCommands();
getDBManager().getDB().triggerTableIdUpdate();
diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/explored.java b/src/main/java/com/gamingmesh/jobs/commands/list/explored.java
index 09452c1b..57c1222e 100644
--- a/src/main/java/com/gamingmesh/jobs/commands/list/explored.java
+++ b/src/main/java/com/gamingmesh/jobs/commands/list/explored.java
@@ -19,7 +19,7 @@ public class explored implements Cmd {
return false;
Player player = (Player) sender;
- Map exploreRegion = Jobs.getExplore().getWorlds().get(player.getWorld().getName());
+ Map exploreRegion = Jobs.getExploreManager().getWorlds().get(player.getWorld().getName());
if (exploreRegion == null) {
player.sendMessage(Jobs.getLanguage().getMessage("command.explored.error.noexplore"));
diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/resetexploreregion.java b/src/main/java/com/gamingmesh/jobs/commands/list/resetexploreregion.java
index 9d22647f..a703a83d 100644
--- a/src/main/java/com/gamingmesh/jobs/commands/list/resetexploreregion.java
+++ b/src/main/java/com/gamingmesh/jobs/commands/list/resetexploreregion.java
@@ -12,25 +12,24 @@ public class resetexploreregion implements Cmd {
@Override
public boolean perform(Jobs plugin, CommandSender sender, String[] args) {
- if (args.length != 2 || !WORLD.equals(args[0])) {
- Jobs.getCommandManager().sendUsage(sender, "resetexploreregion");
- return true;
- }
+ if (args.length != 2 || !WORLD.equals(args[0])) {
+ Jobs.getCommandManager().sendUsage(sender, "resetexploreregion");
+ return true;
+ }
- if (!Jobs.getGCManager().resetExploringData) {
- sender.sendMessage(Jobs.getLanguage().getMessage("command.resetexploreregion.output.notenabled"));
- return true;
- }
+ if (!Jobs.getGCManager().resetExploringData) {
+ sender.sendMessage(Jobs.getLanguage().getMessage("command.resetexploreregion.output.notenabled"));
+ return true;
+ }
- final String worldName = args[1];
- if(!worldName.matches(REGEX)) {
- sender.sendMessage(Jobs.getLanguage().getMessage("command.resetexploreregion.output.invalidname"));
- return true;
- }
+ final String worldName = args[1];
+ if (!worldName.matches(REGEX)) {
+ sender.sendMessage(Jobs.getLanguage().getMessage("command.resetexploreregion.output.invalidname"));
+ return true;
+ }
- ExploreManager manager = ExploreManager.getInstane();
- manager.resetRegion(worldName);
- sender.sendMessage(Jobs.getLanguage().getMessage("command.resetexploreregion.output.reseted", "%worldname%", worldName));
- return true;
+ Jobs.getExploreManager().resetRegion(worldName);
+ sender.sendMessage(Jobs.getLanguage().getMessage("command.resetexploreregion.output.reseted", "%worldname%", worldName));
+ return true;
}
}
diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java
index eb0e07bd..b58ab138 100644
--- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java
+++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java
@@ -806,8 +806,8 @@ public class ConfigManager {
return null;
}
- Jobs.getExplore().setExploreEnabled();
- Jobs.getExplore().setPlayerAmount(amount);
+ Jobs.getExploreManager().setExploreEnabled();
+ Jobs.getExploreManager().setPlayerAmount(amount);
} else if (actionType == ActionType.CRAFT) {
if (myKey.startsWith("!")) {
type = myKey.substring(1, myKey.length());
diff --git a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java
index d28f91e1..29ef4382 100644
--- a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java
+++ b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java
@@ -19,17 +19,6 @@ import com.gamingmesh.jobs.stuff.Util;
public class ExploreManager {
- private static ExploreManager instance;
- public static ExploreManager getInstane() {
- if(null == instance) {
- instance = new ExploreManager();
- }
- return instance;
- }
-
- private ExploreManager() {
- }
-
private final Map> worlds = new HashMap<>();
private boolean exploreEnabled = false;
private int playerAmount = 1;
@@ -150,18 +139,18 @@ public class ExploreManager {
}
}
- public void resetRegion(String worldname) {
- Jobs.consoleMsg("&eReseting explorer data. World: " + worldname);
+ public void resetRegion(String worldname) {
+ Jobs.consoleMsg("&eReseting explorer data. World: " + worldname);
- Map> worlds = getWorlds();
- worlds.put(worldname, new HashMap());
+ Map> worlds = getWorlds();
+ worlds.put(worldname, new HashMap());
- boolean r = Jobs.getJobsDAO().deleteExploredWorld(worldname);
- if(!r) {
- Jobs.consoleMsg("&eFailed in DAO.");
- return;
- }
-
- Jobs.consoleMsg("&eCompleted to reset explorer data.");
+ boolean r = Jobs.getJobsDAO().deleteExploredWorld(worldname);
+ if (!r) {
+ Jobs.consoleMsg("&eFailed in DAO.");
+ return;
}
+
+ Jobs.consoleMsg("&eCompleted to reset explorer data.");
+ }
}
diff --git a/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java b/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java
index a53e2070..15c55f13 100644
--- a/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java
+++ b/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java
@@ -13,12 +13,12 @@ public class ExploreChunk {
public ExploreRespond addPlayer(int playerId) {
if (isFullyExplored()) {
- return new ExploreRespond(Jobs.getExplore().getPlayerAmount() + 1, false);
+ return new ExploreRespond(Jobs.getExploreManager().getPlayerAmount() + 1, false);
}
boolean newChunkForPlayer = false;
if (!playerIds.contains(playerId)) {
- if (playerIds.size() < Jobs.getExplore().getPlayerAmount()) {
+ if (playerIds.size() < Jobs.getExploreManager().getPlayerAmount()) {
playerIds.add(playerId);
updated = true;
}
@@ -26,7 +26,7 @@ public class ExploreChunk {
newChunkForPlayer = true;
}
- if (Jobs.getGCManager().ExploreCompact && playerIds.size() >= Jobs.getExplore().getPlayerAmount()) {
+ if (Jobs.getGCManager().ExploreCompact && playerIds.size() >= Jobs.getExploreManager().getPlayerAmount()) {
playerIds = null;
}
@@ -40,7 +40,7 @@ public class ExploreChunk {
}
public int getCount() {
- return isFullyExplored() ? Jobs.getExplore().getPlayerAmount() : playerIds.size();
+ return isFullyExplored() ? Jobs.getExploreManager().getPlayerAmount() : playerIds.size();
}
public List getPlayers() {
@@ -86,7 +86,7 @@ public class ExploreChunk {
}
}
- if (Jobs.getGCManager().ExploreCompact && playerIds.size() >= Jobs.getExplore().getPlayerAmount()) {
+ if (Jobs.getGCManager().ExploreCompact && playerIds.size() >= Jobs.getExploreManager().getPlayerAmount()) {
playerIds = null;
if (!names.isEmpty())
@@ -111,6 +111,6 @@ public class ExploreChunk {
}
public boolean isFullyExplored() {
- return playerIds == null || playerIds.size() >= Jobs.getExplore().getPlayerAmount();
+ return playerIds == null || playerIds.size() >= Jobs.getExploreManager().getPlayerAmount();
}
}
diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java
index e133fe8e..596caa44 100644
--- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java
+++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java
@@ -2457,7 +2457,7 @@ public abstract class JobsDAO {
}
public void insertExplore() {
- if (!Jobs.getExplore().isExploreEnabled())
+ if (!Jobs.getExploreManager().isExploreEnabled())
return;
JobsConnection conn = getConnection();
@@ -2475,7 +2475,7 @@ public abstract class JobsDAO {
conn.setAutoCommit(false);
int i = 0;
- Map> temp = new HashMap<>(Jobs.getExplore().getWorlds());
+ Map> temp = new HashMap<>(Jobs.getExploreManager().getWorlds());
for (Entry> worlds : temp.entrySet()) {
for (Entry region : worlds.getValue().entrySet()) {
@@ -2516,7 +2516,7 @@ public abstract class JobsDAO {
}
public void updateExplore() {
- if (!Jobs.getExplore().isExploreEnabled())
+ if (!Jobs.getExploreManager().isExploreEnabled())
return;
JobsConnection conn = getConnection();
@@ -2529,7 +2529,7 @@ public abstract class JobsDAO {
int i = 0;
- Map> temp = new HashMap<>(Jobs.getExplore().getWorlds());
+ Map> temp = new HashMap<>(Jobs.getExploreManager().getWorlds());
for (Entry> worlds : temp.entrySet()) {
for (Entry region : worlds.getValue().entrySet()) {
@@ -2568,7 +2568,7 @@ public abstract class JobsDAO {
* @param jobexplore - the information getting saved
*/
public void loadExplore() {
- if (!Jobs.getExplore().isExploreEnabled())
+ if (!Jobs.getExploreManager().isExploreEnabled())
return;
JobsConnection conn = getConnection();
@@ -2587,7 +2587,7 @@ public abstract class JobsDAO {
if (jworld == null || jworld.getWorld() == null) {
missingWorlds.add(worldId);
} else {
- Jobs.getExplore().load(res);
+ Jobs.getExploreManager().load(res);
}
}
@@ -2613,42 +2613,43 @@ public abstract class JobsDAO {
}
- /**
- * Delete player-explore information
- * @param worldName - the world getting removed
- */
- public boolean deleteExploredWorld(String worldName) {
- if (!Jobs.getExplore().isExploreEnabled())
- return false;
+ /**
+ * Delete player-explore information
+ * @param worldName - the world getting removed
+ */
+ public boolean deleteExploredWorld(String worldName) {
+ if (!Jobs.getExploreManager().isExploreEnabled())
+ return false;
- JobsConnection conn = getConnection();
- if (conn == null)
- return false;
+ JobsConnection conn = getConnection();
+ if (conn == null)
+ return false;
- JobsWorld target = Util.getJobsWorld(worldName);
- if (null == target) {
- return false;
- }
-
- PreparedStatement prest = null;
- try {
- prest = conn.prepareStatement("DELETE FROM `" + DBTables.ExploreDataTable.getTableName() + "` WHERE `" + ExploreDataTableFields.worldid.getCollumn() + "` = ?;");
- prest.setInt(1, target.getId());
- prest.execute();
- } catch (Throwable e) {
- e.printStackTrace();
- return false;
- } finally {
- close(prest);
- }
- return true;
+ JobsWorld target = Util.getJobsWorld(worldName);
+ if (null == target) {
+ return false;
}
- /**
- * Save player-job information
- * @param jobInfo - the information getting saved
- * @return
- */
+ boolean res = true;
+ PreparedStatement prest = null;
+ try {
+ prest = conn.prepareStatement("DELETE FROM `" + DBTables.ExploreDataTable.getTableName() + "` WHERE `" + ExploreDataTableFields.worldid.getCollumn() + "` = ?;");
+ prest.setInt(1, target.getId());
+ prest.execute();
+ } catch (Throwable e) {
+ e.printStackTrace();
+ res = false;
+ } finally {
+ close(prest);
+ }
+ return res;
+ }
+
+ /**
+ * Save player-job information
+ * @param jobInfo - the information getting saved
+ * @return
+ */
public List getLognameList(int fromtime, int untiltime) {
JobsConnection conn = getConnection();
List nameList = new ArrayList<>();
diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java
index cb935279..5591495f 100644
--- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java
+++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java
@@ -1775,7 +1775,7 @@ public final class JobsPaymentListener implements Listener {
@EventHandler(ignoreCancelled = true)
public void onExplore(JobsChunkChangeEvent event) {
- if (!Jobs.getExplore().isExploreEnabled())
+ if (!Jobs.getExploreManager().isExploreEnabled())
return;
Player player = event.getPlayer();
@@ -1810,7 +1810,7 @@ public final class JobsPaymentListener implements Listener {
if (jPlayer == null)
return;
- ExploreRespond respond = Jobs.getExplore().chunkRespond(jPlayer.getUserId(), event.getNewChunk());
+ ExploreRespond respond = Jobs.getExploreManager().chunkRespond(jPlayer.getUserId(), event.getNewChunk());
if (!respond.isNewChunk())
return;