use of com.voxelgameslib.voxelgameslib.components.scoreboard.Scoreboard in project VoxelGamesLibv2 by VoxelGamesLib.
the class MapInfoFeature method enable.
@Override
public void enable() {
MapFeature mapFeature = getPhase().getFeature(MapFeature.class);
Map map = mapFeature.getMap();
ScoreboardFeature scoreboardFeature = getPhase().getFeature(ScoreboardFeature.class);
Scoreboard scoreboard = scoreboardFeature.getScoreboard();
for (String mode : map.getInfo().getGamemodes()) {
scoreboard.createAndAddLine(mode);
}
scoreboard.createAndAddLine(ChatColor.YELLOW + "" + ChatColor.BOLD + "Gamemodes: ");
scoreboard.createAndAddLine(map.getInfo().getAuthor());
scoreboard.createAndAddLine(ChatColor.YELLOW + "" + ChatColor.BOLD + "Author: ");
scoreboard.createAndAddLine(map.getInfo().getName());
scoreboard.createAndAddLine(ChatColor.YELLOW + "" + ChatColor.BOLD + "Map: ");
}
use of com.voxelgameslib.voxelgameslib.components.scoreboard.Scoreboard in project VoxelGamesLibv2 by VoxelGamesLib.
the class PersonalScoreboardFeature method onQuit.
@GameEvent
public void onQuit(@Nonnull GameLeaveEvent event) {
Scoreboard scoreboard = scoreboards.get(event.getUser());
scoreboard.removeAllLines();
scoreboard.removeAllUsers();
scoreboards.remove(event.getUser());
}
use of com.voxelgameslib.voxelgameslib.components.scoreboard.Scoreboard in project VoxelGamesLibv2 by VoxelGamesLib.
the class PersonalScoreboardFeature method enable.
@Override
public void enable() {
globalScoreboard = new GlobalScoreboard(scoreboards.values());
getPhase().getGame().getAllUsers().forEach(user -> {
Scoreboard scoreboard = scoreboardHandler.createScoreboard(getPhase().getGame().getGameMode().getName());
scoreboard.addUser(user);
scoreboards.put(user, scoreboard);
});
}
use of com.voxelgameslib.voxelgameslib.components.scoreboard.Scoreboard in project VoxelGamesLibv2 by VoxelGamesLib.
the class PersonalScoreboardFeature method onJoin.
@GameEvent
public void onJoin(@Nonnull GameJoinEvent event) {
Scoreboard scoreboard = scoreboardHandler.createScoreboard(getPhase().getGame().getGameMode().getName());
scoreboard.addUser(event.getUser());
scoreboards.put(event.getUser(), scoreboard);
}
Aggregations