Enum Class BukkitAdapter

java.lang.Object
java.lang.Enum<BukkitAdapter>
com.sk89q.worldedit.bukkit.BukkitAdapter
All Implemented Interfaces:
Serializable, Comparable<BukkitAdapter>, Constable

public enum BukkitAdapter extends Enum<BukkitAdapter>
Adapts between Bukkit and WorldEdit equivalent objects.
  • Enum Constant Details

  • Method Details

    • values

      public static BukkitAdapter[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BukkitAdapter valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • equals

      public static boolean equals(BlockType blockType, Material type)
      Checks equality between a WorldEdit BlockType and a Bukkit Material.
      Parameters:
      blockType - The WorldEdit BlockType
      type - The Bukkit Material
      Returns:
      If they are equal
    • asBukkitWorld

      public static BukkitWorld asBukkitWorld(World world)
      Convert any WorldEdit world into an equivalent wrapped Bukkit world.

      If a matching world cannot be found, a RuntimeException will be thrown.

      Parameters:
      world - the world
      Returns:
      a wrapped Bukkit world
    • adapt

      public static World adapt(World world)
      Create a WorldEdit world from a Bukkit world.
      Parameters:
      world - the Bukkit world
      Returns:
      a WorldEdit world
    • adapt

      public static Actor adapt(CommandSender sender)
      Create a WorldEdit Actor from a Bukkit CommandSender.
      Parameters:
      sender - The Bukkit CommandSender
      Returns:
      The WorldEdit Actor
    • adapt

      public static BukkitPlayer adapt(Player player)
      Create a WorldEdit Player from a Bukkit Player.
      Parameters:
      player - The Bukkit player
      Returns:
      The WorldEdit player
    • adapt

      public static CommandSender adapt(Actor actor)
      Create a Bukkit CommandSender from a WorldEdit Actor.
      Parameters:
      actor - The WorldEdit actor
      Returns:
      The Bukkit command sender
    • adapt

      public static Player adapt(Player player)
      Create a Bukkit Player from a WorldEdit Player.
      Parameters:
      player - The WorldEdit player
      Returns:
      The Bukkit player
    • adapt

      public static Direction adapt(@Nullable BlockFace face)
      Create a WorldEdit Direction from a Bukkit BlockFace.
      Parameters:
      face - the Bukkit BlockFace
      Returns:
      a WorldEdit direction
    • adapt

      public static World adapt(World world)
      Create a Bukkit world from a WorldEdit world.
      Parameters:
      world - the WorldEdit world
      Returns:
      a Bukkit world
    • adapt

      public static Location adapt(Location location)
      Create a WorldEdit location from a Bukkit location.
      Parameters:
      location - the Bukkit location
      Returns:
      a WorldEdit location
    • adapt

      public static Location adapt(Location location)
      Create a Bukkit location from a WorldEdit location.
      Parameters:
      location - the WorldEdit location
      Returns:
      a Bukkit location
    • adapt

      public static Location adapt(World world, Vector3 position)
      Create a Bukkit location from a WorldEdit position with a Bukkit world.
      Parameters:
      world - the Bukkit world
      position - the WorldEdit position
      Returns:
      a Bukkit location
    • adapt

      public static Location adapt(World world, BlockVector3 position)
      Create a Bukkit location from a WorldEdit position with a Bukkit world.
      Parameters:
      world - the Bukkit world
      position - the WorldEdit position
      Returns:
      a Bukkit location
    • adapt

      public static Location adapt(World world, Location location)
      Create a Bukkit location from a WorldEdit location with a Bukkit world.
      Parameters:
      world - the Bukkit world
      location - the WorldEdit location
      Returns:
      a Bukkit location
    • asVector

      public static Vector3 asVector(Location location)
      Create a WorldEdit Vector from a Bukkit location.
      Parameters:
      location - The Bukkit location
      Returns:
      a WorldEdit vector
    • asBlockVector

      public static BlockVector3 asBlockVector(Location location)
      Create a WorldEdit BlockVector from a Bukkit location.
      Parameters:
      location - The Bukkit location
      Returns:
      a WorldEdit vector
    • adapt

      public static Entity adapt(Entity entity)
      Create a WorldEdit entity from a Bukkit entity.
      Parameters:
      entity - the Bukkit entity
      Returns:
      a WorldEdit entity
    • adapt

      public static Material adapt(ItemType itemType)
      Create a Bukkit Material form a WorldEdit ItemType.
      Parameters:
      itemType - The WorldEdit ItemType
      Returns:
      The Bukkit Material
    • adapt

      public static Material adapt(BlockType blockType)
      Create a Bukkit Material form a WorldEdit BlockType.
      Parameters:
      blockType - The WorldEdit BlockType
      Returns:
      The Bukkit Material
    • adapt

      public static GameMode adapt(GameMode gameMode)
      Create a WorldEdit GameMode from a Bukkit one.
      Parameters:
      gameMode - Bukkit GameMode
      Returns:
      WorldEdit GameMode
    • adapt

      public static BiomeType adapt(Biome biome)
      Create a WorldEdit BiomeType from a Bukkit one.
      Parameters:
      biome - Bukkit Biome
      Returns:
      WorldEdit BiomeType
    • adapt

      public static Biome adapt(BiomeType biomeType)
    • adapt

      public static EntityType adapt(EntityType entityType)
      Create a WorldEdit EntityType from a Bukkit one.
      Parameters:
      entityType - Bukkit EntityType
      Returns:
      WorldEdit EntityType
    • adapt

      public static EntityType adapt(EntityType entityType)
    • asBlockType

      @Nullable public static BlockType asBlockType(Material material)
      Converts a Material to a BlockType.
      Parameters:
      material - The material
      Returns:
      The blocktype
    • asItemType

      @Nullable public static ItemType asItemType(Material material)
      Converts a Material to a ItemType.
      Parameters:
      material - The material
      Returns:
      The itemtype
    • adapt

      public static BlockState adapt(@Nonnull BlockData blockData)
      Create a WorldEdit BlockState from a Bukkit BlockData.
      Parameters:
      blockData - The Bukkit BlockData
      Returns:
      The WorldEdit BlockState
    • adapt

      public static BlockData adapt(@Nonnull BlockStateHolder block)
      Create a Bukkit BlockData from a WorldEdit BlockStateHolder.
      Parameters:
      block - The WorldEdit BlockStateHolder
      Returns:
      The Bukkit BlockData
    • asBlockState

      public static BlockState asBlockState(ItemStack itemStack) throws WorldEditException
      Create a WorldEdit BlockState from a Bukkit ItemStack.
      Parameters:
      itemStack - The Bukkit ItemStack
      Returns:
      The WorldEdit BlockState
      Throws:
      WorldEditException
    • adapt

      public static BaseItemStack adapt(ItemStack itemStack)
      Create a WorldEdit BaseItemStack from a Bukkit ItemStack.
      Parameters:
      itemStack - The Bukkit ItemStack
      Returns:
      The WorldEdit BaseItemStack
    • adapt

      public static ItemStack adapt(BaseItemStack item)
      Create a Bukkit ItemStack from a WorldEdit BaseItemStack.
      Parameters:
      item - The WorldEdit BaseItemStack
      Returns:
      The Bukkit ItemStack