mod configs are taking a break

This commit is contained in:
nossr50 2019-02-18 12:16:10 -08:00
parent 63aebd0454
commit e7d8e51722
25 changed files with 141 additions and 130 deletions

View File

@ -3,12 +3,17 @@ package com.gmail.nossr50.config;
import com.gmail.nossr50.config.collectionconfigs.CollectionClassType; import com.gmail.nossr50.config.collectionconfigs.CollectionClassType;
import com.gmail.nossr50.config.collectionconfigs.MultiConfigContainer; import com.gmail.nossr50.config.collectionconfigs.MultiConfigContainer;
import com.gmail.nossr50.config.experience.ExperienceConfig; 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.skills.alchemy.PotionConfig;
import com.gmail.nossr50.config.treasure.TreasureConfig; import com.gmail.nossr50.config.treasure.TreasureConfig;
import com.gmail.nossr50.skills.repair.repairables.Repairable; import com.gmail.nossr50.skills.repair.repairables.Repairable;
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager; import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager;
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable; import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager; import com.gmail.nossr50.skills.salvage.salvageables.SimpleSalvageableManager;
import com.gmail.nossr50.util.ModManager;
import java.util.ArrayList; import java.util.ArrayList;
@ -41,6 +46,17 @@ public final class ConfigManager {
private SimpleRepairableManager simpleRepairableManager; private SimpleRepairableManager simpleRepairableManager;
private SimpleSalvageableManager simpleSalvageableManager; 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 */ /* CONFIG INSTANCES */
private MainConfig mainConfig; private MainConfig mainConfig;
@ -52,6 +68,8 @@ public final class ConfigManager {
private SoundConfig soundConfig; private SoundConfig soundConfig;
private RankConfig rankConfig; private RankConfig rankConfig;
/* CONFIG ERRORS */ /* CONFIG ERRORS */
private ArrayList<String> configErrors; //Collect errors to whine about to server admins private ArrayList<String> configErrors; //Collect errors to whine about to server admins

View File

@ -8,6 +8,7 @@ import com.gmail.nossr50.datatypes.skills.SuperAbilityType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils; import com.gmail.nossr50.util.StringUtils;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
@ -587,23 +588,6 @@ public class MainConfig extends ConfigValidated {
return getIntValue("Hardcore.Vampirism.Level_Threshold", 0); 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 */ /* Items */
public int getChimaeraUseCost() { public int getChimaeraUseCost() {
return getIntValue("Items.Chimaera_Wing.Use_Cost", 1); return getIntValue("Items.Chimaera_Wing.Use_Cost", 1);

View File

@ -1,7 +1,6 @@
package com.gmail.nossr50.config.experience; package com.gmail.nossr50.config.experience;
import com.gmail.nossr50.config.ConfigValidated; import com.gmail.nossr50.config.ConfigValidated;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.datatypes.experience.FormulaType; import com.gmail.nossr50.datatypes.experience.FormulaType;
import com.gmail.nossr50.datatypes.skills.MaterialType; import com.gmail.nossr50.datatypes.skills.MaterialType;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;

View File

@ -1,13 +1,8 @@
package com.gmail.nossr50.config.mods; 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 class ArmorConfigManager {
public ArmorConfigManager() { //TODO: Commented out until modded servers appear again
/*public ArmorConfigManager() {
Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml"); Pattern middlePattern = Pattern.compile("armor\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.armor\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.armor\\.yml");
//File dataFolder = new File(McmmoCore.getModDataFolderPath()); //File dataFolder = new File(McmmoCore.getModDataFolderPath());
@ -32,5 +27,5 @@ public class ArmorConfigManager {
modManager.registerCustomArmor(new CustomArmorConfig(fileName)); modManager.registerCustomArmor(new CustomArmorConfig(fileName));
} }
} }*/
} }

View File

@ -1,13 +1,8 @@
package com.gmail.nossr50.config.mods; 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 class BlockConfigManager {
public BlockConfigManager() { //TODO: Commented out until modded servers appear again
/*public BlockConfigManager() {
Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml"); Pattern middlePattern = Pattern.compile("blocks\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.blocks\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.blocks\\.yml");
//File dataFolder = new File(McmmoCore.getModDataFolderPath()); //File dataFolder = new File(McmmoCore.getModDataFolderPath());
@ -32,5 +27,5 @@ public class BlockConfigManager {
modManager.registerCustomBlocks(new CustomBlockConfig(fileName)); modManager.registerCustomBlocks(new CustomBlockConfig(fileName));
} }
} }*/
} }

View File

@ -18,7 +18,8 @@ import java.util.List;
import java.util.Set; import java.util.Set;
public class CustomToolConfig extends Config { public class CustomToolConfig extends Config {
public List<Material> customAxes = new ArrayList<Material>(); //TODO: Disabled until modded servers come back
/*public List<Material> customAxes = new ArrayList<Material>();
public List<Material> customBows = new ArrayList<Material>(); public List<Material> customBows = new ArrayList<Material>();
public List<Material> customHoes = new ArrayList<Material>(); public List<Material> customHoes = new ArrayList<Material>();
public List<Material> customPickaxes = new ArrayList<Material>(); public List<Material> customPickaxes = new ArrayList<Material>();
@ -113,5 +114,5 @@ public class CustomToolConfig extends Config {
materialList.add(toolMaterial); materialList.add(toolMaterial);
customToolMap.put(toolMaterial, tool); customToolMap.put(toolMaterial, tool);
} }
} }*/
} }

View File

@ -1,14 +1,9 @@
package com.gmail.nossr50.config.mods; 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 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 middlePattern = Pattern.compile("entities\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.entities\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.entities\\.yml");
File dataFolder = new File(mcMMO.getModDirectory()); File dataFolder = new File(mcMMO.getModDirectory());
@ -32,5 +27,5 @@ public class EntityConfigManager {
modManager.registerCustomEntities(new CustomEntityConfig(fileName)); modManager.registerCustomEntities(new CustomEntityConfig(fileName));
} }
} }*/
} }

View File

@ -1,14 +1,9 @@
package com.gmail.nossr50.config.mods; 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 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 middlePattern = Pattern.compile("tools\\.(?:.+)\\.yml");
Pattern startPattern = Pattern.compile("(?:.+)\\.tools\\.yml"); Pattern startPattern = Pattern.compile("(?:.+)\\.tools\\.yml");
File dataFolder = new File(mcMMO.getModDirectory()); File dataFolder = new File(mcMMO.getModDirectory());
@ -32,5 +27,5 @@ public class ToolConfigManager {
modManager.registerCustomTools(new CustomToolConfig(fileName)); modManager.registerCustomTools(new CustomToolConfig(fileName));
} }
} }*/
} }

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.config.treasure; package com.gmail.nossr50.config.treasure;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.ConfigCollection; import com.gmail.nossr50.config.ConfigCollection;
import com.gmail.nossr50.datatypes.treasure.*; import com.gmail.nossr50.datatypes.treasure.*;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;

View File

@ -1,7 +1,9 @@
package com.gmail.nossr50.datatypes.player; package com.gmail.nossr50.datatypes.player;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.config.WorldBlacklist; 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.chat.ChatMode;
import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.experience.XPGainSource; import com.gmail.nossr50.datatypes.experience.XPGainSource;
@ -754,13 +756,13 @@ public class McMMOPlayer {
xp = (float) (xp / primarySkillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier()); xp = (float) (xp / primarySkillType.getXpModifier() * ExperienceConfig.getInstance().getExperienceGainsGlobalMultiplier());
if (MainConfig.getInstance().getToolModsEnabled()) { /*if (MainConfig.getInstance().getToolModsEnabled()) {
CustomTool tool = mcMMO.getModManager().getTool(player.getInventory().getItemInMainHand()); CustomTool tool = mcMMO.getModManager().getTool(player.getInventory().getItemInMainHand());
if (tool != null) { if (tool != null) {
xp *= tool.getXpMultiplier(); xp *= tool.getXpMultiplier();
} }
} }*/
return PerksUtils.handleXpPerks(player, xp, primarySkillType); return PerksUtils.handleXpPerks(player, xp, primarySkillType);
} }
@ -871,9 +873,9 @@ public class McMMOPlayer {
ItemStack inHand = player.getInventory().getItemInMainHand(); 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; return;
} }*/
if (!getAbilityUse()) { if (!getAbilityUse()) {
return; return;

View File

@ -1,7 +1,9 @@
package com.gmail.nossr50; package com.gmail.nossr50;
import com.gmail.nossr50.config.*;
import com.gmail.nossr50.config.ConfigManager; 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.config.experience.ExperienceConfig;
import com.gmail.nossr50.database.DatabaseManager; import com.gmail.nossr50.database.DatabaseManager;
import com.gmail.nossr50.database.DatabaseManagerFactory; import com.gmail.nossr50.database.DatabaseManagerFactory;
@ -134,9 +136,9 @@ public class mcMMO extends JavaPlugin {
//Store this value so other plugins can check it //Store this value so other plugins can check it
isRetroModeEnabled = MainConfig.getInstance().getIsRetroMode(); isRetroModeEnabled = MainConfig.getInstance().getIsRetroMode();
if (getServer().getName().equals("Cauldron") || getServer().getName().equals("MCPC+")) { /*if (getServer().getName().equals("Cauldron") || getServer().getName().equals("MCPC+")) {
checkModConfigs(); checkModConfigs();
} }*/
if (healthBarPluginEnabled) { if (healthBarPluginEnabled) {
getLogger().info("HealthBar plugin found, mcMMO's healthbars are automatically disabled."); 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()) { if (!MainConfig.getInstance().getToolModsEnabled()) {
getLogger().warning("Cauldron implementation found, but the custom tool config for mcMMO is disabled!"); 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."); 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().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."); getLogger().info("To enable, set Mods.Entity_Mods_Enabled to TRUE in config.yml.");
} }
} }*/
public InputStreamReader getResourceAsReader(String fileName) { public InputStreamReader getResourceAsReader(String fileName) {
InputStream in = getResource(fileName); InputStream in = getResource(fileName);

View File

@ -1,10 +1,10 @@
package com.gmail.nossr50.skills.child; package com.gmail.nossr50.skills.child;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import java.util.*; import java.util.ArrayList;
import java.util.Set;
public class FamilyTree { public class FamilyTree {
static final ImmutableSet<PrimarySkillType> salvageTree; static final ImmutableSet<PrimarySkillType> salvageTree;

View File

@ -1,5 +1,7 @@
package com.gmail.nossr50.skills.excavation; 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.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure; import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
@ -26,9 +28,9 @@ public class Excavation {
protected static int getBlockXP(BlockState blockState) { protected static int getBlockXP(BlockState blockState) {
int xp = ExperienceConfig.getInstance().getXp(PrimarySkillType.EXCAVATION, blockState.getType()); 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(); xp = mcMMO.getModManager().getBlock(blockState).getXpGain();
} }*/
return xp; return xp;
} }

View File

@ -2,6 +2,7 @@ package com.gmail.nossr50.skills.herbalism;
import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig; 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.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.mods.CustomBlock; import com.gmail.nossr50.datatypes.mods.CustomBlock;
@ -140,17 +141,16 @@ public class HerbalismManager extends SkillManager {
int xp; int xp;
boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getAbility()); boolean greenTerra = mcMMOPlayer.getAbilityMode(skill.getAbility());
if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) { // if (mcMMO.getModManager().isCustomHerbalismBlock(blockState)) {
CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState); // CustomBlock customBlock = mcMMO.getModManager().getBlock(blockState);
xp = customBlock.getXpGain(); // xp = customBlock.getXpGain();
//
if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) { // if (Permissions.isSubSkillEnabled(player, SubSkillType.HERBALISM_DOUBLE_DROPS) && customBlock.isDoubleDropEnabled()) {
if(checkDoubleDrop(blockState)) // drops = blockState.getBlock().getDrops();
BlockUtils.markBlocksForBonusDrops(blockState, greenTerra); // }
} // }
} // else {
else { xp = ExperienceConfig.getInstance().getXp(skill, blockState.getType());
xp = ExperienceConfig.getInstance().getXp(skill, blockState.getBlockData());
if (!oneBlockPlant) { if (!oneBlockPlant) {
//Kelp is actually two blocks mixed together //Kelp is actually two blocks mixed together
@ -170,7 +170,7 @@ public class HerbalismManager extends SkillManager {
if (Permissions.greenThumbPlant(player, material)) { if (Permissions.greenThumbPlant(player, material)) {
processGreenThumbPlants(blockState, greenTerra); processGreenThumbPlants(blockState, greenTerra);
} }
} //} mod config close
applyXpGain(xp, XPGainReason.PVE); applyXpGain(xp, XPGainReason.PVE);
} }

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.skills.mining; package com.gmail.nossr50.skills.mining;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Misc;
@ -17,9 +18,9 @@ public class Mining {
public static int getBlockXp(BlockState blockState) { public static int getBlockXp(BlockState blockState) {
int xp = ExperienceConfig.getInstance().getXp(PrimarySkillType.MINING, blockState.getType()); 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(); xp = mcMMO.getModManager().getBlock(blockState).getXpGain();
} }*/
return xp; return xp;
} }
@ -93,9 +94,9 @@ public class Mining {
return; return;
default: default:
if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { /*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) {
Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType())); Misc.dropItem(Misc.getBlockCenter(blockState), new ItemStack(blockState.getType()));
} }*/
return; return;
} }
} }
@ -160,9 +161,9 @@ public class Mining {
return; return;
default: default:
if (mcMMO.getModManager().isCustomMiningBlock(blockState)) { /*if (mcMMO.getModManager().isCustomMiningBlock(blockState)) {
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
} }*/
return; return;
} }
} }

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.skills.mining; package com.gmail.nossr50.skills.mining;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.datatypes.experience.XPGainReason; import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
@ -79,7 +80,8 @@ public class MiningManager extends SkillManager {
SkillUtils.handleDurabilityChange(getPlayer().getInventory().getItemInMainHand(), MainConfig.getInstance().getAbilityToolDamage()); 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; return;
} }

View File

@ -1,10 +1,8 @@
package com.gmail.nossr50.skills.repair.repairables; package com.gmail.nossr50.skills.repair.repairables;
import com.gmail.nossr50.config.Unload;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;

View File

@ -3,7 +3,6 @@ package com.gmail.nossr50.skills.smelting;
import com.gmail.nossr50.config.experience.ExperienceConfig; import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.SubSkillType; import com.gmail.nossr50.datatypes.skills.SubSkillType;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.skills.RankUtils; import com.gmail.nossr50.util.skills.RankUtils;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -16,6 +15,7 @@ public class Smelting {
} }
protected static int getResourceXp(ItemStack 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());
} }
} }

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.skills.woodcutting; package com.gmail.nossr50.skills.woodcutting;
import com.gmail.nossr50.config.MainConfig; import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.config.experience.ExperienceConfig;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType; import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.BlockUtils; import com.gmail.nossr50.util.BlockUtils;
@ -36,9 +37,9 @@ public final class Woodcutting {
* @return Amount of experience * @return Amount of experience
*/ */
protected static int getExperienceFromLog(BlockState blockState, ExperienceGainMethod experienceGainMethod) { 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 mcMMO.getModManager().getBlock(blockState).getXpGain();
} }*/
return ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType()); return ExperienceConfig.getInstance().getXp(PrimarySkillType.WOODCUTTING, blockState.getType());
} }
@ -49,14 +50,14 @@ public final class Woodcutting {
* @param blockState Block being broken * @param blockState Block being broken
*/ */
protected static void checkForDoubleDrop(BlockState blockState) { 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()); Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
} }
else { else {*/
if (MainConfig.getInstance().getWoodcuttingDoubleDropsEnabled(blockState.getBlockData())) { if (MainConfig.getInstance().getWoodcuttingDoubleDropsEnabled(blockState.getBlockData())) {
Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops()); Misc.dropItems(Misc.getBlockCenter(blockState), blockState.getBlock().getDrops());
} }
} //}
} }
/** /**

View File

@ -130,7 +130,7 @@ public class WoodcuttingManager extends SkillManager {
xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER); xp += Woodcutting.getExperienceFromLog(blockState, ExperienceGainMethod.TREE_FELLER);
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
} }
else if (mcMMO.getModManager().isCustomLog(blockState)) { /*else if (mcMMO.getModManager().isCustomLog(blockState)) {
if (canGetDoubleDrops()) { if (canGetDoubleDrops()) {
Woodcutting.checkForDoubleDrop(blockState); Woodcutting.checkForDoubleDrop(blockState);
} }
@ -142,7 +142,7 @@ public class WoodcuttingManager extends SkillManager {
} }
else if (mcMMO.getModManager().isCustomLeaf(blockState)) { else if (mcMMO.getModManager().isCustomLeaf(blockState)) {
Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops()); Misc.dropItems(Misc.getBlockCenter(blockState), block.getDrops());
} }*/
else { else {
if (BlockUtils.isLog(blockState)) { if (BlockUtils.isLog(blockState)) {

View File

@ -157,7 +157,8 @@ public final class BlockUtils {
return false; return false;
default : 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; return false;
default : 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 * @return true if the block should affected by Green Terra, false otherwise
*/ */
public static boolean affectedByGreenTerra(BlockState blockState) { public static boolean affectedByGreenTerra(BlockState blockState) {
if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.HERBALISM, blockState.getBlockData())) { if (ExperienceConfig.getInstance().doesBlockGiveSkillXP(PrimarySkillType.HERBALISM, blockState.getType())) {
return true; return true;
} }
else
return false;
return mcMMO.getModManager().isCustomHerbalismBlock(blockState); //return mcMMO.getModManager().isCustomHerbalismBlock(blockState);
} }
/** /**
@ -347,10 +350,10 @@ public final class BlockUtils {
* otherwise * otherwise
*/ */
public static Boolean affectedBySuperBreaker(BlockState blockState) { 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 true;
return isOre(blockState) || mcMMO.getModManager().isCustomMiningBlock(blockState); return isOre(blockState); //|| mcMMO.getModManager().isCustomMiningBlock(blockState);
} }
/** /**
@ -362,9 +365,11 @@ public final class BlockUtils {
* otherwise * otherwise
*/ */
public static boolean affectedByGigaDrillBreaker(BlockState blockState) { 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 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 * @return true if the block is a log, false otherwise
*/ */
public static boolean isLog(BlockState blockState) { 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 true;
return mcMMO.getModManager().isCustomLog(blockState); else
return false;
//return mcMMO.getModManager().isCustomLog(blockState);
} }
/** /**
@ -398,7 +405,8 @@ public final class BlockUtils {
return true; return true;
default : default :
return mcMMO.getModManager().isCustomLeaf(blockState); return false;
//return mcMMO.getModManager().isCustomLeaf(blockState);
} }
} }

View File

@ -28,7 +28,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomBow(type); return false;
//return mcMMO.getModManager().isCustomBow(type);
} }
} }
@ -50,7 +51,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomSword(type); return false;
//return mcMMO.getModManager().isCustomSword(type);
} }
} }
@ -72,7 +74,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomHoe(type); return false;
//return mcMMO.getModManager().isCustomHoe(type);
} }
} }
@ -94,7 +97,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomShovel(type); return false;
//return mcMMO.getModManager().isCustomShovel(type);
} }
} }
@ -116,7 +120,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomAxe(type); return false;
//return mcMMO.getModManager().isCustomAxe(type);
} }
} }
@ -138,7 +143,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomPickaxe(type); return false;
//return mcMMO.getModManager().isCustomPickaxe(type);
} }
} }
@ -174,7 +180,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomHelmet(type); return false;
//return mcMMO.getModManager().isCustomHelmet(type);
} }
} }
@ -196,7 +203,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomChestplate(type); return false;
//return mcMMO.getModManager().isCustomChestplate(type);
} }
} }
@ -218,7 +226,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomLeggings(type); return false;
//return mcMMO.getModManager().isCustomLeggings(type);
} }
} }
@ -240,7 +249,8 @@ public final class ItemUtils {
return true; return true;
default: default:
return mcMMO.getModManager().isCustomBoots(type); return false;
//return mcMMO.getModManager().isCustomBoots(type);
} }
} }

View File

@ -18,7 +18,9 @@ public final class MaterialUtils {
case EMERALD_ORE: case EMERALD_ORE:
return true; return true;
default: default:
return mcMMO.getModManager().isCustomOre(data); return false;
/*default:
return mcMMO.getModManager().isCustomOre(data);*/
} }
} }
} }

View File

@ -22,7 +22,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
public class ModManager { public class ModManager {
private List<Repairable> repairables = new ArrayList<Repairable>(); /*private List<Repairable> repairables = new ArrayList<Repairable>();
// Armor Mods // Armor Mods
private List<Material> customBoots = new ArrayList<Material>(); private List<Material> customBoots = new ArrayList<Material>();
@ -164,22 +164,22 @@ public class ModManager {
return customBlockMap.get(data); return customBlockMap.get(data);
} }
/** *//**
* Checks to see if an item is a custom tool. * Checks to see if an item is a custom tool.
* *
* @param item Item to check * @param item Item to check
* @return true if the item is a custom tool, false otherwise * @return true if the item is a custom tool, false otherwise
*/ *//*
public boolean isCustomTool(ItemStack item) { public boolean isCustomTool(ItemStack item) {
return MainConfig.getInstance().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType()); return MainConfig.getInstance().getToolModsEnabled() && item != null && customToolMap.containsKey(item.getType());
} }
/** *//**
* Get the custom tool associated with an item. * Get the custom tool associated with an item.
* *
* @param item The item to check * @param item The item to check
* @return the tool if it exists, null otherwise * @return the tool if it exists, null otherwise
*/ *//*
public CustomTool getTool(ItemStack item) { public CustomTool getTool(ItemStack item) {
return item == null ? null : customToolMap.get(item.getType()); return item == null ? null : customToolMap.get(item.getType());
} }
@ -278,5 +278,5 @@ public class ModManager {
catch (Exception e) { catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
} }*/
} }

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.util.skills; 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.experience.XPGainReason;
import com.gmail.nossr50.datatypes.interactions.NotificationType; import com.gmail.nossr50.datatypes.interactions.NotificationType;
import com.gmail.nossr50.datatypes.player.McMMOPlayer; import com.gmail.nossr50.datatypes.player.McMMOPlayer;
@ -560,10 +561,11 @@ public final class CombatUtils {
} }
} }
else { else {
if (mcMMO.getModManager().isCustomEntity(target)) { /*if (mcMMO.getModManager().isCustomEntity(target)) {
baseXP = mcMMO.getModManager().getEntity(target).getXpMultiplier(); baseXP = mcMMO.getModManager().getEntity(target).getXpMultiplier();
} }*/
else if (target instanceof Animals) { //else if (target instanceof Animals) {
if (target instanceof Animals) {
EntityType type = target.getType(); EntityType type = target.getType();
baseXP = ExperienceConfig.getInstance().getAnimalsXP(type); baseXP = ExperienceConfig.getInstance().getAnimalsXP(type);
} }
@ -590,7 +592,7 @@ public final class CombatUtils {
else else
{ {
baseXP = 1.0; baseXP = 1.0;
mcMMO.getModManager().addCustomEntity(target); //mcMMO.getModManager().addCustomEntity(target);
} }
} }
@ -819,9 +821,9 @@ public final class CombatUtils {
else if (ItemUtils.isDiamondTool(inHand)) { else if (ItemUtils.isDiamondTool(inHand)) {
tier = 4; tier = 4;
} }
else if (mcMMO.getModManager().isCustomTool(inHand)) { /*else if (mcMMO.getModManager().isCustomTool(inHand)) {
tier = mcMMO.getModManager().getTool(inHand).getTier(); tier = mcMMO.getModManager().getTool(inHand).getTier();
} }*/
return tier; return tier;
} }