Class ConstructSpell<T extends MagicConstructEntity>

java.lang.Object
com.binaris.wizardry.api.content.spell.Spell
com.binaris.wizardry.content.spell.abstr.ConstructSpell<T>
Direct Known Subclasses:
ArrowRain, Boulder, ConstructRangedSpell, Hailstorm, Tornado, ZombieApocalypse

public class ConstructSpell<T extends MagicConstructEntity> extends Spell
  • Field Details

    • constructFactory

      protected final Function<net.minecraft.world.level.Level,T extends MagicConstructEntity> constructFactory
    • permanent

      protected final boolean permanent
    • requiresFloor

      protected boolean requiresFloor
    • allowOverlap

      protected boolean allowOverlap
  • Constructor Details

    • ConstructSpell

      public ConstructSpell(Function<net.minecraft.world.level.Level,T> constructFactory, boolean permanent)
  • Method Details

    • floor

      public ConstructSpell<T> floor(boolean requiresFloor)
    • overlap

      public ConstructSpell<T> overlap(boolean allowOverlap)
    • canCastByEntity

      public boolean canCastByEntity()
      Overrides:
      canCastByEntity in class Spell
    • canCastByLocation

      public boolean canCastByLocation()
      Overrides:
      canCastByLocation in class Spell
    • cast

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

      public boolean cast(EntityCastContext ctx)
      Overrides:
      cast in class Spell
    • cast

      public boolean cast(LocationCastContext ctx)
      Overrides:
      cast in class Spell
    • spawnConstruct

      protected boolean spawnConstruct(CastContext ctx, net.minecraft.world.phys.Vec3 vec3, @Nullable @Nullable net.minecraft.core.Direction side)
    • addConstructExtras

      protected void addConstructExtras(T construct, net.minecraft.core.Direction side, @Nullable @Nullable net.minecraft.world.entity.LivingEntity caster)
    • 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.
    • properties

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