Class ProjectileSpell<T extends MagicProjectileEntity>
java.lang.Object
com.binaris.wizardry.api.content.spell.Spell
com.binaris.wizardry.content.spell.abstr.ProjectileSpell<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class com.binaris.wizardry.api.content.spell.Spell
pitch, pitchVariation, volume -
Constructor Summary
ConstructorsConstructorDescriptionProjectileSpell(Function<net.minecraft.world.level.Level, T> projectileFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddProjectileExtras(T projectile, @Nullable net.minecraft.world.entity.LivingEntity caster) protected floatcalculateVelocity(CastContext ctx, MagicProjectileEntity projectile, float launchHeight) booleanbooleanbooleancast(EntityCastContext ctx) booleancast(LocationCastContext ctx) booleancast(PlayerCastContext ctx) protected @NotNull SpellPropertiesbooleanWhether this spell requires a packet to be sent when it is cast.Methods inherited from class com.binaris.wizardry.api.content.spell.Spell
assignProperties, endCast, getAction, getCharge, getCooldown, getCost, getDesc, getDescriptionFormatted, getDescriptionId, getElement, getIcon, getLocation, getLoopSounds, getOrCreateDescriptionId, getOrCreateLocation, getPitch, getPitchVariation, getProperties, getTier, getType, getVolume, hasEnded, is, is, is, isEmpty, isEnabled, isInstantCast, onCharge, playSound, playSound, playSound, playSoundLoop, playSoundLoop, property, setProperties, soundValues, toString
-
Field Details
-
projectileFactory
protected final Function<net.minecraft.world.level.Level,T extends MagicProjectileEntity> projectileFactory
-
-
Constructor Details
-
ProjectileSpell
-
-
Method Details
-
canCastByEntity
public boolean canCastByEntity()- Overrides:
canCastByEntityin classSpell
-
canCastByLocation
public boolean canCastByLocation()- Overrides:
canCastByLocationin classSpell
-
cast
-
cast
-
cast
-
calculateVelocity
protected float calculateVelocity(CastContext ctx, MagicProjectileEntity projectile, float launchHeight) -
addProjectileExtras
protected void addProjectileExtras(T projectile, @Nullable @Nullable net.minecraft.world.entity.LivingEntity caster) -
requiresPacket
public boolean requiresPacket()Description copied from class:SpellWhether this spell requires a packet to be sent when it is cast. Returns true by default, but can be overridden to return false if the spell's cast() method does not use any code that must be executed client-side (i.e. particle spawning). This is not checked for continuous spells, because they never need to send packets.If in doubt, leave this method as is; it is purely an optimisation.
- Overrides:
requiresPacketin classSpell- Returns:
- true if the spell code should be run on the server and all clients in the dimension, false if the spell code should only be run on the server and the client of the player casting it.
-
properties
- Specified by:
propertiesin classSpell
-