示例#1
0
 void Curse(Player sender) {
     if (sender.ExtraData["cursorlocked"] != null && (bool)sender.ExtraData["cursorlocked"]) return;
     lock (this) {
         sender.ExtraData["cursorlocked"] = true;
         if (sender.ExtraData["Cursor"] != null) {
             Vector3S old;
             if (sender.ExtraData["Cursor"].GetType() == typeof(Vector3S))
                 old = (Vector3S)sender.ExtraData["Cursor"];
             else {
                 old = new Vector3S();
                 old.FromString((string)sender.ExtraData["Cursor"]);
             }
             sender.SendBlockChange((ushort)old.x, (ushort)old.z, (ushort)old.y, sender.Level.GetBlock(old));
         }
         Vector3S cursor = sender.GetBlockFromView();
         if ((object)cursor != null) {
             sender.SendBlockChange((ushort)cursor.x, (ushort)cursor.z, (ushort)cursor.y, 21);
         }
         sender.ExtraData["Cursor"] = cursor;
         sender.ExtraData["cursorlocked"] = false;
     }
 }