예제 #1
0
파일: World.cs 프로젝트: serh39/uMiner
 public bool SetTile(int x, int y, int z, byte type)
 {
     if (x < 0 || y < 0 || z < 0 || x >= this.width || y >= this.height || z >= this.depth || type < 0 || !Blocks.blockNames.ContainsValue(type))
     {
         return(false);
     }
     //Handle basic physics tiles
     if (Blocks.BasicPhysics(type))
     {
         /*if (Blocks.AffectedByGravity(type))
          * {
          *  Program.server.physics.SandGravelFall(x, y, z, type);
          *  return true;
          * }
          * if (Blocks.AffectedBySponges(type) && Program.server.physics.FindSponge(x, y, z))
          * {
          *  return false;
          * }*/
         Program.server.physics.Queue(x, y, z, type);
     }
     //Handle sponge deletion
     if (GetTile(x, y, z) == Blocks.sponge && type == 0)
     {
         Program.server.physics.DeleteSponge(x, y, z);
     }
     this.blocks[(y * this.depth + z) * this.width + x] = type;
     Player.GlobalBlockchange((short)x, (short)y, (short)z, Blocks.ConvertType(type));
     return(true);
 }
예제 #2
0
파일: World.cs 프로젝트: serh39/uMiner
 public bool SetTileNoPhysics(int x, int y, int z, byte type)
 {
     if (x < 0 || y < 0 || z < 0 || x >= this.width || y >= this.height || z >= this.depth || type < 0 || !Blocks.blockNames.ContainsValue(type))
     {
         return(false);
     }
     this.blocks[(y * this.depth + z) * this.width + x] = type;
     Player.GlobalBlockchange((short)x, (short)y, (short)z, Blocks.ConvertType(type));
     return(true);
 }