private bool BreakBlock(McTcpClient handler, Location goal)
 {
     if (!handler.GetWorld().GetBlock(goal).Type.IsSolid())
     {
         return(false);
     }
     handler.DiggingBlock(0, goal);
     return(true);
 }
예제 #2
0
 public override string Run(McTcpClient handler, string command, Dictionary <string, object> localVars)
 {
     string[] args = getArgs(command);
     if (args.Length == 3 || args.Length == 4)
     {
         try
         {
             int status;
             int x, y, z;
             if (args.Length == 4)
             {
                 status = int.Parse(args[0]);
                 x      = int.Parse(args[1]);
                 y      = int.Parse(args[2]);
                 z      = int.Parse(args[3]);
             }
             else
             {
                 status = 0;
                 x      = int.Parse(args[0]);
                 y      = int.Parse(args[1]);
                 z      = int.Parse(args[2]);
             }
             Location goal = new Location(x, y, z);
             if (handler.DiggingBlock(status, goal))
             {
                 return("Dig block at " + goal);
             }
             return("Failed to dig block at " + goal);
         }
         catch (FormatException) { return(CMDDesc); }
     }
     else
     {
         return(CMDDesc);
     }
 }