Fix flag capture and game phase timing bugs

Adjusted the flag capture sequence to ensure proper update of the carrier before notifying about the capture. Fixed the phaseStartTime initialization to correctly track phase transitions. Updated the build number for the new changes.
This commit is contained in:
Teriuihi 2025-02-11 23:02:38 +01:00
parent 237cae37ca
commit 8b09e54106
3 changed files with 4 additions and 4 deletions

View File

@ -81,8 +81,8 @@ public class Flag implements Runnable {
//TODO add de-buffs and enable buffs for others?
player.getInventory().setItem(EquipmentSlot.HEAD, flagItem);
Bukkit.getScheduler().runTask(main, () -> flagLocation.getBlock().setType(Material.AIR));
notifyAboutCapture();
flagCarrier = player;
notifyAboutCapture();
resetFlag();
}

View File

@ -39,7 +39,6 @@ public class RunningGame implements Runnable {
try {
GamePhase nextPhase = (currentPhase.ordinal() + 1 < GamePhase.values().length) ? GamePhase.values()[currentPhase.ordinal() + 1] : null;
if (phaseStartTime == null) {
phaseStartTime = Instant.now();
nextPhaseActions(null, currentPhase);
}
@ -60,6 +59,7 @@ public class RunningGame implements Runnable {
private void nextPhaseActions(@Nullable GamePhase previousPhase, @NotNull GamePhase phase) {
//TODO command to go to next phase
this.currentPhase = phase;
this.phaseStartTime = Instant.now();
if (previousPhase != null) {
gameManager.getPhaseExecutor(previousPhase).end(phase);
}

View File

@ -1,3 +1,3 @@
#Tue Feb 11 22:04:16 CET 2025
buildNumber=42
#Tue Feb 11 22:21:13 CET 2025
buildNumber=45
version=0.1