From 700fc2a5805e2642fc8ef63f94790a9ab70a043e Mon Sep 17 00:00:00 2001 From: Zrips Date: Tue, 23 Jan 2018 12:28:16 +0200 Subject: [PATCH] Updated default files --- pom.xml | 2 +- .../gamingmesh/jobs/commands/list/browse.java | 2 +- .../gamingmesh/jobs/config/ConfigManager.java | 4 +- .../jobs/config/GeneralConfigManager.java | 9 ++- .../jobs/config/LanguageManager.java | 4 +- .../jobs/stuff/FurnaceBrewingHandling.java | 8 ++- src/main/resources/jobConfig.yml | 65 +++++++++++++++++++ src/main/resources/plugin.yml | 10 ++- 8 files changed, 92 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index da6c00bf..35abdc8a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ 4.0.0 Jobs jobs - 4.2.1 + 4.3.0 Jobs http://maven.apache.org diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/browse.java b/src/main/java/com/gamingmesh/jobs/commands/list/browse.java index 2a90f923..b8904773 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/browse.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/browse.java @@ -65,7 +65,7 @@ public class browse implements Cmd { } if (j == null) { - PageInfo pi = new PageInfo(5, jobList.size(), page); + PageInfo pi = new PageInfo(Jobs.getGCManager().getBrowseAmountToShow(), jobList.size(), page); sender.sendMessage(Jobs.getLanguage().getMessage("command.browse.output.newHeader", "[amount]", jobList.size())); for (Job one : jobList) { if (!pi.isEntryOk()) diff --git a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java index c634ebe3..dbb60e8a 100644 --- a/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/ConfigManager.java @@ -731,14 +731,14 @@ public class ConfigManager { ConfigurationSection sqsection = qsection.getConfigurationSection(one); - String name = sqsection.getString("Name"); + String name = sqsection.getString("Name", one); ActionType actionType = ActionType.getByName(sqsection.getString("Action")); KeyValues kv = getKeyValue(sqsection.getString("Target"), actionType, jobName); if (kv == null) continue; int amount = sqsection.getInt("Amount"); - int chance = sqsection.getInt("Chance"); + int chance = sqsection.getInt("Chance", 100); List commands = sqsection.getStringList("RewardCommands"); List desc = sqsection.getStringList("RewardDesc"); diff --git a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java index 9c9969be..d9c6c4ff 100644 --- a/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/GeneralConfigManager.java @@ -87,7 +87,7 @@ public class GeneralConfigManager { public String localeString = "EN"; private boolean FurnacesReassign, BrewingStandsReassign; - private int FurnacesMaxDefault, BrewingStandsMaxDefault; + private int FurnacesMaxDefault, BrewingStandsMaxDefault, BrowseAmountToShow; public boolean useBlockProtection; public int BlockProtectionDays; @@ -871,6 +871,9 @@ public class GeneralConfigManager { c.getW().addComment("JobsBrowse.ShowPenaltyBonus", "Do you want to show penalty and bonus in jobs browse window. Only works if this feature is enabled"); ShowPenaltyBonus = c.get("JobsBrowse.ShowPenaltyBonus", true); + c.getW().addComment("JobsBrowse.AmountToShow", "Defines amount of jobs to be shown in one page for /jobs browse"); + BrowseAmountToShow = c.get("JobsBrowse.AmountToShow", 5); + c.getW().addComment("JobsGUI.OpenOnBrowse", "Do you want to show GUI when performing /jobs browse command"); JobsGUIOpenOnBrowse = c.get("JobsGUI.OpenOnBrowse", true); c.getW().addComment("JobsGUI.ShowChatBrowse", "Do you want to show chat information when performing /jobs browse command"); @@ -934,4 +937,8 @@ public class GeneralConfigManager { public int getBrewingStandsMaxDefault() { return BrewingStandsMaxDefault; } + + public int getBrowseAmountToShow() { + return BrowseAmountToShow; + } } diff --git a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java index 5f2d406d..df01f310 100644 --- a/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java +++ b/src/main/java/com/gamingmesh/jobs/config/LanguageManager.java @@ -148,7 +148,7 @@ public class LanguageManager { c.get("command.help.output.info", "Type /jobs [cmd] ? for more information about a command."); c.get("command.help.output.cmdUsage", "&2Usage: &7[command]"); - c.get("command.help.output.cmdInfoFormat", "[command] &f- &8[description]"); + c.get("command.help.output.cmdInfoFormat", "[command] &f- &2[description]"); c.get("command.help.output.cmdFormat", "&7/[command]&f[arguments]"); c.get("command.help.output.helpPageDescription", "&2* [description]"); @@ -436,7 +436,7 @@ public class LanguageManager { c.get("command.quests.help.info", "List available quests"); c.get("command.quests.help.args", "(playername)"); - c.get("command.quests.error.noquests", "There are no jobs you can join."); + c.get("command.quests.error.noquests", "There are no quests"); c.get("command.quests.toplineseparator", "&7*********************** &6[playerName]&2(&f[questsDone]&2) &7***********************"); c.get("command.quests.output.completed", "&2 !Completed!&r "); c.get("command.quests.output.questLine", "[progress] &7[questName] &f[done]&7/&8[required]"); diff --git a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java index 8bb34f5b..d2855986 100644 --- a/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java +++ b/src/main/java/com/gamingmesh/jobs/stuff/FurnaceBrewingHandling.java @@ -241,7 +241,7 @@ public class FurnaceBrewingHandling { } public enum ownershipFeedback { - invalid, tooMany, newReg, old + invalid, tooMany, newReg, old, notOwn } public static ownershipFeedback registerFurnaces(Player player, Block block) { @@ -268,7 +268,8 @@ public class FurnaceBrewingHandling { if (have > max && max > 0) removeFurnace(block); owner = true; - } + } else + return ownershipFeedback.notOwn; } } @@ -313,7 +314,8 @@ public class FurnaceBrewingHandling { if (have > max && max > 0) removeBrewing(block); owner = true; - } + } else + return ownershipFeedback.notOwn; } } if (owner) diff --git a/src/main/resources/jobConfig.yml b/src/main/resources/jobConfig.yml index b1872d4e..5a7ab36f 100644 --- a/src/main/resources/jobConfig.yml +++ b/src/main/resources/jobConfig.yml @@ -23,6 +23,12 @@ Jobs: # than 1 job shortname: W description: Earns money felling and planting trees + # Full description of job to be shown in job browse command + FullDescription: + - "&2Get money for:" + - " &7Planting trees" + - " &7Cutting down trees" + - " &7Killing players" # The colour of the name, for a full list of supported colours, go to the message config. ChatColour: GREEN # [OPTIONAL] The colour of the boss bar: GREEN, BLUE, RED, WHITE, YELLOW, PINK, PURPLE. @@ -79,6 +85,65 @@ Jobs: Id: 17 # data of block, usualy its 0, but in example Diorite will have id of 1 and data of 3 Data: 2 + # Defines maximum amount of daily quests player can have from THIS job + # This will not have effect on overall quest amount player will have + maxDailyQuests: 3 + # Daily quests + # Each job can have as many daily quests as you want + # Players will have access to quests from jobs he is currently working at + Quests: + # Quest identification. Can be any ONE word or number or both of them. This doesnt have any real meaning but it cant repeat + 1: + # Quest name used for quests list, don't forget to enclose it with " " + Name: "Break Oak wood" + # Quest action can be any valid job action. Look at lower for all possible action types + Action: Break + # Target id or name. Comes in same format as it is for regular job action + Target: "17-0" + # Amount of actions players should perform to complete this quest + Amount: 300 + # Command list to be performed after quest is finished. + # Use [playerName] to insert players name who finished that quest + RewardCommands: + - "money give [playerName] 500" + - "msg [playerName] Completed quest!" + # Quest description to be used to explain quest requirements or rewards for player + RewardDesc: + - "Break 300 Oak wood" + - "Get 500 bucks for this" + # Defines chance in getting this quest. + # If you have set 10 quests and player can have only 2, then quests with biggest chance will be picked most likely + # This will allow to have some rare quests with legendary rewards + Chance: 40 + # Defines to which job level you want to give out this quest. + # Keep in mind that player will keep quest even if he is over level limit if he got new one while being under + # In example: player with level 2 takes quests and levels up to level 5, he still can finish this quest and after next quest reset (check general config file) he will no longer have option to get this quest + toLevel: 3 + # Defines from which level you want to give option to get this quest + # You can use both limitations to have limited quests for particular job level ranges + fromLevel: 5 + 2: + Name: "Zombie killer" + Action: Kill + Target: Zombie + Amount: 50 + RewardCommands: + - "money give [playerName] 2000" + - "msg [playerName] Completed quest!" + RewardDesc: + - "Kill 50 zombies" + - "Get 2000 for this!" + 3: + Name: "Chicken cooker" + Action: Smelt + Target: "COOKED_CHICKEN" + Amount: 20 + RewardCommands: + - "money give [playerName] 300" + - "msg [playerName] Completed quest!" + RewardDesc: + - "Cook some chicken breasts" + - "Get 300 for this!" ######################################################################## # Section used to configure what items the job gets paid for, how much # they get paid and how much experience they gain. diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 699704a3..c372208e 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Jobs description: Jobs Plugin for the BukkitAPI main: com.gamingmesh.jobs.Jobs -version: 4.2.1 +version: 4.3.0 website: https://www.spigotmc.org/resources/jobs-reborn.4216/ author: phrstbrn softdepend: [Vault, iConomy, MythicMobs, McMMO, WorldGuard, MyPet] @@ -177,4 +177,10 @@ permissions: default: true jobs.command.exp: description: Grants access to the exp command - default: op \ No newline at end of file + default: op + jobs.command.quests: + description: Grants access to the quests command + default: true + jobs.command.clearownership: + description: Grants access to the clearownership command + default: true \ No newline at end of file