Moved BlockProvider and ChunkGenerator to abstract classes for future backwards compat (ironically, this isn't backwards compat!)

By: Dinnerbone <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2011-06-06 21:11:47 +01:00
parent 6ad28ba607
commit e82da4c5d2
2 changed files with 9 additions and 7 deletions

View File

@ -8,13 +8,15 @@ import org.bukkit.World;
* A block populator is responsible for generating a small area of blocks. * A block populator is responsible for generating a small area of blocks.
* For example, generating glowstone inside the nether or generating dungeons full of treasure * For example, generating glowstone inside the nether or generating dungeons full of treasure
*/ */
public interface BlockPopulator { public abstract class BlockPopulator {
/** /**
* Populates an area of blocks at or around the given chunk * Populates an area of blocks at or around the given chunk.
*
* The chunks directly surrounding the specified chunk must already exist.
* *
* @param world The world to generate in * @param world The world to generate in
* @param random The random generator to use * @param random The random generator to use
* @param chunk The chunk to generate for * @param chunk The chunk to generate for
*/ */
public void populate(World world, Random random, Chunk source); public abstract void populate(World world, Random random, Chunk source);
} }

View File

@ -8,7 +8,7 @@ import org.bukkit.World;
* A chunk generator is responsible for the initial shaping of an entire chunk. * A chunk generator is responsible for the initial shaping of an entire chunk.
* For example, the nether chunk generator should shape netherrack and soulsand * For example, the nether chunk generator should shape netherrack and soulsand
*/ */
public interface ChunkGenerator { public abstract class ChunkGenerator {
/** /**
* Shapes the chunk for the given coordinates.<br /> * Shapes the chunk for the given coordinates.<br />
* <br /> * <br />
@ -32,7 +32,7 @@ public interface ChunkGenerator {
* @param z The Z-coordinate of the chunk * @param z The Z-coordinate of the chunk
* @return byte[] containing the types for each block created by this generator * @return byte[] containing the types for each block created by this generator
*/ */
public byte[] generate(World world, Random random, int x, int z); public abstract byte[] generate(World world, Random random, int x, int z);
/** /**
* Tests if the specified location is valid for a natural spawn position * Tests if the specified location is valid for a natural spawn position
@ -42,7 +42,7 @@ public interface ChunkGenerator {
* @param z Z-coordinate of the block to test * @param z Z-coordinate of the block to test
* @return true if the location is valid, otherwise false * @return true if the location is valid, otherwise false
*/ */
public boolean canSpawn(World world, int x, int z); public abstract boolean canSpawn(World world, int x, int z);
/** /**
* Gets a list of default {@link BlockPopulator}s to apply to a given world * Gets a list of default {@link BlockPopulator}s to apply to a given world
@ -50,5 +50,5 @@ public interface ChunkGenerator {
* @param world World to apply to * @param world World to apply to
* @return List containing any amount of BlockPopulators * @return List containing any amount of BlockPopulators
*/ */
public List<BlockPopulator> getDefaultPopulators(World world); public abstract List<BlockPopulator> getDefaultPopulators(World world);
} }