This repository was archived by the owner on Apr 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathfarming.lua
More file actions
130 lines (101 loc) · 3.06 KB
/
Copy pathfarming.lua
File metadata and controls
130 lines (101 loc) · 3.06 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
local function add_drop(nodename, drop_table)
-- does node exist?
if not minetest.registered_nodes[nodename] then return end
-- get existing drops
local drops = minetest.registered_nodes[nodename].drop
-- if single item string then apend to end of new drop_table
if type(drops) == "string" then print ("== string")
table.insert(drop_table.items, {items = {drops}})
elseif type(drops) == "table" then print ("== table")
-- apend existing drops to new drop_table
for _, item in ipairs(drops.items) do
table.insert(drop_table.items, item)
end
-- use new max_items or default to current
drop_table.max_items = drop_table.max_items or drops.max_items
end
-- override node with new drops
minetest.override_item(nodename, {drop = drop_table})
end
----------------------------------------------------------
-- Bottle Gourd
-------------------------------------------------
farming.register_plant("earthbuild:bottlegourd", {
description = "Bottle Gourd seed",
paramtype2 = "meshoptions",
inventory_image = "earthbuild_bottlegourd_seed.png",
steps = 7,
minlight = 13,
maxlight = default.LIGHT_MAX,
fertility = {"grassland", "rainforest"},
groups = {flammable = 4},
place_param2 = 3,
})
----------------------
--Gourd Crafts
--Vessel
minetest.register_node("earthbuild:bottlegourd_cup", {
description = "Bottlegourd Cup (empty)",
drawtype = "nodebox",
tiles = { "earthbuild_bottlegourd_cup_top.png",
"earthbuild_bottlegourd_bot.png",
"earthbuild_bottlegourd_cup.png",
"earthbuild_bottlegourd_cup.png",
"earthbuild_bottlegourd_cup.png",
"earthbuild_bottlegourd_cup.png",
"earthbuild_bottlegourd_cup.png",
"earthbuild_bottlegourd_cup.png",
},
inventory_image = "earthbuild_bottlegourd_cup.png",
wield_image = "earthbuild_bottlegourd_cup.png",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, -0.25, 0.25, -0.0, 0.25},
}
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, -0.25, 0.25, -0.0, 0.25},
}
},
groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craft({
output = 'earthbuild:bottlegourd_cup',
recipe = {
{'earthbuild:bottlegourd'},
}
})
minetest.register_craft({
type = "fuel",
recipe = "earthbuild:bottlegourd_cup",
burntime = 1,
})
if minetest.registered_nodes["default:junglegrass"].drop == nil then
add_drop("default:junglegrass", {
max_items = 1,
items = {
{items = {"farming:seed_cotton"}, rarity = 8},
{items = {"default:junglegrass"}}
}
})
end
------------
--Collect wild seeds
--a tropical species so...
add_drop("default:junglegrass", {
items = {
{items = {"earthbuild:seed_bottlegourd"}, rarity = 8},
}
})
minetest.log(dump(minetest.registered_nodes["default:junglegrass"].drop))
--[[
minetest.log("Adding bonemeal support for ")
bonemeal:add_crop({
{"earthbuild:bottlegourd_", 8, "earthbuild:seed_bottlegourd"}
})
]]