Interface BukkitImplAdapter


public interface BukkitImplAdapter
An interface for adapters of various Bukkit implementations.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.bukkit.inventory.ItemStack
    adapt(com.sk89q.worldedit.blocks.BaseItemStack item)
    Create a Bukkit ItemStack with NBT, if available.
    com.sk89q.worldedit.blocks.BaseItemStack
    adapt(org.bukkit.inventory.ItemStack itemStack)
    Create a WorldEdit ItemStack with NBT, if available.
    boolean
    canPlaceAt(org.bukkit.World world, com.sk89q.worldedit.math.BlockVector3 position, com.sk89q.worldedit.world.block.BlockState blockState)
    Gets whether the given BlockState can be placed here.
    default boolean
    clearContainerBlockContents(org.bukkit.World world, com.sk89q.worldedit.math.BlockVector3 pt)
    Clears the contents of a Clearable block.
    org.bukkit.entity.Entity
    createEntity(org.bukkit.Location location, com.sk89q.worldedit.entity.BaseEntity state)
    Create the given entity.
    com.sk89q.worldedit.internal.wna.WorldNativeAccess<?,?,?>
    createWorldNativeAccess(org.bukkit.World world)
    Create a WorldNativeAccess for the given world reference.
    default boolean
    generateFeature(com.sk89q.worldedit.world.generation.ConfiguredFeatureType feature, org.bukkit.World world, com.sk89q.worldedit.EditSession session, com.sk89q.worldedit.math.BlockVector3 pt)
    Generates a Minecraft feature at the given location.
    default boolean
    generateStructure(com.sk89q.worldedit.world.generation.StructureType feature, org.bukkit.World world, com.sk89q.worldedit.EditSession session, com.sk89q.worldedit.math.BlockVector3 pt)
    Generates a Minecraft structure at the given location.
    default com.sk89q.worldedit.world.biome.BiomeType
    getBiome(org.bukkit.Location location)
    Gets the current biome at a location.
    com.sk89q.worldedit.world.block.BlockState
    getBlock(org.bukkit.Location location)
    Get the block at the given location.
    com.sk89q.worldedit.world.DataFixer
    Get a data fixer, or null if not supported.
    com.sk89q.worldedit.entity.BaseEntity
    getEntity(org.bukkit.entity.Entity entity)
    Get the state for the given entity.
    com.sk89q.worldedit.world.block.BaseBlock
    getFullBlock(org.bukkit.Location location)
    Get the block with NBT data at the given location.
    default OptionalInt
    getInternalBlockStateId(com.sk89q.worldedit.world.block.BlockState state)
    Retrieve the internal ID for a given state, if possible.
    default OptionalInt
    getInternalBlockStateId(org.bukkit.block.data.BlockData data)
     
    Map<String,? extends com.sk89q.worldedit.registry.state.Property<?>>
    getProperties(com.sk89q.worldedit.world.block.BlockType blockType)
    Get a map of string -> property.
    com.sk89q.worldedit.util.formatting.text.Component
    getRichBlockName(com.sk89q.worldedit.world.block.BlockType blockType)
    Gets the name for the given block.
    com.sk89q.worldedit.util.formatting.text.Component
    getRichItemName(com.sk89q.worldedit.blocks.BaseItemStack itemStack)
    Gets the name for the given item stack.
    com.sk89q.worldedit.util.formatting.text.Component
    getRichItemName(com.sk89q.worldedit.world.item.ItemType itemType)
    Gets the name for the given item.
    Set<com.sk89q.worldedit.util.SideEffect>
    Get the SideEffects that this adapter supports.
    default boolean
    Checks if this adapter supports custom biomes.
    default void
    Initialize registries that require NMS access.
    default boolean
    regenerate(org.bukkit.World world, com.sk89q.worldedit.regions.Region region, com.sk89q.worldedit.extent.Extent extent, com.sk89q.worldedit.world.RegenOptions options)
    Regenerate a region in the given world, so it appears "as new".
    default void
    sendBiomeUpdates(org.bukkit.World world, Iterable<com.sk89q.worldedit.math.BlockVector2> chunks)
    Sends biome updates for the given chunks.
    void
    sendFakeNBT(org.bukkit.entity.Player player, com.sk89q.worldedit.math.BlockVector3 pos, org.enginehub.linbus.tree.LinCompoundTag nbtData)
    Send the given NBT data to the player.
    void
    sendFakeOP(org.bukkit.entity.Player player)
    Make the client think it has operator status.
    default void
    setBiome(org.bukkit.Location location, com.sk89q.worldedit.world.biome.BiomeType biome)
    Set the biome at a location.
    default boolean
    simulateItemUse(org.bukkit.World world, com.sk89q.worldedit.math.BlockVector3 position, com.sk89q.worldedit.blocks.BaseItem item, com.sk89q.worldedit.util.Direction face)
    Simulates a player using an item.
    default boolean
    Check if this adapter supports the watchdog.
    default void
    Tick the server watchdog, if possible.
  • Method Details

    • getDataFixer

      @Nullable com.sk89q.worldedit.world.DataFixer getDataFixer()
      Get a data fixer, or null if not supported.
      Returns:
      the data fixer
    • supportsWatchdog

      default boolean supportsWatchdog()
      Check if this adapter supports the watchdog.
      Returns:
      true if tickWatchdog() is implemented
    • tickWatchdog

      default void tickWatchdog()
      Tick the server watchdog, if possible.
    • getBlock

      com.sk89q.worldedit.world.block.BlockState getBlock(org.bukkit.Location location)
      Get the block at the given location.
      Parameters:
      location - the location
      Returns:
      the block
    • getFullBlock

      com.sk89q.worldedit.world.block.BaseBlock getFullBlock(org.bukkit.Location location)
      Get the block with NBT data at the given location.
      Parameters:
      location - the location
      Returns:
      the block
    • createWorldNativeAccess

      com.sk89q.worldedit.internal.wna.WorldNativeAccess<?,?,?> createWorldNativeAccess(org.bukkit.World world)
      Create a WorldNativeAccess for the given world reference.
      Parameters:
      world - the world reference
      Returns:
      the native access object
    • getEntity

      @Nullable com.sk89q.worldedit.entity.BaseEntity getEntity(org.bukkit.entity.Entity entity)
      Get the state for the given entity.
      Parameters:
      entity - the entity
      Returns:
      the state, or null
    • createEntity

      @Nullable org.bukkit.entity.Entity createEntity(org.bukkit.Location location, com.sk89q.worldedit.entity.BaseEntity state)
      Create the given entity.
      Parameters:
      location - the location
      state - the state
      Returns:
      the created entity or null
    • getRichBlockName

      com.sk89q.worldedit.util.formatting.text.Component getRichBlockName(com.sk89q.worldedit.world.block.BlockType blockType)
      Gets the name for the given block.
      Parameters:
      blockType - the block
      Returns:
      The name
    • getRichItemName

      com.sk89q.worldedit.util.formatting.text.Component getRichItemName(com.sk89q.worldedit.world.item.ItemType itemType)
      Gets the name for the given item.
      Parameters:
      itemType - the item
      Returns:
      The name
    • getRichItemName

      com.sk89q.worldedit.util.formatting.text.Component getRichItemName(com.sk89q.worldedit.blocks.BaseItemStack itemStack)
      Gets the name for the given item stack.
      Parameters:
      itemStack - the item stack
      Returns:
      The name
    • getProperties

      Map<String,? extends com.sk89q.worldedit.registry.state.Property<?>> getProperties(com.sk89q.worldedit.world.block.BlockType blockType)
      Get a map of string -> property.
      Parameters:
      blockType - The block type
      Returns:
      The properties map
    • sendFakeNBT

      void sendFakeNBT(org.bukkit.entity.Player player, com.sk89q.worldedit.math.BlockVector3 pos, org.enginehub.linbus.tree.LinCompoundTag nbtData)
      Send the given NBT data to the player.
      Parameters:
      player - The player
      pos - The position
      nbtData - The NBT Data
    • sendFakeOP

      void sendFakeOP(org.bukkit.entity.Player player)
      Make the client think it has operator status. This does not give them any operator capabilities.
      Parameters:
      player - The player
    • simulateItemUse

      default boolean simulateItemUse(org.bukkit.World world, com.sk89q.worldedit.math.BlockVector3 position, com.sk89q.worldedit.blocks.BaseItem item, com.sk89q.worldedit.util.Direction face)
      Simulates a player using an item.
      Parameters:
      world - the world
      position - the location
      item - the item to be used
      face - the direction in which to "face" when using the item
      Returns:
      whether the usage was successful
    • canPlaceAt

      boolean canPlaceAt(org.bukkit.World world, com.sk89q.worldedit.math.BlockVector3 position, com.sk89q.worldedit.world.block.BlockState blockState)
      Gets whether the given BlockState can be placed here.
      Parameters:
      world - The world
      position - The position
      blockState - The blockstate
      Returns:
      If it can be placed
    • adapt

      org.bukkit.inventory.ItemStack adapt(com.sk89q.worldedit.blocks.BaseItemStack item)
      Create a Bukkit ItemStack with NBT, if available.
      Parameters:
      item - the WorldEdit BaseItemStack to adapt
      Returns:
      the Bukkit ItemStack
    • adapt

      com.sk89q.worldedit.blocks.BaseItemStack adapt(org.bukkit.inventory.ItemStack itemStack)
      Create a WorldEdit ItemStack with NBT, if available.
      Parameters:
      itemStack - the Bukkit ItemStack to adapt
      Returns:
      the WorldEdit BaseItemStack
    • getSupportedSideEffects

      Set<com.sk89q.worldedit.util.SideEffect> getSupportedSideEffects()
      Get the SideEffects that this adapter supports.
      Returns:
      The side effects that are supported
    • getInternalBlockStateId

      default OptionalInt getInternalBlockStateId(org.bukkit.block.data.BlockData data)
    • getInternalBlockStateId

      default OptionalInt getInternalBlockStateId(com.sk89q.worldedit.world.block.BlockState state)
      Retrieve the internal ID for a given state, if possible.
      Parameters:
      state - The block state
      Returns:
      the internal ID of the state
    • regenerate

      default boolean regenerate(org.bukkit.World world, com.sk89q.worldedit.regions.Region region, com.sk89q.worldedit.extent.Extent extent, com.sk89q.worldedit.world.RegenOptions options)
      Regenerate a region in the given world, so it appears "as new".
      Parameters:
      world - the world to regen in
      region - the region to regen
      extent - the extent to use for setting blocks
      options - the regeneration options
      Returns:
      true on success, false on failure
    • clearContainerBlockContents

      default boolean clearContainerBlockContents(org.bukkit.World world, com.sk89q.worldedit.math.BlockVector3 pt)
      Clears the contents of a Clearable block.
      Parameters:
      world - The world
      pt - The location
      Returns:
      If a block was cleared
    • hasCustomBiomeSupport

      default boolean hasCustomBiomeSupport()
      Checks if this adapter supports custom biomes.
      Returns:
      if custom biomes are supported
    • setBiome

      default void setBiome(org.bukkit.Location location, com.sk89q.worldedit.world.biome.BiomeType biome)
      Set the biome at a location.
      Parameters:
      location - the location
      biome - the new biome
    • getBiome

      default com.sk89q.worldedit.world.biome.BiomeType getBiome(org.bukkit.Location location)
      Gets the current biome at a location.
      Parameters:
      location - the location
      Returns:
      the biome
    • generateFeature

      default boolean generateFeature(com.sk89q.worldedit.world.generation.ConfiguredFeatureType feature, org.bukkit.World world, com.sk89q.worldedit.EditSession session, com.sk89q.worldedit.math.BlockVector3 pt)
      Generates a Minecraft feature at the given location.
      Parameters:
      feature - The feature
      world - The world
      session - The EditSession
      pt - The location
      Returns:
      If it succeeded
    • generateStructure

      default boolean generateStructure(com.sk89q.worldedit.world.generation.StructureType feature, org.bukkit.World world, com.sk89q.worldedit.EditSession session, com.sk89q.worldedit.math.BlockVector3 pt)
      Generates a Minecraft structure at the given location.
      Parameters:
      feature - The feature
      world - The world
      session - The EditSession
      pt - The location
      Returns:
      If it succeeded
    • initializeRegistries

      default void initializeRegistries()
      Initialize registries that require NMS access.
    • sendBiomeUpdates

      default void sendBiomeUpdates(org.bukkit.World world, Iterable<com.sk89q.worldedit.math.BlockVector2> chunks)
      Sends biome updates for the given chunks.

      This doesn't modify biomes at all, it just sends the current state of the biomes in the world to all of the nearby players, updating the visual representation of the biomes on their clients.

      Parameters:
      world - the world
      chunks - a list of chunk coordinates to send biome updates for