Class TransfigurationBase

java.lang.Object
net.pottercraft.ollivanders2.spell.O2Spell
net.pottercraft.ollivanders2.spell.TransfigurationBase
Direct Known Subclasses:
BlockTransfiguration, EntityTransfiguration

public abstract class TransfigurationBase extends O2Spell
The base class for all transfiguration spells that change blocks and entities.
  • Field Details

    • successRate

      protected int successRate
      The percent chance this spell will succeed each casting.
  • Constructor Details

    • TransfigurationBase

      public TransfigurationBase(Ollivanders2 plugin)
      Default constructor for use in generating spell text. Do not use to cast the spell.
      Parameters:
      plugin - the Ollivanders2 plugin
    • TransfigurationBase

      public TransfigurationBase(@NotNull @NotNull Ollivanders2 plugin, @NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull Double rightWand)
      Constructor.
      Parameters:
      plugin - a callback to the MC plugin
      player - the player who cast this spell
      rightWand - which wand the player was using
  • Method Details

    • isTransfigured

      public boolean isTransfigured()
      Has the transfiguration taken place or not.
      Returns:
      whether the target has transfigured or not
    • isPermanent

      public boolean isPermanent()
      Is this spell permanent.
      Returns:
      true if permanent, false otherwise
    • isConsumeOriginal

      public boolean isConsumeOriginal()
      Does this spell consume the original block or not.
      Returns:
      true if it consumes the block, false otherwise
    • doCheckEffect

      protected void doCheckEffect()
      If the target is not transfigured, attempt to transfigure it. If it is transfigured and this is not a permanent spell, age the spell one tick.
      Specified by:
      doCheckEffect in class O2Spell
    • isEntityTransfigured

      public abstract boolean isEntityTransfigured(org.bukkit.entity.Entity entity)
      Is this entity transfigured by this spell
      Parameters:
      entity - the entity to check
      Returns:
      true if transfigured, false otherwise
    • isBlockTransfigured

      public abstract boolean isBlockTransfigured(org.bukkit.block.Block block)
      Is this block transfigured by this spell
      Parameters:
      block - the block to check
      Returns:
      true if transfigured, false otherwise
    • revert

      protected abstract void revert()
      Revert the transfiguration, if not permanent
      Overrides:
      revert in class O2Spell