diff --git a/src/main/java/fliens/autocraft/AutoCraft.java b/src/main/java/fliens/autocraft/AutoCraft.java index c5bca6e..125d54c 100644 --- a/src/main/java/fliens/autocraft/AutoCraft.java +++ b/src/main/java/fliens/autocraft/AutoCraft.java @@ -44,7 +44,7 @@ public class AutoCraft extends JavaPlugin { public static boolean allowBlockRecipeModification; public static ArrayList autoCrafters; - private ArrayList recipes = new ArrayList<>(); + private ArrayList recipes; @Override public void onEnable() { @@ -54,8 +54,8 @@ public void onEnable() { checkConfigFile(); updateConfig(); - - recipes = collectRecipes(); + //If you do this, every plugins that add recipes must be "LoadBefore" in plugin.yml. + //recipes = collectRecipes(); new EventListener(this); BukkitScheduler scheduler = getServer().getScheduler(); @@ -409,6 +409,11 @@ private ItemStack getCraftResult(List items) { } ItemStack result; + + // Load recipes after every plugin activated. + if(recipes == null){ + recipes = collectRecipes(); + } for (Recipe recipe : recipes) { if (recipe instanceof ShapelessRecipe) { // shapeless recipe result = matchesShapeless(((ShapelessRecipe) recipe).getChoiceList(), items) ? recipe.getResult()