1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-02 14:29:07 +01:00

Let's removing unnecessary code

- Fixed NullPointerException if loading words
- Fix potion ids
- Plugin now disabling when found an issue if the plugin has started
- Now if the SignsEnabled boolean is false does not create a file
- Fix api event bugs #226
This commit is contained in:
montlikadani 2018-09-01 09:07:22 +02:00
parent 0172b780de
commit 1e8940124f
63 changed files with 662 additions and 617 deletions

34
pom.xml
View File

@ -16,7 +16,7 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13-R0.1-SNAPSHOT</version>
<version>1.13.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<!-- iConomy7 -->
@ -31,9 +31,9 @@
<dependency>
<groupId>de.Keyle.MyPet</groupId>
<artifactId>MyPet</artifactId>
<version>2.3.0-SNAPSHOT</version>
<version>3.0-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/libs/MyPet-2.3.0-SNAPSHOT.jar</systemPath>
<systemPath>${basedir}/libs/MyPet-3.0-SNAPSHOT.jar</systemPath>
</dependency>
<!-- McMMO -->
<dependency>
@ -60,6 +60,23 @@
</exclusion>
</exclusions>
</dependency>
<!-- Dev. Vault -->
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>Vault</artifactId>
<version>1.6.7</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
</exclusion>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- MythicMobs -->
<dependency>
<groupId>net.elseland.xikage</groupId>
@ -82,6 +99,12 @@
<artifactId>worldguard</artifactId>
<version>6.1</version>
</dependency>
<!-- WorldEdit -->
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>
<version>7.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<!-- WorldGuard -->
@ -89,6 +112,11 @@
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<!-- WorldEdit -->
<repository>
<id>sk89q-repo</id>
<url>http://maven.sk89q.com/repo/</url>
</repository>
<!-- Spigot -->
<repository>
<id>spigot-repo</id>

View File

@ -422,8 +422,8 @@ public class CMIEffectManager {
return EnumParticle;
}
public void setEnumParticle(Object enumParticle) {
EnumParticle = enumParticle;
public void setEnumParticle(Object EnumParticle) {
this.EnumParticle = EnumParticle;
}
public int[] getExtra() {

View File

@ -14,8 +14,11 @@ import org.bukkit.enchantments.Enchantment;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.PotionMeta;
import org.bukkit.potion.Potion;
import org.bukkit.potion.PotionData;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.potion.PotionType;
import com.gamingmesh.jobs.Jobs;
import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
@ -80,7 +83,7 @@ public class CMIItemStack {
}
public short getMaxDurability() {
return this.material.getMaxDurability();
return material.getMaxDurability();
}
public void setData(short data) {
@ -179,7 +182,7 @@ public class CMIItemStack {
public String getRealName() {
return this.material.getName();
return material.getName();
}
public String getBukkitName() {
@ -267,13 +270,16 @@ public class CMIItemStack {
}
if (item.getType() == Material.POTION || item.getType().name().contains("SPLASH_POTION") || item.getType().name().contains("TIPPED_ARROW")) {
PotionMeta potion = (PotionMeta) item.getItemMeta();
try {
if (potion != null && potion.getBasePotionData() != null && potion.getBasePotionData().getType() != null && potion.getBasePotionData().getType().getEffectType() != null) {
data = (short) potion.getBasePotionData().getType().getEffectType().getId();
}
} catch (NoSuchMethodError e) {
}
PotionMeta meta = (PotionMeta) item.getItemMeta();
if (item.getItemMeta() instanceof PotionMeta) {
PotionMeta potionMeta = (PotionMeta) meta;
try {
if (potionMeta != null && potionMeta.getBasePotionData() != null && potionMeta.getBasePotionData() != null && potionMeta.getBasePotionData().getType().getEffectType() != null) {
data = (short) potionMeta.getBasePotionData().getType().getEffectType().getId();
}
} catch (NoSuchMethodError e) {
}
}
}
}
return this;

View File

@ -1132,8 +1132,8 @@ public class ItemManager {
NAME_TAG(421, 0, 30731, "Name Tag", ""),
NAUTILUS_SHELL(-1, -1, 19989, "Nautilus Shell", ""),
NETHERRACK(87, 0, 23425, "Netherrack", "NETHERRACK"),
NETHER_BRICK(405, 0, 19996, "Nether Brick"),
NETHER_BRICKS(112, 0, 27802, "Nether Bricks"),
NETHER_BRICK(405, 0, 19996, "Nether Brick", ""),
NETHER_BRICKS(112, 0, 27802, "Nether Bricks", ""),
NETHER_BRICK_FENCE(113, 0, 5286, "Nether Brick Fence", "NETHER_FENCE"),
NETHER_BRICK_SLAB(44, 6, 26586, "Nether Brick Slab", ""),
NETHER_BRICK_STAIRS(114, 0, 12085, "Nether Brick Stairs", "NETHER_BRICK_STAIRS"),
@ -1556,7 +1556,7 @@ public class ItemManager {
}
public int getLegacyId() {
return this.legacyId;
return legacyId;
}
public int getId() {

View File

@ -7,17 +7,17 @@ import com.gamingmesh.jobs.container.Job;
public class GuiInfoList {
String name;
List<Job> jobList = new ArrayList<>();
Boolean jobInfo = false;
int backButton = 27;
private String name;
private List<Job> jobList = new ArrayList<>();
private Boolean jobInfo = false;
private int backButton = 27;
public GuiInfoList(String name) {
this.name = name;
}
public int getbackButton() {
return this.backButton;
return backButton;
}
public void setbackButton(int backButton) {
@ -25,11 +25,11 @@ public class GuiInfoList {
}
public String getName() {
return this.name;
return name;
}
public List<Job> getJobList() {
return this.jobList;
return jobList;
}
public void setJobList(List<Job> jobList) {
@ -41,6 +41,6 @@ public class GuiInfoList {
}
public Boolean isJobInfo() {
return this.jobInfo;
return jobInfo;
}
}

View File

@ -27,7 +27,10 @@ public class GuiManager {
public HashMap<UUID, GuiInfoList> GuiList = new HashMap<>();
public void CloseInventories() {
public GuiManager() {
}
public void CloseInventories() {
for (Entry<UUID, GuiInfoList> one : GuiList.entrySet()) {
Player player = Bukkit.getPlayer(one.getKey());
if (player != null) {

View File

@ -119,9 +119,9 @@ public class Jobs extends JavaPlugin {
private static TitleManager titleManager = null;
private static RestrictedBlockManager RBManager = null;
private static RestrictedAreaManager RAManager = null;
private static BossBarManager BBManager;
private static ShopManager shopManager;
private static Loging loging;
private static BossBarManager BBManager = null;
private static ShopManager shopManager = null;
private static Loging loging = null;
private static BlockProtectionManager BpManager = null;
private static JobsManager DBManager = null;
@ -129,18 +129,18 @@ public class Jobs extends JavaPlugin {
private static PistonProtectionListener PistonProtectionListener = null;
private static McMMOlistener McMMOlistener = null;
private static MythicMobInterface MythicManager;
private static MyPetManager myPetManager;
private static WorldGuardManager worldGuardManager;
private static MythicMobInterface MythicManager = null;
private static MyPetManager myPetManager = null;
private static WorldGuardManager worldGuardManager = null;
private static ConfigManager configManager;
private static GeneralConfigManager GconfigManager;
private static ConfigManager configManager = null;
private static GeneralConfigManager GconfigManager = null;
private static Reflections reflections;
private static Reflections reflections = null;
private static Logger pLogger;
private static File dataFolder;
private static JobsClassLoader classLoader;
private static Logger pLogger = null;
private static File dataFolder = null;
private static JobsClassLoader classLoader = null;
private static JobsDAO dao = null;
private static List<Job> jobs = null;
private static Job noneJob = null;
@ -159,14 +159,14 @@ public class Jobs extends JavaPlugin {
public static HashMap<String, FastPayment> FastPayment = new HashMap<>();
private static NMS nms;
private static NMS nms = null;
private static ActionBar actionbar;
private static ActionBar actionbar = null;
private static boolean running = false;
protected static VersionChecker versionCheckManager;
protected static VersionChecker versionCheckManager = null;
protected static SelectionManager smanager;
protected static SelectionManager smanager = null;
public void setMcMMOlistener() {
McMMOlistener = new McMMOlistener(this);
@ -177,7 +177,7 @@ public class Jobs extends JavaPlugin {
}
public void setPistonProtectionListener() {
PistonProtectionListener = new PistonProtectionListener(this);
PistonProtectionListener = new PistonProtectionListener();
}
public static PistonProtectionListener getPistonProtectionListener() {
@ -285,8 +285,8 @@ public class Jobs extends JavaPlugin {
return actionbar;
}
public static void setNms(NMS newNms) {
nms = newNms;
public static void setNms(NMS nms) {
Jobs.nms = nms;
}
public static NMS getNms() {
@ -302,7 +302,7 @@ public class Jobs extends JavaPlugin {
}
public void setPlayerManager() {
pManager = new PlayerManager(this);
pManager = new PlayerManager();
}
public static void setRestrictedBlockManager(Jobs plugin) {
@ -440,8 +440,8 @@ public class Jobs extends JavaPlugin {
/**
* Sets the plugin logger
*/
public void setPluginLogger(Logger logger) {
pLogger = logger;
public void setPluginLogger(Logger pLogger) {
Jobs.pLogger = pLogger;
}
/**
@ -456,8 +456,8 @@ public class Jobs extends JavaPlugin {
* Sets the data folder
* @param dir - the data folder
*/
public void setDataFolder(File dir) {
dataFolder = dir;
public void setDataFolder(File dataFolder) {
Jobs.dataFolder = dataFolder;
}
/**
@ -472,8 +472,8 @@ public class Jobs extends JavaPlugin {
* Sets the Data Access Object
* @param dao - the DAO
*/
public static void setDAO(JobsDAO value) {
dao = value;
public static void setDAO(JobsDAO dao) {
Jobs.dao = dao;
}
/**
@ -488,8 +488,8 @@ public class Jobs extends JavaPlugin {
* Sets the list of jobs
* @param jobs - list of jobs
*/
public static void setJobs(List<Job> list) {
jobs = list;
public static void setJobs(List<Job> jobs) {
Jobs.jobs = jobs;
}
/**
@ -504,8 +504,8 @@ public class Jobs extends JavaPlugin {
* Sets the none job
* @param noneJob - the none job
*/
public static void setNoneJob(Job job) {
noneJob = job;
public static void setNoneJob(Job noneJob) {
Jobs.noneJob = noneJob;
}
/**
@ -577,8 +577,9 @@ public class Jobs extends JavaPlugin {
}
dao.getMap().clear();
consoleMsg(ChatColor.YELLOW + "[Jobs] Preloaded " + Jobs.getPlayerManager().getPlayersCache().size() + " players data in " + ((int) (((System.currentTimeMillis() - time)
/ 1000d) * 100) / 100D));
if (Jobs.getPlayerManager().getPlayersCache().size() != 0)
consoleMsg("&e[Jobs] Preloaded " + Jobs.getPlayerManager().getPlayersCache().size() + " players data in " + ((int) (((System.currentTimeMillis() - time)
/ 1000d) * 100) / 100D));
}
/**
@ -766,11 +767,13 @@ public class Jobs extends JavaPlugin {
setNms((NMS) nmsClass.getConstructor().newInstance());
} else {
System.out.println("Something went wrong, please note down version and contact author v:" + version);
running = false;
this.setEnabled(false);
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
| SecurityException e) {
System.out.println("Your server version is not compatible with this plugins version! Plugin will be disabled: " + version);
running = false;
this.setEnabled(false);
e.printStackTrace();
return;
@ -783,7 +786,7 @@ public class Jobs extends JavaPlugin {
jobConfig.saveDefaultConfig();
YmlMaker jobSigns = new YmlMaker(this, "Signs.yml");
jobSigns.saveDefaultConfig();
jobSigns.saveDefaultConfig();
YmlMaker jobSchedule = new YmlMaker(this, "schedule.yml");
jobSchedule.saveDefaultConfig();
@ -816,22 +819,19 @@ public class Jobs extends JavaPlugin {
getServer().getPluginManager().registerEvents(new JobsPaymentListener(this), this);
setMcMMOlistener();
if (McMMOlistener.CheckmcMMO()) {
getServer().getPluginManager().registerEvents(McMMOlistener, this);
}
if (McMMOlistener.CheckmcMMO())
getServer().getPluginManager().registerEvents(McMMOlistener, this);
setMyPetManager();
setWorldGuard();
setMythicManager();
if (MythicManager != null && MythicManager.Check() && GconfigManager.MythicMobsEnabled) {
MythicManager.registerListener();
}
if (MythicManager != null && MythicManager.Check() && GconfigManager.MythicMobsEnabled)
MythicManager.registerListener();
setPistonProtectionListener();
if (GconfigManager.useBlockProtection) {
getServer().getPluginManager().registerEvents(PistonProtectionListener, this);
}
if (GconfigManager.useBlockProtection)
getServer().getPluginManager().registerEvents(PistonProtectionListener, this);
// register economy
Bukkit.getScheduler().runTask(this, new HookEconomyTask(this));
@ -849,14 +849,16 @@ public class Jobs extends JavaPlugin {
cManager.fillCommands();
} catch (Exception e) {
e.printStackTrace();
System.out.println("There was some issues when starting plugin. Please contact dev about this. Plugin will be disabled.");
e.printStackTrace();
getServer().getPluginManager().disablePlugin(this);
running = false;
this.setEnabled(false);
}
}
@Override
public void onDisable() {
running = false;
GUIManager.CloseInventories();
shopManager.CloseInventories();
dao.saveExplore();
@ -866,6 +868,7 @@ public class Jobs extends JavaPlugin {
Jobs.shutdown();
consoleMsg("&e[Jobs] &2Plugin has been disabled succesfully.");
running = false;
this.setEnabled(false);
}
@ -879,9 +882,8 @@ public class Jobs extends JavaPlugin {
if (!job.getQuests().isEmpty()) {
List<QuestProgression> q = jPlayer.getQuestProgressions(job, info.getType());
for (QuestProgression one : q) {
if (one != null) {
if (one != null)
one.processQuest(jPlayer, info);
}
}
}
}
@ -948,9 +950,8 @@ public class Jobs extends JavaPlugin {
income = income + (income * boost.getFinal(CurrencyType.MONEY));
if (GconfigManager.useMinimumOveralPayment && income > 0) {
double maxLimit = income * GconfigManager.MinimumOveralPaymentLimit;
if (income < maxLimit) {
income = maxLimit;
}
if (income < maxLimit)
income = maxLimit;
}
}
@ -960,9 +961,8 @@ public class Jobs extends JavaPlugin {
pointAmount = pointAmount + (pointAmount * boost.getFinal(CurrencyType.POINTS));
if (GconfigManager.useMinimumOveralPoints && pointAmount > 0) {
double maxLimit = pointAmount * GconfigManager.MinimumOveralPaymentLimit;
if (pointAmount < maxLimit) {
pointAmount = maxLimit;
}
if (pointAmount < maxLimit)
pointAmount = maxLimit;
}
}
@ -1025,11 +1025,10 @@ public class Jobs extends JavaPlugin {
int expInt = expAmount.intValue();
double remainder = expAmount.doubleValue() - expInt;
if (Math.abs(remainder) > Math.random()) {
if (expAmount.doubleValue() < 0) {
if (expAmount.doubleValue() < 0)
expInt--;
} else {
else
expInt++;
}
}
if (expInt < 0 && getPlayerExperience(player) < -expInt) {
@ -1047,9 +1046,8 @@ public class Jobs extends JavaPlugin {
income = boost.getFinalAmount(CurrencyType.MONEY, income);
if (GconfigManager.useMinimumOveralPayment && income > 0) {
double maxLimit = income * GconfigManager.MinimumOveralPaymentLimit;
if (income < maxLimit) {
if (income < maxLimit)
income = maxLimit;
}
}
}
@ -1058,9 +1056,8 @@ public class Jobs extends JavaPlugin {
pointAmount = boost.getFinalAmount(CurrencyType.POINTS, pointAmount);
if (GconfigManager.useMinimumOveralPoints && pointAmount > 0) {
double maxLimit = pointAmount * GconfigManager.MinimumOveralPaymentLimit;
if (pointAmount < maxLimit) {
if (pointAmount < maxLimit)
pointAmount = maxLimit;
}
}
}
@ -1069,9 +1066,8 @@ public class Jobs extends JavaPlugin {
if (GconfigManager.useMinimumOveralPayment && expAmount > 0) {
double maxLimit = expAmount * GconfigManager.MinimumOveralPaymentLimit;
if (expAmount < maxLimit) {
expAmount = maxLimit;
}
if (expAmount < maxLimit)
expAmount = maxLimit;
}
if (!jPlayer.isUnderLimit(CurrencyType.MONEY, income)) {
@ -1103,10 +1099,10 @@ public class Jobs extends JavaPlugin {
try {
if (expAmount != 0D && GconfigManager.BossBarEnabled)
if (GconfigManager.BossBarShowOnEachAction) {
Jobs.getBBManager().ShowJobProgression(jPlayer, prog);
} else
jPlayer.getUpdateBossBarFor().add(prog.getJob().getName());
if (GconfigManager.BossBarShowOnEachAction)
Jobs.getBBManager().ShowJobProgression(jPlayer, prog);
else
jPlayer.getUpdateBossBarFor().add(prog.getJob().getName());
} catch (Exception e) {
Bukkit.getConsoleSender().sendMessage("[Jobs] Some issues with boss bar feature accured, try disabling it to avoid it.");
}
@ -1210,9 +1206,8 @@ public class Jobs extends JavaPlugin {
return false;
} else
getBpManager().add(block, cd);
} else {
getBpManager().add(block, getBpManager().getBlockDelayTime(block));
}
} else
getBpManager().add(block, getBpManager().getBlockDelayTime(block));
}
return true;
@ -1226,41 +1221,37 @@ public class Jobs extends JavaPlugin {
// total xp calculation based by lvl
private static int ExpToLevel(int level) {
if (version.equals("1_7")) {
if (level <= 16) {
if (level <= 16)
return 17 * level;
} else if (level <= 31) {
else if (level <= 31)
return ((3 * level * level) / 2) - ((59 * level) / 2) + 360;
} else {
else
return ((7 * level * level) / 2) - ((303 * level) / 2) + 2220;
}
}
if (level <= 16) {
if (level <= 16)
return (level * level) + (6 * level);
} else if (level <= 31) {
return (int) ((2.5 * level * level) - (40.5 * level) + 360);
} else {
return (int) ((4.5 * level * level) - (162.5 * level) + 2220);
}
else if (level <= 31)
return (int) ((2.5 * level * level) - (40.5 * level) + 360);
else
return (int) ((4.5 * level * level) - (162.5 * level) + 2220);
}
// xp calculation for one current lvl
private static int deltaLevelToExp(int level) {
if (version.equals("1_7")) {
if (level <= 16) {
if (level <= 16)
return 17;
} else if (level <= 31) {
else if (level <= 31)
return 3 * level - 31;
} else {
else
return 7 * level - 155;
}
}
if (level <= 16) {
if (level <= 16)
return 2 * level + 7;
} else if (level <= 31) {
else if (level <= 31)
return 5 * level - 38;
} else {
else
return 9 * level - 158;
}
}
public static void perform(JobsPlayer jPlayer, ActionInfo info, BufferedPayment payment, Job job) {
@ -1321,9 +1312,9 @@ public class Jobs extends JavaPlugin {
}
public static void sendMessage(Object sender, String msg) {
if (sender instanceof Player) {
if (sender instanceof Player)
((Player) sender).sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
} else
else
((CommandSender) sender).sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
}

View File

@ -32,7 +32,7 @@ import com.gamingmesh.jobs.container.JobsPlayer;
public class PermissionManager {
HashMap<String, Integer> permDelay = new HashMap<>();
private HashMap<String, Integer> permDelay = new HashMap<>();
private enum prm {
// jobs_join_JOBNAME(remade("jobs.join.%JOBNAME%"), 60 * 1000),

View File

@ -74,14 +74,12 @@ public class PlayerManager {
private HashMap<UUID, PlayerInfo> PlayerUUIDMap = new HashMap<>();
private HashMap<Integer, PlayerInfo> PlayerIDMap = new HashMap<>();
private HashMap<String, PlayerInfo> PlayerNameMap = new HashMap<>();
Jobs plugin;
public PlayerManager(Jobs plugin) {
this.plugin = plugin;
public PlayerManager() {
}
public PointsData getPointsData() {
return this.PointsDatabase;
return PointsDatabase;
}
public int getMapSize() {
@ -131,7 +129,7 @@ public class PlayerManager {
}
public ConcurrentHashMap<UUID, JobsPlayer> getPlayersCache() {
return this.playersUUIDCache;
return playersUUIDCache;
}
// public ConcurrentHashMap<String, JobsPlayer> getPlayers() {
@ -139,7 +137,7 @@ public class PlayerManager {
// }
public HashMap<UUID, PlayerInfo> getPlayersInfoUUIDMap() {
return this.PlayerUUIDMap;
return PlayerUUIDMap;
}
public int getPlayerId(String name) {
@ -198,9 +196,8 @@ public class PlayerManager {
if (Jobs.getGCManager().saveOnDisconnect()) {
jPlayer.onDisconnect();
jPlayer.save();
} else {
} else
jPlayer.onDisconnect();
}
}
/**
@ -216,16 +213,14 @@ public class PlayerManager {
*/
ArrayList<JobsPlayer> list = new ArrayList<>(this.players.values());
for (JobsPlayer jPlayer : list) {
for (JobsPlayer jPlayer : list)
jPlayer.save();
}
Iterator<JobsPlayer> iter = this.players.values().iterator();
while (iter.hasNext()) {
JobsPlayer jPlayer = iter.next();
if (!jPlayer.isOnline() && jPlayer.isSaved()) {
if (!jPlayer.isOnline() && jPlayer.isSaved())
iter.remove();
}
}
}
@ -239,14 +234,13 @@ public class PlayerManager {
for (Entry<UUID, JobsPlayer> one : playersUUIDCache.entrySet()) {
JobsPlayer jPlayer = one.getValue();
if (resetID)
jPlayer.setUserId(-1);
jPlayer.setUserId(-1);
JobsDAO dao = Jobs.getJobsDAO();
dao.updateSeen(jPlayer);
if (jPlayer.getUserId() == -1)
continue;
for (JobProgression oneJ : jPlayer.getJobProgression()) {
dao.insertJob(jPlayer, oneJ);
}
for (JobProgression oneJ : jPlayer.getJobProgression())
dao.insertJob(jPlayer, oneJ);
dao.saveLog(jPlayer);
dao.savePoints(jPlayer);
dao.recordPlayersLimits(jPlayer);
@ -319,11 +313,10 @@ public class PlayerManager {
jPlayer.reloadLimits();
}
if (points != null) {
if (points != null)
Jobs.getPlayerManager().getPointsData().addPlayer(jPlayer.getPlayerUUID(), points);
} else {
else
Jobs.getPlayerManager().getPointsData().addPlayer(jPlayer.getPlayerUUID());
}
if (logs != null)
jPlayer.setLog(logs);
@ -416,9 +409,8 @@ public class PlayerManager {
public void leaveAllJobs(JobsPlayer jPlayer) {
List<JobProgression> jobs = new ArrayList<>();
jobs.addAll(jPlayer.getJobProgression());
for (JobProgression job : jobs) {
for (JobProgression job : jobs)
leaveJob(jPlayer, job.getJob());
}
jPlayer.leaveAllJobs();
}
@ -553,28 +545,27 @@ public class PlayerManager {
if (sound != null && player != null && player.getLocation() != null)
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getSoundVolume(), levelUpEvent.getSoundPitch());
else
Bukkit.getConsoleSender().sendMessage("[Jobs] Cant find sound by name: " + levelUpEvent.getTitleChangeSound().name() + ". Please update it");
Bukkit.getConsoleSender().sendMessage("[Jobs] Can't find sound by name: " + levelUpEvent.getTitleChangeSound().name() + ". Please update it");
}
} catch (Exception e) {
}
String message;
if (Jobs.getGCManager().isBroadcastingLevelups()) {
if (Jobs.getGCManager().isBroadcastingLevelups())
message = Jobs.getLanguage().getMessage("message.levelup.broadcast");
} else {
else
message = Jobs.getLanguage().getMessage("message.levelup.nobroadcast");
}
message = message.replace("%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE);
if (levelUpEvent.getOldTitle() != null) {
if (levelUpEvent.getOldTitle() != null)
message = message.replace("%titlename%", levelUpEvent.getOldTitleColor() + levelUpEvent.getOldTitleName() + ChatColor.WHITE);
}
if (player != null) {
if (player != null)
message = message.replace("%playername%", player.getDisplayName());
} else {
else
message = message.replace("%playername%", jPlayer.getUserName());
}
message = message.replace("%joblevel%", "" + prog.getLevel());
for (String line : message.split("\n")) {
if (Jobs.getGCManager().isBroadcastingLevelups()) {
@ -598,27 +589,27 @@ public class PlayerManager {
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getTitleChangeVolume(),
levelUpEvent.getTitleChangePitch());
else
Bukkit.getConsoleSender().sendMessage("[Jobs] Cant find sound by name: " + levelUpEvent.getTitleChangeSound().name() + ". Please update it");
Bukkit.getConsoleSender().sendMessage("[Jobs] Can't find sound by name: " + levelUpEvent.getTitleChangeSound().name() + ". Please update it");
}
} catch (Exception e) {
}
// user would skill up
if (Jobs.getGCManager().isBroadcastingSkillups()) {
message = Jobs.getLanguage().getMessage("message.skillup.broadcast");
} else {
message = Jobs.getLanguage().getMessage("message.skillup.nobroadcast");
}
if (player != null) {
message = message.replace("%playername%", player.getDisplayName());
} else {
message = message.replace("%playername%", jPlayer.getUserName());
}
if (Jobs.getGCManager().isBroadcastingSkillups())
message = Jobs.getLanguage().getMessage("message.skillup.broadcast");
else
message = Jobs.getLanguage().getMessage("message.skillup.nobroadcast");
if (player != null)
message = message.replace("%playername%", player.getDisplayName());
else
message = message.replace("%playername%", jPlayer.getUserName());
message = message.replace("%titlename%", levelUpEvent.getNewTitleColor() + levelUpEvent.getNewTitleName() + ChatColor.WHITE);
message = message.replace("%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE);
for (String line : message.split("\n")) {
if (Jobs.getGCManager().isBroadcastingSkillups()) {
if (Jobs.getGCManager().isBroadcastingSkillups())
Bukkit.getServer().broadcastMessage(line);
} else if (player != null) {
else if (player != null) {
if (Jobs.getGCManager().TitleChangeActionBar)
Jobs.getActionBar().send(player, line);
if (Jobs.getGCManager().TitleChangeChat)
@ -740,7 +731,7 @@ public class PlayerManager {
HashMap<Job, ItemBonusCache> cj = cache.get(player.getUniqueId());
if (cj == null) {
cj = new HashMap<Job, ItemBonusCache>();
cj = new HashMap<>();
cache.put(player.getUniqueId(), cj);
}
@ -972,7 +963,7 @@ public class PlayerManager {
return;
if (!Jobs.getGCManager().AutoJobJoinUse)
return;
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Jobs.getInstance(), new Runnable() {
@Override
public void run() {
if (!player.isOnline())

View File

@ -2,14 +2,14 @@ package com.gamingmesh.jobs.Signs;
public class Sign {
int Category = 0;
String World = null;
double x = 0.01;
double y = 0.01;
double z = 0.01;
int Number = 0;
String JobName = null;
boolean special = false;
private int Category = 0;
private String World = null;
private double x = 0.01;
private double y = 0.01;
private double z = 0.01;
private int Number = 0;
private String JobName = null;
private boolean special = false;
public Sign() {
}
@ -19,7 +19,7 @@ public class Sign {
}
public boolean isSpecial() {
return this.special;
return special;
}
public void setJobName(String JobName) {
@ -27,7 +27,7 @@ public class Sign {
}
public String GetJobName() {
return this.JobName;
return JobName;
}
public void setCategory(int Category) {
@ -35,7 +35,7 @@ public class Sign {
}
public int GetCategory() {
return this.Category;
return Category;
}
public void setWorld(String World) {
@ -43,7 +43,7 @@ public class Sign {
}
public String GetWorld() {
return this.World;
return World;
}
public void setX(double x) {
@ -51,7 +51,7 @@ public class Sign {
}
public double GetX() {
return this.x;
return x;
}
public void setY(double y) {
@ -59,7 +59,7 @@ public class Sign {
}
public double GetY() {
return this.y;
return y;
}
public void setZ(double z) {
@ -67,7 +67,7 @@ public class Sign {
}
public double GetZ() {
return this.z;
return z;
}
public void setNumber(int Number) {
@ -75,6 +75,6 @@ public class Sign {
}
public int GetNumber() {
return this.Number;
return Number;
}
}

View File

@ -5,7 +5,7 @@ import java.util.List;
public class SignInfo {
List<Sign> AllSigns = new ArrayList<>();
private List<Sign> AllSigns = new ArrayList<>();
public SignInfo() {
}
@ -15,7 +15,7 @@ public class SignInfo {
}
public List<Sign> GetAllSigns() {
return this.AllSigns;
return AllSigns;
}
public void removeSign(Sign sign) {

View File

@ -32,6 +32,10 @@ public class SignUtil {
// Sign file
public void LoadSigns() {
// Boolean false does not create a file
if (!Jobs.getGCManager().SignsEnabled)
return;
Signs.GetAllSigns().clear();
File file = new File(plugin.getDataFolder(), "Signs.yml");
YamlConfiguration f = YamlConfiguration.loadConfiguration(file);
@ -61,6 +65,9 @@ public class SignUtil {
// Signs save file
public void saveSigns() {
if (!Jobs.getGCManager().SignsEnabled)
return;
File f = new File(plugin.getDataFolder(), "Signs.yml");
YamlConfiguration conf = YamlConfiguration.loadConfiguration(f);
@ -92,6 +99,9 @@ public class SignUtil {
}
public boolean SignUpdate(String JobName) {
if (!Jobs.getGCManager().SignsEnabled)
return true;
List<com.gamingmesh.jobs.Signs.Sign> Copy = new ArrayList<>(Signs.GetAllSigns().size());
for (com.gamingmesh.jobs.Signs.Sign foo : Signs.GetAllSigns()) {
Copy.add(foo);
@ -126,9 +136,8 @@ public class SignUtil {
org.bukkit.block.Sign sign = (org.bukkit.block.Sign) block.getState();
if (!one.isSpecial()) {
for (int i = 0; i < 4; i++) {
if (i >= PlayerList.size()) {
if (i >= PlayerList.size())
break;
}
String PlayerName = PlayerList.get(i).getPlayerName();
if (PlayerName != null && PlayerName.length() > 8) {

View File

@ -17,7 +17,7 @@ public final class JobsAreaSelectionEvent extends Event {
}
public Player getPlayer() {
return this.player;
return player;
}
public CuboidArea getArea() {

View File

@ -11,7 +11,7 @@ public final class JobsChunkChangeEvent extends Event implements Cancellable {
private Player player;
private Chunk oldChunk;
private Chunk newChunk;
private boolean cancelled;
private boolean cancelled = false;
public JobsChunkChangeEvent(Player player, Chunk oldChunk, Chunk newChunk) {
this.player = player;
@ -20,15 +20,15 @@ public final class JobsChunkChangeEvent extends Event implements Cancellable {
}
public Player getPlayer() {
return this.player;
return player;
}
public Chunk getOldChunk() {
return this.oldChunk;
return oldChunk;
}
public Chunk getNewChunk() {
return this.newChunk;
return newChunk;
}
@Override
@ -37,8 +37,8 @@ public final class JobsChunkChangeEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override

View File

@ -12,7 +12,7 @@ public final class JobsExpGainEvent extends Event implements Cancellable {
private OfflinePlayer offlinePlayer;
private double exp;
private Job job;
private boolean cancelled;
private boolean cancelled = false;
public JobsExpGainEvent(OfflinePlayer offlinePlayer, Job job, double exp) {
this.offlinePlayer = offlinePlayer;
@ -21,15 +21,15 @@ public final class JobsExpGainEvent extends Event implements Cancellable {
}
public OfflinePlayer getPlayer() {
return this.offlinePlayer;
return offlinePlayer;
}
public Job getJob() {
return this.job;
return job;
}
public double getExp() {
return this.exp;
return exp;
}
public void setExp(double exp) {
@ -42,8 +42,8 @@ public final class JobsExpGainEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override

View File

@ -11,7 +11,7 @@ public final class JobsJoinEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private JobsPlayer player;
private Job job;
private boolean cancelled;
private boolean cancelled = false;
public JobsJoinEvent(JobsPlayer jPlayer, Job job) {
this.player = jPlayer;
@ -19,11 +19,11 @@ public final class JobsJoinEvent extends Event implements Cancellable {
}
public JobsPlayer getPlayer() {
return this.player;
return player;
}
public Job getJob() {
return this.job;
return job;
}
@Override
@ -32,8 +32,8 @@ public final class JobsJoinEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override

View File

@ -11,7 +11,7 @@ public final class JobsLeaveEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private JobsPlayer player;
private Job job;
private boolean cancelled;
private boolean cancelled = false;
public JobsLeaveEvent(JobsPlayer jPlayer, Job job) {
this.player = jPlayer;
@ -19,11 +19,11 @@ public final class JobsLeaveEvent extends Event implements Cancellable {
}
public JobsPlayer getPlayer() {
return this.player;
return player;
}
public Job getJob() {
return this.job;
return job;
}
@Override
@ -32,8 +32,8 @@ public final class JobsLeaveEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override

View File

@ -21,7 +21,7 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
private Sound soundTitleChangeSound = Sound.values()[0];
private int soundTitleChangeVolume = 1;
private int soundTitleChangePitch = 3;
private boolean cancelled;
private boolean cancelled = false;
public JobsLevelUpEvent(JobsPlayer jPlayer, String JobName, int level, Title OldTitle, Title NewTitle, String soundLevelupSound, Integer soundLevelupVolume,
Integer soundLevelupPitch, String soundTitleChangeSound, Integer soundTitleChangeVolume, Integer soundTitleChangePitch) {
@ -47,43 +47,43 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
}
public JobsPlayer getPlayer() {
return this.player;
return player;
}
public String getJobName() {
return this.JobName;
return JobName;
}
public Title getOldTitle() {
return this.OldTitle;
return OldTitle;
}
public String getOldTitleName() {
return this.OldTitle.getName();
return OldTitle.getName();
}
public String getOldTitleShort() {
return this.OldTitle.getShortName();
return OldTitle.getShortName();
}
public String getOldTitleColor() {
return this.OldTitle.getChatColor().toString();
return OldTitle.getChatColor().toString();
}
public Title getNewTitle() {
return this.NewTitle;
return NewTitle;
}
public String getNewTitleName() {
return this.NewTitle.getName();
return NewTitle.getName();
}
public String getNewTitleShort() {
return this.NewTitle.getShortName();
return NewTitle.getShortName();
}
public String getNewTitleColor() {
return this.NewTitle.getChatColor().toString();
return NewTitle.getChatColor().toString();
}
@Deprecated
@ -95,24 +95,24 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
return this.soundLevelupSound == null ? Sound.values()[0] : this.soundLevelupSound;
}
public void setSound(Sound sound) {
this.soundLevelupSound = sound;
public void setSound(Sound soundLevelupSound) {
this.soundLevelupSound = soundLevelupSound;
}
public int getSoundVolume() {
return this.soundLevelupVolume;
return soundLevelupVolume;
}
public void setSoundVolume(int volume) {
this.soundLevelupVolume = volume;
public void setSoundVolume(int soundLevelupVolume) {
this.soundLevelupVolume = soundLevelupVolume;
}
public int getSoundPitch() {
return this.soundLevelupPitch;
return soundLevelupPitch;
}
public void setSoundPitch(int pitch) {
this.soundLevelupPitch = pitch;
public void setSoundPitch(int soundLevelupPitch) {
this.soundLevelupPitch = soundLevelupPitch;
}
@Deprecated
@ -124,28 +124,28 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
return this.soundTitleChangeSound == null ? Sound.values()[0] : this.soundTitleChangeSound;
}
public void setTitleChangeSound(Sound sound) {
this.soundTitleChangeSound = sound;
public void setTitleChangeSound(Sound soundTitleChangeSound) {
this.soundTitleChangeSound = soundTitleChangeSound;
}
public int getTitleChangeVolume() {
return this.soundTitleChangeVolume;
return soundTitleChangeVolume;
}
public void setTitleChangeVolume(int volume) {
this.soundTitleChangeVolume = volume;
public void setTitleChangeVolume(int soundTitleChangeVolume) {
this.soundTitleChangeVolume = soundTitleChangeVolume;
}
public int getTitleChangePitch() {
return this.soundTitleChangePitch;
return soundTitleChangePitch;
}
public void setTitleChangePitch(int pitch) {
this.soundTitleChangePitch = pitch;
public void setTitleChangePitch(int soundTitleChangePitch) {
this.soundTitleChangePitch = soundTitleChangePitch;
}
public int getLevel() {
return this.level;
return level;
}
@Override
@ -154,8 +154,8 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override

View File

@ -10,7 +10,7 @@ public final class JobsPaymentEvent extends Event implements Cancellable {
private OfflinePlayer offlinePlayer;
private double money;
private double points;
private boolean cancelled;
private boolean cancelled = false;
public JobsPaymentEvent(OfflinePlayer offlinePlayer, double money, double points) {
this.offlinePlayer = offlinePlayer;
@ -19,19 +19,19 @@ public final class JobsPaymentEvent extends Event implements Cancellable {
}
public OfflinePlayer getPlayer() {
return this.offlinePlayer;
return offlinePlayer;
}
public double getAmount() {
return this.money;
return money;
}
public double getPoints() {
return this.points;
return points;
}
public void setPoints(double amount) {
this.points = amount;
public void setPoints(double points) {
this.points = points;
}
@Override
@ -40,8 +40,8 @@ public final class JobsPaymentEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
public void setAmount(double money) {

View File

@ -7,7 +7,7 @@ import org.bukkit.event.HandlerList;
public class JobsScheduleStartEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private boolean cancelled = false;
private Schedule schedule;
public JobsScheduleStartEvent(Schedule schedule){
@ -24,8 +24,8 @@ public class JobsScheduleStartEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override

View File

@ -7,7 +7,7 @@ import org.bukkit.event.HandlerList;
public class JobsScheduleStopEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancelled;
private boolean cancelled = false;
private Schedule schedule;
public JobsScheduleStopEvent(Schedule schedule){
@ -24,8 +24,8 @@ public class JobsScheduleStopEvent extends Event implements Cancellable {
}
@Override
public void setCancelled(boolean cancel) {
cancelled = cancel;
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}
@Override

View File

@ -44,7 +44,10 @@ public class ExploreManager {
return;
Jobs.consoleMsg("&e[Jobs] Loading explorer data");
Jobs.getJobsDAO().loadExplore();
Jobs.consoleMsg("&e[Jobs] Loaded explorer data (" + getSize() + ")");
if (getSize() != 0)
Jobs.consoleMsg("&e[Jobs] Loaded explorer data (" + getSize() + ")");
else
Jobs.consoleMsg("&e[Jobs] Loaded explorer data.");
}
public HashMap<String, ExploreRegion> getWorlds() {

View File

@ -86,7 +86,7 @@ public class GeneralConfigManager {
public int globalblocktimer, CowMilkingTimer,
CoreProtectInterval, BlockPlaceInterval, InfoUpdateInterval;
public Double TreeFellerMultiplier, gigaDrillMultiplier, superBreakerMultiplier;
public String localeString = "EN";
public String localeString = "";
private boolean FurnacesReassign, BrewingStandsReassign;
private int FurnacesMaxDefault, BrewingStandsMaxDefault, BrowseAmountToShow;

View File

@ -139,7 +139,7 @@ public class LanguageManager {
c.get("general.error.ingame", "&cYou can use this command only in game!");
c.get("general.error.fromconsole", "&cYou can use this command only from console!");
c.get("general.error.worldisdisabled", "&cYou cant use command in this world!");
c.get("general.error.newFurnaceRegistration", "&eRegistered new ownership for furnace &7[current]&e/&f[max]");
c.get("general.error.newBrewingRegistration", "&eRegistered new ownership for brewing stand &7[current]&e/&f[max]");
c.get("general.error.noFurnaceRegistration", "&cYou reached max furnace count!");
@ -163,8 +163,6 @@ public class LanguageManager {
c.get("command.help.output.nextPageOff", "&7 Next >>----");
c.get("command.help.output.pageCount", "&2[current]/[total]");
c.get("command.moneyboost.help.info", "Boosts Money gain for all players");
c.get("command.moneyboost.help.args", "[jobname] [rate]");
Jobs.getGCManager().commandArgs.put("moneyboost", Arrays.asList("[jobname]", "[rate]"));
@ -202,7 +200,7 @@ public class LanguageManager {
c.get("command.edititembonus.help.info", "Edit item boost bonus");
c.get("command.edititembonus.help.args", "[list/add/remove] [jobsName] [itemBoostName]");
Jobs.getGCManager().commandArgs.put("edititembonus", Arrays.asList("add%%remove", "[jobname]", "[jobitemname]"));
c.get("command.bonus.help.info", "Show job bonuses");
c.get("command.bonus.help.args", "[jobname]");
Jobs.getGCManager().commandArgs.put("bonus", Arrays.asList("[jobname]"));
@ -217,9 +215,6 @@ public class LanguageManager {
c.get("command.bonus.output.mcmmo", " &eMcMMO bonus: %money% %points% %exp%");
c.get("command.bonus.output.final", " &eFinal bonus: %money% %points% %exp%");
c.get("command.bonus.output.finalExplanation", " &eDoes not include Petpay and Near spawner bonus/penalty");
c.get("command.convert.help.info",
"Converts data base system from one system to another. if you currently running sqlite, this will convert to Mysql and vise versa.");

View File

@ -130,66 +130,86 @@ public class NameTranslatorManager {
public void readFile() {
YmlMaker ItemFile = new YmlMaker(plugin, "TranslatableWords" + File.separator + "Words_" + Jobs.getGCManager().localeString + ".yml");
ItemFile.saveDefaultConfig();
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("ItemList");
Set<String> keys = section.getKeys(false);
ListOfNames.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfNames.add(new NameList(id, meta, Name, MCName));
}
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfNames.size() + " custom item names!");
if (ItemFile.getConfig().isConfigurationSection("ItemList")) {
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("ItemList");
Set<String> keys = section.getKeys(false);
ListOfNames.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfNames.add(new NameList(id, meta, Name, MCName));
}
if (ListOfNames.size() != 0)
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfNames.size() + " custom item names!");
} else
Jobs.consoleMsg("&c[Jobs] The ItemList section not found in " + ItemFile.fileName + " file.");
section = ItemFile.getConfig().getConfigurationSection("EntityList");
keys = section.getKeys(false);
ListOfEntities.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfEntities.add(new NameList(id, meta, Name, MCName));
}
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEntities.size() + " custom entity names!");
if (ItemFile.getConfig().isConfigurationSection("EntityList")) {
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("EntityList");
Set<String>keys = section.getKeys(false);
ListOfEntities.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfEntities.add(new NameList(id, meta, Name, MCName));
}
if (ListOfEntities.size() != 0)
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEntities.size() + " custom entity names!");
} else
Jobs.consoleMsg("&c[Jobs] The EntityList section not found in " + ItemFile.fileName + " file.");
section = ItemFile.getConfig().getConfigurationSection("EnchantList");
keys = section.getKeys(false);
ListOfEnchants.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfEnchants.add(new NameList(id, meta, Name, MCName));
}
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEnchants.size() + " custom enchant names!");
if (ItemFile.getConfig().isConfigurationSection("EnchantList")) {
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("EnchantList");
Set<String>keys = section.getKeys(false);
ListOfEnchants.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfEnchants.add(new NameList(id, meta, Name, MCName));
}
if (ListOfEnchants.size() != 0)
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfEnchants.size() + " custom enchant names!");
} else
Jobs.consoleMsg("&c[Jobs] The EnchantList section not found in " + ItemFile.fileName + " file.");
section = ItemFile.getConfig().getConfigurationSection("ColorList");
keys = section.getKeys(false);
ListOfColors.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfColors.add(new NameList(id, meta, Name, MCName));
}
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfColors.size() + " custom color names!");
if (ItemFile.getConfig().isConfigurationSection("ColorList")) {
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("ColorList");
Set<String>keys = section.getKeys(false);
ListOfColors.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfColors.add(new NameList(id, meta, Name, MCName));
}
if (ListOfColors.size() != 0)
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfColors.size() + " custom color names!");
} else
Jobs.consoleMsg("&c[Jobs] The ColorList section not found in " + ItemFile.fileName + " file.");
section = ItemFile.getConfig().getConfigurationSection("PotionNamesList");
keys = section.getKeys(false);
ListOfPotionNames.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfColors.add(new NameList(id, meta, Name, MCName));
}
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfPotionNames.size() + " custom potion names!");
if (ItemFile.getConfig().isConfigurationSection("PotionNamesList")) {
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("PotionNamesList");
Set<String>keys = section.getKeys(false);
ListOfPotionNames.clear();
for (String one : keys) {
String id = one.contains(":") ? one.split(":")[0] : one;
String meta = one.contains(":") ? one.split(":")[1] : "";
String MCName = section.getString(one + ".MCName");
String Name = section.getString(one + ".Name");
ListOfColors.add(new NameList(id, meta, Name, MCName));
}
if (ListOfPotionNames.size() != 0)
Jobs.consoleMsg("&e[Jobs] Loaded " + ListOfPotionNames.size() + " custom potion names!");
} else
Jobs.consoleMsg("&c[Jobs] The PotionNamesList section not found in " + ItemFile.fileName + " file.");
}
synchronized void load() {
@ -1667,7 +1687,7 @@ public class NameTranslatorManager {
c.get("ColorList.2.MCName", "magenta");
c.get("ColorList.2.Name", "&dMagenta");
c.get("ColorList.3.MCName", "lightBlue");
c.get("ColorList.3.Name", "%9Light blue");
c.get("ColorList.3.Name", "&9Light blue");
c.get("ColorList.4.MCName", "yellow");
c.get("ColorList.4.Name", "&eYellow");
c.get("ColorList.5.MCName", "lime");
@ -1694,82 +1714,82 @@ public class NameTranslatorManager {
c.get("ColorList.15.Name", "&0Black");
// Potion name list
c.get("PotionNamesList.0.MCName", "POTION");
c.get("PotionNamesList.0.Name", "Potion");
c.get("PotionNamesList.1.MCName", "AWKWARD_POTION");
c.get("PotionNamesList.1.Name", "Awkward potion");
c.get("PotionNamesList.2.MCName", "THICK_POTION");
c.get("PotionNamesList.2.Name", "Thick potion");
c.get("PotionNamesList.3.MCName", "MUNDANE_POTION");
c.get("PotionNamesList.3.Name", "Mundane potion");
c.get("PotionNamesList.4.MCName", "REGENERATION_POTION");
c.get("PotionNamesList.4.Name", "Regeneration potion");
c.get("PotionNamesList.5.MCName", "SWIFTNESS_POTION");
c.get("PotionNamesList.5.Name", "Swiftness potion");
c.get("PotionNamesList.6.MCName", "FIRE_RESISTANCE_POTION");
c.get("PotionNamesList.6.Name", "Fire resistance potion");
c.get("PotionNamesList.7.MCName", "POISON_POTION");
c.get("PotionNamesList.7.Name", "Poison potion");
c.get("PotionNamesList.8.MCName", "HEALING_POTION");
c.get("PotionNamesList.8.Name", "Healing potion");
c.get("PotionNamesList.9.MCName", "NIGHT_VISION_POTION");
c.get("PotionNamesList.9.Name", "Night vision potion");
c.get("PotionNamesList.10.MCName", "WEAKNESS_POTION");
c.get("PotionNamesList.10.Name", "Weakness potion");
c.get("PotionNamesList.11.MCName", "STRENGTH_POTION");
c.get("PotionNamesList.11.Name", "Strength potion");
c.get("PotionNamesList.12.MCName", "SLOWNESS_POTION");
c.get("PotionNamesList.12.Name", "Slowness potion");
c.get("PotionNamesList.13.MCName", "HARMING_POTION");
c.get("PotionNamesList.13.Name", "Harming potion");
c.get("PotionNamesList.14.MCName", "WATER_BREATHING_POTION");
c.get("PotionNamesList.14.Name", "Water breathing potion");
c.get("PotionNamesList.15.MCName", "INVISIBILITY_POTION");
c.get("PotionNamesList.15.Name", "Inivisibility potion");
c.get("PotionNamesList.16.MCName", "REGENERATION_POTION2");
c.get("PotionNamesList.16.Name", "Regeneration potion 2");
c.get("PotionNamesList.17.MCName", "SWIFTNESS_POTION2");
c.get("PotionNamesList.17.Name", "Swiftness potion 2");
c.get("PotionNamesList.18.MCName", "POISON_POTION2");
c.get("PotionNamesList.18.Name", "Poison potion 2");
c.get("PotionNamesList.19.MCName", "HEALING_POTION2");
c.get("PotionNamesList.19.Name", "Healing potion 2");
c.get("PotionNamesList.20.MCName", "STRENGTH_POTION2");
c.get("PotionNamesList.20.Name", "Strength potion 2");
c.get("PotionNamesList.21.MCName", "LEAPING_POTION2");
c.get("PotionNamesList.21.Name", "Leaping potion 2");
c.get("PotionNamesList.22.MCName", "HARMING_POTION2");
c.get("PotionNamesList.22.Name", "Harming potion 2");
c.get("PotionNamesList.23.MCName", "REGENERATION_POTION3");
c.get("PotionNamesList.23.Name", "Regeneration potion 3");
c.get("PotionNamesList.24.MCName", "SWIFTNESS_POTION3");
c.get("PotionNamesList.24.Name", "Swiftness potion 3");
c.get("PotionNamesList.25.MCName", "FIRE_RESISTANCE_POTION3");
c.get("PotionNamesList.25.Name", "Fire resistance potion 3");
c.get("PotionNamesList.26.MCName", "POISON_POTION3");
c.get("PotionNamesList.26.Name", "Poison potion 3");
c.get("PotionNamesList.27.MCName", "NIGHT_VISION_POTION2");
c.get("PotionNamesList.27.Name", "Night vision potion 2");
c.get("PotionNamesList.28.MCName", "WEAKNESS_POTION2");
c.get("PotionNamesList.28.Name", "Weakness potion 2");
c.get("PotionNamesList.29.MCName", "STRENGTH_POTION3");
c.get("PotionNamesList.29.Name", "Strength potion 3");
c.get("PotionNamesList.30.MCName", "SLOWNESS_POTION2");
c.get("PotionNamesList.30.Name", "Slowness potion 2");
c.get("PotionNamesList.31.MCName", "LEAPING_POTION3");
c.get("PotionNamesList.31.Name", "Leaping potion 3");
c.get("PotionNamesList.32.MCName", "WATER_BREATHING_POTION2");
c.get("PotionNamesList.32.Name", "Water breathing potion 2");
c.get("PotionNamesList.33.MCName", "INVISIBILITY_POTION2");
c.get("PotionNamesList.33.Name", "Invisibility potion 2");
c.get("PotionNamesList.34.MCName", "REGENERATION_POTION4");
c.get("PotionNamesList.34.Name", "Regeneration potion 4");
c.get("PotionNamesList.35.MCName", "SWIFTNESS_POTION4");
c.get("PotionNamesList.35.Name", "Swiftness potion 4");
c.get("PotionNamesList.36.MCName", "POISON_POTION4");
c.get("PotionNamesList.36.Name", "Poison potion 4");
c.get("PotionNamesList.37.MCName", "STRENGTH_POTION4");
c.get("PotionNamesList.37.Name", "Strength potion 4");
c.get("PotionNamesList.373.MCName", "POTION");
c.get("PotionNamesList.373.Name", "Potion");
c.get("PotionNamesList.373:16.MCName", "AWKWARD_POTION");
c.get("PotionNamesList.373:16.Name", "Awkward potion");
c.get("PotionNamesList.373:32.MCName", "THICK_POTION");
c.get("PotionNamesList.373:32.Name", "Thick potion");
c.get("PotionNamesList.373:64.MCName", "MUNDANE_POTION");
c.get("PotionNamesList.373:64.Name", "Mundane potion");
c.get("PotionNamesList.373:8193.MCName", "REGENERATION_POTION");
c.get("PotionNamesList.373:8193.Name", "Regeneration potion");
c.get("PotionNamesList.373:8194.MCName", "SWIFTNESS_POTION");
c.get("PotionNamesList.373:8194.Name", "Swiftness potion");
c.get("PotionNamesList.373:8195.MCName", "FIRE_RESISTANCE_POTION");
c.get("PotionNamesList.373:8195.Name", "Fire resistance potion");
c.get("PotionNamesList.373:8196.MCName", "POISON_POTION");
c.get("PotionNamesList.373:8196.Name", "Poison potion");
c.get("PotionNamesList.373:8197.MCName", "HEALING_POTION");
c.get("PotionNamesList.373:8197.Name", "Healing potion");
c.get("PotionNamesList.373:8198.MCName", "NIGHT_VISION_POTION");
c.get("PotionNamesList.373:8198.Name", "Night vision potion");
c.get("PotionNamesList.373:8200.MCName", "WEAKNESS_POTION");
c.get("PotionNamesList.373:8200.Name", "Weakness potion");
c.get("PotionNamesList.373:8201.MCName", "STRENGTH_POTION");
c.get("PotionNamesList.373:8201.Name", "Strength potion");
c.get("PotionNamesList.373:8202.MCName", "SLOWNESS_POTION");
c.get("PotionNamesList.373:8202.Name", "Slowness potion");
c.get("PotionNamesList.373:8204.MCName", "HARMING_POTION");
c.get("PotionNamesList.373:8204.Name", "Harming potion");
c.get("PotionNamesList.373:8205.MCName", "WATER_BREATHING_POTION");
c.get("PotionNamesList.373:8205.Name", "Water breathing potion");
c.get("PotionNamesList.373:8206.MCName", "INVISIBILITY_POTION");
c.get("PotionNamesList.373:8206.Name", "Inivisibility potion");
c.get("PotionNamesList.373:8225.MCName", "REGENERATION_POTION2");
c.get("PotionNamesList.373:8225.Name", "Regeneration potion 2");
c.get("PotionNamesList.373:8226.MCName", "SWIFTNESS_POTION2");
c.get("PotionNamesList.373:8226.Name", "Swiftness potion 2");
c.get("PotionNamesList.373:8228.MCName", "POISON_POTION2");
c.get("PotionNamesList.373:8228.Name", "Poison potion 2");
c.get("PotionNamesList.373:8229.MCName", "HEALING_POTION2");
c.get("PotionNamesList.373:8229.Name", "Healing potion 2");
c.get("PotionNamesList.373:8233.MCName", "STRENGTH_POTION2");
c.get("PotionNamesList.373:8233.Name", "Strength potion 2");
c.get("PotionNamesList.373:8235.MCName", "LEAPING_POTION2");
c.get("PotionNamesList.373:8235.Name", "Leaping potion 2");
c.get("PotionNamesList.373:8236.MCName", "HARMING_POTION2");
c.get("PotionNamesList.373:8236.Name", "Harming potion 2");
c.get("PotionNamesList.373:8257.MCName", "REGENERATION_POTION3");
c.get("PotionNamesList.373:8257.Name", "Regeneration potion 3");
c.get("PotionNamesList.373:8258.MCName", "SWIFTNESS_POTION3");
c.get("PotionNamesList.373:8258.Name", "Swiftness potion 3");
c.get("PotionNamesList.373:8259.MCName", "FIRE_RESISTANCE_POTION3");
c.get("PotionNamesList.373:8259.Name", "Fire resistance potion 3");
c.get("PotionNamesList.373:8260.MCName", "POISON_POTION3");
c.get("PotionNamesList.373:8260.Name", "Poison potion 3");
c.get("PotionNamesList.373:8262.MCName", "NIGHT_VISION_POTION2");
c.get("PotionNamesList.373:8262.Name", "Night vision potion 2");
c.get("PotionNamesList.373:8264.MCName", "WEAKNESS_POTION2");
c.get("PotionNamesList.373:8264.Name", "Weakness potion 2");
c.get("PotionNamesList.373:8265.MCName", "STRENGTH_POTION3");
c.get("PotionNamesList.373:8265.Name", "Strength potion 3");
c.get("PotionNamesList.373:8266.MCName", "SLOWNESS_POTION2");
c.get("PotionNamesList.373:8266.Name", "Slowness potion 2");
c.get("PotionNamesList.373:8267.MCName", "LEAPING_POTION3");
c.get("PotionNamesList.373:8267.Name", "Leaping potion 3");
c.get("PotionNamesList.373:8269.MCName", "WATER_BREATHING_POTION2");
c.get("PotionNamesList.373:8269.Name", "Water breathing potion 2");
c.get("PotionNamesList.373:8270.MCName", "INVISIBILITY_POTION2");
c.get("PotionNamesList.373:8270.Name", "Invisibility potion 2");
c.get("PotionNamesList.373:8289.MCName", "REGENERATION_POTION4");
c.get("PotionNamesList.373:8289.Name", "Regeneration potion 4");
c.get("PotionNamesList.373:8290.MCName", "SWIFTNESS_POTION4");
c.get("PotionNamesList.373:8290.Name", "Swiftness potion 4");
c.get("PotionNamesList.373:8292.MCName", "POISON_POTION4");
c.get("PotionNamesList.373:8292.Name", "Poison potion 4");
c.get("PotionNamesList.373:8297.MCName", "STRENGTH_POTION4");
c.get("PotionNamesList.373:8297.Name", "Strength potion 4");
try {
c.getW().save(f);

View File

@ -28,6 +28,11 @@ public class RestrictedBlockManager {
* loads from Jobs/restrictedAreas.yml
*/
public synchronized void load() {
// No file create/load when boolean is false
if (!Jobs.getGCManager().useBlockProtection) {
return;
}
File f = new File(plugin.getDataFolder(), "restrictedBlocks.yml");
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
CommentedYamlConfiguration writer = new CommentedYamlConfiguration();
@ -156,8 +161,8 @@ public class RestrictedBlockManager {
Set<String> lss = c.getC().getConfigurationSection("blocksTimer").getKeys(false);
for (String one : lss) {
if (((c.getC().isString("blocksTimer." + one + ".id")) || (c.getC().isInt("blocksTimer." + one + ".id"))) && (c.getC().isInt("blocksTimer." + one
+ ".cd"))) {
CMIItemStack cm = ItemManager.getItem(c.getC().getString("blocksTimer." + one + ".id"));
+ ".cd"))) {
CMIItemStack cm = ItemManager.getItem(c.getC().getString("blocksTimer." + one + ".id"));
if ((cm == null) || (!cm.getCMIType().isBlock())) {
Jobs.consoleMsg("&e[Jobs] Your defined (" + c.getC().getString(new StringBuilder("blocksTimer.").append(one)
.append(".id").toString()) + ") protected block id/name is not correct!");

View File

@ -52,7 +52,7 @@ public class ShopManager {
Inventory topinv = player.getOpenInventory().getTopInventory();
if (topinv != null)
player.closeInventory();
Jobs.getShopManager().GuiList.put(player.getName(), page);
GuiList.put(player.getName(), page);
player.openInventory(inv);
}

View File

@ -26,6 +26,6 @@ public abstract class BaseActionInfo implements ActionInfo {
@Override
public ActionType getType() {
return this.type;
return type;
}
}

View File

@ -6,7 +6,7 @@ import com.gamingmesh.jobs.PlayerManager.BoostOf;
public class Boost {
HashMap<BoostOf, BoostMultiplier> map = new HashMap<>();
private HashMap<BoostOf, BoostMultiplier> map = new HashMap<>();
public Boost() {
for (BoostOf one : BoostOf.values()) {

View File

@ -1,9 +1,9 @@
package com.gamingmesh.jobs.container;
public class BoostCounter {
CurrencyType type;
double boost;
Long calculatedon;
private CurrencyType type;
private double boost;
private Long calculatedon;
public BoostCounter(CurrencyType type, double boost, Long calculatedon) {
this.type = type;
@ -12,19 +12,19 @@ public class BoostCounter {
}
public CurrencyType getType() {
return this.type;
return type;
}
public long getTime() {
return this.calculatedon;
return calculatedon;
}
public double getBoost() {
return this.boost;
return boost;
}
public void setTime(long time) {
this.calculatedon = time;
public void setTime(long calculatedon) {
this.calculatedon = calculatedon;
}
public void setBoost(double boost) {

View File

@ -4,7 +4,7 @@ import java.util.HashMap;
public class BoostMultiplier {
HashMap<CurrencyType, Double> map = new HashMap<>();
private HashMap<CurrencyType, Double> map = new HashMap<>();
@Override
public BoostMultiplier clone() {

View File

@ -4,10 +4,10 @@ import org.bukkit.Bukkit;
import org.bukkit.boss.BossBar;
public class BossBarInfo {
String jobName;
String PlayerName;
BossBar bar;
int id = -1;
private String jobName;
private String PlayerName;
private BossBar bar;
private int id = -1;
public BossBarInfo(String PlayerName, String jobName, BossBar bar) {
this.PlayerName = PlayerName;
@ -26,14 +26,14 @@ public class BossBarInfo {
}
public String getPlayerName() {
return this.PlayerName;
return PlayerName;
}
public String getJobName() {
return this.jobName;
return jobName;
}
public BossBar getBar() {
return this.bar;
return bar;
}
}

View File

@ -4,11 +4,11 @@ import java.util.UUID;
public class Convert {
int id;
UUID uuid;
String jobname;
int level;
int exp;
private int id;
private UUID uuid;
private String jobname;
private int level;
private int exp;
public Convert(int id, UUID uuid, String jobname, int level, int exp) {
this.id = id;
@ -22,22 +22,22 @@ public class Convert {
}
public int GetId() {
return this.id;
return id;
}
public UUID GetUserUUID() {
return this.uuid;
return uuid;
}
public String GetJobName() {
return this.jobname;
return jobname;
}
public int GetLevel() {
return this.level;
return level;
}
public int GetExp() {
return this.exp;
return exp;
}
}

View File

@ -8,9 +8,9 @@ import com.gamingmesh.jobs.Jobs;
public class ExploreChunk {
int x;
int z;
Set<String> playerNames = new HashSet<>();
private int x;
private int z;
private Set<String> playerNames = new HashSet<>();
private Integer dbId = null;
private boolean updated = false;
@ -42,19 +42,19 @@ public class ExploreChunk {
}
public int getCount() {
return this.playerNames.size();
return playerNames.size();
}
public int getX() {
return this.x;
return x;
}
public int getZ() {
return this.z;
return z;
}
public Set<String> getPlayers() {
return this.playerNames;
return playerNames;
}
public String serializeNames() {

View File

@ -6,9 +6,9 @@ import org.bukkit.Chunk;
public class ExploreRegion {
int x;
int z;
HashMap<String, ExploreChunk> chunks = new HashMap<>();
int x;
int z;
private HashMap<String, ExploreChunk> chunks = new HashMap<>();
public ExploreRegion(int x, int z) {
this.x = x;

View File

@ -2,8 +2,8 @@ package com.gamingmesh.jobs.container;
public class ExploreRespond {
int count;
boolean newChunk = false;
private int count;
private boolean newChunk = false;
public ExploreRespond(int count, boolean newChunk) {
this.count = count;
@ -11,10 +11,10 @@ public class ExploreRespond {
}
public int getCount() {
return this.count;
return count;
}
public boolean isNewChunk() {
return this.newChunk;
return newChunk;
}
}

View File

@ -3,11 +3,11 @@ package com.gamingmesh.jobs.container;
import com.gamingmesh.jobs.economy.BufferedPayment;
public class FastPayment {
JobsPlayer jPlayer;
ActionInfo info;
BufferedPayment payment;
Job job;
Long time;
private JobsPlayer jPlayer;
private ActionInfo info;
private BufferedPayment payment;
private Job job;
private Long time;
public FastPayment(JobsPlayer jPlayer, ActionInfo info, BufferedPayment payment, Job job) {
this.jPlayer = jPlayer;
@ -18,22 +18,22 @@ public class FastPayment {
}
public JobsPlayer getPlayer() {
return this.jPlayer;
return jPlayer;
}
public ActionInfo getInfo() {
return this.info;
return info;
}
public BufferedPayment getPayment() {
return this.payment;
return payment;
}
public Job getJob() {
return this.job;
return job;
}
public Long getTime() {
return this.time;
return time;
}
}

View File

@ -6,7 +6,7 @@ import com.gamingmesh.jobs.Jobs;
public class ItemBonusCache {
Player player;
private Player player;
private Long lastCheck = null;
private BoostMultiplier bm = new BoostMultiplier();
private Job job;

View File

@ -139,7 +139,7 @@ public class Job {
}
public BoostMultiplier getBoost() {
return this.boost;
return boost;
}
public boolean isSame(Job job) {
@ -185,15 +185,15 @@ public class Job {
}
public List<String> getCmdOnJoin() {
return this.CmdOnJoin;
return CmdOnJoin;
}
public List<String> getCmdOnLeave() {
return this.CmdOnLeave;
return CmdOnLeave;
}
public ItemStack getGuiItem() {
return this.GUIitem;
return GUIitem;
}
/**

View File

@ -62,11 +62,11 @@ public class JobInfo {
}
public int getFromLevel() {
return this.fromLevel;
return fromLevel;
}
public int getUntilLevel() {
return this.untilLevel;
return untilLevel;
}
public boolean isInLevelRange(int level) {
@ -74,7 +74,7 @@ public class JobInfo {
}
public String getName() {
return this.name;
return name;
}
public String getRealisticName() {
@ -86,27 +86,27 @@ public class JobInfo {
}
public int getId() {
return this.id;
return id;
}
public ActionType getActionType() {
return this.actionType;
return actionType;
}
public String getMeta() {
return this.meta;
return meta;
}
public double getBaseIncome() {
return this.baseIncome;
return baseIncome;
}
public double getBaseXp() {
return this.baseXp;
return baseXp;
}
public double getBasePoints() {
return this.basePoints;
return basePoints;
}
public double getIncome(double level, double numjobs) {

View File

@ -28,10 +28,10 @@ public class JobItemBonus {
}
public String getNode() {
return this.node;
return node;
}
public BoostMultiplier getBoost() {
return this.boostMultiplier.clone();
return boostMultiplier.clone();
}
}

View File

@ -54,7 +54,7 @@ public class JobItems {
}
public String getNode() {
return this.node;
return node;
}
public ItemStack getItemStack(Player player) {
@ -93,30 +93,30 @@ public class JobItems {
}
public int getId() {
return this.id;
return id;
}
public int getData() {
return this.data;
return data;
}
public int getAmount() {
return this.amount;
return amount;
}
public String getName() {
return this.name;
return name;
}
public List<String> getLore() {
return this.lore;
return lore;
}
public HashMap<Enchantment, Integer> getEnchants() {
return this.enchants;
return enchants;
}
public BoostMultiplier getBoost() {
return this.boostMultiplier.clone();
return boostMultiplier.clone();
}
}

View File

@ -40,26 +40,26 @@ public class JobLimitedItems {
}
public String getNode() {
return this.node;
return node;
}
public int getId() {
return this.id;
return id;
}
public String getName() {
return this.name;
return name;
}
public List<String> getLore() {
return this.lore;
return lore;
}
public HashMap<Enchantment, Integer> getenchants() {
return this.enchants;
return enchants;
}
public int getLevel() {
return this.level;
return level;
}
}

View File

@ -146,8 +146,8 @@ public class JobsPlayer {
return true;
}
public void setPlayer(Player p) {
this.player = p;
public void setPlayer(Player player) {
this.player = player;
}
public void loadLogFromDao() {
@ -155,7 +155,7 @@ public class JobsPlayer {
}
public synchronized List<String> getUpdateBossBarFor() {
return this.updateBossBarFor;
return updateBossBarFor;
}
public synchronized void clearUpdateBossBarFor() {
@ -163,7 +163,7 @@ public class JobsPlayer {
}
public synchronized List<BossBarInfo> getBossBarInfo() {
return this.barMap;
return barMap;
}
public synchronized void hideBossBars() {
@ -173,7 +173,7 @@ public class JobsPlayer {
}
public HashMap<String, Log> getLog() {
return this.logList;
return logList;
}
public void setLog(HashMap<String, Log> l) {
@ -185,7 +185,7 @@ public class JobsPlayer {
}
public int getUserId() {
return this.userid;
return userid;
}
/**
@ -372,8 +372,8 @@ public class JobsPlayer {
return this.playerUUID;
}
public void setPlayerUUID(UUID uuid) {
playerUUID = uuid;
public void setPlayerUUID(UUID playerUUID) {
this.playerUUID = playerUUID;
}
public String getDisplayHonorific() {
@ -761,8 +761,8 @@ public class JobsPlayer {
return isSaved;
}
public void setSaved(boolean value) {
isSaved = value;
public void setSaved(boolean isSaved) {
this.isSaved = isSaved;
}
public Long getSeen() {

View File

@ -8,8 +8,8 @@ import org.bukkit.ChatColor;
import com.gamingmesh.jobs.config.CommentedYamlConfiguration;
public class LocaleReader {
YamlConfiguration config;
CommentedYamlConfiguration writer;
private YamlConfiguration config;
private CommentedYamlConfiguration writer;
public LocaleReader(YamlConfiguration config, CommentedYamlConfiguration writer) {
this.config = config;

View File

@ -15,7 +15,7 @@ public final class Log {
}
public String getActionType() {
return this.action;
return action;
}
public void add(String item, HashMap<CurrencyType, Double> amounts) {
@ -42,11 +42,11 @@ public final class Log {
}
public int getDate() {
return this.day;
return day;
}
public HashMap<String, LogAmounts> getAmountList() {
return this.amountMap;
return amountMap;
}
public int getCount(String item) {

View File

@ -20,15 +20,15 @@ public final class LogAmounts {
}
public boolean isNewEntry() {
return this.newEntry;
return newEntry;
}
public void setNewEntry(boolean state) {
this.newEntry = state;
public void setNewEntry(boolean newEntry) {
this.newEntry = newEntry;
}
public String getItemName() {
return this.item;
return item;
}
public void add(HashMap<CurrencyType, Double> amounts) {
@ -58,7 +58,7 @@ public final class LogAmounts {
}
public int getCount() {
return this.count;
return count;
}
public void setCount(int count) {
@ -70,7 +70,7 @@ public final class LogAmounts {
}
public String getUsername() {
return this.username;
return username;
}
public void setAction(String action) {
@ -78,7 +78,7 @@ public final class LogAmounts {
}
public String getAction() {
return this.action;
return action;
}
}

View File

@ -20,10 +20,10 @@ package com.gamingmesh.jobs.container;
public class NameList {
String id;
String meta;
String Name;
String MinecraftName;
private String id;
private String meta;
private String Name;
private String MinecraftName;
public NameList(String id, String meta, String Name, String MinecraftName) {
this.id = id;

View File

@ -6,12 +6,12 @@ import com.gamingmesh.jobs.Jobs;
public class PlayerInfo {
int id;
String name = "Unknown";
private Long seen;
private Integer questsDone;
private UUID uuid;
private JobsPlayer player;
private int id;
private String name = "Unknown";
private Long seen;
private Integer questsDone;
private UUID uuid;
private JobsPlayer player;
public PlayerInfo(String name, int id, UUID uuid, Long seen, Integer questsDone) {
this.name = name;

View File

@ -2,9 +2,9 @@ package com.gamingmesh.jobs.container;
public class PlayerPoints {
double current = 0D;
double total = 0D;
boolean newEntry = false;
private double current = 0D;
private double total = 0D;
private boolean newEntry = false;
public PlayerPoints() {
newEntry = true;
@ -47,7 +47,7 @@ public class PlayerPoints {
return newEntry;
}
public void setNewEntry(boolean state) {
newEntry = state;
public void setNewEntry(boolean newEntry) {
this.newEntry = newEntry;
}
}

View File

@ -40,7 +40,7 @@ public class RestrictedArea {
}
public CuboidArea getCuboidArea() {
return this.area;
return area;
}
/**
@ -49,7 +49,7 @@ public class RestrictedArea {
*/
public double getMultiplier() {
return this.multiplier;
return multiplier;
}
/**

View File

@ -10,76 +10,76 @@ import com.gamingmesh.jobs.Jobs;
public class Schedule {
int From = 0;
int Until = 235959;
private int From = 0;
private int Until = 235959;
int nextFrom = 0;
int nextUntil = 235959;
private int nextFrom = 0;
private int nextUntil = 235959;
boolean nextDay = false;
private boolean nextDay = false;
BoostMultiplier BM = new BoostMultiplier();
private BoostMultiplier BM = new BoostMultiplier();
String Name = null;
private String Name = null;
List<String> Days = new ArrayList<>(Arrays.asList("all"));
List<Job> JobsList = new ArrayList<>();
private List<String> Days = new ArrayList<>(Arrays.asList("all"));
private List<Job> JobsList = new ArrayList<>();
List<String> MessageOnStart = new ArrayList<>();
List<String> MessageOnStop = new ArrayList<>();
private List<String> MessageOnStart = new ArrayList<>();
private List<String> MessageOnStop = new ArrayList<>();
List<String> MessageToBroadcast = new ArrayList<>();
private List<String> MessageToBroadcast = new ArrayList<>();
boolean started = false;
boolean stoped = true;
private boolean started = false;
private boolean stoped = true;
boolean onStop = true;
boolean OnStart = true;
private boolean onStop = true;
private boolean OnStart = true;
long broadcastInfoOn = 0L;
int broadcastInterval = 0;
private long broadcastInfoOn = 0L;
private int broadcastInterval = 0;
public Schedule() {
}
public void setBroadcastInfoOn(long time) {
this.broadcastInfoOn = time;
public void setBroadcastInfoOn(long broadcastInfoOn) {
this.broadcastInfoOn = broadcastInfoOn;
}
public long getBroadcastInfoOn() {
return this.broadcastInfoOn;
return broadcastInfoOn;
}
public void setBroadcastOnStop(boolean stage) {
this.onStop = stage;
public void setBroadcastOnStop(boolean onStop) {
this.onStop = onStop;
}
public boolean isBroadcastOnStop() {
return this.onStop;
return onStop;
}
public void setBroadcastOnStart(boolean stage) {
this.OnStart = stage;
public void setBroadcastOnStart(boolean OnStart) {
this.OnStart = OnStart;
}
public boolean isBroadcastOnStart() {
return this.OnStart;
return OnStart;
}
public void setStarted(boolean stage) {
this.started = stage;
public void setStarted(boolean started) {
this.started = started;
}
public boolean isStarted() {
return this.started;
return started;
}
public void setStoped(boolean con) {
this.stoped = con;
public void setStoped(boolean stoped) {
this.stoped = stoped;
}
public boolean isStoped() {
return this.stoped;
return stoped;
}
public void setBoost(CurrencyType type, double amount) {
@ -91,7 +91,7 @@ public class Schedule {
}
public BoostMultiplier getBoost() {
return this.BM;
return BM;
}
public void setName(String Name) {
@ -99,7 +99,7 @@ public class Schedule {
}
public String GetName() {
return this.Name;
return Name;
}
public void setFrom(int From) {
@ -107,19 +107,19 @@ public class Schedule {
}
public int GetFrom() {
return this.From;
return From;
}
public int GetNextFrom() {
return this.nextFrom;
return nextFrom;
}
public int GetNextUntil() {
return this.nextUntil;
return nextUntil;
}
public boolean isNextDay() {
return this.nextDay;
return nextDay;
}
public void setUntil(int Until) {
@ -134,7 +134,7 @@ public class Schedule {
}
public int GetUntil() {
return this.Until;
return Until;
}
public void setJobs(List<String> JobsNameList) {
@ -158,7 +158,7 @@ public class Schedule {
}
public List<Job> GetJobs() {
return this.JobsList;
return JobsList;
}
public void setDays(List<String> Days) {
@ -169,7 +169,7 @@ public class Schedule {
}
public List<String> GetDays() {
return this.Days;
return Days;
}
public void setMessageOnStart(List<String> msg, String From, String Until) {
@ -181,7 +181,7 @@ public class Schedule {
}
public List<String> GetMessageOnStart() {
return this.MessageOnStart;
return MessageOnStart;
}
public void setMessageOnStop(List<String> msg, String From, String Until) {
@ -193,7 +193,7 @@ public class Schedule {
}
public List<String> GetMessageOnStop() {
return this.MessageOnStop;
return MessageOnStop;
}
public void setMessageToBroadcast(List<String> msg, String From, String Until) {
@ -205,15 +205,15 @@ public class Schedule {
}
public List<String> GetMessageToBroadcast() {
return this.MessageToBroadcast;
return MessageToBroadcast;
}
public void setBroadcastInterval(int From) {
this.broadcastInterval = From;
public void setBroadcastInterval(int broadcastInterval) {
this.broadcastInterval = broadcastInterval;
}
public int GetBroadcastInterval() {
return this.broadcastInterval;
return broadcastInterval;
}
}

View File

@ -40,7 +40,7 @@ public class ShopItem {
}
public int getPage() {
return this.page;
return page;
}
public void setSlot(Integer slot) {
@ -48,7 +48,7 @@ public class ShopItem {
}
public int getSlot() {
return this.slot;
return slot;
}
public void setitems(List<JobItems> items) {
@ -56,7 +56,7 @@ public class ShopItem {
}
public List<JobItems> getitems() {
return this.items;
return items;
}
public void setCommands(List<String> Commands) {
@ -64,7 +64,7 @@ public class ShopItem {
}
public List<String> getCommands() {
return this.Commands;
return Commands;
}
public void setRequiredJobs(HashMap<String, Integer> RequiredJobs) {
@ -72,7 +72,7 @@ public class ShopItem {
}
public HashMap<String, Integer> getRequiredJobs() {
return this.RequiredJobs;
return RequiredJobs;
}
public void setRequiredPerm(List<String> RequiredPerm) {
@ -80,7 +80,7 @@ public class ShopItem {
}
public List<String> getRequiredPerm() {
return this.RequiredPerm;
return RequiredPerm;
}
public void setHideWithoutPerm(boolean HideWithoutPerm) {
@ -88,7 +88,7 @@ public class ShopItem {
}
public boolean isHideWithoutPerm() {
return this.HideWithoutPerm;
return HideWithoutPerm;
}
public void setIconLore(List<String> IconLore) {
@ -96,19 +96,19 @@ public class ShopItem {
}
public List<String> getIconLore() {
return this.IconLore;
return IconLore;
}
public String getNodeName() {
return this.NodeName;
return NodeName;
}
public int getIconId() {
return this.IconId;
return IconId;
}
public int getIconData() {
return this.IconData;
return IconData;
}
public void setIconData(int IconData) {
@ -116,7 +116,7 @@ public class ShopItem {
}
public double getPrice() {
return this.price;
return price;
}
public void setIconAmount(int IconAmount) {
@ -124,7 +124,7 @@ public class ShopItem {
}
public int getIconAmount() {
return this.IconAmount;
return IconAmount;
}
public void setIconName(String IconName) {
@ -132,14 +132,14 @@ public class ShopItem {
}
public String getIconName() {
return this.IconName;
return IconName;
}
public int getRequiredTotalLevels() {
return RequiredTotalLevels;
}
public void setRequiredTotalLevels(int requiredTotalLevels) {
RequiredTotalLevels = requiredTotalLevels;
public void setRequiredTotalLevels(int RequiredTotalLevels) {
this.RequiredTotalLevels = RequiredTotalLevels;
}
}

View File

@ -52,7 +52,7 @@ public class Title {
* Function to return the long name of the title
* @return the long name of the title
*/
public String getName(){
public String getName() {
return name;
}
@ -60,7 +60,7 @@ public class Title {
* Function to return the job name of the title
* @return the job name of the title
*/
public String getJobName(){
public String getJobName() {
return jobName;
}
@ -68,7 +68,7 @@ public class Title {
* Function to get the ChatColor of the title
* @return the chat colour o the title
*/
public ChatColor getChatColor(){
public ChatColor getChatColor() {
return color;
}
@ -76,7 +76,7 @@ public class Title {
* Function to get the levelRequirement of the title
* @return the level requirement for the title
*/
public int getLevelReq(){
public int getLevelReq() {
return levelReq;
}
@ -84,7 +84,7 @@ public class Title {
* Function to get the short name of the title
* @return the short name of the title
*/
public String getShortName(){
public String getShortName() {
return shortName;
}
}

View File

@ -12,14 +12,14 @@ public final class TopList {
}
public String getPlayerName() {
return this.info.getName();
return info.getName();
}
public int getLevel() {
return this.level;
return level;
}
public int getExp() {
return this.exp;
return exp;
}
}

View File

@ -53,8 +53,8 @@ public class BufferedPayment {
this.amount = amount;
}
public void setPoints(double amount) {
this.points = amount;
public void setPoints(double points) {
this.points = points;
}
public void setExp(double exp) {

View File

@ -9,8 +9,8 @@ public class IConomy6Adapter implements Economy {
iConomy icon;
public IConomy6Adapter(iConomy iconomy) {
icon = iconomy;
public IConomy6Adapter(iConomy icon) {
this.icon = icon;
}
public double getBalance(String playerName) {

View File

@ -7,9 +7,9 @@ import com.gamingmesh.jobs.container.CurrencyType;
public class PaymentData {
Long lastAnnouced = 0L;
HashMap<CurrencyType, Double> payments = new HashMap<>();
HashMap<CurrencyType, Long> paymentsTimes = new HashMap<>();
private Long lastAnnouced = 0L;
private HashMap<CurrencyType, Double> payments = new HashMap<>();
private HashMap<CurrencyType, Long> paymentsTimes = new HashMap<>();
private boolean Informed = false;
private boolean Reseted = false;
@ -39,12 +39,12 @@ public class PaymentData {
return paymentsTimes.get(type);
}
public void setReseted(boolean state) {
this.Reseted = state;
public void setReseted(boolean Reseted) {
this.Reseted = Reseted;
}
public boolean isReseted() {
return this.Reseted;
return Reseted;
}
public Double GetAmount(CurrencyType type) {
@ -60,7 +60,7 @@ public class PaymentData {
}
public Long GetLastAnnounced() {
return this.lastAnnouced;
return lastAnnouced;
}
public boolean IsAnnounceTime(int t) {
@ -136,7 +136,7 @@ public class PaymentData {
return Informed;
}
public void setInformed(boolean informed) {
Informed = informed;
public void setInformed(boolean Informed) {
this.Informed = Informed;
}
}

View File

@ -7,7 +7,7 @@ import com.gamingmesh.jobs.container.PlayerPoints;
public class PointsData {
HashMap<UUID, PlayerPoints> Pointbase = new HashMap<>();
private HashMap<UUID, PlayerPoints> Pointbase = new HashMap<>();
public PointsData() {
}

View File

@ -26,7 +26,6 @@ import java.util.regex.Pattern;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import com.gamingmesh.jobs.Jobs;
@ -69,9 +68,8 @@ public class Language {
else
msg = customlocale.contains(key) == true ? Colors(customlocale.getString(key)) : missing;
} catch (Exception e) {
String message = Colors("&e[Jobs] &2Cant read language file. Plugin will be disabled.");
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
console.sendMessage(message);
Bukkit.getServer().getConsoleSender().sendMessage(Colors("&e[Jobs] &2Can't read language file. Plugin will be disabled."));
Bukkit.getServer().getPluginManager().disablePlugin(plugin);
throw e;
}
if (variables.length > 0)
@ -131,7 +129,7 @@ public class Language {
return temp;
}
public String Colors(String text) {
private String Colors(String text) {
return ChatColor.translateAlternateColorCodes('&', text);
}
@ -141,7 +139,7 @@ public class Language {
* @return the message
*/
public String getDefaultMessage(String key) {
return enlocale.contains(key) == true ? Colors(enlocale.getString(key)) : "Cant find locale";
return enlocale.contains(key) == true ? Colors(enlocale.getString(key)) : "Can't find locale";
}
/**

View File

@ -449,7 +449,7 @@ public class JobsListener implements Listener {
Player player = event.getPlayer();
if (!event.getPlayer().hasPermission("jobs.command.signs")) {
if (!player.hasPermission("jobs.command.signs")) {
event.setCancelled(true);
player.sendMessage(Jobs.getLanguage().getMessage("signs.cantcreate"));
return;
@ -565,8 +565,7 @@ public class JobsListener implements Listener {
return;
if (!Jobs.getGCManager().getModifyChat())
return;
Player player = event.getPlayer();
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(event.getPlayer());
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
@ -585,8 +584,7 @@ public class JobsListener implements Listener {
return;
if (Jobs.getGCManager().getModifyChat())
return;
Player player = event.getPlayer();
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(event.getPlayer());
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
if (honorific.equalsIgnoreCase(" "))
honorific = "";
@ -604,8 +602,7 @@ public class JobsListener implements Listener {
return;
if (Jobs.getGCManager().getModifyChat())
return;
Player player = event.getPlayer();
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(event.getPlayer());
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
if (honorific.equalsIgnoreCase(" "))
honorific = "";

View File

@ -13,11 +13,7 @@ import com.gamingmesh.jobs.Jobs;
public class PistonProtectionListener implements Listener {
@SuppressWarnings("unused")
private Jobs plugin;
public PistonProtectionListener(Jobs plugin) {
this.plugin = plugin;
public PistonProtectionListener() {
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)

View File

@ -126,6 +126,9 @@ public class FurnaceBrewingHandling {
}
public static void save() {
// No file saving when the boolean is false
if (!Jobs.getGCManager().isFurnacesReassign() || !Jobs.getGCManager().isBrewingStandsReassign())
return;
YmlMaker f = new YmlMaker(Jobs.getInstance(), "furnaceBrewingStands.yml");