Add interactive bounding box to sugarcane, torches

Note that torches have a different bounding box depending on their
metadata, which is not currently supported by the block model.
This commit is contained in:
Drew DeVault 2016-01-03 12:06:02 -05:00
parent f575a9c4ee
commit 1750eb60d6
2 changed files with 16 additions and 0 deletions

View File

@ -44,6 +44,14 @@ namespace TrueCraft.Core.Logic.Blocks
} }
} }
public override BoundingBox? InteractiveBoundingBox
{
get
{
return new BoundingBox(new Vector3(2 / 16.0, 0, 2 / 16.0), new Vector3(14 / 16.0, 1.0, 14 / 16.0));
}
}
public override Tuple<int, int> GetTextureMap(byte metadata) public override Tuple<int, int> GetTextureMap(byte metadata)
{ {
return new Tuple<int, int>(9, 4); return new Tuple<int, int>(9, 4);

View File

@ -45,6 +45,14 @@ namespace TrueCraft.Core.Logic.Blocks
public override BoundingBox? BoundingBox { get { return null; } } public override BoundingBox? BoundingBox { get { return null; } }
public override BoundingBox? InteractiveBoundingBox
{
get
{
return new BoundingBox(new Vector3(4 / 16.0, 0, 4 / 16.0), new Vector3(12 / 16.0, 7.0 / 16.0, 12 / 16.0));
}
}
public override void BlockPlaced(BlockDescriptor descriptor, BlockFace face, IWorld world, IRemoteClient user) public override void BlockPlaced(BlockDescriptor descriptor, BlockFace face, IWorld world, IRemoteClient user)
{ {
TorchDirection[] preferredDirections = TorchDirection[] preferredDirections =