[F] Fix chunk preloading
This commit is contained in:
@@ -81,15 +81,11 @@ public class SeedServerCache extends Behavior
|
|||||||
@Override
|
@Override
|
||||||
public void onTick(TickEvent event)
|
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)
|
||||||
if (cacheLocation == null)
|
|
||||||
{
|
{
|
||||||
new Thread(this::updateCache).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tell the server to load chunks every 20 seconds (20 * 20 = 400 ticks)
|
// Tell the server to load chunks every 20 seconds (20 * 20 = 400 ticks)
|
||||||
ticks ++;
|
ticks ++;
|
||||||
|
|
||||||
@@ -100,6 +96,13 @@ public class SeedServerCache extends Behavior
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update cache
|
||||||
|
if (cacheLocation == null)
|
||||||
|
{
|
||||||
|
new Thread(this::updateCache).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell the server to pre-load the chunks
|
* Tell the server to pre-load the chunks
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user