mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 17:44:46 +00:00
Revert lots of multithreading for better threaded saving and data synchronization
This commit is contained in:
1 parent
6f1914c002
commit
49fab85291
6 files changed
+19
-20
No files matched your search
@@ -9,21 +9,20 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.util.CustomNPCsScheduler;
|
||||
import noppes.npcs.util.CustomNPCsThreader;
|
||||
import noppes.npcs.util.NBTJsonUtil;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
|
||||
import static noppes.npcs.util.CustomNPCsThreader.playerDataThread;
|
||||
|
||||
public class PlayerDataController {
|
||||
public static PlayerDataController instance;
|
||||
public HashMap<String, String> nameUUIDs;
|
||||
@@ -169,7 +168,7 @@ public class PlayerDataController {
|
||||
}
|
||||
|
||||
public synchronized void savePlayerDataMap(){
|
||||
CustomNPCsScheduler.runTack(() -> {
|
||||
playerDataThread.execute(() -> {
|
||||
try {
|
||||
File saveDir = getSaveDir();
|
||||
File file = new File(saveDir, "___playermap.dat_new");
|
||||
|
||||
Reference in new issue
Block a user