Let generator be up to the implementation

This commit is contained in:
Jesse Boyd
2016-09-17 16:02:05 +10:00
parent 56227a6d7d
commit 264114332b
18 changed files with 79 additions and 34 deletions

View File

@ -136,7 +136,7 @@ public class SpongeMain implements IPlotMain {
THIS = this;
new PS(this, "Sponge");
this.server = this.game.getServer();
this.game.getRegistry().register(WorldGeneratorModifier.class, (WorldGeneratorModifier) new HybridGen().specify(null));
this.game.getRegistry().register(WorldGeneratorModifier.class, (WorldGeneratorModifier) PS.get().IMP.getDefaultGenerator().specify(null));
}
@Override
@ -390,7 +390,7 @@ public class SpongeMain implements IPlotMain {
return new SpongePlotGenerator(wgm);
}
}
return new SpongePlotGenerator(new HybridGen());
return new SpongePlotGenerator(PS.get().IMP.getDefaultGenerator());
}
@Override
@ -403,4 +403,9 @@ public class SpongeMain implements IPlotMain {
return this.game.getPluginManager().getPlugins().stream().map(plugin1 -> plugin1.getName() + ';' + plugin1.getVersion() + ':' + true)
.collect(Collectors.toCollection(ArrayList::new));
}
@Override
public IndependentPlotGenerator getDefaultGenerator() {
return new HybridGen();
}
}

View File

@ -32,7 +32,7 @@ public class SpongeSetupUtils extends SetupUtils {
if (!SetupUtils.generators.isEmpty()) {
return;
}
SetupUtils.generators.put("PlotSquared", new SpongePlotGenerator(new HybridGen()));
SetupUtils.generators.put("PlotSquared", new SpongePlotGenerator(PS.get().IMP.getDefaultGenerator()));
// TODO get external world generators
Collection<WorldGeneratorModifier> wgms = Sponge.getRegistry().getAllOf(WorldGeneratorModifier.class);
for (WorldGeneratorModifier wgm : wgms) {