@@ -47,10 +47,16 @@ bool initNodeJs() {
4747 auto path = ll::string_utils::wstr2str (buf) + " \\ bedrock_server_mod.exe" ;
4848 char * cPath = (char *)path.c_str ();
4949 uv_setup_args (1 , &cPath);
50- args = {path};
51- std::vector<std::string> errors;
52- auto exitCode = node::InitializeNodeWithArgs (&args, &exec_args, &errors);
53- if (exitCode != 0 ) {
50+ args = {path};
51+ auto result = node::InitializeOncePerProcess (
52+ args,
53+ node::ProcessInitializationFlags::Flags (
54+ node::ProcessInitializationFlags::kNoInitializeV8
55+ | node::ProcessInitializationFlags::kNoInitializeNodeV8Platform
56+ )
57+ );
58+ exec_args = result->exec_args ();
59+ if (result->exit_code () != 0 ) {
5460 lse::getSelfModInstance ().getLogger ().error (" Failed to initialize node! NodeJs plugins won't be loaded" );
5561 return false ;
5662 }
@@ -67,7 +73,7 @@ bool initNodeJs() {
6773
6874void shutdownNodeJs () {
6975 v8::V8::Dispose ();
70- v8::V8::ShutdownPlatform ();
76+ v8::V8::DisposePlatform ();
7177}
7278
7379script::ScriptEngine* newEngine () {
@@ -132,8 +138,7 @@ bool loadPluginCode(script::ScriptEngine* engine, std::string entryScriptPath, s
132138 auto it = setups->find (engine);
133139 if (it == setups->end ()) return false ;
134140
135- auto isolate = it->second ->isolate ();
136- auto env = it->second ->env ();
141+ auto env = it->second ->env ();
137142
138143 try {
139144 using namespace v8 ;
0 commit comments