@Override
public boolean canApplyAtEnchantingTable(ItemStack stack) {
if (type == BetterStorageEnchantment.getType("key")) {
IKey key = (stack.getItem() instanceof IKey ? (IKey)stack.getItem() : null);
return ((key != null) && key.canApplyEnchantment(stack, this));
} else if (type == BetterStorageEnchantment.getType("lock")) {
ILock lock = (stack.getItem() instanceof ILock ? (ILock)stack.getItem() : null);
return ((lock != null) && lock.canApplyEnchantment(stack, this));
} else return false;
}