diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/MMOItems.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/MMOItems.java index 22382721..b63b153c 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/MMOItems.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/MMOItems.java @@ -35,7 +35,7 @@ import net.Indyuce.mmoitems.comp.rpg.HeroesHook; import net.Indyuce.mmoitems.comp.rpg.McMMOHook; import net.Indyuce.mmoitems.comp.rpg.RPGHandler; import net.Indyuce.mmoitems.gui.PluginInventory; -import net.Indyuce.mmoitems.gui.edition.recipe.RecipeBrowserGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.RecipeTypeListGUI; import net.Indyuce.mmoitems.manager.*; import net.Indyuce.mmoitems.manager.data.PlayerDataManager; import net.Indyuce.mmoitems.util.PluginUtils; @@ -140,7 +140,7 @@ public class MMOItems extends JavaPlugin { new MMOItemsMetrics(); MMOItemUIFilter.register(); - RecipeBrowserGUI.registerNativeRecipes(); + RecipeTypeListGUI.registerNativeRecipes(); skillManager.initialize(false); final int configVersion = getConfig().contains("config-version", true) ? getConfig().getInt("config-version") : -1; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/AirIngredient.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/AirIngredient.java index 82d2d2b8..93d7c158 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/AirIngredient.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/AirIngredient.java @@ -4,6 +4,7 @@ import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; +@Deprecated public class AirIngredient extends WorkbenchIngredient { public AirIngredient() { super(0); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/MMOItemIngredient.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/MMOItemIngredient.java index 98483e17..3a89ff44 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/MMOItemIngredient.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/MMOItemIngredient.java @@ -7,6 +7,7 @@ import net.Indyuce.mmoitems.MMOItems; import net.Indyuce.mmoitems.api.Type; import io.lumine.mythic.lib.api.item.NBTItem; +@Deprecated public class MMOItemIngredient extends WorkbenchIngredient { private final Type type; private final String id; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/VanillaIngredient.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/VanillaIngredient.java index 6307db7b..929727e6 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/VanillaIngredient.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/VanillaIngredient.java @@ -6,6 +6,7 @@ import org.bukkit.inventory.RecipeChoice; import io.lumine.mythic.lib.api.item.NBTItem; +@Deprecated public class VanillaIngredient extends WorkbenchIngredient { private final Material material; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/WorkbenchIngredient.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/WorkbenchIngredient.java index 8131bbae..7409208d 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/WorkbenchIngredient.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/api/recipe/workbench/ingredients/WorkbenchIngredient.java @@ -3,6 +3,7 @@ package net.Indyuce.mmoitems.api.recipe.workbench.ingredients; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; +@Deprecated public abstract class WorkbenchIngredient { private final int amount; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/EditionInventory.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/EditionInventory.java index 16c0a479..793f0516 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/EditionInventory.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/EditionInventory.java @@ -32,7 +32,8 @@ import java.util.Optional; public abstract class EditionInventory extends PluginInventory { - protected final Inventory inventory; + @Nullable + protected Inventory inventory; /** * Item template currently being edited. This field is not final as it is @@ -81,8 +82,6 @@ public abstract class EditionInventory extends PluginInventory { player.getOpenInventory(); if (player.getOpenInventory().getTopInventory().getHolder() instanceof EditionInventory) this.cachedItem = ((EditionInventory) player.getOpenInventory().getTopInventory().getHolder()).cachedItem; - - inventory = Bukkit.createInventory(this, 54, getName()); } @Override @@ -93,10 +92,12 @@ public abstract class EditionInventory extends PluginInventory { public abstract void arrangeInventory(); /** - * Refreshes the inventory but does not open it again - * for the player. + * Refreshes the inventory but does not open it again for the player. + * Has the same clientside effect as {@link #open()} but does not + * create & open the inventory again. */ public void refreshInventory() { + Validate.notNull(inventory, "Inventory has never been opened"); inventory.clear(); // updateCachedItem(); addEditionItems(); @@ -122,6 +123,7 @@ public abstract class EditionInventory extends PluginInventory { */ @Override public void open() { + if (inventory == null) inventory = Bukkit.createInventory(this, 54, getName()); addEditionItems(); arrangeInventory(); super.open(); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeListGUI.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeListGUI.java index 4e7d9084..6f8f654f 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeListGUI.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeListGUI.java @@ -5,14 +5,13 @@ import io.lumine.mythic.lib.api.util.ItemFactory; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -56,8 +55,8 @@ public class RecipeListGUI extends EditionInventory { listedItem = getRecipeRegistry().getDisplayListItem(); // Obtain the crafting section - ConfigurationSection section = RecipeMakerGUI.getSection(getEditedSection(), "crafting"); - ConfigurationSection type = RecipeMakerGUI.getSection(section, kind.getRecipeConfigPath()); + ConfigurationSection section = RecipeEditorGUI.getSection(getEditedSection(), "crafting"); + ConfigurationSection type = RecipeEditorGUI.getSection(section, kind.getRecipeConfigPath()); // What is all the recipes within this kind? recipeNames.addAll(type.getKeys(false)); @@ -113,7 +112,7 @@ public class RecipeListGUI extends EditionInventory { if (p == recipeNames.size()) { // Rename list item... - inventory.setItem(absolute, RecipeMakerGUI.rename(new ItemStack(Material.NETHER_STAR), FFPMMOItems.get().getBodyFormat() + "Create new " + SilentNumbers.getItemName(getListedItem(), false))); + inventory.setItem(absolute, RecipeEditorGUI.rename(new ItemStack(Material.NETHER_STAR), FFPMMOItems.get().getBodyFormat() + "Create new " + SilentNumbers.getItemName(getListedItem(), false))); // If this slot is clicked, a new recipe will be created. createSlot = absolute; @@ -128,7 +127,7 @@ public class RecipeListGUI extends EditionInventory { } else { // Display name - inventory.setItem(absolute, RecipeMakerGUI.rename(getListedItem().clone(), FFPMMOItems.get().getBodyFormat() + "Edit " + FFPMMOItems.get().getInputFormat() + recipeNames.get(p))); + inventory.setItem(absolute, RecipeEditorGUI.rename(getListedItem().clone(), FFPMMOItems.get().getBodyFormat() + "Edit " + FFPMMOItems.get().getInputFormat() + recipeNames.get(p))); // Store recipeMap.put(absolute, recipeNames.get(p)); @@ -222,8 +221,8 @@ public class RecipeListGUI extends EditionInventory { if (recipeName != null) { // Delete that - ConfigurationSection section = RecipeMakerGUI.getSection(getEditedSection(), "crafting"); - ConfigurationSection type = RecipeMakerGUI.getSection(section, getRecipeRegistry().getRecipeConfigPath()); + ConfigurationSection section = RecipeEditorGUI.getSection(getEditedSection(), "crafting"); + ConfigurationSection type = RecipeEditorGUI.getSection(section, getRecipeRegistry().getRecipeConfigPath()); recipeNames.remove(recipeName); type.set(recipeName, null); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeBrowserGUI.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeTypeListGUI.java similarity index 97% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeBrowserGUI.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeTypeListGUI.java index 9591e9a6..2bba2bbf 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeBrowserGUI.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/RecipeTypeListGUI.java @@ -14,7 +14,6 @@ import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -33,7 +32,7 @@ import java.util.Set; * * @author Gunging */ -public class RecipeBrowserGUI extends EditionInventory { +public class RecipeTypeListGUI extends EditionInventory { // Item Stacks used in this inventory @NotNull private static final ItemStack NEXT_PAGE = ItemFactory.of(Material.ARROW).name(FFPMMOItems.get().getExampleFormat() + "Next Page").build(); @@ -48,7 +47,7 @@ public class RecipeBrowserGUI extends EditionInventory { * @param player Player that is editing recipes * @param template Template being edited */ - public RecipeBrowserGUI(@NotNull Player player, @NotNull MMOItemTemplate template) { + public RecipeTypeListGUI(@NotNull Player player, @NotNull MMOItemTemplate template) { super(player, template); // Start with defaults diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_AmountOutput.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_AmountOutput.java similarity index 91% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_AmountOutput.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_AmountOutput.java index 8ea479be..18032dcb 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_AmountOutput.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_AmountOutput.java @@ -1,4 +1,4 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.MythicLib; import io.lumine.mythic.lib.api.util.AltChar; @@ -8,7 +8,7 @@ import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.api.edition.StatEdition; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; @@ -33,11 +33,11 @@ public class RBA_AmountOutput extends RecipeButtonAction { * @param inv Inventory this button is part of * @param resultItem Output item of this recipe */ - public RBA_AmountOutput(@NotNull RecipeMakerGUI inv, @NotNull ItemStack resultItem) { + public RBA_AmountOutput(@NotNull RecipeEditorGUI inv, @NotNull ItemStack resultItem) { super(inv); // Get item - button = RecipeMakerGUI.rename(ItemFactory.of(resultItem.getType()).lore(SilentNumbers.chop( + button = RecipeEditorGUI.rename(ItemFactory.of(resultItem.getType()).lore(SilentNumbers.chop( "The amount of items produced every time the player crafts." , 65, "\u00a77")).build(), "\u00a7cChoose Output Amount"); @@ -67,7 +67,7 @@ public class RBA_AmountOutput extends RecipeButtonAction { @Override public boolean runPrimary() { // Query user for input - new StatEdition(inv, ItemStats.CRAFTING, RecipeMakerGUI.PRIMARY, this).enable(amountLog); + new StatEdition(inv, ItemStats.CRAFTING, RecipeEditorGUI.PRIMARY, this).enable(amountLog); // Success return true; @@ -141,7 +141,7 @@ public class RBA_AmountOutput extends RecipeButtonAction { ret.setAmount(getOutputAmount()); // That's it - return RecipeMakerGUI.addLore(ret, SilentNumbers.toArrayList( "", + return RecipeEditorGUI.addLore(ret, SilentNumbers.toArrayList( "", ChatColor.YELLOW + AltChar.listDash + " Right click to reset to 1.", ChatColor.YELLOW + AltChar.listDash + " Left click to edit amount." )); } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_CookingTime.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_CookingTime.java similarity index 81% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_CookingTime.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_CookingTime.java index f065191f..e5c7c6b8 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_CookingTime.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_CookingTime.java @@ -1,10 +1,10 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.api.util.ui.QuickNumberRange; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ItemFactory; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.type.RBA_DoubleButton; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.type.RBA_DoubleButton; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -17,7 +17,7 @@ public class RBA_CookingTime extends RBA_DoubleButton { * * @param inv The edition inventory this is a button of */ - public RBA_CookingTime(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_CookingTime(@NotNull RecipeEditorGUI inv) { super(inv); } public static final String FURNACE_TIME = "time"; @NotNull @Override public String getDoubleConfigPath() { return FURNACE_TIME; } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_DropGems.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_DropGems.java similarity index 79% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_DropGems.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_DropGems.java index 0ee5cdcc..bd50e284 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_DropGems.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_DropGems.java @@ -1,9 +1,9 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ItemFactory; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.type.RBA_BooleanButton; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.type.RBA_BooleanButton; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -21,7 +21,7 @@ public class RBA_DropGems extends RBA_BooleanButton { * * @param inv The edition inventory this is a button of */ - public RBA_DropGems(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_DropGems(@NotNull RecipeEditorGUI inv) { super(inv); } public static final String SMITH_GEMS = "drop-gems"; @NotNull @Override public String getBooleanConfigPath() { return SMITH_GEMS; } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_Experience.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_Experience.java similarity index 83% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_Experience.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_Experience.java index 8044f448..81d161a5 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_Experience.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_Experience.java @@ -1,10 +1,10 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.api.util.ui.QuickNumberRange; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ItemFactory; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.type.RBA_DoubleButton; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.type.RBA_DoubleButton; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -22,7 +22,7 @@ public class RBA_Experience extends RBA_DoubleButton { * * @param inv The edition inventory this is a button of */ - public RBA_Experience(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_Experience(@NotNull RecipeEditorGUI inv) { super(inv); } public static final String FURNACE_EXPERIENCE = "exp"; @NotNull @Override public String getDoubleConfigPath() { return FURNACE_EXPERIENCE; } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_HideFromBook.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_HideFromBook.java similarity index 88% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_HideFromBook.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_HideFromBook.java index f53e0fd7..6783aa9b 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_HideFromBook.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_HideFromBook.java @@ -1,11 +1,11 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ItemFactory; import net.Indyuce.mmoitems.MMOItems; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.type.RBA_BooleanButton; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.type.RBA_BooleanButton; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.Sound; @@ -27,7 +27,7 @@ public class RBA_HideFromBook extends RBA_BooleanButton { * * @param inv The edition inventory this is a button of */ - public RBA_HideFromBook(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_HideFromBook(@NotNull RecipeEditorGUI inv) { super(inv); } public static final String BOOK_HIDDEN = "hidden"; @NotNull @Override public String getBooleanConfigPath() { return BOOK_HIDDEN; } @@ -71,7 +71,7 @@ public class RBA_HideFromBook extends RBA_BooleanButton { String input = isEnabled() ? "\u00a7cNO\u00a78, it's hidden." : "\u00a7aYES\u00a78, it's shown."; // Copy and send - return RecipeMakerGUI.addLore(getBooleanButton().clone(), + return RecipeEditorGUI.addLore(getBooleanButton().clone(), SilentNumbers.toArrayList( "", "\u00a77Currently in Book? " + input, "", ChatColor.YELLOW + AltChar.listDash + " Right click to generate recipe unlock book.", diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_InputOutput.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_InputOutput.java similarity index 88% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_InputOutput.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_InputOutput.java index f0b38828..ec5c96fa 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_InputOutput.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_InputOutput.java @@ -1,9 +1,9 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ItemFactory; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -23,7 +23,7 @@ public class RBA_InputOutput extends RecipeButtonAction { * * @param inv The edition inventory this is a button of */ - public RBA_InputOutput(@NotNull RecipeMakerGUI inv) { + public RBA_InputOutput(@NotNull RecipeEditorGUI inv) { super(inv); // By default, input is shown. @@ -76,7 +76,7 @@ public class RBA_InputOutput extends RecipeButtonAction { String input = getInv().isShowingInput() ? "\u00a76INPUT" : "\u00a73OUTPUT"; // Copy and send - return RecipeMakerGUI.addLore(button.clone(), SilentNumbers.toArrayList("\u00a77Currently Showing: " + input, "", + return RecipeEditorGUI.addLore(button.clone(), SilentNumbers.toArrayList("\u00a77Currently Showing: " + input, "", ChatColor.YELLOW + AltChar.listDash + " Left click to switch mode." )); } } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_SmithingEnchantments.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_SmithingEnchantments.java similarity index 89% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_SmithingEnchantments.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_SmithingEnchantments.java index 1f370ac1..69fb0624 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_SmithingEnchantments.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_SmithingEnchantments.java @@ -1,10 +1,10 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ItemFactory; import net.Indyuce.mmoitems.api.crafting.recipe.SmithingCombinationType; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.type.RBA_ChooseableButton; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.type.RBA_ChooseableButton; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -23,7 +23,7 @@ public class RBA_SmithingEnchantments extends RBA_ChooseableButton { * * @param inv The edition inventory this is a button of */ - public RBA_SmithingEnchantments(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_SmithingEnchantments(@NotNull RecipeEditorGUI inv) { super(inv); } @NotNull final ItemStack chooseableButton = ItemFactory.of(Material.ENCHANTING_TABLE).name("\u00a7aEnchantment Transfer").lore(SilentNumbers.chop( "What will happen to the enchantments of the ingredients? Will enchanted ingredients produce an enchanted output item?" diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_SmithingUpgrades.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_SmithingUpgrades.java similarity index 91% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_SmithingUpgrades.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_SmithingUpgrades.java index 58021224..d2f49337 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RBA_SmithingUpgrades.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RBA_SmithingUpgrades.java @@ -1,10 +1,10 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import io.lumine.mythic.lib.api.util.ItemFactory; import net.Indyuce.mmoitems.api.crafting.recipe.SmithingCombinationType; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.type.RBA_ChooseableButton; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.type.RBA_ChooseableButton; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -22,7 +22,7 @@ public class RBA_SmithingUpgrades extends RBA_ChooseableButton { * * @param inv The edition inventory this is a button of */ - public RBA_SmithingUpgrades(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_SmithingUpgrades(@NotNull RecipeEditorGUI inv) { super(inv); } @NotNull final ItemStack chooseableButton = ItemFactory.of(Material.ANVIL).name("\u00a7aUpgrades Transfer").lore(SilentNumbers.chop( "What will happen to the upgrades of the ingredients? Will upgraded ingredients produce an upgraded output item?" diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RecipeButtonAction.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RecipeButtonAction.java similarity index 86% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RecipeButtonAction.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RecipeButtonAction.java index 33c9c7e2..b20b9edc 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/RecipeButtonAction.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/RecipeButtonAction.java @@ -1,8 +1,8 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba; +package net.Indyuce.mmoitems.gui.edition.recipe.button; import net.Indyuce.mmoitems.api.edition.StatEdition; import net.Indyuce.mmoitems.gui.edition.EditionInventory; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.stat.type.ItemStat; import org.bukkit.Sound; import org.bukkit.inventory.ItemStack; @@ -21,23 +21,23 @@ public abstract class RecipeButtonAction { /** * The edition inventory this is a button of */ - @NotNull final RecipeMakerGUI inv; + @NotNull final RecipeEditorGUI inv; /** * @return The edition inventory this is a button of */ - @NotNull public RecipeMakerGUI getInv() { return inv; } + @NotNull public RecipeEditorGUI getInv() { return inv; } /** * A button of an Edition Inventory. Nice! * * @param inv The edition inventory this is a button of */ - public RecipeButtonAction(@NotNull RecipeMakerGUI inv) { this.inv = inv; } + public RecipeButtonAction(@NotNull RecipeEditorGUI inv) { this.inv = inv; } /** * Called when the player left-clicks a slot.
* Important: When initializing a {@link StatEdition#StatEdition(EditionInventory, ItemStat, Object...)} you - * must pass {@link RecipeMakerGUI#PRIMARY} as the first info object! Also, make sure to pass {@code this} + * must pass {@link RecipeEditorGUI#PRIMARY} as the first info object! Also, make sure to pass {@code this} * as the second argument for {@link #primaryProcessInput(String, Object...)} to be called. * * @return true if and only if this action succeeded. Most importantly, @@ -62,7 +62,7 @@ public abstract class RecipeButtonAction { /** * Called when the player right-clicks a slot.
* Important: When initializing a {@link StatEdition#StatEdition(EditionInventory, ItemStat, Object...)} you - * must pass {@link RecipeMakerGUI#SECONDARY} as the first info object! Also, make sure to pass {@code this} + * must pass {@link RecipeEditorGUI#SECONDARY} as the first info object! Also, make sure to pass {@code this} * as the second argument for {@link #secondaryProcessInput(String, Object...)} to be called. * * @return true if and only if this action succeeded. Most importantly, diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_BooleanButton.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_BooleanButton.java similarity index 91% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_BooleanButton.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_BooleanButton.java index ed68b92d..033bd9f3 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_BooleanButton.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_BooleanButton.java @@ -1,9 +1,9 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba.type; +package net.Indyuce.mmoitems.gui.edition.recipe.button.type; import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RecipeButtonAction; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -19,7 +19,7 @@ public abstract class RBA_BooleanButton extends RecipeButtonAction { * * @param inv The edition inventory this is a button of */ - public RBA_BooleanButton(@NotNull RecipeMakerGUI inv) { + public RBA_BooleanButton(@NotNull RecipeEditorGUI inv) { super(inv); } @@ -97,7 +97,7 @@ public abstract class RBA_BooleanButton extends RecipeButtonAction { String input = isEnabled() ? "\u00a7aTRUE" : "\u00a7cFALSE"; // Copy and send - return RecipeMakerGUI.addLore(getBooleanButton().clone(), + return RecipeEditorGUI.addLore(getBooleanButton().clone(), SilentNumbers.toArrayList( "", "\u00a77Current Value: " + input, "", ChatColor.YELLOW + AltChar.listDash + " Right click to reset \u00a78(to\u00a74 FALSE\u00a78)\u00a7e.", diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_ChooseableButton.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_ChooseableButton.java similarity index 93% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_ChooseableButton.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_ChooseableButton.java index 9bf6abaa..d4e0d83e 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_ChooseableButton.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_ChooseableButton.java @@ -1,9 +1,9 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba.type; +package net.Indyuce.mmoitems.gui.edition.recipe.button.type; import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RecipeButtonAction; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -23,7 +23,7 @@ public abstract class RBA_ChooseableButton extends RecipeButtonAction { * * @param inv The edition inventory this is a button of */ - public RBA_ChooseableButton(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_ChooseableButton(@NotNull RecipeEditorGUI inv) { super(inv); } /** * Cycles to the next value @@ -105,7 +105,7 @@ public abstract class RBA_ChooseableButton extends RecipeButtonAction { addedDefinitions.add(pick + " " + AltChar.smallListDash + " \u00a77" + str); } // Clone button and add the lore - return RecipeMakerGUI.addLore(getChooseableButton().clone(), addedDefinitions); + return RecipeEditorGUI.addLore(getChooseableButton().clone(), addedDefinitions); } /** diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_DoubleButton.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_DoubleButton.java similarity index 91% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_DoubleButton.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_DoubleButton.java index 47000b97..59fccc2f 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/rba/type/RBA_DoubleButton.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/button/type/RBA_DoubleButton.java @@ -1,4 +1,4 @@ -package net.Indyuce.mmoitems.gui.edition.recipe.rba.type; +package net.Indyuce.mmoitems.gui.edition.recipe.button.type; import io.lumine.mythic.lib.api.util.AltChar; import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackProvider; @@ -7,8 +7,8 @@ import io.lumine.mythic.lib.api.util.ui.SilentNumbers; import net.Indyuce.mmoitems.ItemStats; import net.Indyuce.mmoitems.api.edition.StatEdition; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RecipeButtonAction; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.ChatColor; import org.bukkit.inventory.ItemStack; import org.jetbrains.annotations.NotNull; @@ -26,7 +26,7 @@ public abstract class RBA_DoubleButton extends RecipeButtonAction { * * @param inv The edition inventory this is a button of */ - public RBA_DoubleButton(@NotNull RecipeMakerGUI inv) { super(inv); } + public RBA_DoubleButton(@NotNull RecipeEditorGUI inv) { super(inv); } /** * @return Straight from the file, if this option is set to TRUE. @@ -46,7 +46,7 @@ public abstract class RBA_DoubleButton extends RecipeButtonAction { @Override public boolean runPrimary() { // Query user for input - new StatEdition(getInv(), ItemStats.CRAFTING, RecipeMakerGUI.PRIMARY, this).enable(requireInteger() ? integerLog : amountLog); + new StatEdition(getInv(), ItemStats.CRAFTING, RecipeEditorGUI.PRIMARY, this).enable(requireInteger() ? integerLog : amountLog); // Success return true; @@ -136,7 +136,7 @@ public abstract class RBA_DoubleButton extends RecipeButtonAction { @NotNull @Override public ItemStack getButton() { // Copy and send - return RecipeMakerGUI.addLore(getDoubleButton().clone(), + return RecipeEditorGUI.addLore(getDoubleButton().clone(), SilentNumbers.toArrayList( "", "\u00a77Current Value: " + getValue(), "", ChatColor.YELLOW + AltChar.listDash + " Right click to reset \u00a78(to\u00a74 " + getDefaultValue() + "\u00a78)\u00a7e.", diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_BurningLegacy.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_BurningLegacy.java index 8657aa3c..39b675d7 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_BurningLegacy.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_BurningLegacy.java @@ -3,12 +3,11 @@ package net.Indyuce.mmoitems.gui.edition.recipe.gui; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_BurningLegacy; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_CookingTime; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_Experience; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_HideFromBook; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_CookingTime; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_Experience; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_HideFromBook; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -21,7 +20,7 @@ import java.util.HashMap; * * @author Gunging */ -public class RMG_BurningLegacy extends RecipeMakerGUI { +public class RMG_BurningLegacy extends RecipeEditorGUI { @NotNull HashMap inputLinks = new HashMap<>(); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_MegaShaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_MegaShaped.java index 570104e1..854fb886 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_MegaShaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_MegaShaped.java @@ -3,10 +3,9 @@ package net.Indyuce.mmoitems.gui.edition.recipe.gui; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_MegaShaped; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_InputOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_InputOutput; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -17,7 +16,7 @@ import java.util.HashMap; * * @author Gunging */ -public class RMG_MegaShaped extends RecipeMakerGUI { +public class RMG_MegaShaped extends RecipeEditorGUI { @NotNull HashMap inputLinks = new HashMap<>(); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shaped.java index db98c7a1..931ba7b1 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shaped.java @@ -3,11 +3,10 @@ package net.Indyuce.mmoitems.gui.edition.recipe.gui; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_Shaped; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_HideFromBook; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_InputOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_HideFromBook; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_InputOutput; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.HashMap; @@ -17,7 +16,7 @@ import java.util.HashMap; * * @author Gunging */ -public class RMG_Shaped extends RecipeMakerGUI { +public class RMG_Shaped extends RecipeEditorGUI { @NotNull HashMap inputLinks = new HashMap<>(); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shapeless.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shapeless.java index c4e4a920..242350cd 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shapeless.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Shapeless.java @@ -3,12 +3,11 @@ package net.Indyuce.mmoitems.gui.edition.recipe.gui; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_Shapeless; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_HideFromBook; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_InputOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_HideFromBook; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_InputOutput; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -24,7 +23,7 @@ import java.util.HashMap; * * @author Gunging */ -public class RMG_Shapeless extends RecipeMakerGUI { +public class RMG_Shapeless extends RecipeEditorGUI { @NotNull final HashMap inputLinks = new HashMap<>(); @@ -43,9 +42,9 @@ public class RMG_Shapeless extends RecipeMakerGUI { addButton(new RBA_HideFromBook(this)); // Get section and build interpreter - ConfigurationSection crafting = RecipeMakerGUI.getSection(getEditedSection(), "crafting"); - ConfigurationSection recipe = RecipeMakerGUI.getSection(crafting, getRecipeRegistry().getRecipeConfigPath()); - ConfigurationSection name = RecipeMakerGUI.getSection(recipe, getRecipeName()); + ConfigurationSection crafting = RecipeEditorGUI.getSection(getEditedSection(), "crafting"); + ConfigurationSection recipe = RecipeEditorGUI.getSection(crafting, getRecipeRegistry().getRecipeConfigPath()); + ConfigurationSection name = RecipeEditorGUI.getSection(recipe, getRecipeName()); interpreter = new RMGRI_Shapeless(name); // Bind inputs diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Smithing.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Smithing.java index a7bcce00..0d25121a 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Smithing.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_Smithing.java @@ -3,14 +3,13 @@ package net.Indyuce.mmoitems.gui.edition.recipe.gui; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_Smithing; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_DropGems; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_InputOutput; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_SmithingEnchantments; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_SmithingUpgrades; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_DropGems; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_InputOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_SmithingEnchantments; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_SmithingUpgrades; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -26,7 +25,7 @@ import java.util.HashMap; * * @author Gunging */ -public class RMG_Smithing extends RecipeMakerGUI { +public class RMG_Smithing extends RecipeEditorGUI { @NotNull final HashMap inputLinks = new HashMap<>(); @@ -43,9 +42,9 @@ public class RMG_Smithing extends RecipeMakerGUI { super(player, template, recipeName, recipeRegistry); // Get section and build interpreter - ConfigurationSection crafting = RecipeMakerGUI.getSection(getEditedSection(), "crafting"); - ConfigurationSection recipe = RecipeMakerGUI.getSection(crafting, getRecipeRegistry().getRecipeConfigPath()); - ConfigurationSection name = RecipeMakerGUI.getSection(recipe, getRecipeName()); + ConfigurationSection crafting = RecipeEditorGUI.getSection(getEditedSection(), "crafting"); + ConfigurationSection recipe = RecipeEditorGUI.getSection(crafting, getRecipeRegistry().getRecipeConfigPath()); + ConfigurationSection name = RecipeEditorGUI.getSection(recipe, getRecipeName()); interpreter = new RMGRI_Smithing(name); // Bind inputs diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_SuperShaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_SuperShaped.java index 78d5f833..c8619ace 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_SuperShaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RMG_SuperShaped.java @@ -3,10 +3,9 @@ package net.Indyuce.mmoitems.gui.edition.recipe.gui; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_SuperShaped; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_InputOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_InputOutput; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.entity.Player; -import org.bukkit.inventory.Inventory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -17,7 +16,7 @@ import java.util.HashMap; * * @author Gunging */ -public class RMG_SuperShaped extends RecipeMakerGUI { +public class RMG_SuperShaped extends RecipeEditorGUI { @NotNull HashMap inputLinks = new HashMap<>(); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RecipeMakerGUI.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RecipeEditorGUI.java similarity index 98% rename from MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RecipeMakerGUI.java rename to MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RecipeEditorGUI.java index 8cf9427f..26429c44 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RecipeMakerGUI.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/gui/RecipeEditorGUI.java @@ -17,15 +17,14 @@ import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_AmountOutput; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RecipeButtonAction; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_AmountOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import org.bukkit.Material; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryClickEvent; -import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.jetbrains.annotations.NotNull; @@ -50,7 +49,7 @@ import java.util.UUID; * @author Gunging */ @SuppressWarnings("unused") -public abstract class RecipeMakerGUI extends EditionInventory { +public abstract class RecipeEditorGUI extends EditionInventory { /** * An editor for a recipe of this crafting system. @@ -66,7 +65,7 @@ public abstract class RecipeMakerGUI extends EditionInventory { * @param recipeName Name of this particular Recipe * @param recipeRegistry Load/Save Information of this Recipe Type */ - public RecipeMakerGUI(@NotNull Player player, @NotNull MMOItemTemplate template, @NotNull String recipeName, @NotNull RecipeRegistry recipeRegistry) { + public RecipeEditorGUI(@NotNull Player player, @NotNull MMOItemTemplate template, @NotNull String recipeName, @NotNull RecipeRegistry recipeRegistry) { super(player, template); // Store name diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_BurningLegacy.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_BurningLegacy.java index 0a170090..bbbc52fa 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_BurningLegacy.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_BurningLegacy.java @@ -1,7 +1,7 @@ package net.Indyuce.mmoitems.gui.edition.recipe.interpreter; import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -28,7 +28,7 @@ public class RMGRI_BurningLegacy implements RMG_RecipeInterpreter{ * * @param input The stuff that must be smelted */ - public void setInput(@Nullable ProvidedUIFilter input) { this.input = input == null ? RecipeMakerGUI.AIR : input; } + public void setInput(@Nullable ProvidedUIFilter input) { this.input = input == null ? RecipeEditorGUI.AIR : input; } @NotNull final ConfigurationSection section; /** @@ -50,8 +50,8 @@ public class RMGRI_BurningLegacy implements RMG_RecipeInterpreter{ // Furnaces support only input //noinspection ConstantConditions - input = ProvidedUIFilter.getFromString(RecipeMakerGUI.poofFromLegacy(recipeNameSection.getString(ITEM)), null); - if (input == null) { input = RecipeMakerGUI.AIR.clone(); } + input = ProvidedUIFilter.getFromString(RecipeEditorGUI.poofFromLegacy(recipeNameSection.getString(ITEM)), null); + if (input == null) { input = RecipeEditorGUI.AIR.clone(); } } @Override @@ -68,7 +68,7 @@ public class RMGRI_BurningLegacy implements RMG_RecipeInterpreter{ @Override public void editOutput(@NotNull ProvidedUIFilter input, int slot) { } - @Override public void deleteInput(int slot) { editInput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteInput(int slot) { editInput(RecipeEditorGUI.AIR.clone(), slot); } @Override public void deleteOutput(int slot) { } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_MegaShaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_MegaShaped.java index c577e634..ea85e1f9 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_MegaShaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_MegaShaped.java @@ -2,7 +2,7 @@ package net.Indyuce.mmoitems.gui.edition.recipe.interpreter; import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -64,7 +64,7 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { // Parse ProvidedUIFilter parsed = ProvidedUIFilter.getFromString(poof, null); - if (parsed == null) { parsed = RecipeMakerGUI.AIR.clone(); } + if (parsed == null) { parsed = RecipeEditorGUI.AIR.clone(); } // Add ret[r][p] = parsed; } } @@ -114,7 +114,7 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { // Build for (ProvidedUIFilter poof : poofs) { ProvidedUIFilter providedUIFilter = poof; - if (providedUIFilter == null) { providedUIFilter = RecipeMakerGUI.AIR.clone(); } + if (providedUIFilter == null) { providedUIFilter = RecipeEditorGUI.AIR.clone(); } // Add bar if (sb.length() != 0) { sb.append("|"); } @@ -182,8 +182,8 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { section = recipeNameSection; // Build Input list - inputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)); - outputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)); + inputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)); + outputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)); } @Override @@ -193,7 +193,7 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { setInput(slot, input); // Save - section.set(RecipeMakerGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); + section.set(RecipeEditorGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); } @Override @@ -203,12 +203,12 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { setOutput(slot, input); // Save - section.set(RecipeMakerGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); + section.set(RecipeEditorGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); } - @Override public void deleteInput(int slot) { editInput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteInput(int slot) { editInput(RecipeEditorGUI.AIR.clone(), slot); } - @Override public void deleteOutput(int slot) { editOutput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteOutput(int slot) { editOutput(RecipeEditorGUI.AIR.clone(), slot); } //region Updater, to update old recipes /** @@ -247,7 +247,7 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } } // Build and return @@ -268,7 +268,7 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } } // Build and return @@ -278,7 +278,7 @@ public class RMGRI_MegaShaped implements RMG_RecipeInterpreter { } else { // Just that i guess - return RecipeMakerGUI.poofFromLegacy(curr) + "|v AIR 0|v AIR 0|v AIR 0|v AIR 0|v AIR 0"; + return RecipeEditorGUI.poofFromLegacy(curr) + "|v AIR 0|v AIR 0|v AIR 0|v AIR 0|v AIR 0"; } } public static final String emptyRow = "v AIR 0|v AIR 0|v AIR 0|v AIR 0|v AIR 0|v AIR 0"; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shaped.java index 23bf3f86..b7ebb371 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shaped.java @@ -2,7 +2,7 @@ package net.Indyuce.mmoitems.gui.edition.recipe.interpreter; import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -59,7 +59,7 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { // Parse ProvidedUIFilter parsed = ProvidedUIFilter.getFromString(poof, null); - if (parsed == null) { parsed = RecipeMakerGUI.AIR.clone(); } + if (parsed == null) { parsed = RecipeEditorGUI.AIR.clone(); } // Add ret[r][p] = parsed; } } @@ -102,7 +102,7 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { // Build for (ProvidedUIFilter poof : poofs) { ProvidedUIFilter providedUIFilter = poof; - if (providedUIFilter == null) { providedUIFilter = RecipeMakerGUI.AIR.clone(); } + if (providedUIFilter == null) { providedUIFilter = RecipeEditorGUI.AIR.clone(); } // Add bar if (sb.length() != 0) { sb.append("|"); } @@ -162,7 +162,7 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { /** * Generate an interpreter from this updated configuration section. *

- * By 'updated' I mean that, for now, we should call {@link RecipeMakerGUI#moveInput()} + * By 'updated' I mean that, for now, we should call {@link RecipeEditorGUI#moveInput()} * on this configuration before passing it here, to move the input list from being the recipe name * section itself to the 'input' section within. * @@ -174,8 +174,8 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { section = recipeNameSection; // Build Input list - inputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)); - outputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)); + inputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)); + outputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)); } @Override @@ -185,7 +185,7 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { setInput(slot, input); // Save - section.set(RecipeMakerGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); + section.set(RecipeEditorGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); } @Override @@ -195,12 +195,12 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { setOutput(slot, input); // Save - section.set(RecipeMakerGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); + section.set(RecipeEditorGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); } - @Override public void deleteInput(int slot) { editInput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteInput(int slot) { editInput(RecipeEditorGUI.AIR.clone(), slot); } - @Override public void deleteOutput(int slot) { editOutput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteOutput(int slot) { editOutput(RecipeEditorGUI.AIR.clone(), slot); } //region Updater, to update old recipes /** @@ -239,7 +239,7 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } } // Build and return @@ -260,7 +260,7 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } } // Build and return @@ -270,7 +270,7 @@ public class RMGRI_Shaped implements RMG_RecipeInterpreter { } else { // Just that i guess - return RecipeMakerGUI.poofFromLegacy(curr) + "|v AIR 0|v AIR 0"; + return RecipeEditorGUI.poofFromLegacy(curr) + "|v AIR 0|v AIR 0"; } } public static final String emptyRow = "v AIR 0|v AIR 0|v AIR 0"; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shapeless.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shapeless.java index d61cf548..e1bfa1ad 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shapeless.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Shapeless.java @@ -1,7 +1,7 @@ package net.Indyuce.mmoitems.gui.edition.recipe.interpreter; import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -49,11 +49,11 @@ public class RMGRI_Shapeless implements RMG_RecipeInterpreter { String row = config.size() > r ? config.get(r) : null; // Update it ig - String poof = RecipeMakerGUI.poofFromLegacy(row); + String poof = RecipeEditorGUI.poofFromLegacy(row); // Parse ProvidedUIFilter parsed = ProvidedUIFilter.getFromString(poof, null); - if (parsed == null) { parsed = RecipeMakerGUI.AIR.clone(); } + if (parsed == null) { parsed = RecipeEditorGUI.AIR.clone(); } // Add ret[r] = parsed; @@ -93,7 +93,7 @@ public class RMGRI_Shapeless implements RMG_RecipeInterpreter { for (int r = 0; r < 9; r++) { // Get row - ProvidedUIFilter poof = ingredients.length > r ? ingredients[r] : RecipeMakerGUI.AIR.clone(); + ProvidedUIFilter poof = ingredients.length > r ? ingredients[r] : RecipeEditorGUI.AIR.clone(); // Add poof ret.add(poof.toString()); @@ -148,7 +148,7 @@ public class RMGRI_Shapeless implements RMG_RecipeInterpreter { /** * Generate an interpreter from this updated configuration section. *

- * By 'updated' I mean that, for now, we should call {@link RecipeMakerGUI#moveInput(ConfigurationSection, String)} + * By 'updated' I mean that, for now, we should call {@link RecipeEditorGUI#moveInput(ConfigurationSection, String)} * on this configuration before passing it here, to move the input list from being the recipe name * section itself to the 'input' section within. * @@ -160,8 +160,8 @@ public class RMGRI_Shapeless implements RMG_RecipeInterpreter { section = recipeNameSection; // Build Input list - inputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)); - outputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)); + inputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)); + outputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)); } @Override @@ -171,7 +171,7 @@ public class RMGRI_Shapeless implements RMG_RecipeInterpreter { setInput(slot, input); // Save - section.set(RecipeMakerGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); + section.set(RecipeEditorGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); } @Override @@ -181,10 +181,10 @@ public class RMGRI_Shapeless implements RMG_RecipeInterpreter { setOutput(slot, input); // Save - section.set(RecipeMakerGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); + section.set(RecipeEditorGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); } - @Override public void deleteInput(int slot) { editInput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteInput(int slot) { editInput(RecipeEditorGUI.AIR.clone(), slot); } - @Override public void deleteOutput(int slot) { editOutput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteOutput(int slot) { editOutput(RecipeEditorGUI.AIR.clone(), slot); } } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Smithing.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Smithing.java index 2994a037..b3e4dae6 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Smithing.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_Smithing.java @@ -1,7 +1,7 @@ package net.Indyuce.mmoitems.gui.edition.recipe.interpreter; import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -68,7 +68,7 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { /** * Generate an interpreter from this updated configuration section. *

- * By 'updated' I mean that, for now, we should call {@link RecipeMakerGUI#moveInput()} + * By 'updated' I mean that, for now, we should call {@link RecipeEditorGUI#moveInput()} * on this configuration before passing it here, to move the input list from being the recipe name * section itself to the 'input' section within. * @@ -82,8 +82,8 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { /* * Read input and output from the file */ - String input = updateIngredients(section.getString(RecipeMakerGUI.INPUT_INGREDIENTS)); - String output = updateIngredients(section.getString(RecipeMakerGUI.OUTPUT_INGREDIENTS)); + String input = updateIngredients(section.getString(RecipeEditorGUI.INPUT_INGREDIENTS)); + String output = updateIngredients(section.getString(RecipeEditorGUI.OUTPUT_INGREDIENTS)); // Split String[] inputSplit = input.split("\\|"); @@ -95,10 +95,10 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { ProvidedUIFilter outputIngotParse = ProvidedUIFilter.getFromString(outputSplit[1], null); // Build Input list - inputItem = inputItemParse != null ? inputItemParse : RecipeMakerGUI.AIR.clone(); - inputIngot = inputIngotParse != null ? inputIngotParse : RecipeMakerGUI.AIR.clone(); - outputItem = outputItemParse != null ? outputItemParse : RecipeMakerGUI.AIR.clone(); - outputIngot = outputIngotParse != null ? outputIngotParse : RecipeMakerGUI.AIR.clone(); + inputItem = inputItemParse != null ? inputItemParse : RecipeEditorGUI.AIR.clone(); + inputIngot = inputIngotParse != null ? inputIngotParse : RecipeEditorGUI.AIR.clone(); + outputItem = outputItemParse != null ? outputItemParse : RecipeEditorGUI.AIR.clone(); + outputIngot = outputIngotParse != null ? outputIngotParse : RecipeEditorGUI.AIR.clone(); } /** @@ -134,7 +134,7 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { setInput(slot, input); // Save - section.set(RecipeMakerGUI.INPUT_INGREDIENTS, toYML(getInputItem(), getInputIngot())); + section.set(RecipeEditorGUI.INPUT_INGREDIENTS, toYML(getInputItem(), getInputIngot())); } @Override @@ -144,12 +144,12 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { setOutput(slot, input); // Save - section.set(RecipeMakerGUI.OUTPUT_INGREDIENTS, toYML(getOutputItem(), getOutputIngot())); + section.set(RecipeEditorGUI.OUTPUT_INGREDIENTS, toYML(getOutputItem(), getOutputIngot())); } - @Override public void deleteInput(int slot) { editInput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteInput(int slot) { editInput(RecipeEditorGUI.AIR.clone(), slot); } - @Override public void deleteOutput(int slot) { editOutput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteOutput(int slot) { editOutput(RecipeEditorGUI.AIR.clone(), slot); } //region Updater, to update old recipes /** @@ -188,7 +188,7 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR -"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR -"); } } // Build and return @@ -209,7 +209,7 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR -"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR -"); } } // Build and return @@ -219,7 +219,7 @@ public class RMGRI_Smithing implements RMG_RecipeInterpreter { } else { // Just that i guess - return RecipeMakerGUI.poofFromLegacy(curr) + "|v AIR 0"; + return RecipeEditorGUI.poofFromLegacy(curr) + "|v AIR 0"; } } public static final String emptyIngredients = "v AIR -|v AIR -"; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_SuperShaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_SuperShaped.java index 88ed5193..64766ff0 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_SuperShaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/interpreter/RMGRI_SuperShaped.java @@ -2,7 +2,7 @@ package net.Indyuce.mmoitems.gui.edition.recipe.interpreter; import io.lumine.mythic.lib.api.crafting.uimanager.ProvidedUIFilter; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -62,7 +62,7 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { // Parse ProvidedUIFilter parsed = ProvidedUIFilter.getFromString(poof, null); - if (parsed == null) { parsed = RecipeMakerGUI.AIR.clone(); } + if (parsed == null) { parsed = RecipeEditorGUI.AIR.clone(); } // Add ret[r][p] = parsed; } } @@ -110,7 +110,7 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { // Build for (ProvidedUIFilter poof : poofs) { ProvidedUIFilter providedUIFilter = poof; - if (providedUIFilter == null) { providedUIFilter = RecipeMakerGUI.AIR.clone(); } + if (providedUIFilter == null) { providedUIFilter = RecipeEditorGUI.AIR.clone(); } // Add bar if (sb.length() != 0) { sb.append("|"); } @@ -170,7 +170,7 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { /** * Generate an interpreter from this updated configuration section. *

- * By 'updated' I mean that, for now, we should call {@link RecipeMakerGUI#moveInput()} + * By 'updated' I mean that, for now, we should call {@link RecipeEditorGUI#moveInput()} * on this configuration before passing it here, to move the input list from being the recipe name * section itself to the 'input' section within. * @@ -182,8 +182,8 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { section = recipeNameSection; // Build Input list - inputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)); - outputRecipe = buildIngredientsFromList(section.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)); + inputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)); + outputRecipe = buildIngredientsFromList(section.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)); } @Override @@ -193,7 +193,7 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { setInput(slot, input); // Save - section.set(RecipeMakerGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); + section.set(RecipeEditorGUI.INPUT_INGREDIENTS, toYML(inputRecipe)); } @Override @@ -203,12 +203,12 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { setOutput(slot, input); // Save - section.set(RecipeMakerGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); + section.set(RecipeEditorGUI.OUTPUT_INGREDIENTS, toYML(outputRecipe)); } - @Override public void deleteInput(int slot) { editInput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteInput(int slot) { editInput(RecipeEditorGUI.AIR.clone(), slot); } - @Override public void deleteOutput(int slot) { editOutput(RecipeMakerGUI.AIR.clone(), slot); } + @Override public void deleteOutput(int slot) { editOutput(RecipeEditorGUI.AIR.clone(), slot); } //region Updater, to update old recipes /** @@ -247,7 +247,7 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } } // Build and return @@ -268,7 +268,7 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { if (r != 0) { ret.append("|"); } // Array has it? - if (r < curSplit.length) { ret.append(RecipeMakerGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } + if (r < curSplit.length) { ret.append(RecipeEditorGUI.poofFromLegacy(curSplit[r])); } else { ret.append("v AIR 0"); } } // Build and return @@ -278,7 +278,7 @@ public class RMGRI_SuperShaped implements RMG_RecipeInterpreter { } else { // Just that i guess - return RecipeMakerGUI.poofFromLegacy(curr) + "|v AIR 0|v AIR 0|v AIR 0|v AIR 0"; + return RecipeEditorGUI.poofFromLegacy(curr) + "|v AIR 0|v AIR 0|v AIR 0|v AIR 0"; } } public static final String emptyRow = "v AIR 0|v AIR 0|v AIR 0|v AIR 0|v AIR 0"; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_LegacyBurning.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_LegacyBurning.java index bd4036c5..e389fb98 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_LegacyBurning.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_LegacyBurning.java @@ -11,11 +11,11 @@ import net.Indyuce.mmoitems.api.recipe.workbench.ingredients.WorkbenchIngredient import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.recipe.gui.RMG_BurningLegacy; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_AmountOutput; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_CookingTime; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_Experience; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_HideFromBook; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_AmountOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_CookingTime; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_Experience; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_HideFromBook; import net.Indyuce.mmoitems.gui.edition.recipe.registry.burninglegacy.BurningRecipeInformation; import net.Indyuce.mmoitems.manager.RecipeManager; import org.apache.commons.lang.Validate; @@ -45,7 +45,7 @@ public abstract class RMGRR_LegacyBurning implements RecipeRegistry { @SuppressWarnings("NotNullFieldNotInitialized") @NotNull - private final ItemStack displayListItem = RecipeMakerGUI.rename(getLegacyBurningType().getItem(), FFPMMOItems.get().getExampleFormat() + capitalizeFirst(getRecipeConfigPath()) + " Recipe"); + private final ItemStack displayListItem = RecipeEditorGUI.rename(getLegacyBurningType().getItem(), FFPMMOItems.get().getExampleFormat() + capitalizeFirst(getRecipeConfigPath()) + " Recipe"); @NotNull @Override @@ -66,7 +66,7 @@ public abstract class RMGRR_LegacyBurning implements RecipeRegistry { Validate.isTrue(namespace.getValue() != null); // Get correct section - ConfigurationSection recipeSection = RecipeMakerGUI.getSection(recipeTypeSection, recipeName); + ConfigurationSection recipeSection = RecipeEditorGUI.getSection(recipeTypeSection, recipeName); // Get ingredient String itemIngredient = recipeSection.getString("item"); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_MegaShaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_MegaShaped.java index a0555d63..d7be1d8d 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_MegaShaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_MegaShaped.java @@ -14,9 +14,9 @@ import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_MegaShaped; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_AmountOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_AmountOutput; import net.Indyuce.mmoitems.gui.edition.recipe.gui.RMG_MegaShaped; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.configuration.ConfigurationSection; @@ -31,7 +31,7 @@ public class RMGRR_MegaShaped implements RecipeRegistry { @Override public String getRecipeConfigPath() { return "megashaped"; } @NotNull @Override public String getRecipeTypeName() { return "Mega Shaped"; } - @NotNull final ItemStack displayListItem = RecipeMakerGUI.rename(new ItemStack(Material.JUKEBOX), FFPMMOItems.get().getExampleFormat() + "Mega Shaped Recipe"); + @NotNull final ItemStack displayListItem = RecipeEditorGUI.rename(new ItemStack(Material.JUKEBOX), FFPMMOItems.get().getExampleFormat() + "Mega Shaped Recipe"); @NotNull @Override public ItemStack getDisplayListItem() { return displayListItem; } @Override public void openForPlayer(@NotNull EditionInventory inv, @NotNull String recipeName, Object... otherParams) { @@ -43,17 +43,17 @@ public class RMGRR_MegaShaped implements RecipeRegistry { public MythicRecipeBlueprint sendToMythicLib(@NotNull MMOItemTemplate template, @NotNull ConfigurationSection recipeTypeSection, @NotNull String recipeName, @NotNull Ref namespace, @NotNull FriendlyFeedbackProvider ffp) throws IllegalArgumentException { // Read some values - ConfigurationSection recipeSection = RecipeMakerGUI.moveInput(recipeTypeSection, recipeName); + ConfigurationSection recipeSection = RecipeEditorGUI.moveInput(recipeTypeSection, recipeName); NamespacedKey nk = namespace.getValue(); if (nk == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Illegal (Null) Namespace")); } // Identify the input - ShapedRecipe input = megaShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)), ffp); + ShapedRecipe input = megaShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)), ffp); if (input == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Shaped recipe containing only AIR, $fignored$b.")); } // Read the options and output - ShapedRecipe output = megaShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)), ffp); + ShapedRecipe output = megaShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)), ffp); int outputAmount = recipeSection.getInt(RBA_AmountOutput.AMOUNT_INGREDIENTS, 1); // Build Output @@ -142,12 +142,12 @@ public class RMGRR_MegaShaped implements RecipeRegistry { if (positions.length != 6) { throw new IllegalArgumentException("Invalid mega crafting table row $u" + updatedRow + "$b ($fNot exactly 6 ingredients wide$b)."); } // Identify - ProvidedUIFilter left = RecipeMakerGUI.readIngredientFrom(positions[0], ffp); - ProvidedUIFilter midLeft = RecipeMakerGUI.readIngredientFrom(positions[1], ffp); - ProvidedUIFilter center = RecipeMakerGUI.readIngredientFrom(positions[2], ffp); - ProvidedUIFilter midRight = RecipeMakerGUI.readIngredientFrom(positions[3], ffp); - ProvidedUIFilter right = RecipeMakerGUI.readIngredientFrom(positions[4], ffp); - ProvidedUIFilter extra = RecipeMakerGUI.readIngredientFrom(positions[5], ffp); + ProvidedUIFilter left = RecipeEditorGUI.readIngredientFrom(positions[0], ffp); + ProvidedUIFilter midLeft = RecipeEditorGUI.readIngredientFrom(positions[1], ffp); + ProvidedUIFilter center = RecipeEditorGUI.readIngredientFrom(positions[2], ffp); + ProvidedUIFilter midRight = RecipeEditorGUI.readIngredientFrom(positions[3], ffp); + ProvidedUIFilter right = RecipeEditorGUI.readIngredientFrom(positions[4], ffp); + ProvidedUIFilter extra = RecipeEditorGUI.readIngredientFrom(positions[5], ffp); if (!left.isAir()) { nonAirFound = true; } if (!midLeft.isAir()) { nonAirFound = true; } if (!center.isAir()) { nonAirFound = true; } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shaped.java index aab646c6..2e2fe866 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shaped.java @@ -15,10 +15,10 @@ import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_Shaped; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_AmountOutput; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_HideFromBook; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_AmountOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_HideFromBook; import net.Indyuce.mmoitems.gui.edition.recipe.gui.RMG_Shaped; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.random.RandomStatData; import org.bukkit.Material; @@ -35,7 +35,7 @@ public class RMGRR_Shaped implements RecipeRegistry { @NotNull @Override public String getRecipeConfigPath() { return "shaped"; } @NotNull @Override public String getRecipeTypeName() { return "Shaped"; } - @NotNull final ItemStack displayListItem = RecipeMakerGUI.rename(new ItemStack(Material.CRAFTING_TABLE), FFPMMOItems.get().getExampleFormat() + "Shaped Recipe"); + @NotNull final ItemStack displayListItem = RecipeEditorGUI.rename(new ItemStack(Material.CRAFTING_TABLE), FFPMMOItems.get().getExampleFormat() + "Shaped Recipe"); @NotNull @Override public ItemStack getDisplayListItem() { return displayListItem; } @Override public void openForPlayer(@NotNull EditionInventory inv, @NotNull String recipeName, Object... otherParams) { @@ -47,17 +47,17 @@ public class RMGRR_Shaped implements RecipeRegistry { public MythicRecipeBlueprint sendToMythicLib(@NotNull MMOItemTemplate template, @NotNull ConfigurationSection recipeTypeSection, @NotNull String recipeName, @NotNull Ref namespace, @NotNull FriendlyFeedbackProvider ffp) throws IllegalArgumentException { // Read some values - ConfigurationSection recipeSection = RecipeMakerGUI.moveInput(recipeTypeSection, recipeName); + ConfigurationSection recipeSection = RecipeEditorGUI.moveInput(recipeTypeSection, recipeName); NamespacedKey nk = namespace.getValue(); if (nk == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Illegal (Null) Namespace")); } // Identify the input - ShapedRecipe input = shapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)), ffp); + ShapedRecipe input = shapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)), ffp); if (input == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Shaped recipe containing only AIR, $fignored$b.")); } // Read the options and output - ShapedRecipe output = shapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)), ffp); + ShapedRecipe output = shapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)), ffp); int outputAmount = recipeSection.getInt(RBA_AmountOutput.AMOUNT_INGREDIENTS, 1); boolean hideBook = recipeSection.getBoolean(RBA_HideFromBook.BOOK_HIDDEN, false); @@ -153,9 +153,9 @@ public class RMGRR_Shaped implements RecipeRegistry { if (positions.length != 3) { throw new IllegalArgumentException("Invalid crafting table row $u" + updatedRow + "$b ($fNot exactly 3 ingredients wide$b)."); } // Identify - ProvidedUIFilter left = RecipeMakerGUI.readIngredientFrom(positions[0], ffp); - ProvidedUIFilter center = RecipeMakerGUI.readIngredientFrom(positions[1], ffp); - ProvidedUIFilter right = RecipeMakerGUI.readIngredientFrom(positions[2], ffp); + ProvidedUIFilter left = RecipeEditorGUI.readIngredientFrom(positions[0], ffp); + ProvidedUIFilter center = RecipeEditorGUI.readIngredientFrom(positions[1], ffp); + ProvidedUIFilter right = RecipeEditorGUI.readIngredientFrom(positions[2], ffp); if (!left.isAir()) { nonAirFound = true; } if (!center.isAir()) { nonAirFound = true; } if (!right.isAir()) { nonAirFound = true; } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shapeless.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shapeless.java index 1ac0fb84..6385abff 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shapeless.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Shapeless.java @@ -15,10 +15,10 @@ import net.Indyuce.mmoitems.api.crafting.MMOItemUIFilter; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_AmountOutput; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_HideFromBook; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_AmountOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_HideFromBook; import net.Indyuce.mmoitems.gui.edition.recipe.gui.RMG_Shapeless; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.random.RandomStatData; import org.bukkit.Material; @@ -34,7 +34,7 @@ public class RMGRR_Shapeless implements RecipeRegistry { @NotNull @Override public String getRecipeTypeName() { return "Shapeless"; } @NotNull @Override public String getRecipeConfigPath() { return "shapeless"; } - @NotNull final ItemStack displayListItem = RecipeMakerGUI.rename(new ItemStack(Material.OAK_LOG), FFPMMOItems.get().getExampleFormat() + "Shapeless Recipe"); + @NotNull final ItemStack displayListItem = RecipeEditorGUI.rename(new ItemStack(Material.OAK_LOG), FFPMMOItems.get().getExampleFormat() + "Shapeless Recipe"); @NotNull @Override public ItemStack getDisplayListItem() { return displayListItem; } @Override public void openForPlayer(@NotNull EditionInventory inv, @NotNull String recipeName, Object... otherParams) { @@ -46,16 +46,16 @@ public class RMGRR_Shapeless implements RecipeRegistry { public MythicRecipeBlueprint sendToMythicLib(@NotNull MMOItemTemplate template, @NotNull ConfigurationSection recipeTypeSection, @NotNull String recipeName, @NotNull Ref namespace, @NotNull FriendlyFeedbackProvider ffp) throws IllegalArgumentException { // Prior Preparations (update old formats) - RecipeMakerGUI.moveInput(recipeTypeSection, recipeName); + RecipeEditorGUI.moveInput(recipeTypeSection, recipeName); // Read some values - ConfigurationSection recipeSection = RecipeMakerGUI.getSection(recipeTypeSection, recipeName); + ConfigurationSection recipeSection = RecipeEditorGUI.getSection(recipeTypeSection, recipeName); NamespacedKey nk = namespace.getValue(); if (nk == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Illegal (Null) Namespace")); } //region Identify the input ArrayList poofs = new ArrayList<>(); - ArrayList recipe = new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)); + ArrayList recipe = new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)); // Read from the recipe boolean nonAirFound = false; @@ -65,7 +65,7 @@ public class RMGRR_Shapeless implements RecipeRegistry { if (str == null || "AIR".equals(str)) { continue; } // Add - ProvidedUIFilter p = RecipeMakerGUI.readIngredientFrom(str, ffp); + ProvidedUIFilter p = RecipeEditorGUI.readIngredientFrom(str, ffp); // Not air right if (p.isAir()) { continue; } @@ -79,7 +79,7 @@ public class RMGRR_Shapeless implements RecipeRegistry { //endregion // Read the options and output - ShapedRecipe output = RMGRR_Shaped.shapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)), ffp); + ShapedRecipe output = RMGRR_Shaped.shapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)), ffp); int outputAmount = recipeSection.getInt(RBA_AmountOutput.AMOUNT_INGREDIENTS, 1); boolean hideBook = recipeSection.getBoolean(RBA_HideFromBook.BOOK_HIDDEN, false); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Smithing.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Smithing.java index c9eacbcc..cf87b321 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Smithing.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_Smithing.java @@ -14,9 +14,9 @@ import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_Smithing; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.*; +import net.Indyuce.mmoitems.gui.edition.recipe.button.*; import net.Indyuce.mmoitems.gui.edition.recipe.gui.RMG_Smithing; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.configuration.ConfigurationSection; @@ -29,7 +29,7 @@ public class RMGRR_Smithing implements RecipeRegistry { @NotNull @Override public String getRecipeTypeName() { return "Smithing"; } @NotNull @Override public String getRecipeConfigPath() { return "smithing"; } - @NotNull final ItemStack displayListItem = RecipeMakerGUI.rename(new ItemStack(Material.SMITHING_TABLE), FFPMMOItems.get().getExampleFormat() + "Smithing Recipe"); + @NotNull final ItemStack displayListItem = RecipeEditorGUI.rename(new ItemStack(Material.SMITHING_TABLE), FFPMMOItems.get().getExampleFormat() + "Smithing Recipe"); @NotNull @Override public ItemStack getDisplayListItem() { return displayListItem; } @Override public void openForPlayer(@NotNull EditionInventory inv, @NotNull String recipeName, Object... otherParams) { @@ -41,22 +41,22 @@ public class RMGRR_Smithing implements RecipeRegistry { public MythicRecipeBlueprint sendToMythicLib(@NotNull MMOItemTemplate template, @NotNull ConfigurationSection recipeTypeSection, @NotNull String recipeName, @NotNull Ref namespace, @NotNull FriendlyFeedbackProvider ffp) throws IllegalArgumentException { // Prior Preparations (update old formats) - RecipeMakerGUI.moveInput(recipeTypeSection, recipeName); + RecipeEditorGUI.moveInput(recipeTypeSection, recipeName); // Read some values - ConfigurationSection recipeSection = RecipeMakerGUI.getSection(recipeTypeSection, recipeName); + ConfigurationSection recipeSection = RecipeEditorGUI.getSection(recipeTypeSection, recipeName); NamespacedKey nk = namespace.getValue(); if (nk == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Illegal (Null) Namespace")); } //region Identify the input // Find value in files - String input = RMGRI_Smithing.updateIngredients(recipeSection.getString(RecipeMakerGUI.INPUT_INGREDIENTS)); + String input = RMGRI_Smithing.updateIngredients(recipeSection.getString(RecipeEditorGUI.INPUT_INGREDIENTS)); String[] inputSplit = input.split("\\|"); // All right lets read them - ProvidedUIFilter itemPoof = RecipeMakerGUI.readIngredientFrom(inputSplit[0], ffp); - ProvidedUIFilter ingotPoof = RecipeMakerGUI.readIngredientFrom(inputSplit[1], ffp); + ProvidedUIFilter itemPoof = RecipeEditorGUI.readIngredientFrom(inputSplit[0], ffp); + ProvidedUIFilter ingotPoof = RecipeEditorGUI.readIngredientFrom(inputSplit[1], ffp); if (itemPoof.isAir() || ingotPoof.isAir()) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Smithing recipe containing AIR, $fignored$b.")); } // Make ingredients @@ -70,12 +70,12 @@ public class RMGRR_Smithing implements RecipeRegistry { //region Identify the output of ingredients // Find value in files - String output = RMGRI_Smithing.updateIngredients(recipeSection.getString(RecipeMakerGUI.OUTPUT_INGREDIENTS)); + String output = RMGRI_Smithing.updateIngredients(recipeSection.getString(RecipeEditorGUI.OUTPUT_INGREDIENTS)); String[] outputSplit = output.split("\\|"); // All right lets read them - ProvidedUIFilter itemOPoof = RecipeMakerGUI.readIngredientFrom(outputSplit[0], ffp); - ProvidedUIFilter ingotOPoof = RecipeMakerGUI.readIngredientFrom(outputSplit[1], ffp); + ProvidedUIFilter itemOPoof = RecipeEditorGUI.readIngredientFrom(outputSplit[0], ffp); + ProvidedUIFilter ingotOPoof = RecipeEditorGUI.readIngredientFrom(outputSplit[1], ffp); // Make output recipes ShapedRecipe outputItem = itemOPoof.isAir() ? null : ShapedRecipe.single(nk.getKey(), itemOPoof); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_SuperShaped.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_SuperShaped.java index bf5360a1..f0c65d39 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_SuperShaped.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RMGRR_SuperShaped.java @@ -15,9 +15,9 @@ import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMGRI_SuperShaped; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RBA_AmountOutput; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RBA_AmountOutput; import net.Indyuce.mmoitems.gui.edition.recipe.gui.RMG_SuperShaped; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.stat.data.StringData; import net.Indyuce.mmoitems.stat.data.random.RandomStatData; import org.bukkit.Material; @@ -35,7 +35,7 @@ public class RMGRR_SuperShaped implements RecipeRegistry { @Override public String getRecipeConfigPath() { return "supershaped"; } @NotNull @Override public String getRecipeTypeName() { return "Super Shaped"; } - @NotNull final ItemStack displayListItem = RecipeMakerGUI.rename(new ItemStack(Material.NOTE_BLOCK), FFPMMOItems.get().getExampleFormat() + "Super Shaped Recipe"); + @NotNull final ItemStack displayListItem = RecipeEditorGUI.rename(new ItemStack(Material.NOTE_BLOCK), FFPMMOItems.get().getExampleFormat() + "Super Shaped Recipe"); @NotNull @Override public ItemStack getDisplayListItem() { return displayListItem; } @Override public void openForPlayer(@NotNull EditionInventory inv, @NotNull String recipeName, Object... otherParams) { @@ -47,17 +47,17 @@ public class RMGRR_SuperShaped implements RecipeRegistry { public MythicRecipeBlueprint sendToMythicLib(@NotNull MMOItemTemplate template, @NotNull ConfigurationSection recipeTypeSection, @NotNull String recipeName, @NotNull Ref namespace, @NotNull FriendlyFeedbackProvider ffp) throws IllegalArgumentException { // Read some values - ConfigurationSection recipeSection = RecipeMakerGUI.moveInput(recipeTypeSection, recipeName); + ConfigurationSection recipeSection = RecipeEditorGUI.moveInput(recipeTypeSection, recipeName); NamespacedKey nk = namespace.getValue(); if (nk == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Illegal (Null) Namespace")); } // Identify the input - ShapedRecipe input = superShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.INPUT_INGREDIENTS)), ffp); + ShapedRecipe input = superShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.INPUT_INGREDIENTS)), ffp); if (input == null) { throw new IllegalArgumentException(FriendlyFeedbackProvider.quickForConsole(FFPMMOItems.get(), "Shaped recipe containing only AIR, $fignored$b.")); } // Read the options and output - ShapedRecipe output = superShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeMakerGUI.OUTPUT_INGREDIENTS)), ffp); + ShapedRecipe output = superShapedRecipeFromList(nk.getKey(), new ArrayList<>(recipeSection.getStringList(RecipeEditorGUI.OUTPUT_INGREDIENTS)), ffp); int outputAmount = recipeSection.getInt(RBA_AmountOutput.AMOUNT_INGREDIENTS, 1); // Build Output @@ -155,11 +155,11 @@ public class RMGRR_SuperShaped implements RecipeRegistry { if (positions.length != 5) { throw new IllegalArgumentException("Invalid super crafting table row $u" + updatedRow + "$b ($fNot exactly 5 ingredients wide$b)."); } // Identify - ProvidedUIFilter left = RecipeMakerGUI.readIngredientFrom(positions[0], ffp); - ProvidedUIFilter midLeft = RecipeMakerGUI.readIngredientFrom(positions[1], ffp); - ProvidedUIFilter center = RecipeMakerGUI.readIngredientFrom(positions[2], ffp); - ProvidedUIFilter midRight = RecipeMakerGUI.readIngredientFrom(positions[3], ffp); - ProvidedUIFilter right = RecipeMakerGUI.readIngredientFrom(positions[4], ffp); + ProvidedUIFilter left = RecipeEditorGUI.readIngredientFrom(positions[0], ffp); + ProvidedUIFilter midLeft = RecipeEditorGUI.readIngredientFrom(positions[1], ffp); + ProvidedUIFilter center = RecipeEditorGUI.readIngredientFrom(positions[2], ffp); + ProvidedUIFilter midRight = RecipeEditorGUI.readIngredientFrom(positions[3], ffp); + ProvidedUIFilter right = RecipeEditorGUI.readIngredientFrom(positions[4], ffp); if (!left.isAir()) { nonAirFound = true; } if (!midLeft.isAir()) { nonAirFound = true; } if (!center.isAir()) { nonAirFound = true; } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RecipeRegistry.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RecipeRegistry.java index efcdbb1e..f8fd954b 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RecipeRegistry.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/RecipeRegistry.java @@ -5,6 +5,7 @@ import io.lumine.mythic.lib.api.util.Ref; import io.lumine.mythic.lib.api.util.ui.FriendlyFeedbackProvider; import net.Indyuce.mmoitems.api.item.template.MMOItemTemplate; import net.Indyuce.mmoitems.gui.edition.EditionInventory; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.NamespacedKey; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.inventory.ItemStack; @@ -50,7 +51,7 @@ public interface RecipeRegistry { * * @param inv Edition Inventory by which the player is opening this * @param recipeName Name of the recipe - * @param otherParams Whatever else required by the constructor of the {@link net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI} + * @param otherParams Whatever else required by the constructor of the {@link RecipeEditorGUI} */ void openForPlayer(@NotNull EditionInventory inv, @NotNull String recipeName, Object... otherParams); diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/burninglegacy/BurningRecipeInformation.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/burninglegacy/BurningRecipeInformation.java index d6b58461..1513e7bc 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/burninglegacy/BurningRecipeInformation.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/edition/recipe/registry/burninglegacy/BurningRecipeInformation.java @@ -11,6 +11,7 @@ import org.jetbrains.annotations.NotNull; * * @author ASangarin */ +@Deprecated public class BurningRecipeInformation { private final WorkbenchIngredient choice; private final float exp; diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/listener/GuiListener.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/listener/GuiListener.java index b3c01006..fefd5cd1 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/listener/GuiListener.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/gui/listener/GuiListener.java @@ -8,9 +8,9 @@ import net.Indyuce.mmoitems.gui.ItemBrowser; import net.Indyuce.mmoitems.gui.PluginInventory; import net.Indyuce.mmoitems.gui.edition.EditionInventory; import net.Indyuce.mmoitems.gui.edition.ItemEdition; -import net.Indyuce.mmoitems.gui.edition.recipe.RecipeBrowserGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.RecipeTypeListGUI; import net.Indyuce.mmoitems.gui.edition.recipe.RecipeListGUI; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -67,10 +67,10 @@ public class GuiListener implements Listener { if (inventory instanceof ItemEdition) { new ItemBrowser(player, template.getType()).open(); } // Open the RECIPE TYPE BROWSER stat thing - else if ((inventory instanceof RecipeListGUI)) { new RecipeBrowserGUI(player, template).open((EditionInventory) inventory); } + else if ((inventory instanceof RecipeListGUI)) { new RecipeTypeListGUI(player, template).open((EditionInventory) inventory); } // Open the RECIPE LIST thing - else if ((inventory instanceof RecipeMakerGUI)) { new RecipeListGUI(player, template, ((RecipeMakerGUI) inventory).getRecipeRegistry()).open((EditionInventory) inventory); } + else if ((inventory instanceof RecipeEditorGUI)) { new RecipeListGUI(player, template, ((RecipeEditorGUI) inventory).getRecipeRegistry()).open((EditionInventory) inventory); } // Just open the ITEM EDITION I guess else { new ItemEdition(player, template).open((EditionInventory) inventory); } diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/RecipeManager.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/RecipeManager.java index 1a713bbc..85c67fae 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/RecipeManager.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/RecipeManager.java @@ -19,8 +19,8 @@ import net.Indyuce.mmoitems.api.recipe.workbench.ingredients.MMOItemIngredient; import net.Indyuce.mmoitems.api.recipe.workbench.ingredients.VanillaIngredient; import net.Indyuce.mmoitems.api.recipe.workbench.ingredients.WorkbenchIngredient; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; -import net.Indyuce.mmoitems.gui.edition.recipe.RecipeBrowserGUI; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.RecipeTypeListGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.gui.edition.recipe.registry.RecipeRegistry; import net.Indyuce.mmoitems.gui.edition.recipe.registry.burninglegacy.BurningRecipeInformation; import org.bukkit.Bukkit; @@ -87,19 +87,19 @@ public class RecipeManager implements Reloadable { if (config.contains(template.getId() + ".base.crafting")) { // Get section containing the crafting recipes - ConfigurationSection section = RecipeMakerGUI.getSection(config, template.getId() + ".base.crafting"); + ConfigurationSection section = RecipeEditorGUI.getSection(config, template.getId() + ".base.crafting"); // All loaded recipes - for (String recipeType : RecipeBrowserGUI.getRegisteredRecipes()) { + for (String recipeType : RecipeTypeListGUI.getRegisteredRecipes()) { // Is it in-yo? if (section.contains(recipeType)) { // Get Registry - RecipeRegistry rr = RecipeBrowserGUI.getRegisteredRecipe(recipeType); + RecipeRegistry rr = RecipeTypeListGUI.getRegisteredRecipe(recipeType); // Get recipe type section - ConfigurationSection typeSection = RecipeMakerGUI.getSection(section, recipeType); + ConfigurationSection typeSection = RecipeEditorGUI.getSection(section, recipeType); // Register dem for (String recipeName : typeSection.getKeys(false)) { @@ -150,6 +150,7 @@ public class RecipeManager implements Reloadable { Bukkit.getScheduler().runTask(MMOItems.plugin, () -> getBukkitRecipes().forEach(Bukkit::addRecipe)); } + @Deprecated public void registerBurningRecipe(@NotNull BurningRecipeType recipeType, @NotNull MMOItem mmo, @NotNull BurningRecipeInformation info, int amount, @NotNull NamespacedKey key, boolean hidden) { // Build its item stacc @@ -339,7 +340,7 @@ public class RecipeManager implements Reloadable { public static WorkbenchIngredient getWorkbenchIngredient(@NotNull String input) throws IllegalArgumentException { // Read it this other way ~ - ProvidedUIFilter poof = ProvidedUIFilter.getFromString(RecipeMakerGUI.poofFromLegacy(input), null); + ProvidedUIFilter poof = ProvidedUIFilter.getFromString(RecipeEditorGUI.poofFromLegacy(input), null); // Air is AIR if (poof == null) { diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/TierManager.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/TierManager.java index 64db4832..afa6f2d9 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/TierManager.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/manager/TierManager.java @@ -7,7 +7,7 @@ import net.Indyuce.mmoitems.api.ConfigFile; import net.Indyuce.mmoitems.api.ItemTier; import net.Indyuce.mmoitems.api.item.mmoitem.MMOItem; import net.Indyuce.mmoitems.api.util.message.FFPMMOItems; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import org.apache.commons.lang.Validate; import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; @@ -35,7 +35,7 @@ public class TierManager implements Reloadable{ for (String tierName : config.getConfig().getKeys(false)) { // Get section (Using RecipeMakerGUI for @NotNull attribute) - ConfigurationSection tierSection = RecipeMakerGUI.getSection(config.getConfig(), tierName); + ConfigurationSection tierSection = RecipeEditorGUI.getSection(config.getConfig(), tierName); // Attempt to register try { diff --git a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Crafting.java b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Crafting.java index da08be5c..144b316a 100644 --- a/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Crafting.java +++ b/MMOItems-API/src/main/java/net/Indyuce/mmoitems/stat/Crafting.java @@ -9,10 +9,10 @@ import io.lumine.mythic.lib.api.crafting.uimanager.UIFilterManager; import io.lumine.mythic.lib.api.item.ItemTag; import io.lumine.mythic.lib.api.util.ui.QuickNumberRange; import io.lumine.mythic.lib.api.util.ui.SilentNumbers; -import net.Indyuce.mmoitems.gui.edition.recipe.RecipeBrowserGUI; -import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeMakerGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.RecipeTypeListGUI; +import net.Indyuce.mmoitems.gui.edition.recipe.gui.RecipeEditorGUI; import net.Indyuce.mmoitems.gui.edition.recipe.interpreter.RMG_RecipeInterpreter; -import net.Indyuce.mmoitems.gui.edition.recipe.rba.RecipeButtonAction; +import net.Indyuce.mmoitems.gui.edition.recipe.button.RecipeButtonAction; import net.Indyuce.mmoitems.stat.data.StringData; import org.bukkit.ChatColor; import org.bukkit.configuration.ConfigurationSection; @@ -40,7 +40,7 @@ public class Crafting extends ItemStat, StatData> { @Override public void whenClicked(@NotNull EditionInventory inv, @NotNull InventoryClickEvent event) { if (event.getAction() == InventoryAction.PICKUP_ALL) - new RecipeBrowserGUI(inv.getPlayer(), inv.getEdited()).open(inv); + new RecipeTypeListGUI(inv.getPlayer(), inv.getEdited()).open(inv); else if (event.getAction() == InventoryAction.PICKUP_HALF && inv.getEditedSection().contains("crafting")) { inv.getEditedSection().set("crafting", null); @@ -76,8 +76,8 @@ public class Crafting extends ItemStat, StatData> { int type = (int) info[0]; switch (type) { - case RecipeMakerGUI.INPUT: - case RecipeMakerGUI.OUTPUT: + case RecipeEditorGUI.INPUT: + case RecipeEditorGUI.OUTPUT: //region Transcribe from old format to new int spc = message.indexOf(' '); @@ -163,12 +163,12 @@ public class Crafting extends ItemStat, StatData> { if (!read.isValid(inv.getFFP())) { throw new IllegalArgumentException(""); } // Find section - ConfigurationSection section = RecipeMakerGUI.getSection(inv.getEditedSection(), "crafting"); - section = RecipeMakerGUI.getSection(section, ((RecipeMakerGUI) inv).getRecipeRegistry().getRecipeConfigPath()); - section = RecipeMakerGUI.getSection(section, ((RecipeMakerGUI) inv).getRecipeName()); + ConfigurationSection section = RecipeEditorGUI.getSection(inv.getEditedSection(), "crafting"); + section = RecipeEditorGUI.getSection(section, ((RecipeEditorGUI) inv).getRecipeRegistry().getRecipeConfigPath()); + section = RecipeEditorGUI.getSection(section, ((RecipeEditorGUI) inv).getRecipeName()); // Redirect - if (type == RecipeMakerGUI.INPUT) { + if (type == RecipeEditorGUI.INPUT) { interpreter.editInput(read, slot); // It must be output @@ -179,8 +179,8 @@ public class Crafting extends ItemStat, StatData> { inv.registerTemplateEdition(); break; - case RecipeMakerGUI.PRIMARY: - case RecipeMakerGUI.SECONDARY: + case RecipeEditorGUI.PRIMARY: + case RecipeEditorGUI.SECONDARY: /* * No Button Action? That's the end, and is not necessarily @@ -192,7 +192,7 @@ public class Crafting extends ItemStat, StatData> { // Delegate - if (type == RecipeMakerGUI.PRIMARY) { + if (type == RecipeEditorGUI.PRIMARY) { ((RecipeButtonAction) info[1]).primaryProcessInput(message, info); } else { @@ -204,26 +204,6 @@ public class Crafting extends ItemStat, StatData> { default: inv.registerTemplateEdition(); break; } - - /* - * Handles burning recipes ie furnace, campfire, smoker and blast - * furnace recipes - * - case "item": { - String[] args = message.split(" "); - Validate.isTrue(args.length == 3, "Invalid format"); - Validate.notNull(MMOItems.plugin.getRecipes().getWorkbenchIngredient(args[0]), "Invalid ingredient"); - int time = Integer.parseInt(args[1]); - double exp = MMOUtils.parseDouble(args[2]); - - inv.getEditedSection().set("crafting." + info[1] + ".1.item", args[0]); - inv.getEditedSection().set("crafting." + info[1] + ".1.time", time); - inv.getEditedSection().set("crafting." + info[1] + ".1.experience", exp); - inv.registerTemplateEdition(); - break; - } - - */ } @Nullable