|
1 | 1 | package io.papermc.paper.statistic; |
2 | 2 |
|
3 | | -import net.kyori.adventure.key.Key; |
4 | | -import net.kyori.adventure.key.KeyPattern; |
5 | 3 | import net.kyori.adventure.translation.Translatable; |
6 | 4 | import org.bukkit.Keyed; |
7 | | -import org.bukkit.Registry; |
8 | 5 | import org.jetbrains.annotations.ApiStatus; |
9 | 6 |
|
10 | 7 | /** |
11 | | - * Custom statistic types. |
| 8 | + * Represents a statistic of the type {@link StatisticTypes#CUSTOM}. |
| 9 | + * @see CustomStatistics |
12 | 10 | */ |
13 | 11 | @ApiStatus.NonExtendable |
14 | 12 | public interface CustomStatistic extends Keyed, Translatable { |
15 | 13 |
|
16 | | - // Start generate - CustomStatistic |
17 | | - // @GeneratedFrom 1.21.6 |
18 | | - CustomStatistic ANIMALS_BRED = get("animals_bred"); |
19 | | - |
20 | | - CustomStatistic AVIATE_ONE_CM = get("aviate_one_cm"); |
21 | | - |
22 | | - CustomStatistic BELL_RING = get("bell_ring"); |
23 | | - |
24 | | - CustomStatistic BOAT_ONE_CM = get("boat_one_cm"); |
25 | | - |
26 | | - CustomStatistic CLEAN_ARMOR = get("clean_armor"); |
27 | | - |
28 | | - CustomStatistic CLEAN_BANNER = get("clean_banner"); |
29 | | - |
30 | | - CustomStatistic CLEAN_SHULKER_BOX = get("clean_shulker_box"); |
31 | | - |
32 | | - CustomStatistic CLIMB_ONE_CM = get("climb_one_cm"); |
33 | | - |
34 | | - CustomStatistic CROUCH_ONE_CM = get("crouch_one_cm"); |
35 | | - |
36 | | - CustomStatistic DAMAGE_ABSORBED = get("damage_absorbed"); |
37 | | - |
38 | | - CustomStatistic DAMAGE_BLOCKED_BY_SHIELD = get("damage_blocked_by_shield"); |
39 | | - |
40 | | - CustomStatistic DAMAGE_DEALT = get("damage_dealt"); |
41 | | - |
42 | | - CustomStatistic DAMAGE_DEALT_ABSORBED = get("damage_dealt_absorbed"); |
43 | | - |
44 | | - CustomStatistic DAMAGE_DEALT_RESISTED = get("damage_dealt_resisted"); |
45 | | - |
46 | | - CustomStatistic DAMAGE_RESISTED = get("damage_resisted"); |
47 | | - |
48 | | - CustomStatistic DAMAGE_TAKEN = get("damage_taken"); |
49 | | - |
50 | | - CustomStatistic DEATHS = get("deaths"); |
51 | | - |
52 | | - CustomStatistic DROP = get("drop"); |
53 | | - |
54 | | - CustomStatistic EAT_CAKE_SLICE = get("eat_cake_slice"); |
55 | | - |
56 | | - CustomStatistic ENCHANT_ITEM = get("enchant_item"); |
57 | | - |
58 | | - CustomStatistic FALL_ONE_CM = get("fall_one_cm"); |
59 | | - |
60 | | - CustomStatistic FILL_CAULDRON = get("fill_cauldron"); |
61 | | - |
62 | | - CustomStatistic FISH_CAUGHT = get("fish_caught"); |
63 | | - |
64 | | - CustomStatistic FLY_ONE_CM = get("fly_one_cm"); |
65 | | - |
66 | | - CustomStatistic HAPPY_GHAST_ONE_CM = get("happy_ghast_one_cm"); |
67 | | - |
68 | | - CustomStatistic HORSE_ONE_CM = get("horse_one_cm"); |
69 | | - |
70 | | - CustomStatistic INSPECT_DISPENSER = get("inspect_dispenser"); |
71 | | - |
72 | | - CustomStatistic INSPECT_DROPPER = get("inspect_dropper"); |
73 | | - |
74 | | - CustomStatistic INSPECT_HOPPER = get("inspect_hopper"); |
75 | | - |
76 | | - CustomStatistic INTERACT_WITH_ANVIL = get("interact_with_anvil"); |
77 | | - |
78 | | - CustomStatistic INTERACT_WITH_BEACON = get("interact_with_beacon"); |
79 | | - |
80 | | - CustomStatistic INTERACT_WITH_BLAST_FURNACE = get("interact_with_blast_furnace"); |
81 | | - |
82 | | - CustomStatistic INTERACT_WITH_BREWINGSTAND = get("interact_with_brewingstand"); |
83 | | - |
84 | | - CustomStatistic INTERACT_WITH_CAMPFIRE = get("interact_with_campfire"); |
85 | | - |
86 | | - CustomStatistic INTERACT_WITH_CARTOGRAPHY_TABLE = get("interact_with_cartography_table"); |
87 | | - |
88 | | - CustomStatistic INTERACT_WITH_CRAFTING_TABLE = get("interact_with_crafting_table"); |
89 | | - |
90 | | - CustomStatistic INTERACT_WITH_FURNACE = get("interact_with_furnace"); |
91 | | - |
92 | | - CustomStatistic INTERACT_WITH_GRINDSTONE = get("interact_with_grindstone"); |
93 | | - |
94 | | - CustomStatistic INTERACT_WITH_LECTERN = get("interact_with_lectern"); |
95 | | - |
96 | | - CustomStatistic INTERACT_WITH_LOOM = get("interact_with_loom"); |
97 | | - |
98 | | - CustomStatistic INTERACT_WITH_SMITHING_TABLE = get("interact_with_smithing_table"); |
99 | | - |
100 | | - CustomStatistic INTERACT_WITH_SMOKER = get("interact_with_smoker"); |
101 | | - |
102 | | - CustomStatistic INTERACT_WITH_STONECUTTER = get("interact_with_stonecutter"); |
103 | | - |
104 | | - CustomStatistic JUMP = get("jump"); |
105 | | - |
106 | | - CustomStatistic LEAVE_GAME = get("leave_game"); |
107 | | - |
108 | | - CustomStatistic MINECART_ONE_CM = get("minecart_one_cm"); |
109 | | - |
110 | | - CustomStatistic MOB_KILLS = get("mob_kills"); |
111 | | - |
112 | | - CustomStatistic OPEN_BARREL = get("open_barrel"); |
113 | | - |
114 | | - CustomStatistic OPEN_CHEST = get("open_chest"); |
115 | | - |
116 | | - CustomStatistic OPEN_ENDERCHEST = get("open_enderchest"); |
117 | | - |
118 | | - CustomStatistic OPEN_SHULKER_BOX = get("open_shulker_box"); |
119 | | - |
120 | | - CustomStatistic PIG_ONE_CM = get("pig_one_cm"); |
121 | | - |
122 | | - CustomStatistic PLAY_NOTEBLOCK = get("play_noteblock"); |
123 | | - |
124 | | - CustomStatistic PLAY_RECORD = get("play_record"); |
125 | | - |
126 | | - CustomStatistic PLAY_TIME = get("play_time"); |
127 | | - |
128 | | - CustomStatistic PLAYER_KILLS = get("player_kills"); |
129 | | - |
130 | | - CustomStatistic POT_FLOWER = get("pot_flower"); |
131 | | - |
132 | | - CustomStatistic RAID_TRIGGER = get("raid_trigger"); |
133 | | - |
134 | | - CustomStatistic RAID_WIN = get("raid_win"); |
135 | | - |
136 | | - CustomStatistic SLEEP_IN_BED = get("sleep_in_bed"); |
137 | | - |
138 | | - CustomStatistic SNEAK_TIME = get("sneak_time"); |
139 | | - |
140 | | - CustomStatistic SPRINT_ONE_CM = get("sprint_one_cm"); |
141 | | - |
142 | | - CustomStatistic STRIDER_ONE_CM = get("strider_one_cm"); |
143 | | - |
144 | | - CustomStatistic SWIM_ONE_CM = get("swim_one_cm"); |
145 | | - |
146 | | - CustomStatistic TALKED_TO_VILLAGER = get("talked_to_villager"); |
147 | | - |
148 | | - CustomStatistic TARGET_HIT = get("target_hit"); |
149 | | - |
150 | | - CustomStatistic TIME_SINCE_DEATH = get("time_since_death"); |
151 | | - |
152 | | - CustomStatistic TIME_SINCE_REST = get("time_since_rest"); |
153 | | - |
154 | | - CustomStatistic TOTAL_WORLD_TIME = get("total_world_time"); |
155 | | - |
156 | | - CustomStatistic TRADED_WITH_VILLAGER = get("traded_with_villager"); |
157 | | - |
158 | | - CustomStatistic TRIGGER_TRAPPED_CHEST = get("trigger_trapped_chest"); |
159 | | - |
160 | | - CustomStatistic TUNE_NOTEBLOCK = get("tune_noteblock"); |
161 | | - |
162 | | - CustomStatistic USE_CAULDRON = get("use_cauldron"); |
163 | | - |
164 | | - CustomStatistic WALK_ON_WATER_ONE_CM = get("walk_on_water_one_cm"); |
165 | | - |
166 | | - CustomStatistic WALK_ONE_CM = get("walk_one_cm"); |
167 | | - |
168 | | - CustomStatistic WALK_UNDER_WATER_ONE_CM = get("walk_under_water_one_cm"); |
169 | | - // End generate - CustomStatistic |
170 | | - |
171 | 14 | /** |
172 | 15 | * Gets the statistic with the given custom stat. |
173 | 16 | * |
174 | 17 | * @return the statistic for the custom stat. |
175 | 18 | */ |
176 | 19 | default Statistic<CustomStatistic> stat() { |
177 | | - return StatisticType.CUSTOM.forValue(this); |
178 | | - } |
179 | | - |
180 | | - private static CustomStatistic get(@KeyPattern.Value final String key) { |
181 | | - return Registry.CUSTOM_STAT.getOrThrow(Key.key(Key.MINECRAFT_NAMESPACE, key)); |
| 20 | + return StatisticTypes.CUSTOM.forValue(this); |
182 | 21 | } |
183 | 22 | } |
0 commit comments