diff --git a/src/com/dre/brewery/BIngredients.java b/src/com/dre/brewery/BIngredients.java index a1524d5..cb249ed 100644 --- a/src/com/dre/brewery/BIngredients.java +++ b/src/com/dre/brewery/BIngredients.java @@ -108,8 +108,12 @@ public class BIngredients { } potionMeta.setDisplayName(P.p.color("&f" + cookedName)); + if (!P.use1_14) { + // Before 1.14 the effects duration would strangely be only a quarter of what we tell it to be + uid *= 4; + } // This effect stores the UID in its Duration - potionMeta.addCustomEffect((PotionEffectType.REGENERATION).createEffect((uid * 4), 0), true); + potionMeta.addCustomEffect((PotionEffectType.REGENERATION).createEffect(uid, 0), true); potion.setItemMeta(potionMeta); return potion; diff --git a/src/com/dre/brewery/BRecipe.java b/src/com/dre/brewery/BRecipe.java index 836acfd..64716c3 100644 --- a/src/com/dre/brewery/BRecipe.java +++ b/src/com/dre/brewery/BRecipe.java @@ -265,8 +265,12 @@ public class BRecipe { Brew.PotionColor.valueOf(getColor()).colorBrew(potionMeta, potion, false); potionMeta.setDisplayName(P.p.color("&f" + getName(quality))); + if (!P.use1_14) { + // Before 1.14 the effects duration would strangely be only a quarter of what we tell it to be + uid *= 4; + } // This effect stores the UID in its Duration - potionMeta.addCustomEffect((PotionEffectType.REGENERATION).createEffect((uid * 4), 0), true); + potionMeta.addCustomEffect((PotionEffectType.REGENERATION).createEffect(uid, 0), true); brew.convertLore(potionMeta, false); Brew.addOrReplaceEffects(potionMeta, effects, quality); @@ -354,4 +358,4 @@ public class BRecipe { return effects; } -} \ No newline at end of file +} diff --git a/src/com/dre/brewery/P.java b/src/com/dre/brewery/P.java index 87824dd..8022aa0 100644 --- a/src/com/dre/brewery/P.java +++ b/src/com/dre/brewery/P.java @@ -44,6 +44,7 @@ public class P extends JavaPlugin { public static boolean use1_9; public static boolean use1_11; public static boolean use1_13; + public static boolean use1_14; public static boolean updateCheck; // Third Party Enabled @@ -78,6 +79,9 @@ public class P extends JavaPlugin { use1_9 = !v.matches("(^|.*[^.\\d])1\\.[0-8]([^\\d].*|$)"); use1_11 = !v.matches("(^|.*[^.\\d])1\\.10([^\\d].*|$)") && !v.matches("(^|.*[^.\\d])1\\.[0-9]([^\\d].*|$)"); use1_13 = !v.matches("(^|.*[^.\\d])1\\.1[0-2]([^\\d].*|$)") && !v.matches("(^|.*[^.\\d])1\\.[0-9]([^\\d].*|$)"); + use1_14 = !v.matches("(^|.*[^.\\d])1\\.1[0-3]([^\\d].*|$)") && !v.matches("(^|.*[^.\\d])1\\.[0-9]([^\\d].*|$)"); + + //P.p.log("§" + (use1_9 ? "a":"c") + "1.9 " + "§" + (use1_11 ? "a":"c") + "1.11 " + "§" + (use1_13 ? "a":"c") + "1.13 " + "§" + (use1_14 ? "a":"c") + "1.14"); // load the Config try {