diff --git a/ClassicalSharp/Entities/Player.cs b/ClassicalSharp/Entities/Player.cs index 8788b988d..cb72faf64 100644 --- a/ClassicalSharp/Entities/Player.cs +++ b/ClassicalSharp/Entities/Player.cs @@ -11,7 +11,7 @@ namespace ClassicalSharp { /// Gets the position of the player's eye in the world. public Vector3 EyePosition { - get { return new Vector3( Position.X, Position.Y + Model.EyeY, Position.Z ); } + get { return new Vector3( Position.X, Position.Y + Model.GetEyeY( this ), Position.Z ); } } protected Game game; diff --git a/ClassicalSharp/Model/BlockModel.cs b/ClassicalSharp/Model/BlockModel.cs index 735614567..533f187eb 100644 --- a/ClassicalSharp/Model/BlockModel.cs +++ b/ClassicalSharp/Model/BlockModel.cs @@ -14,11 +14,9 @@ namespace ClassicalSharp.Model { get { return blockHeight + 0.075f; } } - public override float EyeY { - get { - byte block = Byte.Parse( game.LocalPlayer.ModelName ); - return block == 0 ? 1 : game.BlockInfo.BlockHeight( block ); - } + public override float GetEyeY( Player player ) { + byte block = Byte.Parse( player.ModelName ); + return block == 0 ? 1 : game.BlockInfo.BlockHeight( block ); } const float adjust = 0.1f; diff --git a/ClassicalSharp/Model/ChickenModel.cs b/ClassicalSharp/Model/ChickenModel.cs index 9ddd5f92f..bc8b77e1f 100644 --- a/ClassicalSharp/Model/ChickenModel.cs +++ b/ClassicalSharp/Model/ChickenModel.cs @@ -49,8 +49,8 @@ namespace ClassicalSharp.Model { get { return 1.0125f; } } - public override float EyeY { - get { return 14/16f; } + public override float GetEyeY( Player player ) { + return 14/16f; } public override Vector3 CollisionSize { diff --git a/ClassicalSharp/Model/CreeperModel.cs b/ClassicalSharp/Model/CreeperModel.cs index c90dcf01e..b027f8d2d 100644 --- a/ClassicalSharp/Model/CreeperModel.cs +++ b/ClassicalSharp/Model/CreeperModel.cs @@ -32,8 +32,8 @@ namespace ClassicalSharp.Model { get { return 1.7f; } } - public override float EyeY { - get { return 22/16f; } + public override float GetEyeY( Player player ) { + return 22/16f; } public override Vector3 CollisionSize { diff --git a/ClassicalSharp/Model/IModel.cs b/ClassicalSharp/Model/IModel.cs index b6652818d..1543cd84b 100644 --- a/ClassicalSharp/Model/IModel.cs +++ b/ClassicalSharp/Model/IModel.cs @@ -21,7 +21,7 @@ namespace ClassicalSharp.Model { public abstract float NameYOffset { get; } - public abstract float EyeY { get; } + public abstract float GetEyeY( Player player ); public abstract Vector3 CollisionSize { get; } diff --git a/ClassicalSharp/Model/PigModel.cs b/ClassicalSharp/Model/PigModel.cs index 84c31c275..6919ee53a 100644 --- a/ClassicalSharp/Model/PigModel.cs +++ b/ClassicalSharp/Model/PigModel.cs @@ -32,8 +32,8 @@ namespace ClassicalSharp.Model { get { return 1.075f; } } - public override float EyeY { - get { return 12/16f; } + public override float GetEyeY( Player player ) { + return 12/16f; } public override Vector3 CollisionSize { diff --git a/ClassicalSharp/Model/PlayerModel.cs b/ClassicalSharp/Model/PlayerModel.cs index 1e14f9b4e..9bc1c3d7d 100644 --- a/ClassicalSharp/Model/PlayerModel.cs +++ b/ClassicalSharp/Model/PlayerModel.cs @@ -70,8 +70,8 @@ namespace ClassicalSharp.Model { get { return 2.1375f; } } - public override float EyeY { - get { return 26/16f; } + public override float GetEyeY( Player player ) { + return 26/16f; } public override Vector3 CollisionSize { diff --git a/ClassicalSharp/Model/SheepModel.cs b/ClassicalSharp/Model/SheepModel.cs index 2a2ad6eb6..33afa5051 100644 --- a/ClassicalSharp/Model/SheepModel.cs +++ b/ClassicalSharp/Model/SheepModel.cs @@ -55,8 +55,8 @@ namespace ClassicalSharp.Model { get { return Fur ? 1.48125f: 1.075f; } } - public override float EyeY { - get { return 20/16f; } + public override float GetEyeY( Player player ) { + return 20/16f; } public override Vector3 CollisionSize { diff --git a/ClassicalSharp/Model/SkeletonModel.cs b/ClassicalSharp/Model/SkeletonModel.cs index d5a406b9c..0a9e7045e 100644 --- a/ClassicalSharp/Model/SkeletonModel.cs +++ b/ClassicalSharp/Model/SkeletonModel.cs @@ -43,8 +43,8 @@ namespace ClassicalSharp.Model { get { return 2.075f; } } - public override float EyeY { - get { return 26/16f; } + public override float GetEyeY( Player player ) { + return 26/16f; } public override Vector3 CollisionSize { diff --git a/ClassicalSharp/Model/SpiderModel.cs b/ClassicalSharp/Model/SpiderModel.cs index 8359856ec..8e8ae1375 100644 --- a/ClassicalSharp/Model/SpiderModel.cs +++ b/ClassicalSharp/Model/SpiderModel.cs @@ -34,8 +34,8 @@ namespace ClassicalSharp.Model { get { return 1.0125f; } } - public override float EyeY { - get { return 8/16f; } + public override float GetEyeY( Player player ) { + return 8/16f; } public override Vector3 CollisionSize { diff --git a/ClassicalSharp/Model/ZombieModel.cs b/ClassicalSharp/Model/ZombieModel.cs index 267a5e7a4..7c77d907a 100644 --- a/ClassicalSharp/Model/ZombieModel.cs +++ b/ClassicalSharp/Model/ZombieModel.cs @@ -44,8 +44,8 @@ namespace ClassicalSharp.Model { get { return 2.075f; } } - public override float EyeY { - get { return 26/16f; } + public override float GetEyeY( Player player ) { + return 26/16f; } public override Vector3 CollisionSize {