internal bool PhysicsBlockChange(BlockPos pos, Blocks type) { return PhysicsBlockChange(pos, (byte)type); }
internal bool SetTile(ushort x, ushort y, ushort z, byte type) { if (NotInBounds(x, y, z)) { Server.Log("Out of bounds?", LogTypesEnum.debug); return false; } blocks[PosToInt(x, y, z)] = type; if (physics != null) for (int _X = -1; _X < 2; ++_X) for (int _Y = -1; _Y < 2; ++_Y) for (int _Z = -1; _Z < 2; ++_Z) { BlockPos blockPos = new BlockPos(x + _X, y + _Y, z + _Z); if (NotInBounds(blockPos)) continue; int pos = PosToInt(blockPos); if (blocks[pos] == 0) continue; if (physics.PhysicsUpdates.Contains(pos)) continue; physics.PhysicsUpdates.Add(pos); } return true; }
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; }
internal Blocks GetTile(BlockPos pos, int diffX, int diffY, int diffZ) { ushort x = (ushort)(pos.x + diffX); ushort y = (ushort)(pos.y + diffY); ushort z = (ushort)(pos.z + diffZ); return (Blocks)GetTile(x, y, z); }
internal Blocks GetTile(BlockPos pos) { return (Blocks)GetTile(pos.x, pos.y, pos.z); }
public int PosToInt(BlockPos pos) { return PosToInt(pos.x, pos.y, pos.z); }
public bool NotInBounds(BlockPos pos) { return NotInBounds(pos.x, pos.y, pos.z); }