-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPickBlock.cs
More file actions
39 lines (31 loc) · 881 Bytes
/
PickBlock.cs
File metadata and controls
39 lines (31 loc) · 881 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
31
32
33
34
35
36
37
38
39
using System.Collections.Generic;
using Terraria;
using Terraria.ModLoader;
namespace PickBlock;
public class PickBlock : Mod
{
public Dictionary<int, int> TileAssociativeItems { get; private set; }
public Dictionary<int, int> WallAssociativeItems { get; private set; }
public override void PostSetupContent()
{
TileAssociativeItems = new Dictionary<int, int>();
WallAssociativeItems = new Dictionary<int, int>();
Item item = new();
for (int i = 1; i < ItemLoader.ItemCount; i++)
{
item.SetDefaults(i);
if (item.createTile != -1)
{
if (TileAssociativeItems.ContainsKey(item.createTile))
continue;
TileAssociativeItems.Add(item.createTile, item.type);
}
if (item.createWall != -1)
{
if (WallAssociativeItems.ContainsKey(item.createWall))
continue;
WallAssociativeItems.Add(item.createWall, item.type);
}
}
}
}