|
|
|
@ -18,8 +18,6 @@
|
|
|
|
|
|
|
|
|
|
package com.gamingmesh.jobs.config;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
@ -28,19 +26,18 @@ import java.util.Locale;
|
|
|
|
|
|
|
|
|
|
import org.bukkit.Bukkit;
|
|
|
|
|
import org.bukkit.World;
|
|
|
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
|
|
|
|
import org.bukkit.entity.Entity;
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
|
|
|
|
|
|
import com.gamingmesh.jobs.Jobs;
|
|
|
|
|
import com.gamingmesh.jobs.CMILib.ConfigReader;
|
|
|
|
|
import com.gamingmesh.jobs.CMILib.ItemManager.CMIMaterial;
|
|
|
|
|
import com.gamingmesh.jobs.resources.jfep.Parser;
|
|
|
|
|
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
|
|
|
|
|
import com.gamingmesh.jobs.container.CurrencyLimit;
|
|
|
|
|
import com.gamingmesh.jobs.container.CurrencyType;
|
|
|
|
|
import com.gamingmesh.jobs.container.LocaleReader;
|
|
|
|
|
import com.gamingmesh.jobs.container.Schedule;
|
|
|
|
|
import com.gamingmesh.jobs.CMILib.VersionChecker.Version;
|
|
|
|
|
import com.gamingmesh.jobs.resources.jfep.Parser;
|
|
|
|
|
|
|
|
|
|
public class GeneralConfigManager {
|
|
|
|
|
private Jobs plugin;
|
|
|
|
@ -74,6 +71,7 @@ public class GeneralConfigManager {
|
|
|
|
|
|
|
|
|
|
private int ResetTimeHour;
|
|
|
|
|
private int ResetTimeMinute;
|
|
|
|
|
private ConfigReader c = null;
|
|
|
|
|
|
|
|
|
|
// Limits
|
|
|
|
|
private HashMap<CurrencyType, CurrencyLimit> currencyLimitUse = new HashMap<>();
|
|
|
|
@ -374,30 +372,23 @@ public class GeneralConfigManager {
|
|
|
|
|
* loads from Jobs/generalConfig.yml
|
|
|
|
|
*/
|
|
|
|
|
private synchronized void loadGeneralSettings() {
|
|
|
|
|
File f = new File(Jobs.getFolder(), "generalConfig.yml");
|
|
|
|
|
YamlConfiguration conf = YamlConfiguration.loadConfiguration(f);
|
|
|
|
|
CommentedYamlConfiguration write = new CommentedYamlConfiguration();
|
|
|
|
|
LocaleReader c = new LocaleReader(conf, write);
|
|
|
|
|
try {
|
|
|
|
|
c = new ConfigReader("generalConfig.yml");
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
e1.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
if (c == null){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
c.header(Arrays.asList("General configuration.",
|
|
|
|
|
" The general configuration for the jobs plugin mostly includes how often the plugin",
|
|
|
|
|
" saves user data (when the user is in the game), the storage method, whether",
|
|
|
|
|
" to broadcast a message to the server when a user goes up a skill level.",
|
|
|
|
|
" It also allows admins to set the maximum number of jobs a player can have at",
|
|
|
|
|
" any one time."));
|
|
|
|
|
c.copyDefaults(true);
|
|
|
|
|
c.addComment("locale-language", "Default language.", "Example: en, ru", "File in locale folder with same name should exist. Example: messages_ru.yml");
|
|
|
|
|
|
|
|
|
|
StringBuilder header = new StringBuilder();
|
|
|
|
|
header.append("General configuration.");
|
|
|
|
|
header.append(System.getProperty("line.separator"));
|
|
|
|
|
header.append(" The general configuration for the jobs plugin mostly includes how often the plugin");
|
|
|
|
|
header.append(System.getProperty("line.separator"));
|
|
|
|
|
header.append("saves user data (when the user is in the game), the storage method, whether");
|
|
|
|
|
header.append(System.getProperty("line.separator"));
|
|
|
|
|
header.append("to broadcast a message to the server when a user goes up a skill level.");
|
|
|
|
|
header.append(System.getProperty("line.separator"));
|
|
|
|
|
header.append(" It also allows admins to set the maximum number of jobs a player can have at");
|
|
|
|
|
header.append(System.getProperty("line.separator"));
|
|
|
|
|
header.append("any one time.");
|
|
|
|
|
header.append(System.getProperty("line.separator"));
|
|
|
|
|
|
|
|
|
|
c.getC().options().copyDefaults(true);
|
|
|
|
|
|
|
|
|
|
c.getW().options().header(header.toString());
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("locale-language", "Default language.", "Example: en, ru", "File in locale folder with same name should exist. Example: messages_ru.yml");
|
|
|
|
|
localeString = c.get("locale-language", "en");
|
|
|
|
|
try {
|
|
|
|
|
int i = localeString.indexOf('_');
|
|
|
|
@ -411,7 +402,7 @@ public class GeneralConfigManager {
|
|
|
|
|
Jobs.getPluginLogger().warning("Invalid locale \"" + localeString + "\" defaulting to " + locale.getLanguage());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Jobs.getDBManager().start(c);
|
|
|
|
|
Jobs.getDBManager().start();
|
|
|
|
|
|
|
|
|
|
// c.getW().addComment("storage-method", "storage method, can be MySQL, sqlite");
|
|
|
|
|
// storageMethod = c.get("storage-method", "sqlite");
|
|
|
|
@ -432,149 +423,149 @@ public class GeneralConfigManager {
|
|
|
|
|
// c.get("mysql-database", "minecraft");
|
|
|
|
|
// c.get("mysql-table-prefix", "jobs_");
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("save-period", "How often in minutes you want it to save. This must be a non-zero number");
|
|
|
|
|
c.addComment("save-period", "How often in minutes you want it to save. This must be a non-zero number");
|
|
|
|
|
c.get("save-period", 10);
|
|
|
|
|
if (c.getW().getInt("save-period") <= 0) {
|
|
|
|
|
if (c.getInt("save-period") <= 0) {
|
|
|
|
|
Jobs.getPluginLogger().severe("Save period must be greater than 0! Defaulting to 10 minutes!");
|
|
|
|
|
c.getW().set("save-period", 10);
|
|
|
|
|
c.set("save-period", 10);
|
|
|
|
|
}
|
|
|
|
|
savePeriod = c.getW().getInt("save-period");
|
|
|
|
|
savePeriod = c.getInt("save-period");
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("save-on-disconnect", "Should player data be saved on disconnect?",
|
|
|
|
|
c.addComment("save-on-disconnect", "Should player data be saved on disconnect?",
|
|
|
|
|
"Player data is always periodically auto-saved and autosaved during a clean shutdown.",
|
|
|
|
|
"Only enable this if you have a multi-server setup, or have a really good reason for enabling this.", "Turning this on will decrease database performance.");
|
|
|
|
|
saveOnDisconnect = c.get("save-on-disconnect", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("selectionTool", "Tool used when selecting bounds for restricted area");
|
|
|
|
|
c.addComment("selectionTool", "Tool used when selecting bounds for restricted area");
|
|
|
|
|
if (CMIMaterial.get(getSelectionTooldID) == null)
|
|
|
|
|
getSelectionTooldID = 294;
|
|
|
|
|
else
|
|
|
|
|
getSelectionTooldID = c.get("selectionTool", 294);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("MultiServerCompatability", "Enable if you are using one data base for multiple servers across bungee network",
|
|
|
|
|
c.addComment("MultiServerCompatability", "Enable if you are using one data base for multiple servers across bungee network",
|
|
|
|
|
"This will force to load players data every time he is logging in to have most up to date data instead of having preloaded data",
|
|
|
|
|
"This will enable automatically save-on-disconnect feature");
|
|
|
|
|
MultiServerCompatability = c.get("MultiServerCompatability", false);
|
|
|
|
|
if (MultiServerCompatability)
|
|
|
|
|
saveOnDisconnect = true;
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Optimizations.NewVersion",
|
|
|
|
|
c.addComment("Optimizations.NewVersion",
|
|
|
|
|
"When set to true staff will be informed about new Jobs plugin version", "You need to have jobs.versioncheck permission node");
|
|
|
|
|
ShowNewVersion = c.get("Optimizations.NewVersion", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Optimizations.DecimalPlaces.Money",
|
|
|
|
|
c.addComment("Optimizations.DecimalPlaces.Money",
|
|
|
|
|
"Decimal places to be shown");
|
|
|
|
|
DecimalPlacesMoney = "%." + c.get("Optimizations.DecimalPlaces.Money", 2) + "f";
|
|
|
|
|
DecimalPlacesExp = "%." + c.get("Optimizations.DecimalPlaces.Exp", 2) + "f";
|
|
|
|
|
DecimalPlacesPoints = "%." + c.get("Optimizations.DecimalPlaces.Points", 2) + "f";
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Optimizations.DBCleaning.Jobs.Use",
|
|
|
|
|
c.addComment("Optimizations.DBCleaning.Jobs.Use",
|
|
|
|
|
"Warning!!! before enabling this feature, please make data base backup, just in case there will be some issues with data base cleaning",
|
|
|
|
|
"When set to true, jobs data base will be cleaned on each startup to avoid having not used jobs",
|
|
|
|
|
"keep in mind that this will only clean actual jobs, but not recorded players");
|
|
|
|
|
DBCleaningJobsUse = c.get("Optimizations.DBCleaning.Jobs.Use", false);
|
|
|
|
|
c.getW().addComment("Optimizations.DBCleaning.Jobs.Level", "Any one who has jobs level equal or less then set, hies job will be removed from data base");
|
|
|
|
|
c.addComment("Optimizations.DBCleaning.Jobs.Level", "Any one who has jobs level equal or less then set, hies job will be removed from data base");
|
|
|
|
|
DBCleaningJobsLvl = c.get("Optimizations.DBCleaning.Jobs.Level", 1);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Optimizations.DBCleaning.Users.Use",
|
|
|
|
|
c.addComment("Optimizations.DBCleaning.Users.Use",
|
|
|
|
|
"Warning!!! before enabling this feature, please make data base backup, just in case there will be some issues with data base cleaning",
|
|
|
|
|
"When set to true, data base will be cleaned on each startup from user data to avoid having old player data");
|
|
|
|
|
DBCleaningUsersUse = c.get("Optimizations.DBCleaning.Users.Use", false);
|
|
|
|
|
c.getW().addComment("Optimizations.DBCleaning.Users.Days", "Any one who not played for defined amount of days, will be removed from data base");
|
|
|
|
|
c.addComment("Optimizations.DBCleaning.Users.Days", "Any one who not played for defined amount of days, will be removed from data base");
|
|
|
|
|
DBCleaningUsersDays = c.get("Optimizations.DBCleaning.Users.Days", 60);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Optimizations.AutoJobJoin.Use", "Use or not auto join jobs feature",
|
|
|
|
|
c.addComment("Optimizations.AutoJobJoin.Use", "Use or not auto join jobs feature",
|
|
|
|
|
"If you are not using auto join feature, keep it disabled");
|
|
|
|
|
AutoJobJoinUse = c.get("Optimizations.AutoJobJoin.Use", false);
|
|
|
|
|
c.getW().addComment("Optimizations.AutoJobJoin.Delay", "Delay in seconds to perform auto join job if used after player joins server",
|
|
|
|
|
c.addComment("Optimizations.AutoJobJoin.Delay", "Delay in seconds to perform auto join job if used after player joins server",
|
|
|
|
|
"If you using offline server, try to keep it slightly more than your login plugin gives time to enter password",
|
|
|
|
|
"For player to auto join job add permission node jobs.autojoin.[jobname]",
|
|
|
|
|
"Op players are ignored");
|
|
|
|
|
AutoJobJoinDelay = c.get("Optimizations.AutoJobJoin.Delay", 15);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Optimizations.AllowDelevel", "When set to true players who gets negative experience can delevel job up to level 1",
|
|
|
|
|
c.addComment("Optimizations.AllowDelevel", "When set to true players who gets negative experience can delevel job up to level 1",
|
|
|
|
|
"ATTENTION! Set it to true only if you certain that commands performed on level up will not cause issues if player start level and delevel in a row.");
|
|
|
|
|
AllowDelevel = c.get("Optimizations.AllowDelevel", false);
|
|
|
|
|
|
|
|
|
|
// c.getW().addComment("Optimizations.UseLocalOfflinePlayersData", "With this set to true, offline player data will be taken from local player data files",
|
|
|
|
|
// c.addComment("Optimizations.UseLocalOfflinePlayersData", "With this set to true, offline player data will be taken from local player data files",
|
|
|
|
|
// "This will eliminate small lag spikes when request is being send to mojangs servers for offline players data",
|
|
|
|
|
// "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 = c.get("Optimizations.UseLocalOfflinePlayersData", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Optimizations.DisabledWorlds.Use", "By setting this to true, Jobs plugin will be disabled in given worlds",
|
|
|
|
|
c.addComment("Optimizations.DisabledWorlds.Use", "By setting this to true, Jobs plugin will be disabled in given worlds",
|
|
|
|
|
"Only commands can be performed from disabled worlds with jobs.disabledworld.commands permission node");
|
|
|
|
|
DisabledWorldsUse = c.get("Optimizations.DisabledWorlds.Use", false);
|
|
|
|
|
DisabledWorldsList = c.getStringList("Optimizations.DisabledWorlds.List", Arrays.asList(Bukkit.getWorlds().get(0).getName()));
|
|
|
|
|
DisabledWorldsList = c.get("Optimizations.DisabledWorlds.List", Arrays.asList(Bukkit.getWorlds().get(0).getName()));
|
|
|
|
|
|
|
|
|
|
// c.getW().addComment("Optimizations.Purge.Use", "By setting this to true, Jobs plugin will clean data base on startup from all jobs with level 1 and at 0 exp");
|
|
|
|
|
// c.addComment("Optimizations.Purge.Use", "By setting this to true, Jobs plugin will clean data base on startup from all jobs with level 1 and at 0 exp");
|
|
|
|
|
// PurgeUse = c.get("Optimizations.Purge.Use", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Logging.Use", "With this set to true all players jobs actions will be logged to database for easy to see statistics",
|
|
|
|
|
c.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 = c.get("Logging.Use", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("broadcast.on-skill-up.use", "Do all players get a message when someone goes up a skill level?");
|
|
|
|
|
c.addComment("broadcast.on-skill-up.use", "Do all players get a message when someone goes up a skill level?");
|
|
|
|
|
isBroadcastingSkillups = c.get("broadcast.on-skill-up.use", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("broadcast.on-level-up.use", "Do all players get a message when someone goes up a level?");
|
|
|
|
|
c.addComment("broadcast.on-level-up.use", "Do all players get a message when someone goes up a level?");
|
|
|
|
|
isBroadcastingLevelups = c.get("broadcast.on-level-up.use", false);
|
|
|
|
|
c.getW().addComment("broadcast.on-level-up.levels", "For what levels you want to broadcast message? Keep it at 0 if you want for all of them");
|
|
|
|
|
c.addComment("broadcast.on-level-up.levels", "For what levels you want to broadcast message? Keep it at 0 if you want for all of them");
|
|
|
|
|
BroadcastingLevelUpLevels = c.getIntList("broadcast.on-level-up.levels", Arrays.asList(0));
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("DailyQuests.ResetTime", "Defines time in 24hour format when we want to give out new daily quests",
|
|
|
|
|
c.addComment("DailyQuests.ResetTime", "Defines time in 24hour format when we want to give out new daily quests",
|
|
|
|
|
"Any daily quests given before reset will be invalid and new ones will be given out");
|
|
|
|
|
ResetTimeHour = c.get("DailyQuests.ResetTime.Hour", 4);
|
|
|
|
|
ResetTimeMinute = c.get("DailyQuests.ResetTime.Minute", 0);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("max-jobs", "Maximum number of jobs a player can join.", "Use 0 for no maximum", "Keep in mind that jobs.max.[amount] will bypass this setting");
|
|
|
|
|
c.addComment("max-jobs", "Maximum number of jobs a player can join.", "Use 0 for no maximum", "Keep in mind that jobs.max.[amount] will bypass this setting");
|
|
|
|
|
maxJobs = c.get("max-jobs", 3);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("hide-jobs-without-permission", "Hide jobs from player if they lack the permission to join the job");
|
|
|
|
|
c.addComment("hide-jobs-without-permission", "Hide jobs from player if they lack the permission to join the job");
|
|
|
|
|
hideJobsWithoutPermission = c.get("hide-jobs-without-permission", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("hide-jobsinfo-without-permission", "Hide jobs info from player if they lack the permission to join the job");
|
|
|
|
|
c.addComment("hide-jobsinfo-without-permission", "Hide jobs info from player if they lack the permission to join the job");
|
|
|
|
|
hideJobsInfoWithoutPermission = c.get("hide-jobsinfo-without-permission", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("enable-pay-near-spawner",
|
|
|
|
|
c.addComment("enable-pay-near-spawner",
|
|
|
|
|
"Option to allow payment to be made when killing mobs from a spawner.",
|
|
|
|
|
"Use jobs.nearspawner.[amount] to define multiplayer. Example jobs.nearspawner.-0.5 will pay half of payment, jobs.nearspawner.-1 will not pay at all");
|
|
|
|
|
payNearSpawner = c.get("enable-pay-near-spawner", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("enable-pay-creative", "Option to allow payment to be made in creative mode. This ignoring when a group has 'jobs.paycreative' permission.");
|
|
|
|
|
c.addComment("enable-pay-creative", "Option to allow payment to be made in creative mode. This ignoring when a group has 'jobs.paycreative' permission.");
|
|
|
|
|
payInCreative = c.get("enable-pay-creative", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("enable-pay-for-exploring-when-flying", "Option to allow payment to be made for exploring when player flies");
|
|
|
|
|
c.addComment("enable-pay-for-exploring-when-flying", "Option to allow payment to be made for exploring when player flies");
|
|
|
|
|
payExploringWhenFlying = c.get("enable-pay-for-exploring-when-flying", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("add-xp-player", "Adds the Jobs xp received to the player's Minecraft XP bar");
|
|
|
|
|
c.addComment("add-xp-player", "Adds the Jobs xp received to the player's Minecraft XP bar");
|
|
|
|
|
addXpPlayer = c.get("add-xp-player", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("modify-chat", "Modifys chat to add chat titles. If you're using a chat manager, you may add the tag {jobs} to your chat format and disable this.");
|
|
|
|
|
c.addComment("modify-chat", "Modifys chat to add chat titles. If you're using a chat manager, you may add the tag {jobs} to your chat format and disable this.");
|
|
|
|
|
modifyChat = c.get("modify-chat.use", true);
|
|
|
|
|
modifyChatPrefix = c.get("modify-chat.prefix", "&c[", true);
|
|
|
|
|
modifyChatSuffix = c.get("modify-chat.suffix", "&c]&r ", true);
|
|
|
|
|
modifyChatSeparator = c.get("modify-chat.separator", " ", true);
|
|
|
|
|
modifyChatPrefix = c.get("modify-chat.prefix", "&c[");
|
|
|
|
|
modifyChatSuffix = c.get("modify-chat.suffix", "&c]&r ");
|
|
|
|
|
modifyChatSeparator = c.get("modify-chat.separator", " ");
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("UseCustomNames", "Do you want to use custom item/block/mob/enchant/color names?",
|
|
|
|
|
c.addComment("UseCustomNames", "Do you want to use custom item/block/mob/enchant/color names?",
|
|
|
|
|
"With this set to true names like Stone:1 will be translated to Granite", "Name list is in TranslatableWords.yml file");
|
|
|
|
|
UseCustomNames = c.get("UseCustomNames", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("economy-batch-delay", "Changes how often, in seconds, players are paid out. Default is 5 seconds.",
|
|
|
|
|
c.addComment("economy-batch-delay", "Changes how often, in seconds, players are paid out. Default is 5 seconds.",
|
|
|
|
|
"Setting this too low may cause tick lag. Increase this to improve economy performance (at the cost of delays in payment)");
|
|
|
|
|
economyBatchDelay = c.get("economy-batch-delay", 5);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("economy-async", "Enable async economy calls.", "Disable this if you have issues with payments or your plugin is not thread safe.");
|
|
|
|
|
c.addComment("economy-async", "Enable async economy calls.", "Disable this if you have issues with payments or your plugin is not thread safe.");
|
|
|
|
|
economyAsync = c.get("economy-async", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Economy.PaymentMethods",
|
|
|
|
|
c.addComment("Economy.PaymentMethods",
|
|
|
|
|
"By disabling one of these, players no longer will get particular payment.",
|
|
|
|
|
"Useful for removing particular payment method without editing whole jobConfig file");
|
|
|
|
|
PaymentMethodsMoney = c.get("Economy.PaymentMethods.Money", true);
|
|
|
|
|
PaymentMethodsPoints = c.get("Economy.PaymentMethods.Points", true);
|
|
|
|
|
PaymentMethodsExp = c.get("Economy.PaymentMethods.Exp", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Economy.GeneralMulti",
|
|
|
|
|
c.addComment("Economy.GeneralMulti",
|
|
|
|
|
"Can be used to change payment amounts for all jobs and all actions if you want to readjust them",
|
|
|
|
|
"Amounts are in percentage, above 0 will increase payments",
|
|
|
|
|
"Amount belove 0 will decrease payments",
|
|
|
|
@ -586,18 +577,18 @@ public class GeneralConfigManager {
|
|
|
|
|
generalMulti.put(one, c.get("Economy.GeneralMulti." + one.name(), 0D) / 100D);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Economy.MinimumOveralPayment.use",
|
|
|
|
|
c.addComment("Economy.MinimumOveralPayment.use",
|
|
|
|
|
"Determines minimum payment. In example if player uses McMMO treefeller and earns only 20%, but at same time he gets 25% penalty from dynamic payment. He can 'get' negative amount of money",
|
|
|
|
|
"This will limit it to particular percentage", "Works only when original payment is above 0");
|
|
|
|
|
useMinimumOveralPayment = c.get("Economy.MinimumOveralPayment.use", true);
|
|
|
|
|
MinimumOveralPaymentLimit = c.get("Economy.MinimumOveralPayment.limit", 0.1);
|
|
|
|
|
c.getW().addComment("Economy.MinimumOveralPoints.use",
|
|
|
|
|
c.addComment("Economy.MinimumOveralPoints.use",
|
|
|
|
|
"Determines minimum payment. In example if player uses McMMO treefeller and earns only 20%, but at same time he gets 25% penalty from dynamic payment. He can 'get' negative amount of money",
|
|
|
|
|
"This will limit it to particular percentage", "Works only when original payment is above 0");
|
|
|
|
|
useMinimumOveralPoints = c.get("Economy.MinimumOveralPoints.use", true);
|
|
|
|
|
MinimumOveralPointsLimit = c.get("Economy.MinimumOveralPoints.limit", 0.1);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Economy.DynamicPayment.use", "Do you want to use dynamic payment dependent on how many players already working for jobs?",
|
|
|
|
|
c.addComment("Economy.DynamicPayment.use", "Do you want to use dynamic payment dependent on how many players already working for jobs?",
|
|
|
|
|
"This can help automatically lift up payments for not so popular jobs and lower for most popular ones");
|
|
|
|
|
useDynamicPayment = c.get("Economy.DynamicPayment.use", false);
|
|
|
|
|
|
|
|
|
@ -616,43 +607,43 @@ public class GeneralConfigManager {
|
|
|
|
|
|
|
|
|
|
DynamicPaymentMaxPenalty = c.get("Economy.DynamicPayment.MaxPenalty", 25.0);
|
|
|
|
|
DynamicPaymentMaxBonus = c.get("Economy.DynamicPayment.MaxBonus", 100.0);
|
|
|
|
|
c.getW().addComment("Economy.MaxPayment.curve.use", "Enabling this feature will mean players will still earn once they reach cap but " +
|
|
|
|
|
c.addComment("Economy.MaxPayment.curve.use", "Enabling this feature will mean players will still earn once they reach cap but " +
|
|
|
|
|
"will loose a percentage the higher over cap they go. Controlled by a factor. math is ```100/((1/factor*percentOver^2)+1)```");
|
|
|
|
|
useMaxPaymentCurve = c.get("Economy.MaxPayment.curve.use", false);
|
|
|
|
|
int temp = c.get("Economy.MaxPayment.curve.factor", 10);
|
|
|
|
|
maxPaymentCurveFactor = ((float) temp) / 1000;
|
|
|
|
|
c.getW().addComment("Economy.UseServerAccount", "Server economy account", "With this enabled, players will get money from defined user (server account)",
|
|
|
|
|
c.addComment("Economy.UseServerAccount", "Server economy account", "With this enabled, players will get money from defined user (server account)",
|
|
|
|
|
"If this account don't have enough money to pay for players for, player will get message");
|
|
|
|
|
UseServerAccount = c.get("Economy.UseServerAccount", false);
|
|
|
|
|
c.getW().addComment("Economy.AccountName", "Username should be with Correct capitalization");
|
|
|
|
|
c.addComment("Economy.AccountName", "Username should be with Correct capitalization");
|
|
|
|
|
ServerAccountName = c.get("Economy.AccountName", "Server");
|
|
|
|
|
c.getW().addComment("Economy.Taxes.use", "Do you want to use taxes feature for jobs payment?");
|
|
|
|
|
c.addComment("Economy.Taxes.use", "Do you want to use taxes feature for jobs payment?");
|
|
|
|
|
UseTaxes = c.get("Economy.Taxes.use", false);
|
|
|
|
|
c.getW().addComment("Economy.Taxes.AccountName", "Username should be with Correct capitalization, it can be same as setup in server account before");
|
|
|
|
|
c.addComment("Economy.Taxes.AccountName", "Username should be with Correct capitalization, it can be same as setup in server account before");
|
|
|
|
|
ServertaxesAccountName = c.get("Economy.Taxes.AccountName", "Server");
|
|
|
|
|
c.getW().addComment("Economy.Taxes.Amount", "Amount in percentage");
|
|
|
|
|
c.addComment("Economy.Taxes.Amount", "Amount in percentage");
|
|
|
|
|
TaxesAmount = c.get("Economy.Taxes.Amount", 15.0);
|
|
|
|
|
c.getW().addComment("Economy.Taxes.TransferToServerAccount", "Do you want to transfer taxes to server account?");
|
|
|
|
|
c.addComment("Economy.Taxes.TransferToServerAccount", "Do you want to transfer taxes to server account?");
|
|
|
|
|
TransferToServerAccount = c.get("Economy.Taxes.TransferToServerAccount", true);
|
|
|
|
|
c.getW().addComment("Economy.Taxes.TakeFromPlayersPayment",
|
|
|
|
|
c.addComment("Economy.Taxes.TakeFromPlayersPayment",
|
|
|
|
|
"With this true, taxes will be taken from players payment and he will get less money than its shown in jobs info",
|
|
|
|
|
"When its false player will get full payment and server account will get taxes amount to hes account");
|
|
|
|
|
TakeFromPlayersPayment = c.get("Economy.Taxes.TakeFromPlayersPayment", false);
|
|
|
|
|
|
|
|
|
|
// Money limit
|
|
|
|
|
CurrencyLimit limit = new CurrencyLimit();
|
|
|
|
|
c.getW().addComment("Economy.Limit.Money", "Money gain limit", "With this enabled, players will be limited how much they can make in defined time",
|
|
|
|
|
c.addComment("Economy.Limit.Money", "Money gain limit", "With this enabled, players will be limited how much they can make in defined time",
|
|
|
|
|
"Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
limit.setEnabled(c.get("Economy.Limit.Money.Use", false));
|
|
|
|
|
List<CurrencyType> list = new ArrayList<>();
|
|
|
|
|
c.getW().addComment("Economy.Limit.Money.StopWithExp", "Do you want to stop money gain when exp limit reached?");
|
|
|
|
|
c.addComment("Economy.Limit.Money.StopWithExp", "Do you want to stop money gain when exp limit reached?");
|
|
|
|
|
if (c.get("Economy.Limit.Money.StopWithExp", false))
|
|
|
|
|
list.add(CurrencyType.EXP);
|
|
|
|
|
c.getW().addComment("Economy.Limit.Money.StopWithPoint", "Do you want to stop money gain when point limit reached?");
|
|
|
|
|
c.addComment("Economy.Limit.Money.StopWithPoint", "Do you want to stop money gain when point limit reached?");
|
|
|
|
|
if (c.get("Economy.Limit.Money.StopWithPoint", false))
|
|
|
|
|
list.add(CurrencyType.POINTS);
|
|
|
|
|
limit.setStopWith(list);
|
|
|
|
|
c.getW().addComment("Economy.Limit.Money.MoneyLimit",
|
|
|
|
|
c.addComment("Economy.Limit.Money.MoneyLimit",
|
|
|
|
|
"Equation to calculate max limit. Option to use total level to include players total amount levels of current jobs",
|
|
|
|
|
"You can always use simple number to set money limit",
|
|
|
|
|
"Default equation is: 500+500*(totallevel/100), this will add 1% from 500 for each level player have",
|
|
|
|
@ -667,9 +658,9 @@ public class GeneralConfigManager {
|
|
|
|
|
Jobs.getPluginLogger().warning("MoneyLimit has an invalid value. Disabling money limit!");
|
|
|
|
|
limit.setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
c.getW().addComment("Economy.Limit.Money.TimeLimit", "Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
c.addComment("Economy.Limit.Money.TimeLimit", "Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
limit.setTimeLimit(c.get("Economy.Limit.Money.TimeLimit", 3600));
|
|
|
|
|
c.getW().addComment("Economy.Limit.Money.AnnouncementDelay", "Delay between announcements about reached money limit",
|
|
|
|
|
c.addComment("Economy.Limit.Money.AnnouncementDelay", "Delay between announcements about reached money limit",
|
|
|
|
|
"Keep this from 30 to 5 min (300), as players can get annoyed of constant message displaying");
|
|
|
|
|
limit.setAnnouncementDelay(c.get("Economy.Limit.Money.AnnouncementDelay", 30));
|
|
|
|
|
currencyLimitUse.put(CurrencyType.MONEY, limit);
|
|
|
|
@ -677,16 +668,16 @@ public class GeneralConfigManager {
|
|
|
|
|
// Point limit
|
|
|
|
|
limit = new CurrencyLimit();
|
|
|
|
|
list = new ArrayList<>();
|
|
|
|
|
c.getW().addComment("Economy.Limit.Point", "Point gain limit", "With this enabled, players will be limited how much they can make in defined time");
|
|
|
|
|
c.addComment("Economy.Limit.Point", "Point gain limit", "With this enabled, players will be limited how much they can make in defined time");
|
|
|
|
|
limit.setEnabled(c.get("Economy.Limit.Point.Use", false));
|
|
|
|
|
c.getW().addComment("Economy.Limit.Point.StopWithExp", "Do you want to stop Point gain when exp limit reached?");
|
|
|
|
|
c.addComment("Economy.Limit.Point.StopWithExp", "Do you want to stop Point gain when exp limit reached?");
|
|
|
|
|
if (c.get("Economy.Limit.Point.StopWithExp", false))
|
|
|
|
|
list.add(CurrencyType.EXP);
|
|
|
|
|
c.getW().addComment("Economy.Limit.Point.StopWithMoney", "Do you want to stop Point gain when money limit reached?");
|
|
|
|
|
c.addComment("Economy.Limit.Point.StopWithMoney", "Do you want to stop Point gain when money limit reached?");
|
|
|
|
|
if (c.get("Economy.Limit.Point.StopWithMoney", false))
|
|
|
|
|
list.add(CurrencyType.MONEY);
|
|
|
|
|
limit.setStopWith(list);
|
|
|
|
|
c.getW().addComment("Economy.Limit.Point.Limit",
|
|
|
|
|
c.addComment("Economy.Limit.Point.Limit",
|
|
|
|
|
"Equation to calculate max limit. Option to use total level to include players total amount levels of current jobs",
|
|
|
|
|
"You can always use simple number to set limit",
|
|
|
|
|
"Default equation is: 500+500*(totallevel/100), this will add 1% from 500 for each level player have",
|
|
|
|
@ -701,9 +692,9 @@ public class GeneralConfigManager {
|
|
|
|
|
Jobs.getPluginLogger().warning("PointLimit has an invalid value. Disabling money limit!");
|
|
|
|
|
limit.setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
c.getW().addComment("Economy.Limit.Point.TimeLimit", "Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
c.addComment("Economy.Limit.Point.TimeLimit", "Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
limit.setTimeLimit(c.get("Economy.Limit.Point.TimeLimit", 3600));
|
|
|
|
|
c.getW().addComment("Economy.Limit.Point.AnnouncementDelay", "Delay between announcements about reached limit",
|
|
|
|
|
c.addComment("Economy.Limit.Point.AnnouncementDelay", "Delay between announcements about reached limit",
|
|
|
|
|
"Keep this from 30 to 5 min (300), as players can get annoyed of constant message displaying");
|
|
|
|
|
limit.setAnnouncementDelay(c.get("Economy.Limit.Point.AnnouncementDelay", 30));
|
|
|
|
|
currencyLimitUse.put(CurrencyType.POINTS, limit);
|
|
|
|
@ -711,17 +702,17 @@ public class GeneralConfigManager {
|
|
|
|
|
// Exp limit
|
|
|
|
|
limit = new CurrencyLimit();
|
|
|
|
|
list = new ArrayList<>();
|
|
|
|
|
c.getW().addComment("Economy.Limit.Exp", "Exp gain limit", "With this enabled, players will be limited how much they can get in defined time",
|
|
|
|
|
c.addComment("Economy.Limit.Exp", "Exp gain limit", "With this enabled, players will be limited how much they can get in defined time",
|
|
|
|
|
"Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
limit.setEnabled(c.get("Economy.Limit.Exp.Use", false));
|
|
|
|
|
c.getW().addComment("Economy.Limit.Exp.StopWithMoney", "Do you want to stop exp gain when money limit reached?");
|
|
|
|
|
c.addComment("Economy.Limit.Exp.StopWithMoney", "Do you want to stop exp gain when money limit reached?");
|
|
|
|
|
if (c.get("Economy.Limit.Exp.StopWithMoney", false))
|
|
|
|
|
list.add(CurrencyType.MONEY);
|
|
|
|
|
c.getW().addComment("Economy.Limit.Exp.StopWithPoint", "Do you want to stop exp gain when point limit reached?");
|
|
|
|
|
c.addComment("Economy.Limit.Exp.StopWithPoint", "Do you want to stop exp gain when point limit reached?");
|
|
|
|
|
if (c.get("Economy.Limit.Exp.StopWithPoint", false))
|
|
|
|
|
list.add(CurrencyType.POINTS);
|
|
|
|
|
limit.setStopWith(list);
|
|
|
|
|
c.getW().addComment("Economy.Limit.Exp.Limit", "Equation to calculate max money limit. Option to use total level to include players total amount of current jobs",
|
|
|
|
|
c.addComment("Economy.Limit.Exp.Limit", "Equation to calculate max money limit. Option to use total level to include players total amount of current jobs",
|
|
|
|
|
"You can always use simple number to set exp limit",
|
|
|
|
|
"Default equation is: 5000+5000*(totallevel/100), this will add 1% from 5000 for each level player have",
|
|
|
|
|
"So player with 2 jobs with level 15 and 22 will have 6850 limit");
|
|
|
|
@ -735,148 +726,148 @@ public class GeneralConfigManager {
|
|
|
|
|
Jobs.getPluginLogger().warning("ExpLimit has an invalid value. Disabling money limit!");
|
|
|
|
|
limit.setEnabled(false);
|
|
|
|
|
}
|
|
|
|
|
c.getW().addComment("Economy.Limit.Exp.TimeLimit", "Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
c.addComment("Economy.Limit.Exp.TimeLimit", "Time in seconds: 60 = 1 min, 3600 = 1 hour, 86400 = 24 hours");
|
|
|
|
|
limit.setTimeLimit(c.get("Economy.Limit.Exp.TimeLimit", 3600));
|
|
|
|
|
c.getW().addComment("Economy.Limit.Exp.AnnouncementDelay", "Delay between announcements about reached Exp limit",
|
|
|
|
|
c.addComment("Economy.Limit.Exp.AnnouncementDelay", "Delay between announcements about reached Exp limit",
|
|
|
|
|
"Keep this from 30 to 5 min (300), as players can get annoyed of constant message displaying");
|
|
|
|
|
limit.setAnnouncementDelay(c.get("Economy.Limit.Exp.AnnouncementDelay", 30));
|
|
|
|
|
currencyLimitUse.put(CurrencyType.EXP, limit);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Economy.Repair.PayForRenaming", "Do you want to give money for only renaming items in anvil?",
|
|
|
|
|
c.addComment("Economy.Repair.PayForRenaming", "Do you want to give money for only renaming items in anvil?",
|
|
|
|
|
"Players will get full pay as they would for remaining two items when they only rename one",
|
|
|
|
|
"This is not a big issue, but if you want to disable it, you can");
|
|
|
|
|
PayForRenaming = c.get("Economy.Repair.PayForRenaming", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Economy.Crafting.PayForEachCraft",
|
|
|
|
|
c.addComment("Economy.Crafting.PayForEachCraft",
|
|
|
|
|
"With this true, player will get money for all crafted items instead of each crafting action (like with old payment mechanic)",
|
|
|
|
|
"By default its false, as you can make ALOT of money if prices kept from old payment mechanics");
|
|
|
|
|
PayForEachCraft = c.get("Economy.Crafting.PayForEachCraft", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Economy.MilkingCow.CancelMilking", "With this true, when timer is still going, cow milking event will be canceled",
|
|
|
|
|
c.addComment("Economy.MilkingCow.CancelMilking", "With this true, when timer is still going, cow milking event will be canceled",
|
|
|
|
|
"With this false, player will get bucket of milk, but still no payment");
|
|
|
|
|
CancelCowMilking = c.get("Economy.MilkingCow.CancelMilking", false);
|
|
|
|
|
c.getW().addComment("Economy.MilkingCow.Timer",
|
|
|
|
|
c.addComment("Economy.MilkingCow.Timer",
|
|
|
|
|
"How ofter player can milk cows in seconds. Keep in mind that by default player can milk cow indefinitely and as often as he wants",
|
|
|
|
|
"Set to 0 if you want to disable timer");
|
|
|
|
|
CowMilkingTimer = c.get("Economy.MilkingCow.Timer", 30) * 1000;
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.Furnaces.Reassign",
|
|
|
|
|
c.addComment("ExploitProtections.Furnaces.Reassign",
|
|
|
|
|
"When enabled, players interacted furnaces will be saved into a file and will be reassigned after restart to keep giving out money",
|
|
|
|
|
"Players will no longer need to click on furnace to get paid from it after server restart");
|
|
|
|
|
FurnacesReassign = c.get("ExploitProtections.Furnaces.Reassign", true);
|
|
|
|
|
c.getW().addComment("ExploitProtections.Furnaces.MaxDefaultAvailable",
|
|
|
|
|
c.addComment("ExploitProtections.Furnaces.MaxDefaultAvailable",
|
|
|
|
|
"Defines max available furnaces each player can have to get paid from",
|
|
|
|
|
"This can be overridden with jobs.maxfurnaces.[amount] permission node");
|
|
|
|
|
FurnacesMaxDefault = c.get("ExploitProtections.Furnaces.MaxDefaultAvailable", 20);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.BrewingStands.Reassign",
|
|
|
|
|
c.addComment("ExploitProtections.BrewingStands.Reassign",
|
|
|
|
|
"When enabled, players interacted brewing stands will be saved into file and will be reassigned after restart to keep giving out money",
|
|
|
|
|
"Players will no longer need to click on brewing stand to get paid from it after server restart");
|
|
|
|
|
BrewingStandsReassign = c.get("ExploitProtections.BrewingStands.Reassign", true);
|
|
|
|
|
c.getW().addComment("ExploitProtections.BrewingStands.MaxDefaultAvailable",
|
|
|
|
|
c.addComment("ExploitProtections.BrewingStands.MaxDefaultAvailable",
|
|
|
|
|
"Defines max available brewing stands each player can have to get paid from",
|
|
|
|
|
"Set to 0 if you want to disable this limitation",
|
|
|
|
|
"This can be overridden with jobs.maxbrewingstands.[amount] permission node");
|
|
|
|
|
BrewingStandsMaxDefault = c.get("ExploitProtections.BrewingStands.MaxDefaultAvailable", 20);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.General.PlaceAndBreakProtection",
|
|
|
|
|
c.addComment("ExploitProtections.General.PlaceAndBreakProtection",
|
|
|
|
|
"Enable blocks protection, like ore, from exploiting by placing and destroying same block again and again.",
|
|
|
|
|
"Modify restrictedBlocks.yml for blocks you want to protect");
|
|
|
|
|
useBlockProtection = c.get("ExploitProtections.General.PlaceAndBreakProtection", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.General.KeepDataFor",
|
|
|
|
|
c.addComment("ExploitProtections.General.KeepDataFor",
|
|
|
|
|
"For how long in days to keep block protection data in data base", "This will clean block data which ones have -1 as cooldown value",
|
|
|
|
|
"Data base cleanup will be performed on each server startup");
|
|
|
|
|
BlockProtectionDays = c.get("ExploitProtections.General.KeepDataFor", 14);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.General.GlobalBlockTimer", "All blocks will be protected X sec after player places it on ground.");
|
|
|
|
|
c.addComment("ExploitProtections.General.GlobalBlockTimer", "All blocks will be protected X sec after player places it on ground.");
|
|
|
|
|
useGlobalTimer = c.get("ExploitProtections.General.GlobalBlockTimer.use", true);
|
|
|
|
|
globalblocktimer = c.get("ExploitProtections.General.GlobalBlockTimer.timer", 3);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.General.SilkTouchProtection", "Enable silk touch protection.",
|
|
|
|
|
c.addComment("ExploitProtections.General.SilkTouchProtection", "Enable silk touch protection.",
|
|
|
|
|
"With this enabled players wont get paid for broken blocks from restrictedblocks list with silk touch tool.");
|
|
|
|
|
useSilkTouchProtection = c.get("ExploitProtections.General.SilkTouchProtection", false);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.General.MonsterDamage.Use", "This section controls how much damage player should do to monster for player to get paid",
|
|
|
|
|
c.addComment("ExploitProtections.General.MonsterDamage.Use", "This section controls how much damage player should do to monster for player to get paid",
|
|
|
|
|
"This prevents from killing monsters in one hit when they suffer in example fall damage");
|
|
|
|
|
MonsterDamageUse = c.get("ExploitProtections.General.MonsterDamage.Use", false);
|
|
|
|
|
MonsterDamagePercentage = c.get("ExploitProtections.General.MonsterDamage.Percentage", 60);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.McMMO", "McMMO abilities");
|
|
|
|
|
c.getW().addComment("ExploitProtections.McMMO.TreeFellerMultiplier", "Players will get part of money from cutting trees with treefeller ability enabled.",
|
|
|
|
|
c.addComment("ExploitProtections.McMMO", "McMMO abilities");
|
|
|
|
|
c.addComment("ExploitProtections.McMMO.TreeFellerMultiplier", "Players will get part of money from cutting trees with treefeller ability enabled.",
|
|
|
|
|
"0.2 means 20% of original price");
|
|
|
|
|
TreeFellerMultiplier = c.get("ExploitProtections.McMMO.TreeFellerMultiplier", 0.2);
|
|
|
|
|
c.getW().addComment("ExploitProtections.McMMO.gigaDrillMultiplier", "Players will get part of money from braking blocks with gigaDrill ability enabled.",
|
|
|
|
|
c.addComment("ExploitProtections.McMMO.gigaDrillMultiplier", "Players will get part of money from braking blocks with gigaDrill ability enabled.",
|
|
|
|
|
"0.2 means 20% of original price");
|
|
|
|
|
gigaDrillMultiplier = c.get("ExploitProtections.McMMO.gigaDrillMultiplier", 0.2);
|
|
|
|
|
c.getW().addComment("ExploitProtections.McMMO.superBreakerMultiplier", "Players will get part of money from braking blocks with super breaker ability enabled.",
|
|
|
|
|
c.addComment("ExploitProtections.McMMO.superBreakerMultiplier", "Players will get part of money from braking blocks with super breaker ability enabled.",
|
|
|
|
|
"0.2 means 20% of original price");
|
|
|
|
|
superBreakerMultiplier = c.get("ExploitProtections.McMMO.superBreakerMultiplier", 0.2);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.MythicMobs", "MythicMobs plugin support", "Disable if you having issues with it or using old version");
|
|
|
|
|
c.addComment("ExploitProtections.MythicMobs", "MythicMobs plugin support", "Disable if you having issues with it or using old version");
|
|
|
|
|
MythicMobsEnabled = c.get("ExploitProtections.MythicMobs.enabled", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.Spawner.PreventSlimeSplit", "Prevent slime splitting when they are from spawner",
|
|
|
|
|
c.addComment("ExploitProtections.Spawner.PreventSlimeSplit", "Prevent slime splitting when they are from spawner",
|
|
|
|
|
"Protects agains exploiting as new splited slimes is treated as naturally spawned and not from spawner");
|
|
|
|
|
PreventSlimeSplit = c.get("ExploitProtections.Spawner.PreventSlimeSplit", true);
|
|
|
|
|
c.getW().addComment("ExploitProtections.Spawner.PreventMagmaCubeSplit", "Prevent magmacube splitting when they are from spawner");
|
|
|
|
|
c.addComment("ExploitProtections.Spawner.PreventMagmaCubeSplit", "Prevent magmacube splitting when they are from spawner");
|
|
|
|
|
PreventMagmaCubeSplit = c.get("ExploitProtections.Spawner.PreventMagmaCubeSplit", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ExploitProtections.Smelt.PreventHopperFillUps", "Prevent payments when hoppers moving items into furnace", "Player will not get paid, but items will be smelted");
|
|
|
|
|
c.addComment("ExploitProtections.Smelt.PreventHopperFillUps", "Prevent payments when hoppers moving items into furnace", "Player will not get paid, but items will be smelted");
|
|
|
|
|
PreventHopperFillUps = c.get("ExploitProtections.Smelt.PreventHopperFillUps", true);
|
|
|
|
|
c.getW().addComment("ExploitProtections.Smelt.PreventMagmaCubeSplit", "Prevent payments when hoppers moving items into brewing stands",
|
|
|
|
|
c.addComment("ExploitProtections.Smelt.PreventMagmaCubeSplit", "Prevent payments when hoppers moving items into brewing stands",
|
|
|
|
|
"Player will not get paid, but items will be brewd as they supose too");
|
|
|
|
|
PreventBrewingStandFillUps = c.get("ExploitProtections.Brew.PreventBrewingStandFillUps", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("use-breeder-finder", "Breeder finder.",
|
|
|
|
|
c.addComment("use-breeder-finder", "Breeder finder.",
|
|
|
|
|
"If you are not using breeding payment, you can disable this to save little resources. Really little.");
|
|
|
|
|
useBreederFinder = c.get("use-breeder-finder", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("old-job",
|
|
|
|
|
c.addComment("old-job",
|
|
|
|
|
"Old job save", "Players can leave job and return later with some level loss during that",
|
|
|
|
|
"You can fix players level if his job level is at max level");
|
|
|
|
|
levelLossPercentage = c.get("old-job.level-loss-percentage", 30);
|
|
|
|
|
fixAtMaxLevel = c.get("old-job.fix-at-max-level", true);
|
|
|
|
|
c.getW().addComment("old-job.level-loss-from-max-level",
|
|
|
|
|
c.addComment("old-job.level-loss-from-max-level",
|
|
|
|
|
"Percentage to loose when leaving job at max level",
|
|
|
|
|
"Only works when fix-at-max-level is set to false");
|
|
|
|
|
levelLossPercentageFromMax = c.get("old-job.level-loss-from-max-level", levelLossPercentage);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ActionBars.Messages.EnabledByDefault", "When this set to true player will see action bar messages by default");
|
|
|
|
|
c.addComment("ActionBars.Messages.EnabledByDefault", "When this set to true player will see action bar messages by default");
|
|
|
|
|
ActionBarsMessageByDefault = c.get("ActionBars.Messages.EnabledByDefault", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("BossBar.Enabled", "Enables BossBar feature", "Works only from 1.9 mc version");
|
|
|
|
|
c.addComment("BossBar.Enabled", "Enables BossBar feature", "Works only from 1.9 mc version");
|
|
|
|
|
BossBarEnabled = c.get("BossBar.Enabled", true);
|
|
|
|
|
|
|
|
|
|
if (BossBarEnabled == true) {
|
|
|
|
|
if (Jobs.getVersionCheckManager().getVersion().isLower(Version.v1_9_R1)) {
|
|
|
|
|
Jobs.consoleMsg("&c[Jobs] Your server version don't support BossBar. This feature will be disabled.");
|
|
|
|
|
c.getW().set("BossBar.Enabled", false);
|
|
|
|
|
c.set("BossBar.Enabled", false);
|
|
|
|
|
BossBarEnabled = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("BossBar.Messages.EnabledByDefault", "When this set to true player will see Bossbar messages by default");
|
|
|
|
|
c.addComment("BossBar.Messages.EnabledByDefault", "When this set to true player will see Bossbar messages by default");
|
|
|
|
|
BossBarsMessageByDefault = c.get("BossBar.Messages.EnabledByDefault", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("BossBar.ShowOnEachAction", "If enabled boss bar will update after each action",
|
|
|
|
|
c.addComment("BossBar.ShowOnEachAction", "If enabled boss bar will update after each action",
|
|
|
|
|
"If disabled, BossBar will update only on each payment. This can save some server resources");
|
|
|
|
|
BossBarShowOnEachAction = c.get("BossBar.ShowOnEachAction", false);
|
|
|
|
|
c.getW().addComment("BossBar.Timer", "How long in sec to show BossBar for player",
|
|
|
|
|
c.addComment("BossBar.Timer", "How long in sec to show BossBar for player",
|
|
|
|
|
"If you have disabled ShowOnEachAction, then keep this number higher than payment interval for better experience");
|
|
|
|
|
BossBarTimer = c.get("BossBar.Timer", economyBatchDelay + 1);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ShowActionBars", "You can enable/disable message shown for players in action bar");
|
|
|
|
|
c.addComment("ShowActionBars", "You can enable/disable message shown for players in action bar");
|
|
|
|
|
TitleChangeActionBar = c.get("ShowActionBars.OnTitleChange", true);
|
|
|
|
|
LevelChangeActionBar = c.get("ShowActionBars.OnLevelChange", true);
|
|
|
|
|
EmptyServerAccountActionBar = c.get("ShowActionBars.OnEmptyServerAccount", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("ShowChatMessage", "Chat messages", "You can enable/disable message shown for players in chat");
|
|
|
|
|
c.addComment("ShowChatMessage", "Chat messages", "You can enable/disable message shown for players in chat");
|
|
|
|
|
TitleChangeChat = c.get("ShowChatMessage.OnTitleChange", true);
|
|
|
|
|
LevelChangeChat = c.get("ShowChatMessage.OnLevelChange", true);
|
|
|
|
|
EmptyServerAccountChat = c.get("ShowChatMessage.OnEmptyServerAccount", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Sounds", "Sounds", "Extra sounds on some events",
|
|
|
|
|
c.addComment("Sounds", "Sounds", "Extra sounds on some events",
|
|
|
|
|
"All sounds can be found in https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html");
|
|
|
|
|
SoundLevelupUse = c.get("Sounds.LevelUp.use", true);
|
|
|
|
|
SoundLevelupSound = c.get("Sounds.LevelUp.sound", "ENTITY_PLAYER_LEVELUP");
|
|
|
|
@ -887,50 +878,50 @@ public class GeneralConfigManager {
|
|
|
|
|
SoundTitleChangeVolume = c.get("Sounds.TitleChange.volume", 1);
|
|
|
|
|
SoundTitleChangePitch = c.get("Sounds.TitleChange.pitch", 3);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Signs", "You can disable this to save SMALL amount of server resources");
|
|
|
|
|
c.addComment("Signs", "You can disable this to save SMALL amount of server resources");
|
|
|
|
|
SignsEnabled = c.get("Signs.Enable", true);
|
|
|
|
|
SignsColorizeJobName = c.get("Signs.Colors.ColorizeJobName", true);
|
|
|
|
|
c.getW().addComment("Signs.InfoUpdateInterval",
|
|
|
|
|
c.addComment("Signs.InfoUpdateInterval",
|
|
|
|
|
"This is interval in sec in which signs will be updated. This is not continues update, signs are updated only on levelup, job leave, job join or similar action.");
|
|
|
|
|
c.getW().addComment("Signs.InfoUpdateInterval",
|
|
|
|
|
c.addComment("Signs.InfoUpdateInterval",
|
|
|
|
|
"This is update for same job signs, to avoid huge lag if you have bunch of same type signs. Keep it from 1 to as many sec you want");
|
|
|
|
|
InfoUpdateInterval = c.get("Signs.InfoUpdateInterval", 5);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Scoreboard.ShowToplist", "This will enable to show top list in scoreboard instead of chat");
|
|
|
|
|
c.addComment("Scoreboard.ShowToplist", "This will enable to show top list in scoreboard instead of chat");
|
|
|
|
|
ShowToplistInScoreboard = c.get("Scoreboard.ShowToplist", true);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("Scoreboard.interval", "For how long to show scoreboard");
|
|
|
|
|
c.addComment("Scoreboard.interval", "For how long to show scoreboard");
|
|
|
|
|
ToplistInScoreboardInterval = c.get("Scoreboard.interval", 10);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("JobsBrowse.ShowTotalWorkers", "Do you want to show total amount of workers for job in jobs browse window?");
|
|
|
|
|
c.addComment("JobsBrowse.ShowTotalWorkers", "Do you want to show total amount of workers for job in jobs browse window?");
|
|
|
|
|
ShowTotalWorkers = c.get("JobsBrowse.ShowTotalWorkers", true);
|
|
|
|
|
c.getW().addComment("JobsBrowse.ShowPenaltyBonus", "Do you want to show penalty and bonus in jobs browse window? Only works if this feature is enabled");
|
|
|
|
|
c.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.UseNewLook", "Defines if you want to use new /jobs browse look or old one");
|
|
|
|
|
c.addComment("JobsBrowse.UseNewLook", "Defines if you want to use new /jobs browse look or old one");
|
|
|
|
|
BrowseUseNewLook = c.get("JobsBrowse.UseNewLook", true);
|
|
|
|
|
c.getW().addComment("JobsBrowse.AmountToShow", "Defines amount of jobs to be shown in one page for /jobs browse");
|
|
|
|
|
c.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?");
|
|
|
|
|
c.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?");
|
|
|
|
|
c.addComment("JobsGUI.ShowChatBrowse", "Do you want to show chat information when performing /jobs browse command?");
|
|
|
|
|
JobsGUIShowChatBrowse = c.get("JobsGUI.ShowChatBrowse", true);
|
|
|
|
|
c.getW().addComment("JobsGUI.SwitcheButtons", "With true left mouse button will join job and right will show more info",
|
|
|
|
|
c.addComment("JobsGUI.SwitcheButtons", "With true left mouse button will join job and right will show more info",
|
|
|
|
|
"With false left mouse button will show more info, right will join job", "Don't forget to adjust locale file");
|
|
|
|
|
JobsGUISwitcheButtons = c.get("JobsGUI.SwitcheButtons", false);
|
|
|
|
|
c.getW().addComment("JobsGUI.Rows", "Defines size in rows of GUI");
|
|
|
|
|
c.addComment("JobsGUI.Rows", "Defines size in rows of GUI");
|
|
|
|
|
JobsGUIRows = c.get("JobsGUI.Rows", 5);
|
|
|
|
|
c.getW().addComment("JobsGUI.BackButtonSlot", "Defines back button slot in GUI");
|
|
|
|
|
c.addComment("JobsGUI.BackButtonSlot", "Defines back button slot in GUI");
|
|
|
|
|
JobsGUIBackButton = c.get("JobsGUI.BackButtonSlot", 37);
|
|
|
|
|
c.getW().addComment("JobsGUI.StartPosition", "Defines start position in gui from which job icons will be shown");
|
|
|
|
|
c.addComment("JobsGUI.StartPosition", "Defines start position in gui from which job icons will be shown");
|
|
|
|
|
JobsGUIStartPosition = c.get("JobsGUI.StartPosition", 11);
|
|
|
|
|
c.getW().addComment("JobsGUI.GroupAmount", "Defines by how many jobs we need to group up");
|
|
|
|
|
c.addComment("JobsGUI.GroupAmount", "Defines by how many jobs we need to group up");
|
|
|
|
|
JobsGUIGroupAmount = c.get("JobsGUI.GroupAmount", 7);
|
|
|
|
|
c.getW().addComment("JobsGUI.SkipAmount", "Defines by how many slots we need to skip after group");
|
|
|
|
|
c.addComment("JobsGUI.SkipAmount", "Defines by how many slots we need to skip after group");
|
|
|
|
|
JobsGUISkipAmount = c.get("JobsGUI.SkipAmount", 2);
|
|
|
|
|
|
|
|
|
|
c.getW().addComment("JobsTop.AmountToShow", "Defines amount of players to be shown in one page for /jobs top & /jobs gtop");
|
|
|
|
|
c.addComment("JobsTop.AmountToShow", "Defines amount of players to be shown in one page for /jobs top & /jobs gtop");
|
|
|
|
|
JobsTopAmount = c.get("JobsTop.AmountToShow", 15);
|
|
|
|
|
|
|
|
|
|
CMIMaterial tmat = null;
|
|
|
|
@ -940,14 +931,10 @@ public class GeneralConfigManager {
|
|
|
|
|
tmat = CMIMaterial.get(c.get("JobsGUI.Filler.Material", "STAINED_GLASS_PANE"));
|
|
|
|
|
guiFiller = tmat == null ? CMIMaterial.GREEN_STAINED_GLASS_PANE.newItemStack() : tmat.newItemStack();
|
|
|
|
|
|
|
|
|
|
// c.getW().addComment("Schedule.Boost.Enable", "Do you want to enable scheduler for global boost?");
|
|
|
|
|
// c.addComment("Schedule.Boost.Enable", "Do you want to enable scheduler for global boost?");
|
|
|
|
|
// useGlobalBoostScheduler = c.get("Schedule.Boost.Enable", false);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
c.getW().save(f);
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
c.save();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int getSelectionTooldID() {
|
|
|
|
@ -1038,4 +1025,8 @@ public class GeneralConfigManager {
|
|
|
|
|
return generalMulti.get(type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ConfigReader getConfig() {
|
|
|
|
|
return c;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|