Posts: 11
Threads: 3
Joined: Apr 2014
Thanks: 1
Given 0 thank(s) in 0 post(s)
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)?
Posts: 372
Threads: 29
Joined: Mar 2011
Thanks: 1
Given 21 thank(s) in 18 post(s)
If i recall there is already such a plugin, and used by the gallery server.
Posts: 11
Threads: 3
Joined: Apr 2014
Thanks: 1
Given 0 thank(s) in 0 post(s)
Does the plugin include generating the terrain of a new world into a plots-like thing?
Posts: 11
Threads: 3
Joined: Apr 2014
Thanks: 1
Given 0 thank(s) in 0 post(s)
That doesn't look like it does any of the terrain generation things I mentioned D:
Posts: 372
Threads: 29
Joined: Mar 2011
Thanks: 1
Given 21 thank(s) in 18 post(s)
I was so sure it also generated the terrain.
Posts: 11
Threads: 3
Joined: Apr 2014
Thanks: 1
Given 0 thank(s) in 0 post(s)
Looks like there is a world gen in it, but nothing on how to actually use it to generate a new world D:
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
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.