From 0b3952bd3d6226f780f70a0c840e01e6363b3ee3 Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sun, 19 Apr 2015 12:42:12 +0100 Subject: [PATCH] Added Green Beans and beanpoles to grow them with --- README.txt | 1 + beanpole.lua | 186 ++++++++++++++++++++++++++++++++ init.lua | 5 +- mapgen.lua | 1 + textures/farming_beanbush.png | Bin 0 -> 227 bytes textures/farming_beanpole.png | Bin 0 -> 323 bytes textures/farming_beanpole_1.png | Bin 0 -> 242 bytes textures/farming_beanpole_2.png | Bin 0 -> 264 bytes textures/farming_beanpole_3.png | Bin 0 -> 297 bytes textures/farming_beanpole_4.png | Bin 0 -> 355 bytes textures/farming_beanpole_5.png | Bin 0 -> 353 bytes textures/farming_beans.png | Bin 0 -> 193 bytes 12 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 beanpole.lua create mode 100644 textures/farming_beanbush.png create mode 100644 textures/farming_beanpole.png create mode 100644 textures/farming_beanpole_1.png create mode 100644 textures/farming_beanpole_2.png create mode 100644 textures/farming_beanpole_3.png create mode 100644 textures/farming_beanpole_4.png create mode 100644 textures/farming_beanpole_5.png create mode 100644 textures/farming_beans.png diff --git a/README.txt b/README.txt index 98ea2c9..aa7b320 100644 --- a/README.txt +++ b/README.txt @@ -13,6 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.14 - Added Green Beans from Crops mod (thanks sofar), little bushels in the wild but need to be grown using beanpoles crafted with 4 sticks (2 either side) 1.13 - Fixed seed double-placement glitch. Mapgen now uses 0.4.12+ for plant generation 1.12 - Player cannot place seeds in protected area, also growing speeds changed to match defaults 1.11 - Added Straw Bale, streamlined growing abm a little, fixed melon rotation bug with screwdriver diff --git a/beanpole.lua b/beanpole.lua new file mode 100644 index 0000000..bd31aad --- /dev/null +++ b/beanpole.lua @@ -0,0 +1,186 @@ +--[[ + All textures by + (C) Auke Kok + CC-BY-SA-3.0 +--]] + +minetest.register_craftitem("farming:beans", { + description = "Green Beans", + inventory_image = "farming_beans.png", + on_use = minetest.item_eat(1), + on_place = function(itemstack, placer, pointed_thing) + local nod = minetest.get_node_or_nil(pointed_thing.under) + if nod and nod.name == "farming:beanpole" then + minetest.set_node(pointed_thing.under, {name="farming:beanpole_1"}) + else + return + end + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +-- Beanpole + +minetest.register_node("farming:beanpole", { + drawtype = "plantlike", + tiles = {"farming_beanpole.png"}, + inventory_image = "farming_beanpole.png", + visual_scale = 1.45, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {'farming:beanpole'},rarity=1}, + } + }, + selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, + groups = {snappy=3,flammable=2,not_in_creative_inventory=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + on_place = function(itemstack, placer, pointed_thing) + local nod = minetest.get_node_or_nil(pointed_thing.under) + if nod and minetest.get_item_group(nod.name, "soil") < 2 then return end + local top = {x=pointed_thing.above.x, y=pointed_thing.above.y+1, z=pointed_thing.above.z} + nod = minetest.get_node_or_nil(top) + if nod and nod.name ~= "air" then return end + minetest.set_node(pointed_thing.above, {name="farming:beanpole"}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end +}) + +minetest.register_craft({ + output = "farming:beanpole", + recipe = { + {'', '', ''}, + {'default:stick', '', 'default:stick'}, + {'default:stick', '', 'default:stick'}, + } +}) + +-- Define Corn growth stages + +minetest.register_node("farming:beanpole_1", { + drawtype = "plantlike", + tiles = {"farming_beanpole_1.png"}, + visual_scale = 1.45, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {'farming:beanpole'},rarity=1}, + } + }, + selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, + groups = {snappy=3,flammable=3,not_in_creative_inventory=1,attached_node=1,growing=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("farming:beanpole_2", { + drawtype = "plantlike", + tiles = {"farming_beanpole_2.png"}, + visual_scale = 1.45, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {'farming:beanpole'},rarity=1}, + } + }, + selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, + groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("farming:beanpole_3", { + drawtype = "plantlike", + tiles = {"farming_beanpole_3.png"}, + visual_scale = 1.45, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {'farming:beanpole'},rarity=1}, + } + }, + selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, + groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + +minetest.register_node("farming:beanpole_4", { + drawtype = "plantlike", + tiles = {"farming_beanpole_4.png"}, + visual_scale = 1.45, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {'farming:beanpole'},rarity=1}, + } + }, + selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, + groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +-- Last stage of Corn growth doesnnot have growing=1 so abm never has to check these + +minetest.register_node("farming:beanpole_5", { + drawtype = "plantlike", + tiles = {"farming_beanpole_5.png"}, + visual_scale = 1.45, + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {'farming:beanpole'},rarity=1}, + {items = {'farming:beans 3'},rarity=1}, + {items = {'farming:beans 2'},rarity=2}, + {items = {'farming:beans 2'},rarity=3}, + } + }, + selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, + groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +-- Wild Green Bean Bush (this is what you find on the map) + +minetest.register_node("farming:beanbush", { + drawtype = "plantlike", + tiles = {"farming_beanbush.png"}, + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {'farming:beans 1'},rarity=1}, + {items = {'farming:beans 1'},rarity=2}, + {items = {'farming:beans 1'},rarity=3}, + } + }, + selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},}, + groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), +}) diff --git a/init.lua b/init.lua index 3605d90..7f9f08f 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,5 @@ --[[ - Minetest Farming Redo Mod 1.12 (9th April 2015) + Minetest Farming Redo Mod 1.13 (19th April 2015) by TenPlus1 ]] @@ -25,7 +25,8 @@ dofile(minetest.get_modpath("farming").."/cocoa.lua") dofile(minetest.get_modpath("farming").."/raspberry.lua") dofile(minetest.get_modpath("farming").."/blueberry.lua") dofile(minetest.get_modpath("farming").."/rhubarb.lua") -dofile(minetest.get_modpath("farming").."/donut.lua") -- sweet treat +dofile(minetest.get_modpath("farming").."/beanpole.lua") +dofile(minetest.get_modpath("farming").."/donut.lua") dofile(minetest.get_modpath("farming").."/mapgen.lua") dofile(minetest.get_modpath("farming").."/compatibility.lua") -- Farming Plus compatibility diff --git a/mapgen.lua b/mapgen.lua index 77c4624..995d07c 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -35,6 +35,7 @@ function farming.register_mgv6_decorations() register_plant("raspberry_4", 3, 10, "", -1) register_plant("rhubarb_3", 3, 15, "group:tree", 1) register_plant("blueberry_4", 3, 10, "", -1) + register_plant("beanbush", 18, 35, "", -1) end -- enable in mapgen v6 only diff --git a/textures/farming_beanbush.png b/textures/farming_beanbush.png new file mode 100644 index 0000000000000000000000000000000000000000..637e7162d46a9bf193f8b400c076ad7156a2958a GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeXEjDCq&)JYRO?Yba4#fxUPEIkc-Jtz~y58 z?Y`O{dcG z;=kW33gm8XwEOwXJJr+dU2pBCO~;osEtB4(%-+3yQB07poMuJwDS^qE=1Yz-&i={R YZovOR;>fG%KeyY002ovPDHLkV1gyTi>&|v literal 0 HcmV?d00001 diff --git a/textures/farming_beanpole_1.png b/textures/farming_beanpole_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ef2bd5abe14f6a13a035f901d2ecc7d749335014 GIT binary patch literal 242 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvi2$Dv*Te#b93PQ3ACZ<=iL`0L zISWJzmWh^c5IdzH7YbCvSQ6wH%;50sMjDXQ;pyTSqH(@;;z8bK0|A!r=hS`*WgKW^ z3(#7?GTnjm<$qQtmD`IwJ|3RtW_7m8e^>u%+k*^$SQoflC{AJ9@L#Oypm@~7ScX0B z6P$0cak@`p+w=4P7v>1rBf?x9ItSM0Fa)!zeXHw}mgd`VuYB)Trk>e9V$MgX+zqeF nJ32cltS)7B(we|7^&5;%AK3h5RvMlKx{1Nl)z4*}Q$iB}1btSk literal 0 HcmV?d00001 diff --git a/textures/farming_beanpole_2.png b/textures/farming_beanpole_2.png new file mode 100644 index 0000000000000000000000000000000000000000..34143e470fa2e7762acddb6d6ec296fe18ef0f3b GIT binary patch literal 264 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvi2$Dv*Te#b93PQ3ACZ<=iL`0L zISWJzmWh^c5IdzH7YbCvSQ6wH%;50sMjDVa&(p;*MB{wxL_@yA3Oug82UC5cOP8O# zVET%4Ps;Wpp?CJ87gzDcPkqJMss6xTdXc|juP8Hv9rJ>wghSfg4Ik`T54MK;wB8YA z@K?Cxj^qMcWT|5sV*baT(%Nj-0tJp9l*>z23d9tM_gJVym?I+_Dr%HZkh K=d#Wzp$PyKw_sTS literal 0 HcmV?d00001 diff --git a/textures/farming_beanpole_3.png b/textures/farming_beanpole_3.png new file mode 100644 index 0000000000000000000000000000000000000000..d693f17090f63db73650a55b8691dac267d39b5a GIT binary patch literal 297 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfvi2$Dv*Te#b93PQ3ACZ<=iL`0L zISWJzmWh^c5IdzH7YbCvSQ6wH%;50sMjDW_-_yl0MB{wx#Jzln40u}RUQyGwenJ4$$`Ixl}+Uz z3=-Pb%1_RH$Z_1uS$SSoxSF&|hxnX~K*w1uX(G7?YXfIWOxa(S&TDjDa>r`UqHc%K z37j5F%ul|TX>l{YlI||kG^w%CLh`De+(VG;L^B|S6B st5l*^=(wKmXxfyNe(uB!^}PqVlPtueObpeefL>wnboFyt=akR{0Ota4WdHyG literal 0 HcmV?d00001 diff --git a/textures/farming_beanpole_4.png b/textures/farming_beanpole_4.png new file mode 100644 index 0000000000000000000000000000000000000000..c779b254c52345ce2dea0642ce8e5243a98b19a0 GIT binary patch literal 355 zcmV-p0i6DcP)g)3qH~!@pMDPF=b)wCZL!P*y-lNS)l1Qq*s88!Ho^lN41K z$D5z-z4wa`;C~FL>3>SE(8Aq;%{^p8?5I_HkWiv1;nbf`R+}tk8-C7NNWI9`6E@%Q zt3&BwS$X}*+WA?A`cdI?Ru@g#a>F+3=;80Kooc?zSj4|mZTmka@E@i)#-dq3x002ovPDHLkV1l^F BlU4u# literal 0 HcmV?d00001 diff --git a/textures/farming_beanpole_5.png b/textures/farming_beanpole_5.png new file mode 100644 index 0000000000000000000000000000000000000000..910f8a07d54f862539b2877ce6a389c4120c7bcd GIT binary patch literal 353 zcmV-n0iOPeP)00DGTPE!Ct=GbNc008kxL_t(2 z&s~wRPQx$|h8_2gI9m$pZb~b}hLAe28G@x|J0e$g-y%!)Ac0V~sOpf%#X^X?^tSt? z`~CS&slU=nR!*~Q0?_HXx*!%?(T77QfduG`zN;rAV-^k*&{r=;_T6XmKJH~GUcdHU zfZ@&h)g%I+VJ*Q?Z?TkLiKhsaP(@$GB1l!Z9gTKE1FbSU$08vl@Uamh&4WU<8W>at zi53jPuFeS`8FV_PmzLi=vfK_>`y+$Jnev#i7}&2?nHifkHsuw~J%gf8Yju`KBDOgZ zFW|`op>sF?pu`r_efi!N2FVdQ&MBb@0Np=DHvj+t literal 0 HcmV?d00001