1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00
This commit is contained in:
TheBusyBiscuit 2021-01-26 10:35:47 +01:00
parent 9436ce451a
commit 7ffc8aff24
2 changed files with 6 additions and 4 deletions

View File

@ -55,6 +55,7 @@
* Fixed machines not respecting max size from inventories
* Fixed #2761
* Fixed #2460
* Fixed #2760
## Release Candidate 19 (11 Jan 2021)

View File

@ -246,13 +246,14 @@ public class TalismanListener implements Listener {
// Wizard Talisman
if (!enchantments.containsKey(Enchantment.SILK_TOUCH) && Enchantment.LOOT_BONUS_BLOCKS.canEnchantItem(e.getItem()) && Talisman.checkFor(e, SlimefunItems.TALISMAN_WIZARD)) {
for (Enchantment enchantment : enchantments.keySet()) {
if (random.nextInt(100) < 40) {
e.getEnchantsToAdd().put(enchantment, random.nextInt(3) + 1);
// Randomly lower some enchantments
for (Map.Entry<Enchantment, Integer> entry : enchantments.entrySet()) {
if (entry.getValue() > 1 && random.nextInt(100) < 40) {
enchantments.put(entry.getKey(), entry.getValue() - 1);
}
}
// Give an extra Fortune boost (Lvl 3 - 5)
enchantments.put(Enchantment.LOOT_BONUS_BLOCKS, random.nextInt(3) + 3);
}
}