Package com.bergerkiller.bukkit.mw.commands

Source Code of com.bergerkiller.bukkit.mw.commands.WorldSetForcedRespawn

package com.bergerkiller.bukkit.mw.commands;

import org.bukkit.ChatColor;

import com.bergerkiller.bukkit.common.utils.ParseUtil;
import com.bergerkiller.bukkit.mw.Permission;
import com.bergerkiller.bukkit.mw.WorldConfig;

public class WorldSetForcedRespawn extends Command {

  public WorldSetForcedRespawn() {
    super(Permission.COMMAND_TOGGLERESPAWN, "world.setforcedrespawn");
  }

  public void execute() {
    this.genWorldname(1);
    if (this.handleWorld()) {
      WorldConfig wc = WorldConfig.get(worldname);
      if (args.length > 0) {
        wc.forcedRespawn = ParseUtil.parseBool(args[0]);
      }
      if (wc.forcedRespawn) {
        message(ChatColor.GREEN + "Forced respawning on World: '" + worldname + "' is enabled");
        message(ChatColor.GREEN + "Players will respawn at the world's spawn");
      } else {
        message(ChatColor.YELLOW + "Forced respawning on World: '" + worldname + "' is disabled");
        message(ChatColor.GREEN + "Players will respawn at their bed");
      }
    }
  }
}
TOP

Related Classes of com.bergerkiller.bukkit.mw.commands.WorldSetForcedRespawn

TOP
Copyright © 2018 www.massapi.com. 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.