Doc update
This commit is contained in:
parent
eb8c87468f
commit
eda626fe10
2 changed files with 13 additions and 0 deletions
|
@ -6,6 +6,7 @@ import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.fabricmc.loader.api.ModContainer;
|
import net.fabricmc.loader.api.ModContainer;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.nbt.NbtIo;
|
import net.minecraft.nbt.NbtIo;
|
||||||
|
import net.minecraft.world.level.storage.LevelStorageSource.LevelStorageAccess;
|
||||||
import ru.bclib.BCLib;
|
import ru.bclib.BCLib;
|
||||||
import ru.bclib.api.datafixer.DataFixerAPI;
|
import ru.bclib.api.datafixer.DataFixerAPI;
|
||||||
|
|
||||||
|
@ -14,7 +15,15 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mod-specifix data-storage for a world.
|
||||||
|
*
|
||||||
|
* This class provides the ability for mod to store persistent data inside a world. The Storage for the world is
|
||||||
|
* currently initialized as part of the {@link DataFixerAPI} in {@link DataFixerAPI#fixData(LevelStorageAccess, boolean, Consumer)}
|
||||||
|
* or {@link DataFixerAPI#initializeWorldData(File, boolean)}
|
||||||
|
*/
|
||||||
public class WorldDataAPI {
|
public class WorldDataAPI {
|
||||||
private static final Map<String, CompoundTag> TAGS = Maps.newHashMap();
|
private static final Map<String, CompoundTag> TAGS = Maps.newHashMap();
|
||||||
private static final List<String> MODS = Lists.newArrayList();
|
private static final List<String> MODS = Lists.newArrayList();
|
||||||
|
|
|
@ -119,6 +119,10 @@ public class DataFixerAPI {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Initializes the DataStorage for this world. If the world is new, the patch registry is initialized to the
|
* Initializes the DataStorage for this world. If the world is new, the patch registry is initialized to the
|
||||||
|
* current versions of the plugins.
|
||||||
|
* <p>
|
||||||
|
* This implementation will create a new {@link LevelStorageAccess} and call {@link #initializeWorldData(File, boolean)}
|
||||||
|
* using the provided root path.
|
||||||
* @param levelSource The SourceStorage for this Minecraft instance, You can get this using
|
* @param levelSource The SourceStorage for this Minecraft instance, You can get this using
|
||||||
* {@code Minecraft.getInstance().getLevelSource()}
|
* {@code Minecraft.getInstance().getLevelSource()}
|
||||||
* @param levelID The ID of the Level you want to patch
|
* @param levelID The ID of the Level you want to patch
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue