/*
 * This file is part of Sponge, licensed under the MIT License (MIT).
 *
 * Copyright (c) SpongePowered <https://www.spongepowered.org>
 * Copyright (c) contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
package org.spongepowered.vanilla.mixin.api.mcp.server;

import com.mojang.authlib.GameProfileRepository;
import com.mojang.authlib.minecraft.MinecraftSessionService;
import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
import com.mojang.datafixers.DataFixer;
import net.minecraft.command.Commands;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.management.PlayerProfileCache;
import net.minecraft.world.chunk.listener.IChunkStatusListenerFactory;
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 org.spongepowered.vanilla.VanillaServer;
import org.spongepowered.vanilla.world.VanillaWorldManager;

import java.io.File;
import java.net.Proxy;

@Mixin(MinecraftServer.class)
public abstract class MinecraftServerMixin_Vanilla_API implements VanillaServer {

    private VanillaWorldManager vanilla_api$worldManager;

    @Inject(method = "<init>", at = @At("TAIL"))
    private void vanilla$setupSpongeFields(File p_i50590_1_, Proxy p_i50590_2_, DataFixer dataFixerIn, Commands p_i50590_4_,
        YggdrasilAuthenticationService p_i50590_5_, MinecraftSessionService p_i50590_6_, GameProfileRepository p_i50590_7_,
        PlayerProfileCache p_i50590_8_, IChunkStatusListenerFactory p_i50590_9_, String p_i50590_10_, CallbackInfo ci) {

        this.vanilla_api$worldManager = new VanillaWorldManager((MinecraftServer) (Object) this);
    }

    @Override
    public VanillaWorldManager getWorldManager() {
        return this.vanilla_api$worldManager;
    }
}

@@ -1555,16 +1555,116 @@
 mmands;%0A
+import net.minecraft.resources.DataPackRegistries;%0Aimport net.minecraft.resources.ResourcePackList;%0A
 import n
@@ -1696,24 +1696,24 @@
 raftServer;%0A
-
 import net.m
@@ -1759,16 +1759,70 @@
 eCache;%0A
+import net.minecraft.util.registry.DynamicRegistries;%0A
 import n
@@ -1880,24 +1880,128 @@
 nerFactory;%0A
+import net.minecraft.world.storage.IServerConfiguration;%0Aimport net.minecraft.world.storage.SaveFormat;%0A
 import org.s
@@ -2622,139 +2622,327 @@
 lds(
-File p_i50590_1_, Proxy p_i50590_2_, DataFixer dataFixerIn, Commands p_i50590_4_,%0A        YggdrasilAuthenticationService p_i50590_5
+Thread p_i232576_1_, DynamicRegistries.Impl p_i232576_2_, SaveFormat.LevelSave p_i232576_3_,%0A                                           IServerConfiguration p_i232576_4_, ResourcePackList p_i232576_5_, Proxy p_i232576_6_, DataFixer p_i232576_7_,%0A                                           DataPackRegistries p_i232576_8
 _, M
@@ -2971,15 +2971,16 @@
  p_i
-50590_6
+232576_9
 _, G
@@ -3007,18 +3007,55 @@
  p_i
-50590_7
+232576_10
 _,%0A
+                                   
     
@@ -3084,15 +3084,17 @@
  p_i
-50590_8
+232576_11
 _, I
@@ -3127,36 +3127,17 @@
  p_i
-50590_9_, String p_i50590_10
+232576_12
 _, C

Fix MinecraftServer vanilla mixin injection