Interface WorldStorage


public interface WorldStorage
This plugin contains features which require informations to be bound on blocks, entities, holograms etc.

Bounds are being separated by worlds. This class represents a world in which they get stored

  • Method Details

    • asBukkit

      World asBukkit()
      Returns the world which this instance correspondence to
      Returns:
      The world in which the stuff is located at
    • getBlock

      @Nullable @Nullable SpecialBlock getBlock(int x, int y, int z)
      Tries to fetch and return a special block given by its coordinates
      Parameters:
      x - The x coordinate of the block
      y - The y coordinate of the block
      z - The z coordinate of the block
      Returns:
      The special block located at the coordinates. null if there's none at that location
    • getBlock

      @Nullable default @Nullable SpecialBlock getBlock(Location location)
      Tries to fetch and return a special block given by its coordinates
      Parameters:
      location - The coordinates of the block
      Returns:
      The special block located at the coordinates. null if there's none at that location
      Throws:
      IllegalArgumentException - When the worlds mismatch
    • getBlock

      @Nullable default @Nullable SpecialBlock getBlock(XYZ location)
      Tries to fetch and return a special block given by its coordinates
      Parameters:
      location - The coordinates of the block
      Returns:
      The special block located at the coordinates. null if there's none at that location
    • getBlock

      @Nullable default @Nullable SpecialBlock getBlock(Block block)
      Tries to fetch and return a special block given by its block coordinates
      Parameters:
      block - Will use the coordinates of the given block
      Returns:
      The special block located at the coordinates. null if there's none at that location
    • getBlocks

      Collection<SpecialBlock> getBlocks()
      Returns an iterator to iterate through all SpecialBlocks that were added to this world

      It is not possible to remove or add entries

      Returns:
      A iterator for fetching any block added to this world
    • getBlocksAmount

      int getBlocksAmount()
      Returns the amount of special blocks that exist in this world
      Returns:
      The total amount of added SpecialBlocks
    • addBlock

      @Nullable @Nullable SpecialBlock addBlock(BlockType type, int x, int y, int z)
      Tries to create a special block at the given coordinates.

      May fail when there's already one or a plugin cancelled it via the SpecialBlockAddEvent.

      Parameters:
      type - The type of SpecialBlock you want to create
      x - The x coordinate of the block
      y - The y coordinate of the block
      z - The z coordinate of the block
      Returns:
      The created block. null when it failed as there's already one
    • addBlock

      @Nullable default @Nullable SpecialBlock addBlock(BlockType type, Location location)
      Tries to create a special block at the given coordinates. May fail when there's already one
      Parameters:
      type - The type of SpecialBlock you want to create
      location - The coordinates of the block
      Returns:
      The created block. null when it failed as there's already one
      Throws:
      IllegalArgumentException - When the worlds mismatch
    • addBlock

      @Nullable default @Nullable SpecialBlock addBlock(BlockType type, XYZ location)
      Tries to create a special block at the given coordinates. May fail when there's already one
      Parameters:
      type - The type of SpecialBlock you want to create
      location - The coordinates of the block
      Returns:
      The created block. null when it failed as there's already one
    • addBlock

      @Nullable default @Nullable SpecialBlock addBlock(BlockType type, Block block)
      Tries to create a special block at the given block coordinates. May fail when there's already one
      Parameters:
      type - The type of SpecialBlock you want to create
      block - Will use the coordinates of the given block
      Returns:
      The created block. null when it failed as there's already one
    • getHolograms

      Collection<HologramEntity> getHolograms()
      Returns all the holograms that have been spawned into this world. Read HologramEntity if you want to know more about the feature.

      It is not possible to remove or add entries.

      Returns:
      All existing holograms in this world
    • getHologramsAmount

      int getHologramsAmount()
      Returns the total amount of holograms that currently are in this world.
      Returns:
      Amount of existing holograms in this world
    • getHolograms

      HologramEntity[] getHolograms(HologramSkinType skin)
      Returns all the holograms of the HologramEntity.getSkinType() skin that have been spawned into this world. Read HologramEntity if you want to know more about the feature.
      Returns:
      All existing holograms in this world
    • getHolograms

      HologramEntity[] getHolograms(HologramControllerType controllerType)
      Returns all the holograms of the HologramEntity.getControllerType() controllerType that have been spawned into this world. Read HologramEntity if you want to know more about the feature.
      Returns:
      All existing holograms in this world
    • getNearbyHolograms

      Collection<HologramEntity> getNearbyHolograms(Location location, double radius)
      Returns all the holograms within the given radius.
      Parameters:
      location - The location to search around
      radius - The radius to search in
      Returns:
      All holograms within the radius
    • spawnHologram

      HologramEntity spawnHologram(HologramSkinType skin, Location location)
      Spawns a new hologram into this world.
      Parameters:
      skin - The skin of the hologram
      location - His location
      Returns:
      The newly initiated instance of the hologram
    • spawnHologram

      HologramEntity spawnHologram(HologramControllerType controller, Location location)
      Spawns a new hologram into this world and uses a default skin based on the controller.
      Parameters:
      controller - The controller aka the brain of the hologram
      location - His location
      Returns:
      The newly initiated instance of the hologram