Files
MiraiMC/patches/server/0101-lithium-use-fastutil-hashmap-as-blockentity-ticker-c.patch
etil2jz 7eb885acf1 Update patches
Closes #36
2022-08-20 18:18:32 +02:00

32 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Arthur Blanchot <blanchot.arthur@protonmail.ch>
Date: Sun, 31 Jul 2022 18:55:23 +0200
Subject: [PATCH] lithium: use fastutil hashmap as blockentity ticker
collection
Original license: LGPLv3
Original project: https://github.com/CaffeineMC/lithium-fabric (Yarn mappings)
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 0b08a91ae9dc73c011dbb5f517becac7d08fd1e9..dc836c231d7833c5a873a6f6b6acded23d495f7f 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -76,7 +76,7 @@ public class LevelChunk extends ChunkAccess {
return "<null>";
}
};
- private final Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel;
+ private Map<BlockPos, LevelChunk.RebindableTickingBlockEntityWrapper> tickersInLevel; // Mirai - lithium: use fastutil hashmap as blockentity ticker collection
public boolean loaded;
private boolean clientLightReady;
public final ServerLevel level; // CraftBukkit - type
@@ -116,7 +116,7 @@ public class LevelChunk extends ChunkAccess {
this.setBlockNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
this.setSkyNibbles(ca.spottedleaf.starlight.common.light.StarLightEngine.getFilledEmptyLight(world));
// Paper end - rewrite light engine
- this.tickersInLevel = Maps.newHashMap();
+ this.tickersInLevel = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(); // Mirai - lithium: use fastutil hashmap as blockentity ticker collection
this.clientLightReady = false;
this.level = (ServerLevel) world; // CraftBukkit - type
this.gameEventDispatcherSections = new Int2ObjectOpenHashMap();