[SPIGOT-8012] Option for Sorting Recipes Created: 22/Feb/25  Updated: 05/Mar/25  Resolved: 03/Mar/25

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Eisbaer Shirokuma Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None

Version: 4440-Spigot-e5a64e7-43f66f6
Guidelines Read: Yes

 Description   

Currently, the sorting of recipes in the Stonecutter is random (after a server restart, the recipes are in a different position again). It would be great if you could sort them yourself.



 Comments   
Comment by md_5 [ 05/Mar/25 ]

I cannot reproduce on 4442-Spigot-e5a64e7-42a4fa9. The order is always last to first (zombies, bedwards, battle royal .. 1v1) which is intended by the code I committed.

https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/42a4fa96f046d64dc2afff971d4a0dc26a1ba4b9#nms-patches%2Fnet%2Fminecraft%2Fworld%2Fitem%2Fcrafting%2FRecipeMap.patch?t=44

Comment by Eisbaer Shirokuma [ 04/Mar/25 ]

I used the version 4442-Spigot-e5a64e7-42a4fa9

Comment by md_5 [ 04/Mar/25 ]

Did you try the build released last night?

Comment by Eisbaer Shirokuma [ 04/Mar/25 ]

As expample i use this code (kotlin):

fun createGamemodeRecipes() {
    try {
        val gameModes = listOf(
            "1vs1" to oneVsOneItem,
            "assassins" to assassinsItem,
            "battleRoyale" to battleRoyaleItem,
            "bedwars" to bedwarsItem,
            "zombies" to zombiesItem
        )
        gameModes.forEach { (key, item) ->
            val namespacedKey = NamespacedKey(NvMHub.instance, key)
            val recipe = StonecuttingRecipe(namespacedKey, item, Material.RECOVERY_COMPASS)
            Bukkit.addRecipe(recipe)
        }
    } catch (e: Exception) {
        Bukkit.getLogger().severe(e.toString())
    }
} 

The first item in Stonecuter is the zombies item not the oneVsOneItem

Comment by md_5 [ 03/Mar/25 ]

Should be resolved. If not, please can you give more detailed reproduction steps

Comment by Eisbaer Shirokuma [ 26/Feb/25 ]

That would be also good

Comment by md_5 [ 26/Feb/25 ]

Any reason why it shouldn't just be done by insertion order? Like crafting recipes?

Generated at Sun Mar 30 02:41:58 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.