Fix Potion error in ItemUtils

This commit is contained in:
Flowsqy 2024-04-25 22:35:56 +02:00
parent ca8c8e123a
commit 7a859b13c6

View File

@ -27,7 +27,9 @@ public class ItemUtils {
if (Utils.getMajorVersion() < 9) {
return Potion.fromItemStack(itemStack).getType();
} else {
return ((PotionMeta) itemStack.getItemMeta()).getBasePotionData().getType();
// TODO Maybe save reimplement the old version
//return ((PotionMeta) itemStack.getItemMeta()).getBasePotionData().getType();
return ((PotionMeta)itemStack.getItemMeta()).getBasePotionType();
}
}
@ -39,7 +41,9 @@ public class ItemUtils {
if (Utils.getMajorVersion() < 9) {
return Potion.fromItemStack(itemStack).hasExtendedDuration();
} else {
return ((PotionMeta) itemStack.getItemMeta()).getBasePotionData().isExtended();
// TODO Maybe save reimplement the old version
//return ((PotionMeta) itemStack.getItemMeta()).getBasePotionData().isExtended();
return false; // I have no idea how to get the base duration of a potion without loading it at startup
}
}