Interface BukkitImplAdapter<T>

All Superinterfaces:
IBukkitAdapter
All Known Subinterfaces:
IDelegateBukkitImplAdapter<T>
All Known Implementing Classes:
FaweAdapter

public interface BukkitImplAdapter<T> extends IBukkitAdapter
An interface for adapters of various Bukkit implementations.
  • Method Details

    • getDataFixer

      @Nullable 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

      BlockState getBlock(Location location)
      Get the block at the given location.
      Parameters:
      location - the location
      Returns:
      the block
    • getFullBlock

      BaseBlock getFullBlock(Location location)
      Get the block with NBT data at the given location.
      Parameters:
      location - the location
      Returns:
      the block
    • createWorldNativeAccess

      WorldNativeAccess<?,?,?> createWorldNativeAccess(World world)
      Create a WorldNativeAccess for the given world reference.
      Parameters:
      world - the world reference
      Returns:
      the native access object
    • getEntity

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

      @Nullable Entity createEntity(Location location, 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(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(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(BaseItemStack itemStack)
      Gets the name for the given item stack.
      Parameters:
      itemStack - the item stack
      Returns:
      The name
    • getProperties

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

      void sendFakeNBT(Player player, 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(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(World world, BlockVector3 position, BaseItem item, 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(World world, BlockVector3 position, 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

      ItemStack adapt(BaseItemStack item)
      Create a Bukkit ItemStack with NBT, if available.
      Specified by:
      adapt in interface IBukkitAdapter
      Parameters:
      item - the WorldEdit BaseItemStack to adapt
      Returns:
      the Bukkit ItemStack
    • adapt

      BaseItemStack adapt(ItemStack itemStack)
      Create a WorldEdit ItemStack with NBT, if available.
      Specified by:
      adapt in interface IBukkitAdapter
      Parameters:
      itemStack - the Bukkit ItemStack to adapt
      Returns:
      the WorldEdit BaseItemStack
    • getSupportedSideEffects

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

      default OptionalInt getInternalBlockStateId(BlockData data)
    • getInternalBlockStateId

      default OptionalInt getInternalBlockStateId(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(World world, Region region, Extent extent, RegenOptions options) throws Exception
      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
      Throws:
      Exception
    • clearContainerBlockContents

      default boolean clearContainerBlockContents(World world, BlockVector3 pt)
      Clears the contents of a Clearable block.
      Parameters:
      world - The world
      pt - The location
      Returns:
      If a block was cleared
    • setBiome

      default void setBiome(Location location, BiomeType biome)
      Set the biome at a location.
      Parameters:
      location - the location
      biome - the new biome
    • getBiome

      default BiomeType getBiome(Location location)
      Gets the current biome at a location.
      Parameters:
      location - the location
      Returns:
      the biome
    • initializeRegistries

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

      default void sendBiomeUpdates(World world, Iterable<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
    • getMaterial

      default BlockMaterial getMaterial(BlockType blockType)
    • getMaterial

      default BlockMaterial getMaterial(BlockState blockState)
    • toNative

      @Deprecated default Tag toNative(T foreign)
      Deprecated.
    • toNativeLin

      default org.enginehub.linbus.tree.LinTag<?> toNativeLin(T foreign)
    • fromNative

      @Deprecated default T fromNative(Tag foreign)
      Deprecated.
    • fromNativeLin

      default T fromNativeLin(org.enginehub.linbus.tree.LinTag<?> foreign)
    • createWorld

      @Nullable default World createWorld(WorldCreator creator)
    • sendFakeChunk

      default void sendFakeChunk(World world, Player player, ChunkPacket packet)
      Send a fake chunk packet to a player.
    • get

      default IChunkGet get(World world, int chunkX, int chunkZ)
    • getInternalBiomeId

      default int getInternalBiomeId(BiomeType biome)
    • getRegisteredBiomes

      default Iterable<NamespacedKey> getRegisteredBiomes()
      Returns an iterable of all biomes known to the server.
      Returns:
      all biomes known to the server.
    • getRelighterFactory

      default RelighterFactory getRelighterFactory()
    • getAllProperties

      default Map<String,List<Property<?>>> getAllProperties()
    • getTickingPostProcessor

      default IBatchProcessor getTickingPostProcessor()
      Returns an IBatchProcessor instance for post-processing of chunks to sort ticking of placed/existing blocks and fluids if the plugin is configured to do so
      Since:
      2.1.0