Skip to content

Commit

Permalink
fix player UUID data fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
kory33 committed Apr 9, 2017
1 parent 3ba3228 commit 3df84ef
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.nio.file.Files;
import java.util.HashMap;
import java.util.HashSet;
import java.util.UUID;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand Down Expand Up @@ -36,8 +37,12 @@ public VoteManager(File voteDataDirectory) throws IOException {
String fileName = playerVoteDataFile.getName();
String playerUUID = fileName.substring(0, fileName.length() - Formats.JSON_EXT.length() - 1);

Player player = Bukkit.getPlayer(playerUUID);
Player player = Bukkit.getPlayer(UUID.fromString(playerUUID));

if (player == null) {
continue;
}

HashMap<Integer, HashSet<String>> votedPointsMap = new HashMap<>();

for (String scoreString: jsonObject.keySet()) {
Expand Down

0 comments on commit 3df84ef

Please sign in to comment.