Fix for null furnace level.

This commit is contained in:
Brianna 2019-06-17 17:10:49 -04:00
parent 8155fb6c97
commit bf8e44ee63
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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),