worldhopper: skip over almost full worlds
Co-authored-by: Hugh <nivcraft@gmail.com>
This commit is contained in:
@@ -31,7 +31,6 @@ import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
@@ -101,7 +100,7 @@ import org.apache.commons.lang3.ArrayUtils;
|
||||
public class WorldHopperPlugin extends Plugin
|
||||
{
|
||||
private static final int REFRESH_THROTTLE = 60_000; // ms
|
||||
private static final int TICK_THROTTLE = (int) Duration.ofMinutes(10).toMillis();
|
||||
private static final int MAX_PLAYER_COUNT = 1950;
|
||||
|
||||
private static final int DISPLAY_SWITCHER_MAX_ATTEMPTS = 3;
|
||||
|
||||
@@ -584,6 +583,12 @@ public class WorldHopperPlugin extends Plugin
|
||||
}
|
||||
}
|
||||
|
||||
// Avoid switching to near-max population worlds, as it will refuse to allow the hop if the world is full
|
||||
if (world.getPlayers() >= MAX_PLAYER_COUNT)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Break out if we've found a good world to hop to
|
||||
if (currentWorldTypes.equals(types))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user