} else if (parts[0].equalsIgnoreCase("Mob")) {
String testMob = parts[1];
return test.getType().toString().equalsIgnoreCase(testMob);
} else if (minecart instanceof StorageMinecart && parts[0].equalsIgnoreCase("Ctns")) {
StorageMinecart storageCart = (StorageMinecart) minecart;
Inventory storageInventory = storageCart.getInventory();
if (parts.length == 4) {
try {
int item = Integer.parseInt(parts[1]);
short durability = Short.parseShort(parts[2]);
int index = Math.min(Math.max(Integer.parseInt(parts[3]) - 1, 0),
storageInventory.getContents().length - 1);
ItemStack indexed = storageInventory.getContents()[index];
if (indexed != null && indexed.equals(new ItemStack(item, 1, durability))) return true;
} catch (NumberFormatException ignored) {
}
} else if (parts.length == 3) {
try {
int item = Integer.parseInt(parts[1]);
short durability = Short.parseShort(parts[2]);
if (storageInventory.contains(new ItemStack(item, 1, durability))) return true;
} catch (NumberFormatException ignored) {
}
} else if (parts[1].equalsIgnoreCase("!")) {
for (ItemStack item : storageInventory.getContents()) {
if (item != null) {
return false;
}
}
return true;
} else {
try {
int item = Integer.parseInt(parts[1]);
if (storageInventory.contains(item)) return true;
} catch (NumberFormatException ignored) {
}
}
}
if (line.startsWith("#")) {