From 881ea3f51f79acefb580e15276cf91112b85150b Mon Sep 17 00:00:00 2001 From: ybw0014 Date: Sun, 6 Aug 2023 08:53:57 -0400 Subject: [PATCH] feat(api): add custom wiki page --- .../slimefun4/api/items/SlimefunItem.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java index 32efd33483..13d31ce45f 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/items/SlimefunItem.java @@ -895,6 +895,18 @@ public final void addWikiPage(@Nonnull String page) { wikiURL = Optional.of(getAddon().getWikiURL().replace("%item%", page)); } + /** + * This method assign the given wiki URL to this Item. + * + * @param url + * The associated wiki page URL. + */ + public final void addCustomWikiPage(@Nonnull String url) { + Validate.notNull(url, "Wiki URL cannot be null."); + Validate.isTrue(getState() != ItemState.UNREGISTERED, "Wiki page can only be added after item has been registered."); + wikiURL = Optional.of(url); + } + /** * This method returns the wiki page that has been assigned to this item. * It will return null, if no wiki page was found.