Class LanguageProvider

    • 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  
    • 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • GSON

        private static final com.google.gson.Gson GSON
      • data

        private final java.util.Map<java.lang.String,​java.lang.String> data
      • 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 interface IDataProvider
        Throws:
        java.io.IOException
      • 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)