diff options
author | fairiestoy <johannesvk@web.de> | 2013-09-28 23:34:41 -0700 |
---|---|---|
committer | fairiestoy <johannesvk@web.de> | 2013-09-28 23:34:41 -0700 |
commit | a482167a5118b3cc2f66dccd1688b8b63e8032c0 (patch) | |
tree | 38cbfb20a8a41a2e464e7035fd2787a94c4036a4 | |
parent | 065543f3321218af9f9df7749608876110bf5ab8 (diff) | |
parent | 2f208687d7f56af0056a9b5bb1d24360d1e619df (diff) |
Merge pull request #1 from Bremaweb/master
Update fork
-rw-r--r-- | chatcommands.lua | 17 | ||||
-rw-r--r-- | init.lua | 63 | ||||
-rw-r--r-- | textures/door_blue.png | bin | 0 -> 152 bytes |
3 files changed, 76 insertions, 4 deletions
diff --git a/chatcommands.lua b/chatcommands.lua index d0df825..d452b63 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -15,6 +15,23 @@ minetest.register_chatcommand("landowner", { end, }) +minetest.register_chatcommand("userunclaim", { + params = "player", + privs = {landrush=true}, + description = "Unclaims all of a players areas", + func = function(name, param) + qdone = 0 + for k,v in pairs(claims) do + if claims[k].owner == param then + claims[k] = nil + qdone = qdone + 1 + end + end + landrush.save_claims() + minetest.chat_send_player(name,tostring(qdone).." claims unclaims for "..param) + end +}) + minetest.register_chatcommand("unclaim", { params = "", description = "unclaims the current map chunk", @@ -78,7 +78,7 @@ function landrush.get_chunk(pos) local y = 0 if ( pos.y < -200 ) then - y = -32000 + y = - 32000 elseif ( pos.y < -60 ) then y = -200 elseif ( pos.y < 140 ) then @@ -96,7 +96,9 @@ function landrush.get_chunk_center(pos) local x = math.floor(pos.x/chunkSize)*chunkSize+7.5 local y = 0 - if ( pos.y < -60 ) then + if ( pos.y < -200 ) then + y = - 32000 + elseif ( pos.y < -60 ) then y = -200 elseif ( pos.y < 120 ) then y = -30 @@ -117,6 +119,10 @@ end function landrush.can_interact(name, pos) + if ( pos.y < -200 ) then + return true + end + if ( minetest.check_player_privs(name, {landrush=true}) ) then return true end @@ -300,6 +306,12 @@ landrush.load_claims() on_place = function(itemstack, placer, pointed_thing) owner = landrush.get_owner(pointed_thing.above) player = placer:get_player_name() + + if ( pointed_thing.above.y < -200 ) then + minetest.chat_send_player(player,"You cannot claim below -200") + return itemstack + end + if owner then minetest.chat_send_player(player, "This area is already owned by "..owner) else @@ -389,8 +401,51 @@ end -- End of fix ---landrush.register_claimnode("landclaim", "landrush_landclaim.png") ---landrush.register_claimnode("landclaim_b", "landrush_landclaim.png") +-- create a new type of sign that is not protected by landrush mod +minetest.register_node("landrush:unlocked_sign", { + description = "Unprotected Sign", + drawtype = "signlike", + tiles = {"default_sign_wall.png"}, + inventory_image = "default_sign_wall.png", + wield_image = "default_sign_wall.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "wallmounted", + --wall_top = <default> + --wall_bottom = <default> + --wall_side = <default> + }, + groups = {choppy=2,dig_immediate=2,attached_node=1}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), + on_construct = function(pos) + --local n = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "field[text;;${text}]") + meta:set_string("infotext", "\"\"") + end, + on_receive_fields = function(pos, formname, fields, sender) + local meta = minetest.get_meta(pos) + fields.text = fields.text or "" + print((sender:get_player_name() or "").." wrote \""..fields.text.. + "\" to sign at "..minetest.pos_to_string(pos)) + meta:set_string("text", fields.text) + meta:set_string("infotext", '"'..fields.text..'"') + end, +}) + + +minetest.register_craft({ + output = 'landrush:unlocked_sign 6', + recipe = { + {'default:wood','default:wood','default:wood'}, + {'default:wood','default:wood','landrush:landclaim'}, + {'','default:stick',''} + } +}) minetest.register_entity("landrush:showarea",{ on_activate = function(self, staticdata, dtime_s) diff --git a/textures/door_blue.png b/textures/door_blue.png Binary files differnew file mode 100644 index 0000000..ab3d8aa --- /dev/null +++ b/textures/door_blue.png |