Yatopia/patches/server/0021-Optimize-TileEntity-load-unload.patch
Ivan Pekov d065d41c0e
Drop this unsafe shit
Apparently caused issues we werent aware of.
Unfortunately there's no way to improve it without blocking the main thread.
2020-10-02 17:00:13 +03:00

24 lines
1.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Wed, 5 Aug 2020 08:08:44 -0500
Subject: [PATCH] Optimize TileEntity load/unload
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index bbbbeaafe8d699d59b04fe44a09b6b5fd9f1fac5..47dcc1b9242cb6d035d554ab0ed235b11238f469 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -42,9 +42,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable {
public static final ResourceKey<World> THE_END = ResourceKey.a(IRegistry.L, new MinecraftKey("the_end"));
private static final EnumDirection[] a = EnumDirection.values();
//public final List<TileEntity> tileEntityList = Lists.newArrayList(); // Paper - remove unused list
- public final List<TileEntity> tileEntityListTick = Lists.newArrayList();
- protected final List<TileEntity> tileEntityListPending = Lists.newArrayList();
- protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet();
+ public final List<TileEntity> tileEntityListTick = me.jellysquid.mods.lithium.common.util.collections.HashedList.wrapper(new net.yatopia.server.list.GlueList<>()); // Yatopia
+ protected final List<TileEntity> tileEntityListPending = me.jellysquid.mods.lithium.common.util.collections.HashedList.wrapper(new net.yatopia.server.list.GlueList<>()); // Yatopia
+ protected final List<TileEntity> tileEntityListUnload = me.jellysquid.mods.lithium.common.util.collections.HashedList.wrapper(new net.yatopia.server.list.GlueList<>()); // Yatopia
public final Thread serverThread;
private final boolean debugWorld;
private int d;