public void ClearInvalidMirrorDiscoveries() { if (this.CurrentWorldDiscoveredMirrorTiles == null) { return; } IList <(int x, int y)> removals = new List <(int, int)>(); lock (MMMPlayer.MyCurrentMirrorsLock) { foreach ((int tileX, ISet <int> tileYs) in this.CurrentWorldDiscoveredMirrorTiles.ToArray()) { foreach (int tileY in tileYs.ToArray()) { if (MMMPlayer.IsMirrorTileInvalid(tileX, tileY) == true) { removals.Add((tileX, tileY)); } } } foreach ((int tileX, int tileY) in removals) { this.CurrentWorldDiscoveredMirrorTiles.Remove2D(tileX, tileY); } } }
//////////////// public bool TeleportToMirror(int tileX, int tileY) { int mmmTileType = ModContent.TileType <MountedMagicMirrorTile>(); tileX++; Tile tile = Framing.GetTileSafely(tileX, tileY); if (tile.type != mmmTileType) { //bool isInvalid = Main.netMode != 1 || TileChunkHelpers.IsTileSyncedForCurrentClient( tileX, tileY ); //if( isInvalid ) { } if (MMMPlayer.IsMirrorTileInvalid(tileX, tileY) != false) { if (MMMConfig.Instance.DebugModeInfo) { Main.NewText("Cannot teleport - Invalid mirror tile at " + tileX + "," + tileY); } return(false); } } var pos = new Vector2((tileX << 4), (tileY << 4)); PlayerWarpHelpers.Teleport(this.player, pos, PlayerWarpHelpers.MagicMirrorWarpStyle); return(true); }