Can use air block models, also make noclip sliding configurable.

This commit is contained in:
UnknownShadow200 2015-12-22 07:59:32 +11:00
parent 35e0f8cab5
commit 9707b083db
6 changed files with 13 additions and 3 deletions

View File

@ -43,6 +43,11 @@ namespace ClassicalSharp {
}
}),
Make( 140, 0, "Noclip slide", OnWidgetClick,
g => g.LocalPlayer.NoclipSlide ? "yes" : "no",
(g, v) => { g.LocalPlayer.NoclipSlide = v == "yes";
Options.Set( OptionsKey.NoclipSlide, v == "yes" ); } ),
MakeBack( false, titleFont,
(g, w) => g.SetNewScreen( new PauseScreen( g ) ) ),
null,
@ -54,6 +59,7 @@ namespace ClassicalSharp {
new BooleanValidator(),
new BooleanValidator(),
new BooleanValidator(),
};
okayIndex = buttons.Length - 1;
}

View File

@ -11,7 +11,7 @@ namespace ClassicalSharp {
bool useLiquidGravity = false; // used by BlockDefinitions.
bool canLiquidJump = true;
void UpdateVelocityState( float xMoving, float zMoving ) {
if( noClip && xMoving == 0 && zMoving == 0 )
if( !NoclipSlide && (noClip && xMoving == 0 && zMoving == 0) )
Velocity = Vector3.Zero;
if( flying || noClip ) {

View File

@ -53,6 +53,9 @@ namespace ClassicalSharp {
/// <summary> Whether the player is allowed to see all entity name tags. </summary>
public bool CanSeeAllNames = true;
/// <summary> Whether the player should slide after letting go of movement buttons in noclip. </summary>
public bool NoclipSlide = true;
float jumpVel = 0.42f;
/// <summary> Returns the height that the client can currently jump up to.<br/>
/// Note that when speeding is enabled the client is able to jump much further. </summary>
@ -69,6 +72,7 @@ namespace ClassicalSharp {
SpeedMultiplier = Options.GetFloat( OptionsKey.Speed, 0.1f, 50, 7 );
PushbackPlacing = Options.GetBool( OptionsKey.PushbackPlacing, false );
NoclipSlide = Options.GetBool( OptionsKey.NoclipSlide, true );
InitRenderingData();
}

View File

@ -63,6 +63,7 @@ namespace ClassicalSharp {
ViewBobbing = Options.GetBool( OptionsKey.ViewBobbing, false );
ShowBlockInHand = Options.GetBool( OptionsKey.ShowBlockInHand, true );
InvertMouse = Options.GetBool( OptionsKey.InvertMouse, false );
SimpleArmsAnim = Options.GetBool( OptionsKey.SimpleArmsAnim, false );
TerrainAtlas1D = new TerrainAtlas1D( Graphics );
TerrainAtlas = new TerrainAtlas2D( Graphics, Drawer2D );

View File

@ -31,8 +31,6 @@ namespace ClassicalSharp.Model {
byte blockId;
if( Byte.TryParse( modelName, out blockId ) ) {
modelName = "block";
if( blockId == 0 )
return cache["humanoid"];
}
if( !cache.TryGetValue( modelName, out model ) ) {

View File

@ -34,6 +34,7 @@ namespace ClassicalSharp {
public const string LiquidsBreakable = "liquidsbreakable";
public const string PushbackPlacing = "pushbackplacing";
public const string InvertMouse = "invertmouse";
public const string NoclipSlide = "noclipslide";
}
// TODO: implement this