Package de.marcely.bedwars.api.world
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 Summary
Modifier and TypeMethodDescription@Nullable SpecialBlock
Tries to create a special block at the given coordinates.default @Nullable SpecialBlock
Tries to create a special block at the given coordinates.default @Nullable SpecialBlock
Tries to create a special block at the given block coordinates.default @Nullable SpecialBlock
Tries to create a special block at the given coordinates.asBukkit()
Returns the world which this instance correspondence to@Nullable SpecialBlock
getBlock
(int x, int y, int z) Tries to fetch and return a special block given by its coordinatesdefault @Nullable SpecialBlock
Tries to fetch and return a special block given by its coordinatesdefault @Nullable SpecialBlock
Tries to fetch and return a special block given by its block coordinatesdefault @Nullable SpecialBlock
Tries to fetch and return a special block given by its coordinatesReturns an iterator to iterate through all SpecialBlocks that were added to this worldint
Returns the amount of special blocks that exist in this worldReturns all the holograms that have been spawned into this world.getHolograms
(HologramControllerType controllerType) Returns all the holograms of theHologramEntity.getControllerType()
controllerType
that have been spawned into this world.getHolograms
(HologramSkinType skin) Returns all the holograms of theHologramEntity.getSkinType()
skin
that have been spawned into this world.int
Returns the total amount of holograms that currently are in this world.getNearbyHolograms
(Location location, double radius) Returns all the holograms within the given radius.spawnHologram
(HologramControllerType controller, Location location) Spawns a new hologram into this world and uses a default skin based on the controller.spawnHologram
(HologramSkinType skin, Location location) Spawns a new hologram into this world.
-
Method Details
-
asBukkit
World asBukkit()Returns the world which this instance correspondence to- Returns:
- The world in which the stuff is located at
-
getBlock
Tries to fetch and return a special block given by its coordinates- Parameters:
x
- The x coordinate of the blocky
- The y coordinate of the blockz
- The z coordinate of the block- Returns:
- The special block located at the coordinates.
null
if there's none at that location
-
getBlock
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
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
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 worldIt 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
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 createx
- The x coordinate of the blocky
- The y coordinate of the blockz
- The z coordinate of the block- Returns:
- The created block.
null
when it failed as there's already one
-
addBlock
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 createlocation
- 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
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 createlocation
- The coordinates of the block- Returns:
- The created block.
null
when it failed as there's already one
-
addBlock
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 createblock
- 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. ReadHologramEntity
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
Returns all the holograms of theHologramEntity.getSkinType()
skin
that have been spawned into this world. ReadHologramEntity
if you want to know more about the feature.- Returns:
- All existing holograms in this world
-
getHolograms
Returns all the holograms of theHologramEntity.getControllerType()
controllerType
that have been spawned into this world. ReadHologramEntity
if you want to know more about the feature.- Returns:
- All existing holograms in this world
-
getNearbyHolograms
Returns all the holograms within the given radius.- Parameters:
location
- The location to search aroundradius
- The radius to search in- Returns:
- All holograms within the radius
-
spawnHologram
Spawns a new hologram into this world.- Parameters:
skin
- The skin of the hologramlocation
- His location- Returns:
- The newly initiated instance of the hologram
-
spawnHologram
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 hologramlocation
- His location- Returns:
- The newly initiated instance of the hologram
-