summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2015-05-06 00:48:38 -0700
committerAuke Kok <auke-jan.h.kok@intel.com>2015-05-06 00:48:38 -0700
commit342fd7881ea77fa59d4311f69c8ba9530e38d35c (patch)
tree9d9c62fae51d1e2a598f85f564f7d08a34ab06b7
parent7d4c89842d523e5360a084352f0d263cde8b9e06 (diff)
Make tops of seedling beans behave like double plants too.
More consistent. You can use the watering can on either top or bottom at any stage. Same for hydrometer.
-rw-r--r--polebean.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/polebean.lua b/polebean.lua
index ddeb307..cd3d055 100644
--- a/polebean.lua
+++ b/polebean.lua
@@ -183,10 +183,15 @@ minetest.register_craftitem("crops:green_bean_seed", {
local under = minetest.get_node(pointed_thing.under)
if under.name == "crops:beanpole_base" then
crops.plant(pointed_thing.under, {name="crops:beanpole_plant_base_1"})
+ local above = { x = pointed_thing.under.x, y = pointed_thing.under.y + 1, z = pointed_thing.under.z}
+ local meta = minetest.get_meta(above)
+ meta:set_int("crops_top_half", 1)
elseif under.name == "crops:beanpole_top" then
local below = { x = pointed_thing.under.x, y = pointed_thing.under.y - 1, z = pointed_thing.under.z }
if minetest.get_node(below).name == "crops:beanpole_base" then
crops.plant(below, {name="crops:beanpole_plant_base_1"})
+ local meta = minetest.get_meta(pointed_thing.under)
+ meta:set_int("crops_top_half", 1)
else
return
end