-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod_support_default.lua
More file actions
196 lines (166 loc) · 4.79 KB
/
mod_support_default.lua
File metadata and controls
196 lines (166 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
--[[
X Farming. Extends Luanti farming mod with new plants, crops and ice fishing.
Copyright (C) 2025 SaKeL
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to juraj.vajda@gmail.com
--]]
local tree_defs = {
{
-- apple tree
name = 'default:sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_new_apple_tree(pos)
return true
end
},
{
-- jungle tree
name = 'default:junglesapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_new_jungle_tree(pos)
return true
end
},
{
-- emergent jungle tree
name = 'default:emergent_jungle_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_new_emergent_jungle_tree(pos)
return true
end
},
{
-- acacia tree
name = 'default:acacia_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_new_acacia_tree(pos)
return true
end
},
{
-- aspen tree
name = 'default:aspen_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_new_aspen_tree(pos)
return true
end
},
{
-- pine tree
name = 'default:pine_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
if core.find_node_near(pos, 1, { 'group:snowy' }) then
default.grow_new_snowy_pine_tree(pos)
else
default.grow_new_pine_tree(pos)
end
return true
end
},
{
-- Bush
name = 'default:bush_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_bush(pos)
return true
end
},
{
-- Acacia bush
name = 'default:acacia_bush_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_acacia_bush(pos)
return true
end
},
{
-- Pine bush
name = 'default:pine_bush_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_pine_bush(pos)
return true
end
},
{
-- Blueberry bush
name = 'default:blueberry_bush_sapling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
default.grow_blueberry_bush(pos)
return true
end
},
{
-- Papyrus
name = 'default:papyrus',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_soil(pos) then
return false
end
local node = core.get_node(pos)
default.grow_papyrus(pos, node)
return true
end
},
{
-- Large Cactus
name = 'default:large_cactus_seedling',
chance = 2,
grow_tree = function(pos)
if not x_farming.x_bonemeal.is_on_sand(pos) then
return false
end
default.grow_large_cactus(pos)
return true
end
},
}
x_farming.x_bonemeal:register_tree_defs(tree_defs)