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:
NuclearW
2013-02-26 18:46:15 -05:00
parent 18510ba851
commit cbbe436a69
11 changed files with 266 additions and 28 deletions

View File

@ -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;
}
}