-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Config Option -
players.minPower
(#1726)
## Description The `players.minPower` config option has been added, allowing players to have negative power. closes #1660 ## Testing This has been tested on a local 1.19.4 minecraft server. --------- Co-authored-by: Ren Binden <ren.binden@gmail.com>
- Loading branch information
1 parent
886dfe0
commit 43babd1
Showing
10 changed files
with
120 additions
and
53 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
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>() | ||
} |
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
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