mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Add option to shake items from player inventories
This commit is contained in:
@ -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()); }
|
||||
}
|
||||
|
Reference in New Issue
Block a user