mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add command to disable Gravity (#1955)
Allow disabling gravity (flying) for servers that allow this. /move gravity: show gravity handling status /move gravity on: enable gravity handling (falling) /move gravity off: disable gravity handling (flying) Co-authored-by: ORelio <ORelio@users.noreply.github.com>
This commit is contained in:
parent
288994aeec
commit
8795aab810
6 changed files with 33 additions and 14 deletions
|
|
@ -8,7 +8,7 @@ namespace MinecraftClient.Commands
|
|||
public class Move : Command
|
||||
{
|
||||
public override string CmdName { get { return "move"; } }
|
||||
public override string CmdUsage { get { return "move <on|off|get|up|down|east|west|north|south|x y z> [-f]"; } }
|
||||
public override string CmdUsage { get { return "move <on|off|get|up|down|east|west|north|south|x y z|gravity [on|off]> [-f]"; } }
|
||||
public override string CmdDesc { get { return "walk or start walking. \"-f\": force unsafe movements like falling or touching fire"; } }
|
||||
|
||||
public override string Run(McClient handler, string command, Dictionary<string, object> localVars)
|
||||
|
|
@ -35,6 +35,14 @@ namespace MinecraftClient.Commands
|
|||
handler.SetTerrainEnabled(false);
|
||||
return Translations.Get("cmd.move.disable");
|
||||
}
|
||||
else if (args[0] == "gravity")
|
||||
{
|
||||
if (args.Count >= 2)
|
||||
Settings.GravityEnabled = (args[1] == "on");
|
||||
if (Settings.GravityEnabled)
|
||||
return Translations.Get("cmd.move.gravity.enabled");
|
||||
else return Translations.Get("cmd.move.gravity.disabled");
|
||||
}
|
||||
else if (handler.GetTerrainEnabled())
|
||||
{
|
||||
if (args.Count == 1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue