private void RunForFirstTime() { MinecraftServer server = new MinecraftServer(EngineFile); server.ServerOutput += (s, e) => { JavaOutput?.Invoke(s, e); }; server.ServerStateChanged += Server_FirstRunStates; server.Start(); }
private void Eula_AgreementStateChanged(object sender, bool e) { if (e) { MinecraftServer server = new MinecraftServer(EngineFile); server.ServerOutput += (s, e2) => { JavaOutput?.Invoke(s, e2); }; server.ServerStateChanged += Server_ServerStateChanged; server.PreparingSpawnArea += (sender2, e2) => { CreationStateChanged?.Invoke(this, new ServerCreationStateArgs(ServerCreationState.PreparingSpawn)); }; server.Start(); } else { CreationStateChanged?.Invoke(this, new ServerCreationCanceledState(ServerCreationCanceledReason.EulaAgreementRequired)); } }