diff --git a/changelog.txt b/changelog.txt index 9834fbc..88242ab 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ 4-11-15: -Spigots are working!!! They can only be placed on tree trunks, and need a bucket to collect sap. Right now you just have the infotexts to give you statuses. Placing a bucket in the spigot will trigger a timer that will replace the empty bucket with a sap filled bucket. Cook the sap filled bucket to get sugar. Collection and cooking times will probably be tweaked yet. I want to add a graphic to the spigot that shows whether the bucket is placed and is empty or full, but I don't know if I can do that without creating three nodes. +Spigots are working!!! They can only be placed on tree trunks, and need a bucket to collect sap. Right now you just have the infotexts to give you statuses. Placing a bucket in the spigot will trigger a timer that will replace the empty bucket with a sap filled bucket. Cook the sap filled bucket to get sugar. Collection and cooking times will probably be tweaked yet. I want to add a graphic to the spigot that shows whether the bucket is placed and is empty or full, but I don't know if I can do that without creating three nodes. Updated the spigot model and texture. +Crafting recipe is +c +cs +c s where c is clay and s is group stick 4-9-15: Spigots now only place on tree trunks, though they have to be on the ground, not one node above the ground, not sure why... diff --git a/crafting.lua b/crafting.lua index 149ec65..b217b73 100644 --- a/crafting.lua +++ b/crafting.lua @@ -82,14 +82,32 @@ minetest.register_craft({ } }) ---[[minetest.register_craft({ +minetest.register_craft({ output = 'survival:spigot 1', recipe = { - {'', '', ''}, - {'', '', ''}, - {'', '', ''} + {'default:clay', '', ''}, + {'default:clay', 'group:stick', ''}, + {'default:clay', '', 'group:stick'} } -})]] +}) + +minetest.register_craft({ + output = 'survival:well_bottom 1', + recipe = { + {'default:cobble', 'default:cobble', 'default:cobble'}, + {'default:cobble', 'farming:cotton', 'default:cobble'}, + {'default:cobble', 'default:cobble', 'default:cobble'}, + } +}) + +minetest.register_craft({ + output = 'survival:well_top 1', + recipe = { + {'', 'group:wood', ''}, + {'group:wood', 'farming:cotton', 'group:wood'}, + {'group:stick', 'farming:cotton', 'group:stick'}, + } +}) minetest.register_craft({ type = 'cooking', diff --git a/craftitem.lua b/craftitem.lua index 4c4f113..ea79fd8 100644 --- a/craftitem.lua +++ b/craftitem.lua @@ -2,6 +2,7 @@ minetest.register_craftitem('survival:shell', { description = 'old shell', inventory_image = 'survival_shell.png', }) + minetest.register_craftitem('survival:bucket_sap', { description = 'bucket with sap', inventory_image = 'survival_bucket_sap.png', diff --git a/functions.lua b/functions.lua new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/functions.lua @@ -0,0 +1 @@ + diff --git a/init.lua b/init.lua index 2c05392..2737305 100644 --- a/init.lua +++ b/init.lua @@ -6,3 +6,4 @@ dofile(minetest.get_modpath('survival')..'/tools.lua') dofile(minetest.get_modpath('survival')..'/foods.lua') dofile(minetest.get_modpath('survival')..'/abms.lua') dofile(minetest.get_modpath('survival')..'/craftitem.lua') +dofile(minetest.get_modpath('survival')..'/functions.lua') diff --git a/models/spigot.obj b/models/spigot.obj index 2852673..f8c3be2 100644 --- a/models/spigot.obj +++ b/models/spigot.obj @@ -1,114 +1,92 @@ # Blender v2.74 (sub 4) OBJ File: '' # www.blender.org -o Cube.001 -v 0.307936 0.455513 0.501121 +v 0.000000 0.110653 0.060066 +v 0.000000 0.237622 0.441510 +v 0.035355 0.096758 0.064691 +v 0.035355 0.223727 0.446135 +v 0.050000 0.063212 0.075858 +v 0.050000 0.190181 0.457301 +v 0.035355 0.029667 0.087024 +v 0.035355 0.156635 0.468467 +v -0.000000 0.015772 0.091649 +v -0.000000 0.142740 0.473092 +v -0.035355 0.029667 0.087024 +v -0.035355 0.156635 0.468467 +v -0.050000 0.063212 0.075858 +v -0.050000 0.190181 0.457301 +v -0.035355 0.096758 0.064691 +v -0.035355 0.223727 0.446135 +v -0.000000 0.097173 0.064553 +v 0.025309 0.087226 0.067864 +v 0.035792 0.063212 0.075858 +v 0.025309 0.039199 0.083851 +v -0.000000 0.029252 0.087162 +v -0.025309 0.039199 0.083851 +v -0.035792 0.063212 0.075858 +v -0.025309 0.087226 0.067864 v -0.308226 0.455513 0.501121 +v -0.258129 0.405416 0.407224 +v -0.258129 -0.110552 0.407224 v -0.308226 -0.160649 0.501121 +v 0.257839 -0.110552 0.407225 +v 0.257839 0.405416 0.407225 +v 0.307936 0.455513 0.501121 v 0.307936 -0.160649 0.501121 -v -0.308226 0.455513 0.407224 -v -0.308226 -0.160649 0.407224 -v 0.307936 -0.160649 0.407225 -v -0.048586 0.098990 0.407224 -v 0.048297 0.098990 0.407224 -v 0.307936 0.455513 0.407225 -v 0.048297 0.004616 0.163012 -v -0.048586 0.004616 0.163012 -v -0.048586 -0.023105 0.045603 -v 0.048297 -0.023105 0.045603 -v 0.048297 0.195874 0.407224 -v -0.048586 0.195874 0.407224 -v -0.048586 0.073778 0.045603 -v 0.048297 0.073778 0.045603 -v 0.048297 0.101499 0.163012 -v -0.048586 0.101499 0.163012 -v -0.048586 0.016122 0.211746 -v -0.048586 0.164411 0.206822 -v 0.048297 0.164411 0.206822 -v 0.048297 0.016122 0.211746 -v 0.048297 0.040105 0.289449 -v -0.048586 0.040105 0.289449 -v 0.048297 0.131006 0.255931 -v -0.048586 0.131006 0.255931 -vt 0.681152 0.000000 -vt 0.765129 0.000000 -vt 0.765129 0.618256 -vt 0.681152 0.618256 -vt 0.551066 0.618256 -vt 0.000000 0.618256 -vt 0.232210 0.357734 -vt 0.318857 0.357734 -vt 0.849105 0.618256 -vt 0.849105 0.000000 -vt 0.930565 0.000000 -vt 0.930565 0.618256 -vt 1.000000 0.000000 -vt 1.000000 0.618256 -vt 0.000000 0.878964 -vt 0.086648 0.878964 -vt 0.086648 1.000000 -vt 0.000000 1.000000 -vt 0.551066 0.000000 -vt 0.318857 0.260521 +vt 1.000000 0.312500 +vt 0.000000 0.187500 vt 0.000000 0.000000 -vt 0.232210 0.260521 -vt 0.173295 0.618256 -vt 0.259943 0.618256 -vt 0.259943 0.715468 -vt 0.173295 0.715468 -vt 0.596823 0.663874 -vt 0.681152 0.686212 -vt 0.681152 0.807259 -vt 0.596823 0.784921 -vt 0.332820 0.618256 -vt 0.332820 0.715468 -vt 0.681152 0.121047 -vt 0.596823 0.143385 -vt 0.596823 0.022338 -vt 0.681152 0.171291 -vt 0.551066 0.200673 -vt 0.389086 0.618256 -vt 0.389086 0.715468 -vt 0.551066 0.606586 -vt 0.681152 0.635968 -vt 0.000000 0.828725 -vt 0.086648 0.828725 -vt 0.000000 0.747247 -vt 0.086648 0.747247 -vt 0.590236 0.566331 -vt 0.676245 0.554557 -vt 0.086648 0.707166 -vt 0.173295 0.707166 -vt 0.173295 0.766762 -vt 0.086648 0.766762 -vt 0.676245 0.252702 -vt 0.590236 0.240928 -vt 0.649194 0.381291 -vt 0.564865 0.403630 -vt 0.086648 0.618256 -vt 0.649194 0.425968 +vt 1.000000 0.187500 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.812500 +vt 0.000000 0.812500 +vt 1.000000 0.687500 +vt 0.000000 0.687500 +vt 0.000000 0.500000 +vt 1.000000 0.500000 +vt 0.000000 0.312500 +vt 0.023438 0.000000 +vt 0.171875 0.156250 +vt 0.171875 0.824219 +vt 0.828125 0.175781 +vt 0.976562 1.000000 +vt 0.828125 0.843750 +vn 0.382700 0.876600 -0.291800 +vn 0.923900 0.363100 -0.120900 +vn 0.923900 -0.363100 0.120900 +vn 0.382700 -0.876600 0.291800 +vn -0.382700 -0.876600 0.291800 +vn -0.923900 -0.363100 0.120900 +vn -0.382700 0.876600 -0.291800 +vn -0.923900 0.363100 -0.120900 +vn 0.000000 -0.315800 -0.948800 +vn -0.882300 0.000000 -0.470700 +vn 0.882300 0.000000 -0.470700 +vn 0.000000 -0.882300 -0.470700 +vn 0.000000 0.882300 -0.470700 +vn 0.000000 0.000000 -1.000000 +g Cylinder_Cylinder_Spigot s off -f 2/1 5/2 6/3 3/4 -f 7/5 6/6 8/7 9/8 -f 10/9 1/3 4/2 7/10 -f 4/11 3/12 6/9 7/10 -f 10/12 5/11 2/13 1/14 -f 11/15 12/16 13/17 14/18 -f 10/19 7/5 9/8 15/20 -f 5/21 10/19 15/20 16/22 -f 6/6 5/21 16/22 8/7 -f 17/23 18/24 14/25 13/26 -f 19/27 11/28 14/29 18/30 -f 20/25 19/24 18/31 17/32 -f 12/33 20/34 17/35 13/1 -f 21/36 22/37 20/34 12/33 -f 22/32 23/31 19/38 20/39 -f 23/40 24/41 11/28 19/27 -f 24/42 21/43 12/16 11/15 -f 25/44 26/45 21/43 24/42 -f 27/46 25/47 24/41 23/40 -f 28/48 27/49 23/50 22/51 -f 26/52 28/53 22/37 21/36 -f 8/54 16/55 28/53 26/52 -f 16/56 15/23 27/49 28/48 -f 15/55 9/57 25/47 27/46 -f 9/6 8/56 26/45 25/44 +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/4/2 4/3/2 6/3/2 5/5/2 +f 5/6/3 6/7/3 8/7/3 7/8/3 +f 7/8/4 8/7/4 10/9/4 9/10/4 +f 9/10/5 10/9/5 12/11/5 11/10/5 +f 11/10/6 12/11/6 14/12/6 13/13/6 +f 15/1/7 16/14/7 2/2/7 1/1/7 +f 13/13/8 14/12/8 16/14/8 15/1/8 +f 15/1/9 1/1/9 17/1/9 24/1/9 +f 1/1/9 3/4/9 18/4/9 17/1/9 +f 5/6/9 7/8/9 20/8/9 19/8/9 +f 11/10/9 13/13/9 23/13/9 22/10/9 +f 7/8/9 9/10/9 21/10/9 20/8/9 +f 13/13/9 15/1/9 24/1/9 23/13/9 +f 3/4/9 5/5/9 19/5/9 18/4/9 +f 9/10/9 11/10/9 22/10/9 21/10/9 +g Cylinder_Cylinder_Plaque +f 25/15/10 26/16/10 27/17/10 28/7/10 +f 30/18/11 31/5/11 32/19/11 29/20/11 +f 32/19/12 28/7/12 27/17/12 29/20/12 +f 30/18/13 26/16/13 25/15/13 31/5/13 +f 30/18/14 29/20/14 27/17/14 26/16/14 diff --git a/models/survival_well_bottom.obj b/models/survival_well_bottom.obj new file mode 100644 index 0000000..07007fb --- /dev/null +++ b/models/survival_well_bottom.obj @@ -0,0 +1,125 @@ +# Blender v2.74 (sub 4) OBJ File: '' +# www.blender.org +o Circle_Circle.001 +v 0.000000 0.283161 -0.634972 +v -0.448993 0.283161 -0.448993 +v -0.634972 0.283161 0.000000 +v -0.448993 0.283161 0.448993 +v 0.000000 0.283161 0.634972 +v 0.448993 0.283161 0.448993 +v 0.634972 0.283161 -0.000000 +v 0.448993 0.283161 -0.448993 +v 0.000000 0.283161 -0.468916 +v -0.331573 0.283161 -0.331573 +v -0.468916 0.283161 0.000000 +v -0.331573 0.283161 0.331573 +v 0.000000 0.283161 0.468916 +v 0.331574 0.283161 0.331573 +v 0.468916 0.283161 -0.000000 +v 0.331574 0.283161 -0.331573 +v 0.000000 -0.500000 -0.634972 +v -0.448993 -0.500000 -0.448993 +v -0.634972 -0.500000 0.000000 +v -0.448993 -0.500000 0.448993 +v 0.000000 -0.500000 0.634972 +v 0.448993 -0.500000 0.448993 +v 0.634972 -0.500000 -0.000000 +v 0.448993 -0.500000 -0.448993 +v 0.000000 -0.500000 -0.468916 +v -0.331573 -0.500000 -0.331573 +v -0.468916 -0.500000 0.000000 +v -0.331573 -0.500000 0.331573 +v 0.000000 -0.500000 0.468916 +v 0.331574 -0.500000 0.331573 +v 0.468916 -0.500000 -0.000000 +v 0.331574 -0.500000 -0.331573 +vt -0.608080 0.074124 +vt -0.327469 0.190357 +vt -0.327470 0.846802 +vt -0.608081 0.963035 +vt 0.020474 1.591590 +vt 0.136707 1.310979 +vt 0.793152 1.310979 +vt 0.909385 1.591590 +vt 1.257329 0.846802 +vt 1.537940 0.963035 +vt 1.537940 0.074125 +vt 1.257329 0.190357 +vt 0.793153 -0.273820 +vt 0.909385 -0.554430 +vt 0.020475 -0.554430 +vt 0.136707 -0.273820 +vt 0.515697 1.565113 +vt 0.025118 1.565113 +vt 0.025118 0.494591 +vt 0.515697 0.494591 +vt -0.814013 0.503505 +vt -0.155051 0.503733 +vt -0.155418 1.565641 +vt -0.814379 1.565413 +vt -0.465460 1.565113 +vt -0.465460 0.494591 +vt 1.162871 -0.559966 +vt 1.821833 -0.559966 +vt 1.821833 0.501942 +vt 1.162871 0.501942 +vt 1.496855 0.493016 +vt 1.006276 0.493016 +vt 1.006276 -0.577506 +vt 1.496855 -0.577506 +vt 0.503910 -0.559966 +vt 0.503910 0.501942 +vt 0.515697 0.493016 +vt 0.515697 -0.577506 +vt -0.155051 -0.559966 +vt -0.155051 0.501942 +vt 0.025118 0.493016 +vt 0.025119 -0.577506 +vt -0.814013 -0.559966 +vt -0.814013 0.501942 +vt 1.162872 0.504188 +vt 1.821833 0.504415 +vt 1.821467 1.566324 +vt 1.162505 1.566096 +vt -0.465460 0.493016 +vt -0.465460 -0.577506 +vt 1.496855 1.565113 +vt 1.006276 1.565113 +vt 1.006276 0.494591 +vt 1.496855 0.494591 +vt 0.503910 0.503960 +vt 0.503544 1.565869 +vn 0.000000 1.000000 0.000000 +vn 0.923900 0.000000 -0.382700 +vn -0.382700 0.000000 0.923900 +vn 0.382700 0.000000 -0.923900 +vn 0.382700 0.000000 0.923900 +vn -0.382700 0.000000 -0.923900 +vn 0.923900 0.000000 0.382700 +vn -0.923900 0.000000 -0.382700 +vn -0.923900 0.000000 0.382700 +s off +f 4/1/1 12/2/1 11/3/1 3/4/1 +f 2/5/1 10/6/1 9/7/1 1/8/1 +f 1/8/1 9/7/1 16/9/1 8/10/1 +f 7/11/1 15/12/1 14/13/1 6/14/1 +f 5/15/1 13/16/1 12/2/1 4/1/1 +f 3/4/1 11/3/1 10/6/1 2/5/1 +f 8/10/1 16/9/1 15/12/1 7/11/1 +f 6/14/1 14/13/1 13/16/1 5/15/1 +f 11/17/2 12/18/2 28/19/2 27/20/2 +f 5/21/3 4/22/3 20/23/3 21/24/3 +f 12/18/4 13/25/4 29/26/4 28/19/4 +f 6/27/5 5/28/5 21/29/5 22/30/5 +f 13/31/6 14/32/6 30/33/6 29/34/6 +f 7/35/7 6/27/7 22/30/7 23/36/7 +f 14/32/8 15/37/8 31/38/8 30/33/8 +f 8/39/2 7/35/2 23/36/2 24/40/2 +f 15/37/9 16/41/9 32/42/9 31/38/9 +f 1/43/4 8/39/4 24/40/4 17/44/4 +f 2/45/6 1/46/6 17/47/6 18/48/6 +f 16/41/3 9/49/3 25/50/3 32/42/3 +f 9/51/5 10/52/5 26/53/5 25/54/5 +f 3/55/8 2/45/8 18/48/8 19/56/8 +f 10/52/7 11/17/7 27/20/7 26/53/7 +f 4/22/9 3/55/9 19/56/9 20/23/9 diff --git a/models/survival_well_top.obj b/models/survival_well_top.obj new file mode 100644 index 0000000..222762b --- /dev/null +++ b/models/survival_well_top.obj @@ -0,0 +1,124 @@ +# Blender v2.74 (sub 4) OBJ File: '' +# www.blender.org +o Plane +v -0.594368 -0.025786 0.594368 +v 0.594368 -0.025786 0.594368 +v -0.594368 -0.025786 -0.594368 +v 0.594368 -0.025786 -0.594368 +v -0.594368 0.213800 -0.110024 +v -0.594368 0.213800 0.110024 +v 0.594368 0.213800 0.110024 +v 0.594368 0.213800 -0.110024 +v -0.594368 0.074214 0.594368 +v 0.594368 0.074214 0.594368 +v -0.594368 0.074214 -0.594368 +v 0.594368 0.074214 -0.594368 +v -0.594368 0.395477 -0.037573 +v -0.594368 0.395477 0.037573 +v 0.594368 0.395477 0.037573 +v 0.594368 0.395477 -0.037573 +v 0.580392 -0.716775 -0.100000 +v 0.580392 0.207742 -0.100000 +v 0.580392 -0.716775 0.100000 +v 0.580392 0.207742 0.100000 +v 0.484193 -0.716775 -0.100000 +v 0.484193 0.207742 -0.100000 +v 0.484193 -0.716775 0.100000 +v 0.484193 0.207742 0.100000 +v -0.580392 -0.716775 0.100000 +v -0.580392 0.207742 0.100000 +v -0.580392 -0.716775 -0.100000 +v -0.580392 0.207742 -0.100000 +v -0.484193 -0.716775 0.100000 +v -0.484193 0.207742 0.100000 +v -0.484193 -0.716775 -0.100000 +v -0.484193 0.207742 -0.100000 +vt -2.037692 -0.642955 +vt -2.037691 -1.795974 +vt 0.498825 -1.795974 +vt 0.498825 -0.642955 +vt -2.037692 0.979602 +vt -2.037692 -0.173418 +vt 0.498825 -0.173417 +vt 0.498825 0.979602 +vt -0.828274 0.554469 +vt 1.708243 0.554469 +vt 1.708243 1.926136 +vt -0.828275 1.926135 +vt -0.828275 -0.977544 +vt 1.708243 -0.977544 +vt 1.708243 0.394122 +vt -0.828274 0.394123 +vt 0.533815 0.318514 +vt 0.533815 0.838637 +vt 0.104389 0.667386 +vt 0.104389 0.489764 +vt -2.037692 -2.009354 +vt 0.498825 -2.009355 +vt 0.498825 1.192981 +vt -2.037692 1.192983 +vt -0.160681 2.007526 +vt 0.422098 0.829388 +vt 0.864017 0.653155 +vt 0.082564 2.007526 +vt 1.100118 -0.826317 +vt 0.863751 -0.826317 +vt 0.422098 0.294133 +vt -0.160680 -0.884004 +vt 0.082565 -0.884004 +vt 0.864017 0.470366 +vt 1.100117 1.983467 +vt 0.863749 1.983467 +vt -0.630533 1.126091 +vt -0.630534 0.699332 +vt 1.342194 0.699332 +vt 1.342194 1.126091 +vt -0.630534 0.494062 +vt 1.342194 0.494062 +vt -0.630534 0.067303 +vt 1.342194 0.067302 +vt -0.630534 -0.137967 +vt 1.342194 -0.137967 +vt -0.468279 1.205461 +vt -0.468279 0.778702 +vt 1.504448 0.778702 +vt 1.504449 1.205460 +vt -0.468279 0.573432 +vt 1.504448 0.573432 +vt -0.468279 0.146673 +vt 1.504448 0.146673 +vt -0.468279 -0.058597 +vt 1.504448 -0.058597 +vn 0.000000 -0.896300 0.443400 +vn 0.000000 -0.896300 -0.443400 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 0.866200 -0.499800 +vn 0.000000 0.866200 0.499800 +vn 0.000000 1.000000 0.000000 +vn -1.000000 -0.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 1.000000 +vn 1.000000 -0.000000 0.000000 +s off +f 5/1/1 3/2/1 4/3/1 8/4/1 +f 1/5/2 6/6/2 7/7/2 2/8/2 +f 6/6/3 5/1/3 8/4/3 7/7/3 +f 13/9/4 16/10/4 12/11/4 11/12/4 +f 9/13/5 10/14/5 15/15/5 14/16/5 +f 14/16/6 15/15/6 16/10/6 13/9/6 +f 5/17/7 6/18/7 14/19/7 13/20/7 +f 4/3/8 3/2/8 11/21/8 12/22/8 +f 1/5/9 2/8/9 10/23/9 9/24/9 +f 2/25/10 7/26/10 15/27/10 10/28/10 +f 3/29/7 5/17/7 13/20/7 11/30/7 +f 8/31/10 4/32/10 12/33/10 16/34/10 +f 6/18/7 1/35/7 9/36/7 14/19/7 +f 7/26/10 8/31/10 16/34/10 15/27/10 +f 18/37/10 20/38/10 19/39/10 17/40/10 +f 20/38/9 24/41/9 23/42/9 19/39/9 +f 24/41/7 22/43/7 21/44/7 23/42/7 +f 22/43/8 18/45/8 17/46/8 21/44/8 +f 26/47/7 28/48/7 27/49/7 25/50/7 +f 28/48/8 32/51/8 31/52/8 27/49/8 +f 32/51/10 30/53/10 29/54/10 31/52/10 +f 30/53/9 26/55/9 25/56/9 29/54/9 diff --git a/nodes.lua b/nodes.lua index d298bd3..4c01489 100644 --- a/nodes.lua +++ b/nodes.lua @@ -7,16 +7,6 @@ local barrel_formspec = "list[current_player;main;0,4.85;8,1;]".. "list[current_player;main;0,6.08;8,3;8]".. default.get_hotbar_bg(0,4.85) - -local spigot_formspec = - 'size[8,9]'.. - default.gui_bg.. - default.gui_bg_img.. - default.gui_slots.. - "list[sap;main;2,4;1,1;]".. - "list[current_player;main;0,4.85;8,1;]".. - "list[current_player;main;0,6.08;8,3;8]".. - default.get_hotbar_bg(0,4.85) minetest.register_node('survival:barrel', { description = 'Barrel', @@ -58,6 +48,11 @@ minetest.register_node(":default:dirt_with_grass", { tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, is_ground_content = true, groups = {crumbly=3,soil=1}, + soil = { + base = "default:dirt_with_grass", + dry = "farming:soil", + wet = "farming:soil_wet" + }, drop = { max_items = 2, items = { @@ -90,12 +85,12 @@ minetest.register_node(":default:dirt_with_grass", { footstep = {name="default_grass_footstep", gain=0.25}, }), }) - +--This will probably need to be a few nodes to show the states it can be in. minetest.register_node('survival:spigot', { description = 'spigot', drawtype = 'mesh', mesh = 'spigot.obj', - tiles = {'default_cobble.png'}, + tiles = {{name='default_wood.png'},{name='default_clay.png'}}, -- inventory_image = 'placeholder.png', groups = {choppy=2, dig_immediate=2,}, paramtype = 'light', @@ -108,58 +103,63 @@ minetest.register_node('survival:spigot', { type = 'fixed', fixed = {-.35, -.2, 0, .35, .5, .5}, -- Right, Bottom, Back, Left, Top, Front }, - on_construct = function(pos) - local timer = minetest.get_node_timer(pos) - local meta = minetest.env:get_meta(pos) - local inv = meta:get_inventory() - inv:set_size("main", 8*4) - inv:set_size('sap', 1) - meta:set_string("formspec", - "size[8,9]".. - "label[1,0;You need a bucket to collect sap.]" .. - "list[current_name;sap;1,1.5;1,1]".. - "list[current_player;main;0,5;8,4;]") - meta:set_string("infotext", "Sap Spigot") - end, - on_timer = function(pos, elapsed) - local meta = minetest.env:get_meta(pos) - local inv = meta:get_inventory() - local timer = minetest.get_node_timer(pos) - if inv:contains_item('sap', 'bucket:bucket_empty') then --make sure the bucket is still there - inv:set_stack('sap', 1,'survival:bucket_sap') - meta:set_string('infotext', 'bucket filled with sap, please replace.') - timer:stop() - return - end + on_construct = function(pos) + local timer = minetest.get_node_timer(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + inv:set_size('sap', 1) + meta:set_string("formspec", + "size[8,9]".. + "label[1,0;You need a bucket to collect sap.]" .. + "list[current_name;sap;1,1.5;1,1]".. + "list[current_player;main;0,5;8,4;]") + meta:set_string("infotext", "Sap Spigot") + end, + on_timer = function(pos, elapsed) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('sap', 'bucket:bucket_empty') then --make sure the bucket is still there + inv:set_stack('sap', 1,'survival:bucket_sap') + meta:set_string('infotext', 'bucket filled with sap, please replace.') + timer:stop() + return + end end, on_metadata_inventory_put = function(pos, listname, index, stack, player) local meta = minetest.env:get_meta(pos) local inv = meta:get_inventory() local timer = minetest.get_node_timer(pos) if inv:contains_item('sap', 'bucket:bucket_empty') then - timer:start(60) + timer:start(240) meta:set_string('infotext', 'gathering sap.. this could take a while.') - end + end + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local timer = minetest.get_node_timer(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string('infotext', 'You need a bucket to collect sap.') end, after_place_node = function(pos, placer, itemstack) - local n = minetest.get_node(pos) --get the location of the placed node - if not n or not n.param2 then + local n = minetest.get_node(pos) --get the location of the placed node + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local dir = minetest.facedir_to_dir(n.param2) + local p1 = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z} --node placed on + local p2 = {x=pos.x+dir.x, y=pos.y+1, z=pos.z+dir.z} --node above previous + local p3 = {x=pos.x+dir.x, y=pos.y-1, z=pos.z+dir.z} --node below first + local n2 = minetest.get_node_or_nil(p1) + local n3 = minetest.get_node_or_nil(p2) + local n4 = minetest.get_node_or_nil(p3) + if n2.name and n3.name and n4.name ~= 'default:tree' then minetest.remove_node(pos) return true + --TODO make the spigot place only one node above the ground. end - local dir = minetest.facedir_to_dir(n.param2) - local p1 = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z} --node placed on - local p2 = {x=pos.x+dir.x, y=pos.y+1, z=pos.z+dir.z} --node above previous - local p3 = {x=pos.x+dir.x, y=pos.y-1, z=pos.z+dir.z} --node below first - local n2 = minetest.get_node_or_nil(p1) - local n3 = minetest.get_node_or_nil(p2) - local n4 = minetest.get_node_or_nil(p3) - if n2.name and n3.name and n4.name ~= 'default:tree' then - minetest.remove_node(pos) - return true - --TODO make the spigot place one node above the ground. - end - end, + end, }) minetest.register_node('survival:sleeping_bag', { @@ -257,12 +257,11 @@ minetest.register_node('survival:leafy_bed', { end, on_rightclick = function(pos, node, clicker) beds.on_rightclick(pos, clicker) --- player:set_hp(-1) end, }) minetest.register_node('survival:sand_with_food', { - description = "Sand", + description = "Sand", tiles = {"default_sand.png"}, is_ground_content = true, groups = {crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1}, @@ -284,3 +283,46 @@ minetest.register_node('survival:sand_with_food', { }, }, }) + +minetest.register_node('survival:well_bottom', { + description = 'well bottom', + drawtype = 'mesh', + mesh = 'survival_well_bottom.obj', + tiles = {'default_cobble.png'}, + groups = {cracky=3, stone=2}, + paramtype = 'light', + paramtype2 = 'facedir', + sounds = default.node_sound_stone_defaults(), + selection_box = { + type = 'fixed', + fixed = {-0.6, -0.5, -0.6, 0.6, .3, .6}, -- Right, Bottom, Back, Left, Top, Front + }, + }) + +minetest.register_node('survival:well_top', { + description = 'well top', + drawtype = 'mesh', + mesh = 'survival_well_top.obj', + tiles = {'default_wood.png'}, + groups = {choppy=2,oddly_breakable_by_hand=2, attached_node=1}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-0.6, -0.6, -0.6, 0.6, .4, .6}, -- Right, Bottom, Back, Left, Top, Front + }, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node(pos) + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local dir = minetest.facedir_to_dir(n.param2) + local p = {x=pos.x, y=pos.y-1, z=pos.z} + local n2 = minetest.get_node_or_nil(p) + if n2.name ~= 'survival:well_bottom' then + minetest.remove_node(pos) + return true + end + end, + })