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:
parent
e03c0812ff
commit
9932ef47e5
@ -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) {
|
||||
|
@ -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());
|
||||
|
@ -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;
|
||||
|
@ -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));
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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()));
|
||||
|
@ -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));
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user