Migration to org.json

This commit is contained in:
2024-04-22 09:21:46 -04:00
parent d557e30716
commit ba47b30673
6 changed files with 18 additions and 24 deletions
+2 -5
View File
@@ -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);