Skip to content

Instantly share code, notes, and snippets.

@red-001
Last active May 3, 2017 21:33
Show Gist options
  • Save red-001/7bf17b9ec5cb1e5b370f50cfc6c69e6f to your computer and use it in GitHub Desktop.
Save red-001/7bf17b9ec5cb1e5b370f50cfc6c69e6f to your computer and use it in GitHub Desktop.
test code for #5255
core.register_chatcommand("test_pr", {
func = function(name, _)
local player = core.get_player_by_name(name)
local pos = player:getpos()
pos = {x = math.floor(pos.x+0.5),y=math.floor(pos.y+0.5),z=math.floor(pos.z+0.5)}
print("pos:" .. dump(pos))
print("test1:" .. dump(minetest.find_node_near(pos, 4, "default:water_source", true)))
print("test2:" .. dump(minetest.find_node_near(pos, 4, "default:water_source", false)))
print("test3:" .. dump(minetest.find_node_near(pos, 4, "default:water_source")))
end,
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment