1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-11-25 20:16:13 +01:00

Lets fix special signs has not updated heads

- Last commit stability fix for registering class
This commit is contained in:
montlikadani 2019-03-01 17:03:45 +01:00
parent ef7eafee08
commit 2c0451aa55
3 changed files with 33 additions and 24 deletions

View File

@ -181,11 +181,15 @@ public class Jobs extends JavaPlugin {
@Deprecated
public static McMMOManager getMcMMOlistener() {
return McMMOManager == null ? new McMMOManager() : McMMOManager;
if (McMMOManager == null)
McMMOManager = new McMMOManager();
return McMMOManager;
}
public static McMMOManager getMcMMOManager() {
return McMMOManager == null ? new McMMOManager() : McMMOManager;
if (McMMOManager == null)
McMMOManager = new McMMOManager();
return McMMOManager;
}
public void setPistonProtectionListener() {
@ -208,7 +212,9 @@ public class Jobs extends JavaPlugin {
private boolean PlaceholderAPIEnabled = false;
public Placeholder getPlaceholderAPIManager() {
return Placeholder == null ? new Placeholder(this) : Placeholder;
if (Placeholder == null)
Placeholder = new Placeholder(this);
return Placeholder;
}
private boolean setupPlaceHolderAPI() {
@ -269,11 +275,15 @@ public class Jobs extends JavaPlugin {
}
public static Reflections getReflections() {
return reflections == null ? new Reflections() : reflections;
if (reflections == null)
reflections = new Reflections();
return reflections;
}
public static JobsManager getDBManager() {
return DBManager == null ? new JobsManager(instance) : DBManager;
if (DBManager == null)
DBManager = new JobsManager(instance);
return DBManager;
}
public static void setShopManager() {
@ -305,7 +315,9 @@ public class Jobs extends JavaPlugin {
}
public static ActionBarTitleMessages getActionBar() {
return actionbar == null ? new ActionBarTitleMessages() : actionbar;
if (actionbar == null)
actionbar = new ActionBarTitleMessages();
return actionbar;
}
public static void setNms(NMS nms) {
@ -326,10 +338,6 @@ public class Jobs extends JavaPlugin {
return pManager;
}
public void setPlayerManager() {
}
public static void setRestrictedBlockManager() {
RBManager = new RestrictedBlockManager();
}
@ -419,7 +427,9 @@ public class Jobs extends JavaPlugin {
* @return the scoreboard manager
*/
public CMIScoreboardManager getCMIScoreboardManager() {
return CMIScoreboardManager == null ? new CMIScoreboardManager(this) : CMIScoreboardManager;
if (CMIScoreboardManager == null)
CMIScoreboardManager = new CMIScoreboardManager(this);
return CMIScoreboardManager;
}
protected static Jobs instance;
@ -969,7 +979,7 @@ public class Jobs extends JavaPlugin {
if (income == 0D && pointAmount == 0D)
return;
Boost boost = pManager.getFinalBonus(jPlayer, noneJob);
Boost boost = getPlayerManager().getFinalBonus(jPlayer, noneJob);
// Calculate income
@ -1071,7 +1081,7 @@ public class Jobs extends JavaPlugin {
player.giveExp(expInt);
}
}
Boost boost = pManager.getFinalBonus(jPlayer, prog.getJob(), ent, victim);
Boost boost = getPlayerManager().getFinalBonus(jPlayer, prog.getJob(), ent, victim);
// Calculate income
if (income != 0D) {
@ -1164,7 +1174,7 @@ public class Jobs extends JavaPlugin {
}
if (prog.addExperience(expAmount))
pManager.performLevelUp(jPlayer, prog.getJob(), oldLevel);
getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
}
//need to update bp
@ -1316,7 +1326,7 @@ public class Jobs extends JavaPlugin {
}
if (prog.addExperience(payment.getExp()))
pManager.performLevelUp(jPlayer, prog.getJob(), oldLevel);
getPlayerManager().performLevelUp(jPlayer, prog.getJob(), oldLevel);
}
public static void consoleMsg(String msg) {

View File

@ -214,7 +214,7 @@ public class SignUtil {
sign.setLine(3, line1);
sign.update();
if (!UpdateHead(sign, PlayerName, timelapse))
if (!UpdateHead(sign, pl.getPlayerName(), timelapse))
timelapse--;
}

View File

@ -24,7 +24,7 @@ public class browse implements Cmd {
if (Jobs.getGCManager().BrowseUseNewLook) {
List<Job> jobList = new ArrayList<>(Jobs.getJobs());
if (jobList.size() == 0) {
if (jobList.isEmpty()) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.error.nojobs"));
return true;
}
@ -33,7 +33,7 @@ public class browse implements Cmd {
Inventory inv = null;
try {
inv = Jobs.getGUIManager().CreateJobsGUI((Player) sender);
} catch (Exception e) {
} catch (Throwable e) {
((Player) sender).closeInventory();
Jobs.getGUIManager().GuiList.remove(((Player) sender).getUniqueId());
return true;
@ -53,7 +53,7 @@ public class browse implements Cmd {
try {
page = Integer.parseInt(one.substring("-p:".length()));
continue;
} catch (Exception e) {
} catch (Throwable e) {
}
}
}
@ -63,7 +63,7 @@ public class browse implements Cmd {
try {
j = Jobs.getJob(one.substring("-j:".length()));
continue;
} catch (Exception e) {
} catch (Throwable e) {
}
}
}
@ -231,12 +231,11 @@ public class browse implements Cmd {
builder.append(Jobs.getLanguage().getMessage("command.browse.output.bonus", "[amount]", (int) (job.getBonus() * 100)));
lines.add(builder.toString());
if (!job.getDescription().isEmpty()) {
if (!job.getDescription().isEmpty())
lines.add(" - " + job.getDescription().replace("/n", ""));
}
}
if (lines.size() == 0) {
if (lines.isEmpty()) {
sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.error.nojobs"));
return true;
}
@ -246,7 +245,7 @@ public class browse implements Cmd {
Inventory inv = null;
try {
inv = Jobs.getGUIManager().CreateJobsGUI((Player) sender);
} catch (Exception e) {
} catch (Throwable e) {
((Player) sender).closeInventory();
Jobs.getGUIManager().GuiList.remove(((Player) sender).getName());
return true;