Code cleanup part 1

This commit is contained in:
nossr50
2019-04-02 23:28:12 -07:00
parent ecce631527
commit d2faac3b0d
33 changed files with 522 additions and 712 deletions

View File

@ -1,19 +1,19 @@
package com.gmail.nossr50.config;
import java.io.File;
/**
* Represents a config file that registers keys after its initialized
*/
public abstract class ConfigCollections extends Config implements RegistersKeys, ConfigCollection {
public ConfigCollections(String pathToParentFolder, String relativePath, boolean mergeNewKeys) {
super(pathToParentFolder, relativePath, mergeNewKeys);
loadKeys();
}
public ConfigCollections(File pathToParentFolder, String relativePath, boolean mergeNewKeys) {
super(pathToParentFolder, relativePath, mergeNewKeys);
loadKeys();
}
}
//package com.gmail.nossr50.config;
//
//import java.io.File;
//
///**
// * Represents a config file that registers keys after its initialized
// */
//public abstract class ConfigCollections extends Config implements RegistersKeys, ConfigCollection {
//
// public ConfigCollections(String pathToParentFolder, String relativePath, boolean mergeNewKeys) {
// super(pathToParentFolder, relativePath, mergeNewKeys);
// loadKeys();
// }
//
// public ConfigCollections(File pathToParentFolder, String relativePath, boolean mergeNewKeys) {
// super(pathToParentFolder, relativePath, mergeNewKeys);
// loadKeys();
// }
//}

View File

@ -380,8 +380,8 @@ public final class ConfigManager {
public void registerBonusDrops()
{
bonusDropManager.addToWhitelistByNameID(getConfigMining().getBonusDrops());
bonusDropManager.addToWhitelistByNameID(configHerbalism.getBonusDrops());
bonusDropManager.addToWhitelistByNameID(configWoodcutting.getBonusDrops());
// bonusDropManager.addToWhitelistByNameID(configHerbalism.getBonusDrops());
// bonusDropManager.addToWhitelistByNameID(configWoodcutting.getBonusDrops());
}
public void validateConfigs()
@ -598,6 +598,17 @@ public final class ConfigManager {
return bonusDropManager;
}
/**
* Checks if this plugin is using retro mode
* Retro mode is a 0-1000 skill system
* Standard mode is scaled for 1-100
* @return true if retro mode is enabled
*/
public boolean isRetroMode()
{
return getConfigLeveling().getConfigSectionLevelingGeneral().getConfigSectionLevelScaling().isRetroModeEnabled();
}
public boolean isBonusDropsEnabled(Material material)
{
return getBonusDropManager().isBonusDropWhitelisted(material);