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

code cleanup

This commit is contained in:
DNx 2020-04-05 23:25:10 +07:00
parent ab41129d6b
commit 2396db25ad
2 changed files with 9 additions and 3 deletions

View File

@ -2,6 +2,8 @@ package io.github.thebusybiscuit.slimefun4.utils;
import org.bukkit.block.Block; import org.bukkit.block.Block;
public final class BlockUtils { public final class BlockUtils {
private BlockUtils() {}
public static boolean hasInventory(Block block) { public static boolean hasInventory(Block block) {
if (block == null) return false; if (block == null) return false;

View File

@ -15,7 +15,9 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import com.google.gson.*; import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.stream.JsonWriter; import com.google.gson.stream.JsonWriter;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Chunk; import org.bukkit.Chunk;
@ -388,8 +390,10 @@ public class BlockStorage {
} }
jsonWriter.endObject(); jsonWriter.endObject();
return stringWriter.toString(); return stringWriter.toString();
} catch (IOException e) { }
throw new AssertionError(e); catch (IOException x) {
Slimefun.getLogger().log(Level.SEVERE, "An error occurred while serializing BlockInfo", x);
return null;
} }
} }