Skip to content

Commit 80a4b7f

Browse files
committed
Move constants to separate file
1 parent d0244c7 commit 80a4b7f

File tree

10 files changed

+250
-216
lines changed

10 files changed

+250
-216
lines changed
Lines changed: 3 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -1,183 +1,22 @@
11
package io.papermc.paper.statistic;
22

3-
import net.kyori.adventure.key.Key;
4-
import net.kyori.adventure.key.KeyPattern;
53
import net.kyori.adventure.translation.Translatable;
64
import org.bukkit.Keyed;
7-
import org.bukkit.Registry;
85
import org.jetbrains.annotations.ApiStatus;
96

107
/**
11-
* Custom statistic types.
8+
* Represents a statistic of the type {@link StatisticTypes#CUSTOM}.
9+
* @see CustomStatistics
1210
*/
1311
@ApiStatus.NonExtendable
1412
public interface CustomStatistic extends Keyed, Translatable {
1513

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

0 commit comments

Comments
 (0)