diff --git a/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGui.java b/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGui.java index bee6aecc..0cd02907 100644 --- a/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGui.java +++ b/src/main/java/com/gamingmesh/jobs/CMIGUI/CMIGui.java @@ -20,6 +20,7 @@ import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIFieldType; import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIRows; import com.gamingmesh.jobs.CMIGUI.GUIManager.InvType; import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; +import com.gamingmesh.jobs.commands.JobsCommands; import com.gamingmesh.jobs.stuff.PageInfo; public class CMIGui { @@ -301,7 +302,7 @@ public class CMIGui { } public void addPagination(PageInfo pi, Object cmd, String pagePref) { - addPagination(pi, Jobs.getCommandManager().label + " " + cmd.getClass().getSimpleName(), pagePref); + addPagination(pi, JobsCommands.label + " " + cmd.getClass().getSimpleName(), pagePref); } public void addPagination(PageInfo pi, String cmd, String pagePref) { diff --git a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java index 2bfdcb51..93f4835a 100644 --- a/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java +++ b/src/main/java/com/gamingmesh/jobs/Placeholders/Placeholder.java @@ -392,12 +392,12 @@ public class Placeholder { case user_totallevels: return Integer.toString(user.getTotalLevels()); case user_points: - PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getPlayerUUID()); + PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getUniqueId()); NumberFormat format = NumberFormat.getInstance(Locale.ENGLISH); return format.format(pointInfo.getCurrentPoints()); case user_total_points: format = NumberFormat.getInstance(Locale.ENGLISH); - pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getPlayerUUID()); + pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getUniqueId()); return format.format(pointInfo.getTotalPoints()); case user_issaved: return convert(user.isSaved()); diff --git a/src/main/java/com/gamingmesh/jobs/PlayerManager.java b/src/main/java/com/gamingmesh/jobs/PlayerManager.java index 9078f471..f3ff13d5 100644 --- a/src/main/java/com/gamingmesh/jobs/PlayerManager.java +++ b/src/main/java/com/gamingmesh/jobs/PlayerManager.java @@ -42,6 +42,7 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.FireworkMeta; import com.gamingmesh.jobs.CMILib.ItemReflection; +import com.gamingmesh.jobs.CMILib.Reflections; import com.gamingmesh.jobs.CMILib.VersionChecker.Version; import com.gamingmesh.jobs.Signs.SignTopType; import com.gamingmesh.jobs.api.JobsJoinEvent; @@ -930,7 +931,7 @@ public class PlayerManager { if (item == null) return null; - Object itemName = Jobs.getReflections().getNbt(item, JobsItemBoost); + Object itemName = Reflections.getNbt(item, JobsItemBoost); if (itemName == null || itemName.toString().isEmpty()) { @@ -941,7 +942,7 @@ public class PlayerManager { if (itemName != null) { JobItems b = ItemBoostManager.getItemByKey(itemName.toString()); if (b != null) { - ItemStack ic = Jobs.getReflections().setNbt(item, JobsItemBoost, b.getNode()); + ItemStack ic = Reflections.setNbt(item, JobsItemBoost, b.getNode()); item.setItemMeta(ic.getItemMeta()); } break; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/clearownership.java b/src/main/java/com/gamingmesh/jobs/commands/list/clearownership.java index 1d8cb414..15de50e3 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/clearownership.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/clearownership.java @@ -30,8 +30,8 @@ public class clearownership implements Cmd { return true; } - int furnace = FurnaceBrewingHandling.clearFurnaces(jPlayer.getPlayerUUID()); - int brewing = FurnaceBrewingHandling.clearBrewingStands(jPlayer.getPlayerUUID()); + int furnace = FurnaceBrewingHandling.clearFurnaces(jPlayer.getUniqueId()); + int brewing = FurnaceBrewingHandling.clearBrewingStands(jPlayer.getUniqueId()); sender.sendMessage(Jobs.getLanguage().getMessage("command.clearownership.output.cleared", "[furnaces]", furnace, "[brewing]", brewing)); diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/demote.java b/src/main/java/com/gamingmesh/jobs/commands/list/demote.java index ec3d02b3..6a89b6a0 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/demote.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/demote.java @@ -39,7 +39,7 @@ public class demote implements Cmd { Integer levelsLost = Integer.parseInt(args[2]); Jobs.getPlayerManager().demoteJob(jPlayer, job, levelsLost); - Player player = Bukkit.getServer().getPlayer(jPlayer.getPlayerUUID()); + Player player = Bukkit.getServer().getPlayer(jPlayer.getUniqueId()); if (player != null) { String message = Jobs.getLanguage().getMessage("command.demote.output.target", "%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE, diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java b/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java index 1aaf1a92..45b162cb 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/edititembonus.java @@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack; import com.gamingmesh.jobs.ItemBoostManager; import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.CMILib.Reflections; import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.container.BoostMultiplier; @@ -80,7 +81,7 @@ public class edititembonus implements Cmd { case add: if (jobitem == null) return false; - iih = Jobs.getReflections().setNbt(iih, "JobsItemBoost", jobitem.getNode()); + iih = Reflections.setNbt(iih, "JobsItemBoost", jobitem.getNode()); Jobs.getNms().setItemInMainHand(player, iih); break; case list: @@ -96,7 +97,7 @@ public class edititembonus implements Cmd { sender.sendMessage(Jobs.getLanguage().getMessage("command.bonus.output.topline")); - Object key = Jobs.getReflections().getNbt(iih, "JobsItemBoost"); + Object key = Reflections.getNbt(iih, "JobsItemBoost"); if (key == null) return true; diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java b/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java index 1840bfb3..07d39468 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/editpoints.java @@ -33,7 +33,7 @@ public class editpoints implements Cmd { return true; } - PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getPlayerUUID()); + PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getUniqueId()); if (pointInfo == null) { sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", jPlayer.getUserName())); diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/points.java b/src/main/java/com/gamingmesh/jobs/commands/list/points.java index e05677e1..d01251d2 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/points.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/points.java @@ -38,7 +38,7 @@ public class points implements Cmd { return true; } - PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getPlayerUUID()); + PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getUniqueId()); sender.sendMessage(Jobs.getLanguage().getMessage("general.info.toplineseparator", "%playername%", jPlayer.getUserName())); sender.sendMessage(Jobs.getLanguage().getMessage("command.points.currentpoints", "%currentpoints%", (int) (pointInfo.getCurrentPoints() * 100) / 100D)); diff --git a/src/main/java/com/gamingmesh/jobs/container/JobItems.java b/src/main/java/com/gamingmesh/jobs/container/JobItems.java index a5db950c..1d614217 100644 --- a/src/main/java/com/gamingmesh/jobs/container/JobItems.java +++ b/src/main/java/com/gamingmesh/jobs/container/JobItems.java @@ -30,8 +30,8 @@ import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.bukkit.inventory.meta.ItemMeta; -import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; +import com.gamingmesh.jobs.CMILib.Reflections; public class JobItems { private String node; @@ -70,7 +70,7 @@ public class JobItems { } item.setItemMeta(meta); item.setAmount(amount); - item = Jobs.getReflections().setNbt(item, "JobsItemBoost", node); + item = Reflections.setNbt(item, "JobsItemBoost", node); } catch (Throwable e) { e.printStackTrace(); } diff --git a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java index f22f4584..a35e7755 100644 --- a/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/src/main/java/com/gamingmesh/jobs/dao/JobsDAO.java @@ -35,7 +35,6 @@ import com.gamingmesh.jobs.container.PlayerPoints; import com.gamingmesh.jobs.container.TopList; import com.gamingmesh.jobs.dao.JobsManager.DataBaseType; import com.gamingmesh.jobs.economy.PaymentData; -import com.gamingmesh.jobs.stuff.Debug; import com.gamingmesh.jobs.stuff.TimeManage; import com.gamingmesh.jobs.stuff.Util; @@ -1431,7 +1430,7 @@ public abstract class JobsDAO { if (job == null) continue; - list.add(new Convert(res.getInt("id"), jPlayer.getPlayerUUID(), job.getId(), res.getInt(ArchiveTableFields.level.getCollumn()), res.getInt(ArchiveTableFields.experience.getCollumn()))); + list.add(new Convert(res.getInt("id"), jPlayer.getUniqueId(), job.getId(), res.getInt(ArchiveTableFields.level.getCollumn()), res.getInt(ArchiveTableFields.experience.getCollumn()))); } } catch (SQLException e) { e.printStackTrace(); @@ -1889,7 +1888,7 @@ public abstract class JobsDAO { + "`, `" + UserTableFields.seen.getCollumn() + "`, `" + UserTableFields.donequests.getCollumn() + "`) VALUES (?, ?, ?, ?);"); - prestt.setString(1, player.getPlayerUUID().toString()); + prestt.setString(1, player.getUniqueId().toString()); prestt.setString(2, player.getUserName()); prestt.setLong(3, player.getSeen()); prestt.setInt(4, 0); @@ -1904,7 +1903,7 @@ public abstract class JobsDAO { try { prest = conn.prepareStatement("SELECT `id`,`" + UserTableFields.donequests.getCollumn() + "` FROM `" + DBTables.UsersTable.getTableName() + "` WHERE `" + UserTableFields.player_uuid.getCollumn() + "` = ?;"); - prest.setString(1, player.getPlayerUUID().toString()); + prest.setString(1, player.getUniqueId().toString()); res = prest.executeQuery(); res.next(); int id = res.getInt("id"); @@ -1912,7 +1911,7 @@ public abstract class JobsDAO { Jobs.getPlayerManager().addPlayerToMap(new PlayerInfo( player.getUserName(), id, - player.getPlayerUUID(), + player.getUniqueId(), player.getSeen(), res.getInt(UserTableFields.donequests.getCollumn()))); } catch (SQLException e) { @@ -1940,7 +1939,7 @@ public abstract class JobsDAO { PreparedStatement prest = null; try { - PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getPlayerUUID()); + PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getUniqueId()); prest = conn.prepareStatement("INSERT INTO `" + DBTables.PointsTable.getTableName() + "` (`" + PointsTableFields.totalpoints.getCollumn() + "`, `" + PointsTableFields.currentpoints.getCollumn() + "`, `" + PointsTableFields.userid.getCollumn() + "`) VALUES (?, ?, ?);"); prest.setDouble(1, pointInfo.getTotalPoints()); @@ -1967,9 +1966,9 @@ public abstract class JobsDAO { res = prest.executeQuery(); if (res.next()) { - Jobs.getPointsData().addPlayer(player.getPlayerUUID(), res.getDouble(PointsTableFields.currentpoints.getCollumn()), res.getDouble(PointsTableFields.totalpoints.getCollumn())); + Jobs.getPointsData().addPlayer(player.getUniqueId(), res.getDouble(PointsTableFields.currentpoints.getCollumn()), res.getDouble(PointsTableFields.totalpoints.getCollumn())); } else { - Jobs.getPointsData().addPlayer(player.getPlayerUUID()); + Jobs.getPointsData().addPlayer(player.getUniqueId()); } } catch (SQLException e) { e.printStackTrace();