Skip to content

Commit 1f5231c

Browse files
authored
chore: registry renames (#43)
1 parent 45ad763 commit 1f5231c

File tree

3 files changed

+49
-40
lines changed

3 files changed

+49
-40
lines changed

DataGenerator/src/main/java/net/minestom/datagen/DataGen.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class DataGen {
2222
private static final Logger LOGGER = LoggerFactory.getLogger(DataGen.class);
2323
private static Path OUTPUT = Path.of("../MinestomData/");
2424

25-
private static final List<String> TAG_TYPES = List.of("banner_pattern", "block", "cat_variant", "damage_type", "enchantment", "entity_type", "fluid", "game_event", "instrument", "item", "painting_variant", "worldgen/biome");
25+
private static final List<String> TAG_TYPES = List.of("banner_pattern", "block", "damage_type", "enchantment", "entity_type", "fluid", "game_event", "instrument", "item", "painting_variant", "worldgen/biome");
2626

2727
public static void main(String[] args) throws Exception {
2828
if (args.length > 0) {

DataGenerator/src/main/java/net/minestom/datagen/DataGenType.java

Lines changed: 47 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,61 @@
1313

1414
public enum DataGenType {
1515
CONSTANTS("constants", new MinecraftConstantGenerator()),
16+
// Tags are specified as a special case in datagen
17+
18+
// Codegen only
1619

17-
ATTRIBUTES("attributes", new AttributeGenerator()),
18-
BIOMES("biomes", new BiomeGenerator()),
19-
BLOCKS("blocks", new BlockGenerator()),
20-
BLOCK_SOUND_TYPES("block_sound_types", new BlockSoundTypeGenerator()),
20+
COMMAND_ARGUMENTS("command_arguments", new GenericRegistryGenerator<>(BuiltInRegistries.COMMAND_ARGUMENT_TYPE)),
21+
CONSUME_EFFECT("consume_effects", new GenericRegistryGenerator<>(BuiltInRegistries.CONSUME_EFFECT_TYPE)),
2122
CUSTOM_STATISTICS("custom_statistics", new CustomStatisticGenerator()),
2223
DYE_COLORS("dye_colors", new DyeColorGenerator()),
23-
ENTITIES("entities", new EntityGenerator()),
24-
FEATURE_FLAGS("feature_flags", new FeatureFlagGenerator()),
25-
FLUIDS("fluids", new FluidGenerator()),
26-
GAME_EVENTS("game_events", new GameEventGenerator()),
27-
WORLD_EVENTS("world_events", new WorldEventGenerator()),
28-
MATERIALS("items", new MaterialGenerator()),
2924
MAP_COLORS("map_colors", new MapColorGenerator()),
30-
PARTICLES("particles", new ParticleGenerator()),
31-
MOB_EFFECTS("potion_effects", new MobEffectGenerator()),
32-
POTIONS("potions", new PotionGenerator()),
33-
SOUNDS("sounds", new SoundGenerator()),
34-
SOUND_SOURCES("sound_sources", new SoundSourceGenerator()),
35-
VILLAGER_PROFESSIONS("villager_professions", new VillagerProfessionGenerator()),
36-
VILLAGER_TYPES("villager_types", new GenericRegistryGenerator<>(BuiltInRegistries.VILLAGER_TYPE)),
37-
RECIPE_TYPE("recipe_types", new GenericRegistryGenerator<>(BuiltInRegistries.RECIPE_TYPE)),
25+
PARTICLES("particle", new ParticleGenerator()),
26+
WORLD_EVENTS("world_events", new WorldEventGenerator()),
27+
RECIPE_BOOK_CATEGORY("recipe_book_categories", new GenericRegistryGenerator<>(BuiltInRegistries.RECIPE_BOOK_CATEGORY)),
3828
RECIPE_DISPLAY_TYPE("recipe_display_types", new GenericRegistryGenerator<>(BuiltInRegistries.RECIPE_DISPLAY)),
29+
RECIPE_TYPE("recipe_types", new GenericRegistryGenerator<>(BuiltInRegistries.RECIPE_TYPE)),
3930
SLOT_DISPLAY_TYPE("slot_display_types", new GenericRegistryGenerator<>(BuiltInRegistries.SLOT_DISPLAY)),
40-
RECIPE_BOOK_CATEGORY("recipe_book_categories", new GenericRegistryGenerator<>(BuiltInRegistries.RECIPE_BOOK_CATEGORY)),
41-
CONSUME_EFFECT("consume_effects", new GenericRegistryGenerator<>(BuiltInRegistries.CONSUME_EFFECT_TYPE)),
42-
COMMAND_ARGUMENTS("command_arguments", new GenericRegistryGenerator<>(BuiltInRegistries.COMMAND_ARGUMENT_TYPE)),
31+
SOUND_SOURCES("sound_sources", new SoundSourceGenerator()),
32+
VILLAGER_TYPES("villager_types", new GenericRegistryGenerator<>(BuiltInRegistries.VILLAGER_TYPE)),
4333

44-
// Tags are specified as a special case in datagen
34+
// Static registries
35+
36+
ATTRIBUTES("attribute", new AttributeGenerator()),
37+
BLOCKS("block", new BlockGenerator()),
38+
BLOCK_SOUND_TYPES("block_sound_type", new BlockSoundTypeGenerator()),
39+
ENTITIES("entity_type", new EntityGenerator()),
40+
FEATURE_FLAGS("feature_flag", new FeatureFlagGenerator()),
41+
FLUIDS("fluid", new FluidGenerator()),
42+
GAME_EVENTS("game_event", new GameEventGenerator()),
43+
MATERIALS("item", new MaterialGenerator()),
44+
MOB_EFFECTS("potion_effect", new MobEffectGenerator()),
45+
POTIONS("potion_type", new PotionGenerator()),
46+
SOUNDS("sound_event", new SoundGenerator()),
47+
VILLAGER_PROFESSIONS("villager_profession", new VillagerProfessionGenerator()),
48+
49+
// Dynamic Registries
50+
51+
BANNER_PATTERNS("banner_pattern", new GenericResourceGenerator("banner_pattern")),
52+
BIOMES("worldgen/biome", new BiomeGenerator()),
53+
CAT_VARIANTS("cat_variant", new GenericResourceGenerator("cat_variant")),
54+
CHAT_TYPES("chat_type", new GenericResourceGenerator("chat_type")),
55+
CHICKEN_VARIANTS("chicken_variant", new GenericResourceGenerator("chicken_variant")),
56+
COW_VARIANTS("cow_variant", new GenericResourceGenerator("cow_variant")),
57+
DAMAGE_TYPES("damage_type", new GenericResourceGenerator("damage_type")),
58+
DIMENSION_TYPES("dimension_type", new GenericResourceGenerator("dimension_type")),
59+
ENCHANTMENTS("enchantment", new GenericResourceGenerator("enchantment")),
60+
FROG_VARIANTS("frog_variant", new GenericResourceGenerator("frog_variant")),
61+
JUKEBOX_SONGS("jukebox_song", new GenericResourceGenerator("jukebox_song")),
62+
INSTRUMENTS("instrument", new GenericResourceGenerator("instrument")),
63+
PAINTING_VARIANTS("painting_variant", new GenericResourceGenerator("painting_variant")),
64+
PIG_VARIANTS("pig_variant", new GenericResourceGenerator("pig_variant")),
65+
TRIM_MATERIALS("trim_material", new GenericResourceGenerator("trim_material")),
66+
TRIM_PATTERNS("trim_pattern", new GenericResourceGenerator("trim_pattern")),
67+
WOLF_VARIANTS("wolf_variant", new GenericResourceGenerator("wolf_variant")),
68+
WOLF_SOUND_VARIANTS("wolf_sound_variant", new GenericResourceGenerator("wolf_sound_variant")),
4569

46-
DIMENSION_TYPES("dimension_types", new GenericResourceGenerator("dimension_type")),
47-
CHAT_TYPES("chat_types", new GenericResourceGenerator("chat_type")),
48-
DAMAGE_TYPES("damage_types", new GenericResourceGenerator("damage_type")),
49-
BANNER_PATTERNS("banner_patterns", new GenericResourceGenerator("banner_pattern")),
50-
WOLF_VARIANTS("wolf_variants", new GenericResourceGenerator("wolf_variant")),
51-
TRIM_MATERIALS("trim_materials", new GenericResourceGenerator("trim_material")),
52-
TRIM_PATTERNS("trim_patterns", new GenericResourceGenerator("trim_pattern")),
53-
ENCHANTMENTS("enchantments", new GenericResourceGenerator("enchantment")),
54-
PAINTING_VARIANTS("painting_variants", new GenericResourceGenerator("painting_variant")),
55-
JUKEBOX_SONGS("jukebox_songs", new GenericResourceGenerator("jukebox_song")),
56-
INSTRUMENTS("instruments", new GenericResourceGenerator("instrument")),
57-
CAT_VARIANTS("cat_variants", new GenericResourceGenerator("cat_variant")),
58-
CHICKEN_VARIANTS("chicken_variants", new GenericResourceGenerator("chicken_variant")),
59-
COW_VARIANTS("cow_variants", new GenericResourceGenerator("cow_variant")),
60-
FROG_VARIANTS("frog_variants", new GenericResourceGenerator("frog_variant")),
61-
PIG_VARIANTS("pig_variants", new GenericResourceGenerator("pig_variant")),
62-
WOLF_SOUND_VARIANTS("wolf_sound_variants", new GenericResourceGenerator("wolf_sound_variant")),
70+
// Loot tables (only included for legacy reasons, Minestom doesn't use them)
6371

6472
BLOCK_LOOT_TABLES("loot_tables/block_loot_tables", new BlockLootTableGenerator()),
6573
CHEST_LOOT_TABLES("loot_tables/chest_loot_tables", new ChestLootTableGenerator()),

DataGenerator/src/main/java/net/minestom/generators/FluidGenerator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public JsonObject generate() {
1313
for (var fluid : registry) {
1414
final var location = registry.getKey(fluid);
1515
JsonObject fluidJson = new JsonObject();
16+
fluidJson.addProperty("id", registry.getId(fluid));
1617
fluidJson.addProperty("bucketId", itemRegistry.getKey(fluid.getBucket()).toString());
1718
fluids.add(location.toString(), fluidJson);
1819
}

0 commit comments

Comments
 (0)