boolean lastIsBool = ParseUtil.isBool(args[args.length - 1]);
if (lastIsBool) asBreak = ParseUtil.parseBool(args[args.length - 1]);
int count = lastIsBool ? args.length - 1 : args.length;
Set<Material> mats = new HashSet<Material>();
for (int i = 0; i < count; i++) {
Material mat = ParseUtil.parseMaterial(args[i], null);
if (mat != null) {
if (p.hasPermission("train.command.break.admin") || TrainCarts.canBreak(mat)) {
mats.add(mat);
} else {
p.sendMessage(ChatColor.RED + "You are not allowed to make this cart break '" + mat.toString() + "'!");
}
}
}
if (mats.isEmpty()) {
p.sendMessage(ChatColor.RED + "Failed to find possible and allowed block types in the list given.");