|
33 | 33 | import java.util.Objects; |
34 | 34 | import java.util.Set; |
35 | 35 |
|
| 36 | +/** |
| 37 | + * Provides available Biomes for world generation. |
| 38 | + */ |
36 | 39 | public interface BiomeProvider extends BiomeFinder { |
37 | 40 |
|
38 | | - static <T extends LayeredBiomeConfig> ConfigurableBiomeProvider<T> layered(final T config) { |
39 | | - return Sponge.game().factoryProvider().provide(Factory.class).layered(config); |
40 | | - } |
41 | | - |
42 | | - static ConfigurableBiomeProvider<LayeredBiomeConfig> overworld() { |
| 41 | + /** |
| 42 | + * Returns the vanilla overworld biome provider. |
| 43 | + * |
| 44 | + * @return the vanilla overworld biome provider. |
| 45 | + */ |
| 46 | + static ConfigurableBiomeProvider<MultiNoiseBiomeConfig> overworld() { |
43 | 47 | return Sponge.game().factoryProvider().provide(Factory.class).overworld(); |
44 | 48 | } |
45 | 49 |
|
| 50 | + /** |
| 51 | + * Returns a multi-noise biome provider based on a {@link MultiNoiseBiomeConfig}. |
| 52 | + * @param config the configuration |
| 53 | + * @param <T> the configuration type |
| 54 | + * |
| 55 | + * @return the configured BiomeProvider |
| 56 | + */ |
46 | 57 | static <T extends MultiNoiseBiomeConfig> ConfigurableBiomeProvider<T> multiNoise(final T config) { |
47 | 58 | return Sponge.game().factoryProvider().provide(Factory.class).multiNoise(config); |
48 | 59 | } |
49 | 60 |
|
| 61 | + /** |
| 62 | + * Returns the vanilla nether biome provider. |
| 63 | + * |
| 64 | + * @return the vanilla nether biome provider. |
| 65 | + */ |
50 | 66 | static ConfigurableBiomeProvider<MultiNoiseBiomeConfig> nether() { |
51 | 67 | return Sponge.game().factoryProvider().provide(Factory.class).nether(); |
52 | 68 | } |
53 | 69 |
|
| 70 | + /** |
| 71 | + * Returns a vanilla end-style biome provider based on a {@link EndStyleBiomeConfig}. |
| 72 | + * |
| 73 | + * @param config the configuration |
| 74 | + * @param <T> the configuration type |
| 75 | + * |
| 76 | + * @return the configured BiomeProvider |
| 77 | + */ |
54 | 78 | static <T extends EndStyleBiomeConfig> ConfigurableBiomeProvider<T> endStyle(final T config) { |
55 | 79 | return Sponge.game().factoryProvider().provide(Factory.class).endStyle(config); |
56 | 80 | } |
57 | 81 |
|
| 82 | + /** |
| 83 | + * Returns the vanilla end biome provider. |
| 84 | + * |
| 85 | + * @return the vanilla end biome provider. |
| 86 | + */ |
58 | 87 | static ConfigurableBiomeProvider<EndStyleBiomeConfig> end() { |
59 | 88 | return Sponge.game().factoryProvider().provide(Factory.class).end(); |
60 | 89 | } |
61 | 90 |
|
| 91 | + /** |
| 92 | + * Returns a checkerboard-style biome provider based on a {@link CheckerboardBiomeConfig} |
| 93 | + * |
| 94 | + * @param config the configuration |
| 95 | + * @param <T> the configuration type |
| 96 | + * |
| 97 | + * @return the configured BiomeProvider |
| 98 | + */ |
62 | 99 | static <T extends CheckerboardBiomeConfig> ConfigurableBiomeProvider<T> checkerboard(final T config) { |
63 | 100 | return Sponge.game().factoryProvider().provide(Factory.class).checkerboard(config); |
64 | 101 | } |
65 | 102 |
|
| 103 | + /** |
| 104 | + * Returns a fixed biome provider base on a single {@link Biome} |
| 105 | + * |
| 106 | + * @param biome the biome |
| 107 | + * |
| 108 | + * @return the configured BiomeProvider |
| 109 | + */ |
66 | 110 | static BiomeProvider fixed(final RegistryReference<Biome> biome) { |
67 | 111 | return Sponge.game().factoryProvider().provide(Factory.class).fixed(Objects.requireNonNull(biome, "biome")); |
68 | 112 | } |
69 | 113 |
|
| 114 | + /** |
| 115 | + * The list of biomes possible. |
| 116 | + * |
| 117 | + * @return the list of biomes possible. |
| 118 | + */ |
70 | 119 | List<Biome> choices(); |
71 | 120 |
|
| 121 | + /** |
| 122 | + * The set of biomes within an area. |
| 123 | + * |
| 124 | + * @param x the center x coordinate |
| 125 | + * @param y the center y coordinate |
| 126 | + * @param z the center z coordinate |
| 127 | + * @param size the square area radius |
| 128 | + * |
| 129 | + * @return the set of biomes. |
| 130 | + */ |
72 | 131 | Set<Biome> within(int x, int y, int z, int size); |
73 | 132 |
|
74 | 133 | interface Factory { |
75 | 134 |
|
76 | | - <T extends LayeredBiomeConfig> ConfigurableBiomeProvider<T> layered(T config); |
77 | | - |
78 | | - ConfigurableBiomeProvider<LayeredBiomeConfig> overworld(); |
79 | | - |
| 135 | + /** |
| 136 | + * Returns the vanilla overworld biome provider. |
| 137 | + * |
| 138 | + * @return the vanilla overworld biome provider. |
| 139 | + */ |
| 140 | + ConfigurableBiomeProvider<MultiNoiseBiomeConfig> overworld(); |
| 141 | + |
| 142 | + /** |
| 143 | + * Returns a multi-noise biome provider based on a {@link MultiNoiseBiomeConfig}. |
| 144 | + * @param config the configuration |
| 145 | + * @param <T> the configuration type |
| 146 | + * |
| 147 | + * @return the configured BiomeProvider |
| 148 | + */ |
80 | 149 | <T extends MultiNoiseBiomeConfig> ConfigurableBiomeProvider<T> multiNoise(T config); |
81 | 150 |
|
| 151 | + /** |
| 152 | + * Returns the vanilla nether biome provider. |
| 153 | + * |
| 154 | + * @return the vanilla nether biome provider. |
| 155 | + */ |
82 | 156 | ConfigurableBiomeProvider<MultiNoiseBiomeConfig> nether(); |
83 | 157 |
|
| 158 | + /** |
| 159 | + * Returns a vanilla end-style biome provider based on a {@link EndStyleBiomeConfig}. |
| 160 | + * |
| 161 | + * @param config the configuration |
| 162 | + * @param <T> the configuration type |
| 163 | + * |
| 164 | + * @return the configured BiomeProvider |
| 165 | + */ |
84 | 166 | <T extends EndStyleBiomeConfig> ConfigurableBiomeProvider<T> endStyle(T config); |
85 | 167 |
|
| 168 | + /** |
| 169 | + * Returns the vanilla end biome provider. |
| 170 | + * |
| 171 | + * @return the vanilla end biome provider. |
| 172 | + */ |
86 | 173 | ConfigurableBiomeProvider<EndStyleBiomeConfig> end(); |
87 | 174 |
|
| 175 | + /** |
| 176 | + * Returns a checkerboard-style biome provider based on a {@link CheckerboardBiomeConfig} |
| 177 | + * |
| 178 | + * @param config the configuration |
| 179 | + * @param <T> the configuration type |
| 180 | + * |
| 181 | + * @return the configured BiomeProvider |
| 182 | + */ |
88 | 183 | <T extends CheckerboardBiomeConfig> ConfigurableBiomeProvider<T> checkerboard(T config); |
89 | 184 |
|
| 185 | + /** |
| 186 | + * Returns a fixed biome provider base on a single {@link Biome} |
| 187 | + * |
| 188 | + * @param biome the biome |
| 189 | + * |
| 190 | + * @return the configured BiomeProvider |
| 191 | + */ |
90 | 192 | BiomeProvider fixed(RegistryReference<Biome> biome); |
91 | 193 | } |
92 | 194 | } |
0 commit comments