-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgrass.lua
More file actions
83 lines (64 loc) · 1.88 KB
/
grass.lua
File metadata and controls
83 lines (64 loc) · 1.88 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
local function has(name)
if core.registered_nodes[name] then return name end
return farming.mcl and "mcl_farming:wheat_seeds" or "farming:seed_wheat"
end
-- Override grass to drop wheat and oat seeds
local rarity_lookup = {[1] = 50, [2] = 50, [3] = 50, [4] = 5, [5] = 5}
if core.registered_nodes["default:grass_1"] then
for i = 1, 5 do
core.override_item("default:grass_" .. i, {
drop = {
max_items = 1,
items = {
{items = {"farming:seed_wheat"}, rarity = rarity_lookup[i]},
{items = {has("farming:seed_oat")},rarity = rarity_lookup[i]},
{items = {"default:grass_1"}}
}
}
})
end
end
-- override dry grass to drop barley and rye seeds
if core.registered_nodes["default:dry_grass_1"] then
for i = 1, 5 do
core.override_item("default:dry_grass_" .. i, {
drop = {
max_items = 1,
items = {
{items = {has("farming:seed_barley")}, rarity = rarity_lookup[i]},
{items = {has("farming:seed_rye")}, rarity = rarity_lookup[i]},
{items = {"default:dry_grass_1"}}
}
}
})
end
end
-- override jungle grass to drop cotton and rice seeds
if core.registered_nodes["default:junglegrass"] then
core.override_item("default:junglegrass", {
drop = {
max_items = 1,
items = {
{items = {"farming:seed_cotton"}, rarity = 8},
{items = {has("farming:seed_rice")}, rarity = 8},
{items = {"default:junglegrass"}}
}
}
})
end
-- override mineclone tallgrass to drop all of the above seeds
if farming.mcl then
core.override_item("mcl_flowers:tallgrass", {
drop = {
max_items = 1,
items = {
{items = {"mcl_farming:wheat_seeds"}, rarity = 5},
{items = {has("farming:seed_oat")},rarity = 5},
{items = {has("farming:seed_barley")}, rarity = 5},
{items = {has("farming:seed_rye")},rarity = 5},
{items = {"farming:seed_cotton"}, rarity = 8},
{items = {has("farming:seed_rice")},rarity = 8}
}
}
})
end