Class BlockToEntityTransfiguration

All Implemented Interfaces:
org.bukkit.event.Listener
Direct Known Subclasses:
PIERTOTUM_LOCOMOTOR

public abstract class BlockToEntityTransfiguration extends BlockTransfiguration implements org.bukkit.event.Listener
Transform a block in to an entity.
  • Field Details

    • transfigurationMap

      protected Map<org.bukkit.Material,org.bukkit.entity.EntityType> transfigurationMap
      If this is populated, a map of materials and what entity type to change them in to.

      For use with spells that can do more than one type of change. Add each material that can be changed to this map. Any missing material will fall back to the default entityType.

      If the spell can only target one or more specific material types and they all change to the same thing, add that to materialWhitelist and set entityType.

      If the spell can target any material, make materialWhitelist blank and set entityType.

  • Constructor Details

    • BlockToEntityTransfiguration

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

      public BlockToEntityTransfiguration(@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

    • transfigure

      protected void transfigure()
      Transfigure the block in to the desired entity type.
      Overrides:
      transfigure in class BlockTransfiguration
    • isEntityTransfigured

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

      public boolean isBlockTransfigured(@NotNull @NotNull org.bukkit.block.Block block)
      Is this block transfigured by this spell
      Overrides:
      isBlockTransfigured in class BlockTransfiguration
      Parameters:
      block - the block to check
      Returns:
      true if transfigured, false otherwise
    • onEntityDeath

      public void onEntityDeath(org.bukkit.event.entity.EntityDeathEvent event)
      Handle when the transfigured entity is killed.
      Parameters:
      event - the entity death event