diff --git a/src/generated/resources/assets/extended_industrialization/lang/en_us.json b/src/generated/resources/assets/extended_industrialization/lang/en_us.json index 2859ce3e..317411cc 100644 --- a/src/generated/resources/assets/extended_industrialization/lang/en_us.json +++ b/src/generated/resources/assets/extended_industrialization/lang/en_us.json @@ -93,6 +93,10 @@ "rei_categories.extended_industrialization.steel_bending_machine": "Steel Bending Machine", "rei_categories.extended_industrialization.steel_canning_machine": "Canning Machine", "rei_categories.extended_industrialization.steel_composter": "Steel Composter", + "tag.item.extended_industrialization.farmer_plantable": "Farmer Plantable", + "tag.item.extended_industrialization.farmer_voidable": "Farmer Voidable", + "tag.item.extended_industrialization.photovoltaic_cell": "Photovoltaic Cells", + "tag.item.extended_industrialization.rainbow_dyeable": "Rainbow Dyeable", "text.extended_industrialization.activated": "Activated", "text.extended_industrialization.brewery_brews_multiple": "Brews %s potions at a time.", "text.extended_industrialization.brewery_requires_blazing_essence": "Requires %s to brew potions.", diff --git a/src/main/java/net/swedz/extended_industrialization/EITags.java b/src/main/java/net/swedz/extended_industrialization/EITags.java index 9c7f6595..b54b8b82 100644 --- a/src/main/java/net/swedz/extended_industrialization/EITags.java +++ b/src/main/java/net/swedz/extended_industrialization/EITags.java @@ -1,19 +1,30 @@ package net.swedz.extended_industrialization; +import com.google.common.collect.Maps; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; +import java.util.Collections; +import java.util.Map; + public final class EITags { + private static final Map, String> TRANSLATIONS = Maps.newHashMap(); + + public static Map, String> translations() + { + return Collections.unmodifiableMap(TRANSLATIONS); + } + public static final class Items { - public static final TagKey FARMER_PLANTABLE = item("farmer_plantable"); - public static final TagKey FARMER_VOIDABLE = item("farmer_voidable"); - public static final TagKey PHOTOVOLTAIC_CELL = item("photovoltaic_cell"); - public static final TagKey RAINBOW_DYEABLE = item("rainbow_dyeable"); + public static final TagKey FARMER_PLANTABLE = item("farmer_plantable", "Farmer Plantable"); + public static final TagKey FARMER_VOIDABLE = item("farmer_voidable", "Farmer Voidable"); + public static final TagKey PHOTOVOLTAIC_CELL = item("photovoltaic_cell", "Photovoltaic Cells"); + public static final TagKey RAINBOW_DYEABLE = item("rainbow_dyeable", "Rainbow Dyeable"); } public static final class Blocks @@ -23,9 +34,11 @@ public static final class Blocks public static final TagKey MACHINE_CHAINER_RELAY = block("machine_chainer/relay"); } - public static TagKey item(String path) + public static TagKey item(String path, String englishName) { - return TagKey.create(BuiltInRegistries.ITEM.key(), EI.id(path)); + TagKey tag = TagKey.create(BuiltInRegistries.ITEM.key(), EI.id(path)); + TRANSLATIONS.put(tag, englishName); + return tag; } public static TagKey itemCommon(String path) diff --git a/src/main/java/net/swedz/extended_industrialization/datagen/client/provider/LanguageDatagenProvider.java b/src/main/java/net/swedz/extended_industrialization/datagen/client/provider/LanguageDatagenProvider.java index 5b5c7745..ac6251c2 100644 --- a/src/main/java/net/swedz/extended_industrialization/datagen/client/provider/LanguageDatagenProvider.java +++ b/src/main/java/net/swedz/extended_industrialization/datagen/client/provider/LanguageDatagenProvider.java @@ -7,6 +7,7 @@ import net.swedz.extended_industrialization.EIFluids; import net.swedz.extended_industrialization.EIItems; import net.swedz.extended_industrialization.EIKeybinds; +import net.swedz.extended_industrialization.EITags; import net.swedz.extended_industrialization.EIText; import net.swedz.tesseract.neoforge.datagen.mi.MIDatagenHooks; import net.swedz.tesseract.neoforge.registry.holder.FluidHolder; @@ -42,6 +43,8 @@ protected void addTranslations() this.add(keybind.descriptionId(), keybind.englishName()); } + EITags.translations().forEach(this::add); + MIDatagenHooks.Client.withLanguageHook(this, EI.ID); this.add("itemGroup.%s.%s".formatted(EI.ID, EI.ID), EI.NAME);