p.sendMessage(ChatColor.RED + "You failed to set any owners: you don't own any carts!");
}
} else if (cmd.equals("pushmobs") || cmd.equals("pushplayers") || cmd.equals("pushmisc")) {
Permission.COMMAND_PUSHING.handle(p);
// Parse a new collision mode to set to
CollisionMode newState = null;
if (args.length == 1) {
newState = CollisionMode.fromPushing(ParseUtil.parseBool(args[0]));
}
String msg = ChatColor.YELLOW + "Pushes away ";
if (cmd.equals("pushmobs")) {
if (newState != null) {
prop.mobCollision = newState;
}
msg += "mobs: " + ChatColor.WHITE + " " + (prop.mobCollision == CollisionMode.PUSH);
}
if (cmd.equals("pushplayers")) {
if (newState != null) {
prop.playerCollision = newState;
}
msg += "players: " + ChatColor.WHITE + " " + (prop.playerCollision == CollisionMode.PUSH);
}
if (cmd.equals("pushmisc")) {
if (newState != null) {
prop.miscCollision = newState;
}
msg += "misc. entities: " + ChatColor.WHITE + " " + (prop.miscCollision == CollisionMode.PUSH);
}
p.sendMessage(msg);
} else if (cmd.equals("slowdown") || cmd.equals("slow") || cmd.equals("setslow") || cmd.equals("setslowdown")) {
Permission.COMMAND_SLOWDOWN.handle(p);
if (args.length == 1) {
prop.setSlowingDown(ParseUtil.parseBool(args[0]));
}
p.sendMessage(ChatColor.YELLOW + "Slow down: " + ChatColor.WHITE + prop.isSlowingDown());
} else if (cmd.equals("setcollide") || cmd.equals("setcollision") || cmd.equals("collision") || cmd.equals("collide")) {
Permission.COMMAND_SETCOLLIDE.handle(p);
if (args.length == 2) {
CollisionMode mode = CollisionMode.parse(args[1]);
if (mode != null) {
String typeName = args[0].toLowerCase();
if (typeName.contains("mob")) {
prop.mobCollision = mode;
p.sendMessage(ChatColor.YELLOW + "When colliding this train " + prop.mobCollision.getOperationName() + " mobs");