diff --git a/build.gradle.kts b/build.gradle.kts index 56d386fc..92f42b95 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { val langVersion: Int = 17 group = "com.dre.brewery" -version = "3.2.7" +version = "3.2.8" repositories { mavenCentral() diff --git a/src/main/java/com/dre/brewery/BreweryPlugin.java b/src/main/java/com/dre/brewery/BreweryPlugin.java index 51e72a47..91788e25 100644 --- a/src/main/java/com/dre/brewery/BreweryPlugin.java +++ b/src/main/java/com/dre/brewery/BreweryPlugin.java @@ -68,7 +68,6 @@ import java.util.Iterator; import java.util.Map; import java.util.function.Function; -import java.util.stream.Collectors; public class BreweryPlugin extends JavaPlugin { @@ -491,18 +490,18 @@ public class BreweryRunnable implements Runnable { public void run() { long start = System.currentTimeMillis(); BConfig.reloader = null; + // runs every min to update cooking time - Iterator bCauldronsToRemove = BCauldron.bcauldrons.values().iterator(); - while (bCauldronsToRemove.hasNext()) { - // runs every min to update cooking time - BCauldron bCauldron = bCauldronsToRemove.next(); + + for (BCauldron bCauldron : BCauldron.bcauldrons.values()) { BreweryPlugin.getScheduler().runTask(bCauldron.getBlock().getLocation(), () -> { if (!bCauldron.onUpdate()) { - bCauldronsToRemove.remove(); + BCauldron.bcauldrons.remove(bCauldron.getBlock()); } }); } + Barrel.onUpdate();// runs every min to check and update ageing time if (getMCVersion().isOrLater(MinecraftVersion.V1_14)) MCBarrel.onUpdate(); diff --git a/src/main/java/com/dre/brewery/recipe/BCauldronRecipe.java b/src/main/java/com/dre/brewery/recipe/BCauldronRecipe.java index cd9120f6..9cf77bbe 100644 --- a/src/main/java/com/dre/brewery/recipe/BCauldronRecipe.java +++ b/src/main/java/com/dre/brewery/recipe/BCauldronRecipe.java @@ -103,9 +103,9 @@ public static BCauldronRecipe fromConfig(ConfigurationSection cfg, String id) { } - List> lore = BRecipe.loadQualityStringList(cfg, id + ".lore", StringParser.ParseType.LORE); + Map lore = BRecipe.loadQualityStringList(cfg, id + ".lore", StringParser.ParseType.LORE); if (lore != null && !lore.isEmpty()) { - recipe.lore = lore.stream().map(Tuple::second).collect(Collectors.toList()); + recipe.lore = lore.entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); } recipe.cmData = cfg.getInt(id + ".customModelData", 0); diff --git a/src/main/java/com/dre/brewery/recipe/BRecipe.java b/src/main/java/com/dre/brewery/recipe/BRecipe.java index d579c596..3d9326fa 100644 --- a/src/main/java/com/dre/brewery/recipe/BRecipe.java +++ b/src/main/java/com/dre/brewery/recipe/BRecipe.java @@ -32,7 +32,7 @@ */ public class BRecipe { - private static List recipes = new ArrayList<>(); + private static final List recipes = new ArrayList<>(); public static int numConfigRecipes; // The number of recipes in the list that are from config // info @@ -813,6 +813,21 @@ public static List getAllRecipes() { return recipes; } + + + public String[] getName() { + return name; + } + + public boolean isGlint() { + return glint; + } + + + public byte getDistillruns() { + return distillruns; + } + /** * Get the BRecipe that has the given name as one of its quality names. */