Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-121

Bukkit: Allow ChunkGenerator to generate more block types

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None

      The current chunk generator in the Bukkit API can only generate chunks using bytes or shorts to identify blocks. This means that a lot of the recently added blocks cannot be added by the ChunkGenerator alone and that you have to rely on BlockPopulators to inject more advanced blocks after-the-fact.

      It would be nice if you could do that directly from the ChunkGenerator instead.

      So I suggest that you add the following abstract method to the ChunkGenerator class:

      Material[][] generateBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes)

      Another variant might be to use a lightweight Material class that holds a typeID and a data byte. Although this goes against the magic value deprecation of the BukkitAPI so the use of Material as suggested above is probably a better idea.

      public class LightMaterial
      {
      public int typeID;
      public byte data;
      }

      and then add this to the ChunkGenerator class:

      LightMaterial[][] generateBlockSections(World world, Random random, int x, int z, ChunkGenerator.BiomeGrid biomes)

            Unassigned Unassigned
            orgin_org orgin_org
            Votes:
            4 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: