1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Documented #retrieve()

Credits: @Poslovitch
This commit is contained in:
Redemption 2018-01-06 16:13:16 +01:00 committed by GitHub
parent 9f0796327b
commit 17cc989012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -246,6 +246,15 @@ public class BlockStorage {
addBlockInfo(block, "id", item, true); addBlockInfo(block, "id", item, true);
} }
/**
* 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.
*
* @param block the block to retrieve the ItemStack from
* @return the SlimefunItem's ItemStack corresponding to the block if it has one, otherwise null
*
* @since 4.0
*/
public static ItemStack retrieve(Block block) { public static ItemStack retrieve(Block block) {
if (!hasBlockInfo(block)) return null; if (!hasBlockInfo(block)) return null;
else { else {