Class BukkitAdapter

java.lang.Object
com.sk89q.worldedit.bukkit.BukkitAdapter

public class BukkitAdapter extends Object
Adapts between Bukkit and WorldEdit equivalent objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <B extends com.sk89q.worldedit.world.block.BlockStateHolder<B>>
    org.bukkit.block.data.BlockData
    adapt(B block)
    Create a Bukkit BlockData from a WorldEdit BlockStateHolder.
    static org.bukkit.inventory.ItemStack
    adapt(com.sk89q.worldedit.blocks.BaseItemStack item)
    Create a Bukkit ItemStack from a WorldEdit BaseItemStack.
    static org.bukkit.entity.Player
    adapt(com.sk89q.worldedit.entity.Player player)
    Create a Bukkit Player from a WorldEdit Player.
    static org.bukkit.command.CommandSender
    adapt(com.sk89q.worldedit.extension.platform.Actor actor)
    Create a Bukkit CommandSender from a WorldEdit Actor.
    static org.bukkit.Location
    adapt(com.sk89q.worldedit.util.Location location)
    Create a Bukkit location from a WorldEdit location.
    static org.bukkit.block.Biome
    adapt(com.sk89q.worldedit.world.biome.BiomeType biomeType)
     
    static org.bukkit.Material
    adapt(com.sk89q.worldedit.world.block.BlockType blockType)
    Create a Bukkit Material form a WorldEdit BlockType.
    static org.bukkit.entity.EntityType
    adapt(com.sk89q.worldedit.world.entity.EntityType entityType)
     
    static org.bukkit.Material
    adapt(com.sk89q.worldedit.world.item.ItemType itemType)
    Create a Bukkit Material form a WorldEdit ItemType.
    static org.bukkit.World
    adapt(com.sk89q.worldedit.world.World world)
    Create a Bukkit world from a WorldEdit world.
    static com.sk89q.worldedit.world.biome.BiomeType
    adapt(org.bukkit.block.Biome biome)
    Create a WorldEdit BiomeType from a Bukkit one.
    static com.sk89q.worldedit.util.Direction
    adapt(org.bukkit.block.BlockFace face)
    Create a WorldEdit Direction from a Bukkit BlockFace.
    static com.sk89q.worldedit.world.block.BlockState
    adapt(org.bukkit.block.data.BlockData blockData)
    Create a WorldEdit BlockState from a Bukkit BlockData.
    static com.sk89q.worldedit.extension.platform.Actor
    adapt(org.bukkit.command.CommandSender sender)
    Create a WorldEdit Actor from a Bukkit CommandSender.
    static com.sk89q.worldedit.entity.Entity
    adapt(org.bukkit.entity.Entity entity)
    Create a WorldEdit entity from a Bukkit entity.
    static com.sk89q.worldedit.world.entity.EntityType
    adapt(org.bukkit.entity.EntityType entityType)
    Create a WorldEdit EntityType from a Bukkit one.
    adapt(org.bukkit.entity.Player player)
    Create a WorldEdit Player from a Bukkit Player.
    static com.sk89q.worldedit.world.gamemode.GameMode
    adapt(org.bukkit.GameMode gameMode)
    Create a WorldEdit GameMode from a Bukkit one.
    static com.sk89q.worldedit.blocks.BaseItemStack
    adapt(org.bukkit.inventory.ItemStack itemStack)
    Create a WorldEdit BaseItemStack from a Bukkit ItemStack.
    static com.sk89q.worldedit.util.Location
    adapt(org.bukkit.Location location)
    Create a WorldEdit location from a Bukkit location.
    static com.sk89q.worldedit.world.World
    adapt(org.bukkit.World world)
    Create a WorldEdit world from a Bukkit world.
    static org.bukkit.Location
    adapt(org.bukkit.World world, com.sk89q.worldedit.math.BlockVector3 position)
    Create a Bukkit location from a WorldEdit position with a Bukkit world.
    static org.bukkit.Location
    adapt(org.bukkit.World world, com.sk89q.worldedit.math.Vector3 position)
    Create a Bukkit location from a WorldEdit position with a Bukkit world.
    static org.bukkit.Location
    adapt(org.bukkit.World world, com.sk89q.worldedit.util.Location location)
    Create a Bukkit location from a WorldEdit location with a Bukkit world.
    static com.sk89q.worldedit.world.block.BlockState
    asBlockState(org.bukkit.inventory.ItemStack itemStack)
    Create a WorldEdit BlockState from a Bukkit ItemStack.
    static com.sk89q.worldedit.world.block.BlockType
    asBlockType(org.bukkit.Material material)
    Converts a Material to a BlockType.
    static com.sk89q.worldedit.math.BlockVector3
    asBlockVector(org.bukkit.Location location)
    Create a WorldEdit BlockVector from a Bukkit location.
    asBukkitWorld(com.sk89q.worldedit.world.World world)
    Convert any WorldEdit world into an equivalent wrapped Bukkit world.
    static com.sk89q.worldedit.world.item.ItemType
    asItemType(org.bukkit.Material material)
    Converts a Material to a ItemType.
    static com.sk89q.worldedit.math.Vector3
    asVector(org.bukkit.Location location)
    Create a WorldEdit Vector from a Bukkit location.
    static boolean
    equals(com.sk89q.worldedit.world.block.BlockType blockType, org.bukkit.Material type)
    Checks equality between a WorldEdit BlockType and a Bukkit Material.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • equals

      public static boolean equals(com.sk89q.worldedit.world.block.BlockType blockType, org.bukkit.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(com.sk89q.worldedit.world.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 com.sk89q.worldedit.world.World adapt(org.bukkit.World world)
      Create a WorldEdit world from a Bukkit world.
      Parameters:
      world - the Bukkit world
      Returns:
      a WorldEdit world
    • adapt

      public static com.sk89q.worldedit.extension.platform.Actor adapt(org.bukkit.command.CommandSender sender)
      Create a WorldEdit Actor from a Bukkit CommandSender.
      Parameters:
      sender - The Bukkit CommandSender
      Returns:
      The WorldEdit Actor
    • adapt

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

      public static org.bukkit.command.CommandSender adapt(com.sk89q.worldedit.extension.platform.Actor actor)
      Create a Bukkit CommandSender from a WorldEdit Actor.
      Parameters:
      actor - The WorldEdit actor
      Returns:
      The Bukkit command sender
    • adapt

      public static org.bukkit.entity.Player adapt(com.sk89q.worldedit.entity.Player player)
      Create a Bukkit Player from a WorldEdit Player.
      Parameters:
      player - The WorldEdit player
      Returns:
      The Bukkit player
    • adapt

      public static com.sk89q.worldedit.util.Direction adapt(@Nullable org.bukkit.block.BlockFace face)
      Create a WorldEdit Direction from a Bukkit BlockFace.
      Parameters:
      face - the Bukkit BlockFace
      Returns:
      a WorldEdit direction
    • adapt

      public static org.bukkit.World adapt(com.sk89q.worldedit.world.World world)
      Create a Bukkit world from a WorldEdit world.
      Parameters:
      world - the WorldEdit world
      Returns:
      a Bukkit world
    • adapt

      public static com.sk89q.worldedit.util.Location adapt(org.bukkit.Location location)
      Create a WorldEdit location from a Bukkit location.
      Parameters:
      location - the Bukkit location
      Returns:
      a WorldEdit location
    • adapt

      public static org.bukkit.Location adapt(com.sk89q.worldedit.util.Location location)
      Create a Bukkit location from a WorldEdit location.
      Parameters:
      location - the WorldEdit location
      Returns:
      a Bukkit location
    • adapt

      public static org.bukkit.Location adapt(org.bukkit.World world, com.sk89q.worldedit.math.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 org.bukkit.Location adapt(org.bukkit.World world, com.sk89q.worldedit.math.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 org.bukkit.Location adapt(org.bukkit.World world, com.sk89q.worldedit.util.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 com.sk89q.worldedit.math.Vector3 asVector(org.bukkit.Location location)
      Create a WorldEdit Vector from a Bukkit location.
      Parameters:
      location - The Bukkit location
      Returns:
      a WorldEdit vector
    • asBlockVector

      public static com.sk89q.worldedit.math.BlockVector3 asBlockVector(org.bukkit.Location location)
      Create a WorldEdit BlockVector from a Bukkit location.
      Parameters:
      location - The Bukkit location
      Returns:
      a WorldEdit vector
    • adapt

      public static com.sk89q.worldedit.entity.Entity adapt(org.bukkit.entity.Entity entity)
      Create a WorldEdit entity from a Bukkit entity.
      Parameters:
      entity - the Bukkit entity
      Returns:
      a WorldEdit entity
    • adapt

      public static org.bukkit.Material adapt(com.sk89q.worldedit.world.item.ItemType itemType)
      Create a Bukkit Material form a WorldEdit ItemType.
      Parameters:
      itemType - The WorldEdit ItemType
      Returns:
      The Bukkit Material
    • adapt

      public static org.bukkit.Material adapt(com.sk89q.worldedit.world.block.BlockType blockType)
      Create a Bukkit Material form a WorldEdit BlockType.
      Parameters:
      blockType - The WorldEdit BlockType
      Returns:
      The Bukkit Material
    • adapt

      public static com.sk89q.worldedit.world.gamemode.GameMode adapt(org.bukkit.GameMode gameMode)
      Create a WorldEdit GameMode from a Bukkit one.
      Parameters:
      gameMode - Bukkit GameMode
      Returns:
      WorldEdit GameMode
    • adapt

      public static com.sk89q.worldedit.world.biome.BiomeType adapt(org.bukkit.block.Biome biome)
      Create a WorldEdit BiomeType from a Bukkit one.
      Parameters:
      biome - Bukkit Biome
      Returns:
      WorldEdit BiomeType
    • adapt

      public static org.bukkit.block.Biome adapt(com.sk89q.worldedit.world.biome.BiomeType biomeType)
    • adapt

      public static com.sk89q.worldedit.world.entity.EntityType adapt(org.bukkit.entity.EntityType entityType)
      Create a WorldEdit EntityType from a Bukkit one.
      Parameters:
      entityType - Bukkit EntityType
      Returns:
      WorldEdit EntityType
    • adapt

      public static org.bukkit.entity.EntityType adapt(com.sk89q.worldedit.world.entity.EntityType entityType)
    • asBlockType

      @Nullable public static com.sk89q.worldedit.world.block.BlockType asBlockType(org.bukkit.Material material)
      Converts a Material to a BlockType.
      Parameters:
      material - The material
      Returns:
      The blocktype
    • asItemType

      @Nullable public static com.sk89q.worldedit.world.item.ItemType asItemType(org.bukkit.Material material)
      Converts a Material to a ItemType.
      Parameters:
      material - The material
      Returns:
      The itemtype
    • adapt

      public static com.sk89q.worldedit.world.block.BlockState adapt(org.bukkit.block.data.BlockData blockData)
      Create a WorldEdit BlockState from a Bukkit BlockData.
      Parameters:
      blockData - The Bukkit BlockData
      Returns:
      The WorldEdit BlockState
    • adapt

      public static <B extends com.sk89q.worldedit.world.block.BlockStateHolder<B>> org.bukkit.block.data.BlockData adapt(B block)
      Create a Bukkit BlockData from a WorldEdit BlockStateHolder.
      Parameters:
      block - The WorldEdit BlockStateHolder
      Returns:
      The Bukkit BlockData
    • asBlockState

      public static com.sk89q.worldedit.world.block.BlockState asBlockState(org.bukkit.inventory.ItemStack itemStack) throws com.sk89q.worldedit.WorldEditException
      Create a WorldEdit BlockState from a Bukkit ItemStack.
      Parameters:
      itemStack - The Bukkit ItemStack
      Returns:
      The WorldEdit BlockState
      Throws:
      com.sk89q.worldedit.WorldEditException
    • adapt

      public static com.sk89q.worldedit.blocks.BaseItemStack adapt(org.bukkit.inventory.ItemStack itemStack)
      Create a WorldEdit BaseItemStack from a Bukkit ItemStack.
      Parameters:
      itemStack - The Bukkit ItemStack
      Returns:
      The WorldEdit BaseItemStack
    • adapt

      public static org.bukkit.inventory.ItemStack adapt(com.sk89q.worldedit.blocks.BaseItemStack item)
      Create a Bukkit ItemStack from a WorldEdit BaseItemStack.
      Parameters:
      item - The WorldEdit BaseItemStack
      Returns:
      The Bukkit ItemStack