From 4b30817a4f9397aa8c0cb2b13c094acbb2a2d31f Mon Sep 17 00:00:00 2001 From: YufiriaMazenta Date: Tue, 10 Dec 2024 10:11:05 +0800 Subject: [PATCH] =?UTF-8?q?[1.10.14]=E4=BF=AE=E5=A4=8D=E4=BA=86=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E4=BD=BF=E7=94=A8=E9=85=BF=E9=80=A0=E9=85=8D=E6=96=B9?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=99=A8GUI=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 2 +- .../yufiriamazenta/craftorithm/recipe/RecipeManager.java | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) 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);