| 22 | namespace endstone::core { |
| 23 | |
| 24 | PythonPluginLoader::PythonPluginLoader(Server &server) : PluginLoader(server) |
| 25 | { |
| 26 | try { |
| 27 | py::gil_scoped_acquire gil{}; |
| 28 | auto module = py::module_::import("endstone.plugin.plugin_loader"); |
| 29 | auto cls = module.attr("PythonPluginLoader"); |
| 30 | obj_ = cls(std::ref(server)); |
| 31 | } |
| 32 | catch (std::exception &e) { |
| 33 | server.getLogger().error("Error occurred when trying to register a plugin loader: {}", e.what()); |
| 34 | throw; |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | PythonPluginLoader::~PythonPluginLoader() |
| 39 | { |