Class GlobalLootModifierProvider

java.lang.Object
io.github.vampirestudios.vampirelib.loot.GlobalLootModifierProvider
All Implemented Interfaces:
net.minecraft.data.DataProvider

public abstract class GlobalLootModifierProvider extends Object implements net.minecraft.data.DataProvider
Provider for forge's GlobalLootModifier system. See LootModifier. This provider only requires implementing start() and calling add(java.lang.String, T) from it.
  • Constructor Details

    • GlobalLootModifierProvider

      public GlobalLootModifierProvider(net.minecraft.data.DataGenerator gen, String modid)
  • Method Details

    • replacing

      protected void replacing()
      Sets the "replace" key in global_loot_modifiers to true.
    • start

      protected abstract void start()
      Call add(java.lang.String, T) here, which will pass in the necessary information to write the jsons.
    • run

      public void run(net.minecraft.data.CachedOutput cache) throws IOException
      Specified by:
      run in interface net.minecraft.data.DataProvider
      Throws:
      IOException
    • add

      public <T extends IGlobalLootModifier> void add(String modifier, T instance)
      Passes in the data needed to create the file without any extra objects.
      Parameters:
      modifier - The name of the modifier, which will be the file name.
      instance - The instance to serialize
    • getName

      public String getName()
      Specified by:
      getName in interface net.minecraft.data.DataProvider