Package net.minecraftforge.common.data
Class LanguageProvider
- java.lang.Object
-
- net.minecraftforge.common.data.LanguageProvider
-
- All Implemented Interfaces:
IDataProvider
- Direct Known Subclasses:
DataGeneratorTest.Lang
public abstract class LanguageProvider extends java.lang.Object implements IDataProvider
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
data
private DataGenerator
gen
private static com.google.gson.Gson
GSON
private java.lang.String
locale
private java.lang.String
modid
-
Fields inherited from interface net.minecraft.data.IDataProvider
SHA1
-
-
Constructor Summary
Constructors Constructor Description LanguageProvider(DataGenerator gen, java.lang.String modid, java.lang.String locale)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
add(java.lang.String key, java.lang.String value)
void
add(Block key, java.lang.String name)
void
add(Enchantment key, java.lang.String name)
void
add(EntityType<?> key, java.lang.String name)
void
add(Item key, java.lang.String name)
void
add(ItemStack key, java.lang.String name)
void
add(Effect key, java.lang.String name)
void
addBlock(java.util.function.Supplier<? extends Block> key, java.lang.String name)
void
addEffect(java.util.function.Supplier<? extends Effect> key, java.lang.String name)
void
addEnchantment(java.util.function.Supplier<? extends Enchantment> key, java.lang.String name)
void
addEntityType(java.util.function.Supplier<? extends EntityType<?>> key, java.lang.String name)
void
addItem(java.util.function.Supplier<? extends Item> key, java.lang.String name)
void
addItemStack(java.util.function.Supplier<ItemStack> key, java.lang.String name)
protected abstract void
addTranslations()
java.lang.String
getName()
void
run(DirectoryCache cache)
private void
save(DirectoryCache cache, java.lang.Object object, java.nio.file.Path target)
-
-
-
Field Detail
-
GSON
private static final com.google.gson.Gson GSON
-
data
private final java.util.Map<java.lang.String,java.lang.String> data
-
gen
private final DataGenerator gen
-
modid
private final java.lang.String modid
-
locale
private final java.lang.String locale
-
-
Constructor Detail
-
LanguageProvider
public LanguageProvider(DataGenerator gen, java.lang.String modid, java.lang.String locale)
-
-
Method Detail
-
addTranslations
protected abstract void addTranslations()
-
run
public void run(DirectoryCache cache) throws java.io.IOException
- Specified by:
run
in interfaceIDataProvider
- Throws:
java.io.IOException
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceIDataProvider
-
save
private void save(DirectoryCache cache, java.lang.Object object, java.nio.file.Path target) throws java.io.IOException
- Throws:
java.io.IOException
-
addBlock
public void addBlock(java.util.function.Supplier<? extends Block> key, java.lang.String name)
-
add
public void add(Block key, java.lang.String name)
-
addItem
public void addItem(java.util.function.Supplier<? extends Item> key, java.lang.String name)
-
add
public void add(Item key, java.lang.String name)
-
addItemStack
public void addItemStack(java.util.function.Supplier<ItemStack> key, java.lang.String name)
-
add
public void add(ItemStack key, java.lang.String name)
-
addEnchantment
public void addEnchantment(java.util.function.Supplier<? extends Enchantment> key, java.lang.String name)
-
add
public void add(Enchantment key, java.lang.String name)
-
addEffect
public void addEffect(java.util.function.Supplier<? extends Effect> key, java.lang.String name)
-
add
public void add(Effect key, java.lang.String name)
-
addEntityType
public void addEntityType(java.util.function.Supplier<? extends EntityType<?>> key, java.lang.String name)
-
add
public void add(EntityType<?> key, java.lang.String name)
-
add
public void add(java.lang.String key, java.lang.String value)
-
-