mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-31 03:25:28 +02:00
hardcore and vampirism commands were a mistake
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user