if (Utils.checkCommandSpam(player, "cex_platform")){
return true;
}
Location loc = (player.getLocation());
// Subtract the Y coords by 1 to get the block at the players feet
loc.setY(loc.getY() - 1);
// If there are no args then set the block below to stone
if (args.length == 0) {
// Check if there is already a block below the player
if (loc.getBlock().getTypeId() == 0) {
LogHelper.showInfo("platformCreated", player, ChatColor.GREEN);
loc.getBlock().setType(Material.STONE);
} else {
LogHelper.showInfo("platformBlockBelow", player, ChatColor.RED);
}
} else if (args.length == 1) {
if (loc.getBlock().getTypeId() == 0) {
List <Material> list = ClosestMatches.material(args[0]);
// If the list is empty then display an error messages
if (list.size() == 0) {
LogHelper.showInfo("platformBlockNotFound", player, ChatColor.RED);
// If the list has one match then set the block to that
} else if (list.size() == 1) {
// Check the player has permission to use the block specified
if (player.hasPermission("cex.platform.block." + list.get(0).getId())){
if (list.get(0).isBlock()){
loc.getBlock().setType(list.get(0));
LogHelper.showInfo("platformCreated", player, ChatColor.GREEN);
} else {
LogHelper.showInfo("platformNotBlock", player, ChatColor.RED);
}
} else {