From 1d7c1e68c8eaad26b6e1a024b49b1defb91c074a Mon Sep 17 00:00:00 2001 From: Bas Verhoeven Date: Sun, 7 Apr 2019 02:39:09 +0200 Subject: [PATCH] Do not load incomplete blocks (missing "id") If incomplete blocks are loaded, without an "id", items will not have any usable slimefun block information and will not be usable. Breaking these blocks will give you a "CSCoreLib's Head". --- src/me/mrCookieSlime/Slimefun/api/BlockStorage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/me/mrCookieSlime/Slimefun/api/BlockStorage.java b/src/me/mrCookieSlime/Slimefun/api/BlockStorage.java index 8895d950d..1bc00c394 100644 --- a/src/me/mrCookieSlime/Slimefun/api/BlockStorage.java +++ b/src/me/mrCookieSlime/Slimefun/api/BlockStorage.java @@ -98,7 +98,7 @@ public class BlockStorage { System.out.println("[Slimefun] Loading Blocks... " + Math.round((((done * 100.0f) / total) * 100.0f) / 100.0f) + "% done (\"" + w.getName() + "\")"); timestamp = System.currentTimeMillis(); } - + FileConfiguration cfg = YamlConfiguration.loadConfiguration(file); for (String key: cfg.getKeys(false)) { Location l = deserializeLocation(key); @@ -107,9 +107,9 @@ public class BlockStorage { totalBlocks++; String json = cfg.getString(key); Config blockInfo = parseBlockInfo(l, json); - if (blockInfo == null) continue; + if (blockInfo == null || !blockInfo.contains("id")) continue; storage.put(l, blockInfo); - + if (SlimefunItem.isTicking(file.getName().replace(".sfb", ""))) { Set locations = ticking_chunks.containsKey(chunk_string) ? ticking_chunks.get(chunk_string): new HashSet(); locations.add(l);