Integrate TabListService to update player colors during the game
This commit is contained in:
parent
95219c17bc
commit
7dce9d9f30
|
|
@ -38,13 +38,13 @@ public final class Main extends JavaPlugin {
|
||||||
statService = new StatService(this, round);
|
statService = new StatService(this, round);
|
||||||
playerTeleporterService = PlayerTeleporterService.createSingletonInstance();
|
playerTeleporterService = PlayerTeleporterService.createSingletonInstance();
|
||||||
roundService = RoundService.createSingletonInstance(round, this, lootService, statService, playerTeleporterService);
|
roundService = RoundService.createSingletonInstance(round, this, lootService, statService, playerTeleporterService);
|
||||||
|
tabListService = new TabListService(round, roundService);
|
||||||
|
roundService.setTabListService(tabListService);
|
||||||
playerService = PlayerService.createSingletonInstance(round, roundService, playerTeleporterService);
|
playerService = PlayerService.createSingletonInstance(round, roundService, playerTeleporterService);
|
||||||
|
|
||||||
bossBarService = BossBarService.createSingletonInstance(round, roundService);
|
bossBarService = BossBarService.createSingletonInstance(round, roundService);
|
||||||
round.setBossBarService(bossBarService);
|
round.setBossBarService(bossBarService);
|
||||||
roundService.setBossBarService(bossBarService);
|
roundService.setBossBarService(bossBarService);
|
||||||
|
|
||||||
tabListService = new TabListService(round, roundService);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ public class RoundService implements RoundListener {
|
||||||
private final Round round;
|
private final Round round;
|
||||||
@Setter
|
@Setter
|
||||||
private BossBarService bossBarService;
|
private BossBarService bossBarService;
|
||||||
|
@Setter
|
||||||
|
private TabListService tabListService;
|
||||||
|
|
||||||
public static RoundService createSingletonInstance(Round round, Main main, LootService lootService, StatService statService, PlayerTeleporterService playerTeleporterService) {
|
public static RoundService createSingletonInstance(Round round, Main main, LootService lootService, StatService statService, PlayerTeleporterService playerTeleporterService) {
|
||||||
if (instance != null) {
|
if (instance != null) {
|
||||||
|
|
@ -75,6 +77,13 @@ public class RoundService implements RoundListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tabListService != null) {
|
||||||
|
Player player = Bukkit.getPlayer(uuid);
|
||||||
|
if (player != null) {
|
||||||
|
tabListService.updatePlayerColor(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!roundState.equals(ROUND_STATE.KILL_PHASE) && !roundState.equals(ROUND_STATE.FINALE)) {
|
if (!roundState.equals(ROUND_STATE.KILL_PHASE) && !roundState.equals(ROUND_STATE.FINALE)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user