BlockModel shouldn't always use LocalPlayer's modelname, fixes #82.

This commit is contained in:
UnknownShadow200 2015-09-21 12:06:51 +10:00
parent 3d9d2a0e76
commit 8a076102f4
11 changed files with 21 additions and 23 deletions

View file

@ -11,7 +11,7 @@ namespace ClassicalSharp {
/// <summary> Gets the position of the player's eye in the world. </summary>
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;

View file

@ -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;

View file

@ -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 {

View file

@ -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 {

View file

@ -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; }

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {

View file

@ -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 {