Package com.bergerkiller.bukkit.mw

Examples of com.bergerkiller.bukkit.mw.WorldConfig


  }

  public void execute() {
    this.genWorldname(1);
    if (this.handleWorld()) {
      WorldConfig wc = WorldConfig.get(worldname);
        if (args.length == 0) {
          String diff = wc.difficulty.toString().toLowerCase();
          message(ChatColor.YELLOW + "Difficulty of world '" + worldname + "' is set at " + ChatColor.WHITE + diff);
        } else {
          Difficulty diff = Conversion.toDifficulty.convert(args[0]);
          if (diff != null) {
          wc.difficulty = diff;
          wc.updateDifficulty(wc.getWorld());
          message(ChatColor.YELLOW + "Difficulty of world '" + worldname + "' set to " + ChatColor.WHITE + diff.toString().toLowerCase());
          } else {
            message(ChatColor.RED + "Difficulty '" + args[0] + "' has not been recognized!");
          }
        }
View Full Code Here


        }
      }
    }
    worldname = WorldManager.getWorldName(sender, args, useWorld);
    if (this.handleWorld()) {
      WorldConfig wc = WorldConfig.get(worldname);
      if (time == -1) {
        World w = WorldManager.getWorld(worldname);
        if (w == null) {
          WorldInfo i = wc.getInfo();
          if (i == null) {
            time = 0;
          } else {
            time = i.time;
          }
        } else {
          time = w.getFullTime();
        }
      }
      if (args.length == 0) {
        message(ChatColor.YELLOW + "The current time of world '" +
            worldname + "' is " + TimeUtil.getTimeString(time));
      } else {
        TimeControl tc = wc.timeControl;
        boolean wasLocked = tc.isLocked();
        tc.setLocking(lock);
        tc.setTime(time);
        if (lock) {
          if (wc.isLoaded()) {
            message(ChatColor.GREEN + "Time of world '" + worldname + "' locked to " +
                TimeUtil.getTimeString(time) + "!");
          } else {
            Localization.WORLD_NOTLOADED.message(sender, worldname);
            message(ChatColor.YELLOW + "Time will be locked to " +
                TimeUtil.getTimeString(time) + " as soon it is loaded!");
          }
        } else {
          World w = wc.getWorld();
          if (w != null) {
            if (wasLocked) {
              message(ChatColor.GREEN + "Time of world '" + worldname + "' unlocked and set to " +
                  TimeUtil.getTimeString(time) + "!");
            } else {
View Full Code Here

          message(msg + ChatColor.YELLOW + mode.name().toLowerCase());
        }
      } else {
        //Parse the gamemode
        GameMode mode = ParseUtil.parseEnum(GameMode.class, args[0], null);
        WorldConfig wc = WorldConfig.get(worldname);
        wc.setGameMode(mode);
        if (mode == null) {
          message(ChatColor.YELLOW + "Game mode of World '" + worldname + "' cleared!");
        } else {
          message(ChatColor.YELLOW + "Game mode of World '" + worldname + "' set to " + mode.name().toLowerCase() + "!");
        }
View Full Code Here

  }

  public void execute() {
    this.genWorldname(1);
    if (this.handleWorld()) {
      WorldConfig wc = WorldConfig.get(worldname);
      if (args.length == 0) {
        // Display
        if (wc.keepSpawnInMemory) {
          message(ChatColor.GREEN + "The spawn area on World: '" + worldname + "' is kept loaded");
        } else {
          message(ChatColor.YELLOW + "The spawn area on World: '" + worldname + "' is not kept loaded");
        }
      } else {
        // Set
        wc.keepSpawnInMemory = ParseUtil.parseBool(args[0]);
        wc.updateKeepSpawnInMemory(wc.getWorld());
        if (wc.keepSpawnInMemory) {
          message(ChatColor.GREEN + "The spawn area on World: '" + worldname + "' is now kept loaded!");
        } else {
          message(ChatColor.YELLOW + "The spawn area on World: '" + worldname + "' is no longer kept loaded!");
        }
View Full Code Here

        //Used the last argument as command?
        if (command == args[args.length - 1]) useWorld = false;
      }
      String worldname = WorldManager.getWorldName(sender, args, useWorld);
      if (worldname != null) {
        WorldConfig wc = WorldConfig.get(worldname);
        World w = wc.getWorld();
        if (w != null) {
          boolean holdchange = wc.holdWeather != setHold;
          wc.holdWeather = setHold;
          if (setStorm && ((!w.hasStorm()) || (setThunder && !w.isThundering()) || holdchange)) {
            MyWorlds.plugin.setWeather(w, true);
View Full Code Here

  public void execute() {
    if (args.length != 0) {
      this.genWorldname(1);
      if (this.handleWorld()) {
        WorldConfig wc = WorldConfig.get(worldname);
        if (ParseUtil.isBool(args[0])) {
          wc.formIce = ParseUtil.parseBool(args[0]);
          if (wc.formIce) {
            message(ChatColor.YELLOW + "Ice will now form on world '" + worldname + "'!");
          } else {
View Full Code Here

 
  public void execute() {
    if (args.length != 0) {
      this.genWorldname(1);
      if (this.handleWorld()) {
        WorldConfig wc = WorldConfig.get(worldname);
        if (ParseUtil.isBool(args[0])) {
          wc.reloadWhenEmpty = ParseUtil.parseBool(args[0]);
          if (wc.reloadWhenEmpty) {
            message(ChatColor.YELLOW + "The world '" + worldname + "' will now reload when it has no players.");
          } else {
View Full Code Here

TOP

Related Classes of com.bergerkiller.bukkit.mw.WorldConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.