diff --git a/com/gamingmesh/jobs/Jobs.java b/com/gamingmesh/jobs/Jobs.java index adf56376..d48ad034 100644 --- a/com/gamingmesh/jobs/Jobs.java +++ b/com/gamingmesh/jobs/Jobs.java @@ -20,15 +20,19 @@ package com.gamingmesh.jobs; import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.WeakHashMap; +import java.util.Map.Entry; import java.util.logging.Logger; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.OfflinePlayer; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -46,6 +50,8 @@ import com.gamingmesh.jobs.economy.Economy; import com.gamingmesh.jobs.economy.PaymentData; import com.gamingmesh.jobs.i18n.Language; import com.gamingmesh.jobs.stuff.ActionBar; +import com.gamingmesh.jobs.stuff.Debug; +import com.gamingmesh.jobs.stuff.Explore; import com.gamingmesh.jobs.stuff.JobsClassLoader; import com.gamingmesh.jobs.stuff.Loging; import com.gamingmesh.jobs.stuff.Scboard; @@ -61,6 +67,7 @@ public class Jobs { private static SignUtil signManager = new SignUtil(); private static Scboard scboardManager = new Scboard(); private static ScheduleUtil scheduleManager = new ScheduleUtil(); + private static Explore exploreManager = new Explore(); private static Logger pLogger; private static File dataFolder; @@ -103,6 +110,14 @@ public class Jobs { scheduleManager = new ScheduleUtil(plugin); } + public static Explore getExplore() { + return exploreManager; + } + + public static void setExplore() { + exploreManager = new Explore(); + } + /** * Returns scoreboard manager * @return the scoreboard manager @@ -537,23 +552,53 @@ public class Jobs { // Item boost check Double itemMoneyBoost = 0.0; Double itemExpBoost = 0.0; - if (item != null) + if (item != null) { + + ItemMeta meta = item.getItemMeta(); + String name = null; + List lore = new ArrayList(); + if (item.hasItemMeta()) { - ItemMeta meta = item.getItemMeta(); - if (meta.hasDisplayName() && meta.hasLore()) - for (JobItems oneItem : prog.getJob().getItems()) { - if (oneItem.getId() != item.getTypeId()) - continue; - if (!ChatColor.translateAlternateColorCodes('&', oneItem.getName()).equalsIgnoreCase(meta.getDisplayName())) - continue; - if (!oneItem.getLore().equals(meta.getLore())) - continue; - itemMoneyBoost = ((income * oneItem.getMoneyBoost()) - income); - itemExpBoost = ((exp * oneItem.getExpBoost()) - exp); - break; - } + if (meta.hasDisplayName()) + name = meta.getDisplayName(); + if (meta.hasLore()) + lore = meta.getLore(); } + Map enchants = item.getEnchantments(); + + main: for (JobItems oneItem : prog.getJob().getItems()) { + if (oneItem.getId() != item.getTypeId()) + continue; + + if (oneItem.getName() != null && name != null) + if (!org.bukkit.ChatColor.translateAlternateColorCodes('&', oneItem.getName()).equalsIgnoreCase(name)) + continue; + + for (String onelore : oneItem.getLore()) { + if (lore.size() == 0 || !lore.contains(onelore)) + continue main; + } + + for (Entry oneE : enchants.entrySet()) { + if (oneItem.getenchants().containsKey(oneE.getKey())) { + if (oneItem.getenchants().get(oneE.getKey()) < oneE.getValue()) { + continue main; + } + } else + continue main; + } + + itemMoneyBoost = ((income * oneItem.getMoneyBoost()) - income); + itemExpBoost = ((exp * oneItem.getExpBoost()) - exp); + + Debug.D("boost"); + + break; + } + + } + // Armor boost check Double armorMoneyBoost = 0.0; Double armorExpBoost = 0.0; diff --git a/com/gamingmesh/jobs/JobsPlugin.java b/com/gamingmesh/jobs/JobsPlugin.java index 14e464a1..7f977200 100644 --- a/com/gamingmesh/jobs/JobsPlugin.java +++ b/com/gamingmesh/jobs/JobsPlugin.java @@ -109,6 +109,7 @@ public class JobsPlugin extends JavaPlugin { Jobs.setScboard(this); Jobs.setSchedule(this); Jobs.setLanguage(this); + Jobs.setExplore(); Jobs.setPluginLogger(getLogger()); @@ -162,11 +163,14 @@ public class JobsPlugin extends JavaPlugin { ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); console.sendMessage(message); Jobs.getLanguage().reload(ConfigManager.getJobsConfiguration().getLocale()); + + Jobs.getJobsDAO().loadExplore(); } @Override public void onDisable() { GuiTools.CloseInventories(); + Jobs.getJobsDAO().saveExplore(); Jobs.shutdown(); String message = ChatColor.translateAlternateColorCodes('&', "&e[Jobs] &2Plugin has been disabled succesfully."); ConsoleCommandSender console = Bukkit.getServer().getConsoleSender(); diff --git a/com/gamingmesh/jobs/actions/.gitignore b/com/gamingmesh/jobs/actions/.gitignore index 46baed78..1938d205 100644 --- a/com/gamingmesh/jobs/actions/.gitignore +++ b/com/gamingmesh/jobs/actions/.gitignore @@ -5,3 +5,5 @@ /EnchantActionInfo.class /CustomKillInfo.class /MMKillInfo.class +/WxploreActionInfo.class +/ExploreActionInfo.class diff --git a/com/gamingmesh/jobs/actions/ExploreActionInfo.java b/com/gamingmesh/jobs/actions/ExploreActionInfo.java new file mode 100644 index 00000000..87d0a722 --- /dev/null +++ b/com/gamingmesh/jobs/actions/ExploreActionInfo.java @@ -0,0 +1,42 @@ +/** + * Jobs Plugin for Bukkit + * Copyright (C) 2011 Zak Ford + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.gamingmesh.jobs.actions; + +import com.gamingmesh.jobs.container.ActionInfo; +import com.gamingmesh.jobs.container.ActionType; +import com.gamingmesh.jobs.container.BaseActionInfo; + +public class ExploreActionInfo extends BaseActionInfo implements ActionInfo { + private String place; + + public ExploreActionInfo(String place, ActionType type) { + super(type); + this.place = place; + } + + @Override + public String getName() { + return place; + } + + @Override + public String getNameWithSub() { + return getName(); + } +} diff --git a/com/gamingmesh/jobs/api/.gitignore b/com/gamingmesh/jobs/api/.gitignore index fc96c543..5ba42b3f 100644 --- a/com/gamingmesh/jobs/api/.gitignore +++ b/com/gamingmesh/jobs/api/.gitignore @@ -6,3 +6,4 @@ /JobsLeaveEvent.class /JobsLevelUpEvent.class /JobsPaymentEvent.class +/JobsChunkChangeEvent.class diff --git a/com/gamingmesh/jobs/api/JobsChunkChangeEvent.java b/com/gamingmesh/jobs/api/JobsChunkChangeEvent.java new file mode 100644 index 00000000..55cd113a --- /dev/null +++ b/com/gamingmesh/jobs/api/JobsChunkChangeEvent.java @@ -0,0 +1,49 @@ +package com.gamingmesh.jobs.api; + +import org.bukkit.Chunk; +import org.bukkit.entity.Player; +import org.bukkit.event.Cancellable; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +public final class JobsChunkChangeEvent extends Event implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private Player player; + private Chunk oldChunk; + private Chunk newChunk; + private boolean cancelled; + + public JobsChunkChangeEvent(Player player, Chunk oldChunk, Chunk newChunk) { + this.player = player; + this.oldChunk = oldChunk; + this.newChunk = newChunk; + } + + public Player getPlayer() { + return this.player; + } + + public Chunk getOldChunk() { + return this.oldChunk; + } + + public Chunk getNewChunk() { + return this.newChunk; + } + + public boolean isCancelled() { + return cancelled; + } + + public void setCancelled(boolean cancel) { + cancelled = cancel; + } + + public HandlerList getHandlers() { + return handlers; + } + + public static HandlerList getHandlerList() { + return handlers; + } +} \ No newline at end of file diff --git a/com/gamingmesh/jobs/commands/JobsCommands.java b/com/gamingmesh/jobs/commands/JobsCommands.java index 3469cfae..ade8df61 100644 --- a/com/gamingmesh/jobs/commands/JobsCommands.java +++ b/com/gamingmesh/jobs/commands/JobsCommands.java @@ -1532,7 +1532,7 @@ public class JobsCommands implements CommandExecutor { .replace("%username%", one.getKey().getUsername()) .replace("%number%", String.valueOf(count)) .replace("%action%", info.getAction()) - .replace("%item%", one.getKey().getItemName().replace(":0", "").toLowerCase()) + .replace("%item%", one.getKey().getItemName().replace(":0", "").replace("_", " ").toLowerCase()) .replace("%qty%", String.valueOf(one.getKey().getCount())) .replace("%money%", String.valueOf(one.getKey().getMoney())) .replace("%exp%", String.valueOf(one.getKey().getExp())); diff --git a/com/gamingmesh/jobs/config/JobConfig.java b/com/gamingmesh/jobs/config/JobConfig.java index 37e8dbcb..e85ab414 100644 --- a/com/gamingmesh/jobs/config/JobConfig.java +++ b/com/gamingmesh/jobs/config/JobConfig.java @@ -23,6 +23,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import org.apache.commons.lang.StringEscapeUtils; @@ -43,6 +44,7 @@ import com.gamingmesh.jobs.container.JobCommands; import com.gamingmesh.jobs.container.JobConditions; import com.gamingmesh.jobs.container.JobInfo; import com.gamingmesh.jobs.container.JobItems; +import com.gamingmesh.jobs.container.JobLimitedItems; import com.gamingmesh.jobs.container.JobPermission; import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.stuff.ChatColor; @@ -285,17 +287,34 @@ public class JobConfig { continue; } int id = itemSection.getInt("id"); - String name = itemSection.getString("name"); + + String name = null; + if (itemSection.isString("name")) + name = itemSection.getString("name"); List lore = new ArrayList(); - for (String eachLine : itemSection.getStringList("lore")) { - lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); - } + if (itemSection.getStringList("lore") != null) + for (String eachLine : itemSection.getStringList("lore")) { + lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); + } - List enchants = new ArrayList(); + HashMap enchants = new HashMap(); if (itemSection.getStringList("enchants") != null) for (String eachLine : itemSection.getStringList("enchants")) { - enchants.add(eachLine); + + if (!eachLine.contains("=")) + continue; + + Enchantment ench = Enchantment.getByName(eachLine.split("=")[0]); + Integer level = -1; + try { + level = Integer.parseInt(eachLine.split("=")[1]); + } catch (NumberFormatException e) { + continue; + } + + if (ench != null && level != -1) + enchants.put(ench, level); } Double moneyBoost = itemSection.getDouble("moneyBoost"); @@ -304,8 +323,57 @@ public class JobConfig { } } + // Limited Items + ArrayList jobLimitedItems = new ArrayList(); + ConfigurationSection LimitedItemsSection = jobSection.getConfigurationSection("limitedItems"); + if (LimitedItemsSection != null) { + for (String itemKey : LimitedItemsSection.getKeys(false)) { + ConfigurationSection itemSection = LimitedItemsSection.getConfigurationSection(itemKey); + + String node = itemKey.toLowerCase(); + if (itemSection == null) { + Jobs.getPluginLogger().warning("Job " + jobKey + " has an invalid item key " + itemKey + "!"); + continue; + } + int id = itemSection.getInt("id"); + + String name = null; + if (itemSection.isString("name")) + name = itemSection.getString("name"); + + List lore = new ArrayList(); + if (itemSection.getStringList("lore") != null) + for (String eachLine : itemSection.getStringList("lore")) { + lore.add(org.bukkit.ChatColor.translateAlternateColorCodes('&', eachLine)); + } + + HashMap enchants = new HashMap(); + if (itemSection.getStringList("enchants") != null) + for (String eachLine : itemSection.getStringList("enchants")) { + + if (!eachLine.contains("=")) + continue; + + Enchantment ench = Enchantment.getByName(eachLine.split("=")[0]); + Integer level = -1; + try { + level = Integer.parseInt(eachLine.split("=")[1]); + } catch (NumberFormatException e) { + continue; + } + + if (ench != null && level != -1) + enchants.put(ench, level); + } + + int level = itemSection.getInt("level"); + + jobLimitedItems.add(new JobLimitedItems(node, id, name, lore, enchants, level)); + } + } + Job job = new Job(jobName, jobShortName, description, color, maxExpEquation, displayMethod, maxLevel, vipmaxLevel, maxSlots, jobPermissions, jobCommand, - jobConditions, jobItems, JobsCommandOnJoin, JobsCommandOnLeave, GUIitem); + jobConditions, jobItems, jobLimitedItems, JobsCommandOnJoin, JobsCommandOnLeave, GUIitem); for (ActionType actionType : ActionType.values()) { ConfigurationSection typeSection = jobSection.getConfigurationSection(actionType.getName()); @@ -347,6 +415,9 @@ public class JobConfig { } } + if (actionType == ActionType.EXPLORE) + material = null; + if (material != null) { // Break and Place actions MUST be blocks if (actionType == ActionType.BREAK || actionType == ActionType.PLACE) { @@ -422,6 +493,17 @@ public class JobConfig { type = myKey; } else if (actionType == ActionType.CUSTOMKILL || actionType == ActionType.SHEAR || actionType == ActionType.MMKILL) { type = myKey; + } else if (actionType == ActionType.EXPLORE) { + type = myKey; + int amount = 10; + try { + amount = Integer.valueOf(myKey); + } catch (NumberFormatException e) { + Jobs.getPluginLogger().warning("Job " + jobKey + " has an invalid " + actionType.getName() + " type property: " + key + "!"); + continue; + } + Jobs.getExplore().setExploreEnabled(); + Jobs.getExplore().setPlayerAmount(amount + 1); } if (type == null) { diff --git a/com/gamingmesh/jobs/config/JobsConfiguration.java b/com/gamingmesh/jobs/config/JobsConfiguration.java index 063258a2..1c6b197c 100644 --- a/com/gamingmesh/jobs/config/JobsConfiguration.java +++ b/com/gamingmesh/jobs/config/JobsConfiguration.java @@ -62,6 +62,7 @@ public class JobsConfiguration { protected boolean isBroadcastingSkillups; protected boolean isBroadcastingLevelups; protected boolean payInCreative; + protected boolean payExploringWhenFlying; protected boolean addXpPlayer; protected boolean hideJobsWithoutPermission; protected int maxJobs; @@ -171,6 +172,15 @@ public class JobsConfiguration { public synchronized boolean payInCreative() { return payInCreative; } + + /** + * Function that tells if the player should be paid while exploring and flying + * @return true - pay + * @return false - do not + */ + public synchronized boolean payExploringWhenFlying() { + return payExploringWhenFlying; + } /** * Function to return the title for a given level @@ -379,7 +389,7 @@ public class JobsConfiguration { "Theroticali this should work without issues, but if you havving some, just disable", "But then you can feal some small (100-200ms) lag spikes while performings some jobs commands"); LocalOfflinePlayersData = getBoolean("Optimizations.UseLocalOfflinePlayersData", true, config, writer); - + writer.addComment("Logging.Use", "With this set to true all players jobs actions will be logged to database for easy to see statistics", "This is still in development and in feature it will expand"); LoggingUse = getBoolean("Logging.Use", false, config, writer); @@ -414,6 +424,9 @@ public class JobsConfiguration { writer.addComment("enable-pay-creative", "Option to allow payment to be made in creative mode"); payInCreative = getBoolean("enable-pay-creative", false, config, writer); + + writer.addComment("enable-pay-for-exploring-when-flying", "Option to allow payment to be made for exploring when player flyies"); + payExploringWhenFlying = getBoolean("enable-pay-for-exploring-when-flying", false, config, writer); writer.addComment("add-xp-player", "Adds the Jobs xp recieved to the player's Minecraft XP bar"); addXpPlayer = getBoolean("add-xp-player", false, config, writer); @@ -1206,6 +1219,7 @@ public class JobsConfiguration { languages.add("cs"); languages.add("fr"); languages.add("ru"); + languages.add("cz"); for (String lang : languages) { YmlMaker langFile = new YmlMaker((JavaPlugin) plugin, "locale" + File.separator + "messages_" + lang + ".yml"); @@ -1230,6 +1244,7 @@ public class JobsConfiguration { conf.options().copyDefaults(true); GetConfigString("economy.error.nomoney", "Sorry, no money left in national bank!", writer, conf, true); + GetConfigString("limitedItem.error.levelup", "&cYou need to levelup in [jobname] to use this item!", writer, conf, true); GetConfigString("command.moneyboost.help.info", "Boosts Money gain for all players", writer, conf, true); GetConfigString("command.moneyboost.help.args", "[jobname] [rate]", writer, conf, true); @@ -1340,6 +1355,8 @@ public class JobsConfiguration { GetConfigString("command.info.output.milk.none", "%jobname% does not get money from milking cows.", writer, conf, true); GetConfigString("command.info.output.shear.info", "Shear", writer, conf, true); GetConfigString("command.info.output.shear.none", "%jobname% does not get money from shearing sheeps.", writer, conf, true); + GetConfigString("command.info.output.explore.info", "Explore", writer, conf, true); + GetConfigString("command.info.output.explore.none", "%jobname% does not get money from exploring.", writer, conf, true); GetConfigString("command.info.output.custom-kill.info", "Custom kill", writer, conf, true); GetConfigString("command.info.output.custom-kill.none", "%jobname% does not get money from custom player kills.", writer, conf, true); diff --git a/com/gamingmesh/jobs/container/.gitignore b/com/gamingmesh/jobs/container/.gitignore index 05ff95db..9c0150da 100644 --- a/com/gamingmesh/jobs/container/.gitignore +++ b/com/gamingmesh/jobs/container/.gitignore @@ -21,3 +21,7 @@ /Log.class /LogAmounts.class /JobConditions.class +/JobLimitedItems.class +/ExploreRegion.class +/ExploreChunk.class +/ExploreWorld.class diff --git a/com/gamingmesh/jobs/container/ActionType.java b/com/gamingmesh/jobs/container/ActionType.java index dbf5e64d..d1f416ab 100644 --- a/com/gamingmesh/jobs/container/ActionType.java +++ b/com/gamingmesh/jobs/container/ActionType.java @@ -34,6 +34,7 @@ public enum ActionType { DYE("Dye"), SHEAR("Shear"), MILK("Milk"), + EXPLORE("Explore"), CUSTOMKILL("custom-kill"); private String name; diff --git a/com/gamingmesh/jobs/container/ExploreChunk.java b/com/gamingmesh/jobs/container/ExploreChunk.java new file mode 100644 index 00000000..078935b1 --- /dev/null +++ b/com/gamingmesh/jobs/container/ExploreChunk.java @@ -0,0 +1,59 @@ +package com.gamingmesh.jobs.container; + +import java.util.ArrayList; +import java.util.List; + +import com.gamingmesh.jobs.Jobs; + +public class ExploreChunk { + + int x; + int z; + List playerNames = new ArrayList(); + boolean isNewChunk = true; + + public ExploreChunk(String playerName, int x, int z) { + this.x = x; + this.z = z; + this.playerNames.add(playerName); + } + + public ExploreRespond addPlayer(String playerName) { + boolean newChunk = false; + if (!playerNames.contains(playerName)) { + playerNames.add(playerName); + newChunk = true; + } + if (playerNames.size() > Jobs.getExplore().getPlayerAmount()) + playerNames.remove(0); + return new ExploreRespond(playerNames.size(), newChunk); + } + + public boolean isAlreadyVisited(String playerName) { + return playerNames.contains(playerName); + } + + public int getCount() { + return this.playerNames.size(); + } + + public int getX() { + return this.x; + } + + public int getZ() { + return this.z; + } + + public List getPlayers() { + return this.playerNames; + } + + public boolean isNew() { + return this.isNewChunk; + } + + public void setOldChunk() { + isNewChunk = false; + } +} diff --git a/com/gamingmesh/jobs/container/ExploreRegion.java b/com/gamingmesh/jobs/container/ExploreRegion.java new file mode 100644 index 00000000..73b3b90a --- /dev/null +++ b/com/gamingmesh/jobs/container/ExploreRegion.java @@ -0,0 +1,29 @@ +package com.gamingmesh.jobs.container; + +import java.util.ArrayList; +import java.util.List; + +public class ExploreRegion { + + int x; + int z; + List chunks = new ArrayList(); + + public ExploreRegion(int x, int z, List chunks) { + this.x = x; + this.z = z; + } + + public ExploreRegion(int x, int z) { + this.x = x; + this.z = z; + } + + public void addChunk(ExploreChunk chunk) { + chunks.add(chunk); + } + + public List getChunks() { + return chunks; + } +} diff --git a/com/gamingmesh/jobs/container/ExploreRespond.java b/com/gamingmesh/jobs/container/ExploreRespond.java new file mode 100644 index 00000000..f4a0745d --- /dev/null +++ b/com/gamingmesh/jobs/container/ExploreRespond.java @@ -0,0 +1,20 @@ +package com.gamingmesh.jobs.container; + +public class ExploreRespond { + + int count; + boolean newChunk = false; + + public ExploreRespond(int count, boolean newChunk) { + this.count = count; + this.newChunk = newChunk; + } + + public int getCount() { + return this.count; + } + + public boolean isNewChunk() { + return this.newChunk; + } +} diff --git a/com/gamingmesh/jobs/container/Job.java b/com/gamingmesh/jobs/container/Job.java index 61ce78f2..765c2179 100644 --- a/com/gamingmesh/jobs/container/Job.java +++ b/com/gamingmesh/jobs/container/Job.java @@ -32,326 +32,341 @@ import com.gamingmesh.jobs.resources.jfep.Parser; import com.gamingmesh.jobs.stuff.ChatColor; public class Job { - // job info - private EnumMap> jobInfo = new EnumMap>(ActionType.class); - // permissions - private List jobPermissions; - // commands - private List jobCommands; - // conditions - private List jobConditions; - // items - private List jobItems; - // job name - private String jobName; - // job short name (for use in multiple jobs) - private String jobShortName; - // short description of the job - private String description; - // job chat colour - private ChatColor jobColour; - // job leveling equation - private Parser maxExpEquation; - // display method - private DisplayMethod displayMethod; - // max level - private int maxLevel; - // vip max level - private int vipmaxLevel = 0; - // max number of people allowed with this job on the server. - private Integer maxSlots; - // Commands to be performed on player job join - private List CmdOnJoin = new ArrayList(); - // Commands to be performed on player job leave - private List CmdOnLeave = new ArrayList(); - // Item for GUI - private ItemStack GUIitem; + // job info + private EnumMap> jobInfo = new EnumMap>(ActionType.class); + // permissions + private List jobPermissions; + // commands + private List jobCommands; + // conditions + private List jobConditions; + // items + private List jobItems; + // limited items + private List jobLimitedItems; + // job name + private String jobName; + // job short name (for use in multiple jobs) + private String jobShortName; + // short description of the job + private String description; + // job chat colour + private ChatColor jobColour; + // job leveling equation + private Parser maxExpEquation; + // display method + private DisplayMethod displayMethod; + // max level + private int maxLevel; + // vip max level + private int vipmaxLevel = 0; + // max number of people allowed with this job on the server. + private Integer maxSlots; + // Commands to be performed on player job join + private List CmdOnJoin = new ArrayList(); + // Commands to be performed on player job leave + private List CmdOnLeave = new ArrayList(); + // Item for GUI + private ItemStack GUIitem; - private int totalPlayers = -1; - private double bonus = 0.0; + private int totalPlayers = -1; + private double bonus = 0.0; - private double ExpBoost = 1.0; + private double ExpBoost = 1.0; - private double MoneyBoost = 1.0; + private double MoneyBoost = 1.0; - /** - * Constructor - * @param jobName - the name of the job - * @param jobShortName - the shortened version of the name of the job. - * @param description - a short description of the job. - * @param jobColour - the colour of the job title as displayed in chat. - * @param maxExpEquation - the equation by which the exp needed to level up is calculated - * @param displayMethod - the display method for this job. - * @param maxLevel - the maximum level allowed (null for no max level) - * @param vipmaxLevel - the maximum vip level allowed (null for no max level) - * @param maxSlots - the maximum number of people allowed to have this job at one time (null for no limits) - * @param jobPermissions - permissions gained for having the job - * @param jobCommands - commands to perform on levelup - * @param jobItems - items with boost - * @param CmdOnJoin - commands performed on player join - * @param CmdOnLeave - commands performed on player leave - * @param jobConditions - jobs conditions - */ - public Job(String jobName, String jobShortName, String description, ChatColor jobColour, Parser maxExpEquation, DisplayMethod displayMethod, int maxLevel, int vipmaxLevel, Integer maxSlots, List jobPermissions, List jobCommands, List jobConditions, List jobItems, List CmdOnJoin, List CmdOnLeave, ItemStack GUIitem) { - this.jobName = jobName; - this.jobShortName = jobShortName; - this.description = description; - this.jobColour = jobColour; - this.maxExpEquation = maxExpEquation; - this.displayMethod = displayMethod; - this.maxLevel = maxLevel; - this.vipmaxLevel = vipmaxLevel; - this.maxSlots = maxSlots; - this.jobPermissions = jobPermissions; - this.jobCommands = jobCommands; - this.jobConditions = jobConditions; - this.jobItems = jobItems; - this.CmdOnJoin = CmdOnJoin; - this.CmdOnLeave = CmdOnLeave; - this.GUIitem = GUIitem; + /** + * Constructor + * @param jobName - the name of the job + * @param jobShortName - the shortened version of the name of the job. + * @param description - a short description of the job. + * @param jobColour - the colour of the job title as displayed in chat. + * @param maxExpEquation - the equation by which the exp needed to level up is calculated + * @param displayMethod - the display method for this job. + * @param maxLevel - the maximum level allowed (null for no max level) + * @param vipmaxLevel - the maximum vip level allowed (null for no max level) + * @param maxSlots - the maximum number of people allowed to have this job at one time (null for no limits) + * @param jobPermissions - permissions gained for having the job + * @param jobCommands - commands to perform on levelup + * @param jobItems - items with boost + * @param jobLimitedItems - limited items by lvl + * @param CmdOnJoin - commands performed on player join + * @param CmdOnLeave - commands performed on player leave + * @param jobConditions - jobs conditions + */ + public Job(String jobName, String jobShortName, String description, ChatColor jobColour, Parser maxExpEquation, DisplayMethod displayMethod, int maxLevel, + int vipmaxLevel, Integer maxSlots, List jobPermissions, List jobCommands, List jobConditions, List jobItems, + List jobLimitedItems, List CmdOnJoin, List CmdOnLeave, ItemStack GUIitem) { + this.jobName = jobName; + this.jobShortName = jobShortName; + this.description = description; + this.jobColour = jobColour; + this.maxExpEquation = maxExpEquation; + this.displayMethod = displayMethod; + this.maxLevel = maxLevel; + this.vipmaxLevel = vipmaxLevel; + this.maxSlots = maxSlots; + this.jobPermissions = jobPermissions; + this.jobCommands = jobCommands; + this.jobConditions = jobConditions; + this.jobItems = jobItems; + this.jobLimitedItems = jobLimitedItems; + this.CmdOnJoin = CmdOnJoin; + this.CmdOnLeave = CmdOnLeave; + this.GUIitem = GUIitem; + } + + public void setMoneyBoost(double amount) { + this.MoneyBoost = amount; + } + + public double getMoneyBoost() { + return this.MoneyBoost; + } + + public void setExpBoost(double amount) { + this.ExpBoost = amount; + } + + public double getExpBoost() { + return this.ExpBoost; + } + + public int getTotalPlayers() { + if (this.totalPlayers == -1) { + this.totalPlayers = Jobs.getJobsDAO().getTotalPlayerAmountByJobName(this.jobName); + updateBonus(); } + return this.totalPlayers; + } - public void setMoneyBoost(double amount) { - this.MoneyBoost = amount; - } - - public double getMoneyBoost() { - return this.MoneyBoost; - } - - public void setExpBoost(double amount) { - this.ExpBoost = amount; - } - - public double getExpBoost() { - return this.ExpBoost; - } - - public int getTotalPlayers() { - if (this.totalPlayers == -1) { - this.totalPlayers = Jobs.getJobsDAO().getTotalPlayerAmountByJobName(this.jobName); - updateBonus(); - } - return this.totalPlayers; - } + public void updateTotalPlayers() { + this.totalPlayers = Jobs.getJobsDAO().getTotalPlayerAmountByJobName(this.jobName); + updateBonus(); + } - public void updateTotalPlayers() { - this.totalPlayers = Jobs.getJobsDAO().getTotalPlayerAmountByJobName(this.jobName); - updateBonus(); + public void updateBonus() { + if (!ConfigManager.getJobsConfiguration().useDynamicPayment) + return; + Parser eq = ConfigManager.getJobsConfiguration().DynamicPaymentEquation; + eq.setVariable("totalworkers", Jobs.getJobsDAO().getTotalPlayers()); + eq.setVariable("totaljobs", Jobs.getJobs().size()); + eq.setVariable("jobstotalplayers", getTotalPlayers()); + + double now = eq.getValue(); + if (now > ConfigManager.getJobsConfiguration().DynamicPaymentMaxBonus) + now = ConfigManager.getJobsConfiguration().DynamicPaymentMaxBonus; + if (now < ConfigManager.getJobsConfiguration().DynamicPaymentMaxPenalty * -1) + now = ConfigManager.getJobsConfiguration().DynamicPaymentMaxPenalty * -1; + this.bonus = now; + } + + public double getBonus() { + if (this.bonus == 0.0) + updateBonus(); + return this.bonus; + } + + public List getCmdOnJoin() { + return this.CmdOnJoin; + } + + public List getCmdOnLeave() { + return this.CmdOnLeave; + } + + public ItemStack getGuiItem() { + return this.GUIitem; + } + + /** + * Sets job info for action type + * @param type - The action type + * @param info - the job info + */ + public void setJobInfo(ActionType type, List info) { + jobInfo.put(type, info); + } + + /** + * Gets the job info for the particular type + * @param type - The action type + * @return Job info list + */ + + public List getJobInfo(ActionType type) { + return Collections.unmodifiableList(jobInfo.get(type)); + } + + /** + * Gets the job info list + * @return Job info list + */ + + public EnumMap> getJobInfoList() { + return jobInfo; + } + + /** + * Function to get the income for an action + * @param action - The action info + * @param level - players job level + * @param numjobs - number of jobs for the player + * @return the income received for performing action + */ + + public Double getIncome(ActionInfo action, int level, int numjobs) { + List jobInfo = getJobInfo(action.getType()); + for (JobInfo info : jobInfo) { + if (info.getName().equalsIgnoreCase(action.getName()) || info.getName().equalsIgnoreCase(action.getNameWithSub())) { + return info.getIncome(level, numjobs); + } } + return null; + } - public void updateBonus() { - if (!ConfigManager.getJobsConfiguration().useDynamicPayment) - return; - Parser eq = ConfigManager.getJobsConfiguration().DynamicPaymentEquation; - eq.setVariable("totalworkers", Jobs.getJobsDAO().getTotalPlayers()); - eq.setVariable("totaljobs", Jobs.getJobs().size()); - eq.setVariable("jobstotalplayers", getTotalPlayers()); + /** + * Function to get the income for an action + * @param action - The action info + * @param level - players job level + * @param numjobs - number of jobs for the player + * @return the income received for performing action + */ - double now = eq.getValue(); - if (now > ConfigManager.getJobsConfiguration().DynamicPaymentMaxBonus) - now = ConfigManager.getJobsConfiguration().DynamicPaymentMaxBonus; - if (now < ConfigManager.getJobsConfiguration().DynamicPaymentMaxPenalty * -1) - now = ConfigManager.getJobsConfiguration().DynamicPaymentMaxPenalty * -1; - this.bonus = now; + public Double getExperience(ActionInfo action, int level, int numjobs) { + List jobInfo = getJobInfo(action.getType()); + for (JobInfo info : jobInfo) { + if (info.getName().equalsIgnoreCase(action.getName()) || info.getName().equalsIgnoreCase(action.getNameWithSub())) + return info.getExperience(level, numjobs); } + return null; + } - public double getBonus() { - if (this.bonus == 0.0) - updateBonus(); - return this.bonus; + /** + * Get the job name + * @return the job name + */ + public String getName() { + return jobName; + } + + /** + * Get the shortened version of the jobName + * @return the shortened version of the jobName + */ + public String getShortName() { + return jobShortName; + } + + /** + * Gets the description + * @return description + */ + public String getDescription() { + return description; + } + + /** + * Get the Color of the job for chat + * @return the Color of the job for chat + */ + public ChatColor getChatColor() { + return jobColour; + } + + /** + * Get the MaxExpEquation of the job + * @return the MaxExpEquation of the job + */ + public Parser getMaxExpEquation() { + return maxExpEquation; + } + + /** + * Function to return the appropriate max exp for this level + * @param level - current level + * @return the correct max exp for this level + */ + public double getMaxExp(Map param) { + for (Map.Entry temp : param.entrySet()) { + maxExpEquation.setVariable(temp.getKey(), temp.getValue()); } + return maxExpEquation.getValue(); + } - public List getCmdOnJoin() { - return this.CmdOnJoin; - } + /** + * Function to get the display method + * @return the display method + */ + public DisplayMethod getDisplayMethod() { + return displayMethod; + } - public List getCmdOnLeave() { - return this.CmdOnLeave; - } + /** + * Function to return the maximum level + * @return the max level + * @return null - no max level + */ + public int getMaxLevel() { + return maxLevel; + } - public ItemStack getGuiItem() { - return this.GUIitem; - } + /** + * Function to return the maximum level + * @return the max level + * @return null - no max level + */ + public int getVipMaxLevel() { + return vipmaxLevel; + } - /** - * Sets job info for action type - * @param type - The action type - * @param info - the job info - */ - public void setJobInfo(ActionType type, List info) { - jobInfo.put(type, info); - } + /** + * Function to return the maximum slots + * @return the max slots + * @return null - no max slots + */ + public Integer getMaxSlots() { + return maxSlots; + } - /** - * Gets the job info for the particular type - * @param type - The action type - * @return Job info list - */ + /** + * Get the permission nodes for this job + * @return Permissions for this job + */ + public List getPermissions() { + return Collections.unmodifiableList(jobPermissions); + } - public List getJobInfo(ActionType type) { - return Collections.unmodifiableList(jobInfo.get(type)); - } + /** + * Get the command nodes for this job + * @return Commands for this job + */ + public List getCommands() { + return Collections.unmodifiableList(jobCommands); + } - /** - * Gets the job info list - * @return Job info list - */ + /** + * Get the conditions for this job + * @return Conditions for this job + */ + public List getConditions() { + return Collections.unmodifiableList(jobConditions); + } - public EnumMap> getJobInfoList() { - return jobInfo; - } + /** + * Get the item nodes for this job + * @return Items for this job + */ + public List getItems() { + return Collections.unmodifiableList(jobItems); + } - /** - * Function to get the income for an action - * @param action - The action info - * @param level - players job level - * @param numjobs - number of jobs for the player - * @return the income received for performing action - */ - - public Double getIncome(ActionInfo action, int level, int numjobs) { - List jobInfo = getJobInfo(action.getType()); - for (JobInfo info : jobInfo) { - if (info.getName().equalsIgnoreCase(action.getName()) || info.getName().equalsIgnoreCase(action.getNameWithSub())) { - return info.getIncome(level, numjobs); - } - } - return null; - } - - /** - * Function to get the income for an action - * @param action - The action info - * @param level - players job level - * @param numjobs - number of jobs for the player - * @return the income received for performing action - */ - - public Double getExperience(ActionInfo action, int level, int numjobs) { - List jobInfo = getJobInfo(action.getType()); - for (JobInfo info : jobInfo) { - if (info.getName().equalsIgnoreCase(action.getName()) || info.getName().equalsIgnoreCase(action.getNameWithSub())) - return info.getExperience(level, numjobs); - } - return null; - } - - /** - * Get the job name - * @return the job name - */ - public String getName() { - return jobName; - } - - /** - * Get the shortened version of the jobName - * @return the shortened version of the jobName - */ - public String getShortName() { - return jobShortName; - } - - /** - * Gets the description - * @return description - */ - public String getDescription() { - return description; - } - - /** - * Get the Color of the job for chat - * @return the Color of the job for chat - */ - public ChatColor getChatColor() { - return jobColour; - } - - /** - * Get the MaxExpEquation of the job - * @return the MaxExpEquation of the job - */ - public Parser getMaxExpEquation() { - return maxExpEquation; - } - - /** - * Function to return the appropriate max exp for this level - * @param level - current level - * @return the correct max exp for this level - */ - public double getMaxExp(Map param) { - for (Map.Entry temp : param.entrySet()) { - maxExpEquation.setVariable(temp.getKey(), temp.getValue()); - } - return maxExpEquation.getValue(); - } - - /** - * Function to get the display method - * @return the display method - */ - public DisplayMethod getDisplayMethod() { - return displayMethod; - } - - /** - * Function to return the maximum level - * @return the max level - * @return null - no max level - */ - public int getMaxLevel() { - return maxLevel; - } - - /** - * Function to return the maximum level - * @return the max level - * @return null - no max level - */ - public int getVipMaxLevel() { - return vipmaxLevel; - } - - /** - * Function to return the maximum slots - * @return the max slots - * @return null - no max slots - */ - public Integer getMaxSlots() { - return maxSlots; - } - - /** - * Get the permission nodes for this job - * @return Permissions for this job - */ - public List getPermissions() { - return Collections.unmodifiableList(jobPermissions); - } - - /** - * Get the command nodes for this job - * @return Commands for this job - */ - public List getCommands() { - return Collections.unmodifiableList(jobCommands); - } - /** - * Get the conditions for this job - * @return Conditions for this job - */ - public List getConditions() { - return Collections.unmodifiableList(jobConditions); - } - - /** - * Get the item nodes for this job - * @return Items for this job - */ - public List getItems() { - return Collections.unmodifiableList(jobItems); - } + /** + * Get the limited item nodes for this job + * @return Limited items for this job + */ + public List getLimitedItems() { + return Collections.unmodifiableList(jobLimitedItems); + } } diff --git a/com/gamingmesh/jobs/container/JobItems.java b/com/gamingmesh/jobs/container/JobItems.java index 63472c80..d3dec80e 100644 --- a/com/gamingmesh/jobs/container/JobItems.java +++ b/com/gamingmesh/jobs/container/JobItems.java @@ -18,18 +18,21 @@ package com.gamingmesh.jobs.container; +import java.util.HashMap; import java.util.List; +import org.bukkit.enchantments.Enchantment; + public class JobItems { private String node; private int id; private String name; private List lore; - private List enchants; + private HashMap enchants; private Double moneyBoost; private Double expBoost; - public JobItems(String node, int id, String name, List lore, List enchants, double moneyBoost, double expBoost) { + public JobItems(String node, int id, String name, List lore, HashMap enchants, double moneyBoost, double expBoost) { this.node = node; this.id = id; this.name = name; @@ -55,7 +58,7 @@ public class JobItems { return this.lore; } - public List getenchants() { + public HashMap getenchants() { return this.enchants; } diff --git a/com/gamingmesh/jobs/container/JobLimitedItems.java b/com/gamingmesh/jobs/container/JobLimitedItems.java new file mode 100644 index 00000000..23d2134c --- /dev/null +++ b/com/gamingmesh/jobs/container/JobLimitedItems.java @@ -0,0 +1,65 @@ +/** + * Jobs Plugin for Bukkit + * Copyright (C) 2011 Zak Ford + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.gamingmesh.jobs.container; + +import java.util.HashMap; +import java.util.List; +import org.bukkit.enchantments.Enchantment; + +public class JobLimitedItems { + private String node; + private int id; + private String name; + private List lore; + private HashMap enchants; + private int level; + + public JobLimitedItems(String node, int id, String name, List lore, HashMap enchants, int level) { + this.node = node; + this.id = id; + this.name = name; + this.lore = lore; + this.enchants = enchants; + this.level = level; + } + + public String getNode() { + return this.node; + } + + public int getId() { + return this.id; + } + + public String getName() { + return this.name; + } + + public List getLore() { + return this.lore; + } + + public HashMap getenchants() { + return this.enchants; + } + + public int getLevel() { + return this.level; + } +} diff --git a/com/gamingmesh/jobs/dao/JobsDAO.java b/com/gamingmesh/jobs/dao/JobsDAO.java index b0e8fe1a..02b0abbc 100644 --- a/com/gamingmesh/jobs/dao/JobsDAO.java +++ b/com/gamingmesh/jobs/dao/JobsDAO.java @@ -37,6 +37,8 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.JobsPlugin; import com.gamingmesh.jobs.config.ConfigManager; import com.gamingmesh.jobs.container.Convert; +import com.gamingmesh.jobs.container.ExploreChunk; +import com.gamingmesh.jobs.container.ExploreRegion; import com.gamingmesh.jobs.container.Job; import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; @@ -98,7 +100,10 @@ public abstract class JobsDAO { if (version <= 6) checkUpdate7(); - version = 7; + // creating explore database + checkUpdate8(); + + version = 8; } finally { updateSchemaVersion(version); } @@ -118,6 +123,8 @@ public abstract class JobsDAO { protected abstract void checkUpdate7() throws SQLException; + protected abstract void checkUpdate8() throws SQLException; + /** * Gets the database prefix * @return the prefix @@ -732,6 +739,65 @@ public abstract class JobsDAO { } } + /** + * Save player-explore information + * @param jobexplore - the information getting saved + */ + public synchronized void saveExplore() { + if (!Jobs.getExplore().isExploreEnabled()) + return; + + JobsConnection conn = getConnection(); + if (conn == null) + return; + try { + PreparedStatement prest = conn.prepareStatement("TRUNCATE TABLE `" + prefix + "explore`;"); + prest.execute(); + prest.close(); + + PreparedStatement prest2 = conn.prepareStatement("INSERT INTO `" + prefix + "explore` (`worldname`, `chunkX`, `chunkZ`, `playerName`) VALUES (?, ?, ?, ?);"); + for (Entry worlds : Jobs.getExplore().getWorlds().entrySet()) { + for (ExploreChunk oneChunk : worlds.getValue().getChunks()) { + for (String oneuser : oneChunk.getPlayers()) { + prest2.setString(1, worlds.getKey()); + prest2.setInt(2, oneChunk.getX()); + prest2.setInt(3, oneChunk.getZ()); + prest2.setString(4, oneuser); + prest2.execute(); + } + } + } + prest2.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + + /** + * Save player-explore information + * @param jobexplore - the information getting saved + */ + public synchronized void loadExplore() { + if (!Jobs.getExplore().isExploreEnabled()) + return; + + JobsConnection conn = getConnection(); + if (conn == null) + return; + try { + + PreparedStatement prest = conn.prepareStatement("SELECT * FROM `" + prefix + "explore`;"); + ResultSet res = prest.executeQuery(); + while (res.next()) { + Jobs.getExplore().ChunkRespond(res.getString("playerName"), res.getString("worldname"), res.getInt("chunkX"), res.getInt("chunkZ")); + } + res.close(); + prest.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + /** * Save player-job information * @param jobInfo - the information getting saved diff --git a/com/gamingmesh/jobs/dao/JobsDAOMySQL.java b/com/gamingmesh/jobs/dao/JobsDAOMySQL.java index a0ff3c73..8409d974 100644 --- a/com/gamingmesh/jobs/dao/JobsDAOMySQL.java +++ b/com/gamingmesh/jobs/dao/JobsDAOMySQL.java @@ -431,4 +431,39 @@ public class JobsDAOMySQL extends JobsDAO { executeSQL("DROP TABLE IF EXISTS `" + getPrefix() + "log`;"); executeSQL("ALTER TABLE `" + getPrefix() + "log_temp` RENAME TO `" + getPrefix() + "log`;"); } + + @Override + protected synchronized void checkUpdate8() throws SQLException { + JobsConnection conn = getConnection(); + if (conn == null) { + Jobs.getPluginLogger().severe("Could not run database updates! Could not connect to MySQL!"); + return; + } + PreparedStatement prest = null; + int rows = 0; + try { + // Check for jobs table + prest = conn.prepareStatement("SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = ? AND table_name = ?;"); + prest.setString(1, database); + prest.setString(2, getPrefix() + "explore"); + ResultSet res = prest.executeQuery(); + if (res.next()) { + rows = res.getInt(1); + } + } finally { + if (prest != null) { + try { + prest.close(); + } catch (SQLException e) { + } + } + } + + try { + if (rows == 0) + executeSQL("CREATE TABLE `" + getPrefix() + + "explore` (`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `worldname` varchar(64), `chunkX` int, `chunkZ` int, `playerName` varchar(32));"); + } finally { + } + } } diff --git a/com/gamingmesh/jobs/dao/JobsDAOSQLite.java b/com/gamingmesh/jobs/dao/JobsDAOSQLite.java index 7a416347..27b1f398 100644 --- a/com/gamingmesh/jobs/dao/JobsDAOSQLite.java +++ b/com/gamingmesh/jobs/dao/JobsDAOSQLite.java @@ -411,4 +411,37 @@ public class JobsDAOSQLite extends JobsDAO { executeSQL("ALTER TABLE `" + getPrefix() + "log_temp` RENAME TO `" + getPrefix() + "log`;"); } + @Override + protected synchronized void checkUpdate8() throws SQLException { + JobsConnection conn = getConnection(); + if (conn == null) { + Jobs.getPluginLogger().severe("Could not run database updates! Could not connect to MySQL!"); + return; + } + PreparedStatement prest = null; + int rows = 0; + try { + // Check for jobs table + prest = conn.prepareStatement("SELECT COUNT(*) FROM sqlite_master WHERE name = ?;"); + prest.setString(1, getPrefix() + "explore"); + ResultSet res = prest.executeQuery(); + if (res.next()) { + rows = res.getInt(1); + } + } finally { + if (prest != null) { + try { + prest.close(); + } catch (SQLException e) { + } + } + } + + try { + if (rows == 0) + executeSQL("CREATE TABLE `" + getPrefix() + + "explore` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `worldname` varchar(64), `chunkX` int, `chunkZ` int, `playerName` varchar(32));"); + } finally { + } + } } diff --git a/com/gamingmesh/jobs/listeners/.gitignore b/com/gamingmesh/jobs/listeners/.gitignore index 45b2f50a..3b83e90a 100644 --- a/com/gamingmesh/jobs/listeners/.gitignore +++ b/com/gamingmesh/jobs/listeners/.gitignore @@ -8,3 +8,5 @@ /JobsPaymentListener$2.class /MythicMobsListener.class /JobsListener$2.class +/JobsListener$3.class +/JobsListener$4.class diff --git a/com/gamingmesh/jobs/listeners/JobsListener.java b/com/gamingmesh/jobs/listeners/JobsListener.java index 396398f7..052e2585 100644 --- a/com/gamingmesh/jobs/listeners/JobsListener.java +++ b/com/gamingmesh/jobs/listeners/JobsListener.java @@ -18,15 +18,21 @@ package com.gamingmesh.jobs.listeners; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; import java.util.regex.Pattern; import org.bukkit.Bukkit; import org.bukkit.ChatColor; +import org.bukkit.Chunk; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Sign; +import org.bukkit.enchantments.Enchantment; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; @@ -43,8 +49,11 @@ import org.bukkit.event.player.AsyncPlayerChatEvent; import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.world.WorldLoadEvent; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; import org.bukkit.plugin.PluginManager; @@ -53,10 +62,14 @@ import com.gamingmesh.jobs.Jobs; import com.gamingmesh.jobs.JobsPlugin; import com.gamingmesh.jobs.Gui.GuiInfoList; import com.gamingmesh.jobs.Gui.GuiTools; +import com.gamingmesh.jobs.api.JobsChunkChangeEvent; import com.gamingmesh.jobs.config.ConfigManager; import com.gamingmesh.jobs.container.Job; +import com.gamingmesh.jobs.container.JobLimitedItems; +import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.i18n.Language; +import com.gamingmesh.jobs.stuff.ActionBar; import com.gamingmesh.jobs.stuff.OfflinePlayerList; public class JobsListener implements Listener { @@ -473,4 +486,89 @@ public class JobsListener implements Listener { }, 1L); } } + + @SuppressWarnings("deprecation") + @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + public void onLimitedItemInteract(PlayerInteractEvent event) { + + Player player = (Player) event.getPlayer(); + + ItemStack iih = player.getItemInHand(); + + if (iih == null) + return; + + JobsPlayer JPlayer = Jobs.getPlayerManager().getJobsPlayer(player); + + if (JPlayer == null) + return; + + List prog = JPlayer.getJobProgression(); + + String name = null; + List lore = new ArrayList(); + + Map enchants = iih.getEnchantments(); + + if (iih.hasItemMeta()) { + ItemMeta meta = iih.getItemMeta(); + if (meta.hasDisplayName()) + name = meta.getDisplayName(); + if (meta.hasLore()) + lore = meta.getLore(); + } + + String meinOk = null; + + mein: for (JobProgression one : prog) { + second: for (JobLimitedItems oneItem : one.getJob().getLimitedItems()) { + + if (oneItem.getId() != iih.getTypeId()) + continue; + + meinOk = one.getJob().getName(); + + if (oneItem.getName() != null && name != null) + if (!org.bukkit.ChatColor.translateAlternateColorCodes('&', oneItem.getName()).equalsIgnoreCase(name)) + continue; + + if (one.getLevel() < oneItem.getLevel()) + continue; + + for (Entry oneE : enchants.entrySet()) { + if (oneItem.getenchants().containsKey(oneE.getKey())) { + if (oneItem.getenchants().get(oneE.getKey()) < oneE.getValue()) { + continue second; + } + } else + continue second; + } + for (String onelore : oneItem.getLore()) { + if (!lore.contains(onelore)) + continue second; + } + meinOk = null; + break mein; + } + } + + if (meinOk != null) { + event.setCancelled(true); + ActionBar.send(player, Language.getDefaultMessage("limitedItem.error.levelup").replace("[jobname]", meinOk)); + } + } + + @EventHandler + public void onChunkChangeMove(PlayerMoveEvent event) { + + Chunk from = event.getFrom().getChunk(); + Chunk to = event.getTo().getChunk(); + + if (from == to) + return; + + JobsChunkChangeEvent jobsChunkChangeEvent = new JobsChunkChangeEvent(event.getPlayer(), from, to); + Bukkit.getServer().getPluginManager().callEvent(jobsChunkChangeEvent); + } + } diff --git a/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index b2272be0..f426f740 100644 --- a/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -71,9 +71,12 @@ import com.gamingmesh.jobs.actions.BlockActionInfo; import com.gamingmesh.jobs.actions.CustomKillInfo; import com.gamingmesh.jobs.actions.EnchantActionInfo; import com.gamingmesh.jobs.actions.EntityActionInfo; +import com.gamingmesh.jobs.actions.ExploreActionInfo; import com.gamingmesh.jobs.actions.ItemActionInfo; +import com.gamingmesh.jobs.api.JobsChunkChangeEvent; import com.gamingmesh.jobs.config.ConfigManager; import com.gamingmesh.jobs.container.ActionType; +import com.gamingmesh.jobs.container.ExploreRespond; import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.i18n.Language; @@ -324,7 +327,7 @@ public class JobsPaymentListener implements Listener { } // Item in hand - ItemStack item = player.getItemInHand().hasItemMeta() ? player.getItemInHand() : null; + ItemStack item = player.getItemInHand(); // Protection for block break with silktouch if (ConfigManager.getJobsConfiguration().useSilkTouchProtection && item != null) @@ -1054,4 +1057,50 @@ public class JobsPaymentListener implements Listener { block.setMetadata(brewingOwnerMetadata, new FixedMetadataValue(plugin, event.getPlayer().getName())); } } + + @EventHandler + public void onExplore(JobsChunkChangeEvent event) { + + if (!Jobs.getExplore().isExploreEnabled()) + return; + + Player player = (Player) event.getPlayer(); + + if (!ConfigManager.getJobsConfiguration().payExploringWhenFlying()) + return; + + ExploreRespond respond = Jobs.getExplore().ChunkRespond(event.getPlayer(), event.getNewChunk()); + + if (!respond.isNewChunk()) + return; + + // make sure plugin is enabled + if (!plugin.isEnabled()) + return; + + if (!player.isOnline()) + return; + + // check if in creative + if (event.getPlayer().getGameMode().equals(GameMode.CREATIVE) && !ConfigManager.getJobsConfiguration().payInCreative()) + return; + + if (!Jobs.getPermissionHandler().hasWorldPermission(player, player.getLocation().getWorld().getName())) + return; + + // restricted area multiplier + double multiplier = ConfigManager.getJobsConfiguration().getRestrictedMultiplier(player); + + // Item in hand + ItemStack item = player.getItemInHand(); + + // Wearing armor + ItemStack[] armor = player.getInventory().getArmorContents(); + + JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(player); + if (jPlayer == null) + return; + + Jobs.action(jPlayer, new ExploreActionInfo(String.valueOf(respond.getCount()), ActionType.EXPLORE), multiplier, item, armor); + } } diff --git a/com/gamingmesh/jobs/stuff/.gitignore b/com/gamingmesh/jobs/stuff/.gitignore index f1f0a3cc..dcf06ebb 100644 --- a/com/gamingmesh/jobs/stuff/.gitignore +++ b/com/gamingmesh/jobs/stuff/.gitignore @@ -28,3 +28,4 @@ /ScheduleUtil$2.class /OfflinePlayerList.class /OfflinePlayerList$1.class +/Explore.class diff --git a/com/gamingmesh/jobs/stuff/Explore.java b/com/gamingmesh/jobs/stuff/Explore.java new file mode 100644 index 00000000..8c3ad5ff --- /dev/null +++ b/com/gamingmesh/jobs/stuff/Explore.java @@ -0,0 +1,83 @@ +package com.gamingmesh.jobs.stuff; + +import java.util.HashMap; +import org.bukkit.Chunk; +import org.bukkit.entity.Player; + +import com.gamingmesh.jobs.Jobs; +import com.gamingmesh.jobs.container.ExploreChunk; +import com.gamingmesh.jobs.container.ExploreRegion; +import com.gamingmesh.jobs.container.ExploreRespond; + +public class Explore { + + private HashMap worlds = new HashMap(); + private boolean exploreEnabled = false; + private int playerAmount = 1; + + public Explore() { + } + + public int getPlayerAmount() { + return this.playerAmount; + } + + public void setPlayerAmount(int amount) { + if (this.playerAmount < amount) + this.playerAmount = amount; + } + + public boolean isExploreEnabled() { + return this.exploreEnabled; + } + + public void setExploreEnabled() { + this.exploreEnabled = true; + Jobs.getJobsDAO().loadExplore(); + } + + public HashMap getWorlds() { + return worlds; + } + + public ExploreRespond ChunkRespond(Player player, Chunk chunk) { + return ChunkRespond(player.getName(), chunk.getWorld().getName(), chunk.getX(), chunk.getZ()); + } + + public ExploreRespond ChunkRespond(String player, String worldName, int x, int z) { + + int ChunkX = x; + int ChunkZ = z; + + int RegionX = (int) Math.floor(ChunkX / 32D); + int RegionZ = (int) Math.floor(ChunkZ / 32D); + + if (!worlds.containsKey(worldName)) { + ExploreChunk eChunk = new ExploreChunk(player, ChunkX, ChunkZ); + ExploreRegion eRegion = new ExploreRegion(RegionX, RegionZ); + eRegion.addChunk(eChunk); + worlds.put(worldName, eRegion); + return new ExploreRespond(eChunk.getCount(), true); + } else { + ExploreRegion eRegion = worlds.get(worldName); + ExploreChunk eChunk = null; + for (ExploreChunk one : eRegion.getChunks()) { + if (one.getX() != ChunkX) + continue; + if (one.getZ() != ChunkZ) + continue; + eChunk = one; + break; + } + + if (eChunk == null) { + eChunk = new ExploreChunk(player, ChunkX, ChunkZ); + eRegion.addChunk(eChunk); + return new ExploreRespond(eChunk.getCount(), true); + } else { + return eChunk.addPlayer(player); + } + } + } + +} diff --git a/com/gamingmesh/jobs/stuff/GiveItem.java b/com/gamingmesh/jobs/stuff/GiveItem.java index 1c1a1ac3..0ca78ebd 100644 --- a/com/gamingmesh/jobs/stuff/GiveItem.java +++ b/com/gamingmesh/jobs/stuff/GiveItem.java @@ -1,36 +1,38 @@ -package com.gamingmesh.jobs.stuff; - -import java.util.ArrayList; -import java.util.List; - -import org.bukkit.ChatColor; -import org.bukkit.Material; -import org.bukkit.enchantments.Enchantment; -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.meta.ItemMeta; - -public class GiveItem { - public static boolean GiveItemForPlayer(Player player, int id, int meta, int qty, String name, List lore, List enchants) { - @SuppressWarnings("deprecation") - ItemStack itemStack = new ItemStack(Material.getMaterial(id), qty, (short) meta); - ItemMeta ItemMeta = itemStack.getItemMeta(); - if (lore != null) { - List TranslatedLore = new ArrayList(); - for (String oneLore : lore) { - TranslatedLore.add(ChatColor.translateAlternateColorCodes('&', oneLore.replace("[player]", player.getName()))); - } - ItemMeta.setLore(TranslatedLore); - } - if (enchants != null) - for (String OneEnchant : enchants) { - ItemMeta.addEnchant(Enchantment.getByName(OneEnchant.split("=")[0]), Integer.parseInt(OneEnchant.split("=")[1]), true); - } - if (name != null) - ItemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); - itemStack.setItemMeta(ItemMeta); - player.getInventory().addItem(itemStack); - player.getPlayer().updateInventory(); - return true; - } -} +package com.gamingmesh.jobs.stuff; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map.Entry; + +import org.bukkit.ChatColor; +import org.bukkit.Material; +import org.bukkit.enchantments.Enchantment; +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; +import org.bukkit.inventory.meta.ItemMeta; + +public class GiveItem { + public static boolean GiveItemForPlayer(Player player, int id, int meta, int qty, String name, List lore, HashMap hashMap) { + @SuppressWarnings("deprecation") + ItemStack itemStack = new ItemStack(Material.getMaterial(id), qty, (short) meta); + ItemMeta ItemMeta = itemStack.getItemMeta(); + + if (lore != null) { + List TranslatedLore = new ArrayList(); + for (String oneLore : lore) { + TranslatedLore.add(ChatColor.translateAlternateColorCodes('&', oneLore.replace("[player]", player.getName()))); + } + ItemMeta.setLore(TranslatedLore); + } + for (Entry OneEnchant : hashMap.entrySet()) { + ItemMeta.addEnchant(OneEnchant.getKey(), OneEnchant.getValue(), true); + } + if (name != null) + ItemMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name)); + itemStack.setItemMeta(ItemMeta); + player.getInventory().addItem(itemStack); + player.getPlayer().updateInventory(); + return true; + } +} diff --git a/com/gamingmesh/jobs/stuff/TranslateName.java b/com/gamingmesh/jobs/stuff/TranslateName.java index 13a8ddc7..36e74d5b 100644 --- a/com/gamingmesh/jobs/stuff/TranslateName.java +++ b/com/gamingmesh/jobs/stuff/TranslateName.java @@ -71,6 +71,7 @@ public class TranslateName { break; case CUSTOMKILL: case MMKILL: + case EXPLORE: break; case SHEAR: for (NameList one : ConfigManager.getJobsConfiguration().ListOfColors) { diff --git a/jobConfig.yml b/jobConfig.yml index f01a05dc..5f8625be 100644 --- a/jobConfig.yml +++ b/jobConfig.yml @@ -293,6 +293,24 @@ Jobs: REDSTONE: income: 5.0 experience: 3.0 + # Explore options. Each number represents players number in exploring that chunk + # 1 means that player is first in this chunk, 2 is second and so on, so you can give money not only for first player ho discovers that chunk + Explore: + 1: + income: 5.0 + experience: 5.0 + 2: + income: 2.5 + experience: 2.5 + 3: + income: 1.0 + experience: 1.0 + 4: + income: 0.5 + experience: 0.5 + 5: + income: 0.1 + experience: 0.1 # permissions granted for joining class permissions: # example node @@ -363,6 +381,25 @@ Jobs: - '&710% bonus XP' moneyBoost: 1.1 expBoost: 1.1 + # Limit item use to jobs level + limitedItems: + # Just name, dont have any impact + firstOne: + # Tool/Weapon id. Works for any interact action. + id: 278 + # Level of this job player can start using this item + level: 5 + # (optional) Items name, option to use color codes + name: '&8Miner Pickaxe' + # (optional) Item lore, again can come with color codes + lore: + - '&eBobs pick' + - '&710% bonus XP' + # (optional) Item enchantments, all enchantment names can be found https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html + # enchant level can inrease with jobs level to give best RPG experiance + enchants: + - DAMAGE_ALL=1 + - FIRE_ASPECT=1 cmd-on-join: - 'msg [name] Thx for joining this job!' - 'msg [name] Now start working and get money from [jobname] job!' diff --git a/locale/messages_cz.yml b/locale/messages_cz.yml new file mode 100644 index 00000000..23cf018a --- /dev/null +++ b/locale/messages_cz.yml @@ -0,0 +1,230 @@ +economy: + error: + nomoney: Nedostatek financi! +command: + boost: + help: + info: Zvysuje Exp/Vydelek pro vsechny hrace. + args: '[JmenoPrace] [Hodnota]' + output: + allreset: Vsechny exp/vydelky BOOST byly vypnuty. + jobsboostreset: BOOST pro %jobname% byl vypnut. + nothingtoreset: Neni nic, co by se dalo vypnout. + boostalladded: BOOST hodnoty %boost% byly povoleny pro vsechny prace. + boostadded: BOOST hodnoty &e%boost% &abyly povoleny pro praci &e%jobname%! + infostats: '&c-----> &aExp/Vydelky x%boost% je/jsou zapnute&c <-------' + convert: + help: + info: Prevede data z jednoho zpusobu databaze na jiny. Pokud práve pouzivate SQLite, bude preveden na MySQL a naopak. + args: '' + limit: + help: + info: Vypise limit vydelku praci. + args: '' + output: + lefttime: '&eZbyvajici cas do resetovani limitu vydelku: &2%hour% &ehour &2%min% &emin &2%sec% + &esec' + moneylimit: '&eLimit vydelku: &2%money%&e/&2%totalmoney%' + reachedlimit: '&4Dosahl/a jsi limitu vydelku v danem case!' + reachedlimit2: '&eLimit zjistis prikazem &2/jobs limit' + notenabled: '&eLimit vydelku neni zapnuty.' + admin: + error: Doslo k chybe v prikazu. + success: Prikaz byl proveden dle rozkazu. + error: + job: 'Prace, kterou sis vybral/a, neexistuje.' + permission: Nemas povoleni na tuto akci. + help: + output: + info: Napis /jobs [prikaz] ? pro vice informaci. + usage: 'Pouziti: %usage%' + stats: + help: + info: 'Vypise level v pracech, ve kterych jsi zamestnany(a).' + args: '[JmenoHrace]' + error: + nojob: 'Nejdrive se prihlas do nejake prace.' + output: 'lvl%joblevel% %jobname% : %jobxp%/%jobmaxxp% xp' + archive: + help: + info: Vypise vsechny prace ulozene v archivu podle uzivatele. + args: '[JmenoHrace]' + error: + nojob: Nejsou zadne ulozene prace. + output: lvl %joblevel% (%getbackjoblevel%) %jobname% + give: + help: + info: Da item podle nazvu prace a nazvu kategorie. Jmeno Hrace neni povinny udaj. + args: '[JmenoHrace] [JmenoPrace] [JmenoItemu]' + output: + notonline: '&4Hrac [%playername%] neni online!' + noitem: '&4Nelze najit item s timto jmenem!' + info: + help: + title: '&2*** &ePrace&2 ***' + info: Vypise vysi vydelku prace k dane akci. + args: '[JmenoPrace] [akce]' + actions: '&ePlatne akce jsou: &f%actions%' + max: ' - &emax level:&f ' + material: '&7%material%' + output: + break: + info: Breaknuti + none: '%jobname% vydelava penize za breaknuti bloku.' + place: + info: Polozeni + none: '%jobname% vydelava penize za polozeni bloku.' + kill: + info: Zabijeni + none: '%jobname% vydelava penize za zabijeni monster.' + fish: + info: Rybareni + none: '%jobname% vydelava penize za rybarení.' + craft: + info: Craft + none: '%jobname% vydelava penize za craftení vecí.' + smelt: + info: Peceni + none: '%jobname% vydelava penize za pecení v peci.' + brew: + info: Vareni + none: '%jobname% vydelava penize za vareni lektvaru.' + enchant: + info: Ocarovani + none: '%jobname% vydelava penize za ocarovávání/enchant itemu.' + repair: + info: Opravovani + none: '%jobname% vydelava penize za opravování predmetu.' + breed: + info: Farmareni + none: '%jobname% vydelava penize za farmareni.' + tame: + info: Ochocovani + none: '%jobname% vydelava penize za ochocovani zvirat.' + playerinfo: + help: + info: Vypise vysi vydelku prace k dane akci urciteho hrace. + args: '[JmenoHrace] [JmenoPrace] [akce]' + join: + help: + info: Zamestnas se do prace. + args: '[JmenoPrace]' + error: + alreadyin: Uz pracujes jako %jobname%. + fullslots: Nemuzes se zamestnat do prace %jobname%, nejsou zde zadna volna mista. + maxjobs: Dosahl/a jsi maxima povolenych praci. + success: Zamestnal/a ses jako %jobname%. + leave: + help: + info: Opustis danou praci. + args: '[JmenoPrace]' + success: Opustil/a jsi praci %jobname%. + leaveall: + help: + info: Opustis vsechny svoje prace + error: + nojobs: Nemas zadne prace, ktere by jsi mohl/a opustit. + success: Opustil/a jsi vsechny sve prace. + browse: + help: + info: Seznam dostupnych praci + error: + nojobs: 'Nejsou zadne prace, ve kterych by jsi mohl/a byt zamestnan/a.' + output: + header: 'Mas povoleni na zamestnani v techto pracech:' + footer: Pro více info napis /jobs info [JmenoPrace] + fire: + help: + info: Vykopne hrace z dane prace. + args: '[JmenoHrace] [JmenoPrace]' + error: + nojob: Hrac neni zamestnan jako %jobname%. + output: + target: Byl/a jsi vyhozen/a z prace %jobname%. + fireall: + help: + info: Vykopne hrace ze vsech prací. + args: '[JmenoHrace]' + error: + nojobs: Hrac nema zadne prace, ze kterych by mohl byt vykopnut. + output: + target: Byl/a jsi vykopnut/a ze vsech prací. + employ: + help: + info: Zamestna hrace do prace. + args: '[JmenoHrace] [JmenoPrace]' + error: + alreadyin: Hrac uz pracuje jako %jobname%. + output: + target: Byl/a jsi zamestnan/a jako %jobname%. + top: + help: + info: '&eZobrazi &aTop 10 &ehracu dle praci.' + args: '[JmenoPrace]' + error: + nojob: Nelze najit zadnou praci s timto jmenem. + output: + topline: '&aTop&e 10 &ehracu pro praci &6%jobname%' + list: '&e%number%&a. &e%playername% &alvl &e%level% &as&e %exp% &aexp' + transfer: + help: + info: Prevede danou praci hrace ze stare práce do nove. + args: '[JmenoHrace] [StaraPrace] [NovaPrace]' + output: + target: Byl/a jsi presunut/a z prace %oldjobname% do %newjobname%. + promote: + help: + info: Prida hraci levely do dane prace. + args: '[JmenoHrace] [JmenoPrace] [levely]' + output: + target: Bylo ti pridano %levelsgained% levelu v praci %jobname%. + demote: + help: + info: Odebere hraci levely z dane prace. + args: '[JmenoHrace] [JmenoPrace] [levely]' + output: + target: Bylo ti odebrano %levelslost% levelu v praci %jobname%. + grantxp: + help: + info: Prida hraci zkusenosti do dane prace. + args: '[JmenoHrace] [JmenoPrace] [xp]' + output: + target: Dostal/a jsi %xpgained% zkusenosti v praci %jobname%. + removexp: + help: + info: Odstrani hraci zkusenosti z dane prace. + args: '[JmenoHrace] [JmenoPrace] [xp]' + output: + target: Ztratil/a jsi %xplost% zkusenosti v praci %jobname%. + reload: + help: + info: Reloadne konfiguraci. + toggle: + help: + info: Zapina/Vypina vypis vydelku na panelu akci. + output: + paid: '&a+ &a&l[amount]&a$' + 'on': '&aVypis: &aZAPNUTO' + 'off': '&aVypis: &cVYPNUTO' +message: + skillup: + broadcast: '%playername% byl/a povysen/a na %titlename% %jobname%.' + nobroadcast: Gratulujeme, byl/a jsi povysen/a na %titlename% %jobname%. + levelup: + broadcast: '%playername% dosahl/a levelu %joblevel% v praci %jobname%.' + nobroadcast: Dosahl/a jsi levelu %joblevel% v praci %jobname%. + crafting: + fullinventory: Mas plny inventar! +signs: + cantcreate: '&4Nemuzes vytvorit tuto cedulku!' + topline: '&e[Jobs]' + secondline: + join: '&2Join' + leave: '&4Leave' + toggle: '&eToggle' + top: '&eTop' + browse: '&eBrowse' + stats: '&eStats' + limit: '&eLimit' + info: '&eInfo' + archive: '&eArchive' \ No newline at end of file diff --git a/plugin.yml b/plugin.yml index c1a85105..8b9ab422 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.JobsPlugin -version: 2.56.0 +version: 2.58.0 author: phrstbrn softdepend: [Vault, CoreProtect, MythicMobs, McMMO] commands: