Package com.binaris.wizardry.core
Class QuickArtifactEffect
java.lang.Object
com.binaris.wizardry.core.QuickArtifactEffect
- All Implemented Interfaces:
IArtifactEffect
Utility class used for quickly add artifacts effect to simple items without having to create a whole new class. This
is normally used when you just want to:
It provides static methods that take a
- Check if the user has the artifact equipped and do a quick change
- Check world status and do something in return with the player
- Check the event and do something in return with the player
- Basically any simple-condition with a simple-implementation
It provides static methods that take a
BiPredicate and a BiConsumer for each of the events in
IArtifactEffect, and returns an instance of IArtifactEffect with the corresponding method overridden
to run the consumer if the predicate returns true.-
Method Summary
Modifier and TypeMethodDescriptionstatic IArtifactEffectdeath(BiPredicate<EBLivingDeathEvent, net.minecraft.world.item.ItemStack> predicate, BiConsumer<EBLivingDeathEvent, net.minecraft.world.item.ItemStack> consumer) static IArtifactEffecthurtEntity(BiPredicate<EBLivingHurtEvent, net.minecraft.world.item.ItemStack> predicate, BiConsumer<EBLivingHurtEvent, net.minecraft.world.item.ItemStack> consumer) static IArtifactEffectspellPreCast(BiPredicate<SpellCastEvent.Pre, net.minecraft.world.item.ItemStack> predicate, BiConsumer<SpellCastEvent.Pre, net.minecraft.world.item.ItemStack> consumer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.binaris.wizardry.core.IArtifactEffect
onHurtEntity, onKillEntity, onPlayerHurt, onSpellPostCast, onSpellPreCast, onTick
-
Method Details
-
spellPreCast
public static IArtifactEffect spellPreCast(BiPredicate<SpellCastEvent.Pre, net.minecraft.world.item.ItemStack> predicate, BiConsumer<SpellCastEvent.Pre, net.minecraft.world.item.ItemStack> consumer) -
hurtEntity
public static IArtifactEffect hurtEntity(BiPredicate<EBLivingHurtEvent, net.minecraft.world.item.ItemStack> predicate, BiConsumer<EBLivingHurtEvent, net.minecraft.world.item.ItemStack> consumer) -
death
public static IArtifactEffect death(BiPredicate<EBLivingDeathEvent, net.minecraft.world.item.ItemStack> predicate, BiConsumer<EBLivingDeathEvent, net.minecraft.world.item.ItemStack> consumer)
-