Remove unnecessary cooldown on hologram line click

This commit is contained in:
filoghost 2021-08-23 19:43:03 +02:00
parent 2da7d318df
commit 1aa8a17dab

View File

@ -13,13 +13,8 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.MustBeInvokedByOverriders;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
import java.util.WeakHashMap;
public abstract class BaseClickableLine extends BaseHologramLine {
private static final Map<Player, Long> lastClickByPlayer = new WeakHashMap<>();
private ClickListener clickListener;
protected BaseClickableLine(BaseHologram hologram) {
@ -31,14 +26,6 @@ public abstract class BaseClickableLine extends BaseHologramLine {
return;
}
Long lastClick = lastClickByPlayer.get(player);
long now = System.currentTimeMillis();
if (lastClick != null && now - lastClick < 100) {
return;
}
lastClickByPlayer.put(player, now);
try {
clickListener.onClick(player);
} catch (Throwable t) {