-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow addons to add wiki pages to items #3937
base: master
Are you sure you want to change the base?
Conversation
Pro Tip!
If your changes do not fall into any of these categories, don't worry. You can just ignore this message in that case! 👀 |
Slimefun preview buildA Slimefun preview build is available for testing! https://preview-builds.walshy.dev/download/Slimefun/3937/69df2b59
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea but limiting the addon to be under one url + a placeholder imo isn't ideal. If there was a way to add a full link to an item on top of this I think it would be a good addition
Yea i agree with this, maybe we can have the wiki link be defaulted to the repo as how you have it now but allow it to be overridable with custom links. |
src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java
Outdated
Show resolved
Hide resolved
src/main/java/io/github/thebusybiscuit/slimefun4/utils/WikiUtils.java
Outdated
Show resolved
Hide resolved
For anyone would like to test this build using the preview jar, here is the modified Networks that utilized the methods added in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fully opposed to giving a way to provide wiki links for addons.
However...
Arbitrary links doesn't feel good. Domains will be bought, not renewed and snatched by others. I think we need to figure out the right approach to this rather than just throw this out there.
We do not want to be the ones responsible for someone getting malware on their system or seeing adult material due to a snatched domain.
Maybe add a warning message before sending the link in the chat? |
Warnings don’t mean much and are almost always ignored |
It is the player's choice to ignore the warning. |
i dont think this is the right approach we will still be kept accountable if someone gets a virus or something else. |
Maintaining a list of trusted wiki domain names could be a compromise, since no official addon wiki provided. |
Is creating a second repository for all addons an option?
…On 8/7/23, NoRainCity ***@***.***> wrote:
Maintaining a list of trusted wiki domain names could be a compromise, since
no official addon wiki provided.
--
Reply to this email directly or view it on GitHub:
#3937 (comment)
You are receiving this because you are subscribed to this thread.
Message ID: ***@***.***>
|
This comment was marked as off-topic.
This comment was marked as off-topic.
Sf could have a list of whitelisted links, GitHub, gitbook and other docs hosting platforms. In addition to a warn that the files hosted are not officially by slimefun and made by the addon developer if that makes sense. |
1 similar comment
This comment was marked as duplicate.
This comment was marked as duplicate.
Slimefun displays a message that contains the link when you click on the wiki button, so that will be fired. |
# Conflicts: # src/main/resources/languages/en/messages.yml
As I didnt get any response for panel thing, I just merged commits and resolved merge conflicts. |
src/main/java/io/github/thebusybiscuit/slimefun4/implementation/Slimefun.java
Outdated
Show resolved
Hide resolved
Have you tested this with an addon that uses this? |
Co-authored-by: J3fftw <[email protected]>
I tested this earlier with Networks (Sefiraat/Networks#152), now I'm gonna test this again. |
Yea let’s just call it wiki |
Agreed with Jeff, the item name can be Wiki to make it smaller while the error message is shown in chat. |
I changed the wiki button name to 'View this item on the %addon% wiki', where |
# Conflicts: # src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/PostSetup.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we stop another plugin changing the wiki pages of another?
If an addon or just random plugin wanted to they could loop through the items and change the wiki page right?
And if they did that to the core slimefun items it would still appear as "official" even if it isn't
Or you could make a slimefun item have an "official" wiki, if you register the item with the slimefun instance (which you shouldn't do but you could to trick this system)
good point, maybe once the item has a wiki page, the wiki page link cant be changed further. |
Its been a while. I wonder if I should remove |
Tested again with the modified Networks. |
Description
Nowadays there are more and more Slimefun addons, but only Slimefun items can have the wiki item in the recipe display. Some addons already have wiki, but players may not be able to know the wiki's existence, unless the developer add the wiki link via FlexItemGroup or using other ways. I think the wiki page item should be available to all the items that have wiki for them.
Tested with Sefiraat/Networks#152.
Proposed changes
getWikiURL()
inSlimefunAddon
to provide a base URL for addon wiki.getWikiPage(String)
inSlimefunItem
to allow items to have wiki pages.addOfficialWikipage
in favor ofgetWikiPage
.wiki.json
toWikiUtils
.Related Issues (if applicable)
N/A
Checklist
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values