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 1.0.2
20+ * @version 1.1.0
2021 * @since 0.0.1
2122 * @author Outspending
2223 */
23- @ AsOf ("1.0.2 " )
24+ @ AsOf ("1.1.0 " )
2425public interface CustomBiome {
2526
2627 /**
@@ -160,6 +161,16 @@ public interface CustomBiome {
160161 @ AsOf ("0.0.6" )
161162 @ NotNull BlockReplacement [] getBlockReplacements ();
162163
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+
163174 /**
164175 * Sets the fog color of the CustomBiome.
165176 *
@@ -251,6 +262,16 @@ public interface CustomBiome {
251262 @ AsOf ("0.0.6" )
252263 void setBlockReplacements (@ NotNull BlockReplacement ... blockReplacements );
253264
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+
254275 /**
255276 * Returns a new Builder instance with the properties of the CustomBiome.
256277 *
@@ -314,8 +335,10 @@ class Builder {
314335 private int dryFoliageColor = 0 ;
315336
316337 private GrassColorModifier grassColorModifier = GrassColorModifier .NONE ;
317- private ParticleRenderer particleRenderer = null ;
338+ private ParticleRenderer particleRenderer = ParticleRenderer . EMPTY ;
318339 private BlockReplacement [] blockReplacements = new BlockReplacement [0 ];
340+ private WrappedEnvironmentAttributeMap environmentAttributeMap = WrappedEnvironmentAttributeMap .EMPTY ;
341+
319342
320343 /**
321344 * Formats a hexadecimal color string by removing the leading '#' if present.
@@ -359,6 +382,7 @@ public Builder(@NotNull CustomBiome biome) {
359382 this .grassColorModifier = biome .getGrassColorModifier ();
360383 this .particleRenderer = biome .getParticleRenderer ();
361384 this .blockReplacements = biome .getBlockReplacements ();
385+ this .environmentAttributeMap = biome .getEnvironmentAttributeMap ();
362386 }
363387
364388 /**
@@ -597,13 +621,27 @@ public Builder(@NotNull CustomBiome biome) {
597621 return this ;
598622 }
599623
624+
625+ /**
626+ * This method sets the environment attribute map property of the CustomBiome.
627+ *
628+ * @param environmentAttributeMap The environment attribute map of the custom biome.
629+ * @since 1.1.0
630+ * @return The Builder object, for chaining method calls.
631+ */
632+ @ AsOf ("1.1.0" )
633+ public @ NotNull Builder environmentAttributeMap (@ NotNull WrappedEnvironmentAttributeMap environmentAttributeMap ) {
634+ this .environmentAttributeMap = environmentAttributeMap ;
635+ return this ;
636+ }
637+
600638 /**
601639 * This method creates a new CustomBiome object with the properties set in the Builder.
602640 *
603641 * @since 0.0.1
604642 * @return a new CustomBiome object.
605643 */
606- @ AsOf ("1.0.2 " )
644+ @ AsOf ("1.1.0 " )
607645 public @ NotNull CustomBiome build () {
608646 Preconditions .checkArgument (resourceKey != null , "Resource key must be set" );
609647 Preconditions .checkArgument (settings != null , "Settings must be set" );
@@ -620,7 +658,8 @@ public Builder(@NotNull CustomBiome biome) {
620658 dryFoliageColor ,
621659 grassColorModifier ,
622660 particleRenderer ,
623- blockReplacements
661+ blockReplacements ,
662+ environmentAttributeMap
624663 );
625664 }
626665
0 commit comments