Search in sources :

Example 6 with MapInfo

use of com.voxelgameslib.voxelgameslib.components.map.MapInfo in project VoxelGamesLibv2 by VoxelGamesLib.

the class VoteFeature method confirmVote.

/**
 * Confirms a vote for a map
 */
private void confirmVote(@Nonnull User voter, @Nonnull Integer mapId) {
    if (votes.containsKey(voter.getUuid())) {
        Lang.msg(voter, LangKey.VOTE_ALREADY_VOTED);
    } else {
        MapInfo mapInfo = availableMaps.get(mapId);
        if (mapInfo == null) {
            Lang.msg(voter, LangKey.VOTE_UNKNOWN_MAP, mapId);
            return;
        }
        votes.put(voter.getUuid(), mapId);
        Lang.msg(voter, LangKey.VOTE_SUBMITTED, mapInfo.getDisplayName(), mapId);
    }
}
Also used : MapInfo(com.voxelgameslib.voxelgameslib.components.map.MapInfo)

Aggregations

MapInfo (com.voxelgameslib.voxelgameslib.components.map.MapInfo)6 JsonReader (com.google.gson.stream.JsonReader)1 GameEvent (com.voxelgameslib.voxelgameslib.api.event.GameEvent)1 MapException (com.voxelgameslib.voxelgameslib.api.exception.MapException)1 WorldException (com.voxelgameslib.voxelgameslib.api.exception.WorldException)1 DefaultGameData (com.voxelgameslib.voxelgameslib.api.game.DefaultGameData)1 Map (com.voxelgameslib.voxelgameslib.components.map.Map)1 ItemBuilder (com.voxelgameslib.voxelgameslib.util.utils.ItemBuilder)1 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Nonnull (javax.annotation.Nonnull)1 ZipFile (net.lingala.zip4j.ZipFile)1 ZipException (net.lingala.zip4j.exception.ZipException)1 FileHeader (net.lingala.zip4j.model.FileHeader)1 ItemStack (org.bukkit.inventory.ItemStack)1