[F] Fix chunk preloading

This commit is contained in:
Hykilpikonna
2020-02-19 18:05:18 -05:00
parent 3973a2eb4e
commit 73b4b09b67
@@ -81,23 +81,26 @@ public class SeedServerCache extends Behavior
@Override
public void onTick(TickEvent event)
{
if (!enabled || updating) return;
if (updating) return;
BetterBlockPos feet = new BetterBlockPos(mc.player.getPositionVec().x, mc.player.getPositionVec().y + 0.1251, mc.player.getPositionVec().z);
// If not enabled, preload the chunks
if (!enabled)
{
// Tell the server to load chunks every 20 seconds (20 * 20 = 400 ticks)
ticks ++;
if (ticks > 400)
{
ticks = 0;
new Thread(this::loadChunks).start();
}
}
// Update cache
if (cacheLocation == null)
{
new Thread(this::updateCache).start();
}
// Tell the server to load chunks every 20 seconds (20 * 20 = 400 ticks)
ticks ++;
if (ticks > 400)
{
ticks = 0;
new Thread(this::loadChunks).start();
}
}
/**