mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 16:57:42 +01:00
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:
parent
6ad28ba607
commit
e82da4c5d2
@ -8,13 +8,15 @@ import org.bukkit.World;
|
||||
* 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
|
||||
*/
|
||||
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 random The random generator to use
|
||||
* @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);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.World;
|
||||
* A chunk generator is responsible for the initial shaping of an entire chunk.
|
||||
* 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 />
|
||||
* <br />
|
||||
@ -32,7 +32,7 @@ public interface ChunkGenerator {
|
||||
* @param z The Z-coordinate of the chunk
|
||||
* @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
|
||||
@ -42,7 +42,7 @@ public interface ChunkGenerator {
|
||||
* @param z Z-coordinate of the block to test
|
||||
* @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
|
||||
@ -50,5 +50,5 @@ public interface ChunkGenerator {
|
||||
* @param world World to apply to
|
||||
* @return List containing any amount of BlockPopulators
|
||||
*/
|
||||
public List<BlockPopulator> getDefaultPopulators(World world);
|
||||
public abstract List<BlockPopulator> getDefaultPopulators(World world);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user