Package redempt.redlib.blockdata
Class DataBlock
java.lang.Object
redempt.redlib.blockdata.DataBlock
Represents a Block with data attached to it
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears all data from this DataBlockboolean
Checks if a certain key is used in this DataBlockorg.bukkit.block.Block
getBlock()
protected redempt.redlib.blockdata.BlockPosition
getBoolean
(String key) Gets a Boolean by keyprotected ChunkPosition
getData()
Gets a Double by keyGets an int by keygetKeys()
Gets a JSONList by keyGets a long by keyGets a JSONMap by keyGets an object by keyGets a string by keyvoid
Removes a key from this DataBlockvoid
Sets data in this DataBlock
-
Field Details
-
data
-
-
Method Details
-
getManager
- Returns:
- The BlockDataManager this DataBlock belongs to
-
getTransientProperties
- Returns:
- A map which can be used to store properties that do not persist
-
getBlock
public org.bukkit.block.Block getBlock()- Returns:
- The Block the data is attached to
-
getChunkPosition
-
getBlockPosition
protected redempt.redlib.blockdata.BlockPosition getBlockPosition() -
getObject
Gets an object by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as an Object
-
getString
Gets a string by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as a String
-
getInt
Gets an int by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as an Integer
-
getLong
Gets a long by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as a Long
-
getDouble
Gets a Double by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as a Double
-
getBoolean
Gets a Boolean by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as a Boolean
-
getList
Gets a JSONList by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as a JSONList
-
getMap
Gets a JSONMap by key- Parameters:
key
- The key the data is mapped to- Returns:
- The data as a JSONMap
-
contains
Checks if a certain key is used in this DataBlock- Parameters:
key
- The key- Returns:
- Whether the key is used
-
clear
public void clear()Clears all data from this DataBlock -
set
Sets data in this DataBlock- Parameters:
key
- The key to set the data withvalue
- The data
-
remove
Removes a key from this DataBlock- Parameters:
key
- The key to remove
-
getData
- Returns:
- All data stored in this DataBlock
-
getKeys
- Returns:
- All keys used in this DataBlock
-