mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 09:55:11 +00:00
Reset sync caches between worlds
This commit is contained in:
1 parent
323a0c454a
commit
b47a2bc1d2
2 files changed
+18
No files matched your search
@@ -86,6 +86,15 @@ public class SyncController {
|
||||
registerCache(EnumSyncType.MAGIC_CYCLE, SyncController::magicCyclesNBT);
|
||||
}
|
||||
|
||||
public static void resetServerState() {
|
||||
for (SyncCacheEntry entry : CACHE_ENTRIES.values()) {
|
||||
if (entry != null) {
|
||||
entry.reset();
|
||||
}
|
||||
}
|
||||
PLAYER_SYNC_STATE.clear();
|
||||
}
|
||||
|
||||
public static void syncPlayer(EntityPlayerMP player) {
|
||||
syncPlayer(player, true);
|
||||
}
|
||||
@@ -939,6 +948,12 @@ public class SyncController {
|
||||
return revision;
|
||||
}
|
||||
|
||||
private synchronized void reset() {
|
||||
dirty = true;
|
||||
payload = null;
|
||||
revision = 0;
|
||||
}
|
||||
|
||||
private static byte[][] splitIntoChunks(byte[] payload) {
|
||||
int totalSize = payload.length;
|
||||
int chunkCount = (totalSize + LargeAbstractPacket.CHUNK_SIZE - 1) / LargeAbstractPacket.CHUNK_SIZE;
|
||||
|
||||
Reference in new issue
Block a user