Package com.massivecraft.mcore.mcorecmd

Source Code of com.massivecraft.mcore.mcorecmd.CmdMCoreUsysMultiverseDel

package com.massivecraft.mcore.mcorecmd;

import java.util.List;

import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;

public class CmdMCoreUsysMultiverseDel extends MCoreCommand
{
  public CmdMCoreUsysMultiverseDel(List<String> aliases)
  {
    super(aliases);
    this.addRequiredArg("multiverse");
   
    this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_DEL.node));
  }
 
  @Override
  public void perform()
  {
    Multiverse multiverse = this.arg(0, ARMultiverse.get());
    if (multiverse == null) return;
   
    String id = multiverse.getId();
   
    if (id.equals(MCore.DEFAULT))
    {
      msg("<b>You can't delete the default multiverse.");
      return;
    }
   
    multiverse.detach();
   
    msg("<g>Deleted multiverse <h>%s<g>.", id);
  }
}
TOP

Related Classes of com.massivecraft.mcore.mcorecmd.CmdMCoreUsysMultiverseDel

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.