/// <summary> /// Create a new Minecraft Instance /// </summary> /// <param name="login">The username to use when connecting to Minecraft</param> /// <param name="password">The password to use when connecting to Minecraft (Ignore if you are providing credentials)</param> /// <param name="mode"></param> /// <param name="nameVerification">To connect using Name Verification or not</param> /// <param name="serverSalt"></param> public IMinecraftClient Create(string login, string password, NetworkMode mode, bool nameVerification = false, string serverSalt = null) { ClientLogin = login; ClientPassword = password; UseLogin = nameVerification; Mode = mode; ServerSalt = serverSalt; AsyncReceiveHandlers = new Dictionary <Type, Action <IAsyncReceive> >(); RegisterSupportedReceiveEvents(); World = new World(); Player = new Player(); Entities = new Dictionary <int, Entity>(); PlayersList = new Dictionary <string, short>(); _networkHandler = new NetworkHandler(); _networkHandler.Create(this); return(this); }
/// <summary> /// Create a new Minecraft Instance /// </summary> /// <param name="login">The username to use when connecting to Minecraft</param> /// <param name="password">The password to use when connecting to Minecraft (Ignore if you are providing credentials)</param> /// <param name="mode"></param> /// <param name="nameVerification">To connect using Name Verification or not</param> /// <param name="serverSalt"></param> public IMinecraftClient Create(string login, string password, NetworkMode mode, bool nameVerification = false, string serverSalt = null) { ClientLogin = login; ClientPassword = password; UseLogin = nameVerification; Mode = mode; ServerSalt = serverSalt; AsyncReceiveHandlers = new Dictionary<Type, Action<IAsyncReceive>>(); RegisterSupportedReceiveEvents(); World = new World(); Player = new Player(); Entities = new Dictionary<int, Entity>(); PlayersList = new Dictionary<string, short>(); _networkHandler = new NetworkHandler(); _networkHandler.Create(this); return this; }