diff --git a/TrueCraft.Core/Logic/BlockProvider.cs b/TrueCraft.Core/Logic/BlockProvider.cs index d00f794..7ab0c58 100644 --- a/TrueCraft.Core/Logic/BlockProvider.cs +++ b/TrueCraft.Core/Logic/BlockProvider.cs @@ -150,6 +150,15 @@ namespace TrueCraft.Core.Logic } } + // Prevent the user from placing blocks on themselves + var userPlayer = user.Entity as PlayerEntity; + if (userPlayer != null){ + if (new BoundingBox(userPlayer.Position, userPlayer.Position + userPlayer.Size) + .Intersects(box)){ + return; + } + } + // Place block world.SetBlockID(coordinates, ID); world.SetMetadata(coordinates, (byte)item.Metadata);