From e7d8e51722f411c68444b38ce0e990e55db44d2c Mon Sep 17 00:00:00 2001 From: nossr50 Date: Mon, 18 Feb 2019 12:16:10 -0800 Subject: [PATCH] mod configs are taking a break --- .../gmail/nossr50/config/ConfigManager.java | 18 +++++++++++ .../com/gmail/nossr50/config/MainConfig.java | 18 +---------- .../config/experience/ExperienceConfig.java | 1 - .../config/mods/ArmorConfigManager.java | 11 ++----- .../config/mods/BlockConfigManager.java | 11 ++----- .../nossr50/config/mods/CustomToolConfig.java | 5 ++-- .../config/mods/EntityConfigManager.java | 11 ++----- .../config/mods/ToolConfigManager.java | 11 ++----- .../config/treasure/TreasureConfig.java | 1 - .../nossr50/datatypes/player/McMMOPlayer.java | 10 ++++--- src/main/java/com/gmail/nossr50/mcMMO.java | 12 ++++---- .../nossr50/skills/child/FamilyTree.java | 4 +-- .../nossr50/skills/excavation/Excavation.java | 6 ++-- .../skills/herbalism/HerbalismManager.java | 24 +++++++-------- .../gmail/nossr50/skills/mining/Mining.java | 13 ++++---- .../nossr50/skills/mining/MiningManager.java | 4 ++- .../repairables/SimpleRepairableManager.java | 2 -- .../nossr50/skills/smelting/Smelting.java | 4 +-- .../skills/woodcutting/Woodcutting.java | 11 +++---- .../woodcutting/WoodcuttingManager.java | 4 +-- .../com/gmail/nossr50/util/BlockUtils.java | 30 ++++++++++++------- .../com/gmail/nossr50/util/ItemUtils.java | 30 ++++++++++++------- .../com/gmail/nossr50/util/MaterialUtils.java | 4 ++- .../com/gmail/nossr50/util/ModManager.java | 12 ++++---- .../nossr50/util/skills/CombatUtils.java | 14 +++++---- 25 files changed, 141 insertions(+), 130 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/ConfigManager.java b/src/main/java/com/gmail/nossr50/config/ConfigManager.java index d9db8277b..c78492939 100644 --- a/src/main/java/com/gmail/nossr50/config/ConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/ConfigManager.java @@ -3,12 +3,17 @@ package com.gmail.nossr50.config; import com.gmail.nossr50.config.collectionconfigs.CollectionClassType; import com.gmail.nossr50.config.collectionconfigs.MultiConfigContainer; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.config.mods.ArmorConfigManager; +import com.gmail.nossr50.config.mods.BlockConfigManager; +import com.gmail.nossr50.config.mods.EntityConfigManager; +import com.gmail.nossr50.config.mods.ToolConfigManager; import com.gmail.nossr50.config.skills.alchemy.PotionConfig; import com.gmail.nossr50.config.treasure.TreasureConfig; import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager; +import com.gmail.nossr50.util.ModManager; import java.util.ArrayList; @@ -41,6 +46,17 @@ public final class ConfigManager { private SimpleRepairableManager simpleRepairableManager; private SimpleSalvageableManager simpleSalvageableManager; + /* MOD MANAGERS */ + + //TODO: Add these back when modded servers become a thing again + + private ModManager modManager; + + /*private ToolConfigManager toolConfigManager; + private ArmorConfigManager armorConfigManager; + private BlockConfigManager blockConfigManager; + private EntityConfigManager entityConfigManager;*/ + /* CONFIG INSTANCES */ private MainConfig mainConfig; @@ -52,6 +68,8 @@ public final class ConfigManager { private SoundConfig soundConfig; private RankConfig rankConfig; + + /* CONFIG ERRORS */ private ArrayList configErrors; //Collect errors to whine about to server admins diff --git a/src/main/java/com/gmail/nossr50/config/MainConfig.java b/src/main/java/com/gmail/nossr50/config/MainConfig.java index 4646eba65..8c8142918 100644 --- a/src/main/java/com/gmail/nossr50/config/MainConfig.java +++ b/src/main/java/com/gmail/nossr50/config/MainConfig.java @@ -8,6 +8,7 @@ import com.gmail.nossr50.datatypes.skills.SuperAbilityType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.StringUtils; import org.bukkit.Material; +import org.bukkit.block.data.BlockData; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.EntityType; @@ -587,23 +588,6 @@ public class MainConfig extends ConfigValidated { return getIntValue("Hardcore.Vampirism.Level_Threshold", 0); } - /* SMP Mods */ - public boolean getToolModsEnabled() { - return getBooleanValue("Mods.Tool_Mods_Enabled", false); - } - - public boolean getArmorModsEnabled() { - return getBooleanValue("Mods.Armor_Mods_Enabled", false); - } - - public boolean getBlockModsEnabled() { - return getBooleanValue("Mods.Block_Mods_Enabled", false); - } - - public boolean getEntityModsEnabled() { - return getBooleanValue("Mods.Entity_Mods_Enabled", false); - } - /* Items */ public int getChimaeraUseCost() { return getIntValue("Items.Chimaera_Wing.Use_Cost", 1); diff --git a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java index ff11315a8..7fd62a8d0 100644 --- a/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java +++ b/src/main/java/com/gmail/nossr50/config/experience/ExperienceConfig.java @@ -1,7 +1,6 @@ package com.gmail.nossr50.config.experience; import com.gmail.nossr50.config.ConfigValidated; -import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.datatypes.experience.FormulaType; import com.gmail.nossr50.datatypes.skills.MaterialType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; diff --git a/src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java b/src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java index 91117ba0f..69a468886 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/mods/ArmorConfigManager.java @@ -1,13 +1,8 @@ package com.gmail.nossr50.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; - -import java.io.File; -import java.util.regex.Pattern; - public class ArmorConfigManager { - public ArmorConfigManager() { + //TODO: Commented out until modded servers appear again + /*public ArmorConfigManager() { Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.armor\\.yml"); //File dataFolder = new File(McmmoCore.getModDataFolderPath()); @@ -32,5 +27,5 @@ public class ArmorConfigManager { modManager.registerCustomArmor(new CustomArmorConfig(fileName)); } - } + }*/ } diff --git a/src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java b/src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java index e7fd0dbf9..a0297d46e 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/mods/BlockConfigManager.java @@ -1,13 +1,8 @@ package com.gmail.nossr50.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; - -import java.io.File; -import java.util.regex.Pattern; - public class BlockConfigManager { - public BlockConfigManager() { + //TODO: Commented out until modded servers appear again + /*public BlockConfigManager() { Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.blocks\\.yml"); //File dataFolder = new File(McmmoCore.getModDataFolderPath()); @@ -32,5 +27,5 @@ public class BlockConfigManager { modManager.registerCustomBlocks(new CustomBlockConfig(fileName)); } - } + }*/ } diff --git a/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java b/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java index 8e1d8996e..f72ed536d 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java +++ b/src/main/java/com/gmail/nossr50/config/mods/CustomToolConfig.java @@ -18,7 +18,8 @@ import java.util.List; import java.util.Set; public class CustomToolConfig extends Config { - public List customAxes = new ArrayList(); + //TODO: Disabled until modded servers come back + /*public List customAxes = new ArrayList(); public List customBows = new ArrayList(); public List customHoes = new ArrayList(); public List customPickaxes = new ArrayList(); @@ -113,5 +114,5 @@ public class CustomToolConfig extends Config { materialList.add(toolMaterial); customToolMap.put(toolMaterial, tool); } - } + }*/ } diff --git a/src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java b/src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java index c1e8573e9..4970bac48 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/mods/EntityConfigManager.java @@ -1,14 +1,9 @@ package com.gmail.nossr50.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; - -import java.io.File; -import java.util.regex.Pattern; - public class EntityConfigManager { - public EntityConfigManager(mcMMO plugin) { + //TODO: Commented out until modded servers appear again + /*public EntityConfigManager(mcMMO plugin) { Pattern middlePattern = Pattern.compile("entities\\.(?:.+)\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.entities\\.yml"); File dataFolder = new File(mcMMO.getModDirectory()); @@ -32,5 +27,5 @@ public class EntityConfigManager { modManager.registerCustomEntities(new CustomEntityConfig(fileName)); } - } + }*/ } diff --git a/src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java b/src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java index ee145a6ac..e2624495e 100644 --- a/src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java +++ b/src/main/java/com/gmail/nossr50/config/mods/ToolConfigManager.java @@ -1,14 +1,9 @@ package com.gmail.nossr50.config.mods; -import com.gmail.nossr50.mcMMO; -import com.gmail.nossr50.util.ModManager; - -import java.io.File; -import java.util.regex.Pattern; - public class ToolConfigManager { - public ToolConfigManager(mcMMO plugin) { + //TODO: Commented out until modded servers appear again + /*public ToolConfigManager(mcMMO plugin) { Pattern middlePattern = Pattern.compile("tools\\.(?:.+)\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.tools\\.yml"); File dataFolder = new File(mcMMO.getModDirectory()); @@ -32,5 +27,5 @@ public class ToolConfigManager { modManager.registerCustomTools(new CustomToolConfig(fileName)); } - } + }*/ } diff --git a/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java b/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java index 6a5ee4d37..b07c8cb8b 100755 --- a/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java +++ b/src/main/java/com/gmail/nossr50/config/treasure/TreasureConfig.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.config.treasure; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.ConfigCollection; import com.gmail.nossr50.datatypes.treasure.*; import com.gmail.nossr50.mcMMO; diff --git a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java index 531be5e8c..8f648da02 100644 --- a/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java +++ b/src/main/java/com/gmail/nossr50/datatypes/player/McMMOPlayer.java @@ -1,7 +1,9 @@ package com.gmail.nossr50.datatypes.player; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.WorldBlacklist; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.chat.ChatMode; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainSource; @@ -754,13 +756,13 @@ public class McMMOPlayer { xp = (float) (xp / primarySkillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()); - if (MainConfig.getInstance().getToolModsEnabled()) { + /*if (MainConfig.getInstance().getToolModsEnabled()) { CustomTool tool = mcMMO.getModManager().getTool(player.getInventory().getItemInMainHand()); if (tool != null) { xp *= tool.getXpMultiplier(); } - } + }*/ return PerksUtils.handleXpPerks(player, xp, primarySkillType); } @@ -871,9 +873,9 @@ public class McMMOPlayer { ItemStack inHand = player.getInventory().getItemInMainHand(); - if (mcMMO.getModManager().isCustomTool(inHand) && !mcMMO.getModManager().getTool(inHand).isAbilityEnabled()) { + /*if (mcMMO.getModManager().isCustomTool(inHand) && !mcMMO.getModManager().getTool(inHand).isAbilityEnabled()) { return; - } + }*/ if (!getAbilityUse()) { return; diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index b48107c8b..7dad9b6fc 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -1,7 +1,9 @@ package com.gmail.nossr50; -import com.gmail.nossr50.config.*; import com.gmail.nossr50.config.ConfigManager; +import com.gmail.nossr50.config.CoreSkillsConfig; +import com.gmail.nossr50.config.MainConfig; +import com.gmail.nossr50.config.WorldBlacklist; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.database.DatabaseManager; import com.gmail.nossr50.database.DatabaseManagerFactory; @@ -134,9 +136,9 @@ public class mcMMO extends JavaPlugin { //Store this value so other plugins can check it isRetroModeEnabled = MainConfig.getInstance().getIsRetroMode(); - if (getServer().getName().equals("Cauldron") || getServer().getName().equals("MCPC+")) { + /*if (getServer().getName().equals("Cauldron") || getServer().getName().equals("MCPC+")) { checkModConfigs(); - } + }*/ if (healthBarPluginEnabled) { getLogger().info("HealthBar plugin found, mcMMO's healthbars are automatically disabled."); @@ -493,7 +495,7 @@ public class mcMMO extends JavaPlugin { } } - private void checkModConfigs() { + /*private void checkModConfigs() { if (!MainConfig.getInstance().getToolModsEnabled()) { getLogger().warning("Cauldron implementation found, but the custom tool config for mcMMO is disabled!"); getLogger().info("To enable, set Mods.Tool_Mods_Enabled to TRUE in config.yml."); @@ -513,7 +515,7 @@ public class mcMMO extends JavaPlugin { getLogger().warning("Cauldron implementation found, but the custom entity config for mcMMO is disabled!"); getLogger().info("To enable, set Mods.Entity_Mods_Enabled to TRUE in config.yml."); } - } + }*/ public InputStreamReader getResourceAsReader(String fileName) { InputStream in = getResource(fileName); diff --git a/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java b/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java index 287c62048..84b36dcda 100644 --- a/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java +++ b/src/main/java/com/gmail/nossr50/skills/child/FamilyTree.java @@ -1,10 +1,10 @@ package com.gmail.nossr50.skills.child; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; -import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; -import java.util.*; +import java.util.ArrayList; +import java.util.Set; public class FamilyTree { static final ImmutableSet salvageTree; diff --git a/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java b/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java index 83572f678..a64ba4701 100644 --- a/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java +++ b/src/main/java/com/gmail/nossr50/skills/excavation/Excavation.java @@ -1,5 +1,7 @@ package com.gmail.nossr50.skills.excavation; +import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.config.treasure.TreasureConfig; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.mcMMO; @@ -26,9 +28,9 @@ public class Excavation { protected static int getBlockXP(BlockState blockState) { int xp = ExperienceConfig.getInstance().getXp(PrimarySkillType.EXCAVATION, blockState.getType()); - if (xp == 0 && mcMMO.getModManager().isCustomExcavationBlock(blockState)) { + /*if (xp == 0 && mcMMO.getModManager().isCustomExcavationBlock(blockState)) { xp = mcMMO.getModManager().getBlock(blockState).getXpGain(); - } + }*/ return xp; } diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index cd695e21b..f6dc0dc9b 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -2,6 +2,7 @@ package com.gmail.nossr50.skills.herbalism; import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.experience.ExperienceConfig; +import com.gmail.nossr50.config.treasure.TreasureConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.mods.CustomBlock; @@ -140,17 +141,16 @@ public class HerbalismManager extends SkillManager { int xp; boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getAbility()); - if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) { - CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState); - xp = customBlock.getXpGain(); - - if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) { - if(checkDoubleDrop(blockState)) - BlockUtils.markBlocksForBonusDrops(blockState, greenTerra); - } - } - else { - xp = ExperienceConfig.getInstance().getXp(skill, blockState.getBlockData()); +// if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) { +// CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState); +// xp = customBlock.getXpGain(); +// +// if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) { +// drops = blockState.getBlock().getDrops(); +// } +// } +// else { + xp = ExperienceConfig.getInstance().getXp(skill, blockState.getType()); if (!oneBlockPlant) { //Kelp is actually two blocks mixed together @@ -170,7 +170,7 @@ public class HerbalismManager extends SkillManager { if (Permissions.greenThumbPlant(player, material)) { processGreenThumbPlants(blockState, greenTerra); } - } + //} mod config close applyXpGain(xp, XPGainReason.PVE); } diff --git a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java index 3ceeec43a..e4dd5f788 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/Mining.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/Mining.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.skills.mining; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.Misc; @@ -17,9 +18,9 @@ public class Mining { public static int getBlockXp(BlockState blockState) { int xp = ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, blockState.getType()); - if (xp == 0 && mcMMO.getModManager().isCustomMiningBlock(blockState)) { + /*if (xp == 0 && mcMMO.getModManager().isCustomMiningBlock(blockState)) { xp = mcMMO.getModManager().getBlock(blockState).getXpGain(); - } + }*/ return xp; } @@ -93,9 +94,9 @@ public class Mining { return; default: - if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { + /*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); - } + }*/ return; } } @@ -160,9 +161,9 @@ public class Mining { return; default: - if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { + /*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); - } + }*/ return; } } diff --git a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java index dd4f2216f..8c5a36187 100644 --- a/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java +++ b/src/main/java/com/gmail/nossr50/skills/mining/MiningManager.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.skills.mining; +import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; @@ -79,7 +80,8 @@ public class MiningManager extends SkillManager { SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), MainConfig.getInstance().getAbilityToolDamage()); } - if ((mcMMO.getModManager().isCustomMiningBlock(blockState) && !mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) || !MainConfig.getInstance().getDoubleDropsEnabled(skill, material)) { + //if ((mcMMO.getModManager().isCustomMiningBlock(blockState) && !mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) || !MainConfig.getInstance().getDoubleDropsEnabled(skill, material)) { + if(!MainConfig.getInstance().getDoubleDropsEnabled(skill, material)) { return; } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java b/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java index 37bd0305a..daf8a57b9 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/repairables/SimpleRepairableManager.java @@ -1,10 +1,8 @@ package com.gmail.nossr50.skills.repair.repairables; -import com.gmail.nossr50.config.Unload; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; -import java.util.Collection; import java.util.HashMap; import java.util.List; diff --git a/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java b/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java index 108de3971..21b6d06fc 100644 --- a/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java +++ b/src/main/java/com/gmail/nossr50/skills/smelting/Smelting.java @@ -3,7 +3,6 @@ package com.gmail.nossr50.skills.smelting; import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType; -import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.skills.RankUtils; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -16,6 +15,7 @@ public class Smelting { } protected static int getResourceXp(ItemStack smelting) { - return mcMMO.getModManager().isCustomOre(smelting.getType()) ? mcMMO.getModManager().getBlock(smelting.getType()).getSmeltingXpGain() : ExperienceConfig.getInstance().getXp(PrimarySkillType.SMELTING, smelting.getType()); + //return mcMMO.getModManager().isCustomOre(smelting.getType()) ? mcMMO.getModManager().getBlock(smelting.getType()).getSmeltingXpGain() : ExperienceConfig.getInstance().getXp(PrimarySkillType.SMELTING, smelting.getType()); + return ExperienceConfig.getInstance().getXp(PrimarySkillType.SMELTING, smelting.getType()); } } diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java index faf09c176..8a8eb7552 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/Woodcutting.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.skills.woodcutting; import com.gmail.nossr50.config.MainConfig; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.util.BlockUtils; @@ -36,9 +37,9 @@ public final class Woodcutting { * @return Amount of experience */ protected static int getExperienceFromLog(BlockState blockState, ExperienceGainMethod experienceGainMethod) { - if (mcMMO.getModManager().isCustomLog(blockState)) { + /*if (mcMMO.getModManager().isCustomLog(blockState)) { return mcMMO.getModManager().getBlock(blockState).getXpGain(); - } + }*/ return ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType()); } @@ -49,14 +50,14 @@ public final class Woodcutting { * @param blockState Block being broken */ protected static void checkForDoubleDrop(BlockState blockState) { - if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { + /*if (mcMMO.getModManager().isCustomLog(blockState) && mcMMO.getModManager().getBlock(blockState).isDoubleDropEnabled()) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); } - else { + else {*/ if (MainConfig.getInstance().getWoodcuttingDoubleDropsEnabled(blockState.getBlockData())) { Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); } - } + //} } /** diff --git a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java index fc65fb450..3ec34f827 100644 --- a/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java +++ b/src/main/java/com/gmail/nossr50/skills/woodcutting/WoodcuttingManager.java @@ -130,7 +130,7 @@ public class WoodcuttingManager extends SkillManager { xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); } - else if (mcMMO.getModManager().isCustomLog(blockState)) { + /*else if (mcMMO.getModManager().isCustomLog(blockState)) { if (canGetDoubleDrops()) { Woodcutting.checkForDoubleDrop(blockState); } @@ -142,7 +142,7 @@ public class WoodcuttingManager extends SkillManager { } else if (mcMMO.getModManager().isCustomLeaf(blockState)) { Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); - } + }*/ else { if (BlockUtils.isLog(blockState)) { diff --git a/src/main/java/com/gmail/nossr50/util/BlockUtils.java b/src/main/java/com/gmail/nossr50/util/BlockUtils.java index 129e5c1aa..c77b074a4 100644 --- a/src/main/java/com/gmail/nossr50/util/BlockUtils.java +++ b/src/main/java/com/gmail/nossr50/util/BlockUtils.java @@ -157,7 +157,8 @@ public final class BlockUtils { return false; default : - return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); + return !isMcMMOAnvil(blockState); + //return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); } } @@ -283,7 +284,7 @@ public final class BlockUtils { return false; default : - return !isMcMMOAnvil(blockState) && !mcMMO.getModManager().isCustomAbilityBlock(blockState); + return !isMcMMOAnvil(blockState); // && !mcMMO.getModManager().isCustomAbilityBlock(blockState); } } @@ -331,11 +332,13 @@ public final class BlockUtils { * @return true if the block should affected by Green Terra, false otherwise */ public static boolean affectedByGreenTerra(BlockState blockState) { - if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.HERBALISM, blockState.getBlockData())) { + if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.HERBALISM, blockState.getType())) { return true; } + else + return false; - return mcMMO.getModManager().isCustomHerbalismBlock(blockState); + //return mcMMO.getModManager().isCustomHerbalismBlock(blockState); } /** @@ -347,10 +350,10 @@ public final class BlockUtils { * otherwise */ public static Boolean affectedBySuperBreaker(BlockState blockState) { - if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.MINING, blockState.getBlockData())) + if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.MINING, blockState.getType())) return true; - return isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState); + return isOre(blockState); //|| mcMMO.getModManager().isCustomMiningBlock(blockState); } /** @@ -362,9 +365,11 @@ public final class BlockUtils { * otherwise */ public static boolean affectedByGigaDrillBreaker(BlockState blockState) { - if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.EXCAVATION, blockState.getBlockData())) + if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.EXCAVATION, blockState.getType())) return true; - return mcMMO.getModManager().isCustomExcavationBlock(blockState); + else + return false; + //return mcMMO.getModManager().isCustomExcavationBlock(blockState); } /** @@ -375,9 +380,11 @@ public final class BlockUtils { * @return true if the block is a log, false otherwise */ public static boolean isLog(BlockState blockState) { - if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.WOODCUTTING, blockState.getBlockData())) + if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.WOODCUTTING, blockState.getType())) return true; - return mcMMO.getModManager().isCustomLog(blockState); + else + return false; + //return mcMMO.getModManager().isCustomLog(blockState); } /** @@ -398,7 +405,8 @@ public final class BlockUtils { return true; default : - return mcMMO.getModManager().isCustomLeaf(blockState); + return false; + //return mcMMO.getModManager().isCustomLeaf(blockState); } } diff --git a/src/main/java/com/gmail/nossr50/util/ItemUtils.java b/src/main/java/com/gmail/nossr50/util/ItemUtils.java index 26dedc43c..9bb2cc778 100644 --- a/src/main/java/com/gmail/nossr50/util/ItemUtils.java +++ b/src/main/java/com/gmail/nossr50/util/ItemUtils.java @@ -28,7 +28,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomBow(type); + return false; + //return mcMMO.getModManager().isCustomBow(type); } } @@ -50,7 +51,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomSword(type); + return false; + //return mcMMO.getModManager().isCustomSword(type); } } @@ -72,7 +74,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomHoe(type); + return false; + //return mcMMO.getModManager().isCustomHoe(type); } } @@ -94,7 +97,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomShovel(type); + return false; + //return mcMMO.getModManager().isCustomShovel(type); } } @@ -116,7 +120,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomAxe(type); + return false; + //return mcMMO.getModManager().isCustomAxe(type); } } @@ -138,7 +143,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomPickaxe(type); + return false; + //return mcMMO.getModManager().isCustomPickaxe(type); } } @@ -174,7 +180,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomHelmet(type); + return false; + //return mcMMO.getModManager().isCustomHelmet(type); } } @@ -196,7 +203,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomChestplate(type); + return false; + //return mcMMO.getModManager().isCustomChestplate(type); } } @@ -218,7 +226,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomLeggings(type); + return false; + //return mcMMO.getModManager().isCustomLeggings(type); } } @@ -240,7 +249,8 @@ public final class ItemUtils { return true; default: - return mcMMO.getModManager().isCustomBoots(type); + return false; + //return mcMMO.getModManager().isCustomBoots(type); } } diff --git a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java index 8951a098a..483d600d3 100644 --- a/src/main/java/com/gmail/nossr50/util/MaterialUtils.java +++ b/src/main/java/com/gmail/nossr50/util/MaterialUtils.java @@ -18,7 +18,9 @@ public final class MaterialUtils { case EMERALD_ORE: return true; default: - return mcMMO.getModManager().isCustomOre(data); + return false; + /*default: + return mcMMO.getModManager().isCustomOre(data);*/ } } } diff --git a/src/main/java/com/gmail/nossr50/util/ModManager.java b/src/main/java/com/gmail/nossr50/util/ModManager.java index e63ec421b..af7cb468d 100644 --- a/src/main/java/com/gmail/nossr50/util/ModManager.java +++ b/src/main/java/com/gmail/nossr50/util/ModManager.java @@ -22,7 +22,7 @@ import java.util.HashMap; import java.util.List; public class ModManager { - private List repairables = new ArrayList(); + /*private List repairables = new ArrayList(); // Armor Mods private List customBoots = new ArrayList(); @@ -164,22 +164,22 @@ public class ModManager { return customBlockMap.get(data); } - /** + *//** * Checks to see if an item is a custom tool. * * @param item Item to check * @return true if the item is a custom tool, false otherwise - */ + *//* public boolean isCustomTool(ItemStack item) { return MainConfig.getInstance().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType()); } - /** + *//** * Get the custom tool associated with an item. * * @param item The item to check * @return the tool if it exists, null otherwise - */ + *//* public CustomTool getTool(ItemStack item) { return item == null ? null : customToolMap.get(item.getType()); } @@ -278,5 +278,5 @@ public class ModManager { catch (Exception e) { e.printStackTrace(); } - } + }*/ } diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 31f6c8b33..865b92a1b 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -1,5 +1,6 @@ package com.gmail.nossr50.util.skills; +import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.player.McMMOPlayer; @@ -560,10 +561,11 @@ public final class CombatUtils { } } else { - if (mcMMO.getModManager().isCustomEntity(target)) { + /*if (mcMMO.getModManager().isCustomEntity(target)) { baseXP = mcMMO.getModManager().getEntity(target).getXpMultiplier(); - } - else if (target instanceof Animals) { + }*/ + //else if (target instanceof Animals) { + if (target instanceof Animals) { EntityType type = target.getType(); baseXP = ExperienceConfig.getInstance().getAnimalsXP(type); } @@ -590,7 +592,7 @@ public final class CombatUtils { else { baseXP = 1.0; - mcMMO.getModManager().addCustomEntity(target); + //mcMMO.getModManager().addCustomEntity(target); } } @@ -819,9 +821,9 @@ public final class CombatUtils { else if (ItemUtils.isDiamondTool(inHand)) { tier = 4; } - else if (mcMMO.getModManager().isCustomTool(inHand)) { + /*else if (mcMMO.getModManager().isCustomTool(inHand)) { tier = mcMMO.getModManager().getTool(inHand).getTier(); - } + }*/ return tier; }