Adds optional ability to reforge anvils #15
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
All checks were successful
EpicKnarvik97/Blacksmith/pipeline/head This commit looks good
This commit is contained in:
@ -6,6 +6,7 @@ import net.knarcraft.blacksmith.config.NPCSettings;
|
||||
import net.knarcraft.blacksmith.manager.EconomyManager;
|
||||
import net.knarcraft.blacksmith.util.InputParsingHelper;
|
||||
import net.knarcraft.blacksmith.util.ItemHelper;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -129,6 +130,11 @@ public class ReforgeSession implements Runnable {
|
||||
// Remove any damage done to the item
|
||||
updateDamage(itemToReforge, 0);
|
||||
|
||||
//Replace damaged anvils with a normal anvil
|
||||
if (ItemHelper.isAnvil(itemToReforge.getType(), true)) {
|
||||
itemToReforge.setType(Material.ANVIL);
|
||||
}
|
||||
|
||||
// Add random enchantments
|
||||
int roll = random.nextInt(100);
|
||||
if (!(roll < config.getExtraEnchantmentChance() &&
|
||||
|
Reference in New Issue
Block a user