mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
fix server init
This commit is contained in:
parent
1186fc6624
commit
5376f7e22e
@ -1,33 +0,0 @@
|
|||||||
package com.dfsek.terra.fabric.mixin.init;
|
|
||||||
|
|
||||||
import com.dfsek.terra.fabric.TerraFabricPlugin;
|
|
||||||
import com.mojang.authlib.GameProfileRepository;
|
|
||||||
import com.mojang.authlib.minecraft.MinecraftSessionService;
|
|
||||||
import com.mojang.datafixers.DataFixer;
|
|
||||||
import net.minecraft.resource.ResourcePackManager;
|
|
||||||
import net.minecraft.resource.ServerResourceManager;
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
|
||||||
import net.minecraft.server.WorldGenerationProgressListenerFactory;
|
|
||||||
import net.minecraft.util.UserCache;
|
|
||||||
import net.minecraft.util.registry.DynamicRegistryManager;
|
|
||||||
import net.minecraft.world.SaveProperties;
|
|
||||||
import net.minecraft.world.level.storage.LevelStorage;
|
|
||||||
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.CallbackInfo;
|
|
||||||
|
|
||||||
import java.net.Proxy;
|
|
||||||
|
|
||||||
@Mixin(MinecraftServer.class)
|
|
||||||
public class MinecraftServerMixin {
|
|
||||||
@Inject(method = "<init>", at = @At("RETURN"))
|
|
||||||
public void injectConstructor(Thread thread, DynamicRegistryManager.Impl impl, LevelStorage.Session session,
|
|
||||||
SaveProperties saveProperties, ResourcePackManager resourcePackManager, Proxy proxy,
|
|
||||||
DataFixer dataFixer, ServerResourceManager serverResourceManager,
|
|
||||||
MinecraftSessionService minecraftSessionService, GameProfileRepository gameProfileRepository,
|
|
||||||
UserCache userCache, WorldGenerationProgressListenerFactory worldGenerationProgressListenerFactory,
|
|
||||||
CallbackInfo callbackInfo) {
|
|
||||||
TerraFabricPlugin.getInstance().packInit(); // Load during MinecraftServer construction, after other mods have registered blocks and stuff
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.dfsek.terra.fabric.mixin.init;
|
||||||
|
|
||||||
|
import com.dfsek.terra.fabric.TerraFabricPlugin;
|
||||||
|
import net.minecraft.server.Main;
|
||||||
|
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.CallbackInfo;
|
||||||
|
|
||||||
|
@Mixin(Main.class)
|
||||||
|
public class ServerMainMixin {
|
||||||
|
@Inject(method = "main([Ljava/lang/String;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/registry/DynamicRegistryManager;create()Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;"))
|
||||||
|
private static void injectConstructor(String[] args, CallbackInfo ci) {
|
||||||
|
TerraFabricPlugin.getInstance().packInit(); // Load during MinecraftServer construction, after other mods have registered blocks and stuff
|
||||||
|
}
|
||||||
|
}
|
@ -37,7 +37,7 @@
|
|||||||
"init.MinecraftClientMixin"
|
"init.MinecraftClientMixin"
|
||||||
],
|
],
|
||||||
"server": [
|
"server": [
|
||||||
"init.MinecraftServerMixin"
|
"init.ServerMainMixin"
|
||||||
],
|
],
|
||||||
"injectors": {
|
"injectors": {
|
||||||
"defaultRequire": 1
|
"defaultRequire": 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user