mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-04 23:37:49 +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:
parent
0172b780de
commit
1e8940124f
34
pom.xml
34
pom.xml
@ -16,7 +16,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.13-R0.1-SNAPSHOT</version>
|
<version>1.13.1-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- iConomy7 -->
|
<!-- iConomy7 -->
|
||||||
@ -31,9 +31,9 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.Keyle.MyPet</groupId>
|
<groupId>de.Keyle.MyPet</groupId>
|
||||||
<artifactId>MyPet</artifactId>
|
<artifactId>MyPet</artifactId>
|
||||||
<version>2.3.0-SNAPSHOT</version>
|
<version>3.0-SNAPSHOT</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${basedir}/libs/MyPet-2.3.0-SNAPSHOT.jar</systemPath>
|
<systemPath>${basedir}/libs/MyPet-3.0-SNAPSHOT.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- McMMO -->
|
<!-- McMMO -->
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -60,6 +60,23 @@
|
|||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</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 -->
|
<!-- MythicMobs -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.elseland.xikage</groupId>
|
<groupId>net.elseland.xikage</groupId>
|
||||||
@ -82,6 +99,12 @@
|
|||||||
<artifactId>worldguard</artifactId>
|
<artifactId>worldguard</artifactId>
|
||||||
<version>6.1</version>
|
<version>6.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- WorldEdit -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sk89q</groupId>
|
||||||
|
<artifactId>worldedit</artifactId>
|
||||||
|
<version>7.0.0-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<repositories>
|
<repositories>
|
||||||
<!-- WorldGuard -->
|
<!-- WorldGuard -->
|
||||||
@ -89,6 +112,11 @@
|
|||||||
<id>sk89q-repo</id>
|
<id>sk89q-repo</id>
|
||||||
<url>http://maven.sk89q.com/repo/</url>
|
<url>http://maven.sk89q.com/repo/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<!-- WorldEdit -->
|
||||||
|
<repository>
|
||||||
|
<id>sk89q-repo</id>
|
||||||
|
<url>http://maven.sk89q.com/repo/</url>
|
||||||
|
</repository>
|
||||||
<!-- Spigot -->
|
<!-- Spigot -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>spigot-repo</id>
|
<id>spigot-repo</id>
|
||||||
|
@ -422,8 +422,8 @@ public class CMIEffectManager {
|
|||||||
return EnumParticle;
|
return EnumParticle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnumParticle(Object enumParticle) {
|
public void setEnumParticle(Object EnumParticle) {
|
||||||
EnumParticle = enumParticle;
|
this.EnumParticle = EnumParticle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getExtra() {
|
public int[] getExtra() {
|
||||||
|
@ -14,8 +14,11 @@ import org.bukkit.enchantments.Enchantment;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.inventory.meta.PotionMeta;
|
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.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.potion.PotionType;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
|
import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
|
||||||
@ -80,7 +83,7 @@ public class CMIItemStack {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public short getMaxDurability() {
|
public short getMaxDurability() {
|
||||||
return this.material.getMaxDurability();
|
return material.getMaxDurability();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(short data) {
|
public void setData(short data) {
|
||||||
@ -179,7 +182,7 @@ public class CMIItemStack {
|
|||||||
|
|
||||||
public String getRealName() {
|
public String getRealName() {
|
||||||
|
|
||||||
return this.material.getName();
|
return material.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getBukkitName() {
|
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")) {
|
if (item.getType() == Material.POTION || item.getType().name().contains("SPLASH_POTION") || item.getType().name().contains("TIPPED_ARROW")) {
|
||||||
PotionMeta potion = (PotionMeta) item.getItemMeta();
|
PotionMeta meta = (PotionMeta) item.getItemMeta();
|
||||||
try {
|
if (item.getItemMeta() instanceof PotionMeta) {
|
||||||
if (potion != null && potion.getBasePotionData() != null && potion.getBasePotionData().getType() != null && potion.getBasePotionData().getType().getEffectType() != null) {
|
PotionMeta potionMeta = (PotionMeta) meta;
|
||||||
data = (short) potion.getBasePotionData().getType().getEffectType().getId();
|
try {
|
||||||
}
|
if (potionMeta != null && potionMeta.getBasePotionData() != null && potionMeta.getBasePotionData() != null && potionMeta.getBasePotionData().getType().getEffectType() != null) {
|
||||||
} catch (NoSuchMethodError e) {
|
data = (short) potionMeta.getBasePotionData().getType().getEffectType().getId();
|
||||||
}
|
}
|
||||||
|
} catch (NoSuchMethodError e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
|
@ -1132,8 +1132,8 @@ public class ItemManager {
|
|||||||
NAME_TAG(421, 0, 30731, "Name Tag", ""),
|
NAME_TAG(421, 0, 30731, "Name Tag", ""),
|
||||||
NAUTILUS_SHELL(-1, -1, 19989, "Nautilus Shell", ""),
|
NAUTILUS_SHELL(-1, -1, 19989, "Nautilus Shell", ""),
|
||||||
NETHERRACK(87, 0, 23425, "Netherrack", "NETHERRACK"),
|
NETHERRACK(87, 0, 23425, "Netherrack", "NETHERRACK"),
|
||||||
NETHER_BRICK(405, 0, 19996, "Nether Brick"),
|
NETHER_BRICK(405, 0, 19996, "Nether Brick", ""),
|
||||||
NETHER_BRICKS(112, 0, 27802, "Nether Bricks"),
|
NETHER_BRICKS(112, 0, 27802, "Nether Bricks", ""),
|
||||||
NETHER_BRICK_FENCE(113, 0, 5286, "Nether Brick Fence", "NETHER_FENCE"),
|
NETHER_BRICK_FENCE(113, 0, 5286, "Nether Brick Fence", "NETHER_FENCE"),
|
||||||
NETHER_BRICK_SLAB(44, 6, 26586, "Nether Brick Slab", ""),
|
NETHER_BRICK_SLAB(44, 6, 26586, "Nether Brick Slab", ""),
|
||||||
NETHER_BRICK_STAIRS(114, 0, 12085, "Nether Brick Stairs", "NETHER_BRICK_STAIRS"),
|
NETHER_BRICK_STAIRS(114, 0, 12085, "Nether Brick Stairs", "NETHER_BRICK_STAIRS"),
|
||||||
@ -1556,7 +1556,7 @@ public class ItemManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getLegacyId() {
|
public int getLegacyId() {
|
||||||
return this.legacyId;
|
return legacyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
@ -7,17 +7,17 @@ import com.gamingmesh.jobs.container.Job;
|
|||||||
|
|
||||||
public class GuiInfoList {
|
public class GuiInfoList {
|
||||||
|
|
||||||
String name;
|
private String name;
|
||||||
List<Job> jobList = new ArrayList<>();
|
private List<Job> jobList = new ArrayList<>();
|
||||||
Boolean jobInfo = false;
|
private Boolean jobInfo = false;
|
||||||
int backButton = 27;
|
private int backButton = 27;
|
||||||
|
|
||||||
public GuiInfoList(String name) {
|
public GuiInfoList(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getbackButton() {
|
public int getbackButton() {
|
||||||
return this.backButton;
|
return backButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setbackButton(int backButton) {
|
public void setbackButton(int backButton) {
|
||||||
@ -25,11 +25,11 @@ public class GuiInfoList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Job> getJobList() {
|
public List<Job> getJobList() {
|
||||||
return this.jobList;
|
return jobList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setJobList(List<Job> jobList) {
|
public void setJobList(List<Job> jobList) {
|
||||||
@ -41,6 +41,6 @@ public class GuiInfoList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Boolean isJobInfo() {
|
public Boolean isJobInfo() {
|
||||||
return this.jobInfo;
|
return jobInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,10 @@ public class GuiManager {
|
|||||||
|
|
||||||
public HashMap<UUID, GuiInfoList> GuiList = new HashMap<>();
|
public HashMap<UUID, GuiInfoList> GuiList = new HashMap<>();
|
||||||
|
|
||||||
public void CloseInventories() {
|
public GuiManager() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void CloseInventories() {
|
||||||
for (Entry<UUID, GuiInfoList> one : GuiList.entrySet()) {
|
for (Entry<UUID, GuiInfoList> one : GuiList.entrySet()) {
|
||||||
Player player = Bukkit.getPlayer(one.getKey());
|
Player player = Bukkit.getPlayer(one.getKey());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
|
@ -119,9 +119,9 @@ public class Jobs extends JavaPlugin {
|
|||||||
private static TitleManager titleManager = null;
|
private static TitleManager titleManager = null;
|
||||||
private static RestrictedBlockManager RBManager = null;
|
private static RestrictedBlockManager RBManager = null;
|
||||||
private static RestrictedAreaManager RAManager = null;
|
private static RestrictedAreaManager RAManager = null;
|
||||||
private static BossBarManager BBManager;
|
private static BossBarManager BBManager = null;
|
||||||
private static ShopManager shopManager;
|
private static ShopManager shopManager = null;
|
||||||
private static Loging loging;
|
private static Loging loging = null;
|
||||||
private static BlockProtectionManager BpManager = null;
|
private static BlockProtectionManager BpManager = null;
|
||||||
|
|
||||||
private static JobsManager DBManager = null;
|
private static JobsManager DBManager = null;
|
||||||
@ -129,18 +129,18 @@ public class Jobs extends JavaPlugin {
|
|||||||
private static PistonProtectionListener PistonProtectionListener = null;
|
private static PistonProtectionListener PistonProtectionListener = null;
|
||||||
private static McMMOlistener McMMOlistener = null;
|
private static McMMOlistener McMMOlistener = null;
|
||||||
|
|
||||||
private static MythicMobInterface MythicManager;
|
private static MythicMobInterface MythicManager = null;
|
||||||
private static MyPetManager myPetManager;
|
private static MyPetManager myPetManager = null;
|
||||||
private static WorldGuardManager worldGuardManager;
|
private static WorldGuardManager worldGuardManager = null;
|
||||||
|
|
||||||
private static ConfigManager configManager;
|
private static ConfigManager configManager = null;
|
||||||
private static GeneralConfigManager GconfigManager;
|
private static GeneralConfigManager GconfigManager = null;
|
||||||
|
|
||||||
private static Reflections reflections;
|
private static Reflections reflections = null;
|
||||||
|
|
||||||
private static Logger pLogger;
|
private static Logger pLogger = null;
|
||||||
private static File dataFolder;
|
private static File dataFolder = null;
|
||||||
private static JobsClassLoader classLoader;
|
private static JobsClassLoader classLoader = null;
|
||||||
private static JobsDAO dao = null;
|
private static JobsDAO dao = null;
|
||||||
private static List<Job> jobs = null;
|
private static List<Job> jobs = null;
|
||||||
private static Job noneJob = null;
|
private static Job noneJob = null;
|
||||||
@ -159,14 +159,14 @@ public class Jobs extends JavaPlugin {
|
|||||||
|
|
||||||
public static HashMap<String, FastPayment> FastPayment = new HashMap<>();
|
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;
|
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() {
|
public void setMcMMOlistener() {
|
||||||
McMMOlistener = new McMMOlistener(this);
|
McMMOlistener = new McMMOlistener(this);
|
||||||
@ -177,7 +177,7 @@ public class Jobs extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setPistonProtectionListener() {
|
public void setPistonProtectionListener() {
|
||||||
PistonProtectionListener = new PistonProtectionListener(this);
|
PistonProtectionListener = new PistonProtectionListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PistonProtectionListener getPistonProtectionListener() {
|
public static PistonProtectionListener getPistonProtectionListener() {
|
||||||
@ -285,8 +285,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
return actionbar;
|
return actionbar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setNms(NMS newNms) {
|
public static void setNms(NMS nms) {
|
||||||
nms = newNms;
|
Jobs.nms = nms;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NMS getNms() {
|
public static NMS getNms() {
|
||||||
@ -302,7 +302,7 @@ public class Jobs extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayerManager() {
|
public void setPlayerManager() {
|
||||||
pManager = new PlayerManager(this);
|
pManager = new PlayerManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void setRestrictedBlockManager(Jobs plugin) {
|
public static void setRestrictedBlockManager(Jobs plugin) {
|
||||||
@ -440,8 +440,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
/**
|
/**
|
||||||
* Sets the plugin logger
|
* Sets the plugin logger
|
||||||
*/
|
*/
|
||||||
public void setPluginLogger(Logger logger) {
|
public void setPluginLogger(Logger pLogger) {
|
||||||
pLogger = logger;
|
Jobs.pLogger = pLogger;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -456,8 +456,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
* Sets the data folder
|
* Sets the data folder
|
||||||
* @param dir - the data folder
|
* @param dir - the data folder
|
||||||
*/
|
*/
|
||||||
public void setDataFolder(File dir) {
|
public void setDataFolder(File dataFolder) {
|
||||||
dataFolder = dir;
|
Jobs.dataFolder = dataFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -472,8 +472,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
* Sets the Data Access Object
|
* Sets the Data Access Object
|
||||||
* @param dao - the DAO
|
* @param dao - the DAO
|
||||||
*/
|
*/
|
||||||
public static void setDAO(JobsDAO value) {
|
public static void setDAO(JobsDAO dao) {
|
||||||
dao = value;
|
Jobs.dao = dao;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -488,8 +488,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
* Sets the list of jobs
|
* Sets the list of jobs
|
||||||
* @param jobs - list of jobs
|
* @param jobs - list of jobs
|
||||||
*/
|
*/
|
||||||
public static void setJobs(List<Job> list) {
|
public static void setJobs(List<Job> jobs) {
|
||||||
jobs = list;
|
Jobs.jobs = jobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -504,8 +504,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
* Sets the none job
|
* Sets the none job
|
||||||
* @param noneJob - the none job
|
* @param noneJob - the none job
|
||||||
*/
|
*/
|
||||||
public static void setNoneJob(Job job) {
|
public static void setNoneJob(Job noneJob) {
|
||||||
noneJob = job;
|
Jobs.noneJob = noneJob;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -577,8 +577,9 @@ public class Jobs extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dao.getMap().clear();
|
dao.getMap().clear();
|
||||||
consoleMsg(ChatColor.YELLOW + "[Jobs] Preloaded " + Jobs.getPlayerManager().getPlayersCache().size() + " players data in " + ((int) (((System.currentTimeMillis() - time)
|
if (Jobs.getPlayerManager().getPlayersCache().size() != 0)
|
||||||
/ 1000d) * 100) / 100D));
|
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());
|
setNms((NMS) nmsClass.getConstructor().newInstance());
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Something went wrong, please note down version and contact author v:" + version);
|
System.out.println("Something went wrong, please note down version and contact author v:" + version);
|
||||||
|
running = false;
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
|
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException | NoSuchMethodException
|
||||||
| SecurityException e) {
|
| SecurityException e) {
|
||||||
System.out.println("Your server version is not compatible with this plugins version! Plugin will be disabled: " + version);
|
System.out.println("Your server version is not compatible with this plugins version! Plugin will be disabled: " + version);
|
||||||
|
running = false;
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
return;
|
return;
|
||||||
@ -783,7 +786,7 @@ public class Jobs extends JavaPlugin {
|
|||||||
jobConfig.saveDefaultConfig();
|
jobConfig.saveDefaultConfig();
|
||||||
|
|
||||||
YmlMaker jobSigns = new YmlMaker(this, "Signs.yml");
|
YmlMaker jobSigns = new YmlMaker(this, "Signs.yml");
|
||||||
jobSigns.saveDefaultConfig();
|
jobSigns.saveDefaultConfig();
|
||||||
|
|
||||||
YmlMaker jobSchedule = new YmlMaker(this, "schedule.yml");
|
YmlMaker jobSchedule = new YmlMaker(this, "schedule.yml");
|
||||||
jobSchedule.saveDefaultConfig();
|
jobSchedule.saveDefaultConfig();
|
||||||
@ -816,22 +819,19 @@ public class Jobs extends JavaPlugin {
|
|||||||
getServer().getPluginManager().registerEvents(new JobsPaymentListener(this), this);
|
getServer().getPluginManager().registerEvents(new JobsPaymentListener(this), this);
|
||||||
|
|
||||||
setMcMMOlistener();
|
setMcMMOlistener();
|
||||||
if (McMMOlistener.CheckmcMMO()) {
|
if (McMMOlistener.CheckmcMMO())
|
||||||
getServer().getPluginManager().registerEvents(McMMOlistener, this);
|
getServer().getPluginManager().registerEvents(McMMOlistener, this);
|
||||||
}
|
|
||||||
|
|
||||||
setMyPetManager();
|
setMyPetManager();
|
||||||
setWorldGuard();
|
setWorldGuard();
|
||||||
|
|
||||||
setMythicManager();
|
setMythicManager();
|
||||||
if (MythicManager != null && MythicManager.Check() && GconfigManager.MythicMobsEnabled) {
|
if (MythicManager != null && MythicManager.Check() && GconfigManager.MythicMobsEnabled)
|
||||||
MythicManager.registerListener();
|
MythicManager.registerListener();
|
||||||
}
|
|
||||||
|
|
||||||
setPistonProtectionListener();
|
setPistonProtectionListener();
|
||||||
if (GconfigManager.useBlockProtection) {
|
if (GconfigManager.useBlockProtection)
|
||||||
getServer().getPluginManager().registerEvents(PistonProtectionListener, this);
|
getServer().getPluginManager().registerEvents(PistonProtectionListener, this);
|
||||||
}
|
|
||||||
|
|
||||||
// register economy
|
// register economy
|
||||||
Bukkit.getScheduler().runTask(this, new HookEconomyTask(this));
|
Bukkit.getScheduler().runTask(this, new HookEconomyTask(this));
|
||||||
@ -849,14 +849,16 @@ public class Jobs extends JavaPlugin {
|
|||||||
cManager.fillCommands();
|
cManager.fillCommands();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
System.out.println("There was some issues when starting plugin. Please contact dev about this. Plugin will be disabled.");
|
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
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
running = false;
|
|
||||||
GUIManager.CloseInventories();
|
GUIManager.CloseInventories();
|
||||||
shopManager.CloseInventories();
|
shopManager.CloseInventories();
|
||||||
dao.saveExplore();
|
dao.saveExplore();
|
||||||
@ -866,6 +868,7 @@ public class Jobs extends JavaPlugin {
|
|||||||
|
|
||||||
Jobs.shutdown();
|
Jobs.shutdown();
|
||||||
consoleMsg("&e[Jobs] &2Plugin has been disabled succesfully.");
|
consoleMsg("&e[Jobs] &2Plugin has been disabled succesfully.");
|
||||||
|
running = false;
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -879,9 +882,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
if (!job.getQuests().isEmpty()) {
|
if (!job.getQuests().isEmpty()) {
|
||||||
List<QuestProgression> q = jPlayer.getQuestProgressions(job, info.getType());
|
List<QuestProgression> q = jPlayer.getQuestProgressions(job, info.getType());
|
||||||
for (QuestProgression one : q) {
|
for (QuestProgression one : q) {
|
||||||
if (one != null) {
|
if (one != null)
|
||||||
one.processQuest(jPlayer, info);
|
one.processQuest(jPlayer, info);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -948,9 +950,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
income = income + (income * boost.getFinal(CurrencyType.MONEY));
|
income = income + (income * boost.getFinal(CurrencyType.MONEY));
|
||||||
if (GconfigManager.useMinimumOveralPayment && income > 0) {
|
if (GconfigManager.useMinimumOveralPayment && income > 0) {
|
||||||
double maxLimit = income * GconfigManager.MinimumOveralPaymentLimit;
|
double maxLimit = income * GconfigManager.MinimumOveralPaymentLimit;
|
||||||
if (income < maxLimit) {
|
if (income < maxLimit)
|
||||||
income = maxLimit;
|
income = maxLimit;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -960,9 +961,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
pointAmount = pointAmount + (pointAmount * boost.getFinal(CurrencyType.POINTS));
|
pointAmount = pointAmount + (pointAmount * boost.getFinal(CurrencyType.POINTS));
|
||||||
if (GconfigManager.useMinimumOveralPoints && pointAmount > 0) {
|
if (GconfigManager.useMinimumOveralPoints && pointAmount > 0) {
|
||||||
double maxLimit = pointAmount * GconfigManager.MinimumOveralPaymentLimit;
|
double maxLimit = pointAmount * GconfigManager.MinimumOveralPaymentLimit;
|
||||||
if (pointAmount < maxLimit) {
|
if (pointAmount < maxLimit)
|
||||||
pointAmount = maxLimit;
|
pointAmount = maxLimit;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1025,11 +1025,10 @@ public class Jobs extends JavaPlugin {
|
|||||||
int expInt = expAmount.intValue();
|
int expInt = expAmount.intValue();
|
||||||
double remainder = expAmount.doubleValue() - expInt;
|
double remainder = expAmount.doubleValue() - expInt;
|
||||||
if (Math.abs(remainder) > Math.random()) {
|
if (Math.abs(remainder) > Math.random()) {
|
||||||
if (expAmount.doubleValue() < 0) {
|
if (expAmount.doubleValue() < 0)
|
||||||
expInt--;
|
expInt--;
|
||||||
} else {
|
else
|
||||||
expInt++;
|
expInt++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expInt < 0 && getPlayerExperience(player) < -expInt) {
|
if (expInt < 0 && getPlayerExperience(player) < -expInt) {
|
||||||
@ -1047,9 +1046,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
income = boost.getFinalAmount(CurrencyType.MONEY, income);
|
income = boost.getFinalAmount(CurrencyType.MONEY, income);
|
||||||
if (GconfigManager.useMinimumOveralPayment && income > 0) {
|
if (GconfigManager.useMinimumOveralPayment && income > 0) {
|
||||||
double maxLimit = income * GconfigManager.MinimumOveralPaymentLimit;
|
double maxLimit = income * GconfigManager.MinimumOveralPaymentLimit;
|
||||||
if (income < maxLimit) {
|
if (income < maxLimit)
|
||||||
income = maxLimit;
|
income = maxLimit;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1058,9 +1056,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
pointAmount = boost.getFinalAmount(CurrencyType.POINTS, pointAmount);
|
pointAmount = boost.getFinalAmount(CurrencyType.POINTS, pointAmount);
|
||||||
if (GconfigManager.useMinimumOveralPoints && pointAmount > 0) {
|
if (GconfigManager.useMinimumOveralPoints && pointAmount > 0) {
|
||||||
double maxLimit = pointAmount * GconfigManager.MinimumOveralPaymentLimit;
|
double maxLimit = pointAmount * GconfigManager.MinimumOveralPaymentLimit;
|
||||||
if (pointAmount < maxLimit) {
|
if (pointAmount < maxLimit)
|
||||||
pointAmount = maxLimit;
|
pointAmount = maxLimit;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1069,9 +1066,8 @@ public class Jobs extends JavaPlugin {
|
|||||||
|
|
||||||
if (GconfigManager.useMinimumOveralPayment && expAmount > 0) {
|
if (GconfigManager.useMinimumOveralPayment && expAmount > 0) {
|
||||||
double maxLimit = expAmount * GconfigManager.MinimumOveralPaymentLimit;
|
double maxLimit = expAmount * GconfigManager.MinimumOveralPaymentLimit;
|
||||||
if (expAmount < maxLimit) {
|
if (expAmount < maxLimit)
|
||||||
expAmount = maxLimit;
|
expAmount = maxLimit;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!jPlayer.isUnderLimit(CurrencyType.MONEY, income)) {
|
if (!jPlayer.isUnderLimit(CurrencyType.MONEY, income)) {
|
||||||
@ -1103,10 +1099,10 @@ public class Jobs extends JavaPlugin {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (expAmount != 0D && GconfigManager.BossBarEnabled)
|
if (expAmount != 0D && GconfigManager.BossBarEnabled)
|
||||||
if (GconfigManager.BossBarShowOnEachAction) {
|
if (GconfigManager.BossBarShowOnEachAction)
|
||||||
Jobs.getBBManager().ShowJobProgression(jPlayer, prog);
|
Jobs.getBBManager().ShowJobProgression(jPlayer, prog);
|
||||||
} else
|
else
|
||||||
jPlayer.getUpdateBossBarFor().add(prog.getJob().getName());
|
jPlayer.getUpdateBossBarFor().add(prog.getJob().getName());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Bukkit.getConsoleSender().sendMessage("[Jobs] Some issues with boss bar feature accured, try disabling it to avoid it.");
|
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;
|
return false;
|
||||||
} else
|
} else
|
||||||
getBpManager().add(block, cd);
|
getBpManager().add(block, cd);
|
||||||
} else {
|
} else
|
||||||
getBpManager().add(block, getBpManager().getBlockDelayTime(block));
|
getBpManager().add(block, getBpManager().getBlockDelayTime(block));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1226,41 +1221,37 @@ public class Jobs extends JavaPlugin {
|
|||||||
// total xp calculation based by lvl
|
// total xp calculation based by lvl
|
||||||
private static int ExpToLevel(int level) {
|
private static int ExpToLevel(int level) {
|
||||||
if (version.equals("1_7")) {
|
if (version.equals("1_7")) {
|
||||||
if (level <= 16) {
|
if (level <= 16)
|
||||||
return 17 * level;
|
return 17 * level;
|
||||||
} else if (level <= 31) {
|
else if (level <= 31)
|
||||||
return ((3 * level * level) / 2) - ((59 * level) / 2) + 360;
|
return ((3 * level * level) / 2) - ((59 * level) / 2) + 360;
|
||||||
} else {
|
else
|
||||||
return ((7 * level * level) / 2) - ((303 * level) / 2) + 2220;
|
return ((7 * level * level) / 2) - ((303 * level) / 2) + 2220;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (level <= 16) {
|
if (level <= 16)
|
||||||
return (level * level) + (6 * level);
|
return (level * level) + (6 * level);
|
||||||
} else if (level <= 31) {
|
else if (level <= 31)
|
||||||
return (int) ((2.5 * level * level) - (40.5 * level) + 360);
|
return (int) ((2.5 * level * level) - (40.5 * level) + 360);
|
||||||
} else {
|
else
|
||||||
return (int) ((4.5 * level * level) - (162.5 * level) + 2220);
|
return (int) ((4.5 * level * level) - (162.5 * level) + 2220);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// xp calculation for one current lvl
|
// xp calculation for one current lvl
|
||||||
private static int deltaLevelToExp(int level) {
|
private static int deltaLevelToExp(int level) {
|
||||||
if (version.equals("1_7")) {
|
if (version.equals("1_7")) {
|
||||||
if (level <= 16) {
|
if (level <= 16)
|
||||||
return 17;
|
return 17;
|
||||||
} else if (level <= 31) {
|
else if (level <= 31)
|
||||||
return 3 * level - 31;
|
return 3 * level - 31;
|
||||||
} else {
|
else
|
||||||
return 7 * level - 155;
|
return 7 * level - 155;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (level <= 16) {
|
if (level <= 16)
|
||||||
return 2 * level + 7;
|
return 2 * level + 7;
|
||||||
} else if (level <= 31) {
|
else if (level <= 31)
|
||||||
return 5 * level - 38;
|
return 5 * level - 38;
|
||||||
} else {
|
else
|
||||||
return 9 * level - 158;
|
return 9 * level - 158;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void perform(JobsPlayer jPlayer, ActionInfo info, BufferedPayment payment, Job job) {
|
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) {
|
public static void sendMessage(Object sender, String msg) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player)
|
||||||
((Player) sender).sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
|
((Player) sender).sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
|
||||||
} else
|
else
|
||||||
((CommandSender) sender).sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
|
((CommandSender) sender).sendMessage(ChatColor.translateAlternateColorCodes('&', msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ import com.gamingmesh.jobs.container.JobsPlayer;
|
|||||||
|
|
||||||
public class PermissionManager {
|
public class PermissionManager {
|
||||||
|
|
||||||
HashMap<String, Integer> permDelay = new HashMap<>();
|
private HashMap<String, Integer> permDelay = new HashMap<>();
|
||||||
|
|
||||||
private enum prm {
|
private enum prm {
|
||||||
// jobs_join_JOBNAME(remade("jobs.join.%JOBNAME%"), 60 * 1000),
|
// jobs_join_JOBNAME(remade("jobs.join.%JOBNAME%"), 60 * 1000),
|
||||||
|
@ -74,14 +74,12 @@ public class PlayerManager {
|
|||||||
private HashMap<UUID, PlayerInfo> PlayerUUIDMap = new HashMap<>();
|
private HashMap<UUID, PlayerInfo> PlayerUUIDMap = new HashMap<>();
|
||||||
private HashMap<Integer, PlayerInfo> PlayerIDMap = new HashMap<>();
|
private HashMap<Integer, PlayerInfo> PlayerIDMap = new HashMap<>();
|
||||||
private HashMap<String, PlayerInfo> PlayerNameMap = new HashMap<>();
|
private HashMap<String, PlayerInfo> PlayerNameMap = new HashMap<>();
|
||||||
Jobs plugin;
|
|
||||||
|
|
||||||
public PlayerManager(Jobs plugin) {
|
public PlayerManager() {
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PointsData getPointsData() {
|
public PointsData getPointsData() {
|
||||||
return this.PointsDatabase;
|
return PointsDatabase;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getMapSize() {
|
public int getMapSize() {
|
||||||
@ -131,7 +129,7 @@ public class PlayerManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ConcurrentHashMap<UUID, JobsPlayer> getPlayersCache() {
|
public ConcurrentHashMap<UUID, JobsPlayer> getPlayersCache() {
|
||||||
return this.playersUUIDCache;
|
return playersUUIDCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public ConcurrentHashMap<String, JobsPlayer> getPlayers() {
|
// public ConcurrentHashMap<String, JobsPlayer> getPlayers() {
|
||||||
@ -139,7 +137,7 @@ public class PlayerManager {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
public HashMap<UUID, PlayerInfo> getPlayersInfoUUIDMap() {
|
public HashMap<UUID, PlayerInfo> getPlayersInfoUUIDMap() {
|
||||||
return this.PlayerUUIDMap;
|
return PlayerUUIDMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getPlayerId(String name) {
|
public int getPlayerId(String name) {
|
||||||
@ -198,9 +196,8 @@ public class PlayerManager {
|
|||||||
if (Jobs.getGCManager().saveOnDisconnect()) {
|
if (Jobs.getGCManager().saveOnDisconnect()) {
|
||||||
jPlayer.onDisconnect();
|
jPlayer.onDisconnect();
|
||||||
jPlayer.save();
|
jPlayer.save();
|
||||||
} else {
|
} else
|
||||||
jPlayer.onDisconnect();
|
jPlayer.onDisconnect();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -216,16 +213,14 @@ public class PlayerManager {
|
|||||||
*/
|
*/
|
||||||
ArrayList<JobsPlayer> list = new ArrayList<>(this.players.values());
|
ArrayList<JobsPlayer> list = new ArrayList<>(this.players.values());
|
||||||
|
|
||||||
for (JobsPlayer jPlayer : list) {
|
for (JobsPlayer jPlayer : list)
|
||||||
jPlayer.save();
|
jPlayer.save();
|
||||||
}
|
|
||||||
|
|
||||||
Iterator<JobsPlayer> iter = this.players.values().iterator();
|
Iterator<JobsPlayer> iter = this.players.values().iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
JobsPlayer jPlayer = iter.next();
|
JobsPlayer jPlayer = iter.next();
|
||||||
if (!jPlayer.isOnline() && jPlayer.isSaved()) {
|
if (!jPlayer.isOnline() && jPlayer.isSaved())
|
||||||
iter.remove();
|
iter.remove();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,14 +234,13 @@ public class PlayerManager {
|
|||||||
for (Entry<UUID, JobsPlayer> one : playersUUIDCache.entrySet()) {
|
for (Entry<UUID, JobsPlayer> one : playersUUIDCache.entrySet()) {
|
||||||
JobsPlayer jPlayer = one.getValue();
|
JobsPlayer jPlayer = one.getValue();
|
||||||
if (resetID)
|
if (resetID)
|
||||||
jPlayer.setUserId(-1);
|
jPlayer.setUserId(-1);
|
||||||
JobsDAO dao = Jobs.getJobsDAO();
|
JobsDAO dao = Jobs.getJobsDAO();
|
||||||
dao.updateSeen(jPlayer);
|
dao.updateSeen(jPlayer);
|
||||||
if (jPlayer.getUserId() == -1)
|
if (jPlayer.getUserId() == -1)
|
||||||
continue;
|
continue;
|
||||||
for (JobProgression oneJ : jPlayer.getJobProgression()) {
|
for (JobProgression oneJ : jPlayer.getJobProgression())
|
||||||
dao.insertJob(jPlayer, oneJ);
|
dao.insertJob(jPlayer, oneJ);
|
||||||
}
|
|
||||||
dao.saveLog(jPlayer);
|
dao.saveLog(jPlayer);
|
||||||
dao.savePoints(jPlayer);
|
dao.savePoints(jPlayer);
|
||||||
dao.recordPlayersLimits(jPlayer);
|
dao.recordPlayersLimits(jPlayer);
|
||||||
@ -319,11 +313,10 @@ public class PlayerManager {
|
|||||||
jPlayer.reloadLimits();
|
jPlayer.reloadLimits();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (points != null) {
|
if (points != null)
|
||||||
Jobs.getPlayerManager().getPointsData().addPlayer(jPlayer.getPlayerUUID(), points);
|
Jobs.getPlayerManager().getPointsData().addPlayer(jPlayer.getPlayerUUID(), points);
|
||||||
} else {
|
else
|
||||||
Jobs.getPlayerManager().getPointsData().addPlayer(jPlayer.getPlayerUUID());
|
Jobs.getPlayerManager().getPointsData().addPlayer(jPlayer.getPlayerUUID());
|
||||||
}
|
|
||||||
|
|
||||||
if (logs != null)
|
if (logs != null)
|
||||||
jPlayer.setLog(logs);
|
jPlayer.setLog(logs);
|
||||||
@ -416,9 +409,8 @@ public class PlayerManager {
|
|||||||
public void leaveAllJobs(JobsPlayer jPlayer) {
|
public void leaveAllJobs(JobsPlayer jPlayer) {
|
||||||
List<JobProgression> jobs = new ArrayList<>();
|
List<JobProgression> jobs = new ArrayList<>();
|
||||||
jobs.addAll(jPlayer.getJobProgression());
|
jobs.addAll(jPlayer.getJobProgression());
|
||||||
for (JobProgression job : jobs) {
|
for (JobProgression job : jobs)
|
||||||
leaveJob(jPlayer, job.getJob());
|
leaveJob(jPlayer, job.getJob());
|
||||||
}
|
|
||||||
jPlayer.leaveAllJobs();
|
jPlayer.leaveAllJobs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,28 +545,27 @@ public class PlayerManager {
|
|||||||
if (sound != null && player != null && player.getLocation() != null)
|
if (sound != null && player != null && player.getLocation() != null)
|
||||||
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getSoundVolume(), levelUpEvent.getSoundPitch());
|
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getSoundVolume(), levelUpEvent.getSoundPitch());
|
||||||
else
|
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) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
String message;
|
String message;
|
||||||
if (Jobs.getGCManager().isBroadcastingLevelups()) {
|
if (Jobs.getGCManager().isBroadcastingLevelups())
|
||||||
message = Jobs.getLanguage().getMessage("message.levelup.broadcast");
|
message = Jobs.getLanguage().getMessage("message.levelup.broadcast");
|
||||||
} else {
|
else
|
||||||
message = Jobs.getLanguage().getMessage("message.levelup.nobroadcast");
|
message = Jobs.getLanguage().getMessage("message.levelup.nobroadcast");
|
||||||
}
|
|
||||||
|
|
||||||
message = message.replace("%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE);
|
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);
|
message = message.replace("%titlename%", levelUpEvent.getOldTitleColor() + levelUpEvent.getOldTitleName() + ChatColor.WHITE);
|
||||||
}
|
|
||||||
if (player != null) {
|
if (player != null)
|
||||||
message = message.replace("%playername%", player.getDisplayName());
|
message = message.replace("%playername%", player.getDisplayName());
|
||||||
} else {
|
else
|
||||||
message = message.replace("%playername%", jPlayer.getUserName());
|
message = message.replace("%playername%", jPlayer.getUserName());
|
||||||
}
|
|
||||||
message = message.replace("%joblevel%", "" + prog.getLevel());
|
message = message.replace("%joblevel%", "" + prog.getLevel());
|
||||||
for (String line : message.split("\n")) {
|
for (String line : message.split("\n")) {
|
||||||
if (Jobs.getGCManager().isBroadcastingLevelups()) {
|
if (Jobs.getGCManager().isBroadcastingLevelups()) {
|
||||||
@ -598,27 +589,27 @@ public class PlayerManager {
|
|||||||
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getTitleChangeVolume(),
|
player.getWorld().playSound(player.getLocation(), sound, levelUpEvent.getTitleChangeVolume(),
|
||||||
levelUpEvent.getTitleChangePitch());
|
levelUpEvent.getTitleChangePitch());
|
||||||
else
|
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) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
// user would skill up
|
// user would skill up
|
||||||
if (Jobs.getGCManager().isBroadcastingSkillups()) {
|
if (Jobs.getGCManager().isBroadcastingSkillups())
|
||||||
message = Jobs.getLanguage().getMessage("message.skillup.broadcast");
|
message = Jobs.getLanguage().getMessage("message.skillup.broadcast");
|
||||||
} else {
|
else
|
||||||
message = Jobs.getLanguage().getMessage("message.skillup.nobroadcast");
|
message = Jobs.getLanguage().getMessage("message.skillup.nobroadcast");
|
||||||
}
|
|
||||||
if (player != null) {
|
if (player != null)
|
||||||
message = message.replace("%playername%", player.getDisplayName());
|
message = message.replace("%playername%", player.getDisplayName());
|
||||||
} else {
|
else
|
||||||
message = message.replace("%playername%", jPlayer.getUserName());
|
message = message.replace("%playername%", jPlayer.getUserName());
|
||||||
}
|
|
||||||
message = message.replace("%titlename%", levelUpEvent.getNewTitleColor() + levelUpEvent.getNewTitleName() + ChatColor.WHITE);
|
message = message.replace("%titlename%", levelUpEvent.getNewTitleColor() + levelUpEvent.getNewTitleName() + ChatColor.WHITE);
|
||||||
message = message.replace("%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE);
|
message = message.replace("%jobname%", job.getChatColor() + job.getName() + ChatColor.WHITE);
|
||||||
for (String line : message.split("\n")) {
|
for (String line : message.split("\n")) {
|
||||||
if (Jobs.getGCManager().isBroadcastingSkillups()) {
|
if (Jobs.getGCManager().isBroadcastingSkillups())
|
||||||
Bukkit.getServer().broadcastMessage(line);
|
Bukkit.getServer().broadcastMessage(line);
|
||||||
} else if (player != null) {
|
else if (player != null) {
|
||||||
if (Jobs.getGCManager().TitleChangeActionBar)
|
if (Jobs.getGCManager().TitleChangeActionBar)
|
||||||
Jobs.getActionBar().send(player, line);
|
Jobs.getActionBar().send(player, line);
|
||||||
if (Jobs.getGCManager().TitleChangeChat)
|
if (Jobs.getGCManager().TitleChangeChat)
|
||||||
@ -740,7 +731,7 @@ public class PlayerManager {
|
|||||||
HashMap<Job, ItemBonusCache> cj = cache.get(player.getUniqueId());
|
HashMap<Job, ItemBonusCache> cj = cache.get(player.getUniqueId());
|
||||||
|
|
||||||
if (cj == null) {
|
if (cj == null) {
|
||||||
cj = new HashMap<Job, ItemBonusCache>();
|
cj = new HashMap<>();
|
||||||
cache.put(player.getUniqueId(), cj);
|
cache.put(player.getUniqueId(), cj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -972,7 +963,7 @@ public class PlayerManager {
|
|||||||
return;
|
return;
|
||||||
if (!Jobs.getGCManager().AutoJobJoinUse)
|
if (!Jobs.getGCManager().AutoJobJoinUse)
|
||||||
return;
|
return;
|
||||||
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(Jobs.getInstance(), new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (!player.isOnline())
|
if (!player.isOnline())
|
||||||
|
@ -2,14 +2,14 @@ package com.gamingmesh.jobs.Signs;
|
|||||||
|
|
||||||
public class Sign {
|
public class Sign {
|
||||||
|
|
||||||
int Category = 0;
|
private int Category = 0;
|
||||||
String World = null;
|
private String World = null;
|
||||||
double x = 0.01;
|
private double x = 0.01;
|
||||||
double y = 0.01;
|
private double y = 0.01;
|
||||||
double z = 0.01;
|
private double z = 0.01;
|
||||||
int Number = 0;
|
private int Number = 0;
|
||||||
String JobName = null;
|
private String JobName = null;
|
||||||
boolean special = false;
|
private boolean special = false;
|
||||||
|
|
||||||
public Sign() {
|
public Sign() {
|
||||||
}
|
}
|
||||||
@ -19,7 +19,7 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSpecial() {
|
public boolean isSpecial() {
|
||||||
return this.special;
|
return special;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setJobName(String JobName) {
|
public void setJobName(String JobName) {
|
||||||
@ -27,7 +27,7 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String GetJobName() {
|
public String GetJobName() {
|
||||||
return this.JobName;
|
return JobName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCategory(int Category) {
|
public void setCategory(int Category) {
|
||||||
@ -35,7 +35,7 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int GetCategory() {
|
public int GetCategory() {
|
||||||
return this.Category;
|
return Category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setWorld(String World) {
|
public void setWorld(String World) {
|
||||||
@ -43,7 +43,7 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String GetWorld() {
|
public String GetWorld() {
|
||||||
return this.World;
|
return World;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setX(double x) {
|
public void setX(double x) {
|
||||||
@ -51,7 +51,7 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double GetX() {
|
public double GetX() {
|
||||||
return this.x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setY(double y) {
|
public void setY(double y) {
|
||||||
@ -59,7 +59,7 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double GetY() {
|
public double GetY() {
|
||||||
return this.y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setZ(double z) {
|
public void setZ(double z) {
|
||||||
@ -67,7 +67,7 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double GetZ() {
|
public double GetZ() {
|
||||||
return this.z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNumber(int Number) {
|
public void setNumber(int Number) {
|
||||||
@ -75,6 +75,6 @@ public class Sign {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int GetNumber() {
|
public int GetNumber() {
|
||||||
return this.Number;
|
return Number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class SignInfo {
|
public class SignInfo {
|
||||||
|
|
||||||
List<Sign> AllSigns = new ArrayList<>();
|
private List<Sign> AllSigns = new ArrayList<>();
|
||||||
|
|
||||||
public SignInfo() {
|
public SignInfo() {
|
||||||
}
|
}
|
||||||
@ -15,7 +15,7 @@ public class SignInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Sign> GetAllSigns() {
|
public List<Sign> GetAllSigns() {
|
||||||
return this.AllSigns;
|
return AllSigns;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeSign(Sign sign) {
|
public void removeSign(Sign sign) {
|
||||||
|
@ -32,6 +32,10 @@ public class SignUtil {
|
|||||||
|
|
||||||
// Sign file
|
// Sign file
|
||||||
public void LoadSigns() {
|
public void LoadSigns() {
|
||||||
|
// Boolean false does not create a file
|
||||||
|
if (!Jobs.getGCManager().SignsEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
Signs.GetAllSigns().clear();
|
Signs.GetAllSigns().clear();
|
||||||
File file = new File(plugin.getDataFolder(), "Signs.yml");
|
File file = new File(plugin.getDataFolder(), "Signs.yml");
|
||||||
YamlConfiguration f = YamlConfiguration.loadConfiguration(file);
|
YamlConfiguration f = YamlConfiguration.loadConfiguration(file);
|
||||||
@ -61,6 +65,9 @@ public class SignUtil {
|
|||||||
|
|
||||||
// Signs save file
|
// Signs save file
|
||||||
public void saveSigns() {
|
public void saveSigns() {
|
||||||
|
if (!Jobs.getGCManager().SignsEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
File f = new File(plugin.getDataFolder(), "Signs.yml");
|
File f = new File(plugin.getDataFolder(), "Signs.yml");
|
||||||
YamlConfiguration conf = YamlConfiguration.loadConfiguration(f);
|
YamlConfiguration conf = YamlConfiguration.loadConfiguration(f);
|
||||||
|
|
||||||
@ -92,6 +99,9 @@ public class SignUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean SignUpdate(String JobName) {
|
public boolean SignUpdate(String JobName) {
|
||||||
|
if (!Jobs.getGCManager().SignsEnabled)
|
||||||
|
return true;
|
||||||
|
|
||||||
List<com.gamingmesh.jobs.Signs.Sign> Copy = new ArrayList<>(Signs.GetAllSigns().size());
|
List<com.gamingmesh.jobs.Signs.Sign> Copy = new ArrayList<>(Signs.GetAllSigns().size());
|
||||||
for (com.gamingmesh.jobs.Signs.Sign foo : Signs.GetAllSigns()) {
|
for (com.gamingmesh.jobs.Signs.Sign foo : Signs.GetAllSigns()) {
|
||||||
Copy.add(foo);
|
Copy.add(foo);
|
||||||
@ -126,9 +136,8 @@ public class SignUtil {
|
|||||||
org.bukkit.block.Sign sign = (org.bukkit.block.Sign) block.getState();
|
org.bukkit.block.Sign sign = (org.bukkit.block.Sign) block.getState();
|
||||||
if (!one.isSpecial()) {
|
if (!one.isSpecial()) {
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
if (i >= PlayerList.size()) {
|
if (i >= PlayerList.size())
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
String PlayerName = PlayerList.get(i).getPlayerName();
|
String PlayerName = PlayerList.get(i).getPlayerName();
|
||||||
|
|
||||||
if (PlayerName != null && PlayerName.length() > 8) {
|
if (PlayerName != null && PlayerName.length() > 8) {
|
||||||
|
@ -17,7 +17,7 @@ public final class JobsAreaSelectionEvent extends Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
return this.player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CuboidArea getArea() {
|
public CuboidArea getArea() {
|
||||||
|
@ -11,7 +11,7 @@ public final class JobsChunkChangeEvent extends Event implements Cancellable {
|
|||||||
private Player player;
|
private Player player;
|
||||||
private Chunk oldChunk;
|
private Chunk oldChunk;
|
||||||
private Chunk newChunk;
|
private Chunk newChunk;
|
||||||
private boolean cancelled;
|
private boolean cancelled = false;
|
||||||
|
|
||||||
public JobsChunkChangeEvent(Player player, Chunk oldChunk, Chunk newChunk) {
|
public JobsChunkChangeEvent(Player player, Chunk oldChunk, Chunk newChunk) {
|
||||||
this.player = player;
|
this.player = player;
|
||||||
@ -20,15 +20,15 @@ public final class JobsChunkChangeEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
return this.player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Chunk getOldChunk() {
|
public Chunk getOldChunk() {
|
||||||
return this.oldChunk;
|
return oldChunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Chunk getNewChunk() {
|
public Chunk getNewChunk() {
|
||||||
return this.newChunk;
|
return newChunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -37,8 +37,8 @@ public final class JobsChunkChangeEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -12,7 +12,7 @@ public final class JobsExpGainEvent extends Event implements Cancellable {
|
|||||||
private OfflinePlayer offlinePlayer;
|
private OfflinePlayer offlinePlayer;
|
||||||
private double exp;
|
private double exp;
|
||||||
private Job job;
|
private Job job;
|
||||||
private boolean cancelled;
|
private boolean cancelled = false;
|
||||||
|
|
||||||
public JobsExpGainEvent(OfflinePlayer offlinePlayer, Job job, double exp) {
|
public JobsExpGainEvent(OfflinePlayer offlinePlayer, Job job, double exp) {
|
||||||
this.offlinePlayer = offlinePlayer;
|
this.offlinePlayer = offlinePlayer;
|
||||||
@ -21,15 +21,15 @@ public final class JobsExpGainEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public OfflinePlayer getPlayer() {
|
public OfflinePlayer getPlayer() {
|
||||||
return this.offlinePlayer;
|
return offlinePlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job getJob() {
|
public Job getJob() {
|
||||||
return this.job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getExp() {
|
public double getExp() {
|
||||||
return this.exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExp(double exp) {
|
public void setExp(double exp) {
|
||||||
@ -42,8 +42,8 @@ public final class JobsExpGainEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,7 +11,7 @@ public final class JobsJoinEvent extends Event implements Cancellable {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private JobsPlayer player;
|
private JobsPlayer player;
|
||||||
private Job job;
|
private Job job;
|
||||||
private boolean cancelled;
|
private boolean cancelled = false;
|
||||||
|
|
||||||
public JobsJoinEvent(JobsPlayer jPlayer, Job job) {
|
public JobsJoinEvent(JobsPlayer jPlayer, Job job) {
|
||||||
this.player = jPlayer;
|
this.player = jPlayer;
|
||||||
@ -19,11 +19,11 @@ public final class JobsJoinEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public JobsPlayer getPlayer() {
|
public JobsPlayer getPlayer() {
|
||||||
return this.player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job getJob() {
|
public Job getJob() {
|
||||||
return this.job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -32,8 +32,8 @@ public final class JobsJoinEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -11,7 +11,7 @@ public final class JobsLeaveEvent extends Event implements Cancellable {
|
|||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private JobsPlayer player;
|
private JobsPlayer player;
|
||||||
private Job job;
|
private Job job;
|
||||||
private boolean cancelled;
|
private boolean cancelled = false;
|
||||||
|
|
||||||
public JobsLeaveEvent(JobsPlayer jPlayer, Job job) {
|
public JobsLeaveEvent(JobsPlayer jPlayer, Job job) {
|
||||||
this.player = jPlayer;
|
this.player = jPlayer;
|
||||||
@ -19,11 +19,11 @@ public final class JobsLeaveEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public JobsPlayer getPlayer() {
|
public JobsPlayer getPlayer() {
|
||||||
return this.player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job getJob() {
|
public Job getJob() {
|
||||||
return this.job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -32,8 +32,8 @@ public final class JobsLeaveEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -21,7 +21,7 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
|
|||||||
private Sound soundTitleChangeSound = Sound.values()[0];
|
private Sound soundTitleChangeSound = Sound.values()[0];
|
||||||
private int soundTitleChangeVolume = 1;
|
private int soundTitleChangeVolume = 1;
|
||||||
private int soundTitleChangePitch = 3;
|
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,
|
public JobsLevelUpEvent(JobsPlayer jPlayer, String JobName, int level, Title OldTitle, Title NewTitle, String soundLevelupSound, Integer soundLevelupVolume,
|
||||||
Integer soundLevelupPitch, String soundTitleChangeSound, Integer soundTitleChangeVolume, Integer soundTitleChangePitch) {
|
Integer soundLevelupPitch, String soundTitleChangeSound, Integer soundTitleChangeVolume, Integer soundTitleChangePitch) {
|
||||||
@ -47,43 +47,43 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public JobsPlayer getPlayer() {
|
public JobsPlayer getPlayer() {
|
||||||
return this.player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getJobName() {
|
public String getJobName() {
|
||||||
return this.JobName;
|
return JobName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Title getOldTitle() {
|
public Title getOldTitle() {
|
||||||
return this.OldTitle;
|
return OldTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOldTitleName() {
|
public String getOldTitleName() {
|
||||||
return this.OldTitle.getName();
|
return OldTitle.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOldTitleShort() {
|
public String getOldTitleShort() {
|
||||||
return this.OldTitle.getShortName();
|
return OldTitle.getShortName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getOldTitleColor() {
|
public String getOldTitleColor() {
|
||||||
return this.OldTitle.getChatColor().toString();
|
return OldTitle.getChatColor().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Title getNewTitle() {
|
public Title getNewTitle() {
|
||||||
return this.NewTitle;
|
return NewTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNewTitleName() {
|
public String getNewTitleName() {
|
||||||
return this.NewTitle.getName();
|
return NewTitle.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNewTitleShort() {
|
public String getNewTitleShort() {
|
||||||
return this.NewTitle.getShortName();
|
return NewTitle.getShortName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNewTitleColor() {
|
public String getNewTitleColor() {
|
||||||
return this.NewTitle.getChatColor().toString();
|
return NewTitle.getChatColor().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -95,24 +95,24 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
|
|||||||
return this.soundLevelupSound == null ? Sound.values()[0] : this.soundLevelupSound;
|
return this.soundLevelupSound == null ? Sound.values()[0] : this.soundLevelupSound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSound(Sound sound) {
|
public void setSound(Sound soundLevelupSound) {
|
||||||
this.soundLevelupSound = sound;
|
this.soundLevelupSound = soundLevelupSound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSoundVolume() {
|
public int getSoundVolume() {
|
||||||
return this.soundLevelupVolume;
|
return soundLevelupVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSoundVolume(int volume) {
|
public void setSoundVolume(int soundLevelupVolume) {
|
||||||
this.soundLevelupVolume = volume;
|
this.soundLevelupVolume = soundLevelupVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getSoundPitch() {
|
public int getSoundPitch() {
|
||||||
return this.soundLevelupPitch;
|
return soundLevelupPitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSoundPitch(int pitch) {
|
public void setSoundPitch(int soundLevelupPitch) {
|
||||||
this.soundLevelupPitch = pitch;
|
this.soundLevelupPitch = soundLevelupPitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -124,28 +124,28 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
|
|||||||
return this.soundTitleChangeSound == null ? Sound.values()[0] : this.soundTitleChangeSound;
|
return this.soundTitleChangeSound == null ? Sound.values()[0] : this.soundTitleChangeSound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitleChangeSound(Sound sound) {
|
public void setTitleChangeSound(Sound soundTitleChangeSound) {
|
||||||
this.soundTitleChangeSound = sound;
|
this.soundTitleChangeSound = soundTitleChangeSound;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTitleChangeVolume() {
|
public int getTitleChangeVolume() {
|
||||||
return this.soundTitleChangeVolume;
|
return soundTitleChangeVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitleChangeVolume(int volume) {
|
public void setTitleChangeVolume(int soundTitleChangeVolume) {
|
||||||
this.soundTitleChangeVolume = volume;
|
this.soundTitleChangeVolume = soundTitleChangeVolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getTitleChangePitch() {
|
public int getTitleChangePitch() {
|
||||||
return this.soundTitleChangePitch;
|
return soundTitleChangePitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTitleChangePitch(int pitch) {
|
public void setTitleChangePitch(int soundTitleChangePitch) {
|
||||||
this.soundTitleChangePitch = pitch;
|
this.soundTitleChangePitch = soundTitleChangePitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return this.level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -154,8 +154,8 @@ public final class JobsLevelUpEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -10,7 +10,7 @@ public final class JobsPaymentEvent extends Event implements Cancellable {
|
|||||||
private OfflinePlayer offlinePlayer;
|
private OfflinePlayer offlinePlayer;
|
||||||
private double money;
|
private double money;
|
||||||
private double points;
|
private double points;
|
||||||
private boolean cancelled;
|
private boolean cancelled = false;
|
||||||
|
|
||||||
public JobsPaymentEvent(OfflinePlayer offlinePlayer, double money, double points) {
|
public JobsPaymentEvent(OfflinePlayer offlinePlayer, double money, double points) {
|
||||||
this.offlinePlayer = offlinePlayer;
|
this.offlinePlayer = offlinePlayer;
|
||||||
@ -19,19 +19,19 @@ public final class JobsPaymentEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public OfflinePlayer getPlayer() {
|
public OfflinePlayer getPlayer() {
|
||||||
return this.offlinePlayer;
|
return offlinePlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getAmount() {
|
public double getAmount() {
|
||||||
return this.money;
|
return money;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getPoints() {
|
public double getPoints() {
|
||||||
return this.points;
|
return points;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPoints(double amount) {
|
public void setPoints(double points) {
|
||||||
this.points = amount;
|
this.points = points;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -40,8 +40,8 @@ public final class JobsPaymentEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAmount(double money) {
|
public void setAmount(double money) {
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
public class JobsScheduleStartEvent extends Event implements Cancellable {
|
public class JobsScheduleStartEvent extends Event implements Cancellable {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancelled;
|
private boolean cancelled = false;
|
||||||
private Schedule schedule;
|
private Schedule schedule;
|
||||||
|
|
||||||
public JobsScheduleStartEvent(Schedule schedule){
|
public JobsScheduleStartEvent(Schedule schedule){
|
||||||
@ -24,8 +24,8 @@ public class JobsScheduleStartEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.event.HandlerList;
|
|||||||
|
|
||||||
public class JobsScheduleStopEvent extends Event implements Cancellable {
|
public class JobsScheduleStopEvent extends Event implements Cancellable {
|
||||||
private static final HandlerList handlers = new HandlerList();
|
private static final HandlerList handlers = new HandlerList();
|
||||||
private boolean cancelled;
|
private boolean cancelled = false;
|
||||||
private Schedule schedule;
|
private Schedule schedule;
|
||||||
|
|
||||||
public JobsScheduleStopEvent(Schedule schedule){
|
public JobsScheduleStopEvent(Schedule schedule){
|
||||||
@ -24,8 +24,8 @@ public class JobsScheduleStopEvent extends Event implements Cancellable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCancelled(boolean cancel) {
|
public void setCancelled(boolean cancelled) {
|
||||||
cancelled = cancel;
|
this.cancelled = cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,7 +44,10 @@ public class ExploreManager {
|
|||||||
return;
|
return;
|
||||||
Jobs.consoleMsg("&e[Jobs] Loading explorer data");
|
Jobs.consoleMsg("&e[Jobs] Loading explorer data");
|
||||||
Jobs.getJobsDAO().loadExplore();
|
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() {
|
public HashMap<String, ExploreRegion> getWorlds() {
|
||||||
|
@ -86,7 +86,7 @@ public class GeneralConfigManager {
|
|||||||
public int globalblocktimer, CowMilkingTimer,
|
public int globalblocktimer, CowMilkingTimer,
|
||||||
CoreProtectInterval, BlockPlaceInterval, InfoUpdateInterval;
|
CoreProtectInterval, BlockPlaceInterval, InfoUpdateInterval;
|
||||||
public Double TreeFellerMultiplier, gigaDrillMultiplier, superBreakerMultiplier;
|
public Double TreeFellerMultiplier, gigaDrillMultiplier, superBreakerMultiplier;
|
||||||
public String localeString = "EN";
|
public String localeString = "";
|
||||||
|
|
||||||
private boolean FurnacesReassign, BrewingStandsReassign;
|
private boolean FurnacesReassign, BrewingStandsReassign;
|
||||||
private int FurnacesMaxDefault, BrewingStandsMaxDefault, BrowseAmountToShow;
|
private int FurnacesMaxDefault, BrewingStandsMaxDefault, BrowseAmountToShow;
|
||||||
|
@ -139,7 +139,7 @@ public class LanguageManager {
|
|||||||
c.get("general.error.ingame", "&cYou can use this command only in game!");
|
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.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.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.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.newBrewingRegistration", "&eRegistered new ownership for brewing stand &7[current]&e/&f[max]");
|
||||||
c.get("general.error.noFurnaceRegistration", "&cYou reached max furnace count!");
|
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.nextPageOff", "&7 Next >>----");
|
||||||
c.get("command.help.output.pageCount", "&2[current]/[total]");
|
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.info", "Boosts Money gain for all players");
|
||||||
c.get("command.moneyboost.help.args", "[jobname] [rate]");
|
c.get("command.moneyboost.help.args", "[jobname] [rate]");
|
||||||
Jobs.getGCManager().commandArgs.put("moneyboost", Arrays.asList("[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.info", "Edit item boost bonus");
|
||||||
c.get("command.edititembonus.help.args", "[list/add/remove] [jobsName] [itemBoostName]");
|
c.get("command.edititembonus.help.args", "[list/add/remove] [jobsName] [itemBoostName]");
|
||||||
Jobs.getGCManager().commandArgs.put("edititembonus", Arrays.asList("add%%remove", "[jobname]", "[jobitemname]"));
|
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.info", "Show job bonuses");
|
||||||
c.get("command.bonus.help.args", "[jobname]");
|
c.get("command.bonus.help.args", "[jobname]");
|
||||||
Jobs.getGCManager().commandArgs.put("bonus", Arrays.asList("[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.mcmmo", " &eMcMMO bonus: %money% %points% %exp%");
|
||||||
c.get("command.bonus.output.final", " &eFinal 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.bonus.output.finalExplanation", " &eDoes not include Petpay and Near spawner bonus/penalty");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
c.get("command.convert.help.info",
|
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.");
|
"Converts data base system from one system to another. if you currently running sqlite, this will convert to Mysql and vise versa.");
|
||||||
|
@ -130,66 +130,86 @@ public class NameTranslatorManager {
|
|||||||
public void readFile() {
|
public void readFile() {
|
||||||
YmlMaker ItemFile = new YmlMaker(plugin, "TranslatableWords" + File.separator + "Words_" + Jobs.getGCManager().localeString + ".yml");
|
YmlMaker ItemFile = new YmlMaker(plugin, "TranslatableWords" + File.separator + "Words_" + Jobs.getGCManager().localeString + ".yml");
|
||||||
ItemFile.saveDefaultConfig();
|
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");
|
if (ItemFile.getConfig().isConfigurationSection("EntityList")) {
|
||||||
keys = section.getKeys(false);
|
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("EntityList");
|
||||||
ListOfEntities.clear();
|
Set<String>keys = section.getKeys(false);
|
||||||
for (String one : keys) {
|
ListOfEntities.clear();
|
||||||
String id = one.contains(":") ? one.split(":")[0] : one;
|
for (String one : keys) {
|
||||||
String meta = one.contains(":") ? one.split(":")[1] : "";
|
String id = one.contains(":") ? one.split(":")[0] : one;
|
||||||
String MCName = section.getString(one + ".MCName");
|
String meta = one.contains(":") ? one.split(":")[1] : "";
|
||||||
String Name = section.getString(one + ".Name");
|
String MCName = section.getString(one + ".MCName");
|
||||||
ListOfEntities.add(new NameList(id, meta, Name, 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 (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");
|
if (ItemFile.getConfig().isConfigurationSection("EnchantList")) {
|
||||||
keys = section.getKeys(false);
|
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("EnchantList");
|
||||||
ListOfEnchants.clear();
|
Set<String>keys = section.getKeys(false);
|
||||||
for (String one : keys) {
|
ListOfEnchants.clear();
|
||||||
String id = one.contains(":") ? one.split(":")[0] : one;
|
for (String one : keys) {
|
||||||
String meta = one.contains(":") ? one.split(":")[1] : "";
|
String id = one.contains(":") ? one.split(":")[0] : one;
|
||||||
String MCName = section.getString(one + ".MCName");
|
String meta = one.contains(":") ? one.split(":")[1] : "";
|
||||||
String Name = section.getString(one + ".Name");
|
String MCName = section.getString(one + ".MCName");
|
||||||
ListOfEnchants.add(new NameList(id, meta, Name, 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 (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");
|
if (ItemFile.getConfig().isConfigurationSection("ColorList")) {
|
||||||
keys = section.getKeys(false);
|
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("ColorList");
|
||||||
ListOfColors.clear();
|
Set<String>keys = section.getKeys(false);
|
||||||
for (String one : keys) {
|
ListOfColors.clear();
|
||||||
String id = one.contains(":") ? one.split(":")[0] : one;
|
for (String one : keys) {
|
||||||
String meta = one.contains(":") ? one.split(":")[1] : "";
|
String id = one.contains(":") ? one.split(":")[0] : one;
|
||||||
String MCName = section.getString(one + ".MCName");
|
String meta = one.contains(":") ? one.split(":")[1] : "";
|
||||||
String Name = section.getString(one + ".Name");
|
String MCName = section.getString(one + ".MCName");
|
||||||
ListOfColors.add(new NameList(id, meta, Name, 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 (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");
|
if (ItemFile.getConfig().isConfigurationSection("PotionNamesList")) {
|
||||||
keys = section.getKeys(false);
|
ConfigurationSection section = ItemFile.getConfig().getConfigurationSection("PotionNamesList");
|
||||||
ListOfPotionNames.clear();
|
Set<String>keys = section.getKeys(false);
|
||||||
for (String one : keys) {
|
ListOfPotionNames.clear();
|
||||||
String id = one.contains(":") ? one.split(":")[0] : one;
|
for (String one : keys) {
|
||||||
String meta = one.contains(":") ? one.split(":")[1] : "";
|
String id = one.contains(":") ? one.split(":")[0] : one;
|
||||||
String MCName = section.getString(one + ".MCName");
|
String meta = one.contains(":") ? one.split(":")[1] : "";
|
||||||
String Name = section.getString(one + ".Name");
|
String MCName = section.getString(one + ".MCName");
|
||||||
ListOfColors.add(new NameList(id, meta, Name, 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 (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() {
|
synchronized void load() {
|
||||||
@ -1667,7 +1687,7 @@ public class NameTranslatorManager {
|
|||||||
c.get("ColorList.2.MCName", "magenta");
|
c.get("ColorList.2.MCName", "magenta");
|
||||||
c.get("ColorList.2.Name", "&dMagenta");
|
c.get("ColorList.2.Name", "&dMagenta");
|
||||||
c.get("ColorList.3.MCName", "lightBlue");
|
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.MCName", "yellow");
|
||||||
c.get("ColorList.4.Name", "&eYellow");
|
c.get("ColorList.4.Name", "&eYellow");
|
||||||
c.get("ColorList.5.MCName", "lime");
|
c.get("ColorList.5.MCName", "lime");
|
||||||
@ -1694,82 +1714,82 @@ public class NameTranslatorManager {
|
|||||||
c.get("ColorList.15.Name", "&0Black");
|
c.get("ColorList.15.Name", "&0Black");
|
||||||
|
|
||||||
// Potion name list
|
// Potion name list
|
||||||
c.get("PotionNamesList.0.MCName", "POTION");
|
c.get("PotionNamesList.373.MCName", "POTION");
|
||||||
c.get("PotionNamesList.0.Name", "Potion");
|
c.get("PotionNamesList.373.Name", "Potion");
|
||||||
c.get("PotionNamesList.1.MCName", "AWKWARD_POTION");
|
c.get("PotionNamesList.373:16.MCName", "AWKWARD_POTION");
|
||||||
c.get("PotionNamesList.1.Name", "Awkward potion");
|
c.get("PotionNamesList.373:16.Name", "Awkward potion");
|
||||||
c.get("PotionNamesList.2.MCName", "THICK_POTION");
|
c.get("PotionNamesList.373:32.MCName", "THICK_POTION");
|
||||||
c.get("PotionNamesList.2.Name", "Thick potion");
|
c.get("PotionNamesList.373:32.Name", "Thick potion");
|
||||||
c.get("PotionNamesList.3.MCName", "MUNDANE_POTION");
|
c.get("PotionNamesList.373:64.MCName", "MUNDANE_POTION");
|
||||||
c.get("PotionNamesList.3.Name", "Mundane potion");
|
c.get("PotionNamesList.373:64.Name", "Mundane potion");
|
||||||
c.get("PotionNamesList.4.MCName", "REGENERATION_POTION");
|
c.get("PotionNamesList.373:8193.MCName", "REGENERATION_POTION");
|
||||||
c.get("PotionNamesList.4.Name", "Regeneration potion");
|
c.get("PotionNamesList.373:8193.Name", "Regeneration potion");
|
||||||
c.get("PotionNamesList.5.MCName", "SWIFTNESS_POTION");
|
c.get("PotionNamesList.373:8194.MCName", "SWIFTNESS_POTION");
|
||||||
c.get("PotionNamesList.5.Name", "Swiftness potion");
|
c.get("PotionNamesList.373:8194.Name", "Swiftness potion");
|
||||||
c.get("PotionNamesList.6.MCName", "FIRE_RESISTANCE_POTION");
|
c.get("PotionNamesList.373:8195.MCName", "FIRE_RESISTANCE_POTION");
|
||||||
c.get("PotionNamesList.6.Name", "Fire resistance potion");
|
c.get("PotionNamesList.373:8195.Name", "Fire resistance potion");
|
||||||
c.get("PotionNamesList.7.MCName", "POISON_POTION");
|
c.get("PotionNamesList.373:8196.MCName", "POISON_POTION");
|
||||||
c.get("PotionNamesList.7.Name", "Poison potion");
|
c.get("PotionNamesList.373:8196.Name", "Poison potion");
|
||||||
c.get("PotionNamesList.8.MCName", "HEALING_POTION");
|
c.get("PotionNamesList.373:8197.MCName", "HEALING_POTION");
|
||||||
c.get("PotionNamesList.8.Name", "Healing potion");
|
c.get("PotionNamesList.373:8197.Name", "Healing potion");
|
||||||
c.get("PotionNamesList.9.MCName", "NIGHT_VISION_POTION");
|
c.get("PotionNamesList.373:8198.MCName", "NIGHT_VISION_POTION");
|
||||||
c.get("PotionNamesList.9.Name", "Night vision potion");
|
c.get("PotionNamesList.373:8198.Name", "Night vision potion");
|
||||||
c.get("PotionNamesList.10.MCName", "WEAKNESS_POTION");
|
c.get("PotionNamesList.373:8200.MCName", "WEAKNESS_POTION");
|
||||||
c.get("PotionNamesList.10.Name", "Weakness potion");
|
c.get("PotionNamesList.373:8200.Name", "Weakness potion");
|
||||||
c.get("PotionNamesList.11.MCName", "STRENGTH_POTION");
|
c.get("PotionNamesList.373:8201.MCName", "STRENGTH_POTION");
|
||||||
c.get("PotionNamesList.11.Name", "Strength potion");
|
c.get("PotionNamesList.373:8201.Name", "Strength potion");
|
||||||
c.get("PotionNamesList.12.MCName", "SLOWNESS_POTION");
|
c.get("PotionNamesList.373:8202.MCName", "SLOWNESS_POTION");
|
||||||
c.get("PotionNamesList.12.Name", "Slowness potion");
|
c.get("PotionNamesList.373:8202.Name", "Slowness potion");
|
||||||
c.get("PotionNamesList.13.MCName", "HARMING_POTION");
|
c.get("PotionNamesList.373:8204.MCName", "HARMING_POTION");
|
||||||
c.get("PotionNamesList.13.Name", "Harming potion");
|
c.get("PotionNamesList.373:8204.Name", "Harming potion");
|
||||||
c.get("PotionNamesList.14.MCName", "WATER_BREATHING_POTION");
|
c.get("PotionNamesList.373:8205.MCName", "WATER_BREATHING_POTION");
|
||||||
c.get("PotionNamesList.14.Name", "Water breathing potion");
|
c.get("PotionNamesList.373:8205.Name", "Water breathing potion");
|
||||||
c.get("PotionNamesList.15.MCName", "INVISIBILITY_POTION");
|
c.get("PotionNamesList.373:8206.MCName", "INVISIBILITY_POTION");
|
||||||
c.get("PotionNamesList.15.Name", "Inivisibility potion");
|
c.get("PotionNamesList.373:8206.Name", "Inivisibility potion");
|
||||||
c.get("PotionNamesList.16.MCName", "REGENERATION_POTION2");
|
c.get("PotionNamesList.373:8225.MCName", "REGENERATION_POTION2");
|
||||||
c.get("PotionNamesList.16.Name", "Regeneration potion 2");
|
c.get("PotionNamesList.373:8225.Name", "Regeneration potion 2");
|
||||||
c.get("PotionNamesList.17.MCName", "SWIFTNESS_POTION2");
|
c.get("PotionNamesList.373:8226.MCName", "SWIFTNESS_POTION2");
|
||||||
c.get("PotionNamesList.17.Name", "Swiftness potion 2");
|
c.get("PotionNamesList.373:8226.Name", "Swiftness potion 2");
|
||||||
c.get("PotionNamesList.18.MCName", "POISON_POTION2");
|
c.get("PotionNamesList.373:8228.MCName", "POISON_POTION2");
|
||||||
c.get("PotionNamesList.18.Name", "Poison potion 2");
|
c.get("PotionNamesList.373:8228.Name", "Poison potion 2");
|
||||||
c.get("PotionNamesList.19.MCName", "HEALING_POTION2");
|
c.get("PotionNamesList.373:8229.MCName", "HEALING_POTION2");
|
||||||
c.get("PotionNamesList.19.Name", "Healing potion 2");
|
c.get("PotionNamesList.373:8229.Name", "Healing potion 2");
|
||||||
c.get("PotionNamesList.20.MCName", "STRENGTH_POTION2");
|
c.get("PotionNamesList.373:8233.MCName", "STRENGTH_POTION2");
|
||||||
c.get("PotionNamesList.20.Name", "Strength potion 2");
|
c.get("PotionNamesList.373:8233.Name", "Strength potion 2");
|
||||||
c.get("PotionNamesList.21.MCName", "LEAPING_POTION2");
|
c.get("PotionNamesList.373:8235.MCName", "LEAPING_POTION2");
|
||||||
c.get("PotionNamesList.21.Name", "Leaping potion 2");
|
c.get("PotionNamesList.373:8235.Name", "Leaping potion 2");
|
||||||
c.get("PotionNamesList.22.MCName", "HARMING_POTION2");
|
c.get("PotionNamesList.373:8236.MCName", "HARMING_POTION2");
|
||||||
c.get("PotionNamesList.22.Name", "Harming potion 2");
|
c.get("PotionNamesList.373:8236.Name", "Harming potion 2");
|
||||||
c.get("PotionNamesList.23.MCName", "REGENERATION_POTION3");
|
c.get("PotionNamesList.373:8257.MCName", "REGENERATION_POTION3");
|
||||||
c.get("PotionNamesList.23.Name", "Regeneration potion 3");
|
c.get("PotionNamesList.373:8257.Name", "Regeneration potion 3");
|
||||||
c.get("PotionNamesList.24.MCName", "SWIFTNESS_POTION3");
|
c.get("PotionNamesList.373:8258.MCName", "SWIFTNESS_POTION3");
|
||||||
c.get("PotionNamesList.24.Name", "Swiftness potion 3");
|
c.get("PotionNamesList.373:8258.Name", "Swiftness potion 3");
|
||||||
c.get("PotionNamesList.25.MCName", "FIRE_RESISTANCE_POTION3");
|
c.get("PotionNamesList.373:8259.MCName", "FIRE_RESISTANCE_POTION3");
|
||||||
c.get("PotionNamesList.25.Name", "Fire resistance potion 3");
|
c.get("PotionNamesList.373:8259.Name", "Fire resistance potion 3");
|
||||||
c.get("PotionNamesList.26.MCName", "POISON_POTION3");
|
c.get("PotionNamesList.373:8260.MCName", "POISON_POTION3");
|
||||||
c.get("PotionNamesList.26.Name", "Poison potion 3");
|
c.get("PotionNamesList.373:8260.Name", "Poison potion 3");
|
||||||
c.get("PotionNamesList.27.MCName", "NIGHT_VISION_POTION2");
|
c.get("PotionNamesList.373:8262.MCName", "NIGHT_VISION_POTION2");
|
||||||
c.get("PotionNamesList.27.Name", "Night vision potion 2");
|
c.get("PotionNamesList.373:8262.Name", "Night vision potion 2");
|
||||||
c.get("PotionNamesList.28.MCName", "WEAKNESS_POTION2");
|
c.get("PotionNamesList.373:8264.MCName", "WEAKNESS_POTION2");
|
||||||
c.get("PotionNamesList.28.Name", "Weakness potion 2");
|
c.get("PotionNamesList.373:8264.Name", "Weakness potion 2");
|
||||||
c.get("PotionNamesList.29.MCName", "STRENGTH_POTION3");
|
c.get("PotionNamesList.373:8265.MCName", "STRENGTH_POTION3");
|
||||||
c.get("PotionNamesList.29.Name", "Strength potion 3");
|
c.get("PotionNamesList.373:8265.Name", "Strength potion 3");
|
||||||
c.get("PotionNamesList.30.MCName", "SLOWNESS_POTION2");
|
c.get("PotionNamesList.373:8266.MCName", "SLOWNESS_POTION2");
|
||||||
c.get("PotionNamesList.30.Name", "Slowness potion 2");
|
c.get("PotionNamesList.373:8266.Name", "Slowness potion 2");
|
||||||
c.get("PotionNamesList.31.MCName", "LEAPING_POTION3");
|
c.get("PotionNamesList.373:8267.MCName", "LEAPING_POTION3");
|
||||||
c.get("PotionNamesList.31.Name", "Leaping potion 3");
|
c.get("PotionNamesList.373:8267.Name", "Leaping potion 3");
|
||||||
c.get("PotionNamesList.32.MCName", "WATER_BREATHING_POTION2");
|
c.get("PotionNamesList.373:8269.MCName", "WATER_BREATHING_POTION2");
|
||||||
c.get("PotionNamesList.32.Name", "Water breathing potion 2");
|
c.get("PotionNamesList.373:8269.Name", "Water breathing potion 2");
|
||||||
c.get("PotionNamesList.33.MCName", "INVISIBILITY_POTION2");
|
c.get("PotionNamesList.373:8270.MCName", "INVISIBILITY_POTION2");
|
||||||
c.get("PotionNamesList.33.Name", "Invisibility potion 2");
|
c.get("PotionNamesList.373:8270.Name", "Invisibility potion 2");
|
||||||
c.get("PotionNamesList.34.MCName", "REGENERATION_POTION4");
|
c.get("PotionNamesList.373:8289.MCName", "REGENERATION_POTION4");
|
||||||
c.get("PotionNamesList.34.Name", "Regeneration potion 4");
|
c.get("PotionNamesList.373:8289.Name", "Regeneration potion 4");
|
||||||
c.get("PotionNamesList.35.MCName", "SWIFTNESS_POTION4");
|
c.get("PotionNamesList.373:8290.MCName", "SWIFTNESS_POTION4");
|
||||||
c.get("PotionNamesList.35.Name", "Swiftness potion 4");
|
c.get("PotionNamesList.373:8290.Name", "Swiftness potion 4");
|
||||||
c.get("PotionNamesList.36.MCName", "POISON_POTION4");
|
c.get("PotionNamesList.373:8292.MCName", "POISON_POTION4");
|
||||||
c.get("PotionNamesList.36.Name", "Poison potion 4");
|
c.get("PotionNamesList.373:8292.Name", "Poison potion 4");
|
||||||
c.get("PotionNamesList.37.MCName", "STRENGTH_POTION4");
|
c.get("PotionNamesList.373:8297.MCName", "STRENGTH_POTION4");
|
||||||
c.get("PotionNamesList.37.Name", "Strength potion 4");
|
c.get("PotionNamesList.373:8297.Name", "Strength potion 4");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
c.getW().save(f);
|
c.getW().save(f);
|
||||||
|
@ -28,6 +28,11 @@ public class RestrictedBlockManager {
|
|||||||
* loads from Jobs/restrictedAreas.yml
|
* loads from Jobs/restrictedAreas.yml
|
||||||
*/
|
*/
|
||||||
public synchronized void load() {
|
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");
|
File f = new File(plugin.getDataFolder(), "restrictedBlocks.yml");
|
||||||
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
|
YamlConfiguration config = YamlConfiguration.loadConfiguration(f);
|
||||||
CommentedYamlConfiguration writer = new CommentedYamlConfiguration();
|
CommentedYamlConfiguration writer = new CommentedYamlConfiguration();
|
||||||
@ -156,8 +161,8 @@ public class RestrictedBlockManager {
|
|||||||
Set<String> lss = c.getC().getConfigurationSection("blocksTimer").getKeys(false);
|
Set<String> lss = c.getC().getConfigurationSection("blocksTimer").getKeys(false);
|
||||||
for (String one : lss) {
|
for (String one : lss) {
|
||||||
if (((c.getC().isString("blocksTimer." + one + ".id")) || (c.getC().isInt("blocksTimer." + one + ".id"))) && (c.getC().isInt("blocksTimer." + one
|
if (((c.getC().isString("blocksTimer." + one + ".id")) || (c.getC().isInt("blocksTimer." + one + ".id"))) && (c.getC().isInt("blocksTimer." + one
|
||||||
+ ".cd"))) {
|
+ ".cd"))) {
|
||||||
CMIItemStack cm = ItemManager.getItem(c.getC().getString("blocksTimer." + one + ".id"));
|
CMIItemStack cm = ItemManager.getItem(c.getC().getString("blocksTimer." + one + ".id"));
|
||||||
if ((cm == null) || (!cm.getCMIType().isBlock())) {
|
if ((cm == null) || (!cm.getCMIType().isBlock())) {
|
||||||
Jobs.consoleMsg("&e[Jobs] Your defined (" + c.getC().getString(new StringBuilder("blocksTimer.").append(one)
|
Jobs.consoleMsg("&e[Jobs] Your defined (" + c.getC().getString(new StringBuilder("blocksTimer.").append(one)
|
||||||
.append(".id").toString()) + ") protected block id/name is not correct!");
|
.append(".id").toString()) + ") protected block id/name is not correct!");
|
||||||
|
@ -52,7 +52,7 @@ public class ShopManager {
|
|||||||
Inventory topinv = player.getOpenInventory().getTopInventory();
|
Inventory topinv = player.getOpenInventory().getTopInventory();
|
||||||
if (topinv != null)
|
if (topinv != null)
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
Jobs.getShopManager().GuiList.put(player.getName(), page);
|
GuiList.put(player.getName(), page);
|
||||||
player.openInventory(inv);
|
player.openInventory(inv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,6 @@ public abstract class BaseActionInfo implements ActionInfo {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ActionType getType() {
|
public ActionType getType() {
|
||||||
return this.type;
|
return type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import com.gamingmesh.jobs.PlayerManager.BoostOf;
|
|||||||
|
|
||||||
public class Boost {
|
public class Boost {
|
||||||
|
|
||||||
HashMap<BoostOf, BoostMultiplier> map = new HashMap<>();
|
private HashMap<BoostOf, BoostMultiplier> map = new HashMap<>();
|
||||||
|
|
||||||
public Boost() {
|
public Boost() {
|
||||||
for (BoostOf one : BoostOf.values()) {
|
for (BoostOf one : BoostOf.values()) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package com.gamingmesh.jobs.container;
|
package com.gamingmesh.jobs.container;
|
||||||
|
|
||||||
public class BoostCounter {
|
public class BoostCounter {
|
||||||
CurrencyType type;
|
private CurrencyType type;
|
||||||
double boost;
|
private double boost;
|
||||||
Long calculatedon;
|
private Long calculatedon;
|
||||||
|
|
||||||
public BoostCounter(CurrencyType type, double boost, Long calculatedon) {
|
public BoostCounter(CurrencyType type, double boost, Long calculatedon) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@ -12,19 +12,19 @@ public class BoostCounter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CurrencyType getType() {
|
public CurrencyType getType() {
|
||||||
return this.type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getTime() {
|
public long getTime() {
|
||||||
return this.calculatedon;
|
return calculatedon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getBoost() {
|
public double getBoost() {
|
||||||
return this.boost;
|
return boost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTime(long time) {
|
public void setTime(long calculatedon) {
|
||||||
this.calculatedon = time;
|
this.calculatedon = calculatedon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBoost(double boost) {
|
public void setBoost(double boost) {
|
||||||
|
@ -4,7 +4,7 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
public class BoostMultiplier {
|
public class BoostMultiplier {
|
||||||
|
|
||||||
HashMap<CurrencyType, Double> map = new HashMap<>();
|
private HashMap<CurrencyType, Double> map = new HashMap<>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BoostMultiplier clone() {
|
public BoostMultiplier clone() {
|
||||||
|
@ -4,10 +4,10 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.boss.BossBar;
|
import org.bukkit.boss.BossBar;
|
||||||
|
|
||||||
public class BossBarInfo {
|
public class BossBarInfo {
|
||||||
String jobName;
|
private String jobName;
|
||||||
String PlayerName;
|
private String PlayerName;
|
||||||
BossBar bar;
|
private BossBar bar;
|
||||||
int id = -1;
|
private int id = -1;
|
||||||
|
|
||||||
public BossBarInfo(String PlayerName, String jobName, BossBar bar) {
|
public BossBarInfo(String PlayerName, String jobName, BossBar bar) {
|
||||||
this.PlayerName = PlayerName;
|
this.PlayerName = PlayerName;
|
||||||
@ -26,14 +26,14 @@ public class BossBarInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getPlayerName() {
|
public String getPlayerName() {
|
||||||
return this.PlayerName;
|
return PlayerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getJobName() {
|
public String getJobName() {
|
||||||
return this.jobName;
|
return jobName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BossBar getBar() {
|
public BossBar getBar() {
|
||||||
return this.bar;
|
return bar;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,11 @@ import java.util.UUID;
|
|||||||
|
|
||||||
public class Convert {
|
public class Convert {
|
||||||
|
|
||||||
int id;
|
private int id;
|
||||||
UUID uuid;
|
private UUID uuid;
|
||||||
String jobname;
|
private String jobname;
|
||||||
int level;
|
private int level;
|
||||||
int exp;
|
private int exp;
|
||||||
|
|
||||||
public Convert(int id, UUID uuid, String jobname, int level, int exp) {
|
public Convert(int id, UUID uuid, String jobname, int level, int exp) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
@ -22,22 +22,22 @@ public class Convert {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int GetId() {
|
public int GetId() {
|
||||||
return this.id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public UUID GetUserUUID() {
|
public UUID GetUserUUID() {
|
||||||
return this.uuid;
|
return uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String GetJobName() {
|
public String GetJobName() {
|
||||||
return this.jobname;
|
return jobname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetLevel() {
|
public int GetLevel() {
|
||||||
return this.level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetExp() {
|
public int GetExp() {
|
||||||
return this.exp;
|
return exp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,9 @@ import com.gamingmesh.jobs.Jobs;
|
|||||||
|
|
||||||
public class ExploreChunk {
|
public class ExploreChunk {
|
||||||
|
|
||||||
int x;
|
private int x;
|
||||||
int z;
|
private int z;
|
||||||
Set<String> playerNames = new HashSet<>();
|
private Set<String> playerNames = new HashSet<>();
|
||||||
private Integer dbId = null;
|
private Integer dbId = null;
|
||||||
private boolean updated = false;
|
private boolean updated = false;
|
||||||
|
|
||||||
@ -42,19 +42,19 @@ public class ExploreChunk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return this.playerNames.size();
|
return playerNames.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getX() {
|
public int getX() {
|
||||||
return this.x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getZ() {
|
public int getZ() {
|
||||||
return this.z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getPlayers() {
|
public Set<String> getPlayers() {
|
||||||
return this.playerNames;
|
return playerNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String serializeNames() {
|
public String serializeNames() {
|
||||||
|
@ -6,9 +6,9 @@ import org.bukkit.Chunk;
|
|||||||
|
|
||||||
public class ExploreRegion {
|
public class ExploreRegion {
|
||||||
|
|
||||||
int x;
|
int x;
|
||||||
int z;
|
int z;
|
||||||
HashMap<String, ExploreChunk> chunks = new HashMap<>();
|
private HashMap<String, ExploreChunk> chunks = new HashMap<>();
|
||||||
|
|
||||||
public ExploreRegion(int x, int z) {
|
public ExploreRegion(int x, int z) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
|
@ -2,8 +2,8 @@ package com.gamingmesh.jobs.container;
|
|||||||
|
|
||||||
public class ExploreRespond {
|
public class ExploreRespond {
|
||||||
|
|
||||||
int count;
|
private int count;
|
||||||
boolean newChunk = false;
|
private boolean newChunk = false;
|
||||||
|
|
||||||
public ExploreRespond(int count, boolean newChunk) {
|
public ExploreRespond(int count, boolean newChunk) {
|
||||||
this.count = count;
|
this.count = count;
|
||||||
@ -11,10 +11,10 @@ public class ExploreRespond {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return this.count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNewChunk() {
|
public boolean isNewChunk() {
|
||||||
return this.newChunk;
|
return newChunk;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,11 +3,11 @@ package com.gamingmesh.jobs.container;
|
|||||||
import com.gamingmesh.jobs.economy.BufferedPayment;
|
import com.gamingmesh.jobs.economy.BufferedPayment;
|
||||||
|
|
||||||
public class FastPayment {
|
public class FastPayment {
|
||||||
JobsPlayer jPlayer;
|
private JobsPlayer jPlayer;
|
||||||
ActionInfo info;
|
private ActionInfo info;
|
||||||
BufferedPayment payment;
|
private BufferedPayment payment;
|
||||||
Job job;
|
private Job job;
|
||||||
Long time;
|
private Long time;
|
||||||
|
|
||||||
public FastPayment(JobsPlayer jPlayer, ActionInfo info, BufferedPayment payment, Job job) {
|
public FastPayment(JobsPlayer jPlayer, ActionInfo info, BufferedPayment payment, Job job) {
|
||||||
this.jPlayer = jPlayer;
|
this.jPlayer = jPlayer;
|
||||||
@ -18,22 +18,22 @@ public class FastPayment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public JobsPlayer getPlayer() {
|
public JobsPlayer getPlayer() {
|
||||||
return this.jPlayer;
|
return jPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionInfo getInfo() {
|
public ActionInfo getInfo() {
|
||||||
return this.info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BufferedPayment getPayment() {
|
public BufferedPayment getPayment() {
|
||||||
return this.payment;
|
return payment;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job getJob() {
|
public Job getJob() {
|
||||||
return this.job;
|
return job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getTime() {
|
public Long getTime() {
|
||||||
return this.time;
|
return time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ import com.gamingmesh.jobs.Jobs;
|
|||||||
|
|
||||||
public class ItemBonusCache {
|
public class ItemBonusCache {
|
||||||
|
|
||||||
Player player;
|
private Player player;
|
||||||
private Long lastCheck = null;
|
private Long lastCheck = null;
|
||||||
private BoostMultiplier bm = new BoostMultiplier();
|
private BoostMultiplier bm = new BoostMultiplier();
|
||||||
private Job job;
|
private Job job;
|
||||||
|
@ -139,7 +139,7 @@ public class Job {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BoostMultiplier getBoost() {
|
public BoostMultiplier getBoost() {
|
||||||
return this.boost;
|
return boost;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSame(Job job) {
|
public boolean isSame(Job job) {
|
||||||
@ -185,15 +185,15 @@ public class Job {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getCmdOnJoin() {
|
public List<String> getCmdOnJoin() {
|
||||||
return this.CmdOnJoin;
|
return CmdOnJoin;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getCmdOnLeave() {
|
public List<String> getCmdOnLeave() {
|
||||||
return this.CmdOnLeave;
|
return CmdOnLeave;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getGuiItem() {
|
public ItemStack getGuiItem() {
|
||||||
return this.GUIitem;
|
return GUIitem;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,11 +62,11 @@ public class JobInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getFromLevel() {
|
public int getFromLevel() {
|
||||||
return this.fromLevel;
|
return fromLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getUntilLevel() {
|
public int getUntilLevel() {
|
||||||
return this.untilLevel;
|
return untilLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isInLevelRange(int level) {
|
public boolean isInLevelRange(int level) {
|
||||||
@ -74,7 +74,7 @@ public class JobInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRealisticName() {
|
public String getRealisticName() {
|
||||||
@ -86,27 +86,27 @@ public class JobInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return this.id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionType getActionType() {
|
public ActionType getActionType() {
|
||||||
return this.actionType;
|
return actionType;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMeta() {
|
public String getMeta() {
|
||||||
return this.meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getBaseIncome() {
|
public double getBaseIncome() {
|
||||||
return this.baseIncome;
|
return baseIncome;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getBaseXp() {
|
public double getBaseXp() {
|
||||||
return this.baseXp;
|
return baseXp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getBasePoints() {
|
public double getBasePoints() {
|
||||||
return this.basePoints;
|
return basePoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getIncome(double level, double numjobs) {
|
public double getIncome(double level, double numjobs) {
|
||||||
|
@ -28,10 +28,10 @@ public class JobItemBonus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getNode() {
|
public String getNode() {
|
||||||
return this.node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BoostMultiplier getBoost() {
|
public BoostMultiplier getBoost() {
|
||||||
return this.boostMultiplier.clone();
|
return boostMultiplier.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ public class JobItems {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getNode() {
|
public String getNode() {
|
||||||
return this.node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack getItemStack(Player player) {
|
public ItemStack getItemStack(Player player) {
|
||||||
@ -93,30 +93,30 @@ public class JobItems {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return this.id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getData() {
|
public int getData() {
|
||||||
return this.data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAmount() {
|
public int getAmount() {
|
||||||
return this.amount;
|
return amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getLore() {
|
public List<String> getLore() {
|
||||||
return this.lore;
|
return lore;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<Enchantment, Integer> getEnchants() {
|
public HashMap<Enchantment, Integer> getEnchants() {
|
||||||
return this.enchants;
|
return enchants;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BoostMultiplier getBoost() {
|
public BoostMultiplier getBoost() {
|
||||||
return this.boostMultiplier.clone();
|
return boostMultiplier.clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,26 +40,26 @@ public class JobLimitedItems {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getNode() {
|
public String getNode() {
|
||||||
return this.node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return this.id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getLore() {
|
public List<String> getLore() {
|
||||||
return this.lore;
|
return lore;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<Enchantment, Integer> getenchants() {
|
public HashMap<Enchantment, Integer> getenchants() {
|
||||||
return this.enchants;
|
return enchants;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return this.level;
|
return level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,8 +146,8 @@ public class JobsPlayer {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayer(Player p) {
|
public void setPlayer(Player player) {
|
||||||
this.player = p;
|
this.player = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadLogFromDao() {
|
public void loadLogFromDao() {
|
||||||
@ -155,7 +155,7 @@ public class JobsPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized List<String> getUpdateBossBarFor() {
|
public synchronized List<String> getUpdateBossBarFor() {
|
||||||
return this.updateBossBarFor;
|
return updateBossBarFor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void clearUpdateBossBarFor() {
|
public synchronized void clearUpdateBossBarFor() {
|
||||||
@ -163,7 +163,7 @@ public class JobsPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized List<BossBarInfo> getBossBarInfo() {
|
public synchronized List<BossBarInfo> getBossBarInfo() {
|
||||||
return this.barMap;
|
return barMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void hideBossBars() {
|
public synchronized void hideBossBars() {
|
||||||
@ -173,7 +173,7 @@ public class JobsPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Log> getLog() {
|
public HashMap<String, Log> getLog() {
|
||||||
return this.logList;
|
return logList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setLog(HashMap<String, Log> l) {
|
public void setLog(HashMap<String, Log> l) {
|
||||||
@ -185,7 +185,7 @@ public class JobsPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getUserId() {
|
public int getUserId() {
|
||||||
return this.userid;
|
return userid;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -372,8 +372,8 @@ public class JobsPlayer {
|
|||||||
return this.playerUUID;
|
return this.playerUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPlayerUUID(UUID uuid) {
|
public void setPlayerUUID(UUID playerUUID) {
|
||||||
playerUUID = uuid;
|
this.playerUUID = playerUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayHonorific() {
|
public String getDisplayHonorific() {
|
||||||
@ -761,8 +761,8 @@ public class JobsPlayer {
|
|||||||
return isSaved;
|
return isSaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSaved(boolean value) {
|
public void setSaved(boolean isSaved) {
|
||||||
isSaved = value;
|
this.isSaved = isSaved;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getSeen() {
|
public Long getSeen() {
|
||||||
|
@ -8,8 +8,8 @@ import org.bukkit.ChatColor;
|
|||||||
import com.gamingmesh.jobs.config.CommentedYamlConfiguration;
|
import com.gamingmesh.jobs.config.CommentedYamlConfiguration;
|
||||||
|
|
||||||
public class LocaleReader {
|
public class LocaleReader {
|
||||||
YamlConfiguration config;
|
private YamlConfiguration config;
|
||||||
CommentedYamlConfiguration writer;
|
private CommentedYamlConfiguration writer;
|
||||||
|
|
||||||
public LocaleReader(YamlConfiguration config, CommentedYamlConfiguration writer) {
|
public LocaleReader(YamlConfiguration config, CommentedYamlConfiguration writer) {
|
||||||
this.config = config;
|
this.config = config;
|
||||||
|
@ -15,7 +15,7 @@ public final class Log {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getActionType() {
|
public String getActionType() {
|
||||||
return this.action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(String item, HashMap<CurrencyType, Double> amounts) {
|
public void add(String item, HashMap<CurrencyType, Double> amounts) {
|
||||||
@ -42,11 +42,11 @@ public final class Log {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getDate() {
|
public int getDate() {
|
||||||
return this.day;
|
return day;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, LogAmounts> getAmountList() {
|
public HashMap<String, LogAmounts> getAmountList() {
|
||||||
return this.amountMap;
|
return amountMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCount(String item) {
|
public int getCount(String item) {
|
||||||
|
@ -20,15 +20,15 @@ public final class LogAmounts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNewEntry() {
|
public boolean isNewEntry() {
|
||||||
return this.newEntry;
|
return newEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNewEntry(boolean state) {
|
public void setNewEntry(boolean newEntry) {
|
||||||
this.newEntry = state;
|
this.newEntry = newEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getItemName() {
|
public String getItemName() {
|
||||||
return this.item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(HashMap<CurrencyType, Double> amounts) {
|
public void add(HashMap<CurrencyType, Double> amounts) {
|
||||||
@ -58,7 +58,7 @@ public final class LogAmounts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return this.count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCount(int count) {
|
public void setCount(int count) {
|
||||||
@ -70,7 +70,7 @@ public final class LogAmounts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
return this.username;
|
return username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAction(String action) {
|
public void setAction(String action) {
|
||||||
@ -78,7 +78,7 @@ public final class LogAmounts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getAction() {
|
public String getAction() {
|
||||||
return this.action;
|
return action;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,10 @@ package com.gamingmesh.jobs.container;
|
|||||||
|
|
||||||
public class NameList {
|
public class NameList {
|
||||||
|
|
||||||
String id;
|
private String id;
|
||||||
String meta;
|
private String meta;
|
||||||
String Name;
|
private String Name;
|
||||||
String MinecraftName;
|
private String MinecraftName;
|
||||||
|
|
||||||
public NameList(String id, String meta, String Name, String MinecraftName) {
|
public NameList(String id, String meta, String Name, String MinecraftName) {
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
@ -6,12 +6,12 @@ import com.gamingmesh.jobs.Jobs;
|
|||||||
|
|
||||||
public class PlayerInfo {
|
public class PlayerInfo {
|
||||||
|
|
||||||
int id;
|
private int id;
|
||||||
String name = "Unknown";
|
private String name = "Unknown";
|
||||||
private Long seen;
|
private Long seen;
|
||||||
private Integer questsDone;
|
private Integer questsDone;
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
private JobsPlayer player;
|
private JobsPlayer player;
|
||||||
|
|
||||||
public PlayerInfo(String name, int id, UUID uuid, Long seen, Integer questsDone) {
|
public PlayerInfo(String name, int id, UUID uuid, Long seen, Integer questsDone) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -2,9 +2,9 @@ package com.gamingmesh.jobs.container;
|
|||||||
|
|
||||||
public class PlayerPoints {
|
public class PlayerPoints {
|
||||||
|
|
||||||
double current = 0D;
|
private double current = 0D;
|
||||||
double total = 0D;
|
private double total = 0D;
|
||||||
boolean newEntry = false;
|
private boolean newEntry = false;
|
||||||
|
|
||||||
public PlayerPoints() {
|
public PlayerPoints() {
|
||||||
newEntry = true;
|
newEntry = true;
|
||||||
@ -47,7 +47,7 @@ public class PlayerPoints {
|
|||||||
return newEntry;
|
return newEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setNewEntry(boolean state) {
|
public void setNewEntry(boolean newEntry) {
|
||||||
newEntry = state;
|
this.newEntry = newEntry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class RestrictedArea {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CuboidArea getCuboidArea() {
|
public CuboidArea getCuboidArea() {
|
||||||
return this.area;
|
return area;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -49,7 +49,7 @@ public class RestrictedArea {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public double getMultiplier() {
|
public double getMultiplier() {
|
||||||
return this.multiplier;
|
return multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,76 +10,76 @@ import com.gamingmesh.jobs.Jobs;
|
|||||||
|
|
||||||
public class Schedule {
|
public class Schedule {
|
||||||
|
|
||||||
int From = 0;
|
private int From = 0;
|
||||||
int Until = 235959;
|
private int Until = 235959;
|
||||||
|
|
||||||
int nextFrom = 0;
|
private int nextFrom = 0;
|
||||||
int nextUntil = 235959;
|
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"));
|
private List<String> Days = new ArrayList<>(Arrays.asList("all"));
|
||||||
List<Job> JobsList = new ArrayList<>();
|
private List<Job> JobsList = new ArrayList<>();
|
||||||
|
|
||||||
List<String> MessageOnStart = new ArrayList<>();
|
private List<String> MessageOnStart = new ArrayList<>();
|
||||||
List<String> MessageOnStop = new ArrayList<>();
|
private List<String> MessageOnStop = new ArrayList<>();
|
||||||
|
|
||||||
List<String> MessageToBroadcast = new ArrayList<>();
|
private List<String> MessageToBroadcast = new ArrayList<>();
|
||||||
|
|
||||||
boolean started = false;
|
private boolean started = false;
|
||||||
boolean stoped = true;
|
private boolean stoped = true;
|
||||||
|
|
||||||
boolean onStop = true;
|
private boolean onStop = true;
|
||||||
boolean OnStart = true;
|
private boolean OnStart = true;
|
||||||
|
|
||||||
long broadcastInfoOn = 0L;
|
private long broadcastInfoOn = 0L;
|
||||||
int broadcastInterval = 0;
|
private int broadcastInterval = 0;
|
||||||
|
|
||||||
public Schedule() {
|
public Schedule() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBroadcastInfoOn(long time) {
|
public void setBroadcastInfoOn(long broadcastInfoOn) {
|
||||||
this.broadcastInfoOn = time;
|
this.broadcastInfoOn = broadcastInfoOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getBroadcastInfoOn() {
|
public long getBroadcastInfoOn() {
|
||||||
return this.broadcastInfoOn;
|
return broadcastInfoOn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBroadcastOnStop(boolean stage) {
|
public void setBroadcastOnStop(boolean onStop) {
|
||||||
this.onStop = stage;
|
this.onStop = onStop;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBroadcastOnStop() {
|
public boolean isBroadcastOnStop() {
|
||||||
return this.onStop;
|
return onStop;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBroadcastOnStart(boolean stage) {
|
public void setBroadcastOnStart(boolean OnStart) {
|
||||||
this.OnStart = stage;
|
this.OnStart = OnStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBroadcastOnStart() {
|
public boolean isBroadcastOnStart() {
|
||||||
return this.OnStart;
|
return OnStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStarted(boolean stage) {
|
public void setStarted(boolean started) {
|
||||||
this.started = stage;
|
this.started = started;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStarted() {
|
public boolean isStarted() {
|
||||||
return this.started;
|
return started;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStoped(boolean con) {
|
public void setStoped(boolean stoped) {
|
||||||
this.stoped = con;
|
this.stoped = stoped;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isStoped() {
|
public boolean isStoped() {
|
||||||
return this.stoped;
|
return stoped;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBoost(CurrencyType type, double amount) {
|
public void setBoost(CurrencyType type, double amount) {
|
||||||
@ -91,7 +91,7 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public BoostMultiplier getBoost() {
|
public BoostMultiplier getBoost() {
|
||||||
return this.BM;
|
return BM;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setName(String Name) {
|
public void setName(String Name) {
|
||||||
@ -99,7 +99,7 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String GetName() {
|
public String GetName() {
|
||||||
return this.Name;
|
return Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFrom(int From) {
|
public void setFrom(int From) {
|
||||||
@ -107,19 +107,19 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int GetFrom() {
|
public int GetFrom() {
|
||||||
return this.From;
|
return From;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetNextFrom() {
|
public int GetNextFrom() {
|
||||||
return this.nextFrom;
|
return nextFrom;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetNextUntil() {
|
public int GetNextUntil() {
|
||||||
return this.nextUntil;
|
return nextUntil;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNextDay() {
|
public boolean isNextDay() {
|
||||||
return this.nextDay;
|
return nextDay;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUntil(int Until) {
|
public void setUntil(int Until) {
|
||||||
@ -134,7 +134,7 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int GetUntil() {
|
public int GetUntil() {
|
||||||
return this.Until;
|
return Until;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setJobs(List<String> JobsNameList) {
|
public void setJobs(List<String> JobsNameList) {
|
||||||
@ -158,7 +158,7 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Job> GetJobs() {
|
public List<Job> GetJobs() {
|
||||||
return this.JobsList;
|
return JobsList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDays(List<String> Days) {
|
public void setDays(List<String> Days) {
|
||||||
@ -169,7 +169,7 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> GetDays() {
|
public List<String> GetDays() {
|
||||||
return this.Days;
|
return Days;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessageOnStart(List<String> msg, String From, String Until) {
|
public void setMessageOnStart(List<String> msg, String From, String Until) {
|
||||||
@ -181,7 +181,7 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> GetMessageOnStart() {
|
public List<String> GetMessageOnStart() {
|
||||||
return this.MessageOnStart;
|
return MessageOnStart;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessageOnStop(List<String> msg, String From, String Until) {
|
public void setMessageOnStop(List<String> msg, String From, String Until) {
|
||||||
@ -193,7 +193,7 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> GetMessageOnStop() {
|
public List<String> GetMessageOnStop() {
|
||||||
return this.MessageOnStop;
|
return MessageOnStop;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setMessageToBroadcast(List<String> msg, String From, String Until) {
|
public void setMessageToBroadcast(List<String> msg, String From, String Until) {
|
||||||
@ -205,15 +205,15 @@ public class Schedule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> GetMessageToBroadcast() {
|
public List<String> GetMessageToBroadcast() {
|
||||||
return this.MessageToBroadcast;
|
return MessageToBroadcast;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBroadcastInterval(int From) {
|
public void setBroadcastInterval(int broadcastInterval) {
|
||||||
this.broadcastInterval = From;
|
this.broadcastInterval = broadcastInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetBroadcastInterval() {
|
public int GetBroadcastInterval() {
|
||||||
return this.broadcastInterval;
|
return broadcastInterval;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getPage() {
|
public int getPage() {
|
||||||
return this.page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSlot(Integer slot) {
|
public void setSlot(Integer slot) {
|
||||||
@ -48,7 +48,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getSlot() {
|
public int getSlot() {
|
||||||
return this.slot;
|
return slot;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setitems(List<JobItems> items) {
|
public void setitems(List<JobItems> items) {
|
||||||
@ -56,7 +56,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<JobItems> getitems() {
|
public List<JobItems> getitems() {
|
||||||
return this.items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCommands(List<String> Commands) {
|
public void setCommands(List<String> Commands) {
|
||||||
@ -64,7 +64,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getCommands() {
|
public List<String> getCommands() {
|
||||||
return this.Commands;
|
return Commands;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRequiredJobs(HashMap<String, Integer> RequiredJobs) {
|
public void setRequiredJobs(HashMap<String, Integer> RequiredJobs) {
|
||||||
@ -72,7 +72,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public HashMap<String, Integer> getRequiredJobs() {
|
public HashMap<String, Integer> getRequiredJobs() {
|
||||||
return this.RequiredJobs;
|
return RequiredJobs;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRequiredPerm(List<String> RequiredPerm) {
|
public void setRequiredPerm(List<String> RequiredPerm) {
|
||||||
@ -80,7 +80,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getRequiredPerm() {
|
public List<String> getRequiredPerm() {
|
||||||
return this.RequiredPerm;
|
return RequiredPerm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHideWithoutPerm(boolean HideWithoutPerm) {
|
public void setHideWithoutPerm(boolean HideWithoutPerm) {
|
||||||
@ -88,7 +88,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHideWithoutPerm() {
|
public boolean isHideWithoutPerm() {
|
||||||
return this.HideWithoutPerm;
|
return HideWithoutPerm;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIconLore(List<String> IconLore) {
|
public void setIconLore(List<String> IconLore) {
|
||||||
@ -96,19 +96,19 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getIconLore() {
|
public List<String> getIconLore() {
|
||||||
return this.IconLore;
|
return IconLore;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNodeName() {
|
public String getNodeName() {
|
||||||
return this.NodeName;
|
return NodeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIconId() {
|
public int getIconId() {
|
||||||
return this.IconId;
|
return IconId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getIconData() {
|
public int getIconData() {
|
||||||
return this.IconData;
|
return IconData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIconData(int IconData) {
|
public void setIconData(int IconData) {
|
||||||
@ -116,7 +116,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public double getPrice() {
|
public double getPrice() {
|
||||||
return this.price;
|
return price;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIconAmount(int IconAmount) {
|
public void setIconAmount(int IconAmount) {
|
||||||
@ -124,7 +124,7 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getIconAmount() {
|
public int getIconAmount() {
|
||||||
return this.IconAmount;
|
return IconAmount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIconName(String IconName) {
|
public void setIconName(String IconName) {
|
||||||
@ -132,14 +132,14 @@ public class ShopItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getIconName() {
|
public String getIconName() {
|
||||||
return this.IconName;
|
return IconName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getRequiredTotalLevels() {
|
public int getRequiredTotalLevels() {
|
||||||
return RequiredTotalLevels;
|
return RequiredTotalLevels;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRequiredTotalLevels(int requiredTotalLevels) {
|
public void setRequiredTotalLevels(int RequiredTotalLevels) {
|
||||||
RequiredTotalLevels = requiredTotalLevels;
|
this.RequiredTotalLevels = RequiredTotalLevels;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ public class Title {
|
|||||||
* Function to return the long name of the title
|
* Function to return the long name of the title
|
||||||
* @return the long name of the title
|
* @return the long name of the title
|
||||||
*/
|
*/
|
||||||
public String getName(){
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ public class Title {
|
|||||||
* Function to return the job name of the title
|
* Function to return the job name of the title
|
||||||
* @return the job name of the title
|
* @return the job name of the title
|
||||||
*/
|
*/
|
||||||
public String getJobName(){
|
public String getJobName() {
|
||||||
return jobName;
|
return jobName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ public class Title {
|
|||||||
* Function to get the ChatColor of the title
|
* Function to get the ChatColor of the title
|
||||||
* @return the chat colour o the title
|
* @return the chat colour o the title
|
||||||
*/
|
*/
|
||||||
public ChatColor getChatColor(){
|
public ChatColor getChatColor() {
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ public class Title {
|
|||||||
* Function to get the levelRequirement of the title
|
* Function to get the levelRequirement of the title
|
||||||
* @return the level requirement for the title
|
* @return the level requirement for the title
|
||||||
*/
|
*/
|
||||||
public int getLevelReq(){
|
public int getLevelReq() {
|
||||||
return levelReq;
|
return levelReq;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ public class Title {
|
|||||||
* Function to get the short name of the title
|
* Function to get the short name of the title
|
||||||
* @return the short name of the title
|
* @return the short name of the title
|
||||||
*/
|
*/
|
||||||
public String getShortName(){
|
public String getShortName() {
|
||||||
return shortName;
|
return shortName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,14 +12,14 @@ public final class TopList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getPlayerName() {
|
public String getPlayerName() {
|
||||||
return this.info.getName();
|
return info.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
return this.level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getExp() {
|
public int getExp() {
|
||||||
return this.exp;
|
return exp;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -53,8 +53,8 @@ public class BufferedPayment {
|
|||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPoints(double amount) {
|
public void setPoints(double points) {
|
||||||
this.points = amount;
|
this.points = points;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExp(double exp) {
|
public void setExp(double exp) {
|
||||||
|
@ -9,8 +9,8 @@ public class IConomy6Adapter implements Economy {
|
|||||||
|
|
||||||
iConomy icon;
|
iConomy icon;
|
||||||
|
|
||||||
public IConomy6Adapter(iConomy iconomy) {
|
public IConomy6Adapter(iConomy icon) {
|
||||||
icon = iconomy;
|
this.icon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getBalance(String playerName) {
|
public double getBalance(String playerName) {
|
||||||
|
@ -7,9 +7,9 @@ import com.gamingmesh.jobs.container.CurrencyType;
|
|||||||
|
|
||||||
public class PaymentData {
|
public class PaymentData {
|
||||||
|
|
||||||
Long lastAnnouced = 0L;
|
private Long lastAnnouced = 0L;
|
||||||
HashMap<CurrencyType, Double> payments = new HashMap<>();
|
private HashMap<CurrencyType, Double> payments = new HashMap<>();
|
||||||
HashMap<CurrencyType, Long> paymentsTimes = new HashMap<>();
|
private HashMap<CurrencyType, Long> paymentsTimes = new HashMap<>();
|
||||||
private boolean Informed = false;
|
private boolean Informed = false;
|
||||||
private boolean Reseted = false;
|
private boolean Reseted = false;
|
||||||
|
|
||||||
@ -39,12 +39,12 @@ public class PaymentData {
|
|||||||
return paymentsTimes.get(type);
|
return paymentsTimes.get(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReseted(boolean state) {
|
public void setReseted(boolean Reseted) {
|
||||||
this.Reseted = state;
|
this.Reseted = Reseted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReseted() {
|
public boolean isReseted() {
|
||||||
return this.Reseted;
|
return Reseted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Double GetAmount(CurrencyType type) {
|
public Double GetAmount(CurrencyType type) {
|
||||||
@ -60,7 +60,7 @@ public class PaymentData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Long GetLastAnnounced() {
|
public Long GetLastAnnounced() {
|
||||||
return this.lastAnnouced;
|
return lastAnnouced;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean IsAnnounceTime(int t) {
|
public boolean IsAnnounceTime(int t) {
|
||||||
@ -136,7 +136,7 @@ public class PaymentData {
|
|||||||
return Informed;
|
return Informed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setInformed(boolean informed) {
|
public void setInformed(boolean Informed) {
|
||||||
Informed = informed;
|
this.Informed = Informed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import com.gamingmesh.jobs.container.PlayerPoints;
|
|||||||
|
|
||||||
public class PointsData {
|
public class PointsData {
|
||||||
|
|
||||||
HashMap<UUID, PlayerPoints> Pointbase = new HashMap<>();
|
private HashMap<UUID, PlayerPoints> Pointbase = new HashMap<>();
|
||||||
|
|
||||||
public PointsData() {
|
public PointsData() {
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
|
|
||||||
import com.gamingmesh.jobs.Jobs;
|
import com.gamingmesh.jobs.Jobs;
|
||||||
@ -69,9 +68,8 @@ public class Language {
|
|||||||
else
|
else
|
||||||
msg = customlocale.contains(key) == true ? Colors(customlocale.getString(key)) : missing;
|
msg = customlocale.contains(key) == true ? Colors(customlocale.getString(key)) : missing;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String message = Colors("&e[Jobs] &2Cant read language file. Plugin will be disabled.");
|
Bukkit.getServer().getConsoleSender().sendMessage(Colors("&e[Jobs] &2Can't read language file. Plugin will be disabled."));
|
||||||
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
|
Bukkit.getServer().getPluginManager().disablePlugin(plugin);
|
||||||
console.sendMessage(message);
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
if (variables.length > 0)
|
if (variables.length > 0)
|
||||||
@ -131,7 +129,7 @@ public class Language {
|
|||||||
return temp;
|
return temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String Colors(String text) {
|
private String Colors(String text) {
|
||||||
return ChatColor.translateAlternateColorCodes('&', text);
|
return ChatColor.translateAlternateColorCodes('&', text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +139,7 @@ public class Language {
|
|||||||
* @return the message
|
* @return the message
|
||||||
*/
|
*/
|
||||||
public String getDefaultMessage(String key) {
|
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";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -449,7 +449,7 @@ public class JobsListener implements Listener {
|
|||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (!event.getPlayer().hasPermission("jobs.command.signs")) {
|
if (!player.hasPermission("jobs.command.signs")) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.sendMessage(Jobs.getLanguage().getMessage("signs.cantcreate"));
|
player.sendMessage(Jobs.getLanguage().getMessage("signs.cantcreate"));
|
||||||
return;
|
return;
|
||||||
@ -565,8 +565,7 @@ public class JobsListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
if (!Jobs.getGCManager().getModifyChat())
|
if (!Jobs.getGCManager().getModifyChat())
|
||||||
return;
|
return;
|
||||||
Player player = event.getPlayer();
|
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(event.getPlayer());
|
||||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
|
||||||
|
|
||||||
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
|
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
|
||||||
|
|
||||||
@ -585,8 +584,7 @@ public class JobsListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
if (Jobs.getGCManager().getModifyChat())
|
if (Jobs.getGCManager().getModifyChat())
|
||||||
return;
|
return;
|
||||||
Player player = event.getPlayer();
|
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(event.getPlayer());
|
||||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
|
||||||
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
|
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
|
||||||
if (honorific.equalsIgnoreCase(" "))
|
if (honorific.equalsIgnoreCase(" "))
|
||||||
honorific = "";
|
honorific = "";
|
||||||
@ -604,8 +602,7 @@ public class JobsListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
if (Jobs.getGCManager().getModifyChat())
|
if (Jobs.getGCManager().getModifyChat())
|
||||||
return;
|
return;
|
||||||
Player player = event.getPlayer();
|
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(event.getPlayer());
|
||||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player);
|
|
||||||
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
|
String honorific = jPlayer != null ? jPlayer.getDisplayHonorific() : "";
|
||||||
if (honorific.equalsIgnoreCase(" "))
|
if (honorific.equalsIgnoreCase(" "))
|
||||||
honorific = "";
|
honorific = "";
|
||||||
|
@ -13,11 +13,7 @@ import com.gamingmesh.jobs.Jobs;
|
|||||||
|
|
||||||
public class PistonProtectionListener implements Listener {
|
public class PistonProtectionListener implements Listener {
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
public PistonProtectionListener() {
|
||||||
private Jobs plugin;
|
|
||||||
|
|
||||||
public PistonProtectionListener(Jobs plugin) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
|
@ -126,6 +126,9 @@ public class FurnaceBrewingHandling {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void save() {
|
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");
|
YmlMaker f = new YmlMaker(Jobs.getInstance(), "furnaceBrewingStands.yml");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user