Class CastContext
java.lang.Object
com.binaris.wizardry.api.content.spell.internal.CastContext
- Direct Known Subclasses:
EntityCastContext,LocationCastContext,PlayerCastContext
CastContext - Base Context for Spell Casting
Base class that encapsulates the fundamental information needed to cast any spell in the mod. All spell casting context variants inherit from this class, providing a unified interface for the spell system.
This class acts as a shared data container between all types of spell casts, regardless of whether the caster is a player, an entity, or a location in the world.
Context Hierarchy
CastContext (base) ├─ PlayerCastContext - When a player casts from items (wands, scrolls) ├─ EntityCastContext - When NPCs/mobs cast spells (with optional target) └─ LocationCastContext - When cast from a fixed location (dispensers, constructs)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected net.minecraft.world.entity.LivingEntityprotected intprotected SpellModifiersprotected net.minecraft.world.level.Level -
Constructor Summary
ConstructorsConstructorDescriptionCastContext(net.minecraft.world.level.Level world, int castingTicks, SpellModifiers modifiers) CastContext(net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity caster, int castingTicks, SpellModifiers modifiers) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.entity.LivingEntitycaster()intvoidcastingTicks(int tick) voidmodifiers(SpellModifiers modifiers) net.minecraft.world.level.Levelworld()
-
Field Details
-
world
protected net.minecraft.world.level.Level world -
castingTicks
protected int castingTicks -
modifiers
-
caster
protected net.minecraft.world.entity.LivingEntity caster
-
-
Constructor Details
-
CastContext
public CastContext(net.minecraft.world.level.Level world, int castingTicks, SpellModifiers modifiers) -
CastContext
public CastContext(net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity caster, int castingTicks, SpellModifiers modifiers)
-
-
Method Details
-
caster
public net.minecraft.world.entity.LivingEntity caster() -
world
public net.minecraft.world.level.Level world() -
castingTicks
public int castingTicks() -
modifiers
-
castingTicks
public void castingTicks(int tick) -
modifiers
-