Skip to content

Commit

Permalink
一直有人说直接放入背包时物块不会被破坏, 虽然我本地一直没有出现过这种问题, 不过还是换了一种方法, 可能会有一点性能上的影响
Browse files Browse the repository at this point in the history
  • Loading branch information
Megghy committed Sep 1, 2021
1 parent d73bc04 commit 928f269
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions VeinMiner/VeinMiner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,20 +130,22 @@ public static void KillTileAndSend(List<Point> list, bool noItem)
{
Task.Run(() =>
{
if (!list.Any()) return;
var minX = list[0].X;
if (!list.Any())
return;
/*var minX = list[0].X;
var minY = list[0].Y;
var maxX = minX;
var maxY = minY;
var maxY = minY;*/
list.ForEach(p =>
{
if (p.X < minX) minX = p.X;
/*if (p.X < minX) minX = p.X;
if (p.X > maxX) maxX = p.X;
if (p.Y < minY) minY = p.Y;
if (p.Y > maxY) maxY = p.Y;
if (p.Y > maxY) maxY = p.Y;*/
WorldGen.KillTile(p.X, p.Y, false, false, noItem);
NetMessage.SendData(17, -1, -1, null, 4, p.X, p.Y, false.GetHashCode());
});
NetMessage.SendTileSquare(-1, minX, minY, maxX - minX + 1, maxY - minY + 1, Terraria.ID.TileChangeType.None);
//NetMessage.SendTileSquare(-1, minX, minY, maxX - minX + 1, maxY - minY + 1, Terraria.ID.TileChangeType.None);
});
}
public static Task<List<Point>> GetVein(List<Point> list, int x, int y, int type)
Expand Down

0 comments on commit 928f269

Please sign in to comment.