From df037a51f00e1c50a3fe60aec9eab39b74d4cc0b Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 10 Apr 2024 17:40:00 -0400 Subject: [PATCH] More info on template bootstrap --- src/engine/db/handlers/dbItemHandler.java | 5 +---- src/engine/objects/ItemTemplate.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/engine/db/handlers/dbItemHandler.java b/src/engine/db/handlers/dbItemHandler.java index 73162f9e..83229178 100644 --- a/src/engine/db/handlers/dbItemHandler.java +++ b/src/engine/db/handlers/dbItemHandler.java @@ -195,10 +195,7 @@ public class dbItemHandler extends dbHandlerBase { itemTemplate.template_id = templateID; ItemTemplate.templates.put(templateID, itemTemplate); - if (templateTCountMap.entrySet().contains(itemTemplate.item_type)) - templateTCountMap.put(itemTemplate.item_type, templateTCountMap.get(itemTemplate.item_type) + 1); - else - templateTCountMap.put(itemTemplate.item_type, 1); + templateTCountMap.merge(itemTemplate.item_type, 1, Integer::sum); } Logger.info(templateTCountMap.toString()); diff --git a/src/engine/objects/ItemTemplate.java b/src/engine/objects/ItemTemplate.java index a2d9f140..0ac29787 100644 --- a/src/engine/objects/ItemTemplate.java +++ b/src/engine/objects/ItemTemplate.java @@ -181,7 +181,7 @@ public class ItemTemplate { // Banes are defined by their sparse data field - if (obj_sparse_data.entrySet().contains("ACTIONRESPONSE")) + if (obj_sparse_data.get("ACTIONRESPONSE") != null) if (obj_sparse_data.get("ACTIONRESPONSE").equals("4250517122")) item_bane_rank = ((Long) jsonObject.get("item_bane_rank")).intValue();