Update LinkedChest.java

When upgrading from previous versions chests.yml doesnt contain the mapping for autocraftingtables.
This adds a check for null for both chests and crafting tables.
This commit is contained in:
jameslfc19 2020-06-27 16:49:13 +01:00
parent 01229a2907
commit d44a417a50

View File

@ -22,7 +22,9 @@ public class LinkedChest implements ConfigurationSerializable {
@SuppressWarnings("unchecked")
public LinkedChest(Map<String, Object> map){
chests = (HashMap<String, HashMap<String, InventoryStorage>>) map.get("chests");
if(chests == null) chests = new HashMap<>();
autocraftingtables = (HashMap<String, HashMap<String, AutoCraftingStorage>>) map.get("autocraftingtables");
if(autocraftingtables == null) autocraftingtables = new HashMap<>();
validate();
}