Fix inventory setups (#683)
This commit is contained in:
@@ -32,6 +32,7 @@ import java.awt.image.BufferedImage;
|
|||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
@@ -102,7 +103,7 @@ public class InventorySetupPlugin extends Plugin
|
|||||||
|
|
||||||
private InventorySetupPluginPanel panel;
|
private InventorySetupPluginPanel panel;
|
||||||
|
|
||||||
private HashMap<String, InventorySetup> inventorySetups;
|
private Map<String, InventorySetup> inventorySetups = new HashMap<>();
|
||||||
|
|
||||||
private NavigationButton navButton;
|
private NavigationButton navButton;
|
||||||
|
|
||||||
@@ -270,7 +271,7 @@ public class InventorySetupPlugin extends Plugin
|
|||||||
final String json = configManager.getConfiguration(CONFIG_GROUP, CONFIG_KEY);
|
final String json = configManager.getConfiguration(CONFIG_GROUP, CONFIG_KEY);
|
||||||
if (json == null || json.isEmpty())
|
if (json == null || json.isEmpty())
|
||||||
{
|
{
|
||||||
inventorySetups = new HashMap<>();
|
inventorySetups.clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -280,7 +281,8 @@ public class InventorySetupPlugin extends Plugin
|
|||||||
{
|
{
|
||||||
|
|
||||||
}.getType();
|
}.getType();
|
||||||
inventorySetups = gson.fromJson(json, type);
|
inventorySetups.clear();
|
||||||
|
inventorySetups.putAll(gson.fromJson(json, type));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final String key : inventorySetups.keySet())
|
for (final String key : inventorySetups.keySet())
|
||||||
|
|||||||
Reference in New Issue
Block a user