update plantlife's mods
|
@ -1,12 +1,4 @@
|
|||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
local S = plantslib.intllib
|
||||
|
||||
-- Basket
|
||||
|
||||
|
|
|
@ -2,14 +2,8 @@
|
|||
-- now maintained by VanessaE
|
||||
--
|
||||
-- License: WTFPL
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
local S = plantslib.intllib
|
||||
|
||||
bushes_classic = {}
|
||||
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
# Template
|
||||
|
||||
Strawberry = Fraise
|
||||
Blackberry = Mûre
|
||||
Blueberry = Myrtille
|
||||
Raspberry = Framboise
|
||||
Gooseberry = Groseille
|
||||
Mixed Berry = Mélange de baies
|
||||
Basket with Strawberry Pies = Panier de tartes aux fraises
|
||||
Basket with Blackberry Pies = Panier de tartes aux mûres
|
||||
Basket with Blueberry Pies = Panier de tartes aux myrtilles
|
||||
Basket with Raspberry Pies = Panier de tartes aux framboises
|
||||
Basket with Gooseberry Pies = Panier de tartes aux groseilles
|
||||
Basket with Mixed Berry Pies = Panier de tartes au mélange de baies
|
||||
currently fruitless = actuellement sans fruit
|
||||
Strawberry Bush = Buisson à fraise
|
||||
Blackberry Bush = Buisson à mûre
|
||||
Blueberry Bush = Buisson à myrtille
|
||||
Raspberry Bush = Buisson à framboise
|
||||
Gooseberry Bush = Buisson à groseille
|
||||
Mixed Berry Bush = Buisson de baies mélangées
|
||||
Basket = Panier
|
||||
Sugar = Sucre
|
||||
Raw Strawberry pie = Tarte crue aux fraises
|
||||
Raw Blackberry pie = Tarte crue aux mûres
|
||||
Raw Blueberry pie = Tarte crue aux myrtilles
|
||||
Raw Raspberry pie = Tarte crue aux framboises
|
||||
Raw Gooseberry pie = Tarte crue aux groseilles
|
||||
Raw Mixed Berry pie = Tarte crue au mélange de baies
|
||||
Cooked Strawberry pie = Tarte cuite aux fraises
|
||||
Cooked Blackberry pie = Tarte cuite aux mûres
|
||||
Cooked Blueberry pie = Tarte cuite aux myrtilles
|
||||
Cooked Raspberry pie = Tarte cuite aux framboises
|
||||
Cooked Gooseberry pie = Tarte cuite aux groseilles
|
||||
Cooked Mixed Berry pie = Tarte cuite au mélange de baies
|
||||
Slice of Strawberry pie = Part de tarte aux fraises
|
||||
Slice of Blackberry pie = Part de tarte aux mûres
|
||||
Slice of Blueberry pie = Part de tarte aux myrtilles
|
||||
Slice of Raspberry pie = Part de tarts aux framboises
|
||||
Slice of Gooseberry pie = Part de tarte aux groseilles
|
||||
Slice of Mixed Berry pie = Part de tarte au mélange de baies
|
||||
|
||||
[Bushes] Loaded. = [Buissons] Chargés.
|
|
@ -0,0 +1,44 @@
|
|||
# Turkish translation
|
||||
# mahmutelmas06@hotmail.com
|
||||
|
||||
Strawberry = Çilek
|
||||
Blackberry = Böğürtlen
|
||||
Blueberry = Yaban mersini
|
||||
Raspberry = Ahududu
|
||||
Gooseberry = Bektaşi üzümü
|
||||
Mixed Berry = Dut
|
||||
Basket with Strawberry Pies = Çilekli pasta sepeti
|
||||
Basket with Blackberry Pies = Böğürtlenli pasta sepeti
|
||||
Basket with Blueberry Pies = Yaban mersini pastalı sepet
|
||||
Basket with Raspberry Pies = Ahududulu pasta sepeti
|
||||
Basket with Gooseberry Pies = Bektaşi üzümlü pasta sepeti
|
||||
Basket with Mixed Berry Pies = Dutlu pasta sepeti
|
||||
currently fruitless = şu anda meyvesiz
|
||||
Strawberry Bush = Çilek fidanı
|
||||
Blackberry Bush = Böğürtlen fidanı
|
||||
Blueberry Bush = Yaban mersini fidanı
|
||||
Raspberry Bush = Ahududu fidanı
|
||||
Gooseberry Bush = Bektaşi üzümü fidanı
|
||||
Mixed Berry Bush = Dut fidanı
|
||||
Basket = Sepet
|
||||
Sugar = Şeker
|
||||
Raw Strawberry pie = Çilekli çiğ pasta
|
||||
Raw Blackberry pie = Böğürtlenli çiğ pasta
|
||||
Raw Blueberry pie = Yaban mersinli çiğ pasta
|
||||
Raw Raspberry pie = Ahududulu çiğ pasta
|
||||
Raw Gooseberry pie = Bektaşi üzümlü çiğ pasta
|
||||
Raw Mixed Berry pie = Dutlu çiğ pasta
|
||||
Cooked Strawberry pie = Pişmiş çilekli pasta
|
||||
Cooked Blackberry pie = Pişmiş böğürtlenli pasta
|
||||
Cooked Blueberry pie = Pişmiş yaban mersinli pasta
|
||||
Cooked Raspberry pie = Pişmiş ahududulu pasta
|
||||
Cooked Gooseberry pie = Pişmiş bektaşi üzümlü pasta
|
||||
Cooked Mixed Berry pie = Pişmiş dutlu pasta
|
||||
Slice of Strawberry pie = Çilekli pasta dilimi
|
||||
Slice of Blackberry pie = Böğürtlenli pasta dilimi
|
||||
Slice of Blueberry pie = Yaban mersinli pasta dilimi
|
||||
Slice of Raspberry pie = Ahududulu pasta dilimi
|
||||
Slice of Gooseberry pie = Bektaşi üzümlü pasta dilimi
|
||||
Slice of Mixed Berry pie = Dutlu pasta dilimi
|
||||
|
||||
[Bushes] Loaded. = [Bushes] yüklendi.
|
|
@ -0,0 +1,46 @@
|
|||
# Blender v2.73 (sub 0) OBJ File: 'basket-of-pies.blend'
|
||||
# www.blender.org
|
||||
o basket_Cube.001
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v -0.500000 0.500000 0.500000
|
||||
v -0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.500000 0.500000
|
||||
v -0.437500 0.500000 0.437500
|
||||
v -0.437500 0.500000 -0.437500
|
||||
v 0.437500 0.500000 -0.437500
|
||||
v 0.437500 0.500000 0.437500
|
||||
v -0.437500 -0.437500 0.437500
|
||||
v -0.437500 -0.437500 -0.437500
|
||||
v 0.437500 -0.437500 -0.437500
|
||||
v 0.437500 -0.437500 0.437500
|
||||
vt 0.484848 0.984848
|
||||
vt 0.015152 0.984848
|
||||
vt 0.015152 0.515152
|
||||
vt 0.484848 0.515152
|
||||
vt 0.515152 0.984848
|
||||
vt 0.515152 0.515152
|
||||
vt 0.984848 0.515152
|
||||
vt 0.984848 0.984848
|
||||
vt 0.954545 0.545455
|
||||
vt 0.545455 0.545455
|
||||
vt 0.954545 0.954545
|
||||
vt 0.545455 0.954545
|
||||
s off
|
||||
f 5/1 6/2 2/3 1/4
|
||||
f 6/1 7/2 3/3 2/4
|
||||
f 7/1 8/2 4/3 3/4
|
||||
f 8/1 5/2 1/3 4/4
|
||||
f 1/5 2/6 3/7 4/8
|
||||
f 5/6 8/7 12/9 9/10
|
||||
f 8/7 7/8 11/11 12/9
|
||||
f 7/8 6/5 10/12 11/11
|
||||
f 6/5 5/6 9/10 10/12
|
||||
f 9/1 12/2 16/3 13/4
|
||||
f 12/1 11/2 15/3 16/4
|
||||
f 11/1 10/2 14/3 15/4
|
||||
f 10/1 9/2 13/3 14/4
|
||||
f 13/10 16/9 15/11 14/12
|
|
@ -0,0 +1,330 @@
|
|||
# Blender v2.73 (sub 0) OBJ File: 'basket-of-pies.blend'
|
||||
# www.blender.org
|
||||
o pies_Cylinder
|
||||
v -0.089468 -0.116804 -0.438000
|
||||
v -0.116691 -0.091480 -0.438000
|
||||
v 0.024696 0.005921 -0.404659
|
||||
v -0.002527 0.031245 -0.404659
|
||||
v 0.121480 0.109962 -0.309713
|
||||
v 0.094258 0.135286 -0.309713
|
||||
v 0.186149 0.179480 -0.167615
|
||||
v 0.158927 0.204804 -0.167615
|
||||
v 0.208858 0.203891 0.000000
|
||||
v 0.181635 0.229215 0.000000
|
||||
v 0.186149 0.179480 0.167615
|
||||
v 0.158927 0.204804 0.167615
|
||||
v 0.121480 0.109962 0.309713
|
||||
v 0.094258 0.135286 0.309713
|
||||
v 0.024696 0.005921 0.404659
|
||||
v -0.002527 0.031245 0.404659
|
||||
v -0.089468 -0.116804 0.438000
|
||||
v -0.116691 -0.091480 0.438000
|
||||
v -0.230856 -0.214204 0.404659
|
||||
v -0.327640 -0.318245 0.309713
|
||||
v -0.392309 -0.387763 0.167615
|
||||
v -0.415018 -0.412175 -0.000000
|
||||
v -0.392309 -0.387763 -0.167615
|
||||
v -0.327640 -0.318245 -0.309713
|
||||
v -0.230856 -0.214204 -0.404659
|
||||
v -0.135230 -0.074234 -0.383250
|
||||
v -0.035336 0.033150 -0.354077
|
||||
v 0.049350 0.124186 -0.270999
|
||||
v 0.105936 0.185014 -0.146663
|
||||
v 0.125806 0.206374 0.000000
|
||||
v 0.105936 0.185014 0.146663
|
||||
v 0.049350 0.124186 0.270999
|
||||
v -0.035336 0.033150 0.354077
|
||||
v -0.135230 -0.074234 0.383250
|
||||
v -0.235124 -0.181618 0.354077
|
||||
v -0.319810 -0.272654 0.270999
|
||||
v -0.376395 -0.333482 0.146663
|
||||
v -0.396266 -0.354842 -0.000000
|
||||
v -0.376395 -0.333482 -0.146664
|
||||
v -0.319810 -0.272654 -0.270999
|
||||
v -0.235124 -0.181618 -0.354077
|
||||
v 0.071215 -0.085999 -0.438000
|
||||
v 0.041377 -0.063816 -0.438000
|
||||
v 0.171221 0.048513 -0.404659
|
||||
v 0.141384 0.070697 -0.404659
|
||||
v 0.256002 0.162547 -0.309713
|
||||
v 0.226165 0.184731 -0.309713
|
||||
v 0.312652 0.238743 -0.167615
|
||||
v 0.282814 0.260926 -0.167615
|
||||
v 0.332544 0.265499 0.000000
|
||||
v 0.302707 0.287682 0.000000
|
||||
v 0.312652 0.238743 0.167615
|
||||
v 0.282814 0.260926 0.167615
|
||||
v 0.256002 0.162547 0.309713
|
||||
v 0.226165 0.184731 0.309713
|
||||
v 0.171221 0.048513 0.404659
|
||||
v 0.141383 0.070697 0.404659
|
||||
v 0.071215 -0.085999 0.438000
|
||||
v 0.041377 -0.063816 0.438000
|
||||
v -0.058629 -0.198328 0.404659
|
||||
v -0.058629 -0.198328 -0.404659
|
||||
v 0.021058 -0.048709 -0.383250
|
||||
v 0.108564 0.068989 -0.354077
|
||||
v 0.182747 0.168769 -0.270999
|
||||
v 0.232315 0.235440 -0.146663
|
||||
v 0.249721 0.258852 0.000000
|
||||
v 0.232315 0.235440 0.146663
|
||||
v 0.182747 0.168769 0.270999
|
||||
v 0.108564 0.068989 0.354077
|
||||
v 0.021058 -0.048709 0.383250
|
||||
v -0.066448 -0.166408 0.354077
|
||||
v -0.140632 -0.266188 0.270999
|
||||
v -0.190200 -0.332858 0.146663
|
||||
v -0.207605 -0.356270 -0.000000
|
||||
v -0.190199 -0.332858 -0.146664
|
||||
v -0.140631 -0.266188 -0.270999
|
||||
v -0.066448 -0.166408 -0.354077
|
||||
v 0.220377 -0.057101 -0.438000
|
||||
v 0.188086 -0.038671 -0.438000
|
||||
v 0.303465 0.088470 -0.404659
|
||||
v 0.271175 0.106901 -0.404659
|
||||
v 0.373905 0.211880 -0.309713
|
||||
v 0.341614 0.230311 -0.309713
|
||||
v 0.420971 0.294340 -0.167615
|
||||
v 0.388680 0.312771 -0.167615
|
||||
v 0.437498 0.323296 0.000000
|
||||
v 0.405208 0.341727 0.000000
|
||||
v 0.420971 0.294340 0.167615
|
||||
v 0.388680 0.312771 0.167615
|
||||
v 0.373905 0.211880 0.309713
|
||||
v 0.341614 0.230311 0.309713
|
||||
v 0.303465 0.088470 0.404659
|
||||
v 0.271175 0.106901 0.404659
|
||||
v 0.220377 -0.057101 0.438000
|
||||
v 0.188086 -0.038671 0.438000
|
||||
v 0.104997 -0.184242 0.404659
|
||||
v 0.104997 -0.184242 -0.404659
|
||||
v 0.166096 -0.026119 -0.383250
|
||||
v 0.238799 0.101256 -0.354077
|
||||
v 0.300433 0.209240 -0.270999
|
||||
v 0.341616 0.281392 -0.146663
|
||||
v 0.356078 0.306728 0.000000
|
||||
v 0.341616 0.281392 0.146664
|
||||
v 0.300433 0.209240 0.270999
|
||||
v 0.238799 0.101256 0.354077
|
||||
v 0.166096 -0.026119 0.383250
|
||||
v 0.093393 -0.153495 0.354077
|
||||
v 0.031759 -0.261478 0.270999
|
||||
v -0.009424 -0.333631 0.146663
|
||||
v -0.023885 -0.358967 -0.000000
|
||||
v -0.009424 -0.333631 -0.146664
|
||||
v 0.031759 -0.261478 -0.270999
|
||||
v 0.093394 -0.153495 -0.354077
|
||||
vt 0.000000 0.054054
|
||||
vt 0.000000 0.000000
|
||||
vt 0.062500 0.000000
|
||||
vt 0.062500 0.054054
|
||||
vt 0.125000 0.000000
|
||||
vt 0.125000 0.054054
|
||||
vt 0.187500 0.000000
|
||||
vt 0.187500 0.054054
|
||||
vt 0.250000 0.000000
|
||||
vt 0.250000 0.054054
|
||||
vt 0.312500 0.000000
|
||||
vt 0.312500 0.054054
|
||||
vt 0.375000 0.000000
|
||||
vt 0.375000 0.054054
|
||||
vt 0.437500 0.000000
|
||||
vt 0.437500 0.054054
|
||||
vt 0.500000 0.000000
|
||||
vt 0.500000 0.054054
|
||||
vt 0.055610 0.293778
|
||||
vt 0.110171 0.184656
|
||||
vt 0.123905 0.225763
|
||||
vt 0.076165 0.321244
|
||||
vt 0.316174 0.801264
|
||||
vt 0.253798 0.852938
|
||||
vt 0.186282 0.852938
|
||||
vt 0.123905 0.801264
|
||||
vt 0.076165 0.705782
|
||||
vt 0.050327 0.581029
|
||||
vt 0.050327 0.445997
|
||||
vt 0.186282 0.174088
|
||||
vt 0.253798 0.174089
|
||||
vt 0.316174 0.225763
|
||||
vt 0.363915 0.321245
|
||||
vt 0.389752 0.445997
|
||||
vt 0.389752 0.581029
|
||||
vt 0.363915 0.705782
|
||||
vt 0.384468 0.733249
|
||||
vt 0.329907 0.842371
|
||||
vt 0.055610 0.733249
|
||||
vt 0.026082 0.590674
|
||||
vt 0.384468 0.293778
|
||||
vt 0.413996 0.436353
|
||||
vt 0.258619 0.901428
|
||||
vt 0.181458 0.901428
|
||||
vt 0.181458 0.125599
|
||||
vt 0.258619 0.125599
|
||||
vt 0.026082 0.436353
|
||||
vt 0.413996 0.590674
|
||||
vt 0.110171 0.842371
|
||||
vt 0.329907 0.184656
|
||||
vt 0.076566 0.705251
|
||||
vt 0.050729 0.580498
|
||||
vt 0.050729 0.445466
|
||||
vt 0.076566 0.320713
|
||||
vt 0.124307 0.225232
|
||||
vt 0.186684 0.173557
|
||||
vt 0.254199 0.173557
|
||||
vt 0.316576 0.225232
|
||||
vt 0.364317 0.320713
|
||||
vt 0.390154 0.445466
|
||||
vt 0.390154 0.580498
|
||||
vt 0.364317 0.705251
|
||||
vt 0.316576 0.800732
|
||||
vt 0.254199 0.852407
|
||||
vt 0.186684 0.852407
|
||||
vt 0.124307 0.800732
|
||||
vt 0.110573 0.841838
|
||||
vt 0.056012 0.732716
|
||||
vt 0.330309 0.841838
|
||||
vt 0.259022 0.900894
|
||||
vt 0.026484 0.590141
|
||||
vt 0.026484 0.435819
|
||||
vt 0.414398 0.435819
|
||||
vt 0.414398 0.590141
|
||||
vt 0.181861 0.900894
|
||||
vt 0.384870 0.732716
|
||||
vt 0.384870 0.293245
|
||||
vt 0.389637 0.582094
|
||||
vt 0.363799 0.706847
|
||||
vt 0.316059 0.802329
|
||||
vt 0.253682 0.854003
|
||||
vt 0.186166 0.854003
|
||||
vt 0.123790 0.802329
|
||||
vt 0.076049 0.706847
|
||||
vt 0.050212 0.582094
|
||||
vt 0.050212 0.447062
|
||||
vt 0.076049 0.322309
|
||||
vt 0.123790 0.226828
|
||||
vt 0.186166 0.175153
|
||||
vt 0.253682 0.175153
|
||||
vt 0.316058 0.226828
|
||||
vt 0.363799 0.322310
|
||||
vt 0.389637 0.447062
|
||||
vt 0.413881 0.437419
|
||||
vt 0.413881 0.591741
|
||||
vt 0.258504 0.126666
|
||||
vt 0.329792 0.185722
|
||||
vt 0.384353 0.734315
|
||||
vt 0.329792 0.843437
|
||||
vt 0.055495 0.294844
|
||||
vt 0.110056 0.185722
|
||||
vt 0.384353 0.294844
|
||||
vt 0.181343 0.126666
|
||||
vt 0.025967 0.437419
|
||||
g pies_Cylinder_pie
|
||||
s off
|
||||
f 1/1 2/2 4/3 3/4
|
||||
f 3/4 4/3 6/5 5/6
|
||||
f 5/6 6/5 8/7 7/8
|
||||
f 7/8 8/7 10/9 9/10
|
||||
f 9/10 10/9 12/11 11/12
|
||||
f 11/12 12/11 14/13 13/14
|
||||
f 13/14 14/13 16/15 15/16
|
||||
f 15/16 16/15 18/17 17/18
|
||||
f 20/19 19/20 35/21 36/22
|
||||
f 27/23 26/24 41/25 40/26 39/27 38/28 37/29 36/22 35/21 34/30 33/31 32/32 31/33 30/34 29/35 28/36
|
||||
f 6/37 4/38 27/23 28/36
|
||||
f 23/39 22/40 38/28 39/27
|
||||
f 12/41 10/42 30/34 31/33
|
||||
f 2/43 25/44 41/25 26/24
|
||||
f 4/38 2/43 26/24 27/23
|
||||
f 18/45 16/46 33/31 34/30
|
||||
f 21/47 20/19 36/22 37/29
|
||||
f 8/48 6/37 28/36 29/35
|
||||
f 24/49 23/39 39/27 40/26
|
||||
f 14/50 12/41 31/33 32/32
|
||||
f 19/20 18/45 34/30 35/21
|
||||
f 22/40 21/47 37/29 38/28
|
||||
f 10/42 8/48 29/35 30/34
|
||||
f 25/44 24/49 40/26 41/25
|
||||
f 16/46 14/50 32/32 33/31
|
||||
f 42/1 43/2 45/3 44/4
|
||||
f 44/4 45/3 47/5 46/6
|
||||
f 46/6 47/5 49/7 48/8
|
||||
f 48/8 49/7 51/9 50/10
|
||||
f 50/10 51/9 53/11 52/12
|
||||
f 52/12 53/11 55/13 54/14
|
||||
f 54/14 55/13 57/15 56/16
|
||||
f 56/16 57/15 59/17 58/18
|
||||
f 63/51 62/52 77/53 76/54 75/55 74/56 73/57 72/58 71/59 70/60 69/61 68/62 67/63 66/64 65/65 64/66
|
||||
f 47/67 45/68 63/51 64/66
|
||||
f 53/69 51/70 66/64 67/63
|
||||
f 43/71 61/72 77/53 62/52
|
||||
f 45/68 43/71 62/52 63/51
|
||||
f 59/73 57/74 69/61 70/60
|
||||
f 49/75 47/67 64/66 65/65
|
||||
f 55/76 53/69 67/63 68/62
|
||||
f 60/77 59/73 70/60 71/59
|
||||
f 51/70 49/75 65/65 66/64
|
||||
f 57/74 55/76 68/62 69/61
|
||||
f 78/1 79/2 81/3 80/4
|
||||
f 80/4 81/3 83/5 82/6
|
||||
f 82/6 83/5 85/7 84/8
|
||||
f 84/8 85/7 87/9 86/10
|
||||
f 86/10 87/9 89/11 88/12
|
||||
f 88/12 89/11 91/13 90/14
|
||||
f 90/14 91/13 93/15 92/16
|
||||
f 92/16 93/15 95/17 94/18
|
||||
f 99/78 98/79 113/80 112/81 111/82 110/83 109/84 108/85 107/86 106/87 105/88 104/89 103/90 102/91 101/92 100/93
|
||||
f 83/94 81/95 99/78 100/93
|
||||
f 89/96 87/97 102/91 103/90
|
||||
f 79/98 97/99 113/80 98/79
|
||||
f 81/95 79/98 98/79 99/78
|
||||
f 95/100 93/101 105/88 106/87
|
||||
f 85/102 83/94 100/93 101/92
|
||||
f 91/103 89/96 103/90 104/89
|
||||
f 96/104 95/100 106/87 107/86
|
||||
f 87/97 85/102 101/92 102/91
|
||||
f 93/101 91/103 104/89 105/88
|
||||
o basket_Cube.001
|
||||
v -0.500000 -0.500000 0.500000
|
||||
v -0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 -0.500000
|
||||
v 0.500000 -0.500000 0.500000
|
||||
v -0.500000 0.500000 0.500000
|
||||
v -0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.500000 -0.500000
|
||||
v 0.500000 0.500000 0.500000
|
||||
v -0.437500 0.500000 0.437500
|
||||
v -0.437500 0.500000 -0.437500
|
||||
v 0.437500 0.500000 -0.437500
|
||||
v 0.437500 0.500000 0.437500
|
||||
v -0.437500 -0.437500 0.437500
|
||||
v -0.437500 -0.437500 -0.437500
|
||||
v 0.437500 -0.437500 -0.437500
|
||||
v 0.437500 -0.437500 0.437500
|
||||
vt 0.484848 0.984848
|
||||
vt 0.015152 0.984848
|
||||
vt 0.015152 0.515152
|
||||
vt 0.484848 0.515152
|
||||
vt 0.515152 0.984848
|
||||
vt 0.515152 0.515152
|
||||
vt 0.984848 0.515152
|
||||
vt 0.984848 0.984848
|
||||
vt 0.954545 0.545455
|
||||
vt 0.545455 0.545455
|
||||
vt 0.954545 0.954545
|
||||
vt 0.545455 0.954545
|
||||
g basket_Cube.001_basket
|
||||
s off
|
||||
f 118/105 119/106 115/107 114/108
|
||||
f 119/105 120/106 116/107 115/108
|
||||
f 120/105 121/106 117/107 116/108
|
||||
f 121/105 118/106 114/107 117/108
|
||||
f 114/109 115/110 116/111 117/112
|
||||
f 118/110 121/111 125/113 122/114
|
||||
f 121/111 120/112 124/115 125/113
|
||||
f 120/112 119/109 123/116 124/115
|
||||
f 119/109 118/110 122/114 123/116
|
||||
f 122/105 125/106 129/107 126/108
|
||||
f 125/105 124/106 128/107 129/108
|
||||
f 124/105 123/106 127/107 128/108
|
||||
f 123/105 122/106 126/107 127/108
|
||||
f 126/114 129/113 128/115 127/116
|
|
@ -0,0 +1,329 @@
|
|||
# Blender v2.73 (sub 0) OBJ File: 'bush.blend'
|
||||
# www.blender.org
|
||||
o nodebox-4
|
||||
v 0.467076 -0.122686 -0.190481
|
||||
v -0.453590 -0.119789 -0.192145
|
||||
v 0.420865 -0.181680 -0.171396
|
||||
v -0.429008 -0.188000 -0.182314
|
||||
v -0.450977 0.041977 -0.191409
|
||||
v -0.271687 -0.294075 -0.114977
|
||||
v -0.096925 -0.495759 -0.044091
|
||||
v -0.070286 -0.344209 -0.030750
|
||||
v -0.163971 -0.173437 -0.403793
|
||||
v -0.188139 -0.116431 0.446425
|
||||
v 0.069865 0.462329 0.170043
|
||||
v -0.175980 -0.180649 0.417932
|
||||
v -0.184276 0.039248 0.437271
|
||||
v -0.121692 -0.319322 0.290049
|
||||
v -0.039557 -0.495759 0.097032
|
||||
v -0.029307 -0.346230 0.070496
|
||||
v -0.440307 0.205163 -0.203598
|
||||
v -0.440281 0.206327 0.191785
|
||||
v -0.339366 0.327086 -0.144329
|
||||
v -0.267923 0.418413 0.108270
|
||||
v -0.264994 0.405691 -0.113216
|
||||
v 0.173823 0.186657 0.424935
|
||||
v -0.172109 0.470396 -0.073638
|
||||
v -0.090743 0.491063 -0.039539
|
||||
v -0.173625 0.180559 0.412022
|
||||
v 0.108534 0.404586 0.263698
|
||||
v -0.137870 0.317286 0.327397
|
||||
v 0.149454 0.342906 0.361857
|
||||
v -0.115069 0.426252 0.274637
|
||||
v 0.116858 -0.311812 0.284557
|
||||
v -0.074459 0.465500 0.178311
|
||||
v -0.036397 0.486640 0.094150
|
||||
v 0.044199 -0.495759 -0.101459
|
||||
v 0.034559 -0.377127 -0.079219
|
||||
v 0.116886 -0.299764 -0.276145
|
||||
v -0.172864 0.462259 0.069984
|
||||
v 0.173974 -0.178414 -0.411782
|
||||
v 0.191827 0.042411 -0.453422
|
||||
v 0.190055 -0.117435 -0.449613
|
||||
v -0.136929 0.321997 -0.339476
|
||||
v 0.101567 -0.495759 0.039664
|
||||
v 0.076778 -0.365788 0.030191
|
||||
v 0.292232 -0.320027 0.121743
|
||||
v -0.067752 0.451498 -0.167691
|
||||
v 0.433751 -0.189348 0.181586
|
||||
v 0.457624 0.044950 0.184732
|
||||
v 0.473778 -0.128221 0.198329
|
||||
v -0.113891 -0.307852 -0.282552
|
||||
v 0.081961 0.458662 -0.191580
|
||||
v 0.042947 0.491063 -0.093885
|
||||
v 0.109202 0.397842 -0.257691
|
||||
v 0.145450 0.328672 -0.343352
|
||||
v 0.191241 0.038411 0.444768
|
||||
v -0.184306 0.045052 -0.456452
|
||||
v -0.289997 -0.318897 0.117161
|
||||
v 0.182461 0.185982 -0.431178
|
||||
v 0.180190 0.469152 0.074510
|
||||
v 0.097292 0.491063 0.039804
|
||||
v 0.264954 0.412421 0.110505
|
||||
v 0.355939 0.336100 0.148277
|
||||
v -0.474575 0.042725 0.191924
|
||||
v -0.169486 0.185035 -0.418844
|
||||
v -0.445009 -0.118527 0.180804
|
||||
v 0.427054 0.187979 0.172057
|
||||
v 0.350926 0.339079 -0.143384
|
||||
v 0.189060 -0.125023 0.462241
|
||||
v 0.269270 -0.290650 -0.109472
|
||||
v 0.175816 -0.186803 0.429367
|
||||
v 0.259570 0.406980 -0.105942
|
||||
v -0.103158 0.398344 -0.255462
|
||||
v -0.339105 0.330270 0.137302
|
||||
v -0.186029 -0.123369 -0.460126
|
||||
v -0.418539 -0.180131 0.169838
|
||||
v 0.041492 0.491063 0.094145
|
||||
v 0.487251 0.041118 -0.191308
|
||||
v 0.173059 0.459504 -0.070716
|
||||
v 0.460259 0.206607 -0.196213
|
||||
v 0.108065 0.487446 -0.045199
|
||||
v -0.103423 0.491173 0.040772
|
||||
v -0.040665 0.496765 -0.107957
|
||||
v -0.070153 -0.343292 0.028053
|
||||
v -0.028215 -0.347521 -0.072596
|
||||
v 0.028031 -0.329368 0.067986
|
||||
v 0.075170 -0.358957 -0.031186
|
||||
v -0.037332 -0.495759 -0.099759
|
||||
v 0.099867 -0.495759 -0.041867
|
||||
v -0.095225 -0.495759 0.037440
|
||||
v 0.041974 -0.495759 0.095332
|
||||
v 0.001777 0.503796 -0.003546
|
||||
v 0.002321 -0.495758 -0.002214
|
||||
vt 0.875000 0.281250
|
||||
vt 1.000000 0.281250
|
||||
vt 1.000000 0.421875
|
||||
vt 0.875000 0.421875
|
||||
vt 0.375000 0.125000
|
||||
vt 0.500000 0.125000
|
||||
vt 0.500000 0.234375
|
||||
vt 0.375000 0.234375
|
||||
vt 0.625000 0.234375
|
||||
vt 0.625000 0.281250
|
||||
vt 0.500000 0.281250
|
||||
vt 0.500000 0.609375
|
||||
vt 0.500000 0.656250
|
||||
vt 0.375000 0.656250
|
||||
vt 0.375000 0.609375
|
||||
vt 0.625000 0.421875
|
||||
vt 0.500000 0.421875
|
||||
vt 0.375000 0.281250
|
||||
vt 0.375000 0.421875
|
||||
vt 0.125000 0.609375
|
||||
vt 0.125000 0.656250
|
||||
vt 0.000000 0.656250
|
||||
vt 0.000000 0.609375
|
||||
vt 0.846670 0.983596
|
||||
vt 0.823789 0.862038
|
||||
vt 0.861831 0.862038
|
||||
vt 0.500000 0.531250
|
||||
vt 0.375000 0.531250
|
||||
vt 0.234375 0.609375
|
||||
vt 0.234375 0.531250
|
||||
vt 0.875000 0.234375
|
||||
vt 0.750000 0.234375
|
||||
vt 0.750000 0.125000
|
||||
vt 0.875000 0.125000
|
||||
vt 0.125000 0.234375
|
||||
vt 0.125000 0.125000
|
||||
vt 0.234375 0.125000
|
||||
vt 0.234375 0.234375
|
||||
vt 0.125000 0.281250
|
||||
vt 0.234375 0.281250
|
||||
vt 0.234375 0.421875
|
||||
vt 0.125000 0.421875
|
||||
vt 0.125000 0.703125
|
||||
vt 0.000000 0.703125
|
||||
vt 0.875000 0.656250
|
||||
vt 0.750000 0.656250
|
||||
vt 0.750000 0.609375
|
||||
vt 0.875000 0.609375
|
||||
vt 0.625000 0.656250
|
||||
vt 0.625000 0.609375
|
||||
vt 0.234375 0.656250
|
||||
vt 0.375000 0.703125
|
||||
vt 0.234375 0.703125
|
||||
vt 0.125000 0.531250
|
||||
vt 0.875000 0.531250
|
||||
vt 1.000000 0.531250
|
||||
vt 1.000000 0.609375
|
||||
vt 0.500000 0.703125
|
||||
vt 0.000000 0.421875
|
||||
vt 0.000000 0.531250
|
||||
vt 0.875000 0.703125
|
||||
vt 0.750000 0.703125
|
||||
vt 0.328125 0.812500
|
||||
vt 0.328125 0.875000
|
||||
vt 0.265625 0.890625
|
||||
vt 0.265625 0.781250
|
||||
vt 0.750000 0.531250
|
||||
vt 1.000000 0.234375
|
||||
vt -0.000000 0.281250
|
||||
vt 0.000000 0.234375
|
||||
vt 0.375000 0.921875
|
||||
vt 0.328125 0.984375
|
||||
vt 0.562500 0.812500
|
||||
vt 0.500000 0.828125
|
||||
vt 0.625000 0.125000
|
||||
vt 0.625000 0.531250
|
||||
vt 0.970570 0.983596
|
||||
vt 0.918853 0.862038
|
||||
vt 0.983390 0.862038
|
||||
vt 1.000000 0.703125
|
||||
vt 1.000000 0.656250
|
||||
vt 0.694849 0.983596
|
||||
vt 0.653099 0.862038
|
||||
vt 0.703461 0.862038
|
||||
vt 0.453125 1.000000
|
||||
vt 0.437500 0.937500
|
||||
vt 0.546875 0.937500
|
||||
vt 0.375000 0.765625
|
||||
vt 0.625000 0.703125
|
||||
vt 0.750000 0.281250
|
||||
vt 0.000000 0.125000
|
||||
vt 0.781059 0.974219
|
||||
vt 0.740272 0.862038
|
||||
vt 0.773590 0.862038
|
||||
vt 0.823762 0.862067
|
||||
vt 0.773656 0.862066
|
||||
vt 0.800723 0.801332
|
||||
vt 0.750000 0.421875
|
||||
vt 1.000000 0.125000
|
||||
vt 0.881508 0.980225
|
||||
vt 0.923791 0.982865
|
||||
vt 0.819499 0.959318
|
||||
vt 0.634200 0.973424
|
||||
vt 0.659430 0.971277
|
||||
vt 0.724959 0.956989
|
||||
vt 0.755822 0.968617
|
||||
vt 0.125000 0.000000
|
||||
vt 0.234375 0.000000
|
||||
vt 0.375000 0.000000
|
||||
vt 0.500000 0.000000
|
||||
vt 0.750000 0.000000
|
||||
vt 0.875000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 0.625000 0.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.618713 0.862038
|
||||
vt 0.453125 0.781250
|
||||
vt 0.484375 0.890625
|
||||
vt 0.406250 0.859375
|
||||
vt 0.738525 0.828462
|
||||
vt 0.741806 0.778103
|
||||
vt 0.777683 0.740596
|
||||
vt 0.827789 0.740597
|
||||
vt 0.862920 0.774201
|
||||
vt 0.859639 0.824560
|
||||
s off
|
||||
f 63/1 10/2 13/3 61/4
|
||||
f 67/5 35/6 37/7 3/8
|
||||
f 9/9 72/10 39/11 37/7
|
||||
f 52/12 51/13 69/14 65/15
|
||||
f 72/10 54/16 38/17 39/11
|
||||
f 1/18 39/11 38/17 75/19
|
||||
f 28/20 26/21 29/22 27/23
|
||||
f 82/24 33/25 85/26
|
||||
f 75/19 38/17 56/27 77/28
|
||||
f 77/28 65/15 60/29 64/30
|
||||
f 73/31 4/32 6/33 55/34
|
||||
f 68/35 30/36 43/37 45/38
|
||||
f 66/39 47/40 46/41 53/42
|
||||
f 11/43 31/44 29/22 26/21
|
||||
f 20/45 21/46 19/47 71/48
|
||||
f 70/49 40/50 19/47 21/46
|
||||
f 59/51 69/14 76/52 57/53
|
||||
f 3/8 37/7 39/11 1/18
|
||||
f 28/20 22/54 64/30 60/29
|
||||
f 71/48 18/55 25/56 27/57
|
||||
f 69/14 51/13 49/58 76/52
|
||||
f 13/59 53/42 22/54 25/60
|
||||
f 36/61 23/62 21/46 20/45
|
||||
f 58/63 74/64 11/65 57/66
|
||||
f 57/53 11/43 26/21 59/51
|
||||
f 19/47 17/67 18/55 71/48
|
||||
f 73/31 12/68 10/2 63/1
|
||||
f 68/35 66/39 10/69 12/70
|
||||
f 74/64 32/71 31/72 11/65
|
||||
f 53/42 46/41 64/30 22/54
|
||||
f 25/56 18/55 61/4 13/3
|
||||
f 49/58 44/73 80/74
|
||||
f 45/38 3/8 1/18 47/40
|
||||
f 9/9 48/75 6/33 4/32
|
||||
f 62/76 40/50 52/12 56/27
|
||||
f 81/77 7/78 87/79
|
||||
f 31/80 36/61 20/45 29/81
|
||||
f 83/82 15/83 88/84
|
||||
f 36/85 79/86 23/87
|
||||
f 78/88 58/63 57/66
|
||||
f 17/67 19/47 40/50 62/76
|
||||
f 45/38 47/40 66/39 68/35
|
||||
f 51/13 70/49 44/89 49/58
|
||||
f 4/32 73/31 63/1 2/90
|
||||
f 12/70 14/91 30/36 68/35
|
||||
f 84/92 41/93 86/94
|
||||
f 33/95 86/96 90/97
|
||||
f 70/49 21/46 23/62 44/89
|
||||
f 54/16 62/76 56/27 38/17
|
||||
f 29/81 20/45 71/48 27/57
|
||||
f 37/7 35/6 48/75 9/9
|
||||
f 5/98 17/67 62/76 54/16
|
||||
f 18/55 17/67 5/98 61/4
|
||||
f 10/69 66/39 53/42 13/59
|
||||
f 12/68 73/31 55/34 14/99
|
||||
f 51/13 52/12 40/50 70/49
|
||||
f 27/23 25/60 22/54 28/20
|
||||
f 65/15 69/14 59/51 60/29
|
||||
f 56/27 52/12 65/15 77/28
|
||||
f 46/41 75/19 77/28 64/30
|
||||
f 60/29 59/51 26/21 28/20
|
||||
f 47/40 1/18 75/19 46/41
|
||||
f 2/90 5/98 54/16 72/10
|
||||
f 4/32 2/90 72/10 9/9
|
||||
f 43/37 67/5 3/8 45/38
|
||||
f 2/90 63/1 61/4 5/98
|
||||
f 82/100 7/78 8/101
|
||||
f 82/24 34/102 33/25
|
||||
f 81/103 15/83 16/104
|
||||
f 81/77 8/101 7/78
|
||||
f 83/82 41/93 42/105
|
||||
f 83/82 16/104 15/83
|
||||
f 84/92 33/25 34/102
|
||||
f 84/92 42/106 41/93
|
||||
f 30/36 83/107 42/108 43/37
|
||||
f 42/108 84/109 67/5 43/37
|
||||
f 67/5 84/109 34/110 35/6
|
||||
f 55/34 6/33 8/111 81/112
|
||||
f 55/34 81/112 16/113 14/99
|
||||
f 34/110 82/114 48/75 35/6
|
||||
f 48/75 82/114 8/111 6/33
|
||||
f 30/36 14/91 16/115 83/107
|
||||
f 7/78 82/100 85/26
|
||||
f 15/83 81/103 87/116
|
||||
f 41/93 83/82 88/84
|
||||
f 33/25 84/92 86/94
|
||||
f 80/74 50/117 49/58
|
||||
f 23/87 24/118 80/74
|
||||
f 80/74 44/73 23/87
|
||||
f 79/86 36/85 31/72
|
||||
f 79/86 24/118 23/87
|
||||
f 31/72 32/71 79/86
|
||||
f 78/88 49/58 50/117
|
||||
f 78/88 57/66 76/52
|
||||
f 76/52 49/58 78/88
|
||||
f 24/118 79/86 89/119
|
||||
f 79/86 32/71 89/119
|
||||
f 32/71 74/64 89/119
|
||||
f 74/64 58/63 89/119
|
||||
f 58/63 78/88 89/119
|
||||
f 78/88 50/117 89/119
|
||||
f 50/117 80/74 89/119
|
||||
f 80/74 24/118 89/119
|
||||
f 86/96 41/120 90/97
|
||||
f 41/120 88/121 90/97
|
||||
f 88/121 15/122 90/97
|
||||
f 15/122 87/123 90/97
|
||||
f 87/123 7/124 90/97
|
||||
f 7/124 85/125 90/97
|
||||
f 85/125 33/95 90/97
|
|
@ -1,145 +1,142 @@
|
|||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
|
||||
local S = plantslib.intllib
|
||||
|
||||
plantlife_bushes = {}
|
||||
|
||||
-- TODO: add support for nodebreakers? those dig like mese picks
|
||||
plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
if( not( digger ) or not( pos ) or not (oldnode )) then
|
||||
return nil;
|
||||
plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
if not (digger and pos and oldnode) then
|
||||
return
|
||||
end
|
||||
|
||||
-- find out which bush type we are dealing with
|
||||
local bush_name = "";
|
||||
local can_harvest = false;
|
||||
local bush_name = ""
|
||||
local can_harvest = false
|
||||
|
||||
if( oldnode.name == 'bushes:fruitless_bush' ) then
|
||||
if oldnode.name == "bushes:fruitless_bush" then
|
||||
-- this bush has not grown fruits yet (but will eventually)
|
||||
bush_name = oldmetadata[ 'fields' ][ 'bush_type' ];
|
||||
bush_name = oldmetadata.fields.bush_type
|
||||
-- no fruits to be found, so can_harvest stays false
|
||||
else
|
||||
local name_parts = oldnode.name:split( ":" );
|
||||
if( #name_parts >= 2 and name_parts[2]~=nil ) then
|
||||
local name_parts = oldnode.name:split(":")
|
||||
if #name_parts >= 2 and name_parts[2] ~= nil then
|
||||
|
||||
name_parts = name_parts[2]:split( "_" );
|
||||
name_parts = name_parts[2]:split("_")
|
||||
|
||||
if( #name_parts >= 2 and name_parts[1]~=nil ) then
|
||||
bush_name = name_parts[1];
|
||||
if #name_parts >= 2 and name_parts[1] ~= nil then
|
||||
bush_name = name_parts[1]
|
||||
-- this bush really carries fruits
|
||||
can_harvest = true;
|
||||
can_harvest = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- find out which tool the digger was wielding (if any)
|
||||
local toolstack = digger:get_wielded_item();
|
||||
local capabilities = toolstack:get_tool_capabilities();
|
||||
local toolstack = digger:get_wielded_item()
|
||||
local capabilities = toolstack:get_tool_capabilities()
|
||||
|
||||
-- what the player will get
|
||||
local harvested = "";
|
||||
local amount = "";
|
||||
local harvested
|
||||
|
||||
-- failure to find out what the tool can do: destroy the bush and return nothing
|
||||
if( not( capabilities["groupcaps"] )) then
|
||||
return nil;
|
||||
local groupcaps = capabilities.groupcaps
|
||||
if not groupcaps then
|
||||
return
|
||||
|
||||
-- digging with the hand or something like that
|
||||
elseif( capabilities["groupcaps"]["snappy"] ) then
|
||||
elseif groupcaps.snappy then
|
||||
|
||||
-- plant a new bush without fruits
|
||||
minetest.set_node(pos,{type='node',name='bushes:fruitless_bush'})
|
||||
local meta = minetest.get_meta( pos );
|
||||
meta:set_string( 'bush_type', bush_name );
|
||||
minetest.set_node(pos, {type = "node", name = "bushes:fruitless_bush"})
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string('bush_type', bush_name)
|
||||
|
||||
-- construct the stack of fruits the player will get
|
||||
-- only bushes that have grown fruits can actually give fruits
|
||||
if( can_harvest == true ) then
|
||||
amount = "4";
|
||||
harvested = "bushes:"..bush_name.." "..amount;
|
||||
if can_harvest then
|
||||
local amount = "4"
|
||||
harvested = "bushes:" .. bush_name .. " " .. amount
|
||||
end
|
||||
|
||||
-- something like a shovel
|
||||
elseif( capabilities["groupcaps"]["crumbly"] ) then
|
||||
elseif groupcaps.crumbly then
|
||||
|
||||
-- with a chance of 1/3, return 2 bushes
|
||||
if( math.random(1,3)==1 ) then
|
||||
amount = "2";
|
||||
local amount
|
||||
if math.random(1,3) == 1 then
|
||||
amount = "2"
|
||||
else
|
||||
amount = "1";
|
||||
amount = "1"
|
||||
end
|
||||
-- return the bush itself
|
||||
harvested = "bushes:" .. bush_name .. "_bush "..amount;
|
||||
harvested = "bushes:" .. bush_name .. "_bush "..amount
|
||||
|
||||
-- something like an axe
|
||||
elseif( capabilities["groupcaps"]["choppy"] ) then
|
||||
elseif groupcaps.choppy then
|
||||
|
||||
-- the amount of sticks may vary
|
||||
amount = math.random( 4, 20 );
|
||||
local amount = math.random(4, 20)
|
||||
-- return some sticks
|
||||
harvested = "default:stick "..amount;
|
||||
harvested = "default:stick " .. amount
|
||||
|
||||
-- nothing known - destroy the plant
|
||||
else
|
||||
return nil;
|
||||
return
|
||||
end
|
||||
|
||||
-- give the harvested result to the player
|
||||
if( harvested ~= "" ) then
|
||||
if harvested then
|
||||
--minetest.chat_send_player("singleplayer","you would now get "..tostring( harvested ) );
|
||||
digger:get_inventory():add_item( "main", harvested );
|
||||
local itemstack = ItemStack(harvested)
|
||||
local inventory = digger:get_inventory()
|
||||
if inventory:room_for_item("main", itemstack) then
|
||||
inventory:add_item("main", itemstack)
|
||||
else
|
||||
minetest.item_drop(itemstack, digger, pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
plantlife_bushes.after_place_node = function(pos, placer, itemstack)
|
||||
|
||||
if( not( itemstack ) or not( pos )) then
|
||||
return nil;
|
||||
if not (itemstack and pos) then
|
||||
return
|
||||
end
|
||||
|
||||
local name_parts = itemstack:get_name():split( ":" );
|
||||
if( #name_parts <2 or name_parts[2]==nil ) then
|
||||
return nil;
|
||||
local name_parts = itemstack:get_name():split(":")
|
||||
if #name_parts < 2 or name_parts[2] == nil then
|
||||
return
|
||||
end
|
||||
|
||||
name_parts = name_parts[2]:split( "_" );
|
||||
name_parts = name_parts[2]:split("_")
|
||||
|
||||
if( #name_parts <2 or name_parts[1]==nil ) then
|
||||
return nil;
|
||||
if #name_parts < 2 or name_parts[1] == nil then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.set_node( pos, {type='node',name='bushes:fruitless_bush'});
|
||||
local meta = minetest.get_meta( pos );
|
||||
meta:set_string( 'bush_type', name_parts[1] );
|
||||
|
||||
return nil;
|
||||
minetest.set_node(pos, {name = "bushes:fruitless_bush"})
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("bush_type", name_parts[1])
|
||||
end
|
||||
|
||||
|
||||
|
||||
-- regrow berries (uses a base abm instead of plants_lib because of the use of metadata).
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = { "bushes:fruitless_bush" },
|
||||
nodenames = {"bushes:fruitless_bush"},
|
||||
neighbors = {"group:soil", "group:potting_soil"},
|
||||
interval = 500,
|
||||
chance = 5,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
|
||||
local meta = minetest.get_meta( pos );
|
||||
local bush_name = meta:get_string( 'bush_type' );
|
||||
if( bush_name ~= nil and bush_name ~= '' ) then
|
||||
local dirtpos = { x = pos.x, y = pos.y-1, z = pos.z }
|
||||
local meta = minetest.get_meta(pos)
|
||||
local bush_name = meta:get_string("bush_type")
|
||||
|
||||
if bush_name and bush_name ~= "" then
|
||||
local dirtpos = {x = pos.x, y = pos.y-1, z = pos.z}
|
||||
local dirt = minetest.get_node(dirtpos)
|
||||
if dirt.name == "farming:soil_wet" or math.random(1,3) == 1 then
|
||||
minetest.set_node( pos, {type='node',name='bushes:'..bush_name..'_bush'})
|
||||
local is_soil = minetest.get_item_group(dirt.name, "soil") or minetest.get_item_group(dirt.name, "potting_soil")
|
||||
|
||||
if is_soil and (dirt.name == "farming:soil_wet" or math.random(1,3) == 1) then
|
||||
minetest.set_node( pos, {name = "bushes:" .. bush_name .. "_bush"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -153,11 +150,14 @@ for i, bush_name in ipairs(bushes_classic.bushes) do
|
|||
|
||||
minetest.register_node(":bushes:basket_"..bush_name, {
|
||||
description = S("Basket with "..desc.." Pies"),
|
||||
drawtype = "mesh",
|
||||
mesh = "bushes_basket_full.obj",
|
||||
tiles = {
|
||||
"bushes_basket_"..bush_name.."_top.png",
|
||||
"bushes_basket_bottom.png",
|
||||
"bushes_basket_side.png"
|
||||
"bushes_basket_pie_"..bush_name..".png",
|
||||
"bushes_basket.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
on_use = minetest.item_eat(18),
|
||||
groups = { dig_immediate = 3 },
|
||||
})
|
||||
|
@ -177,35 +177,22 @@ for i, bush_name in ipairs(bushes_classic.bushes) do
|
|||
end
|
||||
|
||||
minetest.register_node(":bushes:" .. bush_name .. "_bush", {
|
||||
description = S(desc.." Bush"),
|
||||
drawtype = "nodebox",
|
||||
tiles = {texture_top, texture_bottom, "bushes_" .. bush_name .. "_bush.png"},
|
||||
inventory_image = "bushes_" .. bush_name .. "_bush.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-1/16, -8/16, -1/16, 1/16, -6/16, 1/16},
|
||||
{-4/16, -6/16, -4/16, 4/16, 5/16, 4/16},
|
||||
{-5/16, -5/16, -5/16, 5/16, 3/16, 5/16},
|
||||
{-6/16, -4/16, -6/16, 6/16, 2/16, 6/16},
|
||||
{-6.5/16, -3/16, -6.5/16, 6.5/16, -2/16, 6.5/16},
|
||||
{-3/16, 5/16, -3/16, 3/16, 6/16, 3/16},
|
||||
{-2/16, 5/16, -2/16, 2/16, 7/16, 2/16}
|
||||
}
|
||||
},
|
||||
|
||||
groups = groups,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = "",
|
||||
after_dig_node = function( pos, oldnode, oldmetadata, digger )
|
||||
return plantlife_bushes.after_dig_node(pos, oldnode, oldmetadata, digger);
|
||||
end,
|
||||
after_place_node = function( pos, placer, itemstack )
|
||||
return plantlife_bushes.after_place_node(pos, placer, itemstack);
|
||||
end,
|
||||
description = S(desc.." Bush"),
|
||||
drawtype = "mesh",
|
||||
mesh = "bushes_bush.obj",
|
||||
tiles = {"bushes_bush_"..bush_name..".png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = groups,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = "",
|
||||
after_dig_node = function( pos, oldnode, oldmetadata, digger )
|
||||
return plantlife_bushes.after_dig_node(pos, oldnode, oldmetadata, digger);
|
||||
end,
|
||||
after_place_node = function( pos, placer, itemstack )
|
||||
return plantlife_bushes.after_place_node(pos, placer, itemstack);
|
||||
end,
|
||||
})
|
||||
|
||||
-- do not spawn fruitless bushes
|
||||
|
@ -214,14 +201,13 @@ for i, bush_name in ipairs(bushes_classic.bushes) do
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
minetest.register_node(":bushes:basket_empty", {
|
||||
description = S("Basket"),
|
||||
tiles = {
|
||||
"bushes_basket_empty_top.png",
|
||||
"bushes_basket_bottom.png",
|
||||
"bushes_basket_side.png"
|
||||
},
|
||||
drawtype = "mesh",
|
||||
mesh = "bushes_basket_empty.obj",
|
||||
tiles = { "bushes_basket.png" },
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = { dig_immediate = 3 },
|
||||
})
|
||||
|
||||
|
|
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 248 B |
Before Width: | Height: | Size: 271 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 601 B |
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 612 B |
Before Width: | Height: | Size: 391 B After Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 602 B |
Before Width: | Height: | Size: 771 B After Width: | Height: | Size: 606 B |
Before Width: | Height: | Size: 409 B After Width: | Height: | Size: 347 B |
After Width: | Height: | Size: 8.9 KiB |
After Width: | Height: | Size: 9.0 KiB |
Before Width: | Height: | Size: 9.9 KiB |
After Width: | Height: | Size: 7.7 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 979 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 705 B After Width: | Height: | Size: 607 B |
Before Width: | Height: | Size: 739 B After Width: | Height: | Size: 597 B |
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 716 B After Width: | Height: | Size: 565 B |
Before Width: | Height: | Size: 781 B After Width: | Height: | Size: 586 B |
Before Width: | Height: | Size: 421 B After Width: | Height: | Size: 337 B |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 708 B After Width: | Height: | Size: 613 B |
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 610 B |
Before Width: | Height: | Size: 411 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 671 B After Width: | Height: | Size: 577 B |
Before Width: | Height: | Size: 747 B After Width: | Height: | Size: 606 B |
Before Width: | Height: | Size: 386 B After Width: | Height: | Size: 339 B |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.0 KiB |
|
@ -1 +1,2 @@
|
|||
plants_lib
|
||||
|
||||
|
|
|
@ -1,11 +1,4 @@
|
|||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = plantslib.intllib
|
||||
|
||||
-- This file supplies a few additional plants and some related crafts
|
||||
-- for the plantlife modpack. Last revision: 2013-04-24
|
||||
|
@ -19,6 +12,8 @@ local lilies_max_count = 320
|
|||
local lilies_rarity = 33
|
||||
local seaweed_max_count = 320
|
||||
local seaweed_rarity = 33
|
||||
local sunflowers_max_count = 10
|
||||
local sunflowers_rarity = 25
|
||||
|
||||
-- register the various rotations of waterlilies
|
||||
|
||||
|
@ -225,53 +220,35 @@ for i in ipairs(algae_list) do
|
|||
})
|
||||
end
|
||||
|
||||
-- register all potted plant nodes, crafts, and most backward-compat aliases
|
||||
-- Description, base node name, item to craft flowerpot with
|
||||
|
||||
local flowers_list = {
|
||||
{ "Rose", "rose", "flowers:rose" },
|
||||
{ "Tulip", "tulip", "flowers:tulip" },
|
||||
{ "Yellow Dandelion", "dandelion_yellow", "flowers:dandelion_yellow" },
|
||||
{ "White Dandelion", "dandelion_white", "flowers:dandelion_white" },
|
||||
{ "Blue Geranium", "geranium", "flowers:geranium" },
|
||||
{ "Viola", "viola", "flowers:viola" },
|
||||
{ "Cactus", "cactus", "default:cactus" },
|
||||
{ "Bonsai", "bonsai", "default:sapling" }
|
||||
local box = {
|
||||
type="fixed",
|
||||
fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } },
|
||||
}
|
||||
|
||||
for i in ipairs(flowers_list) do
|
||||
local flowerdesc = flowers_list[i][1]
|
||||
local flower = flowers_list[i][2]
|
||||
local craftwith = flowers_list[i][3]
|
||||
|
||||
minetest.register_node(":flowers:potted_"..flower, {
|
||||
description = S("Potted "..flowerdesc),
|
||||
drawtype = "plantlike",
|
||||
tiles = { "flowers_potted_"..flower..".png" },
|
||||
inventory_image = "flowers_potted_"..flower..".png",
|
||||
wield_image = "flowers_potted_"..flower..".png",
|
||||
sunlight_propagates = true,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = { snappy = 3,flammable=2 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
|
||||
},
|
||||
})
|
||||
minetest.register_node(":flowers:sunflower", {
|
||||
description = "Sunflower",
|
||||
drawtype = "mesh",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
inventory_image = "flowers_sunflower_inv.png",
|
||||
mesh = "flowers_sunflower.obj",
|
||||
tiles = { "flowers_sunflower.png" },
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
is_ground_content = true,
|
||||
groups = { dig_immediate=3, flora=1, flammable=3 },
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = box,
|
||||
collision_box = box,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = "shapeless",
|
||||
output = "flowers:potted_"..flower,
|
||||
recipe = {
|
||||
craftwith,
|
||||
"flowers:flower_pot"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_alias("flowers:flower_"..flower.."_pot", "flowers:potted_"..flower)
|
||||
end
|
||||
minetest.override_item("flowers:sunflower", {drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {"farming:seed_wheat"}, rarity = 8},
|
||||
{items = {"flowers:sunflower"}},
|
||||
}
|
||||
}})
|
||||
|
||||
local extra_aliases = {
|
||||
"waterlily",
|
||||
|
@ -387,6 +364,20 @@ plantslib:register_generate_plant({
|
|||
},
|
||||
flowers_plus.grow_seaweed
|
||||
)
|
||||
|
||||
plantslib:register_generate_plant({
|
||||
surface = {"default:dirt_with_grass"},
|
||||
avoid_nodes = { "flowers:sunflower" },
|
||||
max_count = sunflowers_max_count,
|
||||
rarity = sunflowers_rarity,
|
||||
min_elevation = 0,
|
||||
plantlife_limit = -0.9,
|
||||
temp_max = 0.53,
|
||||
random_facedir = {0,3},
|
||||
},
|
||||
"flowers:sunflower"
|
||||
)
|
||||
|
||||
-- spawn ABM registrations
|
||||
|
||||
plantslib:spawn_on_surfaces({
|
||||
|
@ -452,19 +443,20 @@ plantslib:spawn_on_surfaces({
|
|||
facedir = 1
|
||||
})
|
||||
|
||||
-- crafting recipes!
|
||||
|
||||
minetest.register_craftitem(":flowers:flower_pot", {
|
||||
description = S("Flower Pot"),
|
||||
inventory_image = "flowers_flowerpot.png",
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "flowers:flower_pot",
|
||||
recipe = {
|
||||
{ "default:clay_brick", "", "default:clay_brick" },
|
||||
{ "", "default:clay_brick", "" }
|
||||
},
|
||||
plantslib:spawn_on_surfaces({
|
||||
spawn_delay = SPAWN_DELAY*2,
|
||||
spawn_plants = {"flowers:sunflower"},
|
||||
spawn_chance = SPAWN_CHANCE*2,
|
||||
spawn_surfaces = {"default:dirt_with_grass"},
|
||||
avoid_nodes = {"group:flower", "flowers:sunflower"},
|
||||
seed_diff = flowers_seed_diff,
|
||||
light_min = 11,
|
||||
light_max = 14,
|
||||
min_elevation = 0,
|
||||
plantlife_limit = -0.9,
|
||||
temp_max = 0.53,
|
||||
random_facedir = {0,3},
|
||||
avoid_radius = 5
|
||||
})
|
||||
|
||||
-- Cotton plants are now provided by the default "farming" mod.
|
||||
|
@ -478,5 +470,6 @@ minetest.register_alias("flowers:flower_cotton_pot", "flowers:potted_dandelion_w
|
|||
minetest.register_alias("flowers:potted_cotton_plant", "flowers:potted_dandelion_white")
|
||||
minetest.register_alias("flowers:cotton", "farming:string")
|
||||
minetest.register_alias("flowers:cotton_wad", "farming:string")
|
||||
minetest.register_alias("sunflower:sunflower", "flowers:sunflower")
|
||||
|
||||
print(S("[Flowers] Loaded."))
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
# Template
|
||||
|
||||
Waterlily = Nénuphar
|
||||
Seaweed = Algues
|
||||
Potted Rose = Rose en pot
|
||||
Potted Tulip = Tulipe en pot
|
||||
Potted Yellow Dandelion = Pissenlit jaune en pot
|
||||
Potted White Dandelion = Pissenlit blanc en pot
|
||||
Potted Blue Geranium = Géranium bleu en pot
|
||||
Potted Viola = Violette en pot
|
||||
Flower Pot = Fleurs en pot
|
||||
|
||||
[Flowers] Loaded. = [Fleurs] Chargées.
|
|
@ -0,0 +1,73 @@
|
|||
# Blender v2.70 (sub 0) OBJ File: 'sunflower.blend'
|
||||
# www.blender.org
|
||||
mtllib sunflower_sunflower.mtl
|
||||
o Cube
|
||||
v -0.015625 -0.500000 0.028125
|
||||
v -0.015625 -0.500000 -0.028125
|
||||
v 0.028125 -0.500000 -0.028125
|
||||
v 0.028125 -0.500000 0.028125
|
||||
v -0.015625 0.790890 0.028125
|
||||
v -0.015625 0.689140 -0.028125
|
||||
v 0.028125 0.689140 -0.028125
|
||||
v 0.028125 0.790890 0.028125
|
||||
v 0.250000 0.533494 -0.125000
|
||||
v -0.250000 0.533494 -0.125000
|
||||
v 0.250000 0.966506 0.125000
|
||||
v -0.250000 0.966506 0.125000
|
||||
v 0.267063 0.373606 -0.088749
|
||||
v 0.044375 0.303464 -0.141576
|
||||
v 0.239202 0.473737 0.108253
|
||||
v -0.008452 0.378817 0.108253
|
||||
v 0.017721 0.016639 -0.112053
|
||||
v -0.231280 0.110242 -0.115181
|
||||
v -0.030356 -0.036246 0.146223
|
||||
v -0.252831 0.028885 0.088910
|
||||
v 0.062500 0.641747 -0.057917
|
||||
v -0.106953 0.097386 -0.113617
|
||||
v -0.006318 -0.053008 0.024707
|
||||
v 0.118968 0.360674 0.006909
|
||||
v 0.116101 0.452031 0.108253
|
||||
v 0.017962 0.298392 -0.019504
|
||||
v 0.145794 0.358736 -0.115163
|
||||
v 0.240237 0.375544 0.033323
|
||||
v -0.224509 0.021356 -0.032606
|
||||
v -0.131273 0.023638 0.117567
|
||||
v -0.102951 0.016109 -0.003950
|
||||
vt 0.750000 0.875000
|
||||
vt 0.625000 0.875000
|
||||
vt 0.625000 0.750000
|
||||
vt 0.750000 0.750000
|
||||
vt 0.750000 1.000000
|
||||
vt 0.625000 1.000000
|
||||
vt 0.625000 0.500000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.500000 1.000000
|
||||
vt 0.000100 0.500100
|
||||
vt 0.499900 0.500100
|
||||
vt 0.499900 0.999900
|
||||
vt 0.000100 0.999900
|
||||
vt 0.250000 0.250000
|
||||
vt 0.500000 0.250000
|
||||
vt 0.250000 0.500000
|
||||
vt 0.000000 0.250000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.250000 0.000000
|
||||
vt 0.000000 0.500000
|
||||
vt 0.500000 0.000000
|
||||
usemtl Sunflower
|
||||
s off
|
||||
f 1/1 2/2 3/3 4/4
|
||||
f 5/5 8/6 7/2 6/1
|
||||
f 1/7 5/8 6/9 2/6
|
||||
f 2/7 6/6 7/9 3/8
|
||||
f 3/7 7/8 8/9 4/6
|
||||
f 5/7 1/8 4/9 8/6
|
||||
f 9/10 10/11 12/12 11/13
|
||||
f 24/14 26/15 16/8 25/16
|
||||
f 31/14 29/17 20/18 30/19
|
||||
f 17/8 22/16 31/14 23/15
|
||||
f 22/16 18/20 29/17 31/14
|
||||
f 27/19 14/21 26/15 24/14
|
||||
f 13/18 27/19 24/14 28/17
|
||||
f 23/15 31/14 30/19 19/21
|
||||
f 28/17 24/14 25/16 15/20
|
Before Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 565 B |
Before Width: | Height: | Size: 509 B |
Before Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 575 B |
Before Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 376 B |
Before Width: | Height: | Size: 368 B |
Before Width: | Height: | Size: 377 B After Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 358 B After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 364 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 383 B After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 811 B |
After Width: | Height: | Size: 378 B |
Before Width: | Height: | Size: 503 B After Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 500 B After Width: | Height: | Size: 409 B |
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 421 B |
Before Width: | Height: | Size: 538 B After Width: | Height: | Size: 435 B |
Before Width: | Height: | Size: 619 B After Width: | Height: | Size: 468 B |
Before Width: | Height: | Size: 612 B After Width: | Height: | Size: 472 B |
Before Width: | Height: | Size: 573 B After Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 368 B After Width: | Height: | Size: 219 B |
|
@ -0,0 +1,14 @@
|
|||
# Turkish translation
|
||||
# mahmutelmas06@hotmail.com
|
||||
|
||||
Waterlily = Nilüfer
|
||||
Seaweed = Deniz yosunu
|
||||
Potted Rose = Saksı gülü
|
||||
Potted Tulip = Saksı lalesi
|
||||
Potted Yellow Dandelion = Sarı hindiba
|
||||
Potted White Dandelion = Beyaz hindiba
|
||||
Potted Blue Geranium = Mavi hindiba
|
||||
Potted Viola = Saksı Menekşesi
|
||||
Flower Pot = Saksı
|
||||
|
||||
[Flowers] Loaded. = [Flowers] yüklendi.
|
|
@ -0,0 +1,579 @@
|
|||
This document describes the Plantlife mod API.
|
||||
|
||||
Last revision: 2015-02-16
|
||||
|
||||
|
||||
=========
|
||||
Functions
|
||||
=========
|
||||
|
||||
There are three main functions defined by the main "plants_lib" mod:
|
||||
|
||||
spawn_on_surfaces()
|
||||
register_generate_plant()
|
||||
grow_plants()
|
||||
|
||||
There are also several internal, helper functions that can be called if so
|
||||
desired, but they are not really intended for use by other mods and may change
|
||||
at any time. They are briefly described below these main functions, but see
|
||||
init.lua for details.
|
||||
|
||||
Most functions in plants lib are declared locally to avoid namespace
|
||||
collisions with other mods. They are accessible via the "plantslib" method,
|
||||
e.g. plantslib:spawn_on_surfaces() and so forth.
|
||||
|
||||
=====
|
||||
spawn_on_surfaces(biome)
|
||||
spawn_on_surfaces(sdelay, splant, sradius, schance, ssurface, savoid)
|
||||
|
||||
This first function is an ABM-based spawner function originally created as
|
||||
part of Ironzorg's flowers mod. It has since been largely extended and
|
||||
expanded. There are two ways to call this function: You can either pass it
|
||||
several individual string and number parameters to use the legacy interface,
|
||||
or you can pass a single biome definition as a table, with all of your options
|
||||
spelled out nicely. This is the preferred method.
|
||||
|
||||
When used with the legacy interface, you must specify the parameters exactly
|
||||
in order, with the first five being mandatory (even if some are set to nil),
|
||||
and the last one being optional:
|
||||
|
||||
sdelay: The value passed to the ABM's interval parameter, in seconds.
|
||||
splant: The node name of the item to spawn (e.g.
|
||||
"flowers:flower_rose"). A plant will of course only be
|
||||
spawned if the node about to be replaced is air.
|
||||
sradius: Don't spawn within this many nodes of the avoid items
|
||||
mentioned below. If set to nil, this check is skipped.
|
||||
schance: The value passed to the ABM's chance parameter, normally in
|
||||
the 10-100 range (1-in-X chance of operating on a given node)
|
||||
ssurface: String with the name of the node on which to spawn the plant
|
||||
in question, such as "default:sand" or
|
||||
"default:dirt_with_grass". It is not recommended to put air,
|
||||
stone, or plain dirt here if you can use some other node, as
|
||||
doing so will cause the engine to process potentially large
|
||||
numbers of such nodes when deciding when to execute the ABM
|
||||
and where it should operate.
|
||||
savoid: Table with a list of groups and/or node names to avoid when
|
||||
spawning the plant, such as {"group:flowers", "default:tree"}.
|
||||
|
||||
When passed a table as the argument, and thus using the modern calling method,
|
||||
you must pass a number of arguments in the form of an ordinary keyed-value
|
||||
table. Below is a list of everything supported by this function:
|
||||
|
||||
biome = {
|
||||
spawn_plants = something, -- [*] String or table; see below.
|
||||
spawn_delay = number, -- same as sdelay, above.
|
||||
spawn_chance = number, -- same as schance, above.
|
||||
spawn_surfaces = {table}, -- List of node names on which the plants
|
||||
-- should be spawned. As with the single-node "ssurface"
|
||||
-- option in the legacy API, you should not put stone, air,
|
||||
-- etc. here.
|
||||
|
||||
---- From here down are a number of optional parameters. You will
|
||||
---- most likely want to use at least some of these to limit how and
|
||||
---- where your objects are spawned.
|
||||
|
||||
avoid_nodes = {table}, -- same meaning as savoid, above
|
||||
avoid_radius = num, -- same as sradius
|
||||
seed_diff = num, -- The Perlin seed difference value passed to the
|
||||
-- minetest.get_perlin() function. Used along with
|
||||
-- the global Perlin controls below to create the
|
||||
-- "biome" in which the plants will spawn. Defaults
|
||||
-- to 0 if not provided.
|
||||
light_min = num, -- Minimum amount of light necessary to make a plant
|
||||
-- spawn. Defaults to 0.
|
||||
light_max = num, -- Maximum amount of light needed to spawn. Defaults
|
||||
-- to the engine's MAX_LIGHT value of 14.
|
||||
neighbors = {table}, -- List of neighboring nodes that need to be
|
||||
-- immediately next to the node the plant is about to
|
||||
-- spawn on. Can also be a string with a single node
|
||||
-- name. It is both passed to the ABM as the
|
||||
-- "neighbors" parameter, and is used to manually
|
||||
-- check the adjacent nodes. It only takes one of
|
||||
-- these for the spawn routine to mark the target as
|
||||
-- spawnable. Defaults to nil (ignored).
|
||||
ncount = num, -- There must be at least this many of the above
|
||||
-- neighbors in the eight spaces immediately
|
||||
-- surrounding the node the plant is about to spawn on
|
||||
-- for it to happen. If not provided, this check is
|
||||
-- disabled.
|
||||
facedir = num, -- The value passed to the param2 variable when adding
|
||||
-- the node to the map. Defaults to 0. Be sure that
|
||||
-- the value you use here (and the range thereof) is
|
||||
-- appropriate for the type of node you're spawning.
|
||||
random_facedir = {table}, -- If set, the table should contain two values.
|
||||
-- If they're both provided, the spawned plant will be
|
||||
-- given a random facedir value in the range specified
|
||||
-- by these two numbers. Overrides the facedir
|
||||
-- parameter above, if it exists. Use {0,3} if you
|
||||
-- want the full range for wallmounted nodes, or {2,5}
|
||||
-- for most everything else, or any other pair of
|
||||
-- numbers appropriate for the node you want to spawn.
|
||||
depth_max = num, -- If the object spawns on top of a water source, the
|
||||
-- water must be at most this deep. Defaults to 1.
|
||||
min_elevation = num, -- Surface must be at this altitude or higher to
|
||||
-- spawn at all. Defaults to -31000...
|
||||
max_elevation = num, -- ...but must be no higher than this altitude.
|
||||
-- Defaults to +31000.
|
||||
near_nodes = {table}, -- List of nodes that must be somewhere in the
|
||||
-- vicinity in order for the plant to spawn. Can also
|
||||
-- be a string with a single node name. If not
|
||||
-- provided, this check is disabled.
|
||||
near_nodes_size = num, -- How large of an area to check for the above
|
||||
-- node. Specifically, this checks a flat, horizontal
|
||||
-- area centered on the node to be spawned on.
|
||||
-- Defaults to 0, but is ignored if the above
|
||||
-- near_nodes value is not set.
|
||||
near_nodes_vertical = num, -- Used with the size value above, this extends
|
||||
-- the vertical range of the near nodes search.
|
||||
-- Basically, this turns the flat region described
|
||||
-- above into a cuboid region. The area to be checked
|
||||
-- will extend this high and this low above/below the
|
||||
-- target node, centered thereon. Defaults to 1 (only
|
||||
-- check the layer above, the layer at, and the layer
|
||||
-- below the target node), but is ignored if
|
||||
-- near_nodes is not set.
|
||||
near_nodes_count = num, -- How many of the above nodes must be within that
|
||||
-- radius. Defaults to 1 but is ignored if near_nodes
|
||||
-- isn't set. Bear in mind that the total area to be
|
||||
-- checked is equal to:
|
||||
-- (near_nodes_size^2)*near_nodes_vertical*2
|
||||
-- For example, if size is 10 and vertical is 4, then
|
||||
-- the area is (10^2)*8 = 800 nodes in size, so you'll
|
||||
-- want to make sure you specify a value appropriate
|
||||
-- for the size of the area being tested.
|
||||
air_size = num, -- How large of an area to check for air above and
|
||||
-- around the target. If omitted, only the space
|
||||
-- above the target is checked. This does not check
|
||||
-- for air at the sides or below the target.
|
||||
air_count = num, -- How many of the surrounding nodes need to be air
|
||||
-- for the above check to return true. If omitted,
|
||||
-- only the space above the target is checked.
|
||||
plantlife_limit = num, -- The value compared against the generic "plants
|
||||
-- can grow here" Perlin noise layer. Smaller numbers
|
||||
-- result in more abundant plants. Range of -1 to +1,
|
||||
-- with values in the range of about 0 to 0.5 being
|
||||
-- most useful. Defaults to 0.1.
|
||||
temp_min = num, -- Minimum temperature needed for the desired object
|
||||
-- to spawn. This is a 2d Perlin value, which has an
|
||||
-- inverted range of +1 to -1. Larger values
|
||||
-- represent *colder* temperatures, so this value is
|
||||
-- actually the upper end of the desired Perlin range.
|
||||
-- See the temperature map section at the bottom of
|
||||
-- this document for details on how these values work.
|
||||
-- Defaults to +1 (unlimited coldness).
|
||||
temp_max = num, -- Maximum temperature/lower end of the Perlin range.
|
||||
-- Defaults to -1 (unlimited heat).
|
||||
humidity_min = num, -- Minimum humidity for the plant to spawn in. Like
|
||||
-- the temperature map, this is a Perlin value where
|
||||
-- lower numbers mean more humidity in the area.
|
||||
-- Defaults to +1 (0% humidity).
|
||||
humidity_max = num, -- Maximum humidity for the plant to spawn at.
|
||||
-- Defaults to -1 (100% humidity).
|
||||
verticals_list = {table}, -- List of nodes that should be considered to be
|
||||
-- natural walls.
|
||||
alt_wallnode = "string", -- If specified, this node will be substituted in
|
||||
-- place of the plant(s) defined by spawn_plants
|
||||
-- above, if the spawn target has one or more adjacent
|
||||
-- walls. In such a case, the two above facedir
|
||||
-- parameters will be ignored.
|
||||
spawn_on_side = bool, -- Set this to true to immediately spawn the node on
|
||||
-- one side of the target node rather than the top.
|
||||
-- The code will search for an airspace to the side of
|
||||
-- the target, then spawn the plant at the first one
|
||||
-- found. The above facedir and random_facedir
|
||||
-- parameters are ignored in this case. If the above
|
||||
-- parameters for selecting generic wall nodes are
|
||||
-- provided, this option is ignored. Important note:
|
||||
-- the facedir values assigned by this option only
|
||||
-- make sense with wallmounted nodes (nodes which
|
||||
-- don't use facedir won't be affected).
|
||||
choose_random_wall = bool, -- if set to true, and searching for walls is
|
||||
-- being done, just pick any random wall if there is
|
||||
-- one, rather than returning the first one.
|
||||
spawn_on_bottom = bool, -- If set to true, spawn the object below the
|
||||
-- target node instead of above it. The above
|
||||
-- spawn_on_side variable takes precedence over this
|
||||
-- one if both happen to be true. When using this
|
||||
-- option with the random facedir function above, the
|
||||
-- values given to the facedir parameter are for
|
||||
-- regular nodes, not wallmounted.
|
||||
spawn_replace_node = bool, -- If set to true, the target node itself is
|
||||
-- replaced by the spawned object. Overrides the
|
||||
-- spawn_on_bottom and spawn_on_side settings.
|
||||
}
|
||||
|
||||
[*] spawn_plants must be either a table or a string. If it's a table, the
|
||||
values therein are treated as a list of nodenames to pick from randomly on
|
||||
each application of the ABM code. The more nodes you can pack into this
|
||||
parameter to avoid making too many calls to this function, the lower the CPU
|
||||
load will likely be.
|
||||
|
||||
You can also specify a string containing the name of a function to execute.
|
||||
In this case, the function will be passed a single position parameter
|
||||
indicating where the function should place the desired object, and the checks
|
||||
for spawning on top vs. sides vs. bottom vs. replacing the target node will be
|
||||
skipped.
|
||||
|
||||
By default, if a biome node, size, and count are not defined, the biome
|
||||
checking is disabled. Same holds true for the nneighbors bit above that.
|
||||
|
||||
|
||||
=====
|
||||
plantslib:register_generate_plant(biome, nodes_or_function_or_treedef)
|
||||
|
||||
To register an object to be spawned at mapgen time rather than via an ABM,
|
||||
call this function with two parameters: a table with your object's biome
|
||||
information, and a string, function, or table describing what to do if the
|
||||
engine finds a suitable surface node (see below).
|
||||
|
||||
The biome table contains quite a number of options, though there are fewer
|
||||
here than are available in the ABM-based spawner, as some stuff doesn't make
|
||||
sense at map-generation time.
|
||||
|
||||
biome = {
|
||||
surface = something, -- What node(s). May be a string such as
|
||||
-- "default:dirt_with_grass" or a table with
|
||||
-- multiple such entries.
|
||||
|
||||
---- Everything else is optional, but you'll definitely want to use
|
||||
---- some of these other fields to limit where and under what
|
||||
---- conditions the objects are spawned.
|
||||
|
||||
below_nodes = {table}, -- List of nodes that must be below the target
|
||||
-- node. Useful in snow biomes to keep objects from
|
||||
-- spawning in snow that's on the wrong surface for
|
||||
-- that object.
|
||||
avoid_nodes = {table}, -- List of nodes to avoid when spawning. Groups are
|
||||
-- not supported here.
|
||||
avoid_radius = num, -- How much distance to leave between the object to be
|
||||
-- added and the objects to be avoided. If this or
|
||||
-- the avoid_nodes value is nil/omitted, this check is
|
||||
-- skipped. Avoid using excessively large radii.
|
||||
rarity = num, -- How rare should this object be in its biome? Larger
|
||||
-- values make objects more rare, via:
|
||||
-- math.random(1,100) > this
|
||||
max_count = num, -- The absolute maximum number of your object that
|
||||
-- should be allowed to spawn in a 5x5x5 mapblock area
|
||||
-- (80x80x80 nodes). Defaults to 5, but be sure you
|
||||
-- set this to some reasonable value depending on your
|
||||
-- object and its size if 5 is insufficient.
|
||||
seed_diff = num, -- Perlin seed-diff value. Defaults to 0, which
|
||||
-- causes the function to inherit the global value of
|
||||
-- 329.
|
||||
neighbors = {table}, -- What ground nodes must be right next to and at the
|
||||
-- same elevation as the node to be spawned on.
|
||||
ncount = num, -- At least this many of the above nodes must be next
|
||||
-- to the node to spawn on. Any value greater than 8
|
||||
-- will probably cause the code to never spawn
|
||||
-- anything. Defaults to 0.
|
||||
depth = num, -- How deep/thick of a layer the spawned-on node must
|
||||
-- be. Typically used for water.
|
||||
min_elevation = num, -- Minimum elevation in meters/nodes. Defaults to
|
||||
-- -31000 (unlimited).
|
||||
max_elevation = num, -- Max elevation. Defaults to +31000 (unlimited).
|
||||
near_nodes = {table}, -- what nodes must be in the general vicinity of the
|
||||
-- object being spawned.
|
||||
near_nodes_size = num, -- how wide of a search area to look for the nodes
|
||||
-- in that list.
|
||||
near_nodes_vertical = num, -- How high/low of an area to search from the
|
||||
-- target node.
|
||||
near_nodes_count = num, -- at least this many of those nodes must be in
|
||||
-- the area.
|
||||
plantlife_limit = num, -- The value compared against the generic "plants
|
||||
-- can grow here" Perlin noise layer. Smaller numbers
|
||||
-- result in more abundant plants. Range of -1 to +1,
|
||||
-- with values in the range of about 0 to 0.5 being
|
||||
-- most useful. Defaults to 0.1.
|
||||
temp_min = num, -- Coldest allowable temperature for a plant to spawn
|
||||
-- (that is, the largest Perlin value).
|
||||
temp_max = num, -- warmest allowable temperature to spawn a plant
|
||||
-- (lowest Perlin value).
|
||||
verticals_list = {table}, -- Same as with the spawn_on_surfaces function.
|
||||
check_air = bool, -- Flag to tell the mapgen code to check for air above
|
||||
-- the spawn target. Defaults to true if not
|
||||
-- explicitly set to false. Set this to false VERY
|
||||
-- SPARINGLY, as it will slow the map generator down.
|
||||
delete_above = bool, -- Flag to tell the mapgen code to delete the two
|
||||
-- nodes directly above the spawn target just before
|
||||
-- adding the plant or tree. Useful when generating
|
||||
-- in snow biomes. Defaults to false.
|
||||
delete_above_surround = bool, -- Flag to tell the mapgen code to also
|
||||
-- delete the five nodes surrounding the above space,
|
||||
-- and the five nodes above those, resulting in a two-
|
||||
-- node-deep cross-shaped empty region above/around
|
||||
-- the spawn target. Useful when adding trees to snow
|
||||
-- biomes. Defaults to false.
|
||||
spawn_replace_node = bool, -- same as with the ABM spawner.
|
||||
random_facedir = {table}, -- same as with the ABM spawner.
|
||||
}
|
||||
|
||||
Regarding nodes_or_function_or_treedef, this must either be a string naming
|
||||
a node to spawn, a table with a list of nodes to choose from, a table with an
|
||||
L-Systems tree definition, or a function.
|
||||
|
||||
If you specified a string, the code will attempt to determine whether that
|
||||
string specifies a valid node name. If it does, that node will be placed on
|
||||
top of the target position directly (unless one of the other mapgen options
|
||||
directs the code to do otherwise).
|
||||
|
||||
If you specified a table and there is no "axiom" field, the code assumes that
|
||||
it is a list of nodes. Simply name one node per entry in the list, e.g.
|
||||
{"default:junglegrass", "default:dry_shrub"} and so on, for as many nodes as
|
||||
you want to list. A random node from the list will be chosen each time the
|
||||
code goes to place a node.
|
||||
|
||||
If you specified a table, and there *is* an "axiom" field, the code assumes
|
||||
that this table contains an L-Systems tree definition, which will be passed
|
||||
directly to the engine's spawn_tree() function along with the position on
|
||||
which to spawn the tree.
|
||||
|
||||
You can also supply a function to be directly executed, which is given the
|
||||
current node position (the usual "pos" table format) as its sole argument. It
|
||||
will be called in the form:
|
||||
|
||||
somefunction(pos)
|
||||
|
||||
|
||||
=====
|
||||
plantslib:grow_plants(options)
|
||||
|
||||
The third function, grow_plants() is used to turn the spawned nodes above
|
||||
into something else over time. This function has no return value, and accepts
|
||||
a biome definition table as the only parameter. These are defined like so:
|
||||
|
||||
options = {
|
||||
grow_plant = "string", -- Name of the node to be grown into something
|
||||
-- else. This value is passed to the ABM as the
|
||||
-- "nodenames" parameter, so it is the plants
|
||||
-- themselves that are the ABM trigger, rather than
|
||||
-- the ground they spawned on. A plant will only grow
|
||||
-- if the node above it is air. Can also be a table,
|
||||
-- but note that all nodes referenced therein will be
|
||||
-- grown into the same object.
|
||||
grow_delay = num, -- Passed as the ABM "interval" parameter, as with
|
||||
-- spawning.
|
||||
grow_chance = num, -- Passed as the ABM "chance" parameter.
|
||||
grow_result = "string", -- Name of the node into which the grow_plant
|
||||
-- node(s) should transform when the ABM executes.
|
||||
|
||||
---- Everything from here down is optional.
|
||||
|
||||
dry_early_node = "string", -- This value is ignored except for jungle
|
||||
-- grass (a corner case needed by that mod), where it
|
||||
-- indicates which node the grass must be on in order
|
||||
-- for it to turn from the short size to
|
||||
-- "default:dry_shrub" instead of the medium size.
|
||||
grow_nodes = {table}, -- One of these nodes must be under the plant in
|
||||
-- order for it to grow at all. Normally this should
|
||||
-- be the same as the list of surfaces passed to the
|
||||
-- spawning ABM as the "nodenames" parameter. This is
|
||||
-- so that the plant can be manually placed on
|
||||
-- something like a flower pot or something without it
|
||||
-- necessarily growing and perhaps dieing. Defaults
|
||||
-- to "default:dirt_with_grass".
|
||||
facedir = num, -- Same as with spawning a plant.
|
||||
need_wall = bool, -- Set this to true if you the plant needs to grow
|
||||
-- against a wall. Defaults to false.
|
||||
verticals_list = {table}, -- same as with spawning a plant.
|
||||
choose_random_wall = bool, -- same as with spawning a plant.
|
||||
grow_vertically = bool, -- Set this to true if the plant needs to grow
|
||||
-- vertically, as in climbing poison ivy. Defaults to
|
||||
-- false.
|
||||
height_limit = num, -- Set this to limit how tall the desired node can
|
||||
-- grow. The mod will search straight down from the
|
||||
-- position being spawned at to find a ground node,
|
||||
-- set via the field below. Defaults to 5 nodes.
|
||||
ground_nodes = {table}, -- What nodes should be treated as "the ground"
|
||||
-- below a vertically-growing plant. Usually this
|
||||
-- should be the same as the grow_nodes table, but
|
||||
-- might also include, for example, water or some
|
||||
-- other surrounding material. Defaults to
|
||||
-- "default:dirt_with_grass".
|
||||
grow_function = something, -- [*] see below.
|
||||
seed_diff = num, -- [*] see below.
|
||||
}
|
||||
|
||||
[*] grow_function can take one of three possible settings: it can be nil (or
|
||||
not provided), a string, or a table.
|
||||
|
||||
If it is not provided or it's set to nil, all of the regular growing code is
|
||||
executed normally, the value of seed_diff, if any, is ignored, and the node to
|
||||
be placed is assumed to be specified in the grow_result variable.
|
||||
|
||||
If this value is set to a simple string, this is treated as the name of the
|
||||
function to use to grow the plant. In this case, all of the usual growing
|
||||
code is executeed, but then instead of a plant being simply added to the
|
||||
world, grow_result is ignored and the named function is executed and passed a
|
||||
few parmeters in the following general form:
|
||||
|
||||
somefunction(pos, perlin1, perlin2)
|
||||
|
||||
These values represent the current position (the usual table), the Perlin
|
||||
noise value for that spot in the generic "plants can grow here" map for the
|
||||
seed_diff value above, the Perlin value for that same spot from the
|
||||
temperature map, and the detected neighboring wall face, if there was one (or
|
||||
nil if not). If seed_diff is not provided, it defaults to 0.
|
||||
|
||||
If this variable is instead set to a table, it is treated an an L-Systems tree
|
||||
definition. All of the growing code is executed in the usual manner, then the
|
||||
tree described by that definition is spawned at the current position instead,
|
||||
and grow_result is ignored.
|
||||
|
||||
|
||||
=====
|
||||
find_adjacent_wall(pos, verticals, randomflag)
|
||||
|
||||
Of the few helper functions, this one expects a position parameter and a table
|
||||
with the list of nodes that should be considered as walls. The code will
|
||||
search around the given position for a neighboring wall, returning the first
|
||||
one it finds as a facedir value, or nil if there are no adjacent walls.
|
||||
|
||||
If randomflag is set to true, the function will just return the facedir of any
|
||||
random wall it finds adjacent to the target position. Defaults to false if
|
||||
not specified.
|
||||
|
||||
=====
|
||||
is_node_loaded(pos)
|
||||
|
||||
This acts as a wrapper for the minetest.get_node_or_nil(node_pos)
|
||||
function and accepts a single position parameter. Returns true if the node in
|
||||
question is already loaded, or false if not.
|
||||
|
||||
|
||||
=====
|
||||
dbg(string)
|
||||
|
||||
This is a simple debug output function which takes one string parameter. It
|
||||
just checks if DEBUG is true and outputs the phrase "[Plantlife] " followed by
|
||||
the supplied string, via the print() function, if so.
|
||||
|
||||
=====
|
||||
plantslib:generate_tree(pos, treemodel)
|
||||
plantslib:grow_tree(pos, treemodel)
|
||||
|
||||
In the case of the growing code and the mapgen-based tree generator code,
|
||||
generating a tree is done via the above two calls, which in turn immediately
|
||||
call the usual spawn_tree() functions. This rerouting exists as a way for
|
||||
other mods to hook into plants_lib's tree-growing functions in general,
|
||||
perhaps to execute something extra whenever a tree is spawned.
|
||||
|
||||
plantslib:generate_tree(pos, treemodel) is called any time a tree is spawned
|
||||
at map generation time. 'pos' is the position of the block on which the tree
|
||||
is to be placed. 'treemodel' is the standard L-Systems tree definition table
|
||||
expected by the spawn_tree() function. Refer to the 'trunk' field in that
|
||||
table to derive the name of the tree being spawned.
|
||||
|
||||
plantslib:grow_tree(pos, treemodel) does the same sort of thing whenever a
|
||||
tree is spawned within the abm-based growing code, for example when growing a
|
||||
sapling into a tree.
|
||||
|
||||
|
||||
=====
|
||||
There are other, internal helper functions that are not meant for use by other
|
||||
mods. Don't rely on them, as they are subject to change without notice.
|
||||
|
||||
|
||||
===============
|
||||
Global Settings
|
||||
===============
|
||||
|
||||
Set this to true if you want the mod to spam your console with debug info :-)
|
||||
|
||||
plantlife_debug = false
|
||||
|
||||
|
||||
======================
|
||||
Fertile Ground Mapping
|
||||
======================
|
||||
|
||||
The mod uses Perlin noise to create "biomes" of the various plants, via the
|
||||
minetest.get_perlin() function. At present, there are three layers of
|
||||
Perlin noise used.
|
||||
|
||||
The first one is for a "fertile ground" layer, which I tend to refer to as the
|
||||
generic "stuff can potentially grow here" layer. Its values are hard-coded:
|
||||
|
||||
plantslib.plantlife_seed_diff = 329
|
||||
perlin_octaves = 3
|
||||
perlin_persistence = 0.6
|
||||
perlin_scale = 100
|
||||
|
||||
For more information on how Perlin noise is generated, you will need to search
|
||||
the web, as these default values were from that which is used by minetest_game
|
||||
to spawn jungle grass at mapgen time, and I'm still learning how Perlin noise
|
||||
works. ;-)
|
||||
|
||||
|
||||
===================
|
||||
Temperature Mapping
|
||||
===================
|
||||
|
||||
The second Perlin layer is a temperature map, with values taken from
|
||||
SPlizard's Snow Biomes mod so that the two will be compatible, since that mod
|
||||
appears to be the standard now. Those values are:
|
||||
|
||||
temperature_seeddiff = 112
|
||||
temperature_octaves = 3
|
||||
temperature_persistence = 0.5
|
||||
temperature_scale = 150
|
||||
|
||||
The way Perlin values are used by this mod, in keeping with the snow mod's
|
||||
apparent methods, larger values returned by the Perlin function represent
|
||||
*colder* temperatures. In this mod, the following table gives a rough
|
||||
approximation of how temperature maps to these values, normalized to
|
||||
0.53 = 0 °C and +1.0 = -25 °C.
|
||||
|
||||
Perlin Approx. Temperature
|
||||
-1.0 81 °C ( 178 °F)
|
||||
-0.75 68 °C ( 155 °F)
|
||||
-0.56 58 °C ( 136 °F)
|
||||
-0.5 55 °C ( 131 °F)
|
||||
-0.25 41 °C ( 107 °F)
|
||||
-0.18 38 °C ( 100 °F)
|
||||
0 28 °C ( 83 °F)
|
||||
0.13 21 °C ( 70 °F)
|
||||
0.25 15 °C ( 59 °F)
|
||||
0.5 2 °C ( 35 °F)
|
||||
0.53 0 °C ( 32 °F)
|
||||
0.75 -12 °C ( 11 °F)
|
||||
0.86 -18 °C ( 0 °F)
|
||||
1.0 -25 °C (- 13 °F)
|
||||
|
||||
Included in this table are even 0.25 steps in Perlin values along with some
|
||||
common temperatures on both the Centigrade and Fahrenheit scales. Note that
|
||||
unless you're trying to model the Moon or perhaps Mercury in your mods/maps,
|
||||
you probably won't need to bother with Perlin values of less than -0.56 or so.
|
||||
|
||||
|
||||
================
|
||||
Humidity Mapping
|
||||
================
|
||||
|
||||
Last but not least is a moisture/humidity map. Like the temperature map
|
||||
above, Perlin values can be tested to determine the approximate humidity of
|
||||
the *air* in the area. This humidity map is basically the perlin layer used
|
||||
for deserts.
|
||||
|
||||
A value of +1.0 is very moist (basically a thick fog, if it could be seen), a
|
||||
value of roughly +0.25 represents the edge of a desert as usually seen in the
|
||||
game, and a value of -1.0 is as dry as a bone.
|
||||
|
||||
This does not check for nearby water, just general air humidity, and that
|
||||
being the case, nearby ground does not affect the reported humidity of a
|
||||
region (because this isn't yet possible to calculate yet). Use the near_nodes
|
||||
and avoid_nodes parameters and their related options to check for water and
|
||||
such.
|
||||
|
||||
The Perlin values use for this layer are:
|
||||
|
||||
humidity_seeddiff = 9130
|
||||
humidity_octaves = 3
|
||||
humidity_persistence = 0.5
|
||||
humidity_scale = 250
|
||||
|
||||
And this particular one is mapped slightly differently from the others:
|
||||
|
||||
noise3 = perlin3:get2d({x=p_top.x+150, y=p_top.z+50})
|
||||
|
||||
(Note the +150 and +50 offsets)
|
||||
|
|
@ -1 +1,3 @@
|
|||
default
|
||||
intllib?
|
||||
|
||||
|
|
|
@ -26,17 +26,17 @@ plantslib.actionslist_aircheck = {}
|
|||
plantslib.actionslist_no_aircheck = {}
|
||||
|
||||
plantslib.modpath = minetest.get_modpath("plants_lib")
|
||||
plantslib.intllib_modpath = minetest.get_modpath("intllib")
|
||||
|
||||
plantslib.total_no_aircheck_calls = 0
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if plantslib.intllib_modpath then
|
||||
dofile(plantslib.intllib_modpath.."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
if minetest.get_modpath("intllib") then
|
||||
S = intllib.Getter()
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
S = function(s) return s end
|
||||
end
|
||||
plantslib.intllib = S
|
||||
|
||||
local DEBUG = false --... except if you want to spam the console with debugging info :-)
|
||||
|
||||
|
@ -325,8 +325,7 @@ end
|
|||
-- Primary mapgen spawner, for mods that can work with air checking enabled on
|
||||
-- a surface during the initial map read stage.
|
||||
|
||||
function plantslib:generate_block_with_air_checking(dtime)
|
||||
|
||||
function plantslib:generate_block_with_air_checking()
|
||||
if #plantslib.blocklist_aircheck > 0 then
|
||||
|
||||
local minp = plantslib.blocklist_aircheck[1][1]
|
||||
|
@ -339,17 +338,22 @@ function plantslib:generate_block_with_air_checking(dtime)
|
|||
|
||||
if not plantslib.surface_nodes_aircheck.blockhash then
|
||||
|
||||
local search_area = minetest.find_nodes_in_area(minp, maxp, plantslib.surfaceslist_aircheck)
|
||||
if type(minetest.find_nodes_in_area_under_air) == "function" then -- use newer API call
|
||||
plantslib.surface_nodes_aircheck.blockhash =
|
||||
minetest.find_nodes_in_area_under_air(minp, maxp, plantslib.surfaceslist_aircheck)
|
||||
else
|
||||
local search_area = minetest.find_nodes_in_area(minp, maxp, plantslib.surfaceslist_aircheck)
|
||||
|
||||
-- search the generated block for air-bounded surfaces
|
||||
-- search the generated block for air-bounded surfaces the slow way.
|
||||
|
||||
plantslib.surface_nodes_aircheck.blockhash = {}
|
||||
plantslib.surface_nodes_aircheck.blockhash = {}
|
||||
|
||||
for i = 1, #search_area do
|
||||
local pos = search_area[i]
|
||||
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
|
||||
if minetest.get_node(p_top).name == "air" then
|
||||
plantslib.surface_nodes_aircheck.blockhash[#plantslib.surface_nodes_aircheck.blockhash + 1] = pos
|
||||
for i = 1, #search_area do
|
||||
local pos = search_area[i]
|
||||
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
|
||||
if minetest.get_node(p_top).name == "air" then
|
||||
plantslib.surface_nodes_aircheck.blockhash[#plantslib.surface_nodes_aircheck.blockhash + 1] = pos
|
||||
end
|
||||
end
|
||||
end
|
||||
plantslib.actioncount_aircheck.blockhash = 1
|
||||
|
@ -375,8 +379,7 @@ end
|
|||
-- Secondary mapgen spawner, for mods that require disabling of
|
||||
-- checking for air during the initial map read stage.
|
||||
|
||||
function plantslib:generate_block_no_aircheck(dtime)
|
||||
|
||||
function plantslib:generate_block_no_aircheck()
|
||||
if #plantslib.blocklist_no_aircheck > 0 then
|
||||
|
||||
local minp = plantslib.blocklist_no_aircheck[1][1]
|
||||
|
@ -422,11 +425,42 @@ end)
|
|||
-- "Play" them back, populating them with new stuff in the process
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
plantslib:generate_block_with_air_checking(dtime)
|
||||
if dtime < 0.2 and -- don't attempt to populate if lag is already too high
|
||||
(#plantslib.blocklist_aircheck > 0 or #plantslib.blocklist_no_aircheck > 0) then
|
||||
plantslib.globalstep_start_time = minetest.get_us_time()
|
||||
plantslib.globalstep_runtime = 0
|
||||
while (#plantslib.blocklist_aircheck > 0 or #plantslib.blocklist_no_aircheck > 0)
|
||||
and plantslib.globalstep_runtime < 200000 do -- 0.2 seconds, in uS.
|
||||
if #plantslib.blocklist_aircheck > 0 then
|
||||
plantslib:generate_block_with_air_checking()
|
||||
end
|
||||
if #plantslib.blocklist_no_aircheck > 0 then
|
||||
plantslib:generate_block_no_aircheck()
|
||||
end
|
||||
plantslib.globalstep_runtime = minetest.get_us_time() - plantslib.globalstep_start_time
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
plantslib:generate_block_no_aircheck(dtime)
|
||||
-- Play out the entire log all at once on shutdown
|
||||
-- to prevent unpopulated map areas
|
||||
|
||||
minetest.register_on_shutdown(function()
|
||||
print("[plants_lib] Stand by, playing out the rest of the aircheck mapblock log")
|
||||
print("(there are "..#plantslib.blocklist_aircheck.." entries)...")
|
||||
while true do
|
||||
plantslib:generate_block_with_air_checking(0.1)
|
||||
if #plantslib.blocklist_aircheck == 0 then return end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_shutdown(function()
|
||||
print("[plants_lib] Stand by, playing out the rest of the no-aircheck mapblock log")
|
||||
print("(there are "..#plantslib.blocklist_aircheck.." entries)...")
|
||||
while true do
|
||||
plantslib:generate_block_no_aircheck(0.1)
|
||||
if #plantslib.blocklist_no_aircheck == 0 then return end
|
||||
end
|
||||
end)
|
||||
|
||||
-- The spawning ABM
|
||||
|
@ -483,7 +517,7 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
|
|||
and pos.y >= biome.min_elevation
|
||||
and pos.y <= biome.max_elevation
|
||||
then
|
||||
local walldir = plantslib:find_adjacent_wall(p_top, biome.verticals_list)
|
||||
local walldir = plantslib:find_adjacent_wall(p_top, biome.verticals_list, biome.choose_random_wall)
|
||||
if biome.alt_wallnode and walldir then
|
||||
if n_top.name == "air" then
|
||||
minetest.set_node(p_top, { name = biome.alt_wallnode, param2 = walldir })
|
||||
|
@ -499,8 +533,8 @@ function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa)
|
|||
if biome.random_facedir then
|
||||
fdir = math.random(biome.random_facedir[1],biome.random_facedir[2])
|
||||
end
|
||||
if type(spawn_plants) == "string" then
|
||||
assert(loadstring(spawn_plants.."(...)"))(pos)
|
||||
if type(biome.spawn_plants) == "string" then
|
||||
assert(loadstring(biome.spawn_plants.."(...)"))(pos)
|
||||
elseif not biome.spawn_on_side and not biome.spawn_on_bottom and not biome.spawn_replace_node then
|
||||
if n_top.name == "air" then
|
||||
minetest.set_node(p_top, { name = plant_to_spawn, param2 = fdir })
|
||||
|
@ -555,10 +589,10 @@ function plantslib:grow_plants(opts)
|
|||
local root_node = minetest.get_node({x=pos.x, y=pos.y-options.height_limit, z=pos.z})
|
||||
local walldir = nil
|
||||
if options.need_wall and options.verticals_list then
|
||||
walldir = plantslib:find_adjacent_wall(p_top, options.verticals_list)
|
||||
walldir = plantslib:find_adjacent_wall(p_top, options.verticals_list, options.choose_random_wall)
|
||||
end
|
||||
if n_top.name == "air" and (not options.need_wall or (options.need_wall and walldir))
|
||||
then
|
||||
if (n_top.name == "air" or n_top.name == "default:snow")
|
||||
and (not options.need_wall or (options.need_wall and walldir)) then
|
||||
-- corner case for changing short junglegrass
|
||||
-- to dry shrub in desert
|
||||
if n_bot.name == options.dry_early_node and options.grow_plant == "junglegrass:short" then
|
||||
|
@ -612,12 +646,24 @@ end
|
|||
-- function to decide if a node has a wall that's in verticals_list{}
|
||||
-- returns wall direction of valid node, or nil if invalid.
|
||||
|
||||
function plantslib:find_adjacent_wall(pos, verticals)
|
||||
function plantslib:find_adjacent_wall(pos, verticals, randomflag)
|
||||
local verts = dump(verticals)
|
||||
if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then return 3 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then return 2 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then return 5 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z+1 }).name) then return 4 end
|
||||
if randomflag then
|
||||
local walltab = {}
|
||||
|
||||
if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 3 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 2 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then walltab[#walltab + 1] = 5 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z+1 }).name) then walltab[#walltab + 1] = 4 end
|
||||
|
||||
if #walltab > 0 then return walltab[math.random(1, #walltab)] end
|
||||
|
||||
else
|
||||
if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then return 3 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then return 2 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then return 5 end
|
||||
if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z+1 }).name) then return 4 end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
# Template
|
||||
|
||||
someone = quelqu'un
|
||||
Sorry, %s owns that spot. = Désolé, %s possède cet endroit.
|
||||
[Plantlife Library] Loaded = [Librairie Plantlife] Chargée.
|
|
@ -0,0 +1,5 @@
|
|||
# Turkish translation by mahmutelmas06
|
||||
|
||||
someone = birisi
|
||||
Sorry, %s owns that spot. = Üzgünüm, buranın sahibi %s.
|
||||
[Plantlife Library] Loaded = [Plantlife Library] yüklendi
|
|
@ -1 +1,2 @@
|
|||
plants_lib
|
||||
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
-- This file supplies poison ivy for the plantlife modpack
|
||||
-- Last revision: 2013-01-24
|
||||
|
||||
-- Boilerplate to support localized strings if intllib mod is installed.
|
||||
local S
|
||||
if (minetest.get_modpath("intllib")) then
|
||||
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
||||
S = intllib.Getter(minetest.get_current_modname())
|
||||
else
|
||||
S = function ( s ) return s end
|
||||
end
|
||||
local S = plantslib.intllib
|
||||
|
||||
local SPAWN_DELAY = 1000
|
||||
local SPAWN_CHANCE = 200
|
||||
|
|