Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(game.enchantment): EnchantmentPredicates
- Loading branch information
1 parent
b4e5d65
commit 6bbd6f3
Showing
3 changed files
with
30 additions
and
5 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/main/java/org/auioc/mcmod/arnicalib/game/enchantment/EnchantmentPredicates.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.auioc.mcmod.arnicalib.game.enchantment; | ||
|
||
import java.util.function.Predicate; | ||
import org.auioc.mcmod.arnicalib.game.registry.VanillaPredicates; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
import net.minecraft.world.item.enchantment.Enchantment.Rarity; | ||
|
||
public class EnchantmentPredicates { | ||
|
||
public static final Predicate<Enchantment> IS_VANILLA = (e) -> VanillaPredicates.REGISTRY_ENTRY.test(e); | ||
|
||
public static final Predicate<Enchantment> IS_TREASURE_ONLY = (e) -> e.isTreasureOnly(); | ||
public static final Predicate<Enchantment> IS_CURSE = (e) -> e.isCurse(); | ||
public static final Predicate<Enchantment> IS_TRADEABLE = (e) -> e.isTradeable(); | ||
public static final Predicate<Enchantment> IS_DISCOVERABLE = (e) -> e.isDiscoverable(); | ||
|
||
public static final Predicate<Enchantment> IS_COMMON = (e) -> e.getRarity() == Rarity.COMMON; | ||
public static final Predicate<Enchantment> IS_UNCOMMON = (e) -> e.getRarity() == Rarity.UNCOMMON; | ||
public static final Predicate<Enchantment> IS_RARE = (e) -> e.getRarity() == Rarity.RARE; | ||
public static final Predicate<Enchantment> IS_VERY_RARE = (e) -> e.getRarity() == Rarity.VERY_RARE; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters