WorldGen: Difference between revisions

From Vintage Story Wiki
No edit summary
Line 20: Line 20:
The IServerEventAPI has a method called ChunkColumnGeneration that allows you to pass a delegate just like we did for our /treasure command. However, the method signature for this is different.
The IServerEventAPI has a method called ChunkColumnGeneration that allows you to pass a delegate just like we did for our /treasure command. However, the method signature for this is different.
TODO:
TODO:
== Finding where to place the chest ==
TODO
== Excercises ==
A few things could be done to improve this code and it's left as an exercise for the reader. Doing this will help you get familiar with the API without overwhelming you.
<ul>
<li>Make chests a more rare item to find.</li>
<li>Currently the code will place chests over water or air. Change TryGetChestLocation to only place chests over solid blocks.</li>
<li>Chests should have more interesting items. Modify the code to put some more useful things in there. Maybe tools or weapons that can't be crafted.</li>
<li>A harder exercise might be to only place chests in caves.</li>
</ul>