[BUG] World/Ore Generation TYPE Plate Seems Broken
shawnbyday opened this issue ยท 1 comments
Describe the bug
I was recently starting to put together a configuration for a pack I'm designing and like normal I started with ore generation and I'm not personally a fan of spherical veins so I switched to the plate type. The only veins that are spawning in my world with the plate type generator are: copper tin vein (chalcopyrite, cassiterite, zeolite and realgar), copper vein (chalcopyrite, pyrite, iron, copper) and galena vein (galena, lead, silver). The rest of the veins do not generate at all.
I spent several hours analyzing the wiki from GTCE and my JSON files to make sure I didn't have an error and posted those files on Discord to see if anyone else knew anything. They said it was a configuration that was probably just broken. I've included the same examples of ore generation JSONs here that I posted in Discord just for even more scrutiny (converted to .txt files for compatibility here):
iron_vein.txt
galena_vein.txt
copper_vein.txt
copper_tin_vein.txt
Versions
Forge: 14.23.5.2860 (1.12.2)
GTCEu: gregtech-1.12.2-2.2.3-beta
Modpack: Custom Design, N/A
Addons: N/A or can provide the list if necessary (216 O.O)
Setup
Does this issue happen on Singleplayer, a Server, or both: Singleplayer, have not built server yet.
Does this issue happen on a newly generated world: Yes
Steps To Reproduce
- I modified the GregTech Ore Generation files to what I linked above.
- As stated in the description above as well, I only had 3 ore veins generating.
Expected behavior
I would expect all ore veins to generate just like the copper tin, copper and galena veins did.
Screenshots
I've attached JSON files (converted to text) to show the configurations. I can provide a block cleared world picture as well showing what I see too if this is something you'd like to see.
Additional context
I did try to peruse the source code here to see if I noticed anything blatantly obvious in the ore generation algorithms, but modding world generation has never been my strong suit.
The issue with the Iron Plate vein not generating can be solved by raising the maximum height of the vein, or by decreasing the maximum depth value.
For the Plate vein type, the vein generates out from a central point in a plate formation for 2 * length and 2 * height blocks (basically length
in one direction and length
in the other direction from the central point, and same for height)
The maximum size of the vein (possible, in code) is determined by 2 * max(maxLength, maxDepth) for the X and Z directions, and 2 * maxDepth for the Y direction. This is to account for the fact that the plate can be angled when it generates in world.
Taking this knowledge, we can go to CachedGridEntry#doGenerateVein
, where for the iron vein provided, the topHeightOffset
value is calculated to be 52 blocks.
Using this value, the maximum height that the vein can generate at is calculated to be Y = -12 due to this section of code, currentOreVein.getHeightLimit()[1] - topHeightOffset
.
This obviously fails the following check for if the maximum height is greater than the minimum height (which is 10), and so the vein does not generate.
Therefore, this vein has to be adjusted so that the maximum generation height is greater than the minimum generation height, which can be done through either increasing the maximum height that the vein can generate at, or by reducing the maximum depth value.
Essentially, you want maxHeightLimit - (maxDepth + 4) > minDepth
(plate vein type specific), so play around with those numbers, and see if it then generates.