Increased range for entities to solve this, instead of checking the client bounding box

This commit is contained in:
Dizigma 2015-07-06 19:57:08 -06:00
parent 5c1512d527
commit 6a8cd691a6

View File

@ -131,7 +131,7 @@ namespace TrueCraft.Core.Logic
{
// Test for entities
var em = user.Server.GetEntityManagerForWorld(world);
var entities = em.EntitiesInRange(coordinates, 1);
var entities = em.EntitiesInRange(coordinates, 2);
var box = new BoundingBox(coordinates, coordinates + Vector3.One);
foreach (var entity in entities)
{
@ -150,15 +150,6 @@ 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);