mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 11:44:42 +02:00
Clean up a bit, and make the /party itemshare command recognize the new
"misc" option
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package com.gmail.nossr50.config.party;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
@ -24,23 +23,14 @@ public class ItemWeightConfig extends ConfigLoader {
|
||||
}
|
||||
|
||||
public int getItemWeight(Material material) {
|
||||
String materialName = StringUtils.getPrettyItemString(material).replace(" ", "_");
|
||||
int itemWeight = config.getInt("Item_Weights.Default");
|
||||
|
||||
if (config.getInt("Item_Weights." + materialName) > 0) {
|
||||
itemWeight = config.getInt("Item_Weights." + materialName);
|
||||
}
|
||||
return itemWeight;
|
||||
return config.getInt("Item_Weights." + StringUtils.getPrettyItemString(material).replace(" ", "_"), config.getInt("Item_Weights.Default"));
|
||||
}
|
||||
|
||||
public HashSet<Material> getMiscItems() {
|
||||
HashSet<Material> miscItems = new HashSet<Material>();
|
||||
|
||||
List<String> itemList = config.getStringList("Party_Shareables.Misc_Items");
|
||||
|
||||
for (String item : itemList) {
|
||||
String materialName = item.toUpperCase();
|
||||
Material material = Material.getMaterial(materialName);
|
||||
for (String item : config.getStringList("Party_Shareables.Misc_Items")) {
|
||||
Material material = Material.getMaterial(item.toUpperCase());
|
||||
|
||||
if (material != null) {
|
||||
miscItems.add(material);
|
||||
|
Reference in New Issue
Block a user