mehboss / CustomRecipes

CustomRecipes source code
Mozilla Public License 2.0
2 stars 1 forks source link

[Feature Suggestion]: Wiki Additions/Rankup plugin integration for custom item requirements #17

Open MummieSenpai opened 1 year ago

MummieSenpai commented 1 year ago

What is your suggestion?

We are trying to use the new placeholders and are looking for a spesific usecase or some examples how to use the current placeholders. but there is no written documentation on the wiki currently.

in our use case one of the team is trying to use the placeholders to tie in the plugin "rankup3" so we can use the custom items crafted by the plugin in the rankup process. the easiest way to do is using something along the lines of %Identifier%

Thank you for reading the suggestion.

Can you show some examples?

What the wiki tab of placeholders could look like.

%placeholder1% Explanation what it does. Example use case.

%placeholder2% Explanation what it does. Example use case.

ect.

as for the new placeholder if not pressent. (%Identifier%) example use case : can be called upon to mark the correct item needed for /rankup. so the plugin can indentfy the correct %cursed_sword% and is ignoring anvil made items.

so would be looking like this within the rankup3 config

default:
  rank: 'default'
  next: 'coal'
  requirements:
    - 'money 10000'
    - 'xp-level 50'
    - '%Identifier% 64'

Beneficial to others?

the Wiki part would be beneficial for everyone. good documentation helps the end user out allot knowing what everything does and how it is intended to be used. ingame menus do help allot as well but noting beats a good documentation so new users know what the plugin can do and how it works in some cases.

as for the placeholder itself if its not present.

useful for use case as shown in the example section. bein able to link the custom items to a sell / buy shop without the risk of players selling counterfeit items.

Server Version

This server is running Paper version git-Paper-72 (MC: 1.20.1)

Server Mode

Online Mode

mehboss commented 1 year ago

Hello,

Per looking into this documentation, it may not be possible to utilize my placeholder integration feature for what you are trying to do. I have looked at this documentation, and it seems I might need to hook into the rank-up plugin directly in order to create a custom requirement field for my custom items so that you can do "%identifier% 64"

I will be renaming this thread to fit your needs and you can expect support and implementation for the Rankup plugin soon.

As far as actual placeholders, if you could submit another ticket for useful placeholders and what you have in mind for these placeholders and what information should be displayed, that would be great.

As far as the wiki goes, you can find the information on the main page of the spigot resource here. There are currently 4 placeholders that I have created for CustomRecipes. There are plenty more that PlaceholderAPI supports on their side though. I plan on adding an official wiki soon, I have just been a little busy.

If you can think of other placeholder ideas let me know. I hope this makes sense.

Thank you

Valorless commented 1 year ago

@MummieSenpai To better understand what you've written. You want CustomRecipes to add every recipe's Identifier into Rankup3's requirement system? I'm unfamiliar with Rankup3 as I use AutoRanks, but the premise seems the same.

An issue is that you can't use the placeholders in Rankup3's paths, unless Rankup3 parses the requirements for placeholders; so you'd just use the registered identifier instead.

default:
  rank: 'default'
  next: 'coal'
  requirements:
    - 'money 10000'
    - 'xp-level 50'
    - 'cursed_sword 64'

Would it check for the amount of a specific custom item crafted, or held in the player's inventory? If it's the amount crafted we'll have to store somewhere how many items were crafted, and check from there. This storage would of course not include past crafts.

As Boss states, he'll have to make CustomRecipes hook into Rankup3 to manually add the requirement entry. I haven't looked too deep into the code, but I wouldn't suspect this being too tough a challenge to do, after seeing the documentation: https://okx.sh/rankup/For-Developers.html

MummieSenpai commented 1 year ago

@Valorless

this is indeed how the placeholders work in rankup3. they support full placeholderAPI. i used %placeholder% in the suggestion to make it clear where i would use it but indeed it would be something like

default:
  rank: 'default'
  next: 'coal'
  requirements:
    - 'money 10000'
    - 'xp-level 50'
    - 'cursed_sword 64'

unless we can use one of the existing placeholders already made by mehboss that we are not aware off id like to know as well.

-mummie

Valorless commented 1 year ago

@MummieSenpai Thanks for clarifying ^^ Since I work in a different plugin environment than Boss, I can't say exactly how easy this is to add. But it could definitely be added :) I don't want to make promises on behalf of Boss, but I'll assist him when/if he chooses to work on this.

Valorless commented 1 year ago

Oh, by the way. I've updated the wiki on the recipes themselves, and will make a placeholder wiki alongside Boss, when we both have time for it ^^

mehboss commented 1 year ago

I can definitely add support for Rankup3. But the way you want me to do it (using placeholders) I think will not work the way you would expect because there is no way for me to attach an itemstack to it. I could potentially make it return the NamedSpacedKey, but I would have to see how Rankup3 does the itemstack requirement check. Definitely will be coming in the future regardless of how I need to do it!

Valorless commented 1 year ago

I think the best way to implement it would be registering all recipe identifiers into Rankup3, and using it that way. Kinda like my earlier reply:

@MummieSenpai To better understand what you've written. You want CustomRecipes to add every recipe's Identifier into Rankup3's requirement system? I'm unfamiliar with Rankup3 as I use AutoRanks, but the premise seems the same.

An issue is that you can't use the placeholders in Rankup3's paths, unless Rankup3 parses the requirements for placeholders; so you'd just use the registered identifier instead.

default:
  rank: 'default'
  next: 'coal'
  requirements:
    - 'money 10000'
    - 'xp-level 50'
    - 'cursed_sword 64'

Would it check for the amount of a specific custom item crafted, or held in the player's inventory? If it's the amount crafted we'll have to store somewhere how many items were crafted, and check from there. This storage would of course not include past crafts.

As Boss states, he'll have to make CustomRecipes hook into Rankup3 to manually add the requirement entry. I haven't looked too deep into the code, but I wouldn't suspect this being too tough a challenge to do, after seeing the documentation: https://okx.sh/rankup/For-Developers.html

Valorless commented 1 year ago

Implementation discussions has been moved into DMs between Boss and I, to not clutter this place.

mehboss commented 1 year ago

Hello, sorry about the wait on this feature. I am still currently reviewing the best possible way to go about this, it shouldn't be much longer.

I will get back with you soon.

Thank you.