Enable/Disable TerrainAndMovements while logged in

Feature requested in #705
This commit is contained in:
ORelio 2019-04-28 21:32:03 +02:00
parent 41b3f98924
commit a6e660c974
8 changed files with 126 additions and 19 deletions

View file

@ -579,13 +579,33 @@ namespace MinecraftClient
Handler.BotLoad(new ChatBots.Script(filename, playername));
}
/// <summary>
/// Check whether Terrain and Movements is enabled.
/// </summary>
/// <returns>Enable status.</returns>
public bool GetTerrainEnabled()
{
return Handler.GetTerrainEnabled();
}
/// <summary>
/// Enable or disable Terrain and Movements.
/// Please note that Enabling will be deferred until next relog, respawn or world change.
/// </summary>
/// <param name="enabled">Enabled</param>
/// <returns>TRUE if the setting was applied immediately, FALSE if delayed.</returns>
public bool SetTerrainEnabled(bool enabled)
{
return Handler.SetTerrainEnabled(enabled);
}
/// <summary>
/// Get the current Minecraft World
/// </summary>
/// <returns>Minecraft world or null if associated setting is disabled</returns>
protected Mapping.World GetWorld()
{
if (Settings.TerrainAndMovements)
if (GetTerrainEnabled())
return Handler.GetWorld();
return null;
}