Reorganizing MCore internal commands and permissions.

This commit is contained in:
Olof Larsson 2013-05-01 12:29:51 +02:00
parent a3d99f627f
commit b64e8a8b77
28 changed files with 367 additions and 325 deletions

View File

@ -6,68 +6,51 @@ permissions:
# -------------------------------------------- # # -------------------------------------------- #
# THE REAL NODES # THE REAL NODES
# -------------------------------------------- # # -------------------------------------------- #
# usys command # cmd
mcore.cmd.usys: {description: manage the universe system, default: false}
mcore.cmd.usys.multiverse: {description: manage multiverses, default: false}
mcore.cmd.usys.multiverse.list: {description: list multiverses, default: false}
mcore.cmd.usys.multiverse.show: {description: show multiverse, default: false}
mcore.cmd.usys.multiverse.new: {description: create new multiverse, default: false}
mcore.cmd.usys.multiverse.del: {description: delete multiverse, default: false}
mcore.cmd.usys.universe: {description: manage universes, default: false}
mcore.cmd.usys.universe.new: {description: create new universe in multiverse, default: false}
mcore.cmd.usys.universe.del: {description: delete universe in multiverse, default: false}
mcore.cmd.usys.universe.clear: {description: clear universe in multiverse, default: false}
mcore.cmd.usys.world: {description: set a worlds universe in a multiverse, default: false}
mcore.cmd.usys.aspect: {description: manage aspects, default: false}
mcore.cmd.usys.aspect.list: {description: list aspects, default: false}
mcore.cmd.usys.aspect.show: {description: show aspect, default: false}
mcore.cmd.usys.aspect.use: {description: set multiverse for aspect, default: false}
# mcore command
mcore.cmd.mcore: {description: use the mcore command, default: false} mcore.cmd.mcore: {description: use the mcore command, default: false}
mcore.cmd.mcore.id: {description: see the server id, default: false}
mcore.cmd.mcore.version: {description: diplay plugin version, default: false}
mcore.cmd.mcore.usys: {description: manage the universe system, default: false}
mcore.cmd.mcore.usys.multiverse: {description: manage multiverses, default: false}
mcore.cmd.mcore.usys.multiverse.list: {description: list multiverses, default: false}
mcore.cmd.mcore.usys.multiverse.show: {description: show multiverse, default: false}
mcore.cmd.mcore.usys.multiverse.new: {description: create new multiverse, default: false}
mcore.cmd.mcore.usys.multiverse.del: {description: delete multiverse, default: false}
mcore.cmd.mcore.usys.universe: {description: manage universes, default: false}
mcore.cmd.mcore.usys.universe.new: {description: create new universe in multiverse, default: false}
mcore.cmd.mcore.usys.universe.del: {description: delete universe in multiverse, default: false}
mcore.cmd.mcore.usys.universe.clear: {description: clear universe in multiverse, default: false}
mcore.cmd.mcore.usys.world: {description: set a worlds universe in a multiverse, default: false}
mcore.cmd.mcore.usys.aspect: {description: manage aspects, default: false}
mcore.cmd.mcore.usys.aspect.list: {description: list aspects, default: false}
mcore.cmd.mcore.usys.aspect.show: {description: show aspect, default: false}
mcore.cmd.mcore.usys.aspect.use: {description: set multiverse for aspect, default: false}
# misc # misc
mcore.notpdelay: {description: teleport without delay, default: false} mcore.notpdelay: {description: teleport without delay, default: false}
# -------------------------------------------- # # -------------------------------------------- #
# STAR NOTATION # STAR NOTATION
# -------------------------------------------- # # -------------------------------------------- #
mcore.cmd.usys.multiverse.*:
default: false
children:
mcore.cmd.usys.multiverse.list: true
mcore.cmd.usys.multiverse.show: true
mcore.cmd.usys.multiverse.new: true
mcore.cmd.usys.multiverse.del: true
mcore.cmd.usys.universe.*:
default: false
children:
mcore.cmd.usys.universe.new: true
mcore.cmd.usys.universe.del: true
mcore.cmd.usys.universe.clear: true
mcore.cmd.usys.aspect.*:
default: false
children:
mcore.cmd.usys.aspect.list: true
mcore.cmd.usys.aspect.show: true
mcore.cmd.usys.aspect.use: true
mcore.cmd.usys.*:
default: false
children:
mcore.cmd.usys.multiverse: true
mcore.cmd.usys.multiverse.*: true
mcore.cmd.usys.universe: true
mcore.cmd.usys.universe.*: true
mcore.cmd.usys.world: true
mcore.cmd.usys.aspect: true
mcore.cmd.usys.aspect.*: true
mcore.cmd.*:
default: false
children:
mcore.cmd.usys: true
mcore.cmd.usys.*: true
mcore.cmd.mcore: true
mcore.*: mcore.*:
default: false default: false
children: children:
mcore.cmd.*: true mcore.cmd.mcore: true
mcore.cmd.mcore.id: true
mcore.cmd.mcore.version: true
mcore.cmd.mcore.usys: true
mcore.cmd.mcore.usys.multiverse: true
mcore.cmd.mcore.usys.multiverse.list: true
mcore.cmd.mcore.usys.multiverse.show: true
mcore.cmd.mcore.usys.multiverse.new: true
mcore.cmd.mcore.usys.multiverse.del: true
mcore.cmd.mcore.usys.universe: true
mcore.cmd.mcore.usys.universe.new: true
mcore.cmd.mcore.usys.universe.del: true
mcore.cmd.mcore.usys.universe.clear: true
mcore.cmd.mcore.usys.world: true
mcore.cmd.mcore.usys.aspect: true
mcore.cmd.mcore.usys.aspect.list: true
mcore.cmd.mcore.usys.aspect.show: true
mcore.cmd.mcore.usys.aspect.use: true
mcore.notpdelay: true mcore.notpdelay: true
# -------------------------------------------- # # -------------------------------------------- #
# KITS # KITS
@ -76,15 +59,33 @@ permissions:
default: op default: op
children: children:
mcore.*: true mcore.*: true
mcore.kit.readonly: mcore.kit.rank3:
default: false default: false
children: children:
mcore.cmd.usys: true mcore.kit.rank2: true
mcore.cmd.usys.multiverse: true mcore.kit.rank2:
mcore.cmd.usys.multiverse.list: true default: false
mcore.cmd.usys.multiverse.show: true children:
mcore.cmd.usys.universe: true mcore.kit.rank1: true
mcore.cmd.usys.aspect: true mcore.kit.rank1:
mcore.cmd.usys.aspect.list: true default: false
mcore.cmd.usys.aspect.show: true children:
mcore.kit.rank0: true
mcore.cmd.mcore: true mcore.cmd.mcore: true
mcore.cmd.mcore.id: true
mcore.cmd.mcore.version: true
mcore.cmd.mcore.usys: true
mcore.cmd.mcore.usys.multiverse: true
mcore.cmd.mcore.usys.multiverse.list: true
mcore.cmd.mcore.usys.multiverse.show: true
mcore.cmd.mcore.usys.aspect: true
mcore.cmd.mcore.usys.aspect.list: true
mcore.cmd.mcore.usys.aspect.show: true
mcore.notpdelay: true
mcore.kit.rank0:
default: false
children:
massivechat.kit.default:
default: true
children:
massivechat.kit.rank0: true

View File

@ -1,13 +1,11 @@
package com.massivecraft.mcore; package com.massivecraft.mcore;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID; import java.util.UUID;
import com.massivecraft.mcore.mcorecmd.CmdMcore;
import com.massivecraft.mcore.mcorecmd.CmdUsys;
import com.massivecraft.mcore.util.MUtil; import com.massivecraft.mcore.util.MUtil;
public class ConfServer extends SimpleConfig public class ConfServer extends SimpleConfig
{ {
// -------------------------------------------- // // -------------------------------------------- //
@ -22,23 +20,10 @@ public class ConfServer extends SimpleConfig
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
public static String serverid = UUID.randomUUID().toString();
public static String dburi = "gson://./mstore"; public static String dburi = "gson://./mstore";
public static String serverid = UUID.randomUUID().toString(); public static List<String> aliasesOuterMCore = MUtil.list("mcore");
public static List<String> aliasesOuterMCoreUsys = MUtil.list("usys");
public static Map<String, List<String>> cmdaliases = MUtil.map(
CmdUsys.USYS, MUtil.list(CmdUsys.USYS),
CmdMcore.MCORE, MUtil.list(CmdMcore.MCORE)
);
public static List<String> getCmdAliases(String name)
{
List<String> ret = cmdaliases.get(name);
if (ret == null)
{
ret = MUtil.list(name);
cmdaliases.put(name, ret);
i.save();
}
return ret;
}
} }

View File

@ -19,8 +19,8 @@ import com.massivecraft.mcore.adapter.PlayerInventoryAdapter;
import com.massivecraft.mcore.adapter.UUIDAdapter; import com.massivecraft.mcore.adapter.UUIDAdapter;
import com.massivecraft.mcore.integration.protocollib.ProtocolLibFeatures; import com.massivecraft.mcore.integration.protocollib.ProtocolLibFeatures;
import com.massivecraft.mcore.integration.vault.VaultFeatures; import com.massivecraft.mcore.integration.vault.VaultFeatures;
import com.massivecraft.mcore.mcorecmd.CmdMcore; import com.massivecraft.mcore.mcorecmd.CmdMCore;
import com.massivecraft.mcore.mcorecmd.CmdUsys; import com.massivecraft.mcore.mcorecmd.CmdMCoreUsys;
import com.massivecraft.mcore.mixin.ScheduledTeleportEngine; import com.massivecraft.mcore.mixin.ScheduledTeleportEngine;
import com.massivecraft.mcore.mixin.SenderIdMixinDefault; import com.massivecraft.mcore.mixin.SenderIdMixinDefault;
import com.massivecraft.mcore.mixin.TeleportMixinCauseEngine; import com.massivecraft.mcore.mixin.TeleportMixinCauseEngine;
@ -83,16 +83,20 @@ public class MCore extends MPlugin
// FIELDS // FIELDS
// -------------------------------------------- // // -------------------------------------------- //
// Commands
public CmdUsys cmdUsys;
public CmdMcore cmdMcore;
// Aspects // Aspects
private Aspect moneyAspect; private Aspect moneyAspect;
public Aspect getMoneyAspect() { return this.moneyAspect; } public Aspect getMoneyAspect() { return this.moneyAspect; }
public Multiverse getMoneyMultiverse() { return this.getMoneyAspect().getMultiverse(); } public Multiverse getMoneyMultiverse() { return this.getMoneyAspect().getMultiverse(); }
// Commands
private CmdMCore outerCmdMCore;
public CmdMCore getOuterCmdMCore() { return this.outerCmdMCore; }
private CmdMCoreUsys outerCmdMCoreUsys;
public CmdMCoreUsys getOuterCmdMCoreUsys() { return this.outerCmdMCoreUsys; }
// Runnables // Runnables
// TODO: Make this one a singleton
private Runnable collTickTask = new Runnable() private Runnable collTickTask = new Runnable()
{ {
public void run() public void run()
@ -152,11 +156,11 @@ public class MCore extends MPlugin
); );
// Register commands // Register commands
this.cmdUsys = new CmdUsys(); this.outerCmdMCore = new CmdMCore(ConfServer.aliasesOuterMCore);
this.cmdUsys.register(this, true); this.outerCmdMCore.register(this);
this.cmdMcore = new CmdMcore(); this.outerCmdMCoreUsys = new CmdMCoreUsys(ConfServer.aliasesOuterMCoreUsys);
this.cmdMcore.register(this, true); this.outerCmdMCoreUsys.register(this);
// Integration // Integration
this.integrate( this.integrate(

View File

@ -10,22 +10,25 @@ public enum MCorePerm
// ENUM // ENUM
// -------------------------------------------- // // -------------------------------------------- //
CMD_USYS("cmd.usys"),
CMD_USYS_MULTIVERSE("cmd.usys.multiverse"),
CMD_USYS_MULTIVERSE_LIST("cmd.usys.multiverse.list"),
CMD_USYS_MULTIVERSE_SHOW("cmd.usys.multiverse.show"),
CMD_USYS_MULTIVERSE_NEW("cmd.usys.multiverse.new"),
CMD_USYS_MULTIVERSE_DEL("cmd.usys.multiverse.del"),
CMD_USYS_UNIVERSE("cmd.usys.universe"),
CMD_USYS_UNIVERSE_NEW("cmd.usys.universe.new"),
CMD_USYS_UNIVERSE_DEL("cmd.usys.universe.del"),
CMD_USYS_UNIVERSE_CLEAR("cmd.usys.universe.clear"),
CMD_USYS_WORLD("cmd.usys.world"),
CMD_USYS_ASPECT("cmd.usys.aspect"),
CMD_USYS_ASPECT_LIST("cmd.usys.aspect.list"),
CMD_USYS_ASPECT_SHOW("cmd.usys.aspect.show"),
CMD_USYS_ASPECT_USE("cmd.usys.aspect.use"),
CMD_MCORE("cmd.mcore"), CMD_MCORE("cmd.mcore"),
CMD_MCORE_ID("cmd.mcore.id"),
CMD_MCORE_VERSION("cmd.mcore.version"),
CMD_MCORE_USYS("cmd.mcore.usys"),
CMD_MCORE_USYS_MULTIVERSE("cmd.mcore.usys.multiverse"),
CMD_MCORE_USYS_MULTIVERSE_LIST("cmd.mcore.usys.multiverse.list"),
CMD_MCORE_USYS_MULTIVERSE_SHOW("cmd.mcore.usys.multiverse.show"),
CMD_MCORE_USYS_MULTIVERSE_NEW("cmd.mcore.usys.multiverse.new"),
CMD_MCORE_USYS_MULTIVERSE_DEL("cmd.mcore.usys.multiverse.del"),
CMD_MCORE_USYS_UNIVERSE("cmd.mcore.usys.universe"),
CMD_MCORE_USYS_UNIVERSE_NEW("cmd.mcore.usys.universe.new"),
CMD_MCORE_USYS_UNIVERSE_DEL("cmd.mcore.usys.universe.del"),
CMD_MCORE_USYS_UNIVERSE_CLEAR("cmd.mcore.usys.universe.clear"),
CMD_MCORE_USYS_WORLD("cmd.mcore.usys.world"),
CMD_MCORE_USYS_ASPECT("cmd.mcore.usys.aspect"),
CMD_MCORE_USYS_ASPECT_LIST("cmd.mcore.usys.aspect.list"),
CMD_MCORE_USYS_ASPECT_SHOW("cmd.mcore.usys.aspect.show"),
CMD_MCORE_USYS_ASPECT_USE("cmd.mcore.usys.aspect.use"),
NOTPDELAY("notpdelay"), NOTPDELAY("notpdelay"),
// END OF LIST // END OF LIST

View File

@ -36,7 +36,7 @@ public class ARAspect extends ARAbstractSelect<Aspect>
@Override @Override
public boolean canList(CommandSender sender) public boolean canList(CommandSender sender)
{ {
return MCorePerm.CMD_USYS_ASPECT_LIST.has(sender, false); return MCorePerm.CMD_MCORE_USYS_ASPECT_LIST.has(sender, false);
} }
@Override @Override

View File

@ -36,7 +36,7 @@ public class ARMultiverse extends ARAbstractSelect<Multiverse>
@Override @Override
public boolean canList(CommandSender sender) public boolean canList(CommandSender sender)
{ {
return MCorePerm.CMD_USYS_MULTIVERSE_LIST.has(sender, false); return MCorePerm.CMD_MCORE_USYS_MULTIVERSE_LIST.has(sender, false);
} }
@Override @Override

View File

@ -0,0 +1,22 @@
package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.ConfServer;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdMCoreId extends MCoreCommand
{
public CmdMCoreId(List<String> aliases)
{
super(aliases);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_ID.node));
}
@Override
public void perform()
{
this.msg("<i>The id of this server is \"<h>%s<i>\".", ConfServer.serverid);
}
}

View File

@ -0,0 +1,35 @@
package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.MUtil;
public class CmdMCoreUsys extends MCoreCommand
{
public CmdMCoreUsysMultiverse cmdUsysMultiverse = new CmdMCoreUsysMultiverse(MUtil.list("m", "multiverse"));
public CmdMCoreUsysUniverse cmdUsysUniverse = new CmdMCoreUsysUniverse(MUtil.list("u", "universe"));
public CmdMCoreUsysWorld cmdUsysWorld = new CmdMCoreUsysWorld(MUtil.list("w", "world"));
public CmdMCoreUsysAspect cmdUsysAspect = new CmdMCoreUsysAspect(MUtil.list("a", "aspect"));
public CmdMCoreUsys(List<String> aliases)
{
super(aliases);
this.addSubCommand(this.cmdUsysMultiverse);
this.addSubCommand(this.cmdUsysUniverse);
this.addSubCommand(this.cmdUsysWorld);
this.addSubCommand(this.cmdUsysAspect);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -0,0 +1,33 @@
package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.MUtil;
public class CmdMCoreUsysAspect extends MCoreCommand
{
public CmdMCoreUsysAspectList cmdUsysAspectList = new CmdMCoreUsysAspectList(MUtil.list("l", "list"));
public CmdMCoreUsysAspectShow cmdUsysAspectShow = new CmdMCoreUsysAspectShow(MUtil.list("s", "show"));
public CmdMCoreUsysAspectUse cmdUsysAspectUse = new CmdMCoreUsysAspectUse(MUtil.list("u", "use"));
public CmdMCoreUsysAspect(List<String> aliases)
{
super(aliases);
this.addSubCommand(this.cmdUsysAspectList);
this.addSubCommand(this.cmdUsysAspectShow);
this.addSubCommand(this.cmdUsysAspectUse);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -6,19 +6,18 @@ import java.util.List;
import com.massivecraft.mcore.Aspect; import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.AspectColl; import com.massivecraft.mcore.AspectColl;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARInteger; import com.massivecraft.mcore.cmd.arg.ARInteger;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.util.Txt;
public class CmdUsysAspectList extends MCommand public class CmdMCoreUsysAspectList extends MCoreCommand
{ {
public CmdUsysAspectList() public CmdMCoreUsysAspectList(List<String> aliases)
{ {
this.addAliases("l", "list"); super(aliases);
this.addOptionalArg("page", "1"); this.addOptionalArg("page", "1");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_ASPECT_LIST.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT_LIST.node));
} }
@Override @Override

View File

@ -1,20 +1,21 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.Aspect; import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARAspect; import com.massivecraft.mcore.cmd.arg.ARAspect;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.util.Txt;
public class CmdUsysAspectShow extends MCommand public class CmdMCoreUsysAspectShow extends MCoreCommand
{ {
public CmdUsysAspectShow() public CmdMCoreUsysAspectShow(List<String> aliases)
{ {
this.addAliases("s", "show"); super(aliases);
this.addRequiredArg("aspect"); this.addRequiredArg("aspect");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_ASPECT_SHOW.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT_SHOW.node));
} }
@Override @Override

View File

@ -1,22 +1,23 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.Aspect; import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARAspect; import com.massivecraft.mcore.cmd.arg.ARAspect;
import com.massivecraft.mcore.cmd.arg.ARMultiverse; import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysAspectUse extends MCommand public class CmdMCoreUsysAspectUse extends MCoreCommand
{ {
public CmdUsysAspectUse() public CmdMCoreUsysAspectUse(List<String> aliases)
{ {
this.addAliases("u", "use"); super(aliases);
this.addRequiredArg("aspect"); this.addRequiredArg("aspect");
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_ASPECT_USE.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_ASPECT_USE.node));
} }
@Override @Override

View File

@ -0,0 +1,35 @@
package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.MUtil;
public class CmdMCoreUsysMultiverse extends MCoreCommand
{
public CmdMCoreUsysMultiverseList cmdUsysMultiverseList = new CmdMCoreUsysMultiverseList(MUtil.list("l", "list"));
public CmdMCoreUsysMultiverseShow cmdUsysMultiverseShow = new CmdMCoreUsysMultiverseShow(MUtil.list("s", "show"));
public CmdMCoreUsysMultiverseNew cmdUsysMultiverseNew = new CmdMCoreUsysMultiverseNew(MUtil.list("n", "new"));
public CmdMCoreUsysMultiverseDel cmdUsysMultiverseDel = new CmdMCoreUsysMultiverseDel(MUtil.list("d", "del"));
public CmdMCoreUsysMultiverse(List<String> aliases)
{
super(aliases);
this.addSubCommand(this.cmdUsysMultiverseList);
this.addSubCommand(this.cmdUsysMultiverseShow);
this.addSubCommand(this.cmdUsysMultiverseNew);
this.addSubCommand(this.cmdUsysMultiverseDel);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -1,20 +1,21 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARMultiverse; import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysMultiverseDel extends MCommand public class CmdMCoreUsysMultiverseDel extends MCoreCommand
{ {
public CmdUsysMultiverseDel() public CmdMCoreUsysMultiverseDel(List<String> aliases)
{ {
this.addAliases("d", "del"); super(aliases);
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_MULTIVERSE_DEL.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_DEL.node));
} }
@Override @Override

View File

@ -6,19 +6,18 @@ import java.util.List;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MultiverseColl; import com.massivecraft.mcore.MultiverseColl;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARInteger; import com.massivecraft.mcore.cmd.arg.ARInteger;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.util.Txt;
public class CmdUsysMultiverseList extends MCommand public class CmdMCoreUsysMultiverseList extends MCoreCommand
{ {
public CmdUsysMultiverseList() public CmdMCoreUsysMultiverseList(List<String> aliases)
{ {
this.addAliases("l", "list"); super(aliases);
this.addOptionalArg("page", "1"); this.addOptionalArg("page", "1");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_MULTIVERSE_LIST.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_LIST.node));
} }
@Override @Override

View File

@ -1,18 +1,19 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MultiverseColl; import com.massivecraft.mcore.MultiverseColl;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysMultiverseNew extends MCommand public class CmdMCoreUsysMultiverseNew extends MCoreCommand
{ {
public CmdUsysMultiverseNew() public CmdMCoreUsysMultiverseNew(List<String> aliases)
{ {
this.addAliases("n", "new"); super(aliases);
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_MULTIVERSE_NEW.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_NEW.node));
} }
@Override @Override

View File

@ -7,19 +7,18 @@ import com.massivecraft.mcore.Aspect;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARMultiverse; import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.Txt; import com.massivecraft.mcore.util.Txt;
public class CmdUsysMultiverseShow extends MCommand public class CmdMCoreUsysMultiverseShow extends MCoreCommand
{ {
public CmdUsysMultiverseShow() public CmdMCoreUsysMultiverseShow(List<String> aliases)
{ {
this.addAliases("s", "show"); super(aliases);
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_MULTIVERSE_SHOW.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_SHOW.node));
} }
@Override @Override

View File

@ -0,0 +1,33 @@
package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.MUtil;
public class CmdMCoreUsysUniverse extends MCoreCommand
{
public CmdMCoreUsysUniverseNew cmdUsysUniverseNew = new CmdMCoreUsysUniverseNew(MUtil.list("n", "new"));
public CmdMCoreUsysUniverseDel cmdUsysUniverseDel = new CmdMCoreUsysUniverseDel(MUtil.list("d", "del"));
public CmdMCoreUsysUniverseClear cmdUsysUniverseClear = new CmdMCoreUsysUniverseClear(MUtil.list("c", "clear"));
public CmdMCoreUsysUniverse(List<String> aliases)
{
super(aliases);
this.addSubCommand(this.cmdUsysUniverseNew);
this.addSubCommand(this.cmdUsysUniverseDel);
this.addSubCommand(this.cmdUsysUniverseClear);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_UNIVERSE.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -1,21 +1,22 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARMultiverse; import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysUniverseClear extends MCommand public class CmdMCoreUsysUniverseClear extends MCoreCommand
{ {
public CmdUsysUniverseClear() public CmdMCoreUsysUniverseClear(List<String> aliases)
{ {
this.addAliases("c", "clear"); super(aliases);
this.addRequiredArg("universe"); this.addRequiredArg("universe");
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_UNIVERSE_CLEAR.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_UNIVERSE_CLEAR.node));
} }
@Override @Override

View File

@ -1,21 +1,22 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARMultiverse; import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysUniverseDel extends MCommand public class CmdMCoreUsysUniverseDel extends MCoreCommand
{ {
public CmdUsysUniverseDel() public CmdMCoreUsysUniverseDel(List<String> aliases)
{ {
this.addAliases("d", "del"); super(aliases);
this.addRequiredArg("universe"); this.addRequiredArg("universe");
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_MULTIVERSE_DEL.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_MULTIVERSE_DEL.node));
} }
@Override @Override

View File

@ -1,20 +1,21 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARMultiverse; import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysUniverseNew extends MCommand public class CmdMCoreUsysUniverseNew extends MCoreCommand
{ {
public CmdUsysUniverseNew() public CmdMCoreUsysUniverseNew(List<String> aliases)
{ {
this.addAliases("n", "new"); super(aliases);
this.addRequiredArg("universe"); this.addRequiredArg("universe");
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_UNIVERSE_NEW.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_UNIVERSE_NEW.node));
} }
@Override @Override

View File

@ -1,21 +1,22 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.Multiverse; import com.massivecraft.mcore.Multiverse;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.arg.ARMultiverse; import com.massivecraft.mcore.cmd.arg.ARMultiverse;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysWorld extends MCommand public class CmdMCoreUsysWorld extends MCoreCommand
{ {
public CmdUsysWorld() public CmdMCoreUsysWorld(List<String> aliases)
{ {
this.addAliases("w", "world"); super(aliases);
this.addRequiredArg("world"); this.addRequiredArg("world");
this.addRequiredArg("universe"); this.addRequiredArg("universe");
this.addRequiredArg("multiverse"); this.addRequiredArg("multiverse");
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_WORLD.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE_USYS_WORLD.node));
} }
@Override @Override

View File

@ -1,25 +1,34 @@
package com.massivecraft.mcore.mcorecmd; package com.massivecraft.mcore.mcorecmd;
import com.massivecraft.mcore.ConfServer; import java.util.List;
import com.massivecraft.mcore.MCore; import com.massivecraft.mcore.MCore;
import com.massivecraft.mcore.MCorePerm; import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.MCommand; import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.VersionCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm; import com.massivecraft.mcore.cmd.req.ReqHasPerm;
import com.massivecraft.mcore.util.MUtil;
public class CmdMcore extends MCommand public class CmdMCore extends MCoreCommand
{ {
public final static String MCORE = "mcore"; public CmdMCoreId cmdMCoreId = new CmdMCoreId(MUtil.list("id"));
public CmdMCoreUsys cmdMCoreUsys = new CmdMCoreUsys(MUtil.list("usys"));
public CmdMcore() public CmdMCore(List<String> aliases)
{ {
this.addAliases(ConfServer.getCmdAliases(MCORE)); super(aliases);
this.addSubCommand(this.cmdMCoreUsys);
this.addSubCommand(this.cmdMCoreId);
this.addSubCommand(new VersionCommand(MCore.get(), MCorePerm.CMD_MCORE_VERSION.node, "v", "version"));
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE.node)); this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_MCORE.node));
} }
@Override @Override
public void perform() public void perform()
{ {
this.msg("<i>You are running %s", MCore.get().getDescription().getFullName()); this.getCommandChain().add(this);
this.msg("<i>The id of this server is \"<h>%s<i>\".", ConfServer.serverid); HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
} }
} }

View File

@ -1,38 +0,0 @@
package com.massivecraft.mcore.mcorecmd;
import com.massivecraft.mcore.ConfServer;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsys extends MCommand
{
public final static String USYS = "usys";
public CmdUsysMultiverse cmdUsysMultiverse = new CmdUsysMultiverse();
public CmdUsysUniverse cmdUsysUniverse = new CmdUsysUniverse();
public CmdUsysWorld cmdUsysWorld = new CmdUsysWorld();
public CmdUsysAspect cmdUsysAspect = new CmdUsysAspect();
public CmdUsys()
{
super();
this.addAliases(ConfServer.getCmdAliases(USYS));
this.addSubCommand(this.cmdUsysMultiverse);
this.addSubCommand(this.cmdUsysUniverse);
this.addSubCommand(this.cmdUsysWorld);
this.addSubCommand(this.cmdUsysAspect);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -1,32 +0,0 @@
package com.massivecraft.mcore.mcorecmd;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysAspect extends MCommand
{
public CmdUsysAspectList cmdUsysAspectList = new CmdUsysAspectList();
public CmdUsysAspectShow cmdUsysAspectShow = new CmdUsysAspectShow();
public CmdUsysAspectUse cmdUsysAspectUse = new CmdUsysAspectUse();
public CmdUsysAspect()
{
super();
this.addAliases("a", "aspect");
this.addSubCommand(this.cmdUsysAspectList);
this.addSubCommand(this.cmdUsysAspectShow);
this.addSubCommand(this.cmdUsysAspectUse);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_ASPECT.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -1,34 +0,0 @@
package com.massivecraft.mcore.mcorecmd;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysMultiverse extends MCommand
{
public CmdUsysMultiverseList cmdUsysMultiverseList = new CmdUsysMultiverseList();
public CmdUsysMultiverseShow cmdUsysMultiverseShow = new CmdUsysMultiverseShow();
public CmdUsysMultiverseNew cmdUsysMultiverseNew = new CmdUsysMultiverseNew();
public CmdUsysMultiverseDel cmdUsysMultiverseDel = new CmdUsysMultiverseDel();
public CmdUsysMultiverse()
{
super();
this.addAliases("m", "multiverse");
this.addSubCommand(this.cmdUsysMultiverseList);
this.addSubCommand(this.cmdUsysMultiverseShow);
this.addSubCommand(this.cmdUsysMultiverseNew);
this.addSubCommand(this.cmdUsysMultiverseDel);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_MULTIVERSE.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -1,32 +0,0 @@
package com.massivecraft.mcore.mcorecmd;
import com.massivecraft.mcore.MCorePerm;
import com.massivecraft.mcore.cmd.HelpCommand;
import com.massivecraft.mcore.cmd.MCommand;
import com.massivecraft.mcore.cmd.req.ReqHasPerm;
public class CmdUsysUniverse extends MCommand
{
public CmdUsysUniverseNew cmdUsysUniverseNew = new CmdUsysUniverseNew();
public CmdUsysUniverseDel cmdUsysUniverseDel = new CmdUsysUniverseDel();
public CmdUsysUniverseClear cmdUsysUniverseClear = new CmdUsysUniverseClear();
public CmdUsysUniverse()
{
super();
this.addAliases("u", "universe");
this.addSubCommand(this.cmdUsysUniverseNew);
this.addSubCommand(this.cmdUsysUniverseDel);
this.addSubCommand(this.cmdUsysUniverseClear);
this.addRequirements(ReqHasPerm.get(MCorePerm.CMD_USYS_UNIVERSE.node));
}
@Override
public void perform()
{
this.getCommandChain().add(this);
HelpCommand.getInstance().execute(this.sender, this.args, this.commandChain);
}
}

View File

@ -0,0 +1,13 @@
package com.massivecraft.mcore.mcorecmd;
import java.util.List;
import com.massivecraft.mcore.cmd.MCommand;
public abstract class MCoreCommand extends MCommand
{
public MCoreCommand(List<String> aliases)
{
this.setAliases(aliases);
}
}