Package me.mrCookieSlime.Slimefun.api
Class BlockStorage
- java.lang.Object
-
- me.mrCookieSlime.Slimefun.api.BlockStorage
-
public class BlockStorage extends Object
-
-
Constructor Summary
Constructors Constructor Description BlockStorage(World w)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
_integrated_moveLocationInfo(Location from, Location to)
static void
_integrated_removeBlockInfo(Location l, boolean destroy)
static 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
check(Block block)
static boolean
check(Block block, String slimefunItem)
static SlimefunItem
check(Location l)
static boolean
check(Location l, String slimefunItem)
static String
checkID(Block b)
static String
checkID(Location l)
static void
clearBlockInfo(Block block)
static void
clearBlockInfo(Block b, boolean destroy)
static void
clearBlockInfo(Location l)
static void
clearBlockInfo(Location l, boolean destroy)
void
clearInventory(Location l)
void
computeChanges()
static String
getBlockInfoAsJson(Block block)
static String
getBlockInfoAsJson(Location l)
int
getChanges()
static me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config
getChunkInfo(World world, int x, int z)
static String
getChunkInfo(World world, int x, int z, String key)
static BlockStorage
getForcedStorage(World world)
static BlockMenu
getInventory(Block b)
static BlockMenu
getInventory(Location l)
static me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config
getLocationInfo(Location l)
static String
getLocationInfo(Location l, String key)
static BlockStorage
getStorage(World world)
static Set<String>
getTickingChunks()
static Set<Location>
getTickingLocations(String chunk)
static Set<Location>
getTickingLocations(Chunk chunk)
static UniversalBlockMenu
getUniversalInventory(String id)
static UniversalBlockMenu
getUniversalInventory(Block block)
static UniversalBlockMenu
getUniversalInventory(Location l)
static boolean
hasBlockInfo(Block block)
static boolean
hasBlockInfo(Location l)
static boolean
hasChunkInfo(World world, int x, int z)
static boolean
hasInventory(Block b)
boolean
hasInventory(Location l)
static boolean
hasUniversalInventory(String id)
boolean
hasUniversalInventory(Block block)
boolean
hasUniversalInventory(Location l)
static boolean
isWorldRegistered(String name)
BlockMenu
loadInventory(Location l, BlockMenuPreset preset)
void
loadUniversalInventory(BlockMenuPreset preset)
static void
moveBlockInfo(Location from, Location to)
static ItemStack
retrieve(Block block)
Retrieves the SlimefunItem's ItemStack from the specified Block.void
save(boolean remove)
void
save(boolean computeChanges, boolean remove)
static void
setBlockInfo(Block b, String json, boolean updateTicker)
static void
setBlockInfo(Block block, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config cfg, boolean updateTicker)
static void
setBlockInfo(Location l, String json, boolean updateTicker)
static void
setBlockInfo(Location l, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config cfg, boolean updateTicker)
static void
setChunkInfo(World world, int x, int z, String key, String value)
static void
store(Block block, String item)
static void
store(Block block, ItemStack item)
-
-
-
Constructor Detail
-
BlockStorage
public BlockStorage(World w)
-
-
Method Detail
-
getStorage
public static BlockStorage getStorage(World world)
-
getForcedStorage
public static BlockStorage getForcedStorage(World world)
-
computeChanges
public void computeChanges()
-
getChanges
public int getChanges()
-
save
public void save(boolean remove)
-
save
public void save(boolean computeChanges, boolean remove)
-
retrieve
public static ItemStack retrieve(Block block)
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
- Since:
- 4.0
-
getLocationInfo
public static me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config getLocationInfo(Location l)
-
addBlockInfo
public static void addBlockInfo(Block block, String key, String value, boolean updateTicker)
-
addBlockInfo
public static void addBlockInfo(Location l, String key, String value, boolean updateTicker)
-
hasBlockInfo
public static boolean hasBlockInfo(Block block)
-
hasBlockInfo
public static boolean hasBlockInfo(Location l)
-
setBlockInfo
public static void setBlockInfo(Block block, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config cfg, boolean updateTicker)
-
setBlockInfo
public static void setBlockInfo(Location l, me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config cfg, boolean updateTicker)
-
clearBlockInfo
public static void clearBlockInfo(Block block)
-
clearBlockInfo
public static void clearBlockInfo(Location l)
-
clearBlockInfo
public static void clearBlockInfo(Block b, boolean destroy)
-
clearBlockInfo
public static void clearBlockInfo(Location l, boolean destroy)
-
_integrated_removeBlockInfo
public static void _integrated_removeBlockInfo(Location l, boolean destroy)
-
_integrated_moveLocationInfo
public static void _integrated_moveLocationInfo(Location from, Location to)
-
check
public static SlimefunItem check(Block block)
-
check
public static SlimefunItem check(Location l)
-
isWorldRegistered
public static boolean isWorldRegistered(String name)
-
loadInventory
public BlockMenu loadInventory(Location l, BlockMenuPreset preset)
-
loadUniversalInventory
public void loadUniversalInventory(BlockMenuPreset preset)
-
clearInventory
public void clearInventory(Location l)
-
hasInventory
public boolean hasInventory(Location l)
-
hasUniversalInventory
public static boolean hasUniversalInventory(String id)
-
getUniversalInventory
public static UniversalBlockMenu getUniversalInventory(Block block)
-
getUniversalInventory
public static UniversalBlockMenu getUniversalInventory(Location l)
-
getUniversalInventory
public static UniversalBlockMenu getUniversalInventory(String id)
-
hasInventory
public static boolean hasInventory(Block b)
-
getChunkInfo
public static me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config getChunkInfo(World world, int x, int z)
-
hasChunkInfo
public static boolean hasChunkInfo(World world, int x, int z)
-
hasUniversalInventory
public boolean hasUniversalInventory(Block block)
-
hasUniversalInventory
public boolean hasUniversalInventory(Location l)
-
-