mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
Merge branch 'api/access-raw-storage' of github.com:Slimefun/Slimefun4 into api/access-raw-storage
This commit is contained in:
commit
5aa4361a92
@ -27,6 +27,8 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
@ -360,6 +362,23 @@ public class BlockStorage {
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public Map<Location, Config> getRawStorage() {
|
||||
return this.storage;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static Map<Location, Config> getRawStorage(@Nonnull World world) {
|
||||
Validate.notNull(world, "World cannot be null!");
|
||||
|
||||
BlockStorage storage = getStorage(world);
|
||||
if (storage != null) {
|
||||
return storage.getRawStorage();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static void store(Block block, ItemStack item) {
|
||||
SlimefunItem sfitem = SlimefunItem.getByItem(item);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user