Fixes and readme update
- fixed stop and resuming on player join/leave - fixed stop commandpull/4/head v1.0-alpha
parent
d69740851e
commit
29720e8451
@ -1,5 +1,18 @@
|
||||
# chunkmaster
|
||||
|
||||
Work in Progress. Wait for first release.
|
||||
This plugin can be used to pre-generate the region of a world around the spawn chunk. The plugin provides the commands
|
||||
|
||||
Goal is a plugin that pregenerates chunks around the world spawn.
|
||||
- /generate - Pre-generates chunks in the current world
|
||||
- /listgentasks - Lists all running generation tasks (and their ids)
|
||||
- /removegentask - Removes a generation task (stops it permanently)
|
||||
|
||||
The generation automatically pauses when a player joins the server (assuming the server was empty before)
|
||||
and resumes when the server is empty again. The generation also auto-resumes after a server
|
||||
restart. The plugin tracks the ticks per second and pauses the generation when the tps
|
||||
is lower than 2.
|
||||
|
||||
## Future Features
|
||||
|
||||
- pause generation tasks until restarted by command
|
||||
- configure the tps pause limit
|
||||
- specify how many chunks to generate for a task
|
@ -0,0 +1,19 @@
|
||||
package net.trivernis.chunkmaster.commands
|
||||
|
||||
import net.trivernis.chunkmaster.Chunkmaster
|
||||
import org.bukkit.command.Command
|
||||
import org.bukkit.command.CommandExecutor
|
||||
import org.bukkit.command.CommandSender
|
||||
|
||||
class CommandRemoveGenTask(private val chunkmaster: Chunkmaster): CommandExecutor {
|
||||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
|
||||
return if (command.testPermission(sender) && args.size == 1) {
|
||||
chunkmaster.generationManager.removeTask(args[1].toInt())
|
||||
sender.sendMessage("Task ${args[1].toInt()} canceled.")
|
||||
true
|
||||
} else {
|
||||
sender.sendMessage("Invalid argument.")
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue