Using WorldDataAPI
to keep track of pacth-level
This commit is contained in:
parent
f595cdbbed
commit
4ad3ff8277
3 changed files with 42 additions and 34 deletions
|
@ -1,13 +1,12 @@
|
|||
package ru.bclib.api.datafixer;
|
||||
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import ru.bclib.config.PathConfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public abstract class Patch {
|
||||
private static List<Patch> ALL = new ArrayList<>(10);
|
||||
|
@ -24,8 +23,6 @@ public abstract class Patch {
|
|||
|
||||
/**
|
||||
* The Mod-ID that registered this Patch
|
||||
*
|
||||
* @return The ID
|
||||
*/
|
||||
|
||||
@NotNull
|
||||
|
@ -35,15 +32,6 @@ public abstract class Patch {
|
|||
return ALL;
|
||||
}
|
||||
|
||||
/**
|
||||
* register a new Patch
|
||||
*
|
||||
* @param patch A #Supplier that will instantiate the new Patch Object
|
||||
*/
|
||||
public static void registerPatch(Supplier<Patch> patch) {
|
||||
ALL.add(patch.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the highest Patch-Version that is available for the given mod. If no patches were
|
||||
* registerd for the mod, this will return 0.0.0
|
||||
|
@ -137,10 +125,10 @@ public abstract class Patch {
|
|||
* <p>
|
||||
* A {@link #Patch} with a given {@link #level} is only included if the patch-level of the
|
||||
* world is less
|
||||
*
|
||||
* @param config The current patch-level configuration
|
||||
* @return a new {@link MigrationProfile} Object.
|
||||
*/
|
||||
static MigrationProfile createMigrationData(PathConfig config) {
|
||||
static MigrationProfile createMigrationData(CompoundTag config) {
|
||||
return new MigrationProfile(config);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue