From 6adf8820f707ca884eb6eefb7291037b9346b3f8 Mon Sep 17 00:00:00 2001 From: Boy Date: Mon, 13 May 2024 14:31:37 +0200 Subject: [PATCH] chore: bump idofront --- .../geary/papermc/features/items/recipes/ItemRecipeQuery.kt | 2 +- .../geary/papermc/features/items/recipes/SetRecipes.kt | 1 + .../com/mineinabyss/geary/papermc/plugin/GearyPluginImpl.kt | 3 ++- .../geary/papermc/tracking/items/GearyItemProvider.kt | 2 +- gradle.properties | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/ItemRecipeQuery.kt b/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/ItemRecipeQuery.kt index 5207dde..b9cb5d9 100644 --- a/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/ItemRecipeQuery.kt +++ b/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/ItemRecipeQuery.kt @@ -41,7 +41,7 @@ fun CachedQuery.registerRecipes(): Set { runCatching { val key = NamespacedKey(prefabKey.namespace, "${prefabKey.key}$i") // Register recipe only if not present - Bukkit.getRecipe(key) ?: recipe.toRecipe(key, result, recipes.group).register() + Bukkit.getRecipe(key) ?: recipe.toRecipe(key, result, recipes.group, recipes.category).register() if (recipes.discoverRecipes) discoveredRecipes += key }.onFailure { geary.logger.w { "Failed to register recipe ${prefabKey.key} #$i, ${it.message}" } diff --git a/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/SetRecipes.kt b/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/SetRecipes.kt index c894e23..da816ee 100644 --- a/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/SetRecipes.kt +++ b/geary-papermc-integrations/src/main/kotlin/com/mineinabyss/geary/papermc/features/items/recipes/SetRecipes.kt @@ -11,6 +11,7 @@ class SetRecipes( val recipes: List, val discoverRecipes: Boolean = false, val group: String = "", + val category: String = "MISC", val removeRecipes: List = listOf(), val result: SerializableItemStack? = null, ) diff --git a/geary-papermc-plugin/src/main/kotlin/com/mineinabyss/geary/papermc/plugin/GearyPluginImpl.kt b/geary-papermc-plugin/src/main/kotlin/com/mineinabyss/geary/papermc/plugin/GearyPluginImpl.kt index dcdc722..b897c8c 100644 --- a/geary-papermc-plugin/src/main/kotlin/com/mineinabyss/geary/papermc/plugin/GearyPluginImpl.kt +++ b/geary-papermc-plugin/src/main/kotlin/com/mineinabyss/geary/papermc/plugin/GearyPluginImpl.kt @@ -145,9 +145,10 @@ class GearyPluginImpl : GearyPlugin() { DI.add( object : SerializablePrefabItemService { - override fun encodeFromPrefab(item: ItemStack, prefabName: String) { + override fun encodeFromPrefab(item: ItemStack, prefabName: String): ItemStack { val result = gearyItems.createItem(PrefabKey.of(prefabName), item) require(result != null) { "Failed to create serializable ItemStack from $prefabName, does the prefab exist and have a geary:set.item component?" } + return result } }) diff --git a/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/items/GearyItemProvider.kt b/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/items/GearyItemProvider.kt index 21d168b..c140630 100644 --- a/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/items/GearyItemProvider.kt +++ b/geary-papermc-tracking/src/main/kotlin/com/mineinabyss/geary/papermc/tracking/items/GearyItemProvider.kt @@ -35,7 +35,7 @@ class GearyItemProvider { item.editMeta { it.persistentDataContainer.encodePrefabs(listOf(prefabKey)) } - return item.takeIf { it.type != Material.AIR } + return item.takeUnless { it.isEmpty } } /** diff --git a/gradle.properties b/gradle.properties index 6e6ce31..933cdbe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ kotlin.code.style=official group=com.mineinabyss version=0.30 -idofrontVersion=0.24.0-dev.7 +idofrontVersion=0.24.0-dev.9 gearyVersion=0.26.0-dev.26