From f94aa5f558e8521d6abf38cccfd01cc207de0588 Mon Sep 17 00:00:00 2001 From: Traqueur-dev Date: Thu, 27 Feb 2025 14:15:45 +0100 Subject: [PATCH] feat(core) : breaking version to remove useless tick later action --- build.gradle | 3 +- gradle.properties | 2 +- .../fr/traqueur/recipes/api/RecipesAPI.java | 92 ++++++++++--------- .../recipes/api/domains/BaseIngredient.java | 28 ------ .../recipes/api/domains/Ingredient.java | 35 +++++-- .../fr/traqueur/recipes/api/hook/Hook.java | 6 +- .../recipes/impl/PrepareCraftListener.java | 6 +- .../ingredients/ItemStackIngredient.java | 4 +- .../ingredients/MaterialIngredient.java | 4 +- .../StrictItemStackIngredient.java | 5 - .../domains/ingredients/TagIngredient.java | 4 +- .../impl/domains/recipes/RecipeBuilder.java | 2 +- .../fr/traqueur/recipes/impl/hook/Hooks.java | 28 +----- .../impl/hook/hooks/ItemsAdderIngredient.java | 4 +- .../impl/hook/hooks/OraxenIngredient.java | 4 +- src/main/resources/version.properties | 2 +- test-plugin/build.gradle | 2 +- .../fr/traqueur/testplugin/TestPlugin.java | 11 ++- .../src/main/resources/recipes/example.yml | 2 +- 19 files changed, 109 insertions(+), 135 deletions(-) delete mode 100644 src/main/java/fr/traqueur/recipes/api/domains/BaseIngredient.java diff --git a/build.gradle b/build.gradle index ac7b8fb..161c51d 100644 --- a/build.gradle +++ b/build.gradle @@ -25,8 +25,7 @@ repositories { } dependencies { - compileOnly "org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT" - compileOnly "com.github.technicallycoded:FoliaLib:main-SNAPSHOT" + compileOnly "org.spigotmc:spigot-api:1.21.3-R0.1-SNAPSHOT" // Hooks compileOnly 'io.th0rgal:oraxen:1.181.0' diff --git a/gradle.properties b/gradle.properties index 9aa74e8..e997a9a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=1.4.4 \ No newline at end of file +version=2.0.0 \ No newline at end of file diff --git a/src/main/java/fr/traqueur/recipes/api/RecipesAPI.java b/src/main/java/fr/traqueur/recipes/api/RecipesAPI.java index 75f1b69..317a6c9 100644 --- a/src/main/java/fr/traqueur/recipes/api/RecipesAPI.java +++ b/src/main/java/fr/traqueur/recipes/api/RecipesAPI.java @@ -2,19 +2,22 @@ import fr.traqueur.recipes.api.hook.Hook; import fr.traqueur.recipes.impl.PrepareCraftListener; -import fr.traqueur.recipes.impl.domains.recipes.RecipeConfiguration; import fr.traqueur.recipes.impl.domains.ItemRecipe; +import fr.traqueur.recipes.impl.domains.recipes.RecipeConfiguration; import fr.traqueur.recipes.impl.updater.Updater; -import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.plugin.java.JavaPlugin; import java.io.File; import java.io.IOException; +import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; +import java.security.CodeSource; import java.util.ArrayList; import java.util.List; +import java.util.jar.JarEntry; +import java.util.jar.JarInputStream; import java.util.stream.Stream; /** @@ -38,19 +41,13 @@ public final class RecipesAPI { */ private final List recipes; - /** - * The scheduler - */ - private final com.tcoded.folialib.impl.PlatformScheduler scheduler; - - /** * Create a new instance of RecipesAPI with yml support enabled * @param plugin The plugin instance * @param debug If the debug mode is enabled */ public RecipesAPI(JavaPlugin plugin, boolean debug) { - this(plugin, debug, true, null); + this(plugin, debug, true); } /** @@ -59,49 +56,57 @@ public RecipesAPI(JavaPlugin plugin, boolean debug) { * @param debug If the debug mode is enabled * @param enableYmlSupport If the yml support is enabled */ - public RecipesAPI(JavaPlugin plugin, boolean debug, boolean enableYmlSupport, com.tcoded.folialib.impl.PlatformScheduler scheduler) { + public RecipesAPI(JavaPlugin plugin, boolean debug, boolean enableYmlSupport) { this.debug = debug; this.plugin = plugin; this.recipes = new ArrayList<>(); - this.scheduler = scheduler; RecipeType.registerPlugin(plugin); plugin.getServer().getPluginManager().registerEvents(new PrepareCraftListener(this), plugin); - this.unregisterRecipes(); - this.runNextTick(() -> { - - if(this.debug) { - Hook.HOOKS.stream() - .filter(hook -> hook.isEnable(plugin)) - .forEach(hook -> this.plugin.getLogger().info("Hook enabled: " + hook.getPluginName())); - } - if(enableYmlSupport) { - var recipeFolder = new File(plugin.getDataFolder(), "recipes/"); - if (!recipeFolder.exists() && !recipeFolder.mkdirs()) { - plugin.getLogger().warning("Could not create recipes folder."); - return; - } - this.addConfiguredRecipes(recipeFolder); + if(enableYmlSupport) { + var recipeFolder = new File(plugin.getDataFolder(), "recipes/"); + if (!recipeFolder.exists() && !recipeFolder.mkdirs()) { + plugin.getLogger().warning("Could not create recipes folder."); + return; } - }); + this.loadDefaultRecipes(); + this.addConfiguredRecipes(recipeFolder); + } if(this.debug) { + Hook.HOOKS.stream() + .filter(hook -> hook.isEnable(plugin)) + .forEach(hook -> this.plugin.getLogger().info("Hook enabled: " + hook.getPluginName())); + Updater.update("RecipesAPI"); } } /** - * Run a task on the next tick - * @param runnable The task to run + * Load the default recipes from the jar */ - private void runNextTick(Runnable runnable) { - //Permits to use FoliaLib's scheduler if it's present in the plugin - if(scheduler != null) { - this.scheduler.runNextTick((t) -> runnable.run()); - } else { - Bukkit.getScheduler().runTaskLater(plugin, runnable, 1); + private void loadDefaultRecipes() { + try { + CodeSource src = getClass().getProtectionDomain().getCodeSource(); + if (src != null) { + URL jar = src.getLocation(); + try (JarInputStream jarStream = new JarInputStream(jar.openStream())) { + JarEntry entry; + while ((entry = jarStream.getNextJarEntry()) != null) { + if (entry.getName().startsWith("recipes/") && entry.getName().endsWith(".yml")) { + File outFile = new File(plugin.getDataFolder(), entry.getName()); + if (!outFile.exists()) { + plugin.saveResource(entry.getName(), false); + } + } + } + } + } + } catch (IOException e) { + plugin.getLogger().warning("Could not load default recipes."); + plugin.getServer().getPluginManager().disablePlugin(plugin); } } @@ -110,6 +115,7 @@ private void runNextTick(Runnable runnable) { * @param recipeFolder The folder containing the recipes */ private void addConfiguredRecipes(File recipeFolder) { + try (Stream stream = Files.walk(recipeFolder.toPath())) { stream.skip(1) .map(Path::toFile) @@ -117,7 +123,8 @@ private void addConfiguredRecipes(File recipeFolder) { .filter(e -> e.getName().endsWith(".yml")) .forEach(this::loadRecipe); } catch (IOException exception) { - exception.printStackTrace(); + plugin.getLogger().warning("Could not load recipes."); + plugin.getServer().getPluginManager().disablePlugin(plugin); } } @@ -126,9 +133,6 @@ private void addConfiguredRecipes(File recipeFolder) { * @param file The file to load the recipe from */ private void loadRecipe(File file) { - if(!new File(this.plugin.getDataFolder(), "recipes/" + file.getName()).exists()) { - this.plugin.saveResource("recipes/" + file.getName(), false); - } YamlConfiguration configuration = YamlConfiguration.loadConfiguration(file); var recipe = new RecipeConfiguration(this.plugin, file.getName().replace(".yml", ""), configuration) .build(); @@ -140,8 +144,9 @@ private void loadRecipe(File file) { */ public void unregisterRecipes() { for (ItemRecipe recipe : recipes) { - this.removeRecipe(recipe); + plugin.getServer().removeRecipe(recipe.getKey()); } + recipes.clear(); } /** @@ -149,8 +154,13 @@ public void unregisterRecipes() { * @param recipe The recipe to add */ public void addRecipe(ItemRecipe recipe) { + if (recipes.stream().anyMatch(r -> r.getKey().equals(recipe.getKey()))) { + throw new IllegalArgumentException("Recipe already registered"); + } this.recipes.add(recipe); - plugin.getServer().addRecipe(recipe.toBukkitRecipe()); + if(plugin.getServer().getRecipe(recipe.getKey()) == null) { + plugin.getServer().addRecipe(recipe.toBukkitRecipe()); + } if(this.debug) { plugin.getLogger().info("Registering recipe: " + recipe.getKey()); } diff --git a/src/main/java/fr/traqueur/recipes/api/domains/BaseIngredient.java b/src/main/java/fr/traqueur/recipes/api/domains/BaseIngredient.java deleted file mode 100644 index b010d89..0000000 --- a/src/main/java/fr/traqueur/recipes/api/domains/BaseIngredient.java +++ /dev/null @@ -1,28 +0,0 @@ -package fr.traqueur.recipes.api.domains; - -/** - * Base class for ingredients. - */ -public abstract class BaseIngredient implements Ingredient { - - /** - * The sign of the ingredient. - */ - private final Character sign; - - /** - * Constructor. - * @param sign The sign of the ingredient. - */ - public BaseIngredient(Character sign) { - this.sign = sign; - } - - /** - * {@inheritDoc} - */ - @Override - public Character sign() { - return this.sign; - } -} diff --git a/src/main/java/fr/traqueur/recipes/api/domains/Ingredient.java b/src/main/java/fr/traqueur/recipes/api/domains/Ingredient.java index 65369d6..8affc7a 100644 --- a/src/main/java/fr/traqueur/recipes/api/domains/Ingredient.java +++ b/src/main/java/fr/traqueur/recipes/api/domains/Ingredient.java @@ -4,27 +4,42 @@ import org.bukkit.inventory.RecipeChoice; /** - * Represents an ingredient. + * Base class for ingredients. */ -public interface Ingredient { +public abstract class Ingredient { /** - * Check if the item is similar to the ingredient. - * @param item The item to check. - * @return true if the item is similar to the ingredient, false otherwise. + * The sign of the ingredient. */ - boolean isSimilar(ItemStack item); + private final Character sign; /** - * Get the choice of the ingredient. - * @return The choice of the ingredient. + * Constructor. + * @param sign The sign of the ingredient. */ - RecipeChoice choice(); + public Ingredient(Character sign) { + this.sign = sign; + } /** * Get the sign of the ingredient. * @return The sign of the ingredient. */ - Character sign(); + public Character sign() { + return this.sign; + } + + + /** + * Check if the item is similar to the ingredient. + * @param item The item to check. + * @return true if the item is similar to the ingredient, false otherwise. + */ + public abstract boolean isSimilar(ItemStack item); + /** + * Get the choice of the ingredient. + * @return The choice of the ingredient. + */ + public abstract RecipeChoice choice(); } diff --git a/src/main/java/fr/traqueur/recipes/api/hook/Hook.java b/src/main/java/fr/traqueur/recipes/api/hook/Hook.java index 31aaa88..921e35a 100644 --- a/src/main/java/fr/traqueur/recipes/api/hook/Hook.java +++ b/src/main/java/fr/traqueur/recipes/api/hook/Hook.java @@ -1,6 +1,6 @@ package fr.traqueur.recipes.api.hook; -import fr.traqueur.recipes.api.domains.BaseIngredient; +import fr.traqueur.recipes.api.domains.Ingredient; import fr.traqueur.recipes.impl.hook.Hooks; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; @@ -38,7 +38,7 @@ static void addHook(Hook hook) { * @param sign The sign of the ingredient * @return The ingredient */ - BaseIngredient getIngredient(String data, Character sign); + Ingredient getIngredient(String data, Character sign); /** * Check if the plugin is enabled @@ -46,7 +46,7 @@ static void addHook(Hook hook) { * @return If the plugin is enabled */ default boolean isEnable(JavaPlugin plugin) { - return plugin.getServer().getPluginManager().isPluginEnabled(getPluginName()); + return plugin.getServer().getPluginManager().getPlugin(getPluginName()) != null; } ItemStack getItemStack(String resultPart); diff --git a/src/main/java/fr/traqueur/recipes/impl/PrepareCraftListener.java b/src/main/java/fr/traqueur/recipes/impl/PrepareCraftListener.java index fe4256d..7a82c7e 100644 --- a/src/main/java/fr/traqueur/recipes/impl/PrepareCraftListener.java +++ b/src/main/java/fr/traqueur/recipes/impl/PrepareCraftListener.java @@ -5,7 +5,6 @@ import fr.traqueur.recipes.api.domains.Ingredient; import fr.traqueur.recipes.impl.domains.ItemRecipe; import org.bukkit.Material; -import org.bukkit.NamespacedKey; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.BlockCookEvent; @@ -13,7 +12,10 @@ import org.bukkit.event.inventory.PrepareSmithingEvent; import org.bukkit.inventory.*; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; /** diff --git a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/ItemStackIngredient.java b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/ItemStackIngredient.java index 29a538e..7d4ad39 100644 --- a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/ItemStackIngredient.java +++ b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/ItemStackIngredient.java @@ -1,6 +1,6 @@ package fr.traqueur.recipes.impl.domains.ingredients; -import fr.traqueur.recipes.api.domains.BaseIngredient; +import fr.traqueur.recipes.api.domains.Ingredient; import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; @@ -11,7 +11,7 @@ /** * This class represents an ingredient that is an item stack */ -public class ItemStackIngredient extends BaseIngredient { +public class ItemStackIngredient extends Ingredient { /** * The item of the ingredient diff --git a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/MaterialIngredient.java b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/MaterialIngredient.java index ab435be..2cb9244 100644 --- a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/MaterialIngredient.java +++ b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/MaterialIngredient.java @@ -1,6 +1,6 @@ package fr.traqueur.recipes.impl.domains.ingredients; -import fr.traqueur.recipes.api.domains.BaseIngredient; +import fr.traqueur.recipes.api.domains.Ingredient; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; @@ -8,7 +8,7 @@ /** * A material ingredient */ -public class MaterialIngredient extends BaseIngredient { +public class MaterialIngredient extends Ingredient { /** * The material of the ingredient diff --git a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/StrictItemStackIngredient.java b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/StrictItemStackIngredient.java index 1e5a0b5..55aa955 100644 --- a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/StrictItemStackIngredient.java +++ b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/StrictItemStackIngredient.java @@ -1,12 +1,7 @@ package fr.traqueur.recipes.impl.domains.ingredients; -import fr.traqueur.recipes.api.domains.BaseIngredient; -import org.bukkit.NamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; -import org.bukkit.inventory.meta.ItemMeta; - -import java.util.Objects; /** * This class represents an ingredient that is an item stack with strict comparison diff --git a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/TagIngredient.java b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/TagIngredient.java index 830db95..7a8f352 100644 --- a/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/TagIngredient.java +++ b/src/main/java/fr/traqueur/recipes/impl/domains/ingredients/TagIngredient.java @@ -1,6 +1,6 @@ package fr.traqueur.recipes.impl.domains.ingredients; -import fr.traqueur.recipes.api.domains.BaseIngredient; +import fr.traqueur.recipes.api.domains.Ingredient; import org.bukkit.Material; import org.bukkit.Tag; import org.bukkit.inventory.ItemStack; @@ -9,7 +9,7 @@ /** * This class represents an ingredient that is a tag */ -public class TagIngredient extends BaseIngredient { +public class TagIngredient extends Ingredient { /** * The tag of the ingredient diff --git a/src/main/java/fr/traqueur/recipes/impl/domains/recipes/RecipeBuilder.java b/src/main/java/fr/traqueur/recipes/impl/domains/recipes/RecipeBuilder.java index 35f0b7d..adf9f08 100644 --- a/src/main/java/fr/traqueur/recipes/impl/domains/recipes/RecipeBuilder.java +++ b/src/main/java/fr/traqueur/recipes/impl/domains/recipes/RecipeBuilder.java @@ -1,8 +1,8 @@ package fr.traqueur.recipes.impl.domains.recipes; +import fr.traqueur.recipes.api.RecipeType; import fr.traqueur.recipes.api.domains.Ingredient; import fr.traqueur.recipes.api.domains.Recipe; -import fr.traqueur.recipes.api.RecipeType; import fr.traqueur.recipes.impl.domains.ItemRecipe; import org.bukkit.inventory.ItemStack; diff --git a/src/main/java/fr/traqueur/recipes/impl/hook/Hooks.java b/src/main/java/fr/traqueur/recipes/impl/hook/Hooks.java index 6ff2454..9b42086 100644 --- a/src/main/java/fr/traqueur/recipes/impl/hook/Hooks.java +++ b/src/main/java/fr/traqueur/recipes/impl/hook/Hooks.java @@ -1,7 +1,7 @@ package fr.traqueur.recipes.impl.hook; import dev.lone.itemsadder.api.CustomStack; -import fr.traqueur.recipes.api.domains.BaseIngredient; +import fr.traqueur.recipes.api.domains.Ingredient; import fr.traqueur.recipes.api.hook.Hook; import fr.traqueur.recipes.impl.hook.hooks.ItemsAdderIngredient; import fr.traqueur.recipes.impl.hook.hooks.OraxenIngredient; @@ -17,7 +17,7 @@ public enum Hooks implements Hook { */ ITEMSADDER { @Override - public BaseIngredient getIngredient(String data, Character sign) { + public Ingredient getIngredient(String data, Character sign) { return new ItemsAdderIngredient(data, sign); } @@ -34,7 +34,7 @@ public ItemStack getItemStack(String data) { */ ORAXEN { @Override - public BaseIngredient getIngredient(String data, Character sign) { + public Ingredient getIngredient(String data, Character sign) { return new OraxenIngredient(data, sign); } @@ -49,31 +49,11 @@ public ItemStack getItemStack(String data) { }, ; - /** - * The name of the hook. - */ - private final String name; - - /** - * Constructor. - * @param name The name of the hook. - */ - Hooks(String name) { - this.name = name; - } - - /** - * Default constructor. - */ - Hooks() { - this.name = this.name().toLowerCase(); - } - /** * {@inheritDoc} */ @Override public String getPluginName() { - return this.name; + return this.name().toLowerCase(); } } diff --git a/src/main/java/fr/traqueur/recipes/impl/hook/hooks/ItemsAdderIngredient.java b/src/main/java/fr/traqueur/recipes/impl/hook/hooks/ItemsAdderIngredient.java index 49cc5fe..621b97d 100644 --- a/src/main/java/fr/traqueur/recipes/impl/hook/hooks/ItemsAdderIngredient.java +++ b/src/main/java/fr/traqueur/recipes/impl/hook/hooks/ItemsAdderIngredient.java @@ -1,7 +1,7 @@ package fr.traqueur.recipes.impl.hook.hooks; import dev.lone.itemsadder.api.CustomStack; -import fr.traqueur.recipes.api.domains.BaseIngredient; +import fr.traqueur.recipes.api.domains.Ingredient; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; @@ -9,7 +9,7 @@ * This class is an implementation of the BaseIngredient class. * It is used to represent an ingredient that is an item from the ItemsAdder plugin. */ -public class ItemsAdderIngredient extends BaseIngredient { +public class ItemsAdderIngredient extends Ingredient { /** * The CustomStack object that represents the item from ItemsAdder. diff --git a/src/main/java/fr/traqueur/recipes/impl/hook/hooks/OraxenIngredient.java b/src/main/java/fr/traqueur/recipes/impl/hook/hooks/OraxenIngredient.java index c7579d9..287e7b1 100644 --- a/src/main/java/fr/traqueur/recipes/impl/hook/hooks/OraxenIngredient.java +++ b/src/main/java/fr/traqueur/recipes/impl/hook/hooks/OraxenIngredient.java @@ -1,6 +1,6 @@ package fr.traqueur.recipes.impl.hook.hooks; -import fr.traqueur.recipes.api.domains.BaseIngredient; +import fr.traqueur.recipes.api.domains.Ingredient; import io.th0rgal.oraxen.api.OraxenItems; import org.bukkit.Material; import org.bukkit.inventory.ItemStack; @@ -12,7 +12,7 @@ * This class is an implementation of the BaseIngredient class. * It is used to represent an ingredient that is an item from the Oraxen plugin. */ -public class OraxenIngredient extends BaseIngredient { +public class OraxenIngredient extends Ingredient { /** * The Material object that represents the item from Oraxen. diff --git a/src/main/resources/version.properties b/src/main/resources/version.properties index db06169..e997a9a 100644 --- a/src/main/resources/version.properties +++ b/src/main/resources/version.properties @@ -1 +1 @@ -version=1.4.3 \ No newline at end of file +version=2.0.0 \ No newline at end of file diff --git a/test-plugin/build.gradle b/test-plugin/build.gradle index c5efa8b..d5ce90a 100644 --- a/test-plugin/build.gradle +++ b/test-plugin/build.gradle @@ -23,7 +23,7 @@ repositories { } dependencies { - compileOnly("org.spigotmc:spigot-api:1.21-R0.1-SNAPSHOT") + compileOnly("org.spigotmc:spigot-api:1.21.3-R0.1-SNAPSHOT") implementation rootProject } diff --git a/test-plugin/src/main/java/fr/traqueur/testplugin/TestPlugin.java b/test-plugin/src/main/java/fr/traqueur/testplugin/TestPlugin.java index 22d7021..414b427 100644 --- a/test-plugin/src/main/java/fr/traqueur/testplugin/TestPlugin.java +++ b/test-plugin/src/main/java/fr/traqueur/testplugin/TestPlugin.java @@ -2,17 +2,13 @@ import fr.traqueur.recipes.api.RecipeType; import fr.traqueur.recipes.api.RecipesAPI; -import fr.traqueur.recipes.impl.domains.recipes.RecipeBuilder; import fr.traqueur.recipes.impl.domains.ItemRecipe; -import org.bukkit.Bukkit; +import fr.traqueur.recipes.impl.domains.recipes.RecipeBuilder; import org.bukkit.Material; -import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.plugin.java.JavaPlugin; -import java.io.File; - public final class TestPlugin extends JavaPlugin { private RecipesAPI recipesAPI; @@ -67,4 +63,9 @@ public void onEnable() { recipesAPI.addRecipe(recipe3); recipesAPI.addRecipe(recipe4); } + + @Override + public void onDisable() { + recipesAPI.unregisterRecipes(); + } } diff --git a/test-plugin/src/main/resources/recipes/example.yml b/test-plugin/src/main/resources/recipes/example.yml index 1509431..f1449f4 100644 --- a/test-plugin/src/main/resources/recipes/example.yml +++ b/test-plugin/src/main/resources/recipes/example.yml @@ -11,7 +11,7 @@ group: example # BUILDING, REDSTONE, EQUIPMENT, MISC for crafting recipes category: MISC pattern: - - "##" + - "###" - "##" result: item: "material:diamond"