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:
parent
237cae37ca
commit
8b09e54106
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user