From 4415b52986968098a58f05ce255b5f4f7779c471 Mon Sep 17 00:00:00 2001 From: Acrobot Date: Fri, 8 Feb 2013 19:34:26 +0100 Subject: [PATCH] A bit of optimalization --- com/Acrobot/Breeze/Utils/MaterialUtil.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/com/Acrobot/Breeze/Utils/MaterialUtil.java b/com/Acrobot/Breeze/Utils/MaterialUtil.java index 2cdf97f..b0a02f2 100644 --- a/com/Acrobot/Breeze/Utils/MaterialUtil.java +++ b/com/Acrobot/Breeze/Utils/MaterialUtil.java @@ -178,7 +178,7 @@ public class MaterialUtil { } else { Map enchantments = getEnchantments(itemName); //TODO - it's obsolete, left only for backward compatibility - if (!enchantments.isEmpty()) { + if (enchantments != null) { try { itemStack.addEnchantments(enchantments); } catch (IllegalArgumentException exception) { @@ -225,7 +225,7 @@ public class MaterialUtil { Matcher m = ENCHANTMENT.matcher(itemName); if (!m.find()) { - return new HashMap(); + return null; } String group = m.group().substring(1);