Fix generation of augmented/partial worlds when single worlds are enabled

- Enabling single worlds adds "PlotSquared:single" to the generators map in SetupUtils
 - Adding a switch for if the map has ever been loaded into means that the first time updateGenerators is called, they will always be updated
 - This means that ultimately PlotSquared is not added as a generator for augmented/partial worlds in bukkit/yml (as it is not, it is a populator)
This commit is contained in:
dordsor21 2022-05-10 01:49:33 +01:00
parent 13d7357c85
commit 798b98b3cf
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
2 changed files with 3 additions and 1 deletions

View File

@ -76,7 +76,7 @@ public class BukkitSetupUtils extends SetupUtils {
@Override
public void updateGenerators(final boolean force) {
if (!SetupUtils.generators.isEmpty() && !force) {
if (loaded && !SetupUtils.generators.isEmpty() && !force) {
return;
}
String testWorld = "CheckingPlotSquaredGenerator";
@ -100,6 +100,7 @@ public class BukkitSetupUtils extends SetupUtils {
e.printStackTrace();
}
}
loaded = true;
}
@Override

View File

@ -34,6 +34,7 @@ import java.util.HashMap;
public abstract class SetupUtils {
public static HashMap<String, GeneratorWrapper<?>> generators = new HashMap<>();
protected boolean loaded = false;
/**
* @since 6.1.0