mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Update TalismanListener.java
This commit is contained in:
parent
c25a39c955
commit
ef3c1f3d10
@ -161,6 +161,7 @@ public class TalismanListener implements Listener {
|
|||||||
if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && MaterialCollections.getAllOres().contains(e.getBlock().getType()) && Talisman.checkFor(e, (SlimefunItemStack) SlimefunItems.TALISMAN_MINER)) {
|
if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && MaterialCollections.getAllOres().contains(e.getBlock().getType()) && Talisman.checkFor(e, (SlimefunItemStack) SlimefunItems.TALISMAN_MINER)) {
|
||||||
for (ItemStack drop : drops) {
|
for (ItemStack drop : drops) {
|
||||||
if (!drop.getType().isBlock()) {
|
if (!drop.getType().isBlock()) {
|
||||||
|
// Sometimes doubled amount is 0, So make amount at least equals 1
|
||||||
int amount = (fortune * 2) - drop.getAmount() == 0 ? 1 : (fortune * 2) - drop.getAmount();
|
int amount = (fortune * 2) - drop.getAmount() == 0 ? 1 : (fortune * 2) - drop.getAmount();
|
||||||
e.getPlayer().getInventory().addItem(new CustomItem(drop, amount));
|
e.getPlayer().getInventory().addItem(new CustomItem(drop, amount));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user