File tree Expand file tree Collapse file tree
src/main/java/me/voidxwalker/worldpreview Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 */
1616public final class StateOutputHelper {
1717 private static final Path OUT_PATH = Paths .get ("wpstateout.txt" );
18- private static final ExecutorService EXECUTOR = Executors .newSingleThreadExecutor ();
1918 // Storage variable, not necessarily involved or required for using outputState()
2019 public static int loadingProgress = 0 ;
2120 public static boolean titleHasEverLoaded = false ;
@@ -40,11 +39,10 @@ public static void outputState(String string) {
4039 }
4140 lastOutput = string ;
4241
43- // Queue up the file writes as to not interrupt mc itself
44- EXECUTOR .execute (() -> outputStateInternal (string ));
42+ outputStateInternal (string );
4543 }
4644
47- private static void outputStateInternal (String string ) {
45+ private synchronized static void outputStateInternal (String string ) {
4846 try {
4947 if (stateFile == null ){ // opening file only once is better for performance
5048 stateFile = new RandomAccessFile (OUT_PATH .toString (), "rw" );
You can’t perform that action at this time.
0 commit comments