public bool Load() { try { if (Enabled) { return(true); } PointBlankLogging.Log("Starting " + Name + "..."); Type _class = PluginAssembly.GetTypes().First(a => a.IsClass && typeof(PointBlankPlugin).IsAssignableFrom(a)); // Get the first plugin class PluginClass = Enviroment.runtimeObjects["Plugins"].AddCodeObject(_class) as PointBlankPlugin; // Instentate the plugin class Name = PluginClass.GetType().Name; // Change the name Version = PluginClass.Version; if (CheckUpdates()) { if (PluginConfiguration.NotifyUpdates) { Notify(); } if (PluginConfiguration.AutoUpdate) { Update(); } } LoadConfiguration(); // Load the configuration LoadTranslation(); // Load the translation PointBlankPluginEvents.RunPluginStart(PluginClass); // Run the start event PluginClass.Load(); // Run the load function PointBlankPluginEvents.RunPluginLoaded(PluginClass); // Run the loaded event Enabled = true; // Set the enabled to true t.Start(); // Start the thread return(true); } catch (Exception ex) { PointBlankLogging.LogError("Error starting plugin: " + Name, ex); Unload(); return(false); } }