22
33import com .google .common .base .Preconditions ;
44import me .outspending .biomesapi .wrapper .BiomeSettings ;
5- import me .outspending .biomesapi .wrapper .GrassColorModifier ;
5+ import me .outspending .biomesapi .wrapper .environment . GrassColorModifier ;
66import me .outspending .biomesapi .annotations .AsOf ;
77import me .outspending .biomesapi .packet .data .BlockReplacement ;
88import me .outspending .biomesapi .registry .BiomeResourceKey ;
99import me .outspending .biomesapi .renderer .ParticleRenderer ;
10+ import me .outspending .biomesapi .wrapper .environment .attribute .WrappedEnvironmentAttributeMap ;
1011import org .bukkit .Color ;
1112import org .bukkit .NamespacedKey ;
1213import org .bukkit .block .Biome ;
1617 * This interface represents a custom biome in the BiomesAPI.
1718 * It provides methods to retrieve and modify the properties of the custom biome.
1819 *
19- * @version 0.0.24
20+ * @version 1.1.0
2021 * @since 0.0.1
2122 * @author Outspending
2223 */
23- @ AsOf ("0.0.24 " )
24+ @ AsOf ("1.1.0 " )
2425public interface CustomBiome {
2526
2627 /**
@@ -124,6 +125,15 @@ public interface CustomBiome {
124125 @ AsOf ("0.0.1" )
125126 int getGrassColor ();
126127
128+ /**
129+ * Returns the dry foliage color of the CustomBiome.
130+ *
131+ * @return the dry foliage color of the CustomBiome
132+ * @since 1.0.2
133+ */
134+ @ AsOf ("1.0.2" )
135+ int getDryFoliageColor ();
136+
127137 /**
128138 * Returns the GrassColorModifier of the CustomBiome.
129139 *
@@ -151,6 +161,16 @@ public interface CustomBiome {
151161 @ AsOf ("0.0.6" )
152162 @ NotNull BlockReplacement [] getBlockReplacements ();
153163
164+
165+ /**
166+ * Returns the WrappedEnvironmentAttributeMap of the CustomBiome.
167+ *
168+ * @return the WrappedEnvironmentAttributeMap of the CustomBiome
169+ * @since 1.1.0
170+ */
171+ @ AsOf ("1.1.0" )
172+ @ NotNull WrappedEnvironmentAttributeMap getEnvironmentAttributeMap ();
173+
154174 /**
155175 * Sets the fog color of the CustomBiome.
156176 *
@@ -205,6 +225,15 @@ public interface CustomBiome {
205225 @ AsOf ("0.0.5" )
206226 void setGrassColor (int grassColor );
207227
228+ /**
229+ * Sets the dry foliage color of the CustomBiome.
230+ *
231+ * @param dryFoliageColor the dry foliage color of the CustomBiome
232+ * @since 1.0.2
233+ */
234+ @ AsOf ("1.0.2" )
235+ void setDryFoliageColor (int dryFoliageColor );
236+
208237 /**
209238 * Sets the GrassColorModifier of the CustomBiome.
210239 *
@@ -233,6 +262,16 @@ public interface CustomBiome {
233262 @ AsOf ("0.0.6" )
234263 void setBlockReplacements (@ NotNull BlockReplacement ... blockReplacements );
235264
265+
266+ /**
267+ * Sets the WrappedEnvironmentAttributeMap of the CustomBiome.
268+ *
269+ * @param environmentAttributeMap the WrappedEnvironmentAttributeMap of the CustomBiome
270+ * @since 1.1.0
271+ */
272+ @ AsOf ("1.1.0" )
273+ void setEnvironmentAttributeMap (@ NotNull WrappedEnvironmentAttributeMap environmentAttributeMap );
274+
236275 /**
237276 * Returns a new Builder instance with the properties of the CustomBiome.
238277 *
@@ -286,17 +325,20 @@ class Builder {
286325 private BiomeResourceKey resourceKey = null ;
287326 private BiomeSettings settings = BiomeSettings .defaultSettings ();
288327
289- private int fogColor = 0 ;
290- private int waterColor = 0 ;
291- private int waterFogColor = 0 ;
292- private int skyColor = 0 ;
328+ private int fogColor = - 1 ;
329+ private int waterColor = - 1 ;
330+ private int waterFogColor = - 1 ;
331+ private int skyColor = - 1 ;
293332
294- private int foliageColor = 0 ;
295- private int grassColor = 0 ;
333+ private int foliageColor = -1 ;
334+ private int grassColor = -1 ;
335+ private int dryFoliageColor = -1 ;
296336
297337 private GrassColorModifier grassColorModifier = GrassColorModifier .NONE ;
298- private ParticleRenderer particleRenderer = null ;
338+ private ParticleRenderer particleRenderer = ParticleRenderer . EMPTY ;
299339 private BlockReplacement [] blockReplacements = new BlockReplacement [0 ];
340+ private WrappedEnvironmentAttributeMap environmentAttributeMap = WrappedEnvironmentAttributeMap .EMPTY ;
341+
300342
301343 /**
302344 * Formats a hexadecimal color string by removing the leading '#' if present.
@@ -349,9 +391,11 @@ public Builder(@NotNull CustomBiome biome) {
349391 this .skyColor = biome .getSkyColor ();
350392 this .foliageColor = biome .getFoliageColor ();
351393 this .grassColor = biome .getGrassColor ();
394+ this .dryFoliageColor = biome .getDryFoliageColor ();
395+ this .grassColorModifier = biome .getGrassColorModifier ();
352396 this .particleRenderer = biome .getParticleRenderer ();
353397 this .blockReplacements = biome .getBlockReplacements ();
354- this .grassColorModifier = biome .getGrassColorModifier ();
398+ this .environmentAttributeMap = biome .getEnvironmentAttributeMap ();
355399 }
356400
357401 /**
@@ -536,6 +580,20 @@ public Builder(@NotNull CustomBiome biome) {
536580 return this ;
537581 }
538582
583+
584+ /**
585+ * This method sets the dry foliage color property of the CustomBiome.
586+ *
587+ * @param dryFoliageColor The dry foliage color of the custom biome.
588+ * @since 1.0.2
589+ * @return The Builder object, for chaining method calls.
590+ */
591+ @ AsOf ("1.0.2" )
592+ public @ NotNull Builder dryFoliageColor (@ NotNull String dryFoliageColor ) {
593+ this .dryFoliageColor = Integer .parseInt (formatHex (dryFoliageColor ), 16 );
594+ return this ;
595+ }
596+
539597 /**
540598 * This method sets the grass color modifier property of the CustomBiome.
541599 *
@@ -576,13 +634,27 @@ public Builder(@NotNull CustomBiome biome) {
576634 return this ;
577635 }
578636
637+
638+ /**
639+ * This method sets the environment attribute map property of the CustomBiome.
640+ *
641+ * @param environmentAttributeMap The environment attribute map of the custom biome.
642+ * @since 1.1.0
643+ * @return The Builder object, for chaining method calls.
644+ */
645+ @ AsOf ("1.1.0" )
646+ public @ NotNull Builder environmentAttributeMap (@ NotNull WrappedEnvironmentAttributeMap environmentAttributeMap ) {
647+ this .environmentAttributeMap = environmentAttributeMap ;
648+ return this ;
649+ }
650+
579651 /**
580652 * This method creates a new CustomBiome object with the properties set in the Builder.
581653 *
582- * @version 0.0.1
654+ * @since 0.0.1
583655 * @return a new CustomBiome object.
584656 */
585- @ AsOf ("0.0.1 " )
657+ @ AsOf ("1.1.0 " )
586658 public @ NotNull CustomBiome build () {
587659 Preconditions .checkArgument (resourceKey != null , "Resource key must be set" );
588660 Preconditions .checkArgument (settings != null , "Settings must be set" );
@@ -596,9 +668,11 @@ public Builder(@NotNull CustomBiome biome) {
596668 skyColor ,
597669 foliageColor ,
598670 grassColor ,
671+ dryFoliageColor ,
599672 grassColorModifier ,
600673 particleRenderer ,
601- blockReplacements
674+ blockReplacements ,
675+ environmentAttributeMap
602676 );
603677 }
604678
0 commit comments