Yatopia/patches/server/0020-Optimize-TileEntity-load-unload.patch
Ivan Pekov 784079fc31
optimizations (#297)
* Drop useless stuff

* Faster Random

* TE opts

* Patches.md

* More Faster Random

* Fix Build

* More Opts

* AirplaneLite

* Update README.md

removed TIC-TACS and adding AirplaneLite

* Add AirplaneLite to the update script

* Rebuild patches

* Make enchanting table ticking configurable

* AirplaneLite to commitUpstream.sh

* Use FastRandom on more places

Co-authored-by: Bud Gidiere <sgidiere@gmail.com>
Co-authored-by: Simon Gardling <Titaniumtown@gmail.com>
2020-11-30 20:08:41 -06:00

22 lines
1.5 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 5b45051af00b823e7bbfd9407f2ff66539583863..de7ca87e74084c5cca109a6eff071da351dec91b 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -42,8 +42,8 @@ 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();
+ public final List<TileEntity> tileEntityListTick = me.jellysquid.mods.lithium.common.util.collections.HashedList.wrapper(Lists.newArrayList()); // Yatopia
+ protected final List<TileEntity> tileEntityListPending = me.jellysquid.mods.lithium.common.util.collections.HashedList.wrapper(Lists.newArrayList()); // Yatopia
protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet();
public final Thread serverThread;
private final boolean debugWorld;