Add option to shake items from player inventories

This commit is contained in:
TfT_02
2014-12-20 23:54:24 +01:00
parent d188224c06
commit d5a2dea06b
3 changed files with 37 additions and 0 deletions

View File

@ -176,6 +176,11 @@ public class TreasureConfig extends ConfigLoader {
else if (materialName.contains("INK_SACK")) {
material = Material.INK_SACK;
}
else if (materialName.contains("INVENTORY")) {
// Use magic material BED_BLOCK to know that we're grabbing something from the inventory and not a normal treasure
shakeFromPlayer.add(new ShakeTreasure(new ItemStack(Material.BED_BLOCK, 1, (byte) 0), 1, getInventoryStealDropChance(), getInventoryStealDropLevel()));
continue;
}
else {
material = Material.matchMaterial(materialName);
}
@ -476,6 +481,11 @@ public class TreasureConfig extends ConfigLoader {
}
}
public boolean getInventoryStealEnabled() { return config.contains("Shake.PLAYER.INVENTORY"); }
public boolean getInventoryStealStacks() { return config.getBoolean("Shake.PLAYER.INVENTORY.Whole_Stacks"); }
public double getInventoryStealDropChance() { return config.getDouble("Shake.PLAYER.INVENTORY.Drop_Chance"); }
public int getInventoryStealDropLevel() { return config.getInt("Shake.PLAYER.INVENTORY.Drop_Level"); }
public double getItemDropRate(int tier, Rarity rarity) { return config.getDouble("Item_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
public double getEnchantmentDropRate(int tier, Rarity rarity) { return config.getDouble("Enchantment_Drop_Rates.Tier_" + tier + "." + rarity.toString()); }
}