コード例 #1
0
ファイル: Cloak.cs プロジェクト: Comner-git/MineSharp
        static void CloakCommand(Client player, string[] cmd, int iarg)
        {
            if (player.Admin(Permissions.Cloak) == false)
            {
                return;
            }

            if (cmd.Length < 2)
            {
                TellMode(player);
                return;
            }

            switch (cmd [iarg])
            {
            case "clear":
            case "reset":
            case "normal":
            case "off":
                SetCloak(player, null);
                break;

            case "none":
            case "invisible":
            case "on":
                SetCloak(player, MobType.None.ToString());
                break;

            /*
             *          case "Villager":
             *          case "Snowman":
             *          case "EnderDragon":
             *                  player.Tell (Chat.Red, cmd [1] + " is disabled/not working");
             *                  return;
             */
            case "back":
                if (cloakBack.ContainsKey(player.MinecraftUsername) == false)
                {
                    throw new ErrorException("No saved position, use /cloak first");
                }
                player.Warp(cloakBack [player.MinecraftUsername], player.Session.Dimension, World.Main);
                break;

            default:
                SetCloak(player, cmd [iarg]);
                break;
            }
        }
コード例 #2
0
ファイル: Cloak.cs プロジェクト: mctraveler/MineSharp
        static void CloakCommand(Client player, string[] cmd, int iarg)
        {
            if (player.Admin() == false)
                return;

            if (cmd.Length < 2)
            {
                TellMode(player);
                return;
            }
	
            switch (cmd [iarg])
            {
                case "clear":
                case "reset":
                case "normal":
                case "off":
                    SetCloak(player, null);
                    break;
                case "none":
                case "invisible":
                case "on":
                    SetCloak(player, MobType.None.ToString());
                    break;
            /*
			case "Villager":
			case "Snowman":
			case "EnderDragon":
				player.Tell (Chat.Red, cmd [1] + " is disabled/not working");
				return;
				*/
                case "back":
                    if (cloakBack.ContainsKey(player.MinecraftUsername) == false)
                        throw new ErrorException("No saved position, use /cloak first");
                    player.Warp(cloakBack [player.MinecraftUsername], player.Session.Dimension, World.Main);
                    break;

                default:
                    SetCloak(player, cmd [iarg]);
                    break;
            }
        }