java.lang.Object
com.binaris.wizardry.api.content.spell.Spell
com.binaris.wizardry.content.spell.sorcery.SpeedTime

public class SpeedTime extends Spell
  • Field Details

  • Constructor Details

    • SpeedTime

      public SpeedTime()
  • Method Details

    • cast

      public boolean cast(PlayerCastContext ctx)
      Specified by:
      cast in class Spell
    • playSound

      protected void playSound(net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity entity, int castTicks, int duration)
      Description copied from class: Spell
      Plays this spell's sound at the given entity in the given world. This calls Spell.playSound(Level, double, double, double, int, int), passing in the given entity's position as the xyz coordinates. Also checks if the given entity is silent, and if so, does not play the sound.

      You should override this is you're trying to implement a custom sound loop, check FrostRaySpell as an example.
      Overrides:
      playSound in class Spell
      Parameters:
      world - The world to play the sound in.
      entity - The entity to play the sound at, provided it is not silent.
      castTicks - The number of ticks this spell has already been cast for, passed in from the cast(...) methods. Not used in the base method, but included for use by subclasses overriding this method.
      duration - The number of ticks this spell will be cast for, passed in from the cast(...) methods. Not used in the base method, but included for use by subclasses overriding this method.
    • playSound

      protected void playSound(net.minecraft.world.level.Level world, double x, double y, double z, int ticksInUse, int duration)
      Description copied from class: Spell
      Plays this spell's sounds at the given position in the given world. This is not called automatically; subclasses should call it at the appropriate point(s) in the cast methods. Extend this method entirely if you want to add extra sounds or change the sound behaviour.
      Overrides:
      playSound in class Spell
      Parameters:
      world - The world to play the sound in.
      x - The x position to play the sound at.
      y - The y position to play the sound at.
      z - The z position to play the sound at.
    • requiresPacket

      public boolean requiresPacket()
      Description copied from class: Spell
      Whether 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:
      requiresPacket in class Spell
      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.
    • isInstantCast

      public boolean isInstantCast()
      Overrides:
      isInstantCast in class Spell
    • properties

      @NotNull protected @NotNull SpellProperties properties()
      Specified by:
      properties in class Spell