mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 11:44:42 +02:00
Added party itemShare mode: EQUAL
Slightly cleaner way of handling equal item sharing. Reset the item share modifier back to base when a player leaves the party Added a new config file for the itemWeights Removed the debug messages. Added Lapis_Ore to itemweights.yml Drop the item on the ground if the winningPlayer's inventory is full. Unneccesary Added a feature which allows the party leader to toggle item share categories.... That should be the rest. ItemWeights to Item_Weights
This commit is contained in:
@ -0,0 +1,34 @@
|
||||
package com.gmail.nossr50.config;
|
||||
|
||||
import org.bukkit.Material;
|
||||
|
||||
import com.gmail.nossr50.util.StringUtils;
|
||||
|
||||
public class ItemWeightsConfig extends ConfigLoader {
|
||||
private static ItemWeightsConfig instance;
|
||||
|
||||
private ItemWeightsConfig() {
|
||||
super("itemweights.yml");
|
||||
}
|
||||
|
||||
public static ItemWeightsConfig getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ItemWeightsConfig();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadKeys() {}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user