Created
September 11, 2016 12:37
-
-
Save JustBru00/ccfd04cc602dc9dde8f56996481546e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { | |
exampleMap.put("uuidhere1", 36); | |
exampleMap.put("uuidhere2", 36); | |
exampleMap.put("uuidhere3", 2); | |
exampleMap.put("uuidhere4", 36); | |
exampleMap.put("uuidhere5", 3); | |
exampleMap.put("uuidhere6", 36); | |
exampleMap.put("uuidhere7", 5); | |
exampleMap.put("uuidhere8", 36); | |
main.getConfig().set("revenger-data", exampleMap); | |
main.saveConfig(); | |
sender.sendMessage("Saved map to config."); | |
@SuppressWarnings("unchecked") | |
HashMap<String, Integer> getStuff = (HashMap<String, Integer>) main.getConfig().get("revenger-data"); | |
if (getStuff == null) { | |
sender.sendMessage("NULL GETSTUFF"); | |
return true; | |
} | |
for(Entry<String, Integer> entry : getStuff.entrySet()) { | |
String key = entry.getKey(); | |
int value = entry.getValue(); | |
sender.sendMessage("Key: " + key + " Data: " + value); | |
} | |
//getStuff.forEach((k, v) -> sender.sendMessage("key: " + k + " Value: " + v)); // JAVA 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment