Migration to org.json
This commit is contained in:
@@ -17,8 +17,7 @@ import engine.objects.AbstractCharacter;
|
||||
import engine.objects.CharacterItemManager;
|
||||
import engine.objects.Item;
|
||||
import engine.objects.ItemTemplate;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.JSONObject;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.sql.Connection;
|
||||
@@ -180,8 +179,6 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
|
||||
public void LOAD_ITEM_TEMPLATES() {
|
||||
|
||||
JSONParser jsonParser = new JSONParser();
|
||||
|
||||
HashMap<ItemType, Integer> templateTCountMap = new HashMap<>();
|
||||
|
||||
try (Connection connection = DbManager.getConnection();
|
||||
@@ -190,7 +187,7 @@ public class dbItemHandler extends dbHandlerBase {
|
||||
|
||||
while (rs.next()) {
|
||||
int templateID = rs.getInt("id");
|
||||
JSONObject jsonObject = (JSONObject) jsonParser.parse(rs.getString("template"));
|
||||
JSONObject jsonObject = new JSONObject(rs.getString("template"));
|
||||
ItemTemplate itemTemplate = new ItemTemplate(jsonObject);
|
||||
itemTemplate.template_id = templateID;
|
||||
ItemTemplate.templates.put(templateID, itemTemplate);
|
||||
|
||||
Reference in New Issue
Block a user