-
Notifications
You must be signed in to change notification settings - Fork 2
/
InvTweaksTile.cs
33 lines (32 loc) · 1.07 KB
/
InvTweaksTile.cs
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
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace InvTweaks
{
public class InvTweaksTile : GlobalTile
{
public override bool Drop(int i, int j, int type)
{
if (ClientConfig.Instance.SaplingPlacer)
{
int underneath = Main.tile[i, j + 1].TileType;
if (type == TileID.Trees
&& (TileID.Sets.Conversion.Grass[underneath]
|| underneath == TileID.Sand
|| underneath == TileID.SnowBlock))
{
var mouse = Main.MouseWorld.ToTileCoordinates16();
//Main.NewText("i: " + i);
//Main.NewText("j: " + j);
//Main.NewText("X: " + mouse.X);
//Main.NewText("Y: " + mouse.Y);
if (mouse.X == i && mouse.Y == j)
{
Main.LocalPlayer.GetModPlayer<InvTweaksPlayer>().PlaceTree();
}
}
}
return true;
}
}
}