mfnalex / ChestSort

Best sorting plugin for Minecraft / Spigot 1.14+
https://www.chestsort.de
GNU General Public License v3.0
91 stars 34 forks source link

Plugin Sorting Integrations #96

Closed NickNackGus closed 3 years ago

NickNackGus commented 3 years ago

Is your feature request related to a problem? Please describe. The server I help develop has some server-specific categories that are difficult to sort with the available options. Our particular case is item tiers via lore text, with unrelated lore text on the lines above and below.

Describe the solution you'd like I would like an API to replace custom sorting placeholders with sorting keys provided by external plugins. I am flexible on the exact interface. We may be able to provide a pull request if we have the time and a proposed interface.

Interface ideas include:

Describe alternatives you've considered

Additional context N/A

mfnalex commented 3 years ago

Hi, that is a good suggestion. It would be nice if you could create a PR since I am quite busy right now. How about the following:

ChestSort already calls the ChestSortEvent or something like that. That event could include a HashMap<ItemStack,List> with all the placeholder stuff, so that other plugins can change it.

If you have a better idea, feel free to do it another way ^^

NickNackGus commented 3 years ago

I'm not sure how to link the issue to the pull requests properly yet, so here's the links: https://github.com/JEFF-Media-GbR/Spigot-ChestSort/pull/97 https://github.com/JEFF-Media-GbR/Spigot-ChestSortAPI/pull/1

mfnalex commented 3 years ago

I will have a look at that in the next days, thanks for the PR!

NickNackGus commented 3 years ago

Just checking in - have you had a chance to look at this yet? Anything you need changed or explained? Or does this need example code to go with it?

mfnalex commented 3 years ago

Sorry I hadn't hat time yet. Does this break anything or is it just a "drag-and-drop" replacement if you know what I mean? ^^

NickNackGus commented 3 years ago

Don't worry about it, I just wanted to make sure it wasn't forgotten :slightly_smiling_face: It doesn't change how the plugin behaved before, only add the ability to add more sort options.

mfnalex commented 3 years ago

Are you using your custom version already? I really don't have time to test it myself but if you say that it works, I will release it for the public :)

NickNackGus commented 3 years ago

Actually, yes - I started using it on a live server with a couple hundred players a few weeks ago and haven't had any issues.