Package net.minecraft.data
Class AdvancementProvider
- java.lang.Object
-
- net.minecraft.data.AdvancementProvider
-
- All Implemented Interfaces:
IDataProvider
- Direct Known Subclasses:
DataGeneratorTest.Advancements
public class AdvancementProvider extends java.lang.Object implements IDataProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected ExistingFileHelper
fileHelper
private DataGenerator
generator
private static com.google.gson.Gson
GSON
private static org.apache.logging.log4j.Logger
LOGGER
private java.util.List<java.util.function.Consumer<java.util.function.Consumer<Advancement>>>
tabs
-
Fields inherited from interface net.minecraft.data.IDataProvider
SHA1
-
-
Constructor Summary
Constructors Constructor Description AdvancementProvider(DataGenerator p_i48869_1_)
Deprecated.AdvancementProvider(DataGenerator generatorIn, ExistingFileHelper fileHelperIn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.nio.file.Path
createPath(java.nio.file.Path p_218428_0_, Advancement p_218428_1_)
java.lang.String
getName()
protected void
registerAdvancements(java.util.function.Consumer<Advancement> consumer, ExistingFileHelper fileHelper)
Override this method for registering and generating customAdvancement
s.void
run(DirectoryCache p_200398_1_)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
GSON
private static final com.google.gson.Gson GSON
-
generator
private final DataGenerator generator
-
tabs
private final java.util.List<java.util.function.Consumer<java.util.function.Consumer<Advancement>>> tabs
-
fileHelper
protected ExistingFileHelper fileHelper
-
-
Constructor Detail
-
AdvancementProvider
@Deprecated public AdvancementProvider(DataGenerator p_i48869_1_)
Deprecated.
-
AdvancementProvider
public AdvancementProvider(DataGenerator generatorIn, ExistingFileHelper fileHelperIn)
-
-
Method Detail
-
run
public void run(DirectoryCache p_200398_1_) throws java.io.IOException
- Specified by:
run
in interfaceIDataProvider
- Throws:
java.io.IOException
-
registerAdvancements
protected void registerAdvancements(java.util.function.Consumer<Advancement> consumer, ExistingFileHelper fileHelper)
Override this method for registering and generating customAdvancement
s.Just use
Advancement.Builder
to build your Advancements, you don't need an extra consumer like the vanilla classes.- Parameters:
consumer
- used for the register function fromAdvancement.Builder
fileHelper
- used for the register function fromAdvancement.Builder
-
createPath
private static java.nio.file.Path createPath(java.nio.file.Path p_218428_0_, Advancement p_218428_1_)
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceIDataProvider
-
-