mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
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:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user