Skip to content

Commit

Permalink
feat: add in post party commands
Browse files Browse the repository at this point in the history
  • Loading branch information
darbyjack committed Feb 28, 2024
1 parent a932cb6 commit 55ac671
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,8 @@ internal object PartySettings : SettingsHolder
@Comment("Commands to be executed when a party has started")
val PARTY_COMMANDS: Property<Commands> = newBeanProperty(Commands::class.java, "party.party_commands", Commands(true, listOf("broadcast A Vote Party has started!")))

@JvmField
@Comment("Commands to be executed when a party has ended")
val POST_PARTY_COMMANDS: Property<Commands> = newBeanProperty(Commands::class.java, "party.post_party_commands", Commands(false, listOf("broadcast The Vote Party has ended!")))

}
9 changes: 9 additions & 0 deletions src/main/kotlin/me/clip/voteparty/handler/PartyHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ class PartyHandler(override val plugin: VotePartyPlugin) : Addon
executeCommands(settings.enabled, settings.commands)
}

fun runPostPartyCommands()
{
val settings = party.conf().getProperty(PartySettings.POST_PARTY_COMMANDS)

executeCommands(settings.enabled, settings.commands)
}

fun runPartyStartEffects()
{
val settings = party.conf().getProperty(EffectsSettings.PARTY_START)
Expand Down Expand Up @@ -229,6 +236,8 @@ class PartyHandler(override val plugin: VotePartyPlugin) : Addon
voted.clear()
val partyEndEvent = PartyEndEvent()
Bukkit.getPluginManager().callEvent(partyEndEvent)

runPostPartyCommands()
}
}

Expand Down

0 comments on commit 55ac671

Please sign in to comment.