Skip to content

Commit

Permalink
Add helper for registering lang entries.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Jul 3, 2024
1 parent 0bf9da4 commit 32f2860
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/codechicken/lib/datagen/LanguageProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Block;
import net.minecraftforge.data.event.GatherDataEvent;

Expand Down Expand Up @@ -72,6 +73,7 @@ private void save(CachedOutput cache, Object object, Path target) {
//@formatter:off
public void add(Block key, String name) { add(key.getDescriptionId(), name); }
public void add(Item key, String name) { add(key.getDescriptionId(), name); }
public void add(Supplier<? extends ItemLike> key, String name) { add(key.get().asItem(), name); }
public void add(ItemStack key, String name) { add(key.getDescriptionId(), name); }
public void add(Enchantment key, String name) { add(key.getDescriptionId(), name); }
public void add(MobEffect key, String name) { add(key.getDescriptionId(), name); }
Expand Down

0 comments on commit 32f2860

Please sign in to comment.