Skip to content

Commit 178db04

Browse files
committedNov 5, 2016
Default, flowers: Improve plant selection boxes
Selection box width is limited to 14 / 16 node to visually distinguish box from any neighbouring cubic nodes.
1 parent 23ba2d3 commit 178db04

File tree

2 files changed

+61
-23
lines changed

2 files changed

+61
-23
lines changed
 

Diff for: ‎mods/default/nodes.lua

+21-13
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ minetest.register_node("default:sapling", {
523523
on_timer = default.grow_sapling,
524524
selection_box = {
525525
type = "fixed",
526-
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
526+
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
527527
},
528528
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
529529
attached_node = 1, sapling = 1},
@@ -588,7 +588,7 @@ minetest.register_node("default:apple", {
588588
is_ground_content = false,
589589
selection_box = {
590590
type = "fixed",
591-
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
591+
fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
592592
},
593593
groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
594594
leafdecay = 3, leafdecay_drop = 1},
@@ -659,7 +659,7 @@ minetest.register_node("default:junglesapling", {
659659
on_timer = default.grow_sapling,
660660
selection_box = {
661661
type = "fixed",
662-
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
662+
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
663663
},
664664
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
665665
attached_node = 1, sapling = 1},
@@ -739,7 +739,7 @@ minetest.register_node("default:pine_sapling", {
739739
on_timer = default.grow_sapling,
740740
selection_box = {
741741
type = "fixed",
742-
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
742+
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
743743
},
744744
groups = {snappy = 2, dig_immediate = 3, flammable = 3,
745745
attached_node = 1, sapling = 1},
@@ -819,7 +819,7 @@ minetest.register_node("default:acacia_sapling", {
819819
on_timer = default.grow_sapling,
820820
selection_box = {
821821
type = "fixed",
822-
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
822+
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
823823
},
824824
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
825825
attached_node = 1, sapling = 1},
@@ -898,7 +898,7 @@ minetest.register_node("default:aspen_sapling", {
898898
on_timer = default.grow_sapling,
899899
selection_box = {
900900
type = "fixed",
901-
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
901+
fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
902902
},
903903
groups = {snappy = 2, dig_immediate = 3, flammable = 3,
904904
attached_node = 1, sapling = 1},
@@ -1061,7 +1061,7 @@ minetest.register_node("default:papyrus", {
10611061
walkable = false,
10621062
selection_box = {
10631063
type = "fixed",
1064-
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
1064+
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
10651065
},
10661066
groups = {snappy = 3, flammable = 2},
10671067
sounds = default.node_sound_leaves_defaults(),
@@ -1087,7 +1087,7 @@ minetest.register_node("default:dry_shrub", {
10871087
sounds = default.node_sound_leaves_defaults(),
10881088
selection_box = {
10891089
type = "fixed",
1090-
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1090+
fixed = {-5 / 16, -0.5, -5 / 16, 5 / 16, 4 / 16, 5 / 16},
10911091
},
10921092
})
10931093

@@ -1107,7 +1107,7 @@ minetest.register_node("default:junglegrass", {
11071107
sounds = default.node_sound_leaves_defaults(),
11081108
selection_box = {
11091109
type = "fixed",
1110-
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1110+
fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 1.19, 7 / 16},
11111111
},
11121112
})
11131113

@@ -1128,7 +1128,7 @@ minetest.register_node("default:grass_1", {
11281128
sounds = default.node_sound_leaves_defaults(),
11291129
selection_box = {
11301130
type = "fixed",
1131-
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1131+
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
11321132
},
11331133

11341134
on_place = function(itemstack, placer, pointed_thing)
@@ -1158,7 +1158,7 @@ for i = 2, 5 do
11581158
sounds = default.node_sound_leaves_defaults(),
11591159
selection_box = {
11601160
type = "fixed",
1161-
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1161+
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
11621162
},
11631163
})
11641164
end
@@ -1180,7 +1180,7 @@ minetest.register_node("default:dry_grass_1", {
11801180
sounds = default.node_sound_leaves_defaults(),
11811181
selection_box = {
11821182
type = "fixed",
1183-
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1183+
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
11841184
},
11851185

11861186
on_place = function(itemstack, placer, pointed_thing)
@@ -1210,7 +1210,7 @@ for i = 2, 5 do
12101210
sounds = default.node_sound_leaves_defaults(),
12111211
selection_box = {
12121212
type = "fixed",
1213-
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
1213+
fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
12141214
},
12151215
})
12161216
end
@@ -1227,6 +1227,10 @@ minetest.register_node("default:bush_stem", {
12271227
sunlight_propagates = true,
12281228
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
12291229
sounds = default.node_sound_wood_defaults(),
1230+
selection_box = {
1231+
type = "fixed",
1232+
fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1233+
},
12301234
})
12311235

12321236
minetest.register_node("default:bush_leaves", {
@@ -1250,6 +1254,10 @@ minetest.register_node("default:acacia_bush_stem", {
12501254
sunlight_propagates = true,
12511255
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
12521256
sounds = default.node_sound_wood_defaults(),
1257+
selection_box = {
1258+
type = "fixed",
1259+
fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.54, 7 / 16},
1260+
},
12531261
})
12541262

12551263
minetest.register_node("default:acacia_bush_leaves", {

Diff for: ‎mods/flowers/init.lua

+40-10
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,42 @@ local function add_simple_flower(name, desc, box, f_groups)
5757
end
5858

5959
flowers.datas = {
60-
{"rose", "Rose", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_red = 1, flammable = 1}},
61-
{"tulip", "Orange Tulip", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_orange = 1, flammable = 1}},
62-
{"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1, flammable = 1}},
63-
{"geranium", "Blue Geranium", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 1, flammable = 1}},
64-
{"viola", "Viola", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_violet = 1, flammable = 1}},
65-
{"dandelion_white", "White dandelion", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1, flammable = 1}}
60+
{
61+
"rose",
62+
"Rose",
63+
{-2 / 16, -0.5, -2 / 16, 2 / 16, 5 / 16, 2 / 16},
64+
{color_red = 1, flammable = 1}
65+
},
66+
{
67+
"tulip",
68+
"Orange Tulip",
69+
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
70+
{color_orange = 1, flammable = 1}
71+
},
72+
{
73+
"dandelion_yellow",
74+
"Yellow Dandelion",
75+
{-2 / 16, -0.5, -2 / 16, 2 / 16, 4 / 16, 2 / 16},
76+
{color_yellow = 1, flammable = 1}
77+
},
78+
{
79+
"geranium",
80+
"Blue Geranium",
81+
{-2 / 16, -0.5, -2 / 16, 2 / 16, 2 / 16, 2 / 16},
82+
{color_blue = 1, flammable = 1}
83+
},
84+
{
85+
"viola",
86+
"Viola",
87+
{-5 / 16, -0.5, -5 / 16, 5 / 16, -1 / 16, 5 / 16},
88+
{color_violet = 1, flammable = 1}
89+
},
90+
{
91+
"dandelion_white",
92+
"White dandelion",
93+
{-5 / 16, -0.5, -5 / 16, 5 / 16, -2 / 16, 5 / 16},
94+
{color_white = 1, flammable = 1}
95+
},
6696
}
6797

6898
for _,item in pairs(flowers.datas) do
@@ -141,7 +171,7 @@ minetest.register_node("flowers:mushroom_red", {
141171
on_use = minetest.item_eat(-5),
142172
selection_box = {
143173
type = "fixed",
144-
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
174+
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, -1 / 16, 4 / 16},
145175
}
146176
})
147177

@@ -160,7 +190,7 @@ minetest.register_node("flowers:mushroom_brown", {
160190
on_use = minetest.item_eat(1),
161191
selection_box = {
162192
type = "fixed",
163-
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
193+
fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, -2 / 16, 3 / 16},
164194
}
165195
})
166196

@@ -234,11 +264,11 @@ minetest.register_node("flowers:waterlily", {
234264
node_placement_prediction = "",
235265
node_box = {
236266
type = "fixed",
237-
fixed = {-0.5, -0.5, -0.5, 0.5, -0.46875, 0.5}
267+
fixed = {-0.5, -0.5, -0.5, 0.5, -15 / 32, 0.5}
238268
},
239269
selection_box = {
240270
type = "fixed",
241-
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
271+
fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, -15 / 32, 7 / 16}
242272
},
243273

244274
on_place = function(itemstack, placer, pointed_thing)

0 commit comments

Comments
 (0)
Please sign in to comment.