/setspawn spawn shouldn't save into world file unless using /savespawn
This commit is contained in:
parent
679a28af0a
commit
a0c71e7b30
4 changed files with 178 additions and 6 deletions
|
|
@ -131,6 +131,7 @@ namespace TShockAPI
|
|||
ChatCommands.Add(new Command("maxspawns", "cfg", MaxSpawns));
|
||||
ChatCommands.Add(new Command("spawnrate", "cfg", SpawnRate));
|
||||
ChatCommands.Add(new Command("setspawn", "cfg", SetSpawn));
|
||||
ChatCommands.Add(new Command("savespawn", "cfg", SaveSpawn));
|
||||
ChatCommands.Add(new Command("time", "time", Time));
|
||||
ChatCommands.Add(new Command("slap", "pvpfun", Slap));
|
||||
ChatCommands.Add(new Command("antibuild", "editspawn", ToggleAntiBuild));
|
||||
|
|
@ -869,13 +870,21 @@ namespace TShockAPI
|
|||
|
||||
private static void SetSpawn(CommandArgs args)
|
||||
{
|
||||
Main.spawnTileX = args.Player.TileX;
|
||||
Main.spawnTileY = args.Player.TileY;
|
||||
ConfigurationManager.spawnTileX = args.Player.TileX;
|
||||
ConfigurationManager.spawnTileY = args.Player.TileY;
|
||||
ConfigurationManager.Spawn_WorldID = Main.worldID;
|
||||
ConfigurationManager.WriteJsonConfiguration();
|
||||
args.Player.SendMessage("Set server spawn point to your position");
|
||||
}
|
||||
|
||||
private static void SaveSpawn(CommandArgs args)
|
||||
{
|
||||
Main.spawnTileX = ConfigurationManager.spawnTileX;
|
||||
Main.spawnTileY = ConfigurationManager.spawnTileY;
|
||||
WorldGen.saveWorld();
|
||||
args.Player.SendMessage("Saved current spawn point to file.");
|
||||
}
|
||||
|
||||
private static void DebugConfiguration(CommandArgs args)
|
||||
{
|
||||
args.Player.SendMessage("TShock Config:");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue