mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2024-12-29 20:27:42 +01:00
Remove unnecessary cooldown on hologram line click
This commit is contained in:
parent
2da7d318df
commit
1aa8a17dab
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user