Terrain Generation from Lua, among other things.
#1
I'm thinking of writing my own plots plugin. In my plugin, I want to write my own terrain generator that basically makes a grid like layout for the plots, with something like a 10x10 thing in the center, isles between the plots that are 5 blocks wide, and plots that are 2x2 chunks (32x32). Is this possible to do from lua? If not, what would I need to do to get it to do this?

My second question is how would I detect if a player is right clicking a sign? Is it the OnPlayerRightClickingEntity hook? (not sure if i make my own function w/ that name of if I use cPluginManager:AddHook to get it, this is my first plugin)

Lastly, how would I keep things like creepers or endermen from destroying the terrain (kind of like the mob griefing gamerule in vanilla/spigot/etc)?
Reply
Thanks given by:
#2
If i recall there is already such a plugin, and used by the gallery server.
Reply
Thanks given by:
#3
Does the plugin include generating the terrain of a new world into a plots-like thing?
Reply
Thanks given by:
#4
Read about it here https://forum.cuberite.org/showthread.php?tid=1306
Reply
Thanks given by:
#5
That doesn't look like it does any of the terrain generation things I mentioned D:
Reply
Thanks given by:
#6
I was so sure it also generated the terrain.
Reply
Thanks given by:
#7
Looks like there is a world gen in it, but nothing on how to actually use it to generate a new world D:
Reply
Thanks given by:
#8
The Gallery plugin doesn't do much generating on its own. For each Gallery it takes an input Schematic file and just uses that for both the plot and the walkway; it also defines the half-width of the walkway. This is all it needs to do (and it should be what you should be doing in your plugin - have a Schematic (possibly separate ones for the plot, for the walkways in between and the crossings) and paste that into chunks being generated, and also upon claiming a plot (just to be sure).

A sign is a block like any other, so the OnPlayerUsingBlock() should suffice. I'm not 100% sure about this one, though, you may find that you need to use the OnPlayerRightClick, which is called for each and every right-click.

Explosions cannot currently separate the terrain damage from the entity damage, so you can either disable the entire explosion (the Gallery plugin does that as well, OnExploding hook) or let it have its full effect.
Reply
Thanks given by:




Users browsing this thread: 6 Guest(s)