Every building does not need a rebuild mine method.

This commit is contained in:
2023-10-18 11:21:29 -04:00
parent 88f67efd51
commit 44743b772b
3 changed files with 13 additions and 13 deletions
@@ -851,4 +851,15 @@ public enum BuildingManager {
} }
} }
public static void rebuildMine(Building mineBuilding) {
mineBuilding.setRank(1);
mineBuilding.meshUUID = mineBuilding.getBlueprint().getMeshForRank(mineBuilding.rank);
// New rank mean new max hit points.
mineBuilding.healthMax = mineBuilding.getBlueprint().getMaxHealth(mineBuilding.rank);
mineBuilding.setCurrentHitPoints(mineBuilding.healthMax);
mineBuilding.getBounds().setBounds(mineBuilding);
}
} }
+1 -12
View File
@@ -89,7 +89,7 @@ public class Building extends AbstractWorldObject {
private int maxGold; private int maxGold;
private int effectFlags = 0; private int effectFlags = 0;
private String name = ""; private String name = "";
private int rank; public int rank;
private boolean ownerIsNPC = true; private boolean ownerIsNPC = true;
private boolean spireIsActive = false; private boolean spireIsActive = false;
private ConcurrentHashMap<String, JobContainer> timers = null; private ConcurrentHashMap<String, JobContainer> timers = null;
@@ -954,17 +954,6 @@ public class Building extends AbstractWorldObject {
} }
public final void rebuildMine() {
this.setRank(1);
this.meshUUID = this.getBlueprint().getMeshForRank(this.rank);
// New rank mean new max hit points.
this.healthMax = this.getBlueprint().getMaxHealth(this.rank);
this.setCurrentHitPoints(this.healthMax);
this.getBounds().setBounds(this);
}
public final void refreshGuild() { public final void refreshGuild() {
UpdateObjectMsg uom = new UpdateObjectMsg(this, 5); UpdateObjectMsg uom = new UpdateObjectMsg(this, 5);
+1 -1
View File
@@ -163,7 +163,7 @@ public class HourlyJobThread implements Runnable {
mine.nationName = nation.getName(); mine.nationName = nation.getName();
mine.nationTag = nation.getGuildTag(); mine.nationTag = nation.getGuildTag();
mineBuilding.rebuildMine(); BuildingManager.rebuildMine(mineBuilding);
WorldGrid.updateObject(mineBuilding); WorldGrid.updateObject(mineBuilding);
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().parent.zoneName + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active."); ChatSystemMsg chatMsg = new ChatSystemMsg(null, mine.lastClaimer.getName() + " has claimed the mine in " + mine.getParentZone().parent.zoneName + " for " + mine.getOwningGuild().getName() + ". The mine is no longer active.");