diff --git a/pom.xml b/pom.xml index 988858e1..b53ff1d5 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Jobs jobs - 4.1.2 + 4.1.3 Jobs http://maven.apache.org diff --git a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java index 5851cba2..ca090867 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ExploreManager.java @@ -12,6 +12,7 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.container.ExploreChunk; import com.gamingmesh.jobs.container.ExploreRegion; import com.gamingmesh.jobs.container.ExploreRespond; +import com.gamingmesh.jobs.stuff.Debug; public class ExploreManager { @@ -43,7 +44,7 @@ public class ExploreManager { return; Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loading explorer data"); Jobs.getJobsDAO().loadExplore(); - Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded explorer data"); + Bukkit.getConsoleSender().sendMessage(ChatColor.YELLOW + "[Jobs] Loaded explorer data (" + getSize() + ")"); } public HashMap getWorlds() { @@ -92,26 +93,26 @@ public class ExploreManager { eChunk.setOldChunk(); return eChunk.addPlayer(player); } - - public void addChunk(String player, String worldName, int x, int z) { - int ChunkX = x; - int ChunkZ = z; - int RegionX = (int) Math.floor(ChunkX / 32D); - int RegionZ = (int) Math.floor(ChunkZ / 32D); - if (!worlds.containsKey(worldName)) { - ExploreChunk eChunk = new ExploreChunk(player, ChunkX, ChunkZ); - eChunk.setOldChunk(); - ExploreRegion eRegion = new ExploreRegion(RegionX, RegionZ); - eRegion.addChunk(eChunk); - worlds.put(worldName, eRegion); - } - ExploreRegion eRegion = worlds.get(worldName); - ExploreChunk eChunk = eRegion.getChunk(ChunkX + ":" + ChunkZ); - if (eChunk == null) { - eChunk = new ExploreChunk(player, ChunkX, ChunkZ); - eChunk.setOldChunk(); - eRegion.addChunk(eChunk); - } else - eChunk.setOldChunk(); - } +// +// public void addChunk(String player, String worldName, int x, int z) { +// int ChunkX = x; +// int ChunkZ = z; +// int RegionX = (int) Math.floor(ChunkX / 32D); +// int RegionZ = (int) Math.floor(ChunkZ / 32D); +// if (!worlds.containsKey(worldName)) { +// ExploreChunk eChunk = new ExploreChunk(player, ChunkX, ChunkZ); +// eChunk.setOldChunk(); +// ExploreRegion eRegion = new ExploreRegion(RegionX, RegionZ); +// eRegion.addChunk(eChunk); +// worlds.put(worldName, eRegion); +// } +// ExploreRegion eRegion = worlds.get(worldName); +// ExploreChunk eChunk = eRegion.getChunk(ChunkX + ":" + ChunkZ); +// if (eChunk == null) { +// eChunk = new ExploreChunk(player, ChunkX, ChunkZ); +// eChunk.setOldChunk(); +// eRegion.addChunk(eChunk); +// } else +// eChunk.setOldChunk(); +// } } diff --git a/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java b/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java index 9ff2ece3..8265c03d 100644 --- a/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java +++ b/src/main/java/com/gamingmesh/jobs/container/ExploreChunk.java @@ -1,7 +1,7 @@ package com.gamingmesh.jobs.container; -import java.util.ArrayList; -import java.util.List; +import java.util.HashSet; +import java.util.Set; import com.gamingmesh.jobs.Jobs; @@ -9,7 +9,7 @@ public class ExploreChunk { int x; int z; - List playerNames = new ArrayList(); + Set playerNames = new HashSet(); boolean isNewChunk = true; public ExploreChunk(String playerName, int x, int z) { @@ -45,7 +45,7 @@ public class ExploreChunk { return this.z; } - public List getPlayers() { + public Set getPlayers() { return this.playerNames; } diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index 332e6beb..b91d4d2c 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -1522,7 +1522,7 @@ public abstract class JobsDAO { prest1.setInt(6, log.getDate()); prest1.setString(7, log.getActionType()); prest1.setString(8, one.getKey()); - prest1.addBatch(); +// prest1.addBatch(); added = true; } } @@ -1548,7 +1548,7 @@ public abstract class JobsDAO { prest2.setDouble(6, one.getValue().get(CurrencyType.MONEY)); prest2.setDouble(7, one.getValue().get(CurrencyType.EXP)); prest2.setDouble(8, one.getValue().get(CurrencyType.POINTS)); - prest2.addBatch(); +// prest2.addBatch(); added = true; } } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3b0650ed..81cd9f7f 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 4.1.2 +version: 4.1.3 website: https://www.spigotmc.org/resources/jobs-reborn.4216/ author: phrstbrn softdepend: [Vault, iConomy, MythicMobs, McMMO, WorldGuard, MyPet]