Call DataFixer in Server Context
This commit is contained in:
parent
a247b17e7f
commit
d3db623de5
2 changed files with 19 additions and 1 deletions
17
src/main/java/ru/bclib/mixin/common/MainMixin.java
Normal file
17
src/main/java/ru/bclib/mixin/common/MainMixin.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package ru.bclib.mixin.common;
|
||||||
|
|
||||||
|
import net.minecraft.server.Main;
|
||||||
|
import net.minecraft.world.level.storage.LevelStorageSource;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||||
|
import ru.bclib.api.datafixer.DataFixerAPI;
|
||||||
|
|
||||||
|
@Mixin(Main.class)
|
||||||
|
abstract public class MainMixin {
|
||||||
|
@ModifyArg(method="main", at=@At(value="INVOKE", target="Lnet/minecraft/server/MinecraftServer;convertFromRegionFormatIfNeeded(Lnet/minecraft/world/level/storage/LevelStorageSource$LevelStorageAccess;)V"))
|
||||||
|
private static LevelStorageSource.LevelStorageAccess bclib_callServerFix(LevelStorageSource.LevelStorageAccess session){
|
||||||
|
DataFixerAPI.fixData(session, false, (didFix)->{});
|
||||||
|
return session;
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,8 @@
|
||||||
"AnvilBlockMixin",
|
"AnvilBlockMixin",
|
||||||
"AnvilMenuMixin",
|
"AnvilMenuMixin",
|
||||||
"TagLoaderMixin",
|
"TagLoaderMixin",
|
||||||
"BiomeMixin"
|
"BiomeMixin",
|
||||||
|
"MainMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue