diff --git a/TrueCraft.Core/Entities/ItemEntity.cs b/TrueCraft.Core/Entities/ItemEntity.cs index 1f3765f..ed1bbc2 100644 --- a/TrueCraft.Core/Entities/ItemEntity.cs +++ b/TrueCraft.Core/Entities/ItemEntity.cs @@ -54,7 +54,10 @@ namespace TrueCraft.Core.Entities public void TerrainCollision(Vector3 collisionPoint, Vector3 collisionDirection) { - // This space intentionally left blank + if (collisionDirection == Vector3.Down) + { + Velocity = Vector3.Zero; + } } public override byte EntityType @@ -103,7 +106,7 @@ namespace TrueCraft.Core.Entities if ((DateTime.UtcNow - SpawnTime).TotalSeconds > 1) { var player = nearbyEntities.FirstOrDefault(e => e is PlayerEntity && (e as PlayerEntity).Health != 0 - && e.Position.DistanceTo(Position) <= PickupRange); + && e.Position.DistanceTo(Position) <= PickupRange); if (player != null) { var playerEntity = player as PlayerEntity; diff --git a/TrueCraft/Handlers/InteractionHandlers.cs b/TrueCraft/Handlers/InteractionHandlers.cs index f2d8a18..759343b 100644 --- a/TrueCraft/Handlers/InteractionHandlers.cs +++ b/TrueCraft/Handlers/InteractionHandlers.cs @@ -39,7 +39,7 @@ namespace TrueCraft.Handlers var inventory = client.SelectedItem; inventory.Count--; var item = new ItemEntity(client.Entity.Position + new Vector3(0, PlayerEntity.Height, 0), spawned); - item.Velocity = MathHelper.FowardVector(client.Entity.Yaw) * 0.3; + item.Velocity = MathHelper.RotateY(Vector3.Forwards, MathHelper.DegreesToRadians(client.Entity.Yaw)) * 0.5; client.Inventory[client.SelectedSlot] = inventory; server.GetEntityManagerForWorld(client.World).SpawnEntity(item); break;