Skip to content

Commit 12611a5

Browse files
authored
Merge pull request #619 from pylonmc/balugaq/recipes-loaded-event
Add RebarConfigurableRecipesLoadedEvent
2 parents bb2721f + a7d09d1 commit 12611a5

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

rebar/src/main/kotlin/io/github/pylonmc/rebar/Rebar.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ import io.github.pylonmc.rebar.recipe.RecipeType
8787
import io.github.pylonmc.rebar.registry.RebarRegistry
8888
import io.github.pylonmc.rebar.resourcepack.armor.ArmorTextureEngine
8989
import io.github.pylonmc.rebar.culling.BlockCullingEngine
90+
import io.github.pylonmc.rebar.event.RebarConfigurableRecipesLoadedEvent
9091
import io.github.pylonmc.rebar.util.mergeGlobalConfig
9192
import io.github.pylonmc.rebar.waila.Waila
9293
import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder
@@ -372,6 +373,7 @@ object Rebar : JavaPlugin(), RebarAddon {
372373

373374
val end = System.currentTimeMillis()
374375
logger.info("Loaded recipes in ${(end - start) / 1000.0}s")
376+
RebarConfigurableRecipesLoadedEvent().callEvent()
375377
}
376378

377379
private fun loadResearches() {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package io.github.pylonmc.rebar.event
2+
3+
import org.bukkit.event.Event
4+
import org.bukkit.event.HandlerList
5+
6+
/**
7+
* Called when all the configurable recipes are loaded
8+
*/
9+
class RebarConfigurableRecipesLoadedEvent: Event() {
10+
override fun getHandlers(): HandlerList
11+
= handlerList
12+
13+
companion object {
14+
@JvmStatic
15+
val handlerList: HandlerList = HandlerList()
16+
}
17+
}

0 commit comments

Comments
 (0)