Adding to plugin base.
Untested.
This commit is contained in:
parent
943feece04
commit
37aa598d8f
@ -1,35 +1,31 @@
|
||||
package ca.recrown.islandsurvivalcraft;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.lang.NotImplementedException;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import ca.recrown.islandsurvivalcraft.worldgen.IslandBaseTerrainGenerator;
|
||||
import nl.rutgerkok.worldgeneratorapi.WorldGeneratorApi;
|
||||
import nl.rutgerkok.worldgeneratorapi.WorldRef;
|
||||
import ca.recrown.islandsurvivalcraft.worldgen.IslandSurvivalCraftWorldGenerator;
|
||||
|
||||
public class IslandSurvivalCraft extends JavaPlugin {
|
||||
IslandSurvivalCraftWorldGenerator generator;
|
||||
|
||||
@Override
|
||||
public void onEnable() {
|
||||
// TODO Auto-generated method stub
|
||||
super.onEnable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
// TODO Auto-generated method stub
|
||||
super.onDisable();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id) {
|
||||
WorldGeneratorApi worldGenAPI = WorldGeneratorApi.getInstance(this, 0, 1);
|
||||
return worldGenAPI.createCustomGenerator(WorldRef.ofName(worldName), gen -> {
|
||||
if (generator == null) {
|
||||
World world = getServer().getWorld(worldName);
|
||||
gen.setBaseTerrainGenerator(new IslandBaseTerrainGenerator(world));
|
||||
});
|
||||
generator = new IslandSurvivalCraftWorldGenerator(world.getSeed(), world.getMaxHeight(), world.getSeaLevel(), true);
|
||||
}
|
||||
return generator;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user