&& !plugin.getItemAPI().isTool(event.getResult().getType()))
return;
ItemStack is = plugin.furnanceMap.remove(event.getBlock());
if (is == null)
return;
Material fuel = is.getType();
if (!is.hasItemMeta() || !is.getItemMeta().hasDisplayName())
return;
ChatColor fuelColor = findColor(is.getItemMeta().getDisplayName());
ItemStack tool = event.getResult();
ItemStack oldtool = event.getSource();
ItemMeta metaold;
if (oldtool.hasItemMeta())
metaold = oldtool.getItemMeta();
else
metaold = Bukkit.getItemFactory().getItemMeta(oldtool.getType());
if (!metaold.hasLore()) {
event.setCancelled(true);
event.setResult(oldtool);
return;
}
boolean namTest = false;
for (String n : metaold.getLore())
if (ChatColor.stripColor(n).equalsIgnoreCase("(Socket)")) {
namTest = true;
}
if (!namTest) {
event.setResult(event.getSource());
return;
}
tool.addUnsafeEnchantments(oldtool.getEnchantments());
ItemMeta meta = tool.getItemMeta();
if (fuel.equals(Material.SKULL_ITEM)) {
ChatColor color = ChatColor.WHITE;
if (metaold.hasDisplayName())
color = findColor(metaold.getDisplayName());
SkullMeta skull = (SkullMeta) is.getItemMeta();
String skullName = skull.getOwner();