Package net.minecraftforge.common.data
Class GlobalLootModifierProvider
java.lang.Object
net.minecraftforge.common.data.GlobalLootModifierProvider
- All Implemented Interfaces:
DataProvider
Provider for forge's GlobalLootModifier system. See
and calling
LootModifier
This provider only requires implementing
invalid reference
#start()
add(java.lang.String, T)
from it.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.data.DataProvider
DataProvider.Factory<T extends DataProvider>
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final com.google.gson.Gson
private final String
private final PackOutput
private final CompletableFuture
<HolderLookup.Provider> private boolean
private final Map
<String, IGlobalLootModifier> Fields inherited from interface net.minecraft.data.DataProvider
FIXED_ORDER_FIELDS, KEY_COMPARATOR, LOGGER
-
Constructor Summary
ConstructorDescriptionGlobalLootModifierProvider
(PackOutput output, String modid, CompletableFuture<HolderLookup.Provider> registries) -
Method Summary
Modifier and TypeMethodDescription<T extends IGlobalLootModifier>
voidPasses in the data needed to create the file without any extra objects.getName()
protected void
Sets the "replace" key in global_loot_modifiers to true.run
(CachedOutput cache) private CompletableFuture
<?> run
(CachedOutput cache, HolderLookup.Provider registries) protected abstract void
start
(HolderLookup.Provider registries) Calladd(java.lang.String, T)
here, which will pass in the necessary information to write the jsons.
-
Field Details
-
GSON
private static final com.google.gson.Gson GSON -
output
-
modid
-
registries
-
toSerialize
-
replace
private boolean replace
-
-
Constructor Details
-
GlobalLootModifierProvider
public GlobalLootModifierProvider(PackOutput output, String modid, CompletableFuture<HolderLookup.Provider> registries)
-
-
Method Details
-
replacing
protected void replacing()Sets the "replace" key in global_loot_modifiers to true. -
start
Calladd(java.lang.String, T)
here, which will pass in the necessary information to write the jsons. -
run
- Specified by:
run
in interfaceDataProvider
-
run
-
add
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
- Specified by:
getName
in interfaceDataProvider
-