From f744c64737ec7d6232ef2529998365e3bd2b789f Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 28 Mar 2023 17:29:16 -0400 Subject: [PATCH] Superfluous getter and setters removed. --- src/engine/gameManager/NPCManager.java | 3 +++ src/engine/objects/EquipmentSetEntry.java | 19 ++----------------- src/engine/objects/MobBase.java | 2 +- src/engine/server/world/WorldServer.java | 2 +- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index ef261daa..9c64d06c 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -10,4 +10,7 @@ public enum NPCManager { public static HashMap> EquipmentSetMap = new HashMap<>(); + public static void LoadAllEquipmentSets() { + EquipmentSetMap = DbManager.ItemBaseQueries.LOAD_EQUIPMENT_FOR_NPC_AND_MOBS(); + } } diff --git a/src/engine/objects/EquipmentSetEntry.java b/src/engine/objects/EquipmentSetEntry.java index 7a6fbf49..3ff6c706 100644 --- a/src/engine/objects/EquipmentSetEntry.java +++ b/src/engine/objects/EquipmentSetEntry.java @@ -9,16 +9,13 @@ package engine.objects; -import engine.gameManager.DbManager; -import engine.gameManager.NPCManager; - import java.sql.ResultSet; import java.sql.SQLException; public class EquipmentSetEntry { - private float dropChance; - private int itemID; + public float dropChance; + public int itemID; /** * ResultSet Constructor @@ -29,16 +26,4 @@ public class EquipmentSetEntry { this.itemID = (rs.getInt("itemID")); } - public static void LoadAllEquipmentSets() { - NPCManager.EquipmentSetMap = DbManager.ItemBaseQueries.LOAD_EQUIPMENT_FOR_NPC_AND_MOBS(); - } - - float getDropChance() { - return dropChance; - } - - public int getItemID() { - return itemID; - } - } diff --git a/src/engine/objects/MobBase.java b/src/engine/objects/MobBase.java index 525e72af..cacfa794 100644 --- a/src/engine/objects/MobBase.java +++ b/src/engine/objects/MobBase.java @@ -152,7 +152,7 @@ public class MobBase extends AbstractGameObject { for (EquipmentSetEntry equipmentSetEntry : equipList) { - MobEquipment mobEquipment = new MobEquipment(equipmentSetEntry.getItemID(), equipmentSetEntry.getDropChance()); + MobEquipment mobEquipment = new MobEquipment(equipmentSetEntry.itemID, equipmentSetEntry.dropChance); ItemBase itemBase = mobEquipment.getItemBase(); if (itemBase != null) { diff --git a/src/engine/server/world/WorldServer.java b/src/engine/server/world/WorldServer.java index e5e99e67..46ce5d89 100644 --- a/src/engine/server/world/WorldServer.java +++ b/src/engine/server/world/WorldServer.java @@ -285,7 +285,7 @@ public class WorldServer { DbManager.PromotionQueries.GET_ALL_PROMOTIONS(); Logger.info("Loading NPC and Mob Equipment Sets"); - EquipmentSetEntry.LoadAllEquipmentSets(); + NPCManager.LoadAllEquipmentSets(); Logger.info("Loading Gold Loot for Mobbases"); MobbaseGoldEntry.LoadMobbaseGold();