Esempio n. 1
0
  @Command(
      aliases = {"/walls"},
      usage = "<block>",
      desc = "Build the four sides of the selection",
      min = 1,
      max = 1)
  @CommandPermissions("worldedit.region.walls")
  @Logging(REGION)
  public static void walls(
      CommandContext args,
      WorldEdit we,
      LocalSession session,
      LocalPlayer player,
      EditSession editSession)
      throws WorldEditException {

    Pattern pattern = we.getBlockPattern(player, args.getString(0));
    int affected;
    if (pattern instanceof SingleBlockPattern) {
      affected =
          editSession.makeCuboidWalls(
              session.getSelection(player.getWorld()), ((SingleBlockPattern) pattern).getBlock());
    } else {
      affected = editSession.makeCuboidWalls(session.getSelection(player.getWorld()), pattern);
    }

    player.print(affected + " block(s) have been changed.");
  }