18.7 C
New York
Wednesday, September 17, 2025

java – SquidSquad – methods to use WildernessGenerator and Biomes


There may be a comparatively easy instance for the WildernessGenerator.

As you possibly can see right here, the category Biome has a static array TABLE that accommodates a pre-configured number of biomes. the sourcecode of class Biome, this seems to be the one technique to acquire an occasion of Biome. Apparently customers of this library are solely supposed to make use of the 66 pre-defined biomes from that desk.

One other attainable answer to make use of customized biomes might be to create your individual class that extends Biome. That might permit you to write a constructor of your individual and move an occasion of that class to the WildernessGenerator. However for those who do this, word that the best way the WildernessGenerator operates is to take a look at the string in biome.identify to resolve what tiles and objects the map can comprise. In case your customized biome has a .identify that’s none of those magical strings it’s on the lookout for, then it can create an empty map.

That implies that if you wish to have a wilderness map with customized tile- and object swimming pools, then you would need to lengthen WildernessGenerator and override the strategies floorsByBiome, pathsByBiome and contentByBiome to deal with your customized biome identify(s), as a result of that is the place these settings per biome-name dwell. And if you’d like customized tiles/content material, then defaultViewer as nicely. Or you should utilize the ultra-long constructor public WildernessGenerator(int width, int top, Biome biome, EnhancedRandom rng, ObjectList floorTypes, ObjectList contentTypes, ObjectLongMap viewer) that lets you inject all of those. In that case, the biome turns into comparatively irrelevant.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles