mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Cleaning up more runtime errors during load
This commit is contained in:
parent
154d0a8d50
commit
a58d875d74
@ -17,10 +17,10 @@ public class SkillGuideCommand implements CommandExecutor {
|
|||||||
private final mcMMO pluginRef;
|
private final mcMMO pluginRef;
|
||||||
|
|
||||||
public SkillGuideCommand(PrimarySkillType primarySkillType, mcMMO pluginRef) {
|
public SkillGuideCommand(PrimarySkillType primarySkillType, mcMMO pluginRef) {
|
||||||
|
this.pluginRef = pluginRef;
|
||||||
header = pluginRef.getLocaleManager().getString("Guides.Header", pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType));
|
header = pluginRef.getLocaleManager().getString("Guides.Header", pluginRef.getSkillTools().getLocalizedSkillName(primarySkillType));
|
||||||
guide = getGuide(primarySkillType);
|
guide = getGuide(primarySkillType);
|
||||||
invalidPage = pluginRef.getLocaleManager().getString("Guides.Page.Invalid");
|
invalidPage = pluginRef.getLocaleManager().getString("Guides.Page.Invalid");
|
||||||
this.pluginRef = pluginRef;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -52,6 +52,7 @@ import com.gmail.nossr50.datatypes.party.PartyFeature;
|
|||||||
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
|
||||||
import com.gmail.nossr50.datatypes.skills.properties.DamageProperty;
|
import com.gmail.nossr50.datatypes.skills.properties.DamageProperty;
|
||||||
import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel;
|
import com.gmail.nossr50.datatypes.skills.properties.MaxBonusLevel;
|
||||||
|
import com.gmail.nossr50.datatypes.skills.subskills.taming.CallOfTheWildType;
|
||||||
import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
|
import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||||
@ -251,6 +252,7 @@ public final class ConfigManager {
|
|||||||
customSerializers.registerType(new TypeToken<Material>() {}, new CustomEnumValueSerializer());
|
customSerializers.registerType(new TypeToken<Material>() {}, new CustomEnumValueSerializer());
|
||||||
customSerializers.registerType(new TypeToken<PartyFeature>() {}, new CustomEnumValueSerializer());
|
customSerializers.registerType(new TypeToken<PartyFeature>() {}, new CustomEnumValueSerializer());
|
||||||
customSerializers.registerType(new TypeToken<FormulaType>() {}, new CustomEnumValueSerializer());
|
customSerializers.registerType(new TypeToken<FormulaType>() {}, new CustomEnumValueSerializer());
|
||||||
|
customSerializers.registerType(new TypeToken<CallOfTheWildType>() {}, new CustomEnumValueSerializer());
|
||||||
// customSerializers.registerType(new TypeToken<MMOItem<?>>() {}, new ItemStackSerializer());
|
// customSerializers.registerType(new TypeToken<MMOItem<?>>() {}, new ItemStackSerializer());
|
||||||
customSerializers.registerType(new TypeToken<Set<?>>() {}, new SetSerializer());
|
customSerializers.registerType(new TypeToken<Set<?>>() {}, new SetSerializer());
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ public class ConfigMining {
|
|||||||
@Setting(value = ConfigConstants.SUB_SKILL_NODE)
|
@Setting(value = ConfigConstants.SUB_SKILL_NODE)
|
||||||
private ConfigMiningSubskills miningSubskills = new ConfigMiningSubskills();
|
private ConfigMiningSubskills miningSubskills = new ConfigMiningSubskills();
|
||||||
|
|
||||||
public ConfigMiningSubskills getMiningSubskills() {
|
public ConfigMiningSubskills getMiningSubSkills() {
|
||||||
return miningSubskills;
|
return miningSubskills;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ package com.gmail.nossr50.config.skills.mining;
|
|||||||
|
|
||||||
import ninja.leaping.configurate.objectmapping.Setting;
|
import ninja.leaping.configurate.objectmapping.Setting;
|
||||||
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
import ninja.leaping.configurate.objectmapping.serialize.ConfigSerializable;
|
||||||
import org.bukkit.Material;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -12,18 +11,18 @@ public class ConfigMiningBlastMining {
|
|||||||
|
|
||||||
private static final ArrayList<String> DETONATORS_DEFAULT;
|
private static final ArrayList<String> DETONATORS_DEFAULT;
|
||||||
private static final HashMap<Integer, Double> DAMAGE_DECREASE_RANK_MAP;
|
private static final HashMap<Integer, Double> DAMAGE_DECREASE_RANK_MAP;
|
||||||
private static final HashMap<Integer, Double> OREBONUS_RANK_MAP;
|
private static final HashMap<Integer, Double> ORE_BONUS_RANK_MAP;
|
||||||
private static final HashMap<Integer, Double> DEBRIS_REDUCTION_MAP;
|
private static final HashMap<Integer, Double> DEBRIS_REDUCTION_MAP;
|
||||||
private static final HashMap<Integer, Integer> DROP_MULTIPLIER_MAP;
|
private static final HashMap<Integer, Integer> DROP_MULTIPLIER_MAP;
|
||||||
private static final HashMap<Integer, Double> RADIUS_MAP;
|
private static final HashMap<Integer, Double> RADIUS_MAP;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
DETONATORS_DEFAULT = new ArrayList<>();
|
DETONATORS_DEFAULT = new ArrayList<>();
|
||||||
DETONATORS_DEFAULT.add(Material.FLINT_AND_STEEL.getKey().toString());
|
DETONATORS_DEFAULT.add("flint_and_steel");
|
||||||
DETONATORS_DEFAULT.add(Material.DIAMOND_PICKAXE.getKey().toString());
|
DETONATORS_DEFAULT.add("diamond_pickaxe");
|
||||||
DETONATORS_DEFAULT.add(Material.GOLDEN_PICKAXE.getKey().toString());
|
DETONATORS_DEFAULT.add("golden_pickaxe");
|
||||||
DETONATORS_DEFAULT.add(Material.IRON_PICKAXE.getKey().toString());
|
DETONATORS_DEFAULT.add("iron_pickaxe");
|
||||||
DETONATORS_DEFAULT.add(Material.WOODEN_PICKAXE.getKey().toString());
|
DETONATORS_DEFAULT.add("wooden_pickaxe");
|
||||||
|
|
||||||
DAMAGE_DECREASE_RANK_MAP = new HashMap<>();
|
DAMAGE_DECREASE_RANK_MAP = new HashMap<>();
|
||||||
DAMAGE_DECREASE_RANK_MAP.put(1, 5.0);
|
DAMAGE_DECREASE_RANK_MAP.put(1, 5.0);
|
||||||
@ -35,15 +34,15 @@ public class ConfigMiningBlastMining {
|
|||||||
DAMAGE_DECREASE_RANK_MAP.put(7, 75.0);
|
DAMAGE_DECREASE_RANK_MAP.put(7, 75.0);
|
||||||
DAMAGE_DECREASE_RANK_MAP.put(8, 100.0);
|
DAMAGE_DECREASE_RANK_MAP.put(8, 100.0);
|
||||||
|
|
||||||
OREBONUS_RANK_MAP = new HashMap<>();
|
ORE_BONUS_RANK_MAP = new HashMap<>();
|
||||||
OREBONUS_RANK_MAP.put(1, 35.0);
|
ORE_BONUS_RANK_MAP.put(1, 35.0);
|
||||||
OREBONUS_RANK_MAP.put(2, 40.0);
|
ORE_BONUS_RANK_MAP.put(2, 40.0);
|
||||||
OREBONUS_RANK_MAP.put(3, 45.0);
|
ORE_BONUS_RANK_MAP.put(3, 45.0);
|
||||||
OREBONUS_RANK_MAP.put(4, 50.0);
|
ORE_BONUS_RANK_MAP.put(4, 50.0);
|
||||||
OREBONUS_RANK_MAP.put(5, 55.0);
|
ORE_BONUS_RANK_MAP.put(5, 55.0);
|
||||||
OREBONUS_RANK_MAP.put(6, 60.0);
|
ORE_BONUS_RANK_MAP.put(6, 60.0);
|
||||||
OREBONUS_RANK_MAP.put(7, 65.0);
|
ORE_BONUS_RANK_MAP.put(7, 65.0);
|
||||||
OREBONUS_RANK_MAP.put(8, 70.0);
|
ORE_BONUS_RANK_MAP.put(8, 70.0);
|
||||||
|
|
||||||
DEBRIS_REDUCTION_MAP = new HashMap<>();
|
DEBRIS_REDUCTION_MAP = new HashMap<>();
|
||||||
DEBRIS_REDUCTION_MAP.put(1, 5.0);
|
DEBRIS_REDUCTION_MAP.put(1, 5.0);
|
||||||
@ -83,7 +82,7 @@ public class ConfigMiningBlastMining {
|
|||||||
private HashMap<Integer, Double> damageDecreaseMap = DAMAGE_DECREASE_RANK_MAP;
|
private HashMap<Integer, Double> damageDecreaseMap = DAMAGE_DECREASE_RANK_MAP;
|
||||||
|
|
||||||
@Setting(value = "Ore-Bonus-Per-Rank")
|
@Setting(value = "Ore-Bonus-Per-Rank")
|
||||||
private HashMap<Integer, Double> orebonusMap = OREBONUS_RANK_MAP;
|
private HashMap<Integer, Double> orebonusMap = ORE_BONUS_RANK_MAP;
|
||||||
|
|
||||||
@Setting(value = "Debris-Decrease-Per-Rank")
|
@Setting(value = "Debris-Decrease-Per-Rank")
|
||||||
private HashMap<Integer, Double> debrisReductionMap = DEBRIS_REDUCTION_MAP;
|
private HashMap<Integer, Double> debrisReductionMap = DEBRIS_REDUCTION_MAP;
|
||||||
|
@ -153,6 +153,12 @@ public class mcMMO extends JavaPlugin {
|
|||||||
//Init Skill Tools
|
//Init Skill Tools
|
||||||
skillTools = new SkillTools(this);
|
skillTools = new SkillTools(this);
|
||||||
|
|
||||||
|
//Init Item Tools
|
||||||
|
itemTools = new ItemTools(this);
|
||||||
|
|
||||||
|
//Misc Tools Init
|
||||||
|
miscTools = new MiscTools(this);
|
||||||
|
|
||||||
//Init DST
|
//Init DST
|
||||||
registerDynamicSettings(); //Do this after configs are loaded
|
registerDynamicSettings(); //Do this after configs are loaded
|
||||||
|
|
||||||
@ -280,18 +286,12 @@ public class mcMMO extends JavaPlugin {
|
|||||||
//Init Block Tools
|
//Init Block Tools
|
||||||
blockTools = new BlockTools(this);
|
blockTools = new BlockTools(this);
|
||||||
|
|
||||||
//Init Item Tools
|
|
||||||
itemTools = new ItemTools(this);
|
|
||||||
|
|
||||||
//Init MOTD Utils
|
//Init MOTD Utils
|
||||||
messageOfTheDayUtils = new MessageOfTheDayUtils(this);
|
messageOfTheDayUtils = new MessageOfTheDayUtils(this);
|
||||||
|
|
||||||
//Init Sound Manager
|
//Init Sound Manager
|
||||||
soundManager = new SoundManager(this);
|
soundManager = new SoundManager(this);
|
||||||
|
|
||||||
//Misc Tools Init
|
|
||||||
miscTools = new MiscTools(this);
|
|
||||||
|
|
||||||
//Init HardcoreManager
|
//Init HardcoreManager
|
||||||
hardcoreManager = new HardcoreManager(this);
|
hardcoreManager = new HardcoreManager(this);
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public class MiningManager extends SkillManager {
|
|||||||
|
|
||||||
boolean silkTouch = player.getInventory().getItemInMainHand().containsEnchantment(Enchantment.SILK_TOUCH);
|
boolean silkTouch = player.getInventory().getItemInMainHand().containsEnchantment(Enchantment.SILK_TOUCH);
|
||||||
|
|
||||||
if (silkTouch && !pluginRef.getConfigManager().getConfigMining().getMiningSubskills().getDoubleDrops().isAllowSilkTouchDoubleDrops())
|
if (silkTouch && !pluginRef.getConfigManager().getConfigMining().getMiningSubSkills().getDoubleDrops().isAllowSilkTouchDoubleDrops())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//TODO: Make this readable
|
//TODO: Make this readable
|
||||||
|
Loading…
Reference in New Issue
Block a user