Skip to content

Commit

Permalink
Fix 1.21 trial omen effect detect
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Jul 17, 2024
1 parent cfa7ea2 commit 2574a7d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/cn/dreeam/surf/util/ItemUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,15 @@ public static boolean isUnbreakable(ItemStack i) {
}

public static boolean isIllegalEffect(PotionEffect effect) {
int duration = Util.isNewerAndEqual(14, 0) && effect.getType() == PotionEffectType.BAD_OMEN ? 120000 : 12000;
int duration;

if (Util.isNewerAndEqual(21, 0) && effect.getType() == PotionEffectType.TRIAL_OMEN) {
duration = 108000;
} else if (Util.isNewerAndEqual(14, 0) && effect.getType() == PotionEffectType.BAD_OMEN) {
duration = 120000;
} else {
duration = 12000;
}

return effect.getAmplifier() > 5 || effect.getDuration() < 0 || effect.getDuration() > duration;
}
Expand Down

0 comments on commit 2574a7d

Please sign in to comment.