Discussion in 'Plugin Development' started by slater96, Aug 11, 2012.
Hi, is it possible to get the time that a players name has been in a hashmap for?
Perhaps run a scheduler and increment an integer and store that with the player?
What exactly is this used for? There is a lot of ways to do this dependent on the use.
I put player names in a hashmap when I jail someone and wanted to get how long they have been in jail for.
Add them to another hashmap at the same time and just don't remove them from that one.
You actually only need one HashMap<String, Long> in which you store the player's name and the time he got jailed.
If there is an entry for the player in the HashMap, the player is jailed and you know when.
If you have multiple HashMap's with the same key, it's just rhetorical. You should store an Object as the value.
Maybe this can help: http://forums.bukkit.org/threads/solved-hashmap-cooldown-issues.92728/
Separate names with a comma.