当前位置: 首页>>代码示例>>C#>>正文


C# CommandManager.AddAdminCommand方法代码示例

本文整理汇总了C#中CommandManager.AddAdminCommand方法的典型用法代码示例。如果您正苦于以下问题:C# CommandManager.AddAdminCommand方法的具体用法?C# CommandManager.AddAdminCommand怎么用?C# CommandManager.AddAdminCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CommandManager的用法示例。


在下文中一共展示了CommandManager.AddAdminCommand方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Admin

        public Admin(CommandManager c)
        {
            c.AddTab(GameRuleComplete, "gamerule");
            c.AddAdminCommand(MassPardon, "masspardon");
            c.AddAdminCommand(KillJava, "killjava");
            c.AddAdminCommand(NickCommand, "nick");
            c.AddAdminCommand(Say, "say");
            c.AddAdminCommand(Say2, "say2");
            c.AddAdminCommand(Kick, "kick");
            c.AddAdminCommand(Ban, "ban");
            c.AddAdminCommand(BanIP, "ban-ip", "banip");
            c.AddAdminCommand(CleanBannedRegions, "cleanregionsbanned");
            c.AddAdminCommand(VanillaCommands, "give");
            c.AddAdminCommand(VanillaCommands, "enchant");
            c.AddAdminCommand(VanillaCommands, "difficulty");
            c.AddAdminCommand(VanillaCommands, "gamerule");
            c.AddAdminCommand(VanillaCommands, "spawnpoint");
            c.AddAdminCommand(VanillaCommands, "clear");
            c.AddAdminCommand(VanillaCommands, "gamemode");
            c.AddAdminCommand(VanillaCommands, "effect");
            c.AddAdminCommand(VanillaCommands, "scoreboard");
            c.AddAdminCommand(VanillaCommands, "weather");
            c.AddAdminCommand(VanillaCommands, "toggledownfall");
            c.AddAdminCommand(VanillaCommands, "setidletimeout");
            c.AddAdminCommand(VanillaCommands, "op", "deop");

            c.AddAdminCommand(VanillaCommands, "achievement");
            c.AddAdminCommand(VanillaCommands, "blockdata");
            c.AddAdminCommand(VanillaCommands, "clone");
            c.AddAdminCommand(VanillaCommands, "defaultgamemode");
            c.AddAdminCommand(VanillaCommands, "execute");
            c.AddAdminCommand(VanillaCommands, "fill");
            c.AddAdminCommand(VanillaCommands, "particle");
            c.AddAdminCommand(VanillaCommands, "playsound");
            c.AddAdminCommand(VanillaCommands, "setblock");
            c.AddAdminCommand(VanillaCommands, "summon");
            c.AddAdminCommand(VanillaCommands, "title");

            c.AddAdminCommand(VanillaLoad, "vanillaload");
            c.AddAdminCommand(VanillaUnload, "vanillaunload");
            c.AddAdminCommand(VanillaStop, "vanillarestart");
            c.AddAdminCommand(AllBack, "allback");
            c.AddAdminCommand(OldRestart, null, "restart", "shutdown", "stop");
            c.AddAdminCommand(ProxyStop, "proxystop");
            c.AddAdminCommand((player, cmd, iarg) =>
            {
                Threads.DebugThreads();
            }, "debugthreads");
            c.AddAdminCommand((player, cmd, iarg) =>
            {
                player.TellSystem(Chat.Pink, "New Usage: /ban 30 username Reason for ban");
            }, null, "ban30");
            
            c.AddAdminCommand(VanillaSuspend, "vanillastop");
            c.AddAdminCommand(VanillaResume, "vanillastart");
            c.AddAdminCommand(Possess, "possess", "poss");
            c.AddAdminCommand(Slots, "slots");
            c.AddAdminCommand(Flush, "flush");
            c.AddAdminCommand(Mode, "mode", "gm", "m");
            c.AddAdminCommand(Teleport, "tp", "go");
            c.AddAdminCommand(Crash, "crash");
            
            c.AddAdminCommand((player, cmd, offset) =>
            {
                if (cmd.Length != 4)
                    throw new UsageException("/ee effectID amplification duration");
                
                var ee = new EntityEffect(player.EntityID, (PlayerEffects)int.Parse(cmd [1]), int.Parse(cmd [2]), int.Parse(cmd [3]));
                player.Queue.Queue(ee);
                player.TellSystem(Chat.Purple, ee.ToString());
            }, "ee");

#if DEBUG
            c.AddCommand((player, cmd, offset) =>
            {
                var steer = new Steer();
                steer.Action = Steer.Actions.Unmount;
                player.FromClient(steer);

            }, "steer");
#endif
        }
开发者ID:mctraveler,项目名称:MineSharp,代码行数:82,代码来源:Admin.cs


注:本文中的CommandManager.AddAdminCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。