diff --git a/newpetting/init.lua b/newpetting/init.lua index 98a1f26..eefc7d5 100644 --- a/newpetting/init.lua +++ b/newpetting/init.lua @@ -8,6 +8,13 @@ local chancer = function(hp,difficulty) return math.floor(1000/hp * hp/(hp*0.4) * difficulty) end +local sethas = function(needle,haystack) + if type(haystack) == "table" then + return haystack[needle] ~= nil + end + return haystack == needle +end + local capturedef = function(def) local handchance = chancer(def.hp,0.2) local netchance = chancer(def.hp,0.5) @@ -40,9 +47,13 @@ end local identification = function(self,clicker) if self.owner and self.owner ~= clicker:get_player_name() then - minetest.chat_send_player(clicker:get_player_name(), - "This is a "..self.name..". It eats: "..getfollows(self.follow) - ) + if not sethas(clicker:get_wielded_item():get_name(),self.follow) then + minetest.chat_send_player(clicker:get_player_name(), + "This is a "..self.name..". It eats: "..getfollows(self.follow) + ) + else + minetest.chat_send_player(clicker:get_player_name(),"Feeding "..self.name.." ...") + end end return true end diff --git a/staffmagic/init.lua b/staffmagic/init.lua index ed61244..08a7f24 100644 --- a/staffmagic/init.lua +++ b/staffmagic/init.lua @@ -285,7 +285,7 @@ minetest.register_tool("staffmagic:staff_sending",{ range = 5, stack_max = 1, on_use = function(itemstack, user, pointed_thing) - if not staffmagic:staffcheck(user,"staffer") then return end + --if not staffmagic:staffcheck(user,"staffer") then return end if pointed_thing.type ~= "node" then if pointed_thing.ref and pointed_thing.ref:is_player() then return end if pointed_thing.type == "object" then @@ -495,7 +495,6 @@ minetest.register_tool("staffmagic:staff_melt", { end, }) -if false then minetest.register_craft( { @@ -508,27 +507,6 @@ minetest.register_craft( } ) -minetest.register_craft( -{ - output = "staffmagic:staff_stack", - recipe = { - {"bucket:bucket_lava","default:diamond","bucket:bucket_lava"}, - {"","default:mese_crystal",""}, - {"","default:mese_crystal",""}, - } -} -) - -minetest.register_craft( -{ - output = "staffmagic:staff_clone", - recipe = { - {"default:mese_crystal","default:diamondblock","default:mese_crystal"}, - {"","default:obsidian_shard",""}, - {"","default:obsidian_shard",""}, - } -} -) minetest.register_craft( { output = "staffmagic:staff_sending", @@ -539,14 +517,3 @@ minetest.register_craft( } } ) -minetest.register_craft( -{ - output = "staffmagic:staff_boom", - recipe = { - {"default:mese","bucket:bucket_lava","default:mese"}, - {"tnt:gunpowder","default:obsidian","tnt:gunpowder"}, - {"tnt:gunpowder","default:obsidian","tnt:gunpowder"}, - } -} -) -end