Reverted changes to BiomeModification API
This commit is contained in:
parent
fb79201b51
commit
26fa4bb3fd
4 changed files with 9 additions and 75 deletions
|
@ -1,24 +0,0 @@
|
|||
package ru.bclib.mixin.common;
|
||||
|
||||
import com.mojang.serialization.DynamicOps;
|
||||
import net.minecraft.core.RegistryAccess;
|
||||
import net.minecraft.resources.RegistryReadOps;
|
||||
import net.minecraft.resources.RegistryResourceAccess;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import ru.bclib.api.biomes.BiomeAPI;
|
||||
|
||||
/**
|
||||
* Fabrics BiomeModifications API is called at this point. We have to ensure that BCLibs Modification API
|
||||
* runs before Fabric, so we need to hook into the same class.
|
||||
*/
|
||||
@Mixin(RegistryReadOps.class)
|
||||
public class RegistryReadOpsMixin {
|
||||
@Inject(method = "createAndLoad(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/resources/RegistryResourceAccess;Lnet/minecraft/core/RegistryAccess;)Lnet/minecraft/resources/RegistryReadOps;", at = @At("RETURN"))
|
||||
private static <T> void foo(DynamicOps<T> dynamicOps, RegistryResourceAccess registryResourceAccess, RegistryAccess registryAccess, CallbackInfoReturnable<RegistryReadOps<T>> cir){
|
||||
BiomeAPI.initRegistry(registryAccess);
|
||||
BiomeAPI.applyModifications(registryAccess);
|
||||
}
|
||||
}
|
|
@ -38,9 +38,8 @@ public abstract class ServerLevelMixin extends Level {
|
|||
ServerLevel world = ServerLevel.class.cast(this);
|
||||
LifeCycleAPI._runLevelLoad(world, server, executor, levelStorageAccess, serverLevelData, resourceKey, dimensionType, chunkProgressListener, chunkGenerator, bl, l, list, bl2);
|
||||
|
||||
//called from RegistryReadOpsMixin for now
|
||||
// BiomeAPI.initRegistry(server);
|
||||
// BiomeAPI.applyModifications(ServerLevel.class.cast(this));
|
||||
BiomeAPI.initRegistry(server);
|
||||
BiomeAPI.applyModifications(ServerLevel.class.cast(this));
|
||||
|
||||
if (bclib_lastWorld != null && bclib_lastWorld.equals(levelStorageAccess.getLevelId())) {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue