1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-26 12:35:28 +01:00

Do not ignore deprecated and not used methods

For developers are needed if not updating the Jobs
This commit is contained in:
montlikadani 2020-01-21 17:30:29 +01:00
parent c343407223
commit 1e2a2473b0
4 changed files with 43 additions and 42 deletions

View File

@ -271,10 +271,13 @@ public class Jobs extends JavaPlugin {
return DBManager;
}
private void setPointsDatabase() {
pointsDatabase = new PointsData();
}
/**
* Gets the PointsData
* @deprecated Use {@link JobsPlayer#getPointsData()}
* @return {@link PointsData}
*/
@Deprecated
public static PointsData getPointsData() {
if (pointsDatabase == null)
pointsDatabase = new PointsData();
@ -857,7 +860,6 @@ public class Jobs extends JavaPlugin {
setPermissionHandler(new PermissionHandler(this));
setPluginLogger(getLogger());
setJobsClassloader();
setPointsDatabase();
setDBManager();
setLanguage();
setGUIManager();

View File

@ -15,7 +15,6 @@ import com.gamingmesh.jobs.container.CurrencyType;
import com.gamingmesh.jobs.container.Job;
import com.gamingmesh.jobs.container.JobProgression;
import com.gamingmesh.jobs.container.JobsPlayer;
import com.gamingmesh.jobs.container.PlayerPoints;
import com.gamingmesh.jobs.stuff.TimeManage;
public class Placeholder {

View File

@ -7,39 +7,39 @@ import com.gamingmesh.jobs.container.PlayerPoints;
public class PointsData {
// @Deprecated
// public void addPlayer(UUID uuid) {
// Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData();
// }
//
// @Deprecated
// public void addPlayer(UUID uuid, double points) {
// Jobs.getPlayerManager().getJobsPlayer(uuid).addPoints(points);
// }
//
// @Deprecated
// public void addPlayer(UUID uuid, double points, double total) {
// addPlayer(uuid, new PlayerPoints(points, total));
//
// Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData().setPoints(points);
// Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData().setTotalPoints(total);
// }
//
// @Deprecated
// public void addPlayer(UUID uuid, PlayerPoints points) {
// PlayerPoints pi = Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData();
// pi.setPoints(points.getCurrentPoints());
// pi.setTotalPoints(points.getTotalPoints());
// pi.setNewEntry(points.isNewEntry());
// }
//
// @Deprecated
// public void addPoints(UUID uuid, Double points) {
// Jobs.getPlayerManager().getJobsPlayer(uuid).addPoints(points);
// }
//
// @Deprecated
// public PlayerPoints getPlayerPointsInfo(UUID uuid) {
// return Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData();
// }
@Deprecated
public void addPlayer(UUID uuid) {
Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData();
}
@Deprecated
public void addPlayer(UUID uuid, double points) {
Jobs.getPlayerManager().getJobsPlayer(uuid).addPoints(points);
}
@Deprecated
public void addPlayer(UUID uuid, double points, double total) {
addPlayer(uuid, new PlayerPoints(points, total));
Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData().setPoints(points);
Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData().setTotalPoints(total);
}
@Deprecated
public void addPlayer(UUID uuid, PlayerPoints points) {
PlayerPoints pi = Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData();
pi.setPoints(points.getCurrentPoints());
pi.setTotalPoints(points.getTotalPoints());
pi.setNewEntry(points.isNewEntry());
}
@Deprecated
public void addPoints(UUID uuid, Double points) {
Jobs.getPlayerManager().getJobsPlayer(uuid).addPoints(points);
}
@Deprecated
public PlayerPoints getPlayerPointsInfo(UUID uuid) {
return Jobs.getPlayerManager().getJobsPlayer(uuid).getPointsData();
}
}

View File

@ -97,7 +97,7 @@ public class Language {
}
}
if (variables.length > 0)
if (variables != null && variables.length > 0)
for (int i = 0; i < variables.length; i++) {
if (variables.length >= i + 2)
msg = msg.replace(String.valueOf(variables[i]), String.valueOf(variables[i + 1]));
@ -164,7 +164,7 @@ public class Language {
* @return the message
*/
public String getDefaultMessage(String key) {
return enlocale.contains(key) == true ? Colors(enlocale.getString(key)) : "Can't find locale";
return enlocale.contains(key) ? Colors(enlocale.getString(key)) : "Can't find locale";
}
/**