Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added /vp startmulti command #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/main/kotlin/me/clip/voteparty/cmds/CommandVoteParty.kt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@ internal class CommandVoteParty(override val plugin: VotePartyPlugin) : BaseComm
sendMessage(issuer, Messages.PARTY__FORCE_START_SUCCESSFUL)
}

@Subcommand("startmulti")
@Description("Start Multi")
@Syntax("<amount>")
@CommandPermission(ADMIN_PERM)
fun startMulti(issuer: CommandIssuer, amount: Int)
{
party.partyHandler.startParty(amount)
sendMessage(issuer, Messages.PARTY__FORCE_START_SUCCESSFUL)
}

@Subcommand("giveparty")
@CommandCompletion("@players")
@Description("Give Party")
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/me/clip/voteparty/handler/PartyHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PartyHandler(override val plugin: VotePartyPlugin) : Addon

var voted = mutableListOf<UUID>()

fun giveRandomPartyRewards(player: Player)
fun giveRandomPartyRewards(player: Player, amount: Int = 1)
{
if (player.world.name in party.conf().getProperty(PartySettings.DISABLED_WORLDS)) {
return
Expand All @@ -47,7 +47,7 @@ class PartyHandler(override val plugin: VotePartyPlugin) : Addon
return
}

val iter = settings.commands.takeRandomly(settings.max_possible).iterator()
val iter = settings.commands.takeRandomly(settings.max_possible * amount).iterator()

plugin.runTaskTimer(party.conf().getProperty(PartySettings.COMMAND_DELAY).toLong() * 20L)
{
Expand Down Expand Up @@ -150,7 +150,7 @@ class PartyHandler(override val plugin: VotePartyPlugin) : Addon
}
}

fun startParty()
fun startParty(amount: Int = 1)
{

val prePartyEvent = PrePartyEvent()
Expand Down Expand Up @@ -189,14 +189,14 @@ class PartyHandler(override val plugin: VotePartyPlugin) : Addon
if (party.conf().getProperty(PartySettings.USE_CRATE)) {
val disabledWorlds = party.conf().getProperty(PartySettings.DISABLED_WORLDS)
targets.filterNot { it.world.name in disabledWorlds }.forEach {
it.inventory.addItem(buildCrate(1))
it.inventory.addItem(buildCrate(amount))
}
}
else {
targets.forEach()
{
giveGuaranteedPartyRewards(it)
giveRandomPartyRewards(it)
giveRandomPartyRewards(it, amount)
givePermissionPartyRewards(it)
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/kotlin/me/clip/voteparty/messages/Messages.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum class Messages : MessageKeyProvider
DESCRIPTIONS__SETCOUNTER,
DESCRIPTIONS__ADDVOTE,
DESCRIPTIONS__STARTPARTY,
DESCRIPTIONS__STARTMULTI,
DESCRIPTIONS__GIVECRATE,
DESCRIPTIONS__GIVEPARTY,
DESCRIPTIONS__RELOAD,
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/languages/de-DE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ descriptions:
setcounter: "Setzt den aktuellen Stimmenzähler."
addvote: "Fügt Stimmen zu aktuellen Abzählung hinzu."
startparty: "Erzwingt eine VoteParty."
startmulti: "Force launch a multi-crate/reward party."
givecrate: "Versorge ein Player mit einem Vote."
giveparty: "Führt eine Private Vote Party für einen Spieler durch."
reload: "Lädt die Kon­fi­gu­ra­ti­on und die Sprach Daten erneut."
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/languages/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ descriptions:
setcounter: "Set the current vote counter."
addvote: "Add votes to the current vote tally."
startparty: "Force launch a VoteParty."
startmulti: "Force launch a multi-crate/reward party."
givecrate: "Supply a player with a Vote crate."
giveparty: "Host a private Vote Party for a player."
reload: "Reload the config and language file."
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/languages/fr-FR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ descriptions:
setcounter: "Régler le compteur de vote actuel."
addvote: "Ajouter les votes au décompte actuel."
startparty: "Forcer le lancement d'un VoteParty."
startmulti: "Force launch a multi-crate/reward party."
givecrate: "Fournir une caisse de vote à un joueur."
giveparty: "Organiser un VoteParty privée pour un joueur."
reload: "Rechargez le fichier de configuration."
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/languages/nl-NL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ descriptions:
setcounter: "Stel de huidige stem teller in."
addvote: "Voeg stemmen toe aan de huidige stemmentelling."
startparty: "Forceer het starten van een VoteParty."
startmulti: "Force launch a multi-crate/reward party."
givecrate: "Voorzie een speler van een Vote crate."
giveparty: "Organiseer een privé Vote Party voor een speler."
reload: "Herlaad het configuratie- en taalbestand."
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/languages/sv-SE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ descriptions:
setcounter: "Ange nuvarande röstantal."
addvote: "Lägg till röster i nuvarande rösträkning."
startparty: "Tvångs kör ett VoteParty."
startmulti: "Force launch a multi-crate/reward party."
givecrate: "Förse en spelare med en röstlåda."
giveparty: "Aktivera ett privat Vote Party för en spelare."
reload: "Ladda om konfigurations filerna."
Expand Down