Search in sources :

Example 6 with Map

use of com.voxelgameslib.voxelgameslib.components.map.Map 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().getDisplayName());
    scoreboard.createAndAddLine(ChatColor.YELLOW + "" + ChatColor.BOLD + "Map: ");
}
Also used : Scoreboard(com.voxelgameslib.voxelgameslib.components.scoreboard.Scoreboard) Map(com.voxelgameslib.voxelgameslib.components.map.Map)

Aggregations

Map (com.voxelgameslib.voxelgameslib.components.map.Map)6 CommandPermission (co.aikar.commands.annotation.CommandPermission)4 Subcommand (co.aikar.commands.annotation.Subcommand)4 Syntax (co.aikar.commands.annotation.Syntax)3 Description (co.aikar.commands.annotation.Description)2 WorldException (com.voxelgameslib.voxelgameslib.api.exception.WorldException)2 MapFeature (com.voxelgameslib.voxelgameslib.api.feature.features.MapFeature)2 SpawnFeature (com.voxelgameslib.voxelgameslib.api.feature.features.SpawnFeature)2 File (java.io.File)2 ZipFile (net.lingala.zip4j.ZipFile)2 ZipException (net.lingala.zip4j.exception.ZipException)2 JsonReader (com.google.gson.stream.JsonReader)1 MapException (com.voxelgameslib.voxelgameslib.api.exception.MapException)1 MapInfo (com.voxelgameslib.voxelgameslib.components.map.MapInfo)1 Scoreboard (com.voxelgameslib.voxelgameslib.components.scoreboard.Scoreboard)1 Vector3D (com.voxelgameslib.voxelgameslib.internal.math.Vector3D)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 ArrayList (java.util.ArrayList)1