Allow using a full-block step instead of just slabs. (Thanks goodlyay)

This commit is contained in:
UnknownShadow200 2016-05-24 15:23:01 +10:00
parent 70a6e2fe1a
commit 3dd7a8599d
4 changed files with 24 additions and 11 deletions

View File

@ -38,6 +38,10 @@ namespace ClassicalSharp.Gui {
(g, v) => g.LocalPlayer.Hacks.DoubleJump = v ),
// Column 2
MakeBool( 1, -150, "Full block stepping", OptionsKey.FullBlockStep,
OnWidgetClick, g => g.LocalPlayer.Hacks.FullBlockStep,
(g, v) => g.LocalPlayer.Hacks.FullBlockStep = v ),
MakeBool( 1, -100, "Modifiable liquids", OptionsKey.ModifiableLiquids,
OnWidgetClick, g => g.ModifiableLiquids, (g, v) => g.ModifiableLiquids = v ),
@ -77,7 +81,8 @@ namespace ClassicalSharp.Gui {
bool noGlobalHacks = !p.Hacks.CanAnyHacks || !p.Hacks.Enabled;
widgets[3].Disabled = noGlobalHacks || !p.Hacks.CanSpeed;
widgets[4].Disabled = noGlobalHacks || !p.Hacks.CanSpeed;
widgets[6].Disabled = noGlobalHacks || !p.Hacks.CanPushbackBlocks;
widgets[5].Disabled = noGlobalHacks || !p.Hacks.CanSpeed;
widgets[7].Disabled = noGlobalHacks || !p.Hacks.CanPushbackBlocks;
}
public override void Dispose() {
@ -96,6 +101,7 @@ namespace ClassicalSharp.Gui {
new BooleanValidator(),
new BooleanValidator(),
new BooleanValidator(),
new BooleanValidator(),
new IntegerValidator( 1, 150 ),
};
}
@ -110,16 +116,16 @@ namespace ClassicalSharp.Gui {
"&eSets how many blocks high you can jump up.",
"&eNote: You jump much higher when holding down the speed key binding.",
};
descriptions[5] = new [] {
descriptions[6] = new [] {
"&eIf modifiable liquids is set to true, then water/lava can",
"&ebe placed and deleted the same way as any other block.",
};
descriptions[6] = new [] {
descriptions[7] = new [] {
"&eWhen this is active, placing blocks that intersect your own position",
"&ecause the block to be placed, and you to be moved out of the way.",
"&fThis is mainly useful for quick pillaring/towering.",
};
descriptions[7] = new [] {
descriptions[8] = new [] {
"&eIf noclip sliding isn't used, you will immediately stop when",
"&eyou are in noclip mode and no movement keys are held down.",
};

View File

@ -25,21 +25,24 @@ namespace ClassicalSharp.Entities {
/// should cause the player to be pushed back in the opposite direction of the placed block. </summary>
public bool PushbackPlacing;
/// <summary> Whether the player should be able to step up whole blocks, instead of just slabs. </summary>
public bool FullBlockStep;
/// <summary> Whether the player has allowed hacks usage as an option.
/// Note that all 'can use X' set by the server override this. </summary>
public bool Enabled = true;
public bool Enabled = true;
/// <summary> Whether the player is allowed to use any type of hacks. </summary>
public bool CanAnyHacks = true;
public bool CanAnyHacks = true;
/// <summary> Whether the player is allowed to use the types of cameras that use third person. </summary>
public bool CanUseThirdPersonCamera = true;
public bool CanUseThirdPersonCamera = true;
/// <summary> Whether the player is allowed to increase its speed beyond the normal walking speed. </summary>
public bool CanSpeed = true;
public bool CanSpeed = true;
/// <summary> Whether the player is allowed to fly in the world. </summary>
public bool CanFly = true;
public bool CanFly = true;
/// <summary> Whether the player is allowed to teleport to their respawn coordinates. </summary>
public bool CanRespawn = true;
public bool CanRespawn = true;
/// <summary> Whether the player is allowed to pass through all blocks. </summary>
public bool CanNoclip = true;
public bool CanNoclip = true;
/// <summary> Whether the player is allowed to use pushback block placing. </summary>
public bool CanPushbackBlocks = true;
/// <summary> Whether the player is allowed to see all entity name tags. </summary>

View File

@ -51,12 +51,15 @@ namespace ClassicalSharp.Entities {
Hacks.NoclipSlide = Options.GetBool( OptionsKey.NoclipSlide, false );
Hacks.DoubleJump = !game.ClassicMode && Options.GetBool( OptionsKey.DoubleJump, false );
Hacks.Enabled = !game.ClassicMode && Options.GetBool( OptionsKey.HacksEnabled, true );
Hacks.FullBlockStep = !game.ClassicMode && Options.GetBool( OptionsKey.FullBlockStep, false );
if( game.ClassicMode && game.ClassicHacks ) Hacks.Enabled = true;
}
Vector3 lastSoundPos = new Vector3( float.PositiveInfinity );
public override void Tick( double delta ) {
if( game.World.IsNotLoaded ) return;
StepSize = Hacks.FullBlockStep && Hacks.Enabled && Hacks.CanAnyHacks
&& Hacks.CanSpeed ? 1 : 0.5f;
float xMoving = 0, zMoving = 0;
lastPos = Position = nextPos;

View File

@ -31,6 +31,7 @@ namespace ClassicalSharp {
public const string NoclipSlide = "hacks-noclipslide";
public const string CameraClipping = "hacks-cameraclipping";
public const string DoubleJump = "hacks-doublejump";
public const string FullBlockStep = "hacks-fullblockstep";
public const string TabAutocomplete = "gui-tab-autocomplete";
public const string ShowBlockInHand = "gui-blockinhand";