setProperty doesn't actually set any data
LeLobster opened this issue ยท 16 comments
BiomeTweaker-1.12.2-3.1.332
JungleWood = forBlock("minecraft:log")
JungleWood.setProperty("variant", "jungle") # Doesn't work
JungleLeaves = forBlock("minecraft:leaves")
JungleLeaves.setProperty("variant", "jungle") # Doesn't work
JungleLeaves.setProperty("decayable", false) # Doesn't work
lushDesertFoliage = newTreeDecoration()
lushDesertFoliage.set("count", 12)
lushDesertFoliage.set("minHeight", 2)
lushDesertFoliage.set("heightVariation", 1)
lushDesertFoliage.set("mainBlock", JungleWood)
lushDesertFoliage.set("leafBlock", JungleLeaves)
lushDesertFoliage.set("leafHeight", 2)
Results in normal oak logs and leaves.
Interesting, running your script myself gives the desired behavior.
Script:
JungleWood = forBlock("minecraft:log")
JungleWood.setProperty("variant", "jungle") # Doesn't work
JungleLeaves = forBlock("minecraft:leaves")
JungleLeaves.setProperty("variant", "jungle") # Doesn't work
JungleLeaves.setProperty("decayable", false) # Doesn't work
lushDesertFoliage = newTreeDecoration()
lushDesertFoliage.set("count", 12)
lushDesertFoliage.set("minHeight", 2)
lushDesertFoliage.set("heightVariation", 1)
lushDesertFoliage.set("mainBlock", JungleWood)
lushDesertFoliage.set("leafBlock", JungleLeaves)
lushDesertFoliage.set("leafHeight", 2)
all = forAllBiomes()
all.addDecoration(lushDesertFoliage)
Are there any warnings or errors in your log?
No nothing, but I think I have an idea.
Maybe the cluster from #166 was messing with the other cluster. I'll do a quick test with 333
I'm not seeing any jungle log/leaves, just oak.
But having these 2 splotches in the same sand biome causes java.lang.IllegalArgumentException: bound must be positive
grassSplotch = newSplotchDecoration()
grassSplotch.set("mainBlock", "minecraft:grass")
grassSplotch.set("count", 4)
grassSplotch.set("size", 4)
grassSplotch.addBaseBlock("minecraft:sand")
grassSplotch.addBlockToReplace("minecraft:sand")
dirtSplotch = newSplotchDecoration()
dirtSplotch.set("mainBlock", "minecraft:dirt")
dirtSplotch.set("count", 2)
dirtSplotch.set("size", 2)
dirtSplotch.addBaseBlock("minecraft:sand")
dirtSplotch.addBlockToReplace("minecraft:grass")
I'll temp remove the dirt splotch and try again.
Try again with that latest update, not sure why that would be messing that up, but this script is working for me:
Script:
JungleWood = forBlock("minecraft:log")
JungleWood.setProperty("variant", "jungle") # Doesn't work
JungleLeaves = forBlock("minecraft:leaves")
JungleLeaves.setProperty("variant", "jungle") # Doesn't work
JungleLeaves.setProperty("decayable", false) # Doesn't work
lushDesertFoliage = newTreeDecoration()
lushDesertFoliage.set("count", 12)
lushDesertFoliage.set("minHeight", 2)
lushDesertFoliage.set("heightVariation", 1)
lushDesertFoliage.set("mainBlock", JungleWood)
lushDesertFoliage.set("leafBlock", JungleLeaves)
lushDesertFoliage.set("leafHeight", 2)
grassSplotch = newSplotchDecoration()
grassSplotch.set("mainBlock", "minecraft:grass")
grassSplotch.set("count", 4)
grassSplotch.set("size", 4)
grassSplotch.addBaseBlock("minecraft:sand")
grassSplotch.addBlockToReplace("minecraft:sand")
dirtSplotch = newSplotchDecoration()
dirtSplotch.set("mainBlock", "minecraft:dirt")
dirtSplotch.set("count", 2)
dirtSplotch.set("size", 2)
dirtSplotch.addBaseBlock("minecraft:sand")
dirtSplotch.addBlockToReplace("minecraft:grass")
desert = forBiomes("minecraft:desert")
all = forAllBiomesExcept(desert)
all.registerGenBiomeRep(desert)
desert.addDecoration(grassSplotch)
desert.addDecoration(dirtSplotch)
desert.addDecoration(lushDesertFoliage)
Is that script working for you with 333
or the new update?
Notice that the dirtSplotches aren't generating though. My inital idea was to replace parts of the grassSplotch with a water block but minecraft:water
doesn't exist anymore so I was testing with dirt.
I'll test my current script with the new update.
Changing the base block to grass should do what you want... This works for me:
Script:
dirtSplotch = newSplotchDecoration()
dirtSplotch.set("mainBlock", "minecraft:water")
dirtSplotch.set("count", 2)
dirtSplotch.set("size", 2)
dirtSplotch.addBaseBlock("minecraft:grass")
dirtSplotch.addBlockToReplace("minecraft:grass")
Result:
You may also consider adding sand as a block to replace, since you'll get weird cutoffs in your water splotches.
Still seeing only oak, I'll try adding it to vanilla minecraft:desert
instead of my own custom sand biome to see if that works.
I'll also try the water. I assumed it didn't work because /give x minecraft:water
in MC says that block doesn't exist.
Do you have the script in a different order perhaps? I can't really think of any reason it would work for me, but not for you without errors...
I just added it to vanilla desert and I'm still seeing only oak.
different order
It seems like you are doing everything in FINISHED_LOAD
?
I have the script split up over different stages.
Are you setting the block properties at a later stage then when you create the decorations?
I have the biome and block objects (with setProperty) at the top of the script.
edit: Could this be the cause, I use setScriptStage later in the script but not before where I use the setProperty?
Let me just copy your script exactly to my setup and see what that does.
Well, I copied your script from #167 (comment) and that works.
Could the edit in my previous comment be the cause? It would make sense though now that I think about it. It is an actual function and not just an object declaration.
Post your entire script, please. I can't really be sure until I see it all together
Well now I feel like a derp lol.
Adding Tweaker.setScriptStage("PRE_INIT")
at the top fixes it, and it makes perfect sense.
My apologies for wasting your time.
edit: I guess this issue can be closed as well. Thank you for all the quick help and fixes.