Move forging stuff to ForgingManager, make client respond to ForgeGetQueueDataReq and actually display forging queues.

This commit is contained in:
ImmuState
2022-06-04 07:12:47 -07:00
committed by Melledy
parent 899a87a2ae
commit 3fc63c2c4b
6 changed files with 121 additions and 13 deletions

View File

@@ -30,6 +30,7 @@ import emu.grasscutter.game.managers.InsectCaptureManager;
import emu.grasscutter.game.managers.StaminaManager.StaminaManager;
import emu.grasscutter.game.managers.SotSManager;
import emu.grasscutter.game.managers.EnergyManager.EnergyManager;
import emu.grasscutter.game.managers.ForgingManager.ForgingManager;
import emu.grasscutter.game.props.ActionReason;
import emu.grasscutter.game.props.EntityType;
import emu.grasscutter.game.props.PlayerProperty;
@@ -153,6 +154,7 @@ public class Player {
@Transient private MapMarksManager mapMarksManager;
@Transient private StaminaManager staminaManager;
@Transient private EnergyManager energyManager;
@Transient private ForgingManager forgingManager;
@Transient private DeforestationManager deforestationManager;
private long springLastUsed;
@@ -209,6 +211,7 @@ public class Player {
this.staminaManager = new StaminaManager(this);
this.sotsManager = new SotSManager(this);
this.energyManager = new EnergyManager(this);
this.forgingManager = new ForgingManager(this);
}
// On player creation
@@ -240,6 +243,7 @@ public class Player {
this.sotsManager = new SotSManager(this);
this.energyManager = new EnergyManager(this);
this.deforestationManager = new DeforestationManager(this);
this.forgingManager = new ForgingManager(this);
}
public int getUid() {
@@ -1120,6 +1124,10 @@ public class Player {
return this.energyManager;
}
public ForgingManager getForgingManager() {
return this.forgingManager;
}
public AbilityManager getAbilityManager() {
return abilityManager;
}
@@ -1265,7 +1273,7 @@ public class Player {
session.send(new PacketWidgetGadgetAllDataNotify());
session.send(new PacketPlayerHomeCompInfoNotify(this));
session.send(new PacketHomeComfortInfoNotify(this));
session.send(new PacketForgeDataNotify(this));
this.forgingManager.sendForgeDataNotify();
getTodayMoonCard(); // The timer works at 0:0, some users log in after that, use this method to check if they have received a reward today or not. If not, send the reward.