3D flower pots with flowerpots mod

master
Wuzzy 2018-01-05 14:17:54 +01:00
parent 7f2604126c
commit 7c0ac3519b
13 changed files with 505 additions and 51 deletions

View File

@ -0,0 +1,3 @@
all models and flowerpot texture are made by tobyplowy(aka toby109tt) and code is by D00med and tobyplowy(aka toby109tt) please give credit if used!

View File

@ -0,0 +1,2 @@
default
flowers

3
mods/flowerpots/init.lua Normal file
View File

@ -0,0 +1,3 @@
local path = minetest.get_modpath("flowerpots")
dofile(path.."/nodes.lua")

View File

@ -0,0 +1,25 @@
License for Code
----------------
Copyright (C) 2017 D00Med <heiselong@gmx.com> and toby109tt(aka tobyplowy)
This program 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 program 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 program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
License for Textures, Models
---------------------------------------
CC BY-SA 3.0 UNPORTED. Created by toby109tt(aka tobyplowy)
Note: none of the pot contents are original, see the default mod and flowers mod license/readme for the license of those textures.

View File

@ -0,0 +1,74 @@
# Blender v2.72 (sub 0) OBJ File: 'flowerpot.blend'
# www.blender.org
mtllib flowerpot.mtl
o Cube_Cube.001
v -0.376261 -1.015969 0.376261
v -0.376261 -0.263447 0.376261
v -0.376261 -1.015969 -0.376261
v -0.376261 -0.263447 -0.376261
v 0.376261 -1.015969 0.376261
v 0.376261 -0.263447 0.376261
v 0.376261 -1.015969 -0.376261
v 0.376261 -0.263447 -0.376261
v -0.250727 -0.559166 0.250727
v -0.250727 -0.263549 0.250727
v -0.250727 -0.559166 -0.250727
v -0.250727 -0.263549 -0.250727
v 0.250727 -0.559166 0.250727
v 0.250727 -0.263549 0.250727
v 0.250727 -0.559166 -0.250727
v 0.250727 -0.263549 -0.250727
v 0.678334 1.490754 0.678334
v 0.678334 -0.569152 0.678334
v -0.678334 1.490754 -0.678334
v -0.678334 -0.569152 -0.678334
v -0.678334 1.490754 0.678334
v -0.678334 -0.569152 0.678334
v 0.678334 1.490754 -0.678334
v 0.678334 -0.569152 -0.678334
vt 0.562500 0.187500
vt 0.562500 0.375000
vt 0.375000 0.375000
vt 0.375000 0.187500
vt 0.187500 0.375000
vt 0.187500 0.187500
vt 0.000000 0.375000
vt 0.000000 0.187500
vt 0.750000 0.187500
vt 0.750000 0.375000
vt 0.687500 0.000000
vt 0.875000 0.000000
vt 0.875000 0.187500
vt 0.687500 0.187500
vt 0.500000 0.000000
vt 0.500000 0.187500
vt 0.375000 0.000000
vt 0.250000 0.000000
vt 0.250000 0.062500
vt 0.375000 0.062500
vt 0.125000 0.000000
vt 0.125000 0.062500
vt 0.000000 0.000000
vt 0.000000 0.062500
vt 0.500000 0.062500
vt 0.125000 0.187500
vt 0.250000 0.187500
vt 0.000000 1.000000
vt 0.500000 1.000000
vt 0.500000 0.500000
vt 0.000000 0.500000
usemtl None
s off
f 1/1 2/2 4/3 3/4
f 3/4 4/3 8/5 7/6
f 7/6 8/5 6/7 5/8
f 5/9 6/10 2/2 1/1
f 3/11 7/12 5/13 1/14
f 8/15 4/11 2/14 6/16
f 9/17 11/18 12/19 10/20
f 11/18 15/21 16/22 12/19
f 15/21 13/23 14/24 16/22
f 13/15 9/17 10/20 14/25
f 11/22 9/26 13/27 15/19
f 17/28 19/29 20/30 18/31
f 21/28 23/29 24/30 22/31

View File

@ -0,0 +1,90 @@
# Blender v2.78 (sub 0) OBJ File: ''
# www.blender.org
mtllib flowerpot_with_Xflower.mtl
o Cube_Cube.001
v -0.376017 -1.015283 0.376017
v -0.376017 -0.263249 0.376017
v -0.376017 -0.263249 -0.376017
v -0.376017 -1.015283 -0.376017
v 0.376017 -0.263249 -0.376017
v 0.376017 -1.015283 -0.376017
v 0.376017 -0.263249 0.376017
v 0.376017 -1.015283 0.376017
v -0.250565 -0.558776 0.250565
v -0.250565 -0.558776 -0.250565
v -0.250565 -0.263350 -0.250565
v -0.250565 -0.263350 0.250565
v 0.250565 -0.558776 -0.250565
v 0.250565 -0.263350 -0.250565
v 0.250565 -0.558776 0.250565
v 0.250565 -0.263350 0.250565
v -0.677552 -0.564356 0.677766
v -0.677552 1.848188 0.677767
v 0.677280 -0.564356 -0.677066
v 0.677280 1.848188 -0.677066
v 0.677280 -0.564356 0.677767
v 0.677280 1.848188 0.677767
v -0.677552 -0.564356 -0.677066
v -0.677552 1.848188 -0.677066
vt 1.0000 0.0000
vt 1.0000 0.6250
vt 0.5000 0.6250
vt 0.5000 -0.0000
vt 1.0000 0.0000
vt 1.0000 0.6250
vt 0.5000 0.6250
vt 0.5000 -0.0000
vt 0.5625 0.6250
vt 0.5625 0.8125
vt 0.3750 0.8125
vt 0.3750 0.6250
vt 0.1875 0.8125
vt 0.1875 0.6250
vt -0.0000 0.8125
vt 0.0000 0.6250
vt 0.7500 0.6250
vt 0.7500 0.8125
vt 0.3750 0.8125
vt 0.5625 0.8125
vt 0.5625 1.0000
vt 0.3750 1.0000
vt 0.3750 1.0000
vt 0.1875 1.0000
vt 0.3750 0.4375
vt 0.2500 0.4375
vt 0.2500 0.5000
vt 0.3750 0.5000
vt 0.1250 0.4375
vt 0.1250 0.5000
vt -0.0000 0.4375
vt -0.0000 0.5000
vt 0.5000 0.4375
vt 0.5000 0.5000
vt 0.1250 0.5000
vt 0.1250 0.6250
vt 0.2500 0.6250
vt 0.2500 0.5000
vn -0.7071 0.0000 -0.7071
vn -0.7071 0.0000 0.7071
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 -0.0000 0.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 1.0000 0.0000
usemtl None
s off
f 17/1/1 18/2/1 20/3/1 19/4/1
f 21/5/2 22/6/2 24/7/2 23/8/2
s 1
f 1/9/3 2/10/3 3/11/3 4/12/3
f 4/12/4 3/11/4 5/13/4 6/14/4
f 6/14/5 5/13/5 7/15/5 8/16/5
f 8/17/6 7/18/6 2/10/6 1/9/6
f 4/19/7 6/20/7 8/21/7 1/22/7
f 5/13/8 3/11/8 2/23/8 7/24/8
f 9/25/5 10/26/5 11/27/5 12/28/5
f 10/26/6 13/29/6 14/30/6 11/27/6
f 13/29/3 15/31/3 16/32/3 14/30/3
f 15/33/4 9/25/4 12/28/4 16/34/4
f 10/35/8 9/36/8 15/37/8 13/38/8

View File

@ -0,0 +1,150 @@
# Blender v2.78 (sub 0) OBJ File: ''
# www.blender.org
mtllib flowerpot_with_long_cube.mtl
o Cube_Cube.001
v 0.256212 -0.267479 0.256212
v 0.256212 1.081644 0.256212
v 0.256212 -0.267479 -0.256212
v 0.256212 1.081644 -0.256212
v -0.256212 -0.267479 -0.256212
v -0.256212 1.081644 -0.256212
v -0.256212 1.081644 0.256212
v -0.256212 -0.267479 0.256212
v -0.376017 -1.015283 0.376017
v -0.376017 -0.263249 0.376017
v -0.376017 -0.263249 -0.376017
v -0.376017 -1.015283 -0.376017
v 0.376017 -0.263249 -0.376017
v 0.376017 -1.015283 -0.376017
v 0.376017 -0.263249 0.376017
v 0.376017 -1.015283 0.376017
v -0.250565 -0.558776 0.250565
v -0.250565 -0.558776 -0.250565
v -0.250565 -0.263350 -0.250565
v -0.250565 -0.263350 0.250565
v 0.250565 -0.558776 -0.250565
v 0.250565 -0.263350 -0.250565
v 0.250565 -0.558776 0.250565
v 0.250565 -0.263350 0.250565
v 0.685750 -0.738264 0.685751
v 0.685751 1.201331 0.685750
v -0.685750 -0.738264 -0.685750
v -0.685750 1.201331 -0.685751
v -0.685750 -0.738264 0.685750
v -0.685750 1.201331 0.685751
v 0.685751 -0.738264 -0.685751
v 0.685751 1.201331 -0.685750
v 0.130337 -0.351889 0.130337
v 0.130337 0.272653 0.130337
v 0.130337 -0.351888 -0.130337
v 0.130337 0.272653 -0.130337
v -0.130337 -0.351888 -0.130337
v -0.130337 0.272653 -0.130337
v -0.130337 0.272653 0.130337
v -0.130337 -0.351889 0.130337
vt 1.0000 0.0000
vt 1.0000 0.5000
vt 0.5000 0.5000
vt 0.5000 0.0000
vt 1.0000 0.0000
vt 1.0000 0.5000
vt 0.5000 0.5000
vt 0.5000 0.0000
vt 0.2500 0.0000
vt 0.2500 0.3125
vt 0.1250 0.3125
vt 0.1250 -0.0000
vt 0.3750 0.0000
vt 0.3750 0.3125
vt 0.5625 0.6250
vt 0.5625 0.8125
vt 0.3750 0.8125
vt 0.3750 0.6250
vt 0.1875 0.8125
vt 0.1875 0.6250
vt -0.0000 0.8125
vt 0.0000 0.6250
vt 0.7500 0.6250
vt 0.7500 0.8125
vt 0.3750 0.8125
vt 0.5625 0.8125
vt 0.5625 1.0000
vt 0.3750 1.0000
vt 0.3750 1.0000
vt 0.1875 1.0000
vt 0.3750 0.4375
vt 0.2500 0.4375
vt 0.2500 0.5000
vt 0.3750 0.5000
vt 0.1250 0.4375
vt 0.1250 0.5000
vt -0.0000 0.4375
vt -0.0000 0.5000
vt 0.5000 0.4375
vt 0.5000 0.5000
vt 0.1250 0.5000
vt 0.1250 0.6250
vt 0.2500 0.6250
vt 0.2500 0.5000
vt 0.0000 0.3125
vt -0.0000 -0.0000
vt 0.5000 -0.0000
vt 0.5000 0.3125
vt 0.2500 0.3125
vt 0.3750 0.3125
vt 0.3750 0.4375
vt 0.2500 0.4375
vt 0.2500 0.4375
vt 0.1250 0.4375
vt 0.8750 0.6250
vt 0.8750 0.7188
vt 0.8125 0.7188
vt 0.8125 0.6250
vt 0.9375 0.6250
vt 0.9375 0.7188
vt 0.7500 0.7188
vt 0.7500 0.6250
vt 1.0000 0.6250
vt 1.0000 0.7188
vt 0.8750 0.7188
vt 0.9375 0.7188
vt 0.9375 0.7812
vt 0.8750 0.7812
vt 0.8750 0.7812
vt 0.8125 0.7812
vn -0.7071 0.0000 0.7071
vn -0.7071 0.0000 -0.7071
vn 0.0000 0.0000 -1.0000
vn -1.0000 -0.0000 0.0000
vn 1.0000 -0.0000 0.0000
vn 0.0000 -0.0000 1.0000
vn 0.0000 -1.0000 -0.0000
vn 0.0000 1.0000 0.0000
usemtl None
s off
f 25/1/1 26/2/1 28/3/1 27/4/1
f 29/5/2 30/6/2 32/7/2 31/8/2
s 1
f 5/9/3 6/10/3 4/11/3 3/12/3
f 8/13/4 7/14/4 6/10/4 5/9/4
f 9/15/4 10/16/4 11/17/4 12/18/4
f 12/18/3 11/17/3 13/19/3 14/20/3
f 14/20/5 13/19/5 15/21/5 16/22/5
f 16/23/6 15/24/6 10/16/6 9/15/6
f 12/25/7 14/26/7 16/27/7 9/28/7
f 13/19/8 11/17/8 10/29/8 15/30/8
f 17/31/5 18/32/5 19/33/5 20/34/5
f 18/32/6 21/35/6 22/36/6 19/33/6
f 21/35/4 23/37/4 24/38/4 22/36/4
f 23/39/3 17/31/3 20/34/3 24/40/3
f 18/41/8 17/42/8 23/43/8 21/44/8
f 3/12/5 4/11/5 2/45/5 1/46/5
f 1/47/6 2/48/6 7/14/6 8/13/6
f 5/49/7 3/50/7 1/51/7 8/52/7
f 4/11/8 6/10/8 7/53/8 2/54/8
f 37/55/3 38/56/3 36/57/3 35/58/3
f 40/59/4 39/60/4 38/56/4 37/55/4
f 35/58/5 36/57/5 34/61/5 33/62/5
f 33/63/6 34/64/6 39/60/6 40/59/6
f 37/65/7 35/66/7 33/67/7 40/68/7
f 36/57/8 38/56/8 39/69/8 34/70/8

158
mods/flowerpots/nodes.lua Normal file
View File

@ -0,0 +1,158 @@
local flowers = {
{"rose", "flowers:rose", "Rose"},
{"tulip", "flowers:tulip", "Tulip"},
{"geranium", "flowers:geranium", "Geranium"},
{"viola", "flowers:viola", "Viola"},
{"dandelion_yellow", "flowers:dandelion_yellow", "Yellow Dandelion"},
{"dandelion_white", "flowers:dandelion_white", "White Dandelion"},
-- {"grass", "default:grass_1", "Grass"},
-- {"junglegrass", "default:junglegrass", "junglegrass"},
-- {"dry_shrub", "default:dry_shrub", "Dry Shrub"},
-- {"papyrus", "default:papyrus", "Papyrus"},
-- {"sapling", "default:sapling", "Common Tree Sapling"},
-- {"junglesapling", "default:junglesapling", "Common Jungle Tree Sapling"},
-- {"cjsapling", "farming_plus:cjsapling", "Cultivated Jungle Tree Sapling"},
-- {"olive_sapling", "farming_plus:olive_sapling", "Olive Tree Sapling"},
-- {"pale_sapling", "farming_plus:pale_sapling", "Pale Tree Sapling"},
-- {"birch_sapling", "farming_plus:birch_sapling", "Birch Tree Sapling"},
}
local cubes = {
-- {"cactus", "default:cactus", "Cactus"},
-- {"leaves", "default:leaves", "Leaves"},
-- {"jungleleaves", "default:jungleleaves", "Jungle Leaves"},
}
minetest.register_node("flowerpots:flower_pot", {
description = "Flower Pot",
drawtype = "mesh",
mesh = "flowerpot.obj",
tiles = {
"flowerpot.png",
},
visual_scale = 0.5,
wield_scale = {x=1.0, y=1.0, z=1.0},
paramtype = "light",
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
collision_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
groups = {cracky = 1, oddly_breakable_by_hand = 1, attached_node=1},
sounds = default.node_sound_stone_defaults(),
on_rightclick = function(pos, node, clicker, itemstack)
local item = clicker:get_wielded_item():get_name()
for _, row in ipairs(flowers) do
local flower = row[1]
local flower_node = row[2]
if item == flower_node then
minetest.set_node(pos, {name="flowerpots:flower_pot_"..flower})
if not minetest.settings:get_bool("creative") then
itemstack:take_item()
end
end
end
for _, row in ipairs(cubes) do
local flower = row[1]
local flower_node = row[2]
if item == flower_node then
minetest.set_node(pos, {name="flowerpots:flower_pot_"..flower})
if not minetest.settings:get_bool("creative") then
itemstack:take_item()
end
end
end
end,
})
minetest.register_craft({
output = 'flowerpots:flower_pot',
recipe = {
{'default:clay_brick', '', 'default:clay_brick'},
{'', 'default:clay_brick', ''},
}
})
for _, row in ipairs(flowers) do
local flower = row[1]
local flower_node = row[2]
local desc = row[3]
local texture = minetest.registered_nodes[flower_node]["tiles"]
minetest.register_node("flowerpots:flower_pot_"..flower, {
description = "Flower Pot With "..desc.."",
drawtype = "mesh",
mesh = "flowerpot.obj",
tiles = {
"[combine:32x32:0,0=flowerpot.png:0,0="..texture[1],
},
visual_scale = 0.5,
wield_scale = {x=1.0, y=1.0, z=1.0},
paramtype = "light",
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2},
},
collision_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2},
},
groups = {cracky = 1, oddly_breakable_by_hand = 1, not_in_creative_inventory=1, attached_node=1},
sounds = default.node_sound_stone_defaults(),
on_rightclick = function(pos, item, clicker)
minetest.add_item({x=pos.x, y=pos.y+0.5, z=pos.z}, flower_node)
minetest.set_node(pos, {name="flowerpots:flower_pot"})
end,
drop = {
max_items = 2,items = {{items = {"flowerpots:flower_pot", flower_node},rarity = 1,},},
},
})
end
for _, row in ipairs(cubes) do
local flower = row[1]
local flower_node = row[2]
local desc = row[3]
minetest.register_node("flowerpots:flower_pot_"..flower, {
description = "Flower Pot With "..desc.."",
drawtype = "mesh",
mesh = "flowerpot_with_long_cube.obj",
tiles = {
"flowerpot_"..flower..".png",
},
visual_scale = 0.5,
wield_scale = {x=1.0, y=1.0, z=1.0},
paramtype = "light",
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
collision_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
},
groups = {cracky = 1, oddly_breakable_by_hand = 1, not_in_creative_inventory=1, attached_node=1},
sounds = default.node_sound_stone_defaults(),
on_rightclick = function(pos, item, clicker)
minetest.add_item({x=pos.x, y=pos.y+0.5, z=pos.z}, flower_node)
minetest.set_node(pos, {name="flowerpots:flower_pot"})
end,
drop = {
max_items = 2,items = {{items = {"flowerpots:flower_pot", flower_node},rarity = 1,},},
},
})
end
minetest.register_alias("flowers:flower_pot", "flowerpots:flower_pot")
minetest.register_alias("flowers:potted_rose", "flowerpots:flower_pot_rose")
minetest.register_alias("flowers:potted_dandelion_yellow", "flowerpots:flower_pot_dandelion_yellow")
minetest.register_alias("flowers:potted_dandelion_white", "flowerpots:flower_pot_dandelion_white")
minetest.register_alias("flowers:potted_viola", "flowerpots:flower_pot_viola")
minetest.register_alias("flowers:potted_geranium", "flowerpots:flower_pot_geranium")
minetest.register_alias("flowers:potted_tulip", "flowerpots:flower_pot_tulip")

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -266,43 +266,6 @@ local flowers_list = {
}
for i in ipairs(flowers_list) do
local flowerdesc = flowers_list[i][1]
local flower = flowers_list[i][2]
minetest.register_node(":flowers:potted_"..flower, {
description = S("Potted "..flowerdesc),
drawtype = "plantlike",
tiles = { "flowers_potted_"..flower..".png" },
inventory_image = "flowers_potted_"..flower..".png",
wield_image = "flowers_potted_"..flower..".png",
sunlight_propagates = true,
paramtype = "light",
walkable = false,
groups = { snappy = 3,flammable=2 },
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
},
})
minetest.register_craft( {
type = "shapeless",
output = "flowers:potted_"..flower,
recipe = {
"flowers:flower_pot",
"flowers:"..flower
}
})
minetest.register_alias("flowers:flower_"..flower.."_pot", "flowers:potted_"..flower)
end
local extra_aliases = {
"waterlily",
"waterlily_225",
@ -500,20 +463,6 @@ plantslib:spawn_on_surfaces({
-- crafting recipes!
minetest.register_craftitem(":flowers:flower_pot", {
description = S("Flower Pot"),
inventory_image = "flowers_flowerpot.png",
})
minetest.register_craft( {
output = "flowers:flower_pot",
recipe = {
{ "default:clay_brick", "", "default:clay_brick" },
{ "", "default:clay_brick", "" }
},
})
minetest.register_craft({
output = 'flowers:seaweed 3',
recipe = {{'flowers:waterlily'},}