Remove more threading

This commit is contained in:
Kam committed 2023-05-16 17:45:23 -04:00
1 parent 49fab85291
commit f77a2ff101
3 files changed
+10 -15

No files matched your search

+9 -11
View File
@@ -51,17 +51,15 @@ public class Server {
}
public static void sendAssociatedData(final Entity entity, final EnumPacketClient enu, final Object... obs) {
CustomNPCsThreader.runTack(() -> {
ByteBuf buffer = Unpooled.buffer();
try {
if(!fillBuffer(buffer, enu, obs))
return;
TargetPoint point = new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 60);
CustomNpcs.Channel.sendToAllAround(new FMLProxyPacket(buffer,"CustomNPCs"), point);
} catch (IOException e) {
e.printStackTrace();
}
});
ByteBuf buffer = Unpooled.buffer();
try {
if(!fillBuffer(buffer, enu, obs))
return;
TargetPoint point = new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 60);
CustomNpcs.Channel.sendToAllAround(new FMLProxyPacket(buffer,"CustomNPCs"), point);
} catch (IOException e) {
e.printStackTrace();
}
}
public static void sendToAll(EnumPacketClient enu, Object... obs) {
ByteBuf buffer = Unpooled.buffer();
@@ -17,7 +17,6 @@ import noppes.npcs.api.gui.IItemSlot;
import noppes.npcs.client.gui.custom.components.CustomGuiSlot;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.gui.ScriptGui;
import noppes.npcs.util.CustomNPCsThreader;
import java.util.Iterator;
@@ -25,8 +25,6 @@ import noppes.npcs.util.NBTJsonUtil;
import java.io.File;
import java.io.FileInputStream;
import static noppes.npcs.util.CustomNPCsThreader.playerDataThread;
public class PlayerData implements IExtendedEntityProperties, IPlayerData {
public PlayerDialogData dialogData = new PlayerDialogData(this);
public PlayerBankData bankData = new PlayerBankData(this);
@@ -304,7 +302,7 @@ public class PlayerData implements IExtendedEntityProperties, IPlayerData {
public synchronized void save() {
final NBTTagCompound compound = getNBT();
final String filename = uuid + ".json";
playerDataThread.execute(() -> {
CustomNPCsThreader.playerDataThread.execute(() -> {
try {
File saveDir = PlayerDataController.instance.getSaveDir();
File file = new File(saveDir, filename + "_new");