hardcore and vampirism commands were a mistake

This commit is contained in:
nossr50
2019-02-18 15:17:35 -08:00
parent 9f9b456b0a
commit 4bb513c2d1
11 changed files with 84 additions and 328 deletions

View File

@@ -1,6 +1,7 @@
package com.gmail.nossr50.config.party;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.MainConfig;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.util.StringUtils;
import org.bukkit.Material;
@@ -8,29 +9,59 @@ import org.bukkit.Material;
import java.util.HashSet;
public class ItemWeightConfig extends Config {
public static final String ITEM_WEIGHTS = "Item_Weights";
public static final String DEFAULT = "Default";
public static final String PARTY_SHAREABLES = "Party_Shareables";
public static final String MISC_ITEMS = "Misc_Items";
private static ItemWeightConfig instance;
private ItemWeightConfig() {
public ItemWeightConfig() {
//super(McmmoCore.getDataFolderPath().getAbsoluteFile(), "itemweights.yml");
super(mcMMO.p.getDataFolder().getAbsoluteFile(), "itemweights.yml");
super(mcMMO.p.getDataFolder().getAbsoluteFile(), "itemweights.yml", true);
}
/**
* This grabs an instance of this config class from the Config Manager
* This method is deprecated and will be removed in the future
* @see mcMMO#getConfigManager()
* @return the instance of this config
* @deprecated Please use mcMMO.getConfigManager() to grab a specific config instead
*/
@Deprecated
public static ItemWeightConfig getInstance() {
return mcMMO.getConfigManager().getIte();
}
/**
* The version of this config
*
* @return
*/
@Override
public double getConfigVersion() {
return 1;
}
/*public static ItemWeightConfig getInstance() {
if (instance == null) {
instance = new ItemWeightConfig();
}
return instance;
}
}*/
public int getItemWeight(Material material) {
return getIntValue("Item_Weights." + StringUtils.getPrettyItemString(material).replace(" ", "_"), getIntValue("Item_Weights.Default"));
String[] keyPath = {ITEM_WEIGHTS, StringUtils.getPrettyItemString(material).replace(" ", "_")};
if(hasNode(keyPath))
return getIntValue(keyPath);
else
return getIntValue(ITEM_WEIGHTS, DEFAULT);
}
public HashSet<Material> getMiscItems() {
HashSet<Material> miscItems = new HashSet<Material>();
for (String item : getStringValueList("Party_Shareables.Misc_Items")) {
for (String item : getStringValueList(PARTY_SHAREABLES, MISC_ITEMS)) {
Material material = Material.getMaterial(item.toUpperCase());
if (material != null) {