diff --git a/build.gradle.kts b/build.gradle.kts index b77fa28..e1818f2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -66,7 +66,7 @@ tasks.compileJava.configure { options.release.set(8) } -version = "2.9.12-SNAPSHOT-01" +version = "2.9.12a" tasks.named("processResources") { filesMatching("plugin.yml") { diff --git a/src/main/java/main/java/me/dniym/checks/BadPotionCheck.java b/src/main/java/main/java/me/dniym/checks/BadPotionCheck.java index 2503af4..2694806 100644 --- a/src/main/java/main/java/me/dniym/checks/BadPotionCheck.java +++ b/src/main/java/main/java/me/dniym/checks/BadPotionCheck.java @@ -75,9 +75,17 @@ public static boolean isInvalidPotion(@NotNull Projectile proj) { if (p != null && Protections.AllowBypass.isEnabled() && p.hasPermission("illegalstack.enchantbypass")) return false; + PotionMeta potion = null; + + if(IllegalStack.isPaperServer()) + potion = (PotionMeta) tp.getPotionMeta(); + else + potion = (PotionMeta) tp.getItem().getItemMeta(); - PotionMeta potion = (PotionMeta) tp.getPotionMeta(); PotionData pd = potion.getBasePotionData(); + + PotionType pt = null; + if (pd.getType() == PotionType.UNCRAFTABLE || (potion.hasCustomEffects() && !potion .getCustomEffects() .isEmpty())) { diff --git a/src/main/java/main/java/me/dniym/enums/Protections.java b/src/main/java/main/java/me/dniym/enums/Protections.java index 1efdf4c..6160fbd 100644 --- a/src/main/java/main/java/me/dniym/enums/Protections.java +++ b/src/main/java/main/java/me/dniym/enums/Protections.java @@ -750,7 +750,7 @@ public enum Protections { 35, true, "Prevent Invalid Potions", - "> 1.11", + "1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19", "Exploits.Other.PreventInvalidPotions", "Prevents non-opped players from possessing invalid / uncraftable potions. Typically these are used for malicious purposes on creative servers such as potions of instant death", "", diff --git a/src/main/java/main/java/me/dniym/listeners/fListener.java b/src/main/java/main/java/me/dniym/listeners/fListener.java index 9ad7706..cc6b2eb 100644 --- a/src/main/java/main/java/me/dniym/listeners/fListener.java +++ b/src/main/java/main/java/me/dniym/listeners/fListener.java @@ -297,7 +297,7 @@ public fListener(IllegalStack plugin) { } } - if (!ver.contains("v1_14") && !ver.contains("v1_15") && !ver.contains("v1_16") && !ver.contains("v1_17") && !ver.contains("v1_18") && !ver.contains("V1_19") && !ver.contains("v1_20")) { + if (!ver.contains("v1_14") && !ver.contains("v1_15") && !ver.contains("v1_16") && !ver.contains("v1_17") && !ver.contains("v1_18") && !ver.contains("V1_19") && !ver.contains("v1_20") && !ver.contains("V1_21")) { if (ver.contains("v1_13")) { LOGGER.info("MC Version 1.13+ detected!");