mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-03 06:37:47 +01:00
Error messages are more apparent in the console
This commit is contained in:
parent
7943dcc310
commit
39e23bc729
@ -110,7 +110,7 @@ public class MMOItems extends MMOPlugin {
|
||||
new WorldEditSupport();
|
||||
getLogger().log(Level.INFO, "Hooked onto WorldEdit");
|
||||
} catch (Exception exception) {
|
||||
getLogger().log(Level.WARNING, "Could not initialize support with WorldEdit 7: ", exception);
|
||||
getLogger().log(Level.SEVERE, "Could not initialize support with WorldEdit 7: ", exception);
|
||||
}
|
||||
});
|
||||
|
||||
@ -232,7 +232,7 @@ public class MMOItems extends MMOPlugin {
|
||||
try {
|
||||
new MMOItemsRewardTypes().register();
|
||||
} catch (NullPointerException ignored) {
|
||||
getLogger().log(Level.WARNING, "Could not Hook onto BossShopPro");
|
||||
getLogger().log(Level.SEVERE, "Could not Hook onto BossShopPro");
|
||||
}
|
||||
}
|
||||
}).runTaskLater(this, 1L);
|
||||
@ -347,7 +347,7 @@ public class MMOItems extends MMOPlugin {
|
||||
}
|
||||
|
||||
} catch (Exception exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not initialize RPG plugin compatibility with " + enumPlugin.getName() + ":");
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not initialize RPG plugin compatibility with " + enumPlugin.getName() + ":");
|
||||
exception.printStackTrace();
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,6 @@ import io.lumine.mythic.lib.UtilityMethods;
|
||||
import io.lumine.mythic.lib.api.item.NBTItem;
|
||||
import io.lumine.mythic.lib.player.cooldown.CooldownObject;
|
||||
import io.lumine.mythic.lib.player.modifier.ModifierSource;
|
||||
import io.lumine.mythic.lib.script.Script;
|
||||
import io.lumine.mythic.lib.skill.handler.SkillHandler;
|
||||
import io.lumine.mythic.lib.util.PostLoadAction;
|
||||
import io.lumine.mythic.lib.util.PreloadedObject;
|
||||
@ -19,6 +18,7 @@ import net.Indyuce.mmoitems.api.player.PlayerData;
|
||||
import net.Indyuce.mmoitems.manager.TypeManager;
|
||||
import net.Indyuce.mmoitems.stat.type.ItemStat;
|
||||
import net.Indyuce.mmoitems.util.MMOUtils;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -97,19 +97,16 @@ public class Type implements CooldownObject, PreloadedObject {
|
||||
* - types of modifiers an item of this type would give
|
||||
* - the lore format
|
||||
*/
|
||||
private Type parent;
|
||||
private final Type parent;
|
||||
|
||||
private UnidentifiedItem unidentifiedTemplate;
|
||||
|
||||
private SkillHandler<?> onLeftClick, onRightClick, onAttack, onEntityInteract;
|
||||
|
||||
public Script ent;
|
||||
|
||||
private boolean meleeAttacks, hideInGame;
|
||||
|
||||
/**
|
||||
* List of stats which can be applied onto an item which has this type. This
|
||||
* improves performance when generating an item by a significant amount.
|
||||
* Cached list of stats which can be applied onto an item with this type
|
||||
*/
|
||||
private final List<ItemStat> available = new ArrayList<>();
|
||||
|
||||
@ -132,6 +129,7 @@ public class Type implements CooldownObject, PreloadedObject {
|
||||
this.id = UtilityMethods.enumName(id);
|
||||
this.modifierSource = modifierSource;
|
||||
this.interactionProvider = interactionProvider;
|
||||
this.parent = null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -139,7 +137,8 @@ public class Type implements CooldownObject, PreloadedObject {
|
||||
*/
|
||||
public Type(@NotNull TypeManager manager, @NotNull ConfigurationSection config) {
|
||||
id = UtilityMethods.enumName(config.getName());
|
||||
parent = manager.get(config.getString("parent", "").toUpperCase().replace("-", "_").replace(" ", "_"));
|
||||
Validate.isTrue(config.contains("parent"), "Custom types require a parent type");
|
||||
parent = manager.getOrThrow(UtilityMethods.enumName(config.getString("parent")));
|
||||
modifierSource = config.contains("modifier-source") ? ModifierSource.valueOf(UtilityMethods.enumName(config.getString("modifier-source"))) : (parent != null ? parent.modifierSource : ModifierSource.OTHER);
|
||||
interactionProvider = parent.interactionProvider;
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ public class CraftingStation implements PreloadedObject {
|
||||
try {
|
||||
registerRecipe(loadRecipe(config.getConfigurationSection("recipes." + key)));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"An issue occurred registering recipe '" + key + "' from crafting station '" + id + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class CraftingStatus {
|
||||
|
||||
for (String stationId : config.getKeys(false)) {
|
||||
if (!MMOItems.plugin.getCrafting().hasStation(stationId)) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"An error occurred while trying to load crafting station recipe data of '" + name + "': "
|
||||
+ "could not find crafting station with ID '" + stationId
|
||||
+ "', make sure you backup that player data file before the user logs off.");
|
||||
@ -44,7 +44,7 @@ public class CraftingStatus {
|
||||
for (String recipeConfigId : config.getConfigurationSection(stationId).getKeys(false)) {
|
||||
String recipeId = config.getString(stationId + "." + recipeConfigId + ".recipe");
|
||||
if (recipeId == null || !station.hasRecipe(recipeId)) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"An error occurred while trying to load crafting station recipe data of '" + name + "': "
|
||||
+ "could not find recipe with ID '" + recipeId
|
||||
+ "', make sure you backup that player data file before the user logs off.");
|
||||
@ -53,7 +53,7 @@ public class CraftingStatus {
|
||||
|
||||
Recipe recipe = station.getRecipe(recipeId);
|
||||
if (!(recipe instanceof CraftingRecipe)) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "An error occurred while trying to load crafting station recipe data of '"
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "An error occurred while trying to load crafting station recipe data of '"
|
||||
+ name + "': " + "recipe '" + recipe.getId() + "' is not a CRAFTING recipe.");
|
||||
continue;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public class PlaceholderCondition extends GenericCondition {
|
||||
throw new RuntimeException("Comparator not recognized");
|
||||
}
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not evaluate placeholder condition expression: " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not evaluate placeholder condition expression: " + exception.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class DropTable {
|
||||
subtables.put(key, new Subtable(config.getConfigurationSection(key)));
|
||||
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not read subtable '" + key + "' from drop table '" + config.getName() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not read subtable '" + key + "' from drop table '" + config.getName() + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
Validate.notEmpty(subtablesList, "Your droptable must contain at least one subtable");
|
||||
@ -51,7 +51,7 @@ public class DropTable {
|
||||
if (dropItem.rollDrop()) {
|
||||
ItemStack drop = dropItem.getItem(player);
|
||||
if (drop == null)
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Couldn't read the subtable item " + dropItem.getKey());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Couldn't read the subtable item " + dropItem.getKey());
|
||||
else
|
||||
dropped.add(drop);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@ -116,8 +117,9 @@ public class UseItem {
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Nullable
|
||||
public static UseItem getItem(Player player, NBTItem item, String type) {
|
||||
return getItem(player, item, Type.get(type));
|
||||
return Type.get(type).toUseItem(player, item);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
@ -194,7 +194,7 @@ public class ItemStackBuilder {
|
||||
} catch (IllegalArgumentException | NullPointerException exception) {
|
||||
|
||||
// That
|
||||
MMOItems.print(Level.WARNING, "An error occurred while trying to generate item '$f{0}$b' with stat '$f{1}$b': {2}",
|
||||
MMOItems.print(Level.SEVERE, "An error occurred while trying to generate item '$f{0}$b' with stat '$f{1}$b': {2}",
|
||||
"ItemStackBuilder", builtMMOItem.getId(), stat.getId(), exception.getMessage());
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class LiveMMOItem extends ReadMMOItem {
|
||||
|
||||
// Some unknown error happened
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
ChatColor.GRAY + "Could not load stat '"
|
||||
+ ChatColor.GOLD + stat.getId() + ChatColor.GRAY + "'item data from '"
|
||||
+ ChatColor.RED + getId() + ChatColor.GRAY + "': "
|
||||
|
@ -48,7 +48,7 @@ public class VolatileMMOItem extends ReadMMOItem {
|
||||
} catch (RuntimeException exception) {
|
||||
|
||||
// Log a warning
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
ChatColor.GRAY + "Could not load stat '"
|
||||
+ ChatColor.GOLD + stat.getId() + ChatColor.GRAY + "'item data from '"
|
||||
+ ChatColor.RED + getId() + ChatColor.GRAY + "': "
|
||||
|
@ -56,7 +56,7 @@ public class ModifierNode implements PreloadedObject {
|
||||
child.getPostLoadAction().performAction();
|
||||
ModifierNode.this.children.add(child);
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load parent modifier node '" + key + "' of modifier group '" + getId() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load parent modifier node '" + key + "' of modifier group '" + getId() + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
// Post-load stat data
|
||||
@ -69,7 +69,7 @@ public class ModifierNode implements PreloadedObject {
|
||||
Validate.notNull(stat, "Could not find stat with ID '" + statId + "'");
|
||||
ModifierNode.this.data.put(stat, stat.whenInitialized(statSection.get(key)));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "An error occurred while trying to load modifier node " + getId() + ": " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "An error occurred while trying to load modifier node " + getId() + ": " + exception.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -119,7 +119,7 @@ public class NoClipItem implements Listener {
|
||||
final Object oldProfile = MythicLib.plugin.getVersion().getWrapper().getProfile((SkullMeta) oldItem.getItemMeta());
|
||||
MythicLib.plugin.getVersion().getWrapper().setProfile((SkullMeta) newItemMeta, oldProfile);
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not set skull texture on stripItemData method in the NoClipItem class. Please report this issue!");
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not set skull texture on stripItemData method in the NoClipItem class. Please report this issue!");
|
||||
}
|
||||
|
||||
// Copy Leather colors
|
||||
|
@ -118,7 +118,7 @@ public class BlockManager implements Reloadable {
|
||||
eastIds.contains(id), southIds.contains(id), northIds.contains(id));
|
||||
register(new CustomBlock(state, mmoitem));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load custom block '" + id + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load custom block '" + id + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -73,9 +73,9 @@ public class ConfigManager implements Reloadable {
|
||||
}
|
||||
jarFile.close();
|
||||
} catch (IOException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load default crafting stations.");
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load default crafting stations.");
|
||||
}
|
||||
} else MMOItems.plugin.getLogger().log(Level.WARNING, "Could not create directory!");
|
||||
} else MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not create directory!");
|
||||
}
|
||||
|
||||
// Load files with default configuration
|
||||
@ -208,7 +208,7 @@ public class ConfigManager implements Reloadable {
|
||||
defaultItemCapacity = new NumericStatFormula(MMOItems.plugin.getConfig().getConfigurationSection("default-item-capacity"));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
defaultItemCapacity = new NumericStatFormula(5, .05, .1, .3);
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"An error occurred while trying to load default capacity formula for the item generator, using default: "
|
||||
+ exception.getMessage());
|
||||
}
|
||||
@ -296,7 +296,7 @@ public class ConfigManager implements Reloadable {
|
||||
File folder = new File(MMOItems.plugin.getDataFolder() + "/" + path);
|
||||
if (!folder.exists())
|
||||
if (!folder.mkdir())
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not create directory!");
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not create directory!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -104,14 +104,14 @@ public class CraftingManager implements Reloadable {
|
||||
CraftingStation station = new CraftingStation(file.getName().substring(0, file.getName().length() - 4), YamlConfiguration.loadConfiguration(file));
|
||||
stations.put(station.getId(), station);
|
||||
} catch (IllegalArgumentException|NullPointerException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load station '" + file.getName() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load station '" + file.getName() + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
for (CraftingStation station : stations.values())
|
||||
try {
|
||||
station.getPostLoadAction().performAction();
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Could not post-load station '" + station.getId() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class DropTableManager implements Listener, Reloadable {
|
||||
EntityType type = EntityType.valueOf(key.toUpperCase().replace("-", "_").replace(" ", "_"));
|
||||
monsters.put(type, new DropTable(config.getConfigurationSection("monsters." + key)));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Could not read drop table with mob type '" + key + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ public class DropTableManager implements Listener, Reloadable {
|
||||
Material material = Material.valueOf(key.toUpperCase().replace("-", "_").replace(" ", "_"));
|
||||
blocks.put(material, new DropTable(config.getConfigurationSection("blocks." + key)));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Could not read drop table with material '" + key + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ public class DropTableManager implements Listener, Reloadable {
|
||||
int id = Integer.parseInt(key);
|
||||
customBlocks.put(id, new DropTable(config.getConfigurationSection("customblocks." + key)));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Could not read drop table with custom block '" + key + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ public class LayoutManager implements Reloadable {
|
||||
Layout layout = new Layout(file.getName().substring(0, file.getName().length() - 4), YamlConfiguration.loadConfiguration(file));
|
||||
layouts.put(layout.getId(), layout);
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load layout '" + file.getName() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load layout '" + file.getName() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class LoreFormatManager implements Reloadable {
|
||||
Validate.isTrue(config.isList("lore-format"), "Invalid lore-format! (" + file.getName() + ")");
|
||||
formats.put(file.getName().substring(0, file.getName().length() - 4), config.getStringList("lore-format"));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load layout '" + file.getName() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load layout '" + file.getName() + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
final ConfigurationSection tooltipsConfig = new ConfigFile("tooltips").getConfig();
|
||||
@ -42,7 +42,7 @@ public class LoreFormatManager implements Reloadable {
|
||||
final TooltipTexture tooltip = new TooltipTexture(tooltipsConfig.getConfigurationSection(key));
|
||||
tooltips.put(tooltip.getId(), tooltip);
|
||||
} catch (Exception exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load tooltip '" + key + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load tooltip '" + key + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class PluginUpdateManager {
|
||||
if (split.length > 4) format += ",display=\"" + split[4].replace("_", " ") + "\"";
|
||||
newest.add(format + "}");
|
||||
} else {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Config Update 3: Could not match ingredient from '" + ingredient + "' from recipe '" + key + "', added it anyway.");
|
||||
newest.add(ingredient);
|
||||
}
|
||||
@ -98,7 +98,7 @@ public class PluginUpdateManager {
|
||||
else if (split[0].equalsIgnoreCase("exp"))
|
||||
newest.add("exp{profession=" + split[1] + ",amount=" + split[2] + "}");
|
||||
else {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Config Update 3: Could not match condition from '" + condition + "' from recipe '" + key + "', added it anyway.");
|
||||
newest.add(condition);
|
||||
}
|
||||
@ -106,14 +106,14 @@ public class PluginUpdateManager {
|
||||
|
||||
config.set("recipes." + key + ".conditions", newest);
|
||||
} catch (Exception exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Config Update 3: Could not convert recipe with key '" + key + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
try {
|
||||
config.save(file);
|
||||
} catch (IOException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"Config Update 3: Could not save config '" + file.getName() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ public class RecipeManager implements Reloadable {
|
||||
blueprint.disable();
|
||||
Bukkit.removeRecipe(blueprint.getNk());
|
||||
} catch (Throwable throwable) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not unregister knowledge book recipe '" + blueprint.getNk() + "': " + throwable.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not unregister knowledge book recipe '" + blueprint.getNk() + "': " + throwable.getMessage());
|
||||
}
|
||||
});
|
||||
customRecipes.clear();
|
||||
|
@ -28,7 +28,7 @@ public class SetManager implements Reloadable {
|
||||
throw new IllegalStateException(String.format("Item set '%s' is not a valid configuration section.", id));
|
||||
itemSets.put(id, new ItemSet(section));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, String.format("Could not load item set '%s': %s", id, exception.getMessage()));
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, String.format("Could not load item set '%s': %s", id, exception.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ public class SkillManager {
|
||||
|
||||
// Should not happen
|
||||
} catch (IOException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not save default ability configs: " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not save default ability configs: " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -120,7 +120,7 @@ public class SkillManager {
|
||||
|
||||
// Fail
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load skill '" + handler.getId() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load skill '" + handler.getId() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class StatManager {
|
||||
if (Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers()) && field.get(null) instanceof ItemStat)
|
||||
register((ItemStat<?, ?>) field.get(null));
|
||||
} catch (IllegalArgumentException | IllegalAccessException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, String.format("Couldn't register stat called '%s'", field.getName()), exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, String.format("Couldn't register stat called '%s'", field.getName()), exception.getMessage());
|
||||
}
|
||||
|
||||
// Custom stats
|
||||
@ -71,13 +71,13 @@ public class StatManager {
|
||||
|
||||
// Load stat translation objects (nothing to do with stats)
|
||||
final ConfigurationSection statOptions = new ConfigFile("/language", "stats").getConfig();
|
||||
for (ItemStat stat : getAll())
|
||||
for (ItemStat<?, ?> stat : getAll())
|
||||
try {
|
||||
@Nullable Object object = statOptions.get(stat.getPath());
|
||||
if (object == null) object = statOptions.get(stat.getLegacyTranslationPath());
|
||||
stat.loadConfiguration(statOptions, object != null ? object : "<TranslationNotFound:" + stat.getPath() + ">");
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not load options for stat '" + stat.getId() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not load translation info for stat '" + stat.getId() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ public class StatManager {
|
||||
|
||||
// Safe check, this can happen with numerous extra RPG plugins
|
||||
if (stats.containsKey(stat.getId())) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not register stat '" + stat.getId() + "' as a stat with the same ID already exists.");
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not register stat '" + stat.getId() + "' as a stat with the same ID already exists.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ public class TemplateManager implements Reloadable {
|
||||
return template;
|
||||
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING,
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE,
|
||||
"An error occurred while trying to reload item gen template '" + id + "': " + exception.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ public class TypeManager {
|
||||
if (Modifier.isStatic(field.getModifiers()) && Modifier.isFinal(field.getModifiers()) && field.get(null) instanceof Type)
|
||||
register((Type) field.get(null));
|
||||
} catch (Exception exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Couldn't register type called '" + field.getName() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Couldn't register type called '" + field.getName() + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
// Load custom types
|
||||
@ -42,7 +42,7 @@ public class TypeManager {
|
||||
try {
|
||||
register(new Type(this, config.getConfigurationSection(id)));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not register type '" + id + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not register type '" + id + "': " + exception.getMessage());
|
||||
}
|
||||
|
||||
for (Iterator<Type> iterator = map.values().iterator(); iterator.hasNext(); ) {
|
||||
@ -54,7 +54,7 @@ public class TypeManager {
|
||||
type.load(section);
|
||||
if (clearBefore) type.getPostLoadAction().performAction();
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not register type '" + type.getId() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not register type '" + type.getId() + "': " + exception.getMessage());
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
@ -74,7 +74,7 @@ public class TypeManager {
|
||||
try {
|
||||
type.getPostLoadAction().performAction();
|
||||
} catch (RuntimeException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "An error occured while post-loading type '" + type.getId() + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "An error occured while post-loading type '" + type.getId() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ public class WorldGenManager implements Reloadable {
|
||||
WorldGenTemplate template = new WorldGenTemplate(config.getConfigurationSection(key));
|
||||
templates.put(template.getId(), template);
|
||||
} catch (IllegalArgumentException exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "An error occurred when loading gen template '" + key + "': " + exception.getMessage());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "An error occurred when loading gen template '" + key + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ public class CanDeskin extends BooleanStat implements ConsumableItemInteraction
|
||||
final MMOItem mmoitem = template.newBuilder(playerData.getRPG()).build();
|
||||
new SmartGive(player).give(mmoitem.newBuilder().build());
|
||||
} catch (Exception exception) {
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not retrieve item skin with ID '" + skinId + "' for player " + playerData.getUniqueId());
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not retrieve item skin with ID '" + skinId + "' for player " + playerData.getUniqueId());
|
||||
// No luck :(
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ public class RandomUnsocket extends DoubleStat implements ConsumableItemInteract
|
||||
Message.RANDOM_UNSOCKET_SUCCESS.format(ChatColor.YELLOW, "#item#", MMOUtils.getDisplayName(event.getCurrentItem()), "#gem#", MMOUtils.getDisplayName(builtGem)).send(player);
|
||||
}
|
||||
|
||||
} catch (Throwable e) { MMOItems.print(Level.WARNING, "Could not unsocket gem from item $u{0}$b: $f{1}", "Stat \u00a7eRandom Unsocket", SilentNumbers.getItemName(event.getCurrentItem()), e.getMessage()); }
|
||||
} catch (Throwable e) { MMOItems.print(Level.SEVERE, "Could not unsocket gem from item $u{0}$b: $f{1}", "Stat \u00a7eRandom Unsocket", SilentNumbers.getItemName(event.getCurrentItem()), e.getMessage()); }
|
||||
}
|
||||
|
||||
// Replace
|
||||
|
@ -26,7 +26,7 @@ public class LanguageFile extends ConfigFile {
|
||||
if (found == null) {
|
||||
change = true;
|
||||
getConfig().set(path, found = defaultTranslation.get());
|
||||
MMOItems.plugin.getLogger().log(Level.WARNING, "Could not find translation for '" + path + "', generating it");
|
||||
MMOItems.plugin.getLogger().log(Level.SEVERE, "Could not find translation for '" + path + "', generating it");
|
||||
}
|
||||
|
||||
return found;
|
||||
|
Loading…
Reference in New Issue
Block a user