Because we need to care about the result, not the source.

Also adds a couple of null checks, just to be safe.
This commit is contained in:
GJ
2013-01-23 23:09:54 -05:00
parent a8b5b438bf
commit a01882aea5
2 changed files with 30 additions and 3 deletions

View File

@ -1,5 +1,6 @@
package com.gmail.nossr50.util;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -490,4 +491,26 @@ public class ItemChecks {
return false;
}
}
public static boolean isSmelted(ItemStack itemStack) {
switch (itemStack.getType()) {
case COAL:
case DIAMOND:
case REDSTONE:
case GOLD_INGOT:
case IRON_INGOT:
case EMERALD:
return true;
case INK_SACK:
if (itemStack.getData().getData() == DyeColor.BLUE.getDyeData()) {
return true;
}
return false;
default:
return false;
}
}
}