Skip to content

Commit b8e5e23

Browse files
committed
Add a command to let users write-out the currently loaded configuration
1 parent d69ab59 commit b8e5e23

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/main/java/com/mcmoddev/orespawn/OreSpawn.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.mcmoddev.orespawn.api.SpawnEntry;
1212
import com.mcmoddev.orespawn.commands.AddOreCommand;
1313
import com.mcmoddev.orespawn.commands.ClearChunkCommand;
14+
import com.mcmoddev.orespawn.commands.WriteConfigsCommand;
1415
import com.mcmoddev.orespawn.commands.DumpBiomesCommand;
1516
import com.mcmoddev.orespawn.data.Config;
1617
import com.mcmoddev.orespawn.api.SpawnLogic;
@@ -105,5 +106,6 @@ public void onServerStarting(FMLServerStartingEvent ev) {
105106
ev.registerServerCommand(new ClearChunkCommand());
106107
ev.registerServerCommand(new DumpBiomesCommand());
107108
ev.registerServerCommand(new AddOreCommand());
109+
ev.registerServerCommand(new WriteConfigsCommand());
108110
}
109111
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.mcmoddev.orespawn.commands;
2+
3+
import com.mcmoddev.orespawn.OreSpawn;
4+
5+
import net.minecraft.command.CommandBase;
6+
import net.minecraft.command.CommandException;
7+
import net.minecraft.command.ICommandSender;
8+
import net.minecraft.server.MinecraftServer;
9+
10+
public class WriteConfigsCommand extends CommandBase {
11+
12+
@Override
13+
public String getName() {
14+
return "osSaveConfigs";
15+
}
16+
17+
@Override
18+
public String getUsage(ICommandSender sender) {
19+
return "/osSaveConfigs";
20+
}
21+
22+
@Override
23+
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
24+
OreSpawn.writer.writeSpawnEntries();
25+
}
26+
27+
}

0 commit comments

Comments
 (0)