-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Expand file tree
/
Copy pathPlayerRequestStatisticsEvent.java
More file actions
56 lines (46 loc) · 1.46 KB
/
PlayerRequestStatisticsEvent.java
File metadata and controls
56 lines (46 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package io.papermc.paper.event.player;
import io.papermc.paper.statistic.Statistic;
import it.unimi.dsi.fastutil.objects.Object2IntMap;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;
import org.jetbrains.annotations.ApiStatus;
import org.jspecify.annotations.NullMarked;
/**
* Called when the player requests their statistics.
*/
@NullMarked
public class PlayerRequestStatisticsEvent extends PlayerEvent implements Cancellable {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final Object2IntMap<Statistic<?>> statisticMap;
private boolean cancelled;
@ApiStatus.Internal
public PlayerRequestStatisticsEvent(final Player player, final Object2IntMap<Statistic<?>> statisticMap) {
super(player);
this.statisticMap = statisticMap;
}
/**
* Gets the statistic map to be sent to the player.
*
* @return the mutable statistic map
*/
public Object2IntMap<Statistic<?>> getStatisticMap() {
return this.statisticMap;
}
@Override
public boolean isCancelled() {
return this.cancelled;
}
@Override
public void setCancelled(final boolean cancel) {
this.cancelled = cancel;
}
@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}
public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}