From 3ea4880eb8f7fec8d31f132f1d121e093deadf7e Mon Sep 17 00:00:00 2001 From: LeMagnesium Date: Thu, 23 Apr 2015 18:04:58 +0200 Subject: [PATCH] Added base of runes mod - Added rune API's first implementation - Added basic cubic runes in solarmana --- mods/runes/api.lua | 2 ++ mods/runes/handlers.lua | 13 +++++++++++++ mods/runes/registration.lua | 4 ++++ 3 files changed, 19 insertions(+) diff --git a/mods/runes/api.lua b/mods/runes/api.lua index c689feb6..4b9e5284 100644 --- a/mods/runes/api.lua +++ b/mods/runes/api.lua @@ -161,6 +161,8 @@ runes.functions.connect = function(itemname, callback, handler) runes.datas.handlers[itemname].on_punch = handler else minetest.log("error","[runes] Cannot connect handler to item's " .. itemname .. " unknown " .. callback .. " callback") + else + minetest.log("error","[runes] Cannot connect handler at " .. handler .. " to item's " .. itemname .. " unknown " .. callback .. " callback") return end end diff --git a/mods/runes/handlers.lua b/mods/runes/handlers.lua index aa25c18e..541285b0 100644 --- a/mods/runes/handlers.lua +++ b/mods/runes/handlers.lua @@ -5,7 +5,10 @@ projection = function(itemstack, user, pointed_thing) if pointed_thing.type == "object" then local dir = vector.direction(user:getpos(),pointed_thing.ref:getpos()) +<<<<<<< HEAD local v = pointed_thing.ref:getvelocity() or {x=0,y=0,z=0} +======= +>>>>>>> Added base of runes mod local ykb = 10 if v.y ~= 0 then ykb = 0 end pointed_thing.ref:setvelocity({x=dir.x*50,y=ykb,z=dir.z*50}) @@ -36,6 +39,10 @@ end is_owner_online = function(pos) local meta = minetest.get_meta(pos) +<<<<<<< HEAD +======= + print(meta:get_string("owner")) +>>>>>>> Added base of runes mod if meta:get_string("owner") ~= nil then return minetest.get_player_by_name(meta:get_string("owner")) ~= nil else @@ -49,6 +56,7 @@ go_to_me = function(pos, node, digger) end end +<<<<<<< HEAD set_manamax = function(itemstack, user, pointed_thing) if user and user:is_player() then mana.set(user:get_player_name(),mana.getmax(user:get_player_name())) @@ -63,6 +71,8 @@ set_manamax = function(itemstack, user, pointed_thing) end end +======= +>>>>>>> Added base of runes mod -- Then, connect runes.functions.connect("project","use",projection) @@ -71,6 +81,7 @@ runes.functions.connect("earthquake","use",earthquake) runes.functions.connect("gotome","place",add_owner) runes.functions.connect("gotome","dig",go_to_me) runes.functions.connect("gotome","can_dig",is_owner_online) +<<<<<<< HEAD runes.functions.connect("megamana","use",set_manamax) -- And globalsteps @@ -100,3 +111,5 @@ minetest.register_globalstep(function(dtime) end end end) +======= +>>>>>>> Added base of runes mod diff --git a/mods/runes/registration.lua b/mods/runes/registration.lua index a7f851c2..5d40c03b 100644 --- a/mods/runes/registration.lua +++ b/mods/runes/registration.lua @@ -38,6 +38,7 @@ runes.datas.items = { description = "Go to me rune", img = "default_wood.png", type = "cube" +<<<<<<< HEAD }, ["megamana"] = { description = "Mega Mana", @@ -49,6 +50,9 @@ runes.datas.items = { img = "default_grass.png", type = "plate" }, +======= + } +>>>>>>> Added base of runes mod } for key, value in pairs(runes.datas.items) do