goddess mode: detect splash potions, core: new font test
parent
bf674a2f3f
commit
37f85c2e71
|
@ -19,10 +19,9 @@ local function checkbadblocks(pos)
|
|||
end
|
||||
|
||||
|
||||
local function checkarrow()
|
||||
local function checkprojectile()
|
||||
for k, v in ipairs(minetest.localplayer.get_nearby_objects(karange)) do
|
||||
--if ( v:get_item_textures() == "mcl_bows:arrow_box" or v:get_item_textures() == "mcl_potions:harming_2_arrow_box" or v:get_item_textures() == "mcl_potions:harming_arrow_box") thenw
|
||||
if ( v:get_item_textures():sub(-9) == "arrow_box") then
|
||||
if ( v:get_item_textures():sub(-9) == "arrow_box") or ( v:get_item_textures():sub(-7) == "_splash") then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
@ -125,7 +124,7 @@ minetest.register_globalstep(function()
|
|||
if minetest.settings:get_bool("goddess") then
|
||||
local ppos=minetest.localplayer:get_pos()
|
||||
rro()
|
||||
if(checkbadblocks(ppos) or checkarrow()) then evade(ppos) end
|
||||
if(checkbadblocks(ppos) or checkprojectile()) then evade(ppos) end
|
||||
end
|
||||
end)
|
||||
minetest.register_chatcommand("dhf", { description = "", func = dhfree })
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
local function check_tool(stack, node_groups, old_best_time)
|
||||
autotool={}
|
||||
function autotool.check_tool(stack, node_groups, old_best_time)
|
||||
local toolcaps = stack:get_tool_capabilities()
|
||||
if not toolcaps then return end
|
||||
local best_time = old_best_time
|
||||
|
@ -22,9 +23,9 @@ minetest.register_on_punchnode(function(pos, node)
|
|||
local node_groups = minetest.get_node_def(node.name).groups
|
||||
local new_index = player:get_wield_index()
|
||||
local is_better, best_time = false, math.huge
|
||||
is_better, best_time = check_tool(player:get_wielded_item(), node_groups, best_time)
|
||||
is_better, best_time = autotool.check_tool(player:get_wielded_item(), node_groups, best_time)
|
||||
for index, stack in pairs(inventory.main) do
|
||||
is_better, best_time = check_tool(stack, node_groups, best_time)
|
||||
is_better, best_time = autotool.check_tool(stack, node_groups, best_time)
|
||||
if is_better then
|
||||
new_index = index - 1
|
||||
end
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue