https://gist.github.com/anonymous/869f3c4a5b85ebf8a676a77021467fbb
Za każdym razem przy użyciu:
Instant instant = this.helpOpCache.getIfPresent(player.getUniqueId());
wykonuje się RemovalListener:
private class HelpopRemovalListener implements RemovalListener {
@Override
public void onRemoval(RemovalNotification notification) {
UUID uuid = notification.getKey();
Player player = HelpOpModule.this.getTools().getServer().getPlayer(uuid);
if (player == null) {
return;
}
String message = HelpOpModule.this.getValue("modules.helpop.cooldown.ready");
player.sendMessage(message);
}
}
który nie powinien się wykonywać. Dopiero minutę od ostatniego użycia danego obiektu powinien on się wykonać. Jakieś pomysły? Guava, Apache Commons, Bukkit - wszystko najnowsze.