From 3ee0ec13426c0cfb422e87ab23ca4675910c585c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Thu, 28 Mar 2024 05:10:22 -0400 Subject: [PATCH] More itembase refactor --- .../handlers/RepairBuildingMsgHandler.java | 22 ++----------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/engine/net/client/handlers/RepairBuildingMsgHandler.java b/src/engine/net/client/handlers/RepairBuildingMsgHandler.java index 59c02bac..62373432 100644 --- a/src/engine/net/client/handlers/RepairBuildingMsgHandler.java +++ b/src/engine/net/client/handlers/RepairBuildingMsgHandler.java @@ -47,21 +47,16 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { if (serverZone.playerCityUUID == 0 && targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() != BuildingGroup.MINE) return; - City city = City.GetCityFromCache(serverZone.playerCityUUID); - if (city != null) { + if (city != null) if (city.getBane() != null && city.protectionEnforced == false) return; - } - //cannot repair mines during 24/7 activity. - if (targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.MINE && Mine.getMineFromTower(targetBuilding.getObjectUUID()).isActive == true) { + if (targetBuilding.getBlueprint() != null && targetBuilding.getBlueprint().getBuildingGroup() == BuildingGroup.MINE && Mine.getMineFromTower(targetBuilding.getObjectUUID()).isActive == true) return; - } - int maxHP = (int) targetBuilding.getMaxHitPoints(); int repairCost = BuildingManager.GetRepairCost(targetBuilding); @@ -94,35 +89,22 @@ public class RepairBuildingMsgHandler extends AbstractClientMsgHandler { Building targetBuilding; RepairBuildingMsg msg; - // Member variable assignment msg = (RepairBuildingMsg) baseMsg; - player = SessionManager.getPlayerCharacter(origin); if (player == null) return true; - switch (msg.getType()) { case 0: targetBuilding = BuildingManager.getBuildingFromCache(msg.getBuildingID()); RepairBuilding(targetBuilding, origin, msg); break; - - // targetBuilding.createFurniture(item.getItemBase().getUseID(), 0, msg.getFurnitureLoc(), Vector3f.ZERO, 0, player); - - } - - // dispatch = Dispatch.borrow(player, baseMsg); - // DispatchMessage.dispatchMsgDispatch(dispatch, Enum.DispatchChannel.SECONDARY); - return true; - } - }