Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcchampions committed Aug 7, 2024
2 parents 81bd95d + 38953fe commit 392841e
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,20 @@ private static boolean equalsItemMeta(ItemMeta itemMeta, ItemMeta sfitemMeta, bo
}
}

if (itemMeta instanceof PotionMeta && sfitemMeta instanceof PotionMeta) {
return ((PotionMeta) itemMeta).getBasePotionType().equals(((PotionMeta) sfitemMeta).getBasePotionType());
if (itemMeta instanceof PotionMeta potionMeta && sfitemMeta instanceof PotionMeta sfPotionMeta) {
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_20_5)) {
if (!potionMeta.hasBasePotionType() && !sfPotionMeta.hasBasePotionType()) {
return true;
}

return potionMeta.hasBasePotionType()
&& sfPotionMeta.hasBasePotionType()
&& potionMeta.getBasePotionType().equals(sfPotionMeta.getBasePotionType());
} else if (Slimefun.getMinecraftVersion().isMinecraftVersion(20, 2)) {
return potionMeta.getBasePotionType().equals(sfPotionMeta.getBasePotionType());
} else {
return potionMeta.getBasePotionData().equals(sfPotionMeta.getBasePotionData());
}
}
return true;
}
Expand Down

0 comments on commit 392841e

Please sign in to comment.