diff --git a/build.gradle.kts b/build.gradle.kts index 183c90f0..32a19512 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ import java.text.SimpleDateFormat -version = "1.10.13" +version = "1.10.14" plugins { `java-library` diff --git a/src/main/java/com/github/yufiriamazenta/craftorithm/recipe/RecipeManager.java b/src/main/java/com/github/yufiriamazenta/craftorithm/recipe/RecipeManager.java index f6397cf9..451750e6 100644 --- a/src/main/java/com/github/yufiriamazenta/craftorithm/recipe/RecipeManager.java +++ b/src/main/java/com/github/yufiriamazenta/craftorithm/recipe/RecipeManager.java @@ -60,7 +60,7 @@ public enum RecipeManager implements BukkitLifeCycleTask { private final Map anvilRecipeMap; public static final List UNLOCKABLE_RECIPE_TYPE = List.of(RecipeType.SHAPED, RecipeType.SHAPELESS, RecipeType.COOKING, RecipeType.SMITHING, RecipeType.STONE_CUTTING, RecipeType.RANDOM_COOKING); - private boolean supportPotionMix; + private Boolean supportPotionMix; RecipeManager() { pluginRecipeMap = new ConcurrentHashMap<>(); @@ -449,6 +449,9 @@ public Map serverRecipesCache() { } public boolean supportPotionMix() { + if (supportPotionMix == null) { + supportPotionMix = CrypticLibBukkit.isPaper(); + } return supportPotionMix; } @@ -505,8 +508,7 @@ public void run(Plugin plugin, LifeCycle lifeCycle) { }); } - if (!CrypticLibBukkit.platform().type().equals(Platform.PlatformType.BUKKIT)) { - supportPotionMix = true; + if (supportPotionMix()) { recipeRegisterMap.put(RecipeType.POTION, recipe -> { Bukkit.getPotionBrewer().addPotionMix(((PotionMixRecipe) recipe).potionMix()); potionMixRecipeMap.put(((PotionMixRecipe) recipe).key(), (PotionMixRecipe) recipe);