goddess mode: detect splash potions, core: new font test

master
cora 2020-10-14 13:30:01 +02:00
parent bf674a2f3f
commit 37f85c2e71
3 changed files with 7 additions and 7 deletions

View File

@ -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 })

View File

@ -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.