Package me.mrCookieSlime.Slimefun.api
Class BlockStorage
java.lang.Object
me.mrCookieSlime.Slimefun.api.BlockStorage
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBlockInfo(Block block, String key, String value) static voidaddBlockInfo(Block block, String key, String value, boolean updateTicker) static voidaddBlockInfo(Location l, String key, String value) static voidaddBlockInfo(Location l, String key, String value, boolean updateTicker) static SlimefunItemstatic booleanstatic SlimefunItemstatic booleanstatic Stringstatic Stringstatic voidclearAllBlockInfoAtChunk(Chunk chunk, boolean destroy) static voidclearAllBlockInfoAtChunk(World world, int chunkX, int chunkZ, boolean destroy) static voidclearBlockInfo(Block block) static voidclearBlockInfo(Block b, boolean destroy) static voidstatic voidclearBlockInfo(Location l, boolean destroy) voidvoidstatic voiddeleteLocationInfoUnsafely(Location l, boolean destroy) Do not call this method!.static StringgetBlockInfoAsJson(Block block) static Stringintstatic ConfiggetChunkInfo(World world, int x, int z) static StringgetChunkInfo(World world, int x, int z, String key) static BlockMenustatic BlockMenustatic Configstatic StringgetLocationInfo(Location l, String key) static BlockStoragegetOrCreate(World world) getRawStorage(World world) static BlockStoragegetStorage(World world) static UniversalBlockMenustatic UniversalBlockMenugetUniversalInventory(Block block) static UniversalBlockMenustatic booleanhasBlockInfo(Block block) static booleanstatic booleanhasChunkInfo(World world, int x, int z) static booleanbooleanstatic booleanbooleanhasUniversalInventory(Block block) booleanbooleanstatic booleanisWorldLoaded(World world) loadInventory(Location l, BlockMenuPreset preset) static voidmoveBlockInfo(Location from, Location to) static voidmoveLocationInfoUnsafely(Location from, Location to) Do not call this method!.voidReload a BlockMenu based on the preset.static ItemStackRetrieves the SlimefunItem's ItemStack from the specified Block.voidsave()voidstatic voidstatic voidsetBlockInfo(Block b, String json, boolean updateTicker) static voidsetBlockInfo(Location l, String json, boolean updateTicker) static voidsetChunkInfo(World world, int x, int z, String key, String value) static voidstatic void
-
Constructor Details
-
BlockStorage
-
-
Method Details
-
getStorage
-
getOrCreate
-
computeChanges
public void computeChanges() -
getChanges
public int getChanges() -
save
public void save() -
saveAndRemove
public void saveAndRemove() -
isMarkedForRemoval
public boolean isMarkedForRemoval() -
saveChunks
public static void saveChunks() -
getRawStorage
- Returns:
- An
ImmutableMapof the raw data.
-
getRawStorage
This will return anImmutableMapof the underlineMap<String, Config>of this worldsBlockStorage. If there is no registered world then this will return null.- Parameters:
world- The world of which to fetch the data from.- Returns:
- An
ImmutableMapof the raw data or null if the world isn't registered.
-
store
-
store
-
retrieve
Retrieves the SlimefunItem's ItemStack from the specified Block. If the specified Block is registered in BlockStorage, its data will be erased from it, regardless of the returned value.- Parameters:
block- the block to retrieve the ItemStack from- Returns:
- the SlimefunItem's ItemStack corresponding to the block if it has one, otherwise null
-
getLocationInfo
-
getLocationInfo
-
addBlockInfo
-
addBlockInfo
-
addBlockInfo
-
addBlockInfo
-
hasBlockInfo
-
hasBlockInfo
-
setBlockInfo
-
setBlockInfo
-
clearBlockInfo
-
clearBlockInfo
-
clearBlockInfo
-
clearBlockInfo
-
clearAllBlockInfoAtChunk
-
clearAllBlockInfoAtChunk
-
deleteLocationInfoUnsafely
Do not call this method!. This method is used for internal purposes only.- Parameters:
l- TheLocationdestroy- Whether to completely destroy the block data
-
moveBlockInfo
-
moveLocationInfoUnsafely
@ParametersAreNonnullByDefault public static void moveLocationInfoUnsafely(Location from, Location to) Do not call this method!. This method is used for internal purposes only. -
check
-
check
-
check
-
checkID
-
checkID
-
check
-
isWorldLoaded
-
loadInventory
-
reloadInventory
Reload a BlockMenu based on the preset. This method is solely for if you wish to reload based on data from the preset.- Parameters:
l- The location of the Block.
-
clearInventory
-
hasInventory
-
hasUniversalInventory
-
getUniversalInventory
-
getUniversalInventory
-
getUniversalInventory
-
getInventory
-
hasInventory
-
getInventory
-
getChunkInfo
-
setChunkInfo
-
hasChunkInfo
-
getChunkInfo
-
getBlockInfoAsJson
-
getBlockInfoAsJson
-
hasUniversalInventory
-
hasUniversalInventory
-