From dc2c099231ebbd718b155ea7e063ee88777f1714 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 16 Mar 2021 16:36:16 -0700 Subject: [PATCH 1/9] Add warning about the plugin conflict between mcMMO and ChatControlRed --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/mcMMO.java | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Changelog.txt b/Changelog.txt index d555798e5..1b1eabf16 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,6 +2,7 @@ Version 2.1.182 Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr) Fixed a bug where double smelt never succeeded if the furnace was empty Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute + Added a warning when mcMMO detects ChatControlRed running on the server which has an unresolved severe plugin conflict with mcMMO Version 2.1.181 mcMMO no longer pointlessly tries to check for missing UUIDs for FlatFile database diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 334d26886..a47bc357c 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -266,6 +266,13 @@ public class mcMMO extends JavaPlugin { else metrics.addCustomChart(new SimplePie("leveling_system", () -> "Standard")); } + + //TODO: Remove this when ChatControlRed fixes itself + if(pluginManager.getPlugin("ChatControlRed") != null) { + getLogger().severe("mcMMO has detected ChatControlRed on your server, users have reported a severe plugin conflict between these two plugins which degrades server performance and wastes many server resources."); + getLogger().severe("It is HIGHLY RECOMMENDED that you do --NOT-- use ChatControlRed until this issue is resolved!"); + } + } catch (Throwable t) { getLogger().severe("There was an error while enabling mcMMO!"); From 312206eda50ec2b13f17f7e65c2136f8ac73dae7 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Tue, 16 Mar 2021 16:43:25 -0700 Subject: [PATCH 2/9] Tweak save debug messages --- src/main/java/com/gmail/nossr50/party/PartyManager.java | 3 ++- src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/party/PartyManager.java b/src/main/java/com/gmail/nossr50/party/PartyManager.java index 1aae85dc0..52d3836a5 100644 --- a/src/main/java/com/gmail/nossr50/party/PartyManager.java +++ b/src/main/java/com/gmail/nossr50/party/PartyManager.java @@ -642,6 +642,8 @@ public final class PartyManager { * Save party file. */ public static void saveParties() { + mcMMO.p.debug("[Party Data] Saving..."); + if (partyFile.exists()) { if (!partyFile.delete()) { mcMMO.p.getLogger().warning("Could not delete party file. Party saving failed!"); @@ -651,7 +653,6 @@ public final class PartyManager { YamlConfiguration partiesFile = new YamlConfiguration(); - mcMMO.p.debug("Saving Parties... (" + parties.size() + ")"); for (Party party : parties) { String partyName = party.getName(); PartyLeader leader = party.getLeader(); diff --git a/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java b/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java index 2e679b824..2eba9ec1f 100644 --- a/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java +++ b/src/main/java/com/gmail/nossr50/runnables/SaveTimerTask.java @@ -10,6 +10,7 @@ import org.bukkit.scheduler.BukkitRunnable; public class SaveTimerTask extends BukkitRunnable { @Override public void run() { + mcMMO.p.debug("[User Data] Saving..."); // All player data will be saved periodically through this int count = 1; @@ -18,6 +19,7 @@ public class SaveTimerTask extends BukkitRunnable { count++; } + PartyManager.saveParties(); } } From 667b9a22264a88774f6c0057a7a22a019bffa1d2 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 17 Mar 2021 09:59:18 -0700 Subject: [PATCH 3/9] Remove ChatControlRed warning pending further proof of bug --- Changelog.txt | 1 - src/main/java/com/gmail/nossr50/mcMMO.java | 11 ++++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 1b1eabf16..d555798e5 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,7 +2,6 @@ Version 2.1.182 Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr) Fixed a bug where double smelt never succeeded if the furnace was empty Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute - Added a warning when mcMMO detects ChatControlRed running on the server which has an unresolved severe plugin conflict with mcMMO Version 2.1.181 mcMMO no longer pointlessly tries to check for missing UUIDs for FlatFile database diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index a47bc357c..93e24696f 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -267,11 +267,12 @@ public class mcMMO extends JavaPlugin { metrics.addCustomChart(new SimplePie("leveling_system", () -> "Standard")); } - //TODO: Remove this when ChatControlRed fixes itself - if(pluginManager.getPlugin("ChatControlRed") != null) { - getLogger().severe("mcMMO has detected ChatControlRed on your server, users have reported a severe plugin conflict between these two plugins which degrades server performance and wastes many server resources."); - getLogger().severe("It is HIGHLY RECOMMENDED that you do --NOT-- use ChatControlRed until this issue is resolved!"); - } + //Can't confirm this bug myself as the plugin is premium +// //TODO: Remove this when ChatControlRed fixes itself +// if(pluginManager.getPlugin("ChatControlRed") != null) { +// getLogger().severe("mcMMO has detected ChatControlRed on your server, users have reported a severe plugin conflict between these two plugins which degrades server performance and wastes many server resources."); +// getLogger().severe("It is HIGHLY RECOMMENDED that you do --NOT-- use ChatControlRed until this issue is resolved!"); +// } } catch (Throwable t) { From 076d7a7f87b64719cff6a5779dfa840d9fd92542 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 17 Mar 2021 10:03:54 -0700 Subject: [PATCH 4/9] Remove hardcore and vampirism commands --- Changelog.txt | 1 + .../commands/hardcore/HardcoreCommand.java | 128 +++++++++--------- .../commands/hardcore/VampirismCommand.java | 128 +++++++++--------- .../commands/CommandRegistrationManager.java | 44 +++--- src/main/resources/plugin.yml | 88 ++++++------ 5 files changed, 194 insertions(+), 195 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index d555798e5..2d248159f 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,5 @@ Version 2.1.182 + Removed hardcore and vampirism commands, these commands are dangerous, just modify the config file if you want to use hardcore / vampirism Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr) Fixed a bug where double smelt never succeeded if the furnace was empty Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute diff --git a/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java b/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java index 6375265b2..e3697be36 100644 --- a/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/hardcore/HardcoreCommand.java @@ -1,64 +1,64 @@ -package com.gmail.nossr50.commands.hardcore; - -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; -import org.bukkit.command.CommandSender; - -public class HardcoreCommand extends HardcoreModeCommand { - @Override - protected boolean checkTogglePermissions(CommandSender sender) { - return Permissions.hardcoreToggle(sender); - } - - @Override - protected boolean checkModifyPermissions(CommandSender sender) { - return Permissions.hardcoreModify(sender); - } - - @Override - protected boolean checkEnabled(PrimarySkillType skill) { - if (skill == null) { - for (PrimarySkillType primarySkillType : PrimarySkillType.values()) { - if (!primarySkillType.getHardcoreStatLossEnabled()) { - return false; - } - } - - return true; - } - - return skill.getHardcoreStatLossEnabled(); - } - - @Override - protected void enable(PrimarySkillType skill) { - toggle(true, skill); - } - - @Override - protected void disable(PrimarySkillType skill) { - toggle(false, skill); - } - - @Override - protected void modify(CommandSender sender, double newPercentage) { - Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage); - sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D))); - } - - private void toggle(boolean enable, PrimarySkillType skill) { - if (skill == null) { - for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { - primarySkillType.setHardcoreStatLossEnabled(enable); - } - } - else { - skill.setHardcoreStatLossEnabled(enable); - } - - mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getName()))); - } -} \ No newline at end of file +//package com.gmail.nossr50.commands.hardcore; +// +//import com.gmail.nossr50.config.Config; +//import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +//import com.gmail.nossr50.locale.LocaleLoader; +//import com.gmail.nossr50.mcMMO; +//import com.gmail.nossr50.util.Permissions; +//import org.bukkit.command.CommandSender; +// +//public class HardcoreCommand extends HardcoreModeCommand { +// @Override +// protected boolean checkTogglePermissions(CommandSender sender) { +// return Permissions.hardcoreToggle(sender); +// } +// +// @Override +// protected boolean checkModifyPermissions(CommandSender sender) { +// return Permissions.hardcoreModify(sender); +// } +// +// @Override +// protected boolean checkEnabled(PrimarySkillType skill) { +// if (skill == null) { +// for (PrimarySkillType primarySkillType : PrimarySkillType.values()) { +// if (!primarySkillType.getHardcoreStatLossEnabled()) { +// return false; +// } +// } +// +// return true; +// } +// +// return skill.getHardcoreStatLossEnabled(); +// } +// +// @Override +// protected void enable(PrimarySkillType skill) { +// toggle(true, skill); +// } +// +// @Override +// protected void disable(PrimarySkillType skill) { +// toggle(false, skill); +// } +// +// @Override +// protected void modify(CommandSender sender, double newPercentage) { +// Config.getInstance().setHardcoreDeathStatPenaltyPercentage(newPercentage); +// sender.sendMessage(LocaleLoader.getString("Hardcore.DeathStatLoss.PercentageChanged", percent.format(newPercentage / 100.0D))); +// } +// +// private void toggle(boolean enable, PrimarySkillType skill) { +// if (skill == null) { +// for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { +// primarySkillType.setHardcoreStatLossEnabled(enable); +// } +// } +// else { +// skill.setHardcoreStatLossEnabled(enable); +// } +// +// mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.DeathStatLoss.Name"), (skill == null ? "all skills" : skill.getName()))); +// } +//} \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java b/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java index 854871e05..8bdfa83f9 100644 --- a/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/hardcore/VampirismCommand.java @@ -1,64 +1,64 @@ -package com.gmail.nossr50.commands.hardcore; - -import com.gmail.nossr50.config.Config; -import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.Permissions; -import org.bukkit.command.CommandSender; - -public class VampirismCommand extends HardcoreModeCommand { - @Override - protected boolean checkTogglePermissions(CommandSender sender) { - return Permissions.vampirismToggle(sender); - } - - @Override - protected boolean checkModifyPermissions(CommandSender sender) { - return Permissions.vampirismModify(sender); - } - - @Override - protected boolean checkEnabled(PrimarySkillType skill) { - if (skill == null) { - for (PrimarySkillType primarySkillType : PrimarySkillType.values()) { - if (!primarySkillType.getHardcoreVampirismEnabled()) { - return false; - } - } - - return true; - } - - return skill.getHardcoreVampirismEnabled(); - } - - @Override - protected void enable(PrimarySkillType skill) { - toggle(true, skill); - } - - @Override - protected void disable(PrimarySkillType skill) { - toggle(false, skill); - } - - @Override - protected void modify(CommandSender sender, double newPercentage) { - Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage); - sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D))); - } - - private void toggle(boolean enable, PrimarySkillType skill) { - if (skill == null) { - for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { - primarySkillType.setHardcoreVampirismEnabled(enable); - } - } - else { - skill.setHardcoreVampirismEnabled(enable); - } - - mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill))); - } -} \ No newline at end of file +//package com.gmail.nossr50.commands.hardcore; +// +//import com.gmail.nossr50.config.Config; +//import com.gmail.nossr50.datatypes.skills.PrimarySkillType; +//import com.gmail.nossr50.locale.LocaleLoader; +//import com.gmail.nossr50.mcMMO; +//import com.gmail.nossr50.util.Permissions; +//import org.bukkit.command.CommandSender; +// +//public class VampirismCommand extends HardcoreModeCommand { +// @Override +// protected boolean checkTogglePermissions(CommandSender sender) { +// return Permissions.vampirismToggle(sender); +// } +// +// @Override +// protected boolean checkModifyPermissions(CommandSender sender) { +// return Permissions.vampirismModify(sender); +// } +// +// @Override +// protected boolean checkEnabled(PrimarySkillType skill) { +// if (skill == null) { +// for (PrimarySkillType primarySkillType : PrimarySkillType.values()) { +// if (!primarySkillType.getHardcoreVampirismEnabled()) { +// return false; +// } +// } +// +// return true; +// } +// +// return skill.getHardcoreVampirismEnabled(); +// } +// +// @Override +// protected void enable(PrimarySkillType skill) { +// toggle(true, skill); +// } +// +// @Override +// protected void disable(PrimarySkillType skill) { +// toggle(false, skill); +// } +// +// @Override +// protected void modify(CommandSender sender, double newPercentage) { +// Config.getInstance().setHardcoreVampirismStatLeechPercentage(newPercentage); +// sender.sendMessage(LocaleLoader.getString("Hardcore.Vampirism.PercentageChanged", percent.format(newPercentage / 100.0D))); +// } +// +// private void toggle(boolean enable, PrimarySkillType skill) { +// if (skill == null) { +// for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) { +// primarySkillType.setHardcoreVampirismEnabled(enable); +// } +// } +// else { +// skill.setHardcoreVampirismEnabled(enable); +// } +// +// mcMMO.p.getServer().broadcastMessage(LocaleLoader.getString("Hardcore.Mode." + (enable ? "Enabled" : "Disabled"), LocaleLoader.getString("Hardcore.Vampirism.Name"), (skill == null ? "all skills" : skill))); +// } +//} \ No newline at end of file diff --git a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java index 215c160d8..3f93437a7 100644 --- a/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java +++ b/src/main/java/com/gmail/nossr50/util/commands/CommandRegistrationManager.java @@ -12,8 +12,6 @@ import com.gmail.nossr50.commands.experience.AddlevelsCommand; import com.gmail.nossr50.commands.experience.AddxpCommand; import com.gmail.nossr50.commands.experience.MmoeditCommand; import com.gmail.nossr50.commands.experience.SkillresetCommand; -import com.gmail.nossr50.commands.hardcore.HardcoreCommand; -import com.gmail.nossr50.commands.hardcore.VampirismCommand; import com.gmail.nossr50.commands.party.PartyCommand; import com.gmail.nossr50.commands.party.teleport.PtpCommand; import com.gmail.nossr50.commands.player.*; @@ -363,25 +361,25 @@ public final class CommandRegistrationManager { command.setExecutor(new PtpCommand()); } - private static void registerHardcoreCommand() { - PluginCommand command = mcMMO.p.getCommand("hardcore"); - command.setDescription(LocaleLoader.getString("Commands.Description.hardcore")); - command.setPermission("mcmmo.commands.hardcore;mcmmo.commands.hardcore.toggle;mcmmo.commands.hardcore.modify"); - command.setPermissionMessage(permissionsMessage); - command.setUsage(LocaleLoader.getString("Commands.Usage.1", "hardcore", "[on|off]")); - command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "hardcore", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">")); - command.setExecutor(new HardcoreCommand()); - } - - private static void registerVampirismCommand() { - PluginCommand command = mcMMO.p.getCommand("vampirism"); - command.setDescription(LocaleLoader.getString("Commands.Description.vampirism")); - command.setPermission("mcmmo.commands.vampirism;mcmmo.commands.vampirism.toggle;mcmmo.commands.vampirism.modify"); - command.setPermissionMessage(permissionsMessage); - command.setUsage(LocaleLoader.getString("Commands.Usage.1", "vampirism", "[on|off]")); - command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "vampirism", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">")); - command.setExecutor(new VampirismCommand()); - } +// private static void registerHardcoreCommand() { +// PluginCommand command = mcMMO.p.getCommand("hardcore"); +// command.setDescription(LocaleLoader.getString("Commands.Description.hardcore")); +// command.setPermission("mcmmo.commands.hardcore;mcmmo.commands.hardcore.toggle;mcmmo.commands.hardcore.modify"); +// command.setPermissionMessage(permissionsMessage); +// command.setUsage(LocaleLoader.getString("Commands.Usage.1", "hardcore", "[on|off]")); +// command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "hardcore", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">")); +// command.setExecutor(new HardcoreCommand()); +// } +// +// private static void registerVampirismCommand() { +// PluginCommand command = mcMMO.p.getCommand("vampirism"); +// command.setDescription(LocaleLoader.getString("Commands.Description.vampirism")); +// command.setPermission("mcmmo.commands.vampirism;mcmmo.commands.vampirism.toggle;mcmmo.commands.vampirism.modify"); +// command.setPermissionMessage(permissionsMessage); +// command.setUsage(LocaleLoader.getString("Commands.Usage.1", "vampirism", "[on|off]")); +// command.setUsage(command.getUsage() + "\n" + LocaleLoader.getString("Commands.Usage.1", "vampirism", "<" + LocaleLoader.getString("Commands.Usage.Rate") + ">")); +// command.setExecutor(new VampirismCommand()); +// } private static void registerMcnotifyCommand() { PluginCommand command = mcMMO.p.getCommand("mcnotify"); @@ -473,8 +471,8 @@ public final class CommandRegistrationManager { registerSkillresetCommand(); // Hardcore Commands - registerHardcoreCommand(); - registerVampirismCommand(); +// registerHardcoreCommand(); +// registerVampirismCommand(); // Party Commands registerPartyCommand(); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 70499738e..508e96ee8 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -156,14 +156,14 @@ commands: mcpurge: description: Purge users with 0 powerlevel and/or who haven't connected in several months from the server DB. permission: mcmmo.commands.mcpurge - hardcore: - aliases: [mchardcore] - description: Modify the mcMMO hardcore percentage or toggle hardcore mode on/off - permission: mcmmo.commands.hardcore - vampirism: - aliases: [mcvampirism] - description: Modify the mcMMO vampirism percentage or toggle vampirism mode on/off - permission: mcmmo.commands.vampirism +# hardcore: +# aliases: [mchardcore] +# description: Modify the mcMMO hardcore percentage or toggle hardcore mode on/off +# permission: mcmmo.commands.hardcore +# vampirism: +# aliases: [mcvampirism] +# description: Modify the mcMMO vampirism percentage or toggle vampirism mode on/off +# permission: mcmmo.commands.vampirism mcnotify: aliases: [notify] description: Toggle mcMMO abilities chat display notifications on/off @@ -833,7 +833,7 @@ permissions: mcmmo.commands.addxp: true mcmmo.commands.addxp.others: true mcmmo.commands.defaults: true - mcmmo.commands.hardcore.all: true +# mcmmo.commands.hardcore.all: true mcmmo.commands.inspect.far: true mcmmo.commands.inspect.hidden: true mcmmo.commands.mcability.others: true @@ -854,7 +854,7 @@ permissions: mcmmo.commands.ptp.world.all: true mcmmo.commands.reloadlocale: true mcmmo.commands.skillreset.all: true - mcmmo.commands.vampirism.all: true +# mcmmo.commands.vampirism.all: true mcmmo.commands.xprate.all: true mcmmo.commands.acrobatics: description: Allows access to the acrobatics command @@ -876,23 +876,23 @@ permissions: description: Allows access to the excavation command mcmmo.commands.fishing: description: Allows access to the fishing command - mcmmo.commands.hardcore.*: - default: false - description: Implies access to all mcmmo.commands.hardcore permissions - children: - mcmmo.commands.hardcore.all: true - mcmmo.commands.hardcore.all: - description: Implies access to all mcmmo.commands.hardcore permissions - children: - mcmmo.commands.hardcore: true - mcmmo.commands.hardcore.modify: true - mcmmo.commands.hardcore.toggle: true - mcmmo.commands.hardcore: - description: Allows access to the hardcore command - mcmmo.commands.hardcore.modify: - description: Allows access to the hardcore command to modify the hardcore rate - mcmmo.commands.hardcore.toggle: - description: Allows access to the hardcore command to toggle hardcore on/off +# mcmmo.commands.hardcore.*: +# default: false +# description: Implies access to all mcmmo.commands.hardcore permissions +# children: +# mcmmo.commands.hardcore.all: true +# mcmmo.commands.hardcore.all: +# description: Implies access to all mcmmo.commands.hardcore permissions +# children: +# mcmmo.commands.hardcore: true +# mcmmo.commands.hardcore.modify: true +# mcmmo.commands.hardcore.toggle: true +# mcmmo.commands.hardcore: +# description: Allows access to the hardcore command +# mcmmo.commands.hardcore.modify: +# description: Allows access to the hardcore command to modify the hardcore rate +# mcmmo.commands.hardcore.toggle: +# description: Allows access to the hardcore command to toggle hardcore on/off mcmmo.commands.herbalism: description: Allows access to the herbalism command mcmmo.commands.inspect.*: @@ -1283,23 +1283,23 @@ permissions: description: Allows access to the taming command mcmmo.commands.unarmed: description: Allows access to the unarmed command - mcmmo.commands.vampirism.*: - default: false - description: Implies access to all mcmmo.commands.vampirism permissions - children: - mcmmo.commands.vampirism.all: true - mcmmo.commands.vampirism.all: - description: Implies access to all mcmmo.commands.vampirism permissions - children: - mcmmo.commands.vampirism: true - mcmmo.commands.vampirism.modify: true - mcmmo.commands.vampirism.toggle: true - mcmmo.commands.vampirism: - description: Allows access to the vampirism command - mcmmo.commands.vampirism.modify: - description: Allows access to the vampirism command to modify the vampirism rate - mcmmo.commands.vampirism.toggle: - description: Allows access to the vampirism command to toggle vampirism on/off +# mcmmo.commands.vampirism.*: +# default: false +# description: Implies access to all mcmmo.commands.vampirism permissions +# children: +# mcmmo.commands.vampirism.all: true +# mcmmo.commands.vampirism.all: +# description: Implies access to all mcmmo.commands.vampirism permissions +# children: +# mcmmo.commands.vampirism: true +# mcmmo.commands.vampirism.modify: true +# mcmmo.commands.vampirism.toggle: true +# mcmmo.commands.vampirism: +# description: Allows access to the vampirism command +# mcmmo.commands.vampirism.modify: +# description: Allows access to the vampirism command to modify the vampirism rate +# mcmmo.commands.vampirism.toggle: +# description: Allows access to the vampirism command to toggle vampirism on/off mcmmo.commands.woodcutting: description: Allows access to the woodcutting command mcmmo.commands.xprate.*: From c7a8d74963e5e5ee3823408a50194201795ac42e Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 17 Mar 2021 10:39:05 -0700 Subject: [PATCH 5/9] Add customboost 'mcmmo.perks.xp.customboost.all' perk permission node --- Changelog.txt | 1 + src/main/java/com/gmail/nossr50/util/Permissions.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 2d248159f..ddd170a27 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,4 +1,5 @@ Version 2.1.182 + You can now use '.all' (for example: mcmmo.perks.xp.customboost.all) to give an XP perk to all skills Removed hardcore and vampirism commands, these commands are dangerous, just modify the config file if you want to use hardcore / vampirism Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr) Fixed a bug where double smelt never succeeded if the furnace was empty diff --git a/src/main/java/com/gmail/nossr50/util/Permissions.java b/src/main/java/com/gmail/nossr50/util/Permissions.java index c72b048b9..21df34696 100644 --- a/src/main/java/com/gmail/nossr50/util/Permissions.java +++ b/src/main/java/com/gmail/nossr50/util/Permissions.java @@ -124,7 +124,12 @@ public final class Permissions { public static boolean doubleXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.double." + skill.toString().toLowerCase(Locale.ENGLISH)); } public static boolean oneAndOneHalfXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.50percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); } public static boolean oneAndOneTenthXp(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.10percentboost." + skill.toString().toLowerCase(Locale.ENGLISH)); } - public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { return permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase(Locale.ENGLISH)); } + + public static boolean customXpBoost(Permissible permissible, PrimarySkillType skill) { + return permissible.hasPermission("mcmmo.perks.xp.customboost.all") + ||permissible.hasPermission("mcmmo.perks.xp.customboost." + skill.toString().toLowerCase(Locale.ENGLISH)); + } + /* ACTIVATION PERKS */ public static boolean twelveSecondActivationBoost(Permissible permissible) { return permissible.hasPermission("mcmmo.perks.activationtime.twelveseconds"); } From 13a2d0344407279e9e993f064be88e4af1fb0ff2 Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 18 Mar 2021 13:11:03 -0700 Subject: [PATCH 6/9] Remove silent exceptions --- Changelog.txt | 1 + .../gmail/nossr50/util/scoreboards/ScoreboardWrapper.java | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index ddd170a27..5491f971c 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4,6 +4,7 @@ Version 2.1.182 Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr) Fixed a bug where double smelt never succeeded if the furnace was empty Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute + Removed a few "silent" exceptions for scoreboards & mcMMO Version 2.1.181 mcMMO no longer pointlessly tries to check for missing UUIDs for FlatFile database diff --git a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java index ad61aede0..2ba8715f5 100644 --- a/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java +++ b/src/main/java/com/gmail/nossr50/util/scoreboards/ScoreboardWrapper.java @@ -126,7 +126,8 @@ public class ScoreboardWrapper { try { cooldownTask.cancel(); } - catch (Throwable ignored) { + catch (Exception e) { + e.printStackTrace(); } cooldownTask = null; @@ -430,8 +431,9 @@ public class ScoreboardWrapper { try { updateTask.cancel(); } - catch (Throwable ignored) { - } // catch NullPointerException and IllegalStateException and any Error; don't care + catch (Exception e) { + e.printStackTrace(); + } updateTask = null; From 4f08c6955707c2a7766af3aa431eedf77082f2ed Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 18 Mar 2021 13:18:30 -0700 Subject: [PATCH 7/9] Add UltraPermission warning to mcMMO --- Changelog.txt | 3 ++- src/main/java/com/gmail/nossr50/mcMMO.java | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index 5491f971c..9c4980063 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4,7 +4,8 @@ Version 2.1.182 Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr) Fixed a bug where double smelt never succeeded if the furnace was empty Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute - Removed a few "silent" exceptions for scoreboards & mcMMO + Removed a few silent exceptions for scoreboards & mcMMO + Added warning about UltraPermissions to mcMMO Version 2.1.181 mcMMO no longer pointlessly tries to check for missing UUIDs for FlatFile database diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 93e24696f..25dcfea14 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -74,6 +74,10 @@ import java.util.ArrayList; import java.util.List; public class mcMMO extends JavaPlugin { + public static final String ULTRA_PERMISSONS = "UltraPermissons"; + public static final String UP_WARNING_2 = "Stop using " + ULTRA_PERMISSONS + " with mcMMO immediately!"; + public static final String UP_WARNING_1 = "mcMMO has detected " + ULTRA_PERMISSONS + " on your server, users have reported a severe plugin conflict between these two plugins which severely degrades server performance"; + public static final String UP_WARNING_3 = "The author of UltraPermissions has passed away and its unlikely this issue will ever be solved"; /* Managers */ private static PlatformManager platformManager; private static ChunkManager placeStore; @@ -273,7 +277,17 @@ public class mcMMO extends JavaPlugin { // getLogger().severe("mcMMO has detected ChatControlRed on your server, users have reported a severe plugin conflict between these two plugins which degrades server performance and wastes many server resources."); // getLogger().severe("It is HIGHLY RECOMMENDED that you do --NOT-- use ChatControlRed until this issue is resolved!"); // } + if(pluginManager.getPlugin(ULTRA_PERMISSONS) != null) { + Bukkit.getScheduler().runTaskTimer(this, () -> { + getLogger().severe(UP_WARNING_1); + getLogger().severe(UP_WARNING_2); + getLogger().severe(UP_WARNING_3); + Bukkit.broadcastMessage(UP_WARNING_1); + Bukkit.broadcastMessage(UP_WARNING_2); + Bukkit.broadcastMessage(UP_WARNING_3); + }, 0L, 1200L); + } } catch (Throwable t) { getLogger().severe("There was an error while enabling mcMMO!"); From 49f1154e6581960c6d0792827134018f574e3baf Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 18 Mar 2021 15:15:43 -0700 Subject: [PATCH 8/9] NPE fix for McMMOPlayerExperienceEvent --- Changelog.txt | 1 + .../events/experience/McMMOPlayerExperienceEvent.java | 8 +++++++- src/main/java/com/gmail/nossr50/mcMMO.java | 9 +++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 9c4980063..da135f2bc 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -6,6 +6,7 @@ Version 2.1.182 Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute Removed a few silent exceptions for scoreboards & mcMMO Added warning about UltraPermissions to mcMMO + Fixed a potential NPE in McMMOPlayerExperienceEvent Version 2.1.181 mcMMO no longer pointlessly tries to check for missing UUIDs for FlatFile database diff --git a/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java b/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java index 73829b7a0..44ad7d078 100644 --- a/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java +++ b/src/main/java/com/gmail/nossr50/events/experience/McMMOPlayerExperienceEvent.java @@ -29,7 +29,13 @@ public abstract class McMMOPlayerExperienceEvent extends PlayerEvent implements protected McMMOPlayerExperienceEvent(Player player, PrimarySkillType skill, XPGainReason xpGainReason) { super(player); this.skill = skill; - this.skillLevel = UserManager.getPlayer(player).getSkillLevel(skill); + + if(UserManager.getPlayer(player) != null) { + this.skillLevel = UserManager.getPlayer(player).getSkillLevel(skill); + } else { + this.skillLevel = 0; + } + this.xpGainReason = xpGainReason; } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 25dcfea14..335a7afbc 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -74,10 +74,6 @@ import java.util.ArrayList; import java.util.List; public class mcMMO extends JavaPlugin { - public static final String ULTRA_PERMISSONS = "UltraPermissons"; - public static final String UP_WARNING_2 = "Stop using " + ULTRA_PERMISSONS + " with mcMMO immediately!"; - public static final String UP_WARNING_1 = "mcMMO has detected " + ULTRA_PERMISSONS + " on your server, users have reported a severe plugin conflict between these two plugins which severely degrades server performance"; - public static final String UP_WARNING_3 = "The author of UltraPermissions has passed away and its unlikely this issue will ever be solved"; /* Managers */ private static PlatformManager platformManager; private static ChunkManager placeStore; @@ -152,6 +148,11 @@ public class mcMMO extends JavaPlugin { public static FixedMetadataValue metadataValue; + public static final String ULTRA_PERMISSONS = "UltraPermissons"; + public static final String UP_WARNING_2 = "Stop using " + ULTRA_PERMISSONS + " with mcMMO immediately!"; + public static final String UP_WARNING_1 = "mcMMO has detected " + ULTRA_PERMISSONS + " on your server, users have reported a severe plugin conflict between these two plugins which severely degrades server performance"; + public static final String UP_WARNING_3 = "The author of UltraPermissions has passed away and its unlikely this issue will ever be solved"; + public mcMMO() { p = this; } From 71d1f42cf4c9ccb0b615bf9a5baa179d8b68a06f Mon Sep 17 00:00:00 2001 From: nossr50 Date: Thu, 18 Mar 2021 15:28:42 -0700 Subject: [PATCH 9/9] Tweak changelog --- Changelog.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog.txt b/Changelog.txt index da135f2bc..0c6534d55 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -2,12 +2,15 @@ Version 2.1.182 You can now use '.all' (for example: mcmmo.perks.xp.customboost.all) to give an XP perk to all skills Removed hardcore and vampirism commands, these commands are dangerous, just modify the config file if you want to use hardcore / vampirism Fixed several errors in de locale (Thanks TheBusyBiscuit & w1tcherrr) - Fixed a bug where double smelt never succeeded if the furnace was empty + Fixed a bug where double smelt never succeeded if the furnace was empty (but worked normally afterwards) Added some safety so that mcMMO automatic save interval is never more frequent than 1 minute Removed a few silent exceptions for scoreboards & mcMMO Added warning about UltraPermissions to mcMMO Fixed a potential NPE in McMMOPlayerExperienceEvent + NOTES: + mcMMO will do a better job reporting if something went wrong with scoreboards, which may lead to improved plugin compatibility between mcMMO and other plugins touching scoreboards. + Version 2.1.181 mcMMO no longer pointlessly tries to check for missing UUIDs for FlatFile database Removed the "name change detected" message as some plugins (such as Plan) invoke API calls which spams the console with this message