Log missing Vault/economy plugin during parsing of money things.
Changes the "Vault was not found" message in Vault setup to INFO instead of WARNING, because this configuration isn't actually necessarily a warning sign. Parsing a money thing with no economy is, however. MoneyThingParser logs at ERROR level if Vault or an economy plugin isn't found, but a money thing is parsed.
This commit is contained in:
@@ -202,7 +202,7 @@ public class MobArena extends JavaPlugin
|
||||
private void setupVault() {
|
||||
Plugin vaultPlugin = this.getServer().getPluginManager().getPlugin("Vault");
|
||||
if (vaultPlugin == null) {
|
||||
getLogger().warning("Vault was not found. Economy rewards will not work!");
|
||||
getLogger().info("Vault was not found. Economy rewards will not work.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.garbagemule.MobArena.things;
|
||||
|
||||
import com.garbagemule.MobArena.MobArena;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
|
||||
class MoneyThingParser implements ThingParser {
|
||||
private static final String PREFIX_LONG = "money:";
|
||||
@@ -18,7 +19,11 @@ class MoneyThingParser implements ThingParser {
|
||||
if (money == null) {
|
||||
return null;
|
||||
}
|
||||
return new MoneyThing(plugin.getEconomy(), Double.parseDouble(money));
|
||||
Economy economy = plugin.getEconomy();
|
||||
if (economy == null) {
|
||||
plugin.getLogger().severe("Vault or economy plugin missing while parsing: " + s);
|
||||
}
|
||||
return new MoneyThing(economy, Double.parseDouble(money));
|
||||
}
|
||||
|
||||
private String trimPrefix(String s) {
|
||||
|
||||
Reference in New Issue
Block a user