initial commit

master
D00Med 2017-02-03 07:41:44 +10:00
parent 7b481fac90
commit ba7aa5e013
29 changed files with 429 additions and 0 deletions

3
credits.txt Normal file
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!

1
depends.txt Normal file
View File

@ -0,0 +1 @@
default

3
init.lua Normal file
View File

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

23
license.txt Normal file
View File

@ -0,0 +1,23 @@
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)

69
models/flowerpot.obj Normal file
View File

@ -0,0 +1,69 @@
# Blender v2.78 (sub 0) OBJ File: ''
# www.blender.org
mtllib flowerpot.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
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 -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 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 4/4/2 3/3/2 5/5/2 6/6/2
f 6/6/3 5/5/3 7/7/3 8/8/3
f 8/9/4 7/10/4 2/2/4 1/1/4
f 4/11/5 6/12/5 8/13/5 1/14/5
f 5/5/6 3/3/6 2/15/6 7/16/6
f 9/17/3 10/18/3 11/19/3 12/20/3
f 10/18/4 13/21/4 14/22/4 11/19/4
f 13/21/1 15/23/1 16/24/1 14/22/1
f 15/25/2 9/17/2 12/20/2 16/26/2
f 10/27/6 9/28/6 15/29/6 13/30/6

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

90
nodes.lua Normal file
View File

@ -0,0 +1,90 @@
local flowers = {
{"rose", "flowers:rose", "flowerpot_with_Xflower.obj"},
{"tulip", "flowers:tulip", "flowerpot_with_Xflower.obj"},
{"geranium", "flowers:geranium", "flowerpot_with_Xflower.obj"},
{"viola", "flowers:viola", "flowerpot_with_Xflower.obj"},
{"dandelion_yellow", "flowers:dandelion_yellow", "flowerpot_with_Xflower.obj"},
{"dandelion_white", "flowers:dandelion_white", "flowerpot_with_Xflower.obj"},
{"mushroom_brown", "flowers:mushroom_brown", "flowerpot_with_Xflower.obj"},
{"mushroom_red", "flowers:mushroom_red", "flowerpot_with_Xflower.obj"},
{"cactus", "default:cactus", "flowerpot_with_long_cube.obj"},
{"grass", "default:grass_1", "flowerpot_with_Xflower.obj"},
{"dry_grass", "default:dry_grass_1", "flowerpot_with_Xflower.obj"},
{"dry_shrub", "default:dry_shrub", "flowerpot_with_Xflower.obj"},
{"papyrus", "default:papyrus", "flowerpot_with_Xflower.obj"},
{"leaves", "default:leaves", "flowerpot_with_long_cube.obj"},
{"aspen_leaves", "default:aspen_leaves", "flowerpot_with_long_cube.obj"},
{"pine_needles", "default:pine_needles", "flowerpot_with_long_cube.obj"},
{"jungleleaves", "default:jungleleaves", "flowerpot_with_long_cube.obj"},
{"acacia_leaves", "default:acacia_leaves", "flowerpot_with_long_cube.obj"},
}
minetest.register_node("flowerpots:flower_pot", {
description = "Flower Pot",
drawtype = "mesh",
mesh = "flowerpot.obj",
tiles = {
"flowerpot.png",
},
visual_scale = 0.5,
wield_image = "flowerpot_item.png",
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}
},
inventory_image = "flowerpot_item.png",
groups = {cracky = 2, stone = 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.env:set_node(pos, {name="flowerpots:flower_pot_"..flower})
itemstack:take_item()
end
end
end,
})
for _, row in ipairs(flowers) do
local flower = row[1]
local flower_node = row[2]
local model = row[3]
minetest.register_node("flowerpots:flower_pot_"..flower, {
description = "Flower Pot With "..flower.." Flower",
drawtype = "mesh",
mesh = model,
tiles = {
"flowerpot_"..flower..".png",
},
visual_scale = 0.5,
wield_image = "flowerpot_item.png",
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}
},
inventory_image = "flowerpot_item.png",
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
on_rightclick = function(pos, item, clicker)
minetest.env:add_item({x=pos.x, y=pos.y+0.5, z=pos.z}, flower_node)
minetest.env:set_node(pos, {name="flowerpots:flower_pot"})
end,
})
end

BIN
textures/flowerpot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 958 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
textures/flowerpot_item.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1009 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
textures/flowerpot_rose.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB