BiomeTweaker

BiomeTweaker

13M Downloads

Spawns not happening on server, replace blocks intermittent, water and cave creatures not working

AechtRob opened this issue ยท 7 comments

commented

BiomeTweaker-1.12.2 3.2.354
Forge 14.23.5.2847 (MC 1.12.2)

  • A set of .addSpawn in various biomes runs perfectly in singleplayer and the creatures spawn as needed. When the same config is placed on a server installation, none of the BiomeTweaker added spawns happen.

  • Config specifying a creature as "ambient" or "water_creature" does not restrict it to caves or water, and also ignores its spawn density parameter. The mob instead spawns at unlimited density everywhere on the surface until the installation crashes.

  • Replacing decoration blocks (grass, leaves, log, wood, flower, mushroom, etc.) using myBiome.registerGenBlockRep(oldBlock, newBlock) does not replace 100% of the old blocks with the new ones. It seems quite random how much gets replaced.

Thanks

commented

BiomeTweaker for MC is now EOL, so I will not be addressing bugs that are related to BT - MC interactions. If this bug persists in BiomeTweaker for MC 1.18, please submit a new issue.

commented

Hi - each issue, and config/feedback/info is below :)

A set of .addSpawn in various biomes runs perfectly in singleplayer and the creatures spawn as needed. When the same config is placed on a server installation, none of the BiomeTweaker added spawns happen.

allBiomes=forAllBiomes()
allBiomes.registerGenBiomeRep("minecraft:taiga")
allBiomes.addSpawn("minecraft:zombie_horse", "CREATURE", 100, 5, 10)

Result: in a single-player normal game there are zombie horses everywhere, as expected. If you launch it on a multiplayer server, there are zero (or at least incredibly few) zombie horses.

Config specifying a creature as "ambient" or "water_creature" does not restrict it to caves or water, and also ignores its spawn density parameter. The mob instead spawns at unlimited density everywhere on the surface until the installation crashes.

I've worked this out: the classification "WATER_CREATURE" or "AMBIENT" has nothing to do with mob spawn conditions like water or cave or surface (which is what I expected it might be able to control). It is just a rather arbitrary group used by the game engine to keep track of caps and spawn weights, all done per group. Assigning to one of those two groups will tend to increase the spawning as there are probably far fewer mobs already spawned from these two categories than in the MONSTER and CREATURE ones. A bat will still only spawn in a cave, not in the outside, a squid only in water, and a horse only on land, no matter what classification you give them here.

It think it means that BiomeTweaker is also subject to the mob's underlying spawn rules: if a zombie can only spawn in the dark, then that stays the case when added to a biome. If a squid can only spawn in water, then adding it as a "CREATURE" in a desert will not cause it to spawn on land; if a bat can only spawn in caves, then adding to BiomeTweaker won't spawn it on the surface, etc., etc. This is all fine, but I was hoping to be able to force spawns with BiomeTweaker by just adding them to a Biome, and do things like get surface creatures to spawn in caves, bats in the sun, and non-water creatures to appear in water. For now, I've moved to some specific spawn-control mods for it.

Replacing decoration blocks (grass, leaves, log, wood, flower, mushroom, etc.) using myBiome.registerGenBlockRep(oldBlock, newBlock) does not replace 100% of the old blocks with the new ones. It seems quite random how much gets replaced.

I don't really understand the Wiki, which says this:

With vanilla generation, the only blocks present are stone and water (lava in the nether, endstone in the end).

But then goes onto say that you can set the stage to later (POST_POPULATE) to be able to replace decorations to. This is supposed to swap out spruce logs for birch wood, but it just throws an error in the game log. Script to replace logs with dirt, as a trial:

allBiomes=forAllBiomes()
allBiomes.registerGenBiomeRep("minecraft:taiga")
Tweaker.setPlacementStage("POST_POPULATE")
oldRep = newBlockReplacement()
newRep = newBlockReplacement()
oldLogBlock=forBlock("minecraft:log")
oldRep.set("block",oldLogBlock)
newLogBlock=forBlock("minecraft:dirt")
newRep.set("block",newLogBlock)
allBiomes.registerGenBlockRep(oldRep,newRep)

Error:
[11:51:00] [Client thread/ERROR] [SuperScript]: Failed to parse arguments for command registerGenBlockRep(oldRep,newRep) @ ScriptContext(scriptName=masterConfig.cfg, lineNumber=10). Reason: No constructors found with matching arguments.

commented

These are very general observations that are going to be hard for me to track down. I need example scripts and setups that make each of these happen.

commented

I'll look into the first issue, and the third is an error on your part. The registerGenBlockRep command takes a block as its first argument, not a block replacement. Your replacement is also very simple, so you only need to pass the blocks. Try this instead:

allBiomes=forAllBiomes()
allBiomes.registerGenBiomeRep("minecraft:taiga")
Tweaker.setPlacementStage("POST_POPULATE")
allBiomes.registerGenBlockRep("minecraft:log", "minecraft:dirt")
commented

OK - unfortunately the example you gave at the end doesn't make any replacements when I tried it. I think it's because spruce logs in the taiga biome carry variant data in MC 1.12? It's very hard to know how to define variant data. Can BiomeTweaker accept a meta value as an integer, or only the text descriptions? The Wiki example "andesite.setProperty("variant", "andesite")" looks like it requires the text as well as knowing that the thing is even called a "variant". I don't know what logs types are called in 1.12.2, but do know the meta integers. Is there any chance of supporting the syntax like this?
andesite = forBlock("minecraft:stone:6")

instead of this:
andesite = forBlock("minecraft:stone")
andesite.setProperty("variant", "andesite")

I think my problems with this have been with specifying this metadata with the objects to replace. In a modded pack I have many different variants of many blocks and decorations and there is no easy way for me to know how to refer to them in terms of text strings, only in terms of the metadata integers. So what happens is that only the "default"/0 metadata objects get processed by BiomeTweaker, leaving the other variants untouched.

Btw, I checked, and this does work, though, I think as no variants are involved and the replacement saplings are all defaulting to oak:
allBiomes=forAllBiomes()
allBiomes.registerGenBiomeRep("minecraft:taiga")
Tweaker.setPlacementStage("POST_POPULATE")
newRep = newBlockReplacement()
newSapling=forBlock("minecraft:sapling")
newSapling.setProperty("stage",1)
newRep.set("block",newSapling)
allBiomes.registerGenBlockRep("minecraft:brown_mushroom",newRep)

Is this the best way to get "foreign" or modded trees to generate in a biome? I couldn't find a way to generate finished trees directly.

Sorry for extensive post.....

commented

BiomeTweaker does not accept metadata values because they are magic numbers that may change and should not be exposed to the end-user. You can find resource location and property information in-game through the F3 debug menu (on the bottom right). For saplings, the property key is type and the value for spruce is spruce (oak is oak). I obtained these by simply placing a spruce sapling down in a test world and looking at it.

In the case that you don't care about metadata for a replacement, you'll want to create your replacement and set the ignoreMeta flag detailed here:

allBiomes=forAllBiomes()
allBiomes.registerGenBiomeRep("minecraft:taiga")
Tweaker.setPlacementStage("POST_DECORATE")
newRep = newBlockReplacement()
newRep.set("block","minecraft:dirt")
newRep.set("ignoreMeta", true)
allBiomes.registerGenBlockRep("minecraft:log",newRep)

Generating modded trees wherever you want is a bit tricky, so mods light COFHWorld might be able to do it.

commented

Thanks for all this useful thread! Can you tell me whether it is possible to replace a single block with a two or three block structure? Eg. replace grass with a 3-block high plant from a mod (each block having different variants like "bottom" "middle" and "top").