frengor / UltimateAdvancementAPI

A powerful API to create custom advancements for your Minecraft server.
https://modrinth.com/plugin/ultimateadvancementapi
GNU General Public License v3.0
75 stars 5 forks source link

Utility method suggestion for textures #58

Open Fusezion opened 6 months ago

Fusezion commented 6 months ago

Add some form of static method to retrieve texture path from bukkit material. With the fact AdvancementRoot constructor forces a developer to define a texture path adding a little method to quickly convert material to the path would be increasingly useful.

EscanorTargaryen commented 6 months ago

Yes, it is a good idea, we will put it on the TODO list and include it in one of the next versions!

frengor commented 6 months ago

We discussed about it and the biggest issue implementing this feature would be the fact that materials doesn't always maps to only one texture. For example, the grass block has three textures but just one material.

Moreover, between versions the names of materials and textures changes, so supporting this would require a lot of effort.

Also, the vanilla texture pack is no longer shipped with the server (just discovered this :cry:), so it isn't possible to fetch textures at runtime based on it.

We do think this is something that would be nice to have, but the aforementioned issues pose a challenge to its implementation.
A possible solution might be creating a new library (or module) which does the mapping between materials and textures, but it has to resolve the mentioned issues (also note that the Material enum is being reworked by Spigot, so I wouldn't recommend depending on it too much).