9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-20 07:19:23 +00:00
Files
DivineMC/patches/server/0016-vmp-use-linked-map-for-entity-trackers-for-faster-it.patch
NONPLAYT e61de52a5c Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@45774b4 apply the rest of the unapplied patches
PurpurMC/Purpur@dd826a3 Updated Upstream (Paper)
PurpurMC/Purpur@778995d Updated Upstream (Paper)
PurpurMC/Purpur@9ff84cb Updated Upstream (Paper)
PurpurMC/Purpur@bd49055 [ci skip] replace paper with purpur in log message
PurpurMC/Purpur@a122fd7 Updated Upstream (Paper)
PurpurMC/Purpur@783acfe Updated Upstream (Paper)
PurpurMC/Purpur@b5f1c48 Updated Upstream (Paper)
2024-06-21 04:21:18 +03:00

30 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: NONPLAYT <76615486+NONPLAYT@users.noreply.github.com>
Date: Sun, 14 Jan 2024 14:50:10 +0300
Subject: [PATCH] vmp: use linked map for entity trackers for faster iteration
Original code by RelativityMC, licensed under MIT
You can find the original code on https://github.com/RelativityMC/VMP-fabric (Yarn mappings)
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index ecd02b10c4120a7d7342b12ec95be0ee56318333..f5dd325b755beefa159957864ef0d3a381b3af86 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -12,6 +12,7 @@ import com.mojang.datafixers.DataFixer;
import com.mojang.logging.LogUtils;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
+import it.unimi.dsi.fastutil.ints.Int2ObjectLinkedOpenHashMap; // DivineMC - vmp: use linked map for entity trackers for faster iteration
import it.unimi.dsi.fastutil.longs.Long2ByteMap;
import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap;
import it.unimi.dsi.fastutil.longs.Long2LongMap;
@@ -204,7 +205,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.toDrop = new LongOpenHashSet();
this.tickingGenerated = new AtomicInteger();
this.playerMap = new PlayerMap();
- this.entityMap = new Int2ObjectOpenHashMap();
+ this.entityMap = new Int2ObjectLinkedOpenHashMap<>(); // DivineMC - vmp: use linked map for entity trackers for faster iteration
this.chunkTypeCache = new Long2ByteOpenHashMap();
this.chunkSaveCooldowns = new Long2LongOpenHashMap();
// Paper - rewrite chunk system