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

Ignore deprecated methods usage

This commit is contained in:
montlikadani 2019-10-29 15:00:16 +01:00
parent e03c0812ff
commit 9932ef47e5
10 changed files with 24 additions and 22 deletions

View File

@ -20,6 +20,7 @@ import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIFieldType;
import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIRows; import com.gamingmesh.jobs.CMIGUI.GUIManager.GUIRows;
import com.gamingmesh.jobs.CMIGUI.GUIManager.InvType; import com.gamingmesh.jobs.CMIGUI.GUIManager.InvType;
import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
import com.gamingmesh.jobs.commands.JobsCommands;
import com.gamingmesh.jobs.stuff.PageInfo; import com.gamingmesh.jobs.stuff.PageInfo;
public class CMIGui { public class CMIGui {
@ -301,7 +302,7 @@ public class CMIGui {
} }
public void addPagination(PageInfo pi, Object cmd, String pagePref) { 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) { public void addPagination(PageInfo pi, String cmd, String pagePref) {

View File

@ -392,12 +392,12 @@ public class Placeholder {
case user_totallevels: case user_totallevels:
return Integer.toString(user.getTotalLevels()); return Integer.toString(user.getTotalLevels());
case user_points: case user_points:
PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getPlayerUUID()); PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getUniqueId());
NumberFormat format = NumberFormat.getInstance(Locale.ENGLISH); NumberFormat format = NumberFormat.getInstance(Locale.ENGLISH);
return format.format(pointInfo.getCurrentPoints()); return format.format(pointInfo.getCurrentPoints());
case user_total_points: case user_total_points:
format = NumberFormat.getInstance(Locale.ENGLISH); format = NumberFormat.getInstance(Locale.ENGLISH);
pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getPlayerUUID()); pointInfo = Jobs.getPointsData().getPlayerPointsInfo(user.getUniqueId());
return format.format(pointInfo.getTotalPoints()); return format.format(pointInfo.getTotalPoints());
case user_issaved: case user_issaved:
return convert(user.isSaved()); return convert(user.isSaved());

View File

@ -42,6 +42,7 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.FireworkMeta; import org.bukkit.inventory.meta.FireworkMeta;
import com.gamingmesh.jobs.CMILib.ItemReflection; import com.gamingmesh.jobs.CMILib.ItemReflection;
import com.gamingmesh.jobs.CMILib.Reflections;
import com.gamingmesh.jobs.CMILib.VersionChecker.Version; import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
import com.gamingmesh.jobs.Signs.SignTopType; import com.gamingmesh.jobs.Signs.SignTopType;
import com.gamingmesh.jobs.api.JobsJoinEvent; import com.gamingmesh.jobs.api.JobsJoinEvent;
@ -930,7 +931,7 @@ public class PlayerManager {
if (item == null) if (item == null)
return null; return null;
Object itemName = Jobs.getReflections().getNbt(item, JobsItemBoost); Object itemName = Reflections.getNbt(item, JobsItemBoost);
if (itemName == null || itemName.toString().isEmpty()) { if (itemName == null || itemName.toString().isEmpty()) {
@ -941,7 +942,7 @@ public class PlayerManager {
if (itemName != null) { if (itemName != null) {
JobItems b = ItemBoostManager.getItemByKey(itemName.toString()); JobItems b = ItemBoostManager.getItemByKey(itemName.toString());
if (b != null) { if (b != null) {
ItemStack ic = Jobs.getReflections().setNbt(item, JobsItemBoost, b.getNode()); ItemStack ic = Reflections.setNbt(item, JobsItemBoost, b.getNode());
item.setItemMeta(ic.getItemMeta()); item.setItemMeta(ic.getItemMeta());
} }
break; break;

View File

@ -30,8 +30,8 @@ public class clearownership implements Cmd {
return true; return true;
} }
int furnace = FurnaceBrewingHandling.clearFurnaces(jPlayer.getPlayerUUID()); int furnace = FurnaceBrewingHandling.clearFurnaces(jPlayer.getUniqueId());
int brewing = FurnaceBrewingHandling.clearBrewingStands(jPlayer.getPlayerUUID()); int brewing = FurnaceBrewingHandling.clearBrewingStands(jPlayer.getUniqueId());
sender.sendMessage(Jobs.getLanguage().getMessage("command.clearownership.output.cleared", "[furnaces]", furnace, "[brewing]", brewing)); sender.sendMessage(Jobs.getLanguage().getMessage("command.clearownership.output.cleared", "[furnaces]", furnace, "[brewing]", brewing));

View File

@ -39,7 +39,7 @@ public class demote implements Cmd {
Integer levelsLost = Integer.parseInt(args[2]); Integer levelsLost = Integer.parseInt(args[2]);
Jobs.getPlayerManager().demoteJob(jPlayer, job, levelsLost); Jobs.getPlayerManager().demoteJob(jPlayer, job, levelsLost);
Player player = Bukkit.getServer().getPlayer(jPlayer.getPlayerUUID()); Player player = Bukkit.getServer().getPlayer(jPlayer.getUniqueId());
if (player != null) { if (player != null) {
String message = Jobs.getLanguage().getMessage("command.demote.output.target", String message = Jobs.getLanguage().getMessage("command.demote.output.target",
"%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE, "%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE,

View File

@ -7,6 +7,7 @@ import org.bukkit.inventory.ItemStack;
import com.gamingmesh.jobs.ItemBoostManager; import com.gamingmesh.jobs.ItemBoostManager;
import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.Reflections;
import com.gamingmesh.jobs.commands.Cmd; import com.gamingmesh.jobs.commands.Cmd;
import com.gamingmesh.jobs.commands.JobCommand; import com.gamingmesh.jobs.commands.JobCommand;
import com.gamingmesh.jobs.container.BoostMultiplier; import com.gamingmesh.jobs.container.BoostMultiplier;
@ -80,7 +81,7 @@ public class edititembonus implements Cmd {
case add: case add:
if (jobitem == null) if (jobitem == null)
return false; return false;
iih = Jobs.getReflections().setNbt(iih, "JobsItemBoost", jobitem.getNode()); iih = Reflections.setNbt(iih, "JobsItemBoost", jobitem.getNode());
Jobs.getNms().setItemInMainHand(player, iih); Jobs.getNms().setItemInMainHand(player, iih);
break; break;
case list: case list:
@ -96,7 +97,7 @@ public class edititembonus implements Cmd {
sender.sendMessage(Jobs.getLanguage().getMessage("command.bonus.output.topline")); 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) if (key == null)
return true; return true;

View File

@ -33,7 +33,7 @@ public class editpoints implements Cmd {
return true; return true;
} }
PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getPlayerUUID()); PlayerPoints pointInfo = Jobs.getPointsData().getPlayerPointsInfo(jPlayer.getUniqueId());
if (pointInfo == null) { if (pointInfo == null) {
sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", jPlayer.getUserName())); sender.sendMessage(Jobs.getLanguage().getMessage("general.error.noinfoByPlayer", "%playername%", jPlayer.getUserName()));

View File

@ -38,7 +38,7 @@ public class points implements Cmd {
return true; 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("general.info.toplineseparator", "%playername%", jPlayer.getUserName()));
sender.sendMessage(Jobs.getLanguage().getMessage("command.points.currentpoints", "%currentpoints%", (int) (pointInfo.getCurrentPoints() * 100) / 100D)); sender.sendMessage(Jobs.getLanguage().getMessage("command.points.currentpoints", "%currentpoints%", (int) (pointInfo.getCurrentPoints() * 100) / 100D));

View File

@ -30,8 +30,8 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.EnchantmentStorageMeta; import org.bukkit.inventory.meta.EnchantmentStorageMeta;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial; import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
import com.gamingmesh.jobs.CMILib.Reflections;
public class JobItems { public class JobItems {
private String node; private String node;
@ -70,7 +70,7 @@ public class JobItems {
} }
item.setItemMeta(meta); item.setItemMeta(meta);
item.setAmount(amount); item.setAmount(amount);
item = Jobs.getReflections().setNbt(item, "JobsItemBoost", node); item = Reflections.setNbt(item, "JobsItemBoost", node);
} catch (Throwable e) { } catch (Throwable e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -35,7 +35,6 @@ import com.gamingmesh.jobs.container.PlayerPoints;
import com.gamingmesh.jobs.container.TopList; import com.gamingmesh.jobs.container.TopList;
import com.gamingmesh.jobs.dao.JobsManager.DataBaseType; import com.gamingmesh.jobs.dao.JobsManager.DataBaseType;
import com.gamingmesh.jobs.economy.PaymentData; import com.gamingmesh.jobs.economy.PaymentData;
import com.gamingmesh.jobs.stuff.Debug;
import com.gamingmesh.jobs.stuff.TimeManage; import com.gamingmesh.jobs.stuff.TimeManage;
import com.gamingmesh.jobs.stuff.Util; import com.gamingmesh.jobs.stuff.Util;
@ -1431,7 +1430,7 @@ public abstract class JobsDAO {
if (job == null) if (job == null)
continue; 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) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
@ -1889,7 +1888,7 @@ public abstract class JobsDAO {
+ "`, `" + UserTableFields.seen.getCollumn() + "`, `" + UserTableFields.seen.getCollumn()
+ "`, `" + UserTableFields.donequests.getCollumn() + "`, `" + UserTableFields.donequests.getCollumn()
+ "`) VALUES (?, ?, ?, ?);"); + "`) VALUES (?, ?, ?, ?);");
prestt.setString(1, player.getPlayerUUID().toString()); prestt.setString(1, player.getUniqueId().toString());
prestt.setString(2, player.getUserName()); prestt.setString(2, player.getUserName());
prestt.setLong(3, player.getSeen()); prestt.setLong(3, player.getSeen());
prestt.setInt(4, 0); prestt.setInt(4, 0);
@ -1904,7 +1903,7 @@ public abstract class JobsDAO {
try { try {
prest = conn.prepareStatement("SELECT `id`,`" + UserTableFields.donequests.getCollumn() prest = conn.prepareStatement("SELECT `id`,`" + UserTableFields.donequests.getCollumn()
+ "` FROM `" + DBTables.UsersTable.getTableName() + "` WHERE `" + UserTableFields.player_uuid.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 = prest.executeQuery();
res.next(); res.next();
int id = res.getInt("id"); int id = res.getInt("id");
@ -1912,7 +1911,7 @@ public abstract class JobsDAO {
Jobs.getPlayerManager().addPlayerToMap(new PlayerInfo( Jobs.getPlayerManager().addPlayerToMap(new PlayerInfo(
player.getUserName(), player.getUserName(),
id, id,
player.getPlayerUUID(), player.getUniqueId(),
player.getSeen(), player.getSeen(),
res.getInt(UserTableFields.donequests.getCollumn()))); res.getInt(UserTableFields.donequests.getCollumn())));
} catch (SQLException e) { } catch (SQLException e) {
@ -1940,7 +1939,7 @@ public abstract class JobsDAO {
PreparedStatement prest = null; PreparedStatement prest = null;
try { 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() prest = conn.prepareStatement("INSERT INTO `" + DBTables.PointsTable.getTableName() + "` (`" + PointsTableFields.totalpoints.getCollumn() + "`, `" + PointsTableFields.currentpoints.getCollumn()
+ "`, `" + PointsTableFields.userid.getCollumn() + "`) VALUES (?, ?, ?);"); + "`, `" + PointsTableFields.userid.getCollumn() + "`) VALUES (?, ?, ?);");
prest.setDouble(1, pointInfo.getTotalPoints()); prest.setDouble(1, pointInfo.getTotalPoints());
@ -1967,9 +1966,9 @@ public abstract class JobsDAO {
res = prest.executeQuery(); res = prest.executeQuery();
if (res.next()) { 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 { } else {
Jobs.getPointsData().addPlayer(player.getPlayerUUID()); Jobs.getPointsData().addPlayer(player.getUniqueId());
} }
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();