From bf8e44ee632a3946f0c00fc478e1cbdc458d539c Mon Sep 17 00:00:00 2001 From: Brianna Date: Mon, 17 Jun 2019 17:10:49 -0400 Subject: [PATCH] Fix for null furnace level. --- src/main/java/com/songoda/epicfurnaces/furnace/Furnace.java | 1 - src/main/java/com/songoda/epicfurnaces/storage/Storage.java | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/songoda/epicfurnaces/furnace/Furnace.java b/src/main/java/com/songoda/epicfurnaces/furnace/Furnace.java index a365129..aee6dcd 100644 --- a/src/main/java/com/songoda/epicfurnaces/furnace/Furnace.java +++ b/src/main/java/com/songoda/epicfurnaces/furnace/Furnace.java @@ -14,7 +14,6 @@ import org.bukkit.entity.Player; import org.bukkit.event.inventory.FurnaceSmeltEvent; import org.bukkit.inventory.FurnaceInventory; import org.bukkit.inventory.InventoryHolder; -import org.bukkit.inventory.ItemStack; import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; diff --git a/src/main/java/com/songoda/epicfurnaces/storage/Storage.java b/src/main/java/com/songoda/epicfurnaces/storage/Storage.java index 319eca2..27a198b 100644 --- a/src/main/java/com/songoda/epicfurnaces/storage/Storage.java +++ b/src/main/java/com/songoda/epicfurnaces/storage/Storage.java @@ -32,7 +32,10 @@ public abstract class Storage { * Dump FurnaceManager to file. */ for (Furnace furnace : plugin.getFurnaceManager().getFurnaces().values()) { - if (furnace == null || furnace.getLocation() == null || furnace.getLocation().getWorld() == null) continue; + if (furnace == null + || furnace.getLocation() == null + || furnace.getLocation().getWorld() == null + || furnace.getLevel() == null) continue; String locationStr = Methods.serializeLocation(furnace.getLocation()); prepareSaveItem("charged", new StorageItem("location", locationStr),