Open ph3rr3t opened 5 years ago
@ph3rr3t Do you want to be able to set a chance of this being replaced or anything?
@pacas00 YES
Adding to OP.
Alright, I've updated the example entry with what i feel is a cleaner set of names.
Quite likely, this will get run after the built in mod ore gen code.
If all goes well and today/tomorrows heat wave doesn't put me out of action, should be working on this on thursday.
What is the purpose of the [ReplacementValue] line?
To allow a value to be set on the replacement block,
For paintable or colourised blocks, it's the colour. For anything with a ValueEntry, then a specific key to use. (or number if your using vanilla cubes)
Edited the comment in the OP to reflect that keys are supported
Would that work with an ore block's value too?
Yes, but there is a terrain generator for mod ores already in the game
Though in saying so, if you wanted an ore, but random low chance single blocks and not veins, this would work for that.
You're the coder so you get to pick the tags, but I had a thought;
[BlockReplaceEntry]
[OldKey]DeepRock[/OldKey]
[NewKey]CustomKey[/NewKey]
[NewValue]0[/NewValue] <!--Optional, Defaults to default value. Useful for block color or ore density.-->
<!--Have code lookup value if ValueEntry Key is used.-->
[NewChance]25[/NewChance] <!-- Optional, 0-100 -->
[MinDepth]-1000[/MinDepth]
[MaxDepth]-2000[/MaxDepth]
[/BlockReplaceEntry]
Please don't close this, Unless you no longer want it. Otherwise i'll forget it.
Generally speaking, I like the name of something to be a good reminder of what something is for. In saying so, I've made some adjustments to the names and will explain my reasoning. Because you never know, you might have a better name than me afterwards.
<TerrainGenerationBlockReplacementEntry> <!-- Entry represents a block replacement during terrain generation -->
<TargetKey>DeepRock</TargetKey> <!-- The key targeted during generation -->
<ReplacementKey>NewRockOrStone</ReplacementKey> <!-- The key we replace it with during " -->
<ReplacementValue>0</ReplacementValue> <!-- The value we " -->
<ReplacementChance>25</ReplacementChance> <!-- The chance that we replace it -->
<MinDepth>-1000</MinDepth> <!-- Maybe these should be renamed MinReplacementDepth or something, idk -->
<MaxDepth>-2000</MaxDepth>
</TerrainGenerationBlockReplacementEntry>
If I closed it then I don't know how I did it. Thought you had done so. As for the tags, lets just go with the ones you put in OP.
Bumping this forward to v1.2, Everything below here is notes so i know where to write the implementation of this.
Todo
PerlinCache cache stores the cubes? arrays are [16,16,16] maCubes and maCubeValues
Possible addition, the ability to set just min/max depth, without target key or chance.
So, basically ore gen? Why not just use ore gen for that?
Or do you mean like biome layers?
Kinda as biome layers. Currently flatland only affects the surface. This would allow us to modify everything below ground as well.
So many neat things I could do with a feature like this. Sample code below, might be a few other parameters that could be added that I've not thought of;