Valhelsia Structures

Valhelsia Structures

21M Downloads

[0.1.3] Big Tree can generate in water, unnaturally.

KKotik opened this issue ยท 6 comments

commented

Some biomes spawn in the middle of water, probably you should have a blacklist for that type of issues.
image

commented

Seems to be working fine after latest update.

commented

@Vaelzan just gonna leave this here. I did make a mistake with the original water checking. The error was that I assumed jigsaw structures centered the start piece on the blockpos you pass in.

They don't. The corner of the start piece is set at the blockpos passed in and the start piece is rotated around that. So if you were doing land/water check in isFeatureChunk method, the check you did there will usually not be where the start piece because it rotated away from there.

Instead, change all your (chunkX << 4) + 7 and such code into chunkX << 4 so we are at the corner of the chunk for ease. Now add this code to your structure which will calculate how much off the start piece is from the center position you want and then apply that offset to all of the structure's pieces so it is truly centered on the passed in blockpos no matter its rotation. That way your checks in isFeatureChunk is now truly centered on the structure and will help reduce and weirdness in placing that you may had seen before.

https://github.com/TelepathicGrunt/StructureTutorialMod/blob/95e03fe7e1e71466a5e6451815e7d11d1d3beaf4/src/main/java/com/telepathicgrunt/structuretutorial/structures/RunDownHouseStructure.java#L236-L246

yeah, my bad lol

commented

That looks like a structure instead of a biome. though, I think a good idea is to just add a simple water check to the structures. Like in isFeatureChunk, the devs can do the water check and return false if there is water to make the game skip that spot for the structure. It'll help make the placements for the structures be cleaner and nicer! I kinda forgot to do with check with my own structures in my main mod so i'm gonna be working on doing the water checks as well lol

Example of what I mean:
https://github.com/TelepathicGrunt/StructureTutorialMod/blob/7da2d04a867c6aa63f70b220b5b487f9318fa6c9/src/main/java/com/telepathicgrunt/structuretutorial/structures/RunDownHouseStructure.java#L134

commented

That looks like a structure instead of a biome. though, I think a good idea is to just add a simple water check to the structures. Like in isFeatureChunk, the devs can do the water check and return false if there is water to make the game skip that spot for the structure. It'll help make the placements for the structures be cleaner and nicer! I kinda forgot to do with check with my own structures in my main mod so i'm gonna be working on doing the water checks as well lol

Example of what I mean:
https://github.com/TelepathicGrunt/StructureTutorialMod/blob/7da2d04a867c6aa63f70b220b5b487f9318fa6c9/src/main/java/com/telepathicgrunt/structuretutorial/structures/RunDownHouseStructure.java#L134

That check is in place in the 0.1.3 release. :) We saw your post on Discord and implemented it soon after, so anybody who has updated shouldn't run into this issue anymore. Thanks for the tip. Some structures are also exempt where appropriate (such as the Witch Hut)..

commented

But..
image

commented

This picture was taken from 0.1.3.