Skip to content

Commit

Permalink
DefaultComparators - fix potion effect type match
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneBeee committed Jun 30, 2024
1 parent df620e4 commit 74a1148
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
import org.skriptlang.skript.lang.comparator.Comparator;
import org.skriptlang.skript.lang.comparator.Comparators;
import org.skriptlang.skript.lang.comparator.Relation;
Expand Down Expand Up @@ -653,6 +654,14 @@ public boolean supportsOrdering() {
return false;
}
});

// Potion Effect Type
Comparators.registerComparator(PotionEffectType.class, PotionEffectType.class, new Comparator<PotionEffectType, PotionEffectType>() {
@Override
public Relation compare(PotionEffectType effectOne, PotionEffectType effectTwo) {
return Relation.get(effectOne.equals(effectTwo));
}
});
}

}

0 comments on commit 74a1148

Please sign in to comment.