genWeight not being respected in Deserts
clubpetey opened this issue ยท 10 comments
I'm trying to create a world that is almost all desert. I'm using the following script:
all = forAllBiomes()
all.set("genWeight", 30)
chroma = forBiomes(120,121,122,123,124)
chroma.set("genWeight",15)
all.set("isSpawnBiome", false)
desert = forBiomes(2)
desert.set("isSpawnBiome", true)
desert.set("genWeight", 20000)
The only mods that I have that add biomes is AE2 and ChromatiCraft. I can see in the log the biomes being removed from the spawn list, because I get a warning about it. But every time I create a world, I end up in a Savanna or Forest (usually Rainbow Forest from ChromatiCraft). I NEVER spawn in a Desert and I've run 50+ worldGens. Also there is no deserts to be seen as I travel around the world, it's all forest of one type or another.
Is there something wrong with my script?
Thanks for your help.
MC 1.7.10
Forge 10.13.3.1408
BiomeTweaker 0.9.97
I tried creating my own Biome, but got stuck on this line:
desert = newBiomes(125, "DESERT", 1000)
There doesn't seem to be a command "newBiomes" as shown in the wiki. Does it have a new name?
First, you're going to need build 111 which I just pushed. Still working out all the kinks for the first non-beta.
You're correct in seeing that 'newBiomes' no longer exists. Apparently I forgot to document it, but it has been replaced by '.create'. Here is a quick script I wrote up that imitates a desert and applies your tweaks:
#Specify id. This is the vanilla id for desert, so that this biome will appear in generation instead. Or, choose something else and vanilla deserts will still appear.
desert = forBiomes(2)
#Create the BiomeGenBase instance
desert.create("DESERT", 1000)
#Modify basic fields to match desert
desert.set("color", 16421912)
desert.set("name", "Desert")
desert.set("enableRain", false)
desert.set("temperature", 2.0)
desert.set("humidity", 0.0)
desert.set("height", 0.125)
desert.set("heightVariation", 0.05)
desert.removeAllSpawns("CREATURE")
desert.set("topBlock", "minecraft:sand")
desert.set("fillerBlock", "minecraft:sand")
#We need to apply the last of these changes earlier for them to have an effect
Tweaker.setStage("PRE_INIT")
desert.set("treesPerChunk", -999)
desert.set("deadbushesPerChunk", 2)
desert.set("reedsPerChunk", 50)
desert.set("cactiPerChunk", 10)
Tweaker.setStage("FINISHED_LOAD")
#Apply desired tweaks
all = forAllBiomes()
all.set("genWeight", 30)
chroma = forBiomes(120,121,122,123,124)
chroma.set("genWeight",15)
all.set("isSpawnBiome", false)
desert.set("isSpawnBiome", true)
desert.set("genWeight", 20000)
And the result: I spawned in a desert!
As for your question about oceans, no, not directly. You could, however, register a block replacement (assuming you're using build 111, since it changed since build 97):
allBiomes = forAllBiomes()
allBiomes.registerGenBlockRep("minecraft:water", "minecraft:air")
This will replace all water that is placed during early generation with air. Lakes and other decorations will still appear. This will result in oceans and rivers being dry. (You can also remove lakes through the 'removeDecoration' command if you wish.)
Could you please grab version 109 and provide a full log (including generating a world and quitting Minecraft)?
Full log can be found here: http://pastebin.com/BPZ3iubn
Thanks.
It turns out deserts are actually hard-coded into generation and are not registered in the BiomeManager... It's not possible to edit it's generation weight or it's generation at all with BiomeTweaker, for that matter.
HOWEVER! All is not lost. If there is no other mod that will let you do this, it can be done with BiomeTweaker by adding a totally new biome that imitates the desert. If you want to do this, I can provide you with all of the values you must set. The only difference will be the biome ID, class, and no wells will generate :/
I was able to make an all-desert world with TerrainControl, but it had it's own list of problems. Most notably, messing with the Biome Classes such that Enderman spawned in the Nether. :/
I'm fine with no wells, as long as villages generate, I supposed that means no Desert Temples either tho. Either way, I'd be curious what I need to do to create my own biome.
While you are at it, a question: Is there way with BiomeTweeker to drop "sea level" to around level 10? so that if an Ocean/River spawned it would be dry?
Thanks for the update and the sample. I ran 10 WorldGens, and did spawn in my custom biome 3 times, but still spawned in a lot of forest and hills. Also so a lot of Plains and Forest on the map, with a genWeight of 99999 I should never see any other biome I would think. Or does genWeight have a max that I overflowed or something.
Here's my cfg file based off of your design. In case I messed something else up.
http://pastebin.com/rPy7GACm
One other thing I tried, removing most of the vanilla biomes with a command like this:
vanilla = forBiomes(1,3,4,5,6,10,11,12,13,14,15,17,18,19,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,36)
vanilla.remove()
But that caused a "/ by zero" Exception during worldGen. No idea why tho, I didn't remove ALL the biomes.
The water replacement worked GREAT tho.
Removing too many biomes crashes, yes. See here. You need to ensure there is at least one of each type left in the BiomeManager.
Since we only registered your biome as "DESERT" when Minecraft asks for a "WARM", "COOL", or "ICY" biome, it won't see the desert. You can fix that by, first, grabbing build 112, and then adding these lines:
desert.addToGeneration("WARM", 20000)
desert.addToGeneration("COOL", 20000)
desert.addToGeneration("ICY", 20000)
I also noticed you changed the use of Tweaker.setStage to be incorrect. When using the set command for "xxxPerChunk", you have set the application stage to "INIT" or earlier. I changed it to "PRE_INIT", apply those tweaks, and then change it back to default. See the documentation on the set command.
My script now looks like this, and I couldn't find anything but desert, ocean, beach, and river:
#Specify id.
desert = forBiomes(125)
#Create the BiomeGenBase instance
desert.create("DESERT", 20000)
#Add it to all types so other stuff doesn't appear as often
desert.addToGeneration("WARM", 20000)
desert.addToGeneration("COOL", 20000)
desert.addToGeneration("ICY", 20000)
#Modify basic fields to match desert
desert.set("color", 16421912)
desert.set("name", "Desert")
desert.set("enableRain", false)
desert.set("temperature", 2.0)
desert.set("humidity", 0.0)
desert.set("height", 0.125)
desert.set("heightVariation", 0.05)
desert.removeAllSpawns("CREATURE")
desert.set("topBlock", "minecraft:sand")
desert.set("fillerBlock", "minecraft:sand")
#We need to apply these changes earlier for them to have an effect
Tweaker.setStage("PRE_INIT")
desert.set("treesPerChunk", -999)
desert.set("deadbushesPerChunk", 2)
desert.set("reedsPerChunk", 50)
desert.set("cactiPerChunk", 10)
Tweaker.setStage("FINISHED_LOAD")
#Apply desired tweaks
all = forAllBiomes()
all.set("genWeight", 30)
chroma = forBiomes(120,121,122,123,124)
chroma.set("genWeight",15)
all.set("isSpawnBiome", false)
desert.set("isSpawnBiome", true)
desert.set("genWeight", 20000)
Also, I just realized that with this script, desert will be present with all types, so you should be able to remove everything else from generation entirely.
Actually, with this new command you can actually just use the vanilla desert. Wells and everything will spawn:
#Specify id. This is the vanilla id for desert.
desert = forBiomes(2)
#Add it to all types so other stuff doesn't appear as often
desert.addToGeneration("WARM", 1000)
desert.addToGeneration("COOL", 1000)
desert.addToGeneration("DESERT", 1000)
desert.addToGeneration("ICY", 1000)
#Apply desired tweaks
all = forAllBiomes()
all.set("genWeight", 30)
chroma = forBiomes(120,121,122,123,124)
chroma.set("genWeight",15)
all.set("isSpawnBiome", false)
desert.set("isSpawnBiome", true)
desert.set("genWeight", 20000)
How about that.
THAT IS FANTASTIC! Works perfectly. You are da bomb! Thanks for such a quick response. I'm attaching my final script (minus the ChromatiCraft stuff) to use as an example for you Wiki if you want it. I added DesertHills to the list and changed up the spawn rates in the various biomes. I think this really shows the power of this mod.
Final Script:
http://pastebin.com/fnJiUxUM