Example #1
0
 public int PosToInt(BlockPos pos)
 {
     return PosToInt(pos.X, pos.Y, pos.Z);
 }
Example #2
0
 internal bool PhysicsBlockChange(BlockPos pos, byte type)
 {
     if (BlockChange(pos.X, pos.Y, pos.Z, type))
     {
         try
         {
             //Server.historyController.SetData(name, PosToInt(pos.x, pos.y, pos.z), type, 0);
         }
         catch (Exception e)
         {
             Console.WriteLine(e.Message);
             Console.WriteLine(e.StackTrace);
         }
         return true;
     }
     return false;
 }
Example #3
0
 public bool PhysicsBlockChange(BlockPos pos, MCBlocks type)
 {
     return PhysicsBlockChange(pos, (byte) type);
 }
Example #4
0
        public void PhysicsCheck(ushort inX, ushort inY, ushort inZ)
        {
            for (int x = -1; x < 2; ++x)
                for (int y = -1; y < 2; ++y)
                    for (int z = -1; z < 2; ++z)
                    {
                        var blockPos = new BlockPos(inX + x, inY + y, inZ + z, this);

                        if (NotInBounds(blockPos)) continue;
                        int pos = PosToInt(blockPos);
                        if (BlockData[pos] == 0) continue;
                        if (Physics.PhysicsUpdates.Contains(pos)) continue;
                        Physics.AddCall(pos);
                    }
        }
Example #5
0
 public bool NotInBounds(BlockPos pos)
 {
     return NotInBounds(pos.X, pos.Y, pos.Z);
 }
Example #6
0
        public MCBlocks GetTile(BlockPos pos, int diffX, int diffY, int diffZ)
        {
            var x = (ushort) (pos.X + diffX);
            var y = (ushort) (pos.Y + diffY);
            var z = (ushort) (pos.Z + diffZ);

            return (MCBlocks) GetTile(x, y, z);
        }
Example #7
0
 public MCBlocks GetTile(BlockPos pos)
 {
     return (MCBlocks) GetTile(pos.X, pos.Y, pos.Z);
 }
Example #8
0
        public void PhysicsCheck(ushort inX, ushort inY, ushort inZ)
        {
            for (int x = -1; x < 2; ++x)
                for (int y = -1; y < 2; ++y)
                    for (int z = -1; z < 2; ++z)
                    {
                        var blockPos = new BlockPos(inX + x, inY + y, inZ + z, this);

                        if (!blockPos.InBounds) continue;
                        if (BlockData[blockPos.Index] == 0) continue;
                        if (Physics.PhysicsUpdates.Contains(blockPos.Index)) continue;
                        Physics.AddCall(blockPos.Index);
                    }
        }
Example #9
0
 public bool PhysicsBlockChange(BlockPos pos, MCBlocks type)
 {
     return pos.Level.PhysicsBlockChange(pos, type);
 }