88import me .outspending .biomesapi .packet .data .BlockReplacement ;
99import me .outspending .biomesapi .registry .BiomeRegistry ;
1010import me .outspending .biomesapi .registry .BiomeResourceKey ;
11- import me .outspending .biomesapi .renderer .ParticleRenderer ;
1211import me .outspending .biomesapi .wrapper .environment .attribute .WrappedEnvironmentAttributeMap ;
12+ import me .outspending .biomesapi .wrapper .environment .particles .ParticleCatalog ;
1313import net .minecraft .resources .Identifier ;
1414import org .bukkit .NamespacedKey ;
1515import org .bukkit .block .Biome ;
16+ import org .jetbrains .annotations .ApiStatus ;
1617import org .jetbrains .annotations .NotNull ;
1718import org .jetbrains .annotations .Nullable ;
1819
20+ import java .util .Objects ;
21+
1922/**
2023 * This class represents a custom biome implementation.
2124 *
2225 * @author Outspending
2326 * @version 1.1.0
2427 * @since 0.0.2
2528 */
29+ @ ApiStatus .Internal
2630@ AsOf ("1.1.0" )
2731public final class CustomBiomeImpl implements CustomBiome {
2832
@@ -43,7 +47,7 @@ public final class CustomBiomeImpl implements CustomBiome {
4347
4448 // Optional Settings
4549 private GrassColorModifier grassColorModifier = GrassColorModifier .NONE ;
46- private ParticleRenderer particleRenderer = ParticleRenderer .EMPTY ;
50+ private ParticleCatalog particleCatalog = ParticleCatalog .EMPTY ;
4751 private BlockReplacement [] blockReplacements = new BlockReplacement [0 ];
4852
4953 private WrappedEnvironmentAttributeMap environmentAttributeMap = WrappedEnvironmentAttributeMap .EMPTY ;
@@ -58,11 +62,11 @@ public CustomBiomeImpl(
5862 @ Nullable Integer waterFogColor ,
5963 @ Nullable Integer skyColor ,
6064
61- @ NotNull ParticleRenderer particleRenderer
65+ @ NotNull ParticleCatalog particleCatalog
6266 ) {
6367 this .resourceKey = resourceKey ;
6468 this .settings = settings ;
65- this .particleRenderer = particleRenderer ;
69+ this .particleCatalog = particleCatalog ;
6670
6771 this .fogColor = fogColor ;
6872 this .waterColor = waterColor ;
@@ -83,9 +87,9 @@ public CustomBiomeImpl(
8387 @ Nullable Integer foliageColor ,
8488 @ Nullable Integer grassColor ,
8589
86- @ NotNull ParticleRenderer particleRenderer
90+ @ NotNull ParticleCatalog particleCatalog
8791 ) {
88- this (resourceKey , settings , fogColor , waterColor , waterFogColor , skyColor , particleRenderer );
92+ this (resourceKey , settings , fogColor , waterColor , waterFogColor , skyColor , particleCatalog );
8993 this .foliageColor = foliageColor ;
9094 this .grassColor = grassColor ;
9195 this .blockReplacements = new BlockReplacement [0 ];
@@ -105,11 +109,11 @@ public CustomBiomeImpl(
105109 @ Nullable Integer dryFoliageColor ,
106110
107111 @ NotNull GrassColorModifier grassColorModifier ,
108- @ NotNull ParticleRenderer particleRenderer ,
112+ @ NotNull ParticleCatalog particleCatalog ,
109113 @ NotNull BlockReplacement [] blockReplacements ,
110114 @ NotNull WrappedEnvironmentAttributeMap environmentAttributeMap
111115 ) {
112- this (resourceKey , settings , fogColor , waterColor , waterFogColor , skyColor , particleRenderer );
116+ this (resourceKey , settings , fogColor , waterColor , waterFogColor , skyColor , particleCatalog );
113117 this .foliageColor = foliageColor ;
114118 this .grassColor = grassColor ;
115119 this .dryFoliageColor = dryFoliageColor ;
@@ -179,8 +183,8 @@ public GrassColorModifier getGrassColorModifier() {
179183 }
180184
181185 @ Override
182- public @ NotNull ParticleRenderer getParticleRenderer () {
183- return particleRenderer ;
186+ public @ NotNull ParticleCatalog getParticleCatalog () {
187+ return particleCatalog ;
184188 }
185189
186190 @ Override
@@ -233,8 +237,8 @@ public void setGrassColorModifier(@NotNull GrassColorModifier grassColorModifier
233237 }
234238
235239 @ Override
236- public void setParticleRenderer (@ NotNull ParticleRenderer particleRenderer ) {
237- this .particleRenderer = particleRenderer ;
240+ public void setParticleCatalog (@ NotNull ParticleCatalog particleCatalog ) {
241+ this .particleCatalog = particleCatalog ;
238242 }
239243
240244 @ Override
@@ -262,20 +266,20 @@ public void modify() {
262266 BiomeRegistry .newRegistry ().modify (this );
263267 }
264268
265- @ Override
269+ @ Override // TODO: cleanup
266270 public boolean isSimilar (@ NotNull CustomBiome otherBiome ) {
267271 if (this == otherBiome ) return true ;
268272 if (!this .resourceKey .equals (otherBiome .getResourceKey ())) return false ;
269273 if (!this .settings .equals (otherBiome .getSettings ())) return false ;
270- if (this .fogColor != otherBiome .getFogColor ()) return false ;
274+ if (! Objects . equals ( this .fogColor , otherBiome .getFogColor () )) return false ;
271275 if (this .waterColor != otherBiome .getWaterColor ()) return false ;
272- if (this .waterFogColor != otherBiome .getWaterFogColor ()) return false ;
273- if (this .skyColor != otherBiome .getSkyColor ()) return false ;
274- if (this .foliageColor != otherBiome .getFoliageColor ()) return false ;
275- if (this .grassColor != otherBiome .getGrassColor ()) return false ;
276- if (this .dryFoliageColor != otherBiome .getDryFoliageColor ()) return false ;
276+ if (! Objects . equals ( this .waterFogColor , otherBiome .getWaterFogColor () )) return false ;
277+ if (! Objects . equals ( this .skyColor , otherBiome .getSkyColor () )) return false ;
278+ if (! Objects . equals ( this .foliageColor , otherBiome .getFoliageColor () )) return false ;
279+ if (! Objects . equals ( this .grassColor , otherBiome .getGrassColor () )) return false ;
280+ if (! Objects . equals ( this .dryFoliageColor , otherBiome .getDryFoliageColor () )) return false ;
277281 if (!this .grassColorModifier .equals (otherBiome .getGrassColorModifier ())) return false ;
278- if (!this .particleRenderer .equals (otherBiome .getParticleRenderer ())) return false ;
282+ if (!this .particleCatalog .equals (otherBiome .getParticleCatalog ())) return false ;
279283 if (this .blockReplacements .length != otherBiome .getBlockReplacements ().length ) return false ;
280284 for (int i = 0 ; i < this .blockReplacements .length ; i ++) {
281285 if (!this .blockReplacements [i ].equals (otherBiome .getBlockReplacements ()[i ])) {
0 commit comments