From 330470b9cddb7ffe1420709e01068146698c54d4 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Tue, 30 Nov 2021 09:55:34 -0800 Subject: [PATCH 1/8] register filled flask of knowledge and add respective RecipeType --- .../thebusybiscuit/slimefun4/api/recipes/RecipeType.java | 1 + .../slimefun4/implementation/setup/SlimefunItemSetup.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java index 828c78ddb..9fc0256f9 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/api/recipes/RecipeType.java @@ -56,6 +56,7 @@ public class RecipeType implements Keyed { public static final RecipeType MOB_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "mob_drop"), new CustomItemStack(Material.IRON_SWORD, "&bMob Drop"), RecipeType::registerMobDrop, "", "&rKill the specified Mob to obtain this Item"); public static final RecipeType BARTER_DROP = new RecipeType(new NamespacedKey(Slimefun.instance(), "barter_drop"), new CustomItemStack(Material.GOLD_INGOT, "&bBarter Drop"), RecipeType::registerBarterDrop, "&aBarter with piglins for a chance", "&ato obtain this item"); + public static final RecipeType INTERACT = new RecipeType(new NamespacedKey(Slimefun.instance(), "interact"), new CustomItemStack(Material.PLAYER_HEAD, "&bInteract", "", "&a&oRight click with this item")); public static final RecipeType HEATED_PRESSURE_CHAMBER = new RecipeType(new NamespacedKey(Slimefun.instance(), "heated_pressure_chamber"), SlimefunItems.HEATED_PRESSURE_CHAMBER); public static final RecipeType FOOD_FABRICATOR = new RecipeType(new NamespacedKey(Slimefun.instance(), "food_fabricator"), SlimefunItems.FOOD_FABRICATOR); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 8f5f86ceb..eb8dd69e8 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -1365,6 +1365,11 @@ public final class SlimefunItemSetup { new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) .register(plugin); + SlimefunItem filledFlask = new SlimefunItem(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}); + filledFlask.setHidden(false); + filledFlask.register(plugin); + new BirthdayCake(categories.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) .register(plugin); From e6d0584ced77a6c8e476b7639cb1756bde28aee7 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Tue, 30 Nov 2021 20:00:55 -0800 Subject: [PATCH 2/8] make filled flask nonconfigurable --- .../items/magical/FilledKnowledgeFlask.java | 21 +++++++++++++++++++ .../setup/SlimefunItemSetup.java | 8 +++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java new file mode 100644 index 000000000..8db5ba24f --- /dev/null +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java @@ -0,0 +1,21 @@ +package io.github.thebusybiscuit.slimefun4.implementation.items.magical; + +import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; +import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; +import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; +import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; + +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.inventory.ItemStack; + +public class FilledKnowledgeFlask extends SlimefunItem implements NotConfigurable { + + @ParametersAreNonnullByDefault + public FilledKnowledgeFlask(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + super(itemGroup, item, recipeType, recipe); + this.setHidden(true); + } + +} diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index eb8dd69e8..3d3d09522 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -137,6 +137,7 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSControlPan import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSMarkerTool; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitter; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.BeeWings; +import io.github.thebusybiscuit.slimefun4.implementation.items.magical.FilledKnowledgeFlask; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfernalBonemeal; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedHopper; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedMagnet; @@ -1365,10 +1366,9 @@ public final class SlimefunItemSetup { new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) .register(plugin); - SlimefunItem filledFlask = new SlimefunItem(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, - new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}); - filledFlask.setHidden(false); - filledFlask.register(plugin); + new FilledKnowledgeFlask(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, + new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}) + .register(plugin); new BirthdayCake(categories.birthday, new SlimefunItemStack("BIRTHDAY_CAKE", Material.CAKE, "&bBirthday Cake"), RecipeType.ENHANCED_CRAFTING_TABLE, new ItemStack[] {null, new ItemStack(Material.TORCH), null, new ItemStack(Material.SUGAR), new ItemStack(Material.CAKE), new ItemStack(Material.SUGAR), null, null, null}) From 4bb2bc8f26745a4ab65285e406f874ed3d8e4341 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Tue, 30 Nov 2021 20:19:57 -0800 Subject: [PATCH 3/8] documentation sure --- .../implementation/items/magical/FilledKnowledgeFlask.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java index 8db5ba24f..1c0882b7c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java @@ -10,6 +10,13 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.inventory.ItemStack; +/** + * The {@link FilledKnowledgeFlask} is a {@link NotConfigurable} {@link SlimefunItem} + * that results from interacting with a {@link KnowledgeFlask}. + * + * @see KnowledgeFlask + * + */ public class FilledKnowledgeFlask extends SlimefunItem implements NotConfigurable { @ParametersAreNonnullByDefault From 9d388445c115eacd8cd16fc10de7f688b86876bb Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd Date: Thu, 2 Dec 2021 10:10:29 -0800 Subject: [PATCH 4/8] generalize filled flask to hidden item --- .../FilledKnowledgeFlask.java => HiddenItem.java} | 12 +++++------- .../implementation/setup/SlimefunItemSetup.java | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) rename src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/{magical/FilledKnowledgeFlask.java => HiddenItem.java} (55%) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java similarity index 55% rename from src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java rename to src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index 1c0882b7c..a021ed5b7 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/magical/FilledKnowledgeFlask.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -1,4 +1,4 @@ -package io.github.thebusybiscuit.slimefun4.implementation.items.magical; +package io.github.thebusybiscuit.slimefun4.implementation.items; import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; @@ -11,16 +11,14 @@ import javax.annotation.ParametersAreNonnullByDefault; import org.bukkit.inventory.ItemStack; /** - * The {@link FilledKnowledgeFlask} is a {@link NotConfigurable} {@link SlimefunItem} - * that results from interacting with a {@link KnowledgeFlask}. - * - * @see KnowledgeFlask + * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} + * that is hidden from the Slimefun guide. * */ -public class FilledKnowledgeFlask extends SlimefunItem implements NotConfigurable { +public class HiddenItem extends SlimefunItem implements NotConfigurable { @ParametersAreNonnullByDefault - public FilledKnowledgeFlask(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { + public HiddenItem(ItemGroup itemGroup, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { super(itemGroup, item, recipeType, recipe); this.setHidden(true); } diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java index 3d3d09522..55dcadf84 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/setup/SlimefunItemSetup.java @@ -26,6 +26,7 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.Radioactivity; import io.github.thebusybiscuit.slimefun4.core.handlers.RainbowTickHandler; import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems; +import io.github.thebusybiscuit.slimefun4.implementation.items.HiddenItem; import io.github.thebusybiscuit.slimefun4.implementation.items.RadioactiveItem; import io.github.thebusybiscuit.slimefun4.implementation.items.VanillaItem; import io.github.thebusybiscuit.slimefun4.implementation.items.altar.AncientAltar; @@ -137,7 +138,6 @@ import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSControlPan import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSMarkerTool; import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitter; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.BeeWings; -import io.github.thebusybiscuit.slimefun4.implementation.items.magical.FilledKnowledgeFlask; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfernalBonemeal; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedHopper; import io.github.thebusybiscuit.slimefun4.implementation.items.magical.InfusedMagnet; @@ -1366,7 +1366,7 @@ public final class SlimefunItemSetup { new SlimefunItemStack(SlimefunItems.FLASK_OF_KNOWLEDGE, 8)) .register(plugin); - new FilledKnowledgeFlask(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, + new HiddenItem(categories.magicalGadgets, SlimefunItems.FILLED_FLASK_OF_KNOWLEDGE, RecipeType.INTERACT, new ItemStack[] {SlimefunItems.FLASK_OF_KNOWLEDGE, null, null, null, null, null, null, null, null}) .register(plugin); From c038e1ffc3ee8a80e2e041fa6f1e3979a977b048 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Wed, 12 Jan 2022 23:38:15 +0000 Subject: [PATCH 5/8] Apply suggestions from code review Co-authored-by: svr333 --- .../slimefun4/implementation/items/HiddenItem.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index a021ed5b7..7a6615f5c 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -13,7 +13,6 @@ import org.bukkit.inventory.ItemStack; /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. - * */ public class HiddenItem extends SlimefunItem implements NotConfigurable { @@ -22,5 +21,4 @@ public class HiddenItem extends SlimefunItem implements NotConfigurable { super(itemGroup, item, recipeType, recipe); this.setHidden(true); } - } From 6f5f5e585fe5a47bb1e894da87af682c73013b6f Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Thu, 20 Jan 2022 04:15:38 +0000 Subject: [PATCH 6/8] Update src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java Co-authored-by: poma123 <25465545+poma123@users.noreply.github.com> --- .../slimefun4/implementation/items/HiddenItem.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index 7a6615f5c..b2be1e00b 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -1,15 +1,15 @@ package io.github.thebusybiscuit.slimefun4.implementation.items; +import javax.annotation.ParametersAreNonnullByDefault; + +import org.bukkit.inventory.ItemStack; + import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem; import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack; import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType; import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; -import javax.annotation.ParametersAreNonnullByDefault; - -import org.bukkit.inventory.ItemStack; - /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. From bf3da7b8d5a83ad6fb96160e780f99f3aa731bec Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Thu, 20 Jan 2022 04:16:16 +0000 Subject: [PATCH 7/8] Update HiddenItem.java --- .../slimefun4/implementation/items/HiddenItem.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index b2be1e00b..464e0e609 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -13,6 +13,8 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. + * + * @author char321 */ public class HiddenItem extends SlimefunItem implements NotConfigurable { From 8c8a0d24ed830daa61e471d56b29680316395420 Mon Sep 17 00:00:00 2001 From: qwertyuioplkjhgfd <45241413+qwertyuioplkjhgfd@users.noreply.github.com> Date: Thu, 20 Jan 2022 04:17:34 +0000 Subject: [PATCH 8/8] Update HiddenItem.java --- .../slimefun4/implementation/items/HiddenItem.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java index 464e0e609..dcfaa8a10 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/HiddenItem.java @@ -13,8 +13,9 @@ import io.github.thebusybiscuit.slimefun4.core.attributes.NotConfigurable; /** * The {@link HiddenItem} is a {@link NotConfigurable} {@link SlimefunItem} * that is hidden from the Slimefun guide. - * + * * @author char321 + * */ public class HiddenItem extends SlimefunItem implements NotConfigurable {