public static IntegratedServer getInstance() { if (instance == null) { instance = new IntegratedServer(); } return(instance); }
public void LoadWorld() { _screenManager.ShowGameMenu(); _renderWorld = true; _worldRenderer = new WorldRenderer(this); _world = new ClientWorld(_worldRenderer); _worldRenderer.SetWorldAndLoadRenderers(_world); _server = MinecraftServer.CreateServer(thread => new IntegratedServer(thread)); }
// Use this for initialization void Start() { IntegratedServer.getInstance().run(); }
protected override void OnLoad() { Directory.CreateDirectory("fantasia"); Logger.Init(); Bind.KeyboardState = KeyboardState; VSync = VSyncMode.Off; _renderer = new MainRenderer(Size.X, Size.Y); RenderFrequency = _framesPerSec; UpdateFrequency = _ticksPerSec; try { //Steamworks.SteamClient.Init(1363820); } catch (Exception e) { Logger.LogError(e); _quit = true; } Block.RegisterBlocks(); AddonSystem.Init(); AddonSystem.LoadAddonBlocks(); _renderer.State = RendererState.InGame; Panel pan = new Panel(.5, .5); pan.Width = .1; pan.Height = .1; _renderer.GUIRenderer.GUIElements.Add(pan); //List<string> files = Directory.GetFiles("fantasia/textures/", "*.png", SearchOption.AllDirectories).ToList(); //files.AddRange(Directory.GetFiles("fantasia/addons/Minecraft/textures/", "*.png", SearchOption.AllDirectories).ToList()); //AtlasCreator.GenAtlas(files.ToList()); AtlasCreator.GetTexturesAndGenAtlas(); _renderer.WorldRenderer.BlockAtlas = Texture.LoadAtlas(); GL.Enable(EnableCap.CullFace); GL.CullFace(CullFaceMode.Back); GL.Enable(EnableCap.DepthTest); GL.ClearColor(.702f, .827f, .871f, 1.0f); LocalPlayer = new LocalPlayer(); //Test Server _server = new IntegratedServer(1, LocalPlayer); //Set Active World _renderer.WorldRenderer.ActiveWorld = _server.World; Bind.TryBindKey(Keys.W, "forward"); Bind.TryBindKey(Keys.S, "backward"); Bind.TryBindKey(Keys.A, "left"); Bind.TryBindKey(Keys.D, "right"); Bind.TryBindKey(Keys.Space, "jump"); CursorGrabbed = true; base.OnLoad(); }