Restructure generators

This commit is contained in:
boy0001
2015-07-27 03:00:09 +10:00
parent a3d5326da3
commit 042a295a55
9 changed files with 120 additions and 23 deletions

View File

@ -7,6 +7,7 @@ import org.bukkit.generator.ChunkGenerator;
import com.intellectualcrafters.plot.config.C;
import com.intellectualcrafters.plot.generator.HybridUtils;
import com.intellectualcrafters.plot.generator.PlotGenerator2;
import com.plotsquared.bukkit.listeners.APlotListener;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.util.BlockManager;
@ -70,7 +71,7 @@ public interface IPlotMain {
public void unregister(PlotPlayer player);
public ChunkGenerator getGenerator(String world, String name);
public PlotGenerator2<?> getGenerator(String world, String name);
public APlotListener initPlotListener();

View File

@ -844,12 +844,12 @@ public class PS {
if (ClusterManager.getClusters(world).size() > 0) {
for (final PlotCluster cluster : ClusterManager.getClusters(world)) {
log(C.PREFIX.s() + "&3 - &7| cluster: " + cluster);
generator.augment(generator.getName(), cluster, plotWorld);
generator.augment(cluster, plotWorld);
// new AugmentedPopulator(world, generator, cluster, plotWorld.TERRAIN == 2, plotWorld.TERRAIN != 2);
}
}
} else if (plotWorld.TYPE == 1) {
generator.augment(generator.getName(), null, plotWorld);
generator.augment(null, plotWorld);
// new AugmentedPopulator(world, gen_class, null, plotWorld.TERRAIN == 2, plotWorld.TERRAIN != 2);
}
generator.initialize(plotWorld);

View File

@ -4,11 +4,13 @@ import com.intellectualcrafters.plot.object.PlotCluster;
import com.intellectualcrafters.plot.object.PlotManager;
import com.intellectualcrafters.plot.object.PlotWorld;
public abstract class PlotGenerator2 {
public abstract class PlotGenerator2<T> {
public final String world;
public T generator;
public PlotGenerator2(String world) {
public PlotGenerator2(String world, T generator) {
this.world = world;
this.generator = generator;
}
public abstract void initialize(PlotWorld plotworld);
@ -22,7 +24,7 @@ public abstract class PlotGenerator2 {
* @param cluster Will be the cluster, or null
* @param plotworld
*/
public abstract void augment(String generator, PlotCluster cluster, PlotWorld plotworld);
public abstract void augment(PlotCluster cluster, PlotWorld plotworld);
/**