Skip to content

Commit

Permalink
feat: Methods for datagenning language entries for dimension and stru…
Browse files Browse the repository at this point in the history
…cture names
  • Loading branch information
bconlon1 committed Jan 18, 2024
1 parent 684bd4a commit 9d10f57
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.structure.Structure;
import net.minecraftforge.common.data.LanguageProvider;
import net.minecraftforge.registries.ForgeRegistries;

Expand All @@ -28,10 +30,18 @@ public void addTrim(String key, String name) {
this.add("trim_material." + this.id + "." + key, name + " Material");
}

public void addDimension(ResourceKey<Level> dimension, String name) {
this.add("dimension." + this.id + "." + dimension.location().getPath(), name);
}

public void addBiome(ResourceKey<Biome> biome, String name) {
this.add("biome." + this.id + "." + biome.location().getPath(), name);
}

public void addStructure(ResourceKey<Structure> structure, String name) {
this.add("structure." + this.id + "." + structure.location().getPath(), name);
}

public void addContainerType(Supplier<? extends MenuType<?>> key, String name) {
ResourceLocation location = ForgeRegistries.MENU_TYPES.getKey(key.get());
if (location != null) {
Expand Down

0 comments on commit 9d10f57

Please sign in to comment.