File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/main/java/com/cleanroommc/groovyscript/sandbox Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11
11
import groovy .util .ResourceException ;
12
12
import it .unimi .dsi .fastutil .objects .Object2ObjectOpenHashMap ;
13
13
import it .unimi .dsi .fastutil .objects .ObjectOpenHashSet ;
14
+ import net .minecraft .launchwrapper .Launch ;
14
15
import org .codehaus .groovy .control .CompilerConfiguration ;
15
16
import org .codehaus .groovy .runtime .InvokerHelper ;
16
17
import org .jetbrains .annotations .ApiStatus ;
@@ -82,7 +83,7 @@ protected void stopRunning() {
82
83
}
83
84
84
85
protected GroovyScriptEngine createScriptEngine () {
85
- GroovyScriptEngine engine = new GroovyScriptEngine (this .scriptEnvironment );
86
+ GroovyScriptEngine engine = new GroovyScriptEngine (this .scriptEnvironment , Launch . classLoader );
86
87
CompilerConfiguration config = new CompilerConfiguration (CompilerConfiguration .DEFAULT );
87
88
config .setSourceEncoding ("UTF-8" );
88
89
engine .setConfig (config );
@@ -103,11 +104,11 @@ public void load() throws Exception {
103
104
Binding binding = createBindings ();
104
105
Set <File > executedClasses = new ObjectOpenHashSet <>();
105
106
106
- running .set (true );
107
+ this . running .set (true );
107
108
try {
108
109
load (engine , binding , executedClasses , true );
109
110
} finally {
110
- running .set (false );
111
+ this . running .set (false );
111
112
postRun ();
112
113
setCurrentScript (null );
113
114
}
You can’t perform that action at this time.
0 commit comments