mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 11:44:42 +02:00
Added a new Party item share category "Misc" which contains a list of configurable items.
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
package com.gmail.nossr50.config.party;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import com.gmail.nossr50.config.ConfigLoader;
|
||||
@ -30,6 +33,22 @@ public class ItemWeightConfig extends ConfigLoader {
|
||||
return itemWeight;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
if (material != null) {
|
||||
miscItems.add(material);
|
||||
}
|
||||
}
|
||||
return miscItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user