Class ItemToItemTransfiguration

Direct Known Subclasses:
CALAMUS, PERMURATE

public abstract class ItemToItemTransfiguration extends EntityTransfiguration
Super class for all item entity transfigurations
  • Field Details

    • changedItems

      protected Map<org.bukkit.entity.Item,org.bukkit.Material> changedItems
      The list of changed items for non-permanent spells to revert
    • transfigurationMap

      protected Map<org.bukkit.Material,org.bukkit.Material> transfigurationMap
      If this is populated, any material type key will be changed to the value
  • Constructor Details

    • ItemToItemTransfiguration

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

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

    • canTransfigure

      protected boolean canTransfigure(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Determine if this entity be transfigured by this spell.

      Entity can transfigure if: 1. It is not in the blocked list 2. It is in the allowed list, if the allowed list exists 3. The entity is not already the target type 4. There are no WorldGuard permissions preventing the caster from altering this entity type 5. The item is not enchanted -or- the magic level of the enchantment is lower than this spell's magic level

      Overrides:
      canTransfigure in class EntityTransfiguration
      Parameters:
      entity - the entity to check
      Returns:
      true if it can be changed
    • transfigureEntity

      @Nullable protected @Nullable org.bukkit.entity.Entity transfigureEntity(@NotNull @NotNull org.bukkit.entity.Entity entity)
      Transfigures entity into new EntityType.
      Specified by:
      transfigureEntity in class EntityTransfiguration
      Parameters:
      entity - the entity to transfigure
      Returns:
      the transfigured entity