-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging the latest release into the main branch. --------- Co-authored-by: Ren Binden <[email protected]> Co-authored-by: Donut <[email protected]>
- Loading branch information
1 parent
709ec27
commit 03174cc
Showing
22 changed files
with
357 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...kotlin/com/dansplugins/factionsystem/command/faction/dev/MfFactionDevPowerCycleCommand.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.dansplugins.factionsystem.command.faction.dev | ||
|
||
import com.dansplugins.factionsystem.MedievalFactions | ||
import com.dansplugins.factionsystem.player.MfPlayerId | ||
import org.bukkit.command.Command | ||
import org.bukkit.command.CommandExecutor | ||
import org.bukkit.command.CommandSender | ||
import org.bukkit.command.TabCompleter | ||
|
||
class MfFactionDevPowerCycleCommand(private val plugin: MedievalFactions) : CommandExecutor, TabCompleter { | ||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean { | ||
val onlinePlayers = plugin.server.onlinePlayers | ||
val onlineMfPlayerIds = onlinePlayers.map(MfPlayerId.Companion::fromBukkitPlayer) | ||
val disbandZeroPowerFactions = plugin.config.getBoolean("factions.zeroPowerFactionsGetDisbanded") | ||
val initialPower = plugin.config.getDouble("players.initialPower") | ||
plugin.server.scheduler.runTaskAsynchronously( | ||
plugin, | ||
Runnable { | ||
plugin.onPowerCycle( | ||
onlineMfPlayerIds, | ||
initialPower, | ||
onlinePlayers, | ||
disbandZeroPowerFactions | ||
) | ||
} | ||
) | ||
return true | ||
} | ||
|
||
override fun onTabComplete( | ||
sender: CommandSender, | ||
command: Command, | ||
label: String, | ||
args: Array<out String> | ||
) = emptyList<String>() | ||
} |
Oops, something went wrong.