Package me.mrCookieSlime.Slimefun.api
Class BlockStorage
java.lang.Object
me.mrCookieSlime.Slimefun.api.BlockStorage
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addBlockInfo
(Block block, String key, String value) static void
addBlockInfo
(Block block, String key, String value, boolean updateTicker) static void
addBlockInfo
(Location l, String key, String value) static void
addBlockInfo
(Location l, String key, String value, boolean updateTicker) static SlimefunItem
static boolean
static SlimefunItem
static boolean
static String
static String
static void
clearAllBlockInfoAtChunk
(Chunk chunk, boolean destroy) static void
clearAllBlockInfoAtChunk
(World world, int chunkX, int chunkZ, boolean destroy) static void
clearBlockInfo
(Block block) static void
clearBlockInfo
(Block b, boolean destroy) static void
static void
clearBlockInfo
(Location l, boolean destroy) void
void
static void
deleteLocationInfoUnsafely
(Location l, boolean destroy) Do not call this method!.static String
getBlockInfoAsJson
(Block block) static String
int
static Config
getChunkInfo
(World world, int x, int z) static String
getChunkInfo
(World world, int x, int z, String key) static BlockMenu
static BlockMenu
static Config
static String
getLocationInfo
(Location l, String key) static BlockStorage
getOrCreate
(World world) getRawStorage
(World world) static BlockStorage
getStorage
(World world) static UniversalBlockMenu
static UniversalBlockMenu
getUniversalInventory
(Block block) static UniversalBlockMenu
static boolean
hasBlockInfo
(Block block) static boolean
static boolean
hasChunkInfo
(World world, int x, int z) static boolean
boolean
static boolean
boolean
hasUniversalInventory
(Block block) boolean
boolean
static boolean
isWorldLoaded
(World world) loadInventory
(Location l, BlockMenuPreset preset) static void
moveBlockInfo
(Location from, Location to) static void
moveLocationInfoUnsafely
(Location from, Location to) Do not call this method!.void
Reload a BlockMenu based on the preset.static ItemStack
Retrieves the SlimefunItem's ItemStack from the specified Block.void
save()
void
static void
static void
setBlockInfo
(Block b, String json, boolean updateTicker) static void
setBlockInfo
(Location l, String json, boolean updateTicker) static void
setChunkInfo
(World world, int x, int z, String key, String value) static void
static 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
ImmutableMap
of the raw data.
-
getRawStorage
This will return anImmutableMap
of 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
ImmutableMap
of 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
- TheLocation
destroy
- 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
-