Help from Advanced Modders

User avatar
HolyPhoenix
Member
 
Posts: 27
Joined: Sun Mar 31, 2013 18:20

Help from Advanced Modders

by HolyPhoenix » Sun Mar 31, 2013 18:47

For my world I am working on I wanted to create a fairly advanced mod. As it is my first mod, I am naturally having some difficulty understanding how everything should go together and what I should be using. Currently I have setup several commands(that was fairly easy) but writing the functions for them is the rough point. If I can get the first command working then I should be able to get the rest.

I have a command setcitylimits that takes 3 parameters x, y, and z. I want to set an area on the x axis, y axis, and z axis of the area around the current player of the size in parameters in the command where no one can build/dig unless they have the citylimits privilege. My difficulty is figuring out exactly how to set the existing space in the world to be locked to only people with the citylimits privilege. I found a mod called protector that did something similar but I wasn't able to follow it enough to find out how they actually blocked the blocks and whether I liked the method.

I suppose a more direct question would be, is there a way at this point to go through the area around the player who used the command and set some String for each space in the area, that could be like "owner", "playername". If so what would be the best way to do this? Also is it possible to block the z are even if there is not currently a block there? So say area in the sky that has no placed blocks?

Small easy to follow examples would probably work best for me. I don't really need to for loop parts, just the setting of a space to an owner that is say one space away from the player.

Also how would I go about the actual blocking part? I believe I have to somehow override the old "dig" or "place" methods and have it check if the player has the right privilege. If they do then run the old dig method, otherwise just return? Is that correct?

Thanks so much for any help that one can provide in this matter. The mod, if ever finished, will probably be released under the simplified bsd license.

HP
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Mon Apr 01, 2013 01:08

Maybe node_ownership does already what you want.
A list of my mods can be found here.
 

User avatar
HolyPhoenix
Member
 
Posts: 27
Joined: Sun Mar 31, 2013 18:20

by HolyPhoenix » Mon Apr 01, 2013 02:49

That is pretty close and should help me get what I need. Thank you! I cannot believe I didn't see that one in my searches. I guess it is fairly old though.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 8 guests

cron