package net.moonleay.gimble.mixin;

import net.minecraft.client.gui.screen.DownloadingTerrainScreen;
import net.moonleay.gimble.client.editor.ClientEditor;
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(DownloadingTerrainScreen.class)
public class GimblePolicyCheckMixin {


    @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/DownloadingTerrainScreen;close()V", ordinal = -1))
    private void func(CallbackInfo ci) {
        ClientEditor.INSTANCE.onConnectedToNewWorld();
    }
}
