mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-23 00:31:20 +01:00
Fixed blast mining and lumberjack using durability in creative
This commit is contained in:
parent
3ddc405815
commit
3917f1430c
@ -8,6 +8,7 @@ import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Particle;
|
||||
import org.bukkit.block.Block;
|
||||
@ -93,7 +94,7 @@ public class BlastMining extends EcoEnchant {
|
||||
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
||||
ItemMeta beforeMeta = itemStack.getItemMeta();
|
||||
assert beforeMeta != null;
|
||||
boolean hadUnbreak = beforeMeta.isUnbreakable();
|
||||
boolean hadUnbreak = beforeMeta.isUnbreakable() || player.getGameMode() == GameMode.CREATIVE;
|
||||
beforeMeta.setUnbreakable(true);
|
||||
itemStack.setItemMeta(beforeMeta);
|
||||
int blocks = toBreak.size();
|
||||
|
@ -7,6 +7,7 @@ import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
||||
import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
||||
import com.willfp.ecoenchants.enchantments.meta.EnchantmentType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -59,7 +60,7 @@ public class Lumberjack extends EcoEnchant {
|
||||
ItemStack itemStack = player.getInventory().getItemInMainHand();
|
||||
ItemMeta beforeMeta = itemStack.getItemMeta();
|
||||
assert beforeMeta != null;
|
||||
boolean hadUnbreak = beforeMeta.isUnbreakable();
|
||||
boolean hadUnbreak = beforeMeta.isUnbreakable() || player.getGameMode() == GameMode.CREATIVE;
|
||||
beforeMeta.setUnbreakable(true);
|
||||
itemStack.setItemMeta(beforeMeta);
|
||||
int blocks = treeBlocks.size();
|
||||
|
Loading…
Reference in New Issue
Block a user