diff --git a/fastcraft-bukkit/bukkit-1.13/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/recipe/BukkitFcRecipeProvider_1_13.kt b/fastcraft-bukkit/bukkit-1.13/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/recipe/BukkitFcRecipeProvider_1_13.kt new file mode 100644 index 00000000..0aeb0961 --- /dev/null +++ b/fastcraft-bukkit/bukkit-1.13/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/recipe/BukkitFcRecipeProvider_1_13.kt @@ -0,0 +1,28 @@ +package net.benwoodworth.fastcraft.bukkit.recipe + +import net.benwoodworth.fastcraft.bukkit.util.BukkitVersion +import org.bukkit.Server +import org.bukkit.plugin.Plugin +import javax.inject.Inject +import javax.inject.Singleton + +@Singleton +open class BukkitFcRecipeProvider_1_13 @Inject constructor( + plugin: Plugin, + bukkitVersion: BukkitVersion, + private val server: Server, + recipeFactory: BukkitFcCraftingRecipe.Factory, +) : BukkitFcRecipeProvider_1_7( + plugin = plugin, + bukkitVersion = bukkitVersion, + server = server, + recipeFactory = recipeFactory +) { + init { + warmUpRecipeIterator() + } + + private fun warmUpRecipeIterator() { + server.recipeIterator().forEach { _ -> } + } +} diff --git a/fastcraft-bukkit/bukkit-1.15/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/recipe/BukkitFcRecipeProvider_1_15.kt b/fastcraft-bukkit/bukkit-1.15/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/recipe/BukkitFcRecipeProvider_1_15.kt index f2cb3e5e..6d5b5e6d 100644 --- a/fastcraft-bukkit/bukkit-1.15/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/recipe/BukkitFcRecipeProvider_1_15.kt +++ b/fastcraft-bukkit/bukkit-1.15/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/recipe/BukkitFcRecipeProvider_1_15.kt @@ -17,7 +17,7 @@ open class BukkitFcRecipeProvider_1_15 @Inject constructor( bukkitVersion: BukkitVersion, server: Server, recipeFactory: BukkitFcCraftingRecipe.Factory, -) : BukkitFcRecipeProvider_1_7( +) : BukkitFcRecipeProvider_1_13( plugin = plugin, bukkitVersion = bukkitVersion, server = server, diff --git a/fastcraft-bukkit/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/BukkitFastCraft.kt b/fastcraft-bukkit/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/BukkitFastCraft.kt index d56c1bcb..663fcfce 100644 --- a/fastcraft-bukkit/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/BukkitFastCraft.kt +++ b/fastcraft-bukkit/src/main/kotlin/net/benwoodworth/fastcraft/bukkit/BukkitFastCraft.kt @@ -23,9 +23,6 @@ class BukkitFastCraft : JavaPlugin() { fastCraft = factory.createFastCraft() MetricsLite(this) - - // Initial iteration can be slow, so do it now instead of when FastCraft is opened - server.recipeIterator().forEach { _ -> } } override fun onDisable() {