forked from Ezhh/other_worlds
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mars_plants.lua
111 lines (105 loc) · 2.92 KB
/
mars_plants.lua
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
minetest.register_node(":mars:redgrass", {
description = "Red Grass",
drawtype = "plantlike",
waving = 1,
visual_scale = 1.3,
tiles = {"mars_redgrass.png"},
inventory_image = "mars_redgrass.png",
wield_image = "mars_redgrass.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_node(":mars:redweed", {
description = "Red Weed",
drawtype = "plantlike",
waving = 1,
visual_scale = 1.3,
tiles = {"mars_redweed.png"},
inventory_image = "mars_redweed.png",
wield_image = "mars_redweed.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
minetest.register_node(":mars:moss", {
description = "Martian Moss",
drawtype = "nodebox",
tiles = {"mars_moss.png"},
inventory_image = "mars_moss.png",
wield_image = "mars_moss.png",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
walkable = false,
node_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2},
},
groups = {snappy=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
})
--mars grass
minetest.register_node(":mars:grass_1", {
description = "Martian Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"mars_grass_1.png"},
inventory_image = "mars_grass_3.png",
wield_image = "mars_grass_3.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
-- place a random grass node
local stack = ItemStack("mars:grass_"..math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("mars:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
end,
})
for i=2,5 do
minetest.register_node(":mars:grass_"..i, {
description = "Martian Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"mars_grass_"..i..".png"},
inventory_image = "mars_grass_"..i..".png",
wield_image = "mars_grass_"..i..".png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "mars:grass_1",
groups = {snappy=3,flora=1,attached_node=1,not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
end