-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathChestPlacementFix.cs
More file actions
30 lines (27 loc) · 840 Bytes
/
ChestPlacementFix.cs
File metadata and controls
30 lines (27 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System.Collections.Generic;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace MechTransfer
{
internal class ChestPlacementFix : GlobalTile
{
private List<int> noChestTiles = new List<int>();
public override bool CanPlace(int i, int j, int type)
{
if (TileID.Sets.BasicChest[type] || TileID.Sets.BasicChestFake[type] || TileID.Sets.BasicDresser[type]) // TileLoader.IsDresser
{
Tile bottom = Main.tile[i, j + 1];
if (bottom != null && bottom.HasTile && noChestTiles.Contains(bottom.TileType))
{
return false;
}
}
return true;
}
public void AddNoChestTile(int type)
{
noChestTiles.Add(type);
}
}
}