summaryrefslogtreecommitdiff
path: root/fishing.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2016-01-21 14:59:28 +0000
committerTenPlus1 <kinsellaja@yahoo.com>2016-01-21 14:59:28 +0000
commit87031b60518731f62dbce0ffb1601b0c34d506c9 (patch)
tree707258c7ca090302fbbc7114966d551c849881da /fishing.lua
parentbd0fae584c0b0c3a04d41608acb4dfaf77554d91 (diff)
Optimize code, allfaces leaves by default, leaves walkable by default
Diffstat (limited to 'fishing.lua')
-rw-r--r--fishing.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/fishing.lua b/fishing.lua
index c8d1cbf..dbcf205 100644
--- a/fishing.lua
+++ b/fishing.lua
@@ -87,10 +87,11 @@ minetest.register_craftitem("ethereal:fishing_rod_baited", {
liquids_pointable = true,
on_use = function (itemstack, user, pointed_thing)
- if pointed_thing.type ~= "node" then return end
+ if pointed_thing.type ~= "node" then
+ return
+ end
- local node = minetest.get_node_or_nil(pointed_thing.under)
- if node then node = node.name else return end
+ local node = minetest.get_node(pointed_thing.under).name
if (node == "default:water_source"
or node == "default:river_water_source")
@@ -100,7 +101,9 @@ minetest.register_craftitem("ethereal:fishing_rod_baited", {
local inv = user:get_inventory()
if inv:room_for_item("main", {name = type}) then
+
inv:add_item("main", {name = type})
+
return {name = "ethereal:fishing_rod"}
else
minetest.chat_send_player(user:get_player_name(),