gold tools textures added, tab fixes, workong on CB

master
Victor Hackeridze 2012-03-18 19:27:46 +06:00
parent 576d1b7aea
commit f12488872d
7 changed files with 138 additions and 127 deletions

View File

@ -5,143 +5,143 @@
local DEBUG = 0
local FLOWERS = {
"rose",
"dandelion_yellow",
"dandelion_white",
"tulip",
"viola",
"cotton",
"rose",
"dandelion_yellow",
"dandelion_white",
"tulip",
"viola",
"cotton",
}
local MAX_RATIO = 2000
local GROWING_DELAY = 7200
local table_contains = function(t, v)
for _, i in ipairs(t) do
if (i == v) then
return true
end
end
for _, i in ipairs(t) do
if (i == v) then
return true
end
end
return false
return false
end
local is_node_in_cube = function(nodenames, node_pos, radius)
for x = node_pos.x - radius, node_pos.x + radius do
for y = node_pos.y - radius, node_pos.y + radius do
for z = node_pos.z - radius, node_pos.z + radius do
n = minetest.env:get_node_or_nil({x = x, y = y, z = z})
if (n == nil)
or (n.name == 'ignore')
or (table_contains(nodenames, n.name) == true) then
return true
end
end
end
end
for x = node_pos.x - radius, node_pos.x + radius do
for y = node_pos.y - radius, node_pos.y + radius do
for z = node_pos.z - radius, node_pos.z + radius do
n = minetest.env:get_node_or_nil({x = x, y = y, z = z})
if (n == nil)
or (n.name == 'ignore')
or (table_contains(nodenames, n.name) == true) then
return true
end
end
end
end
return false
return false
end
local grow_blocks_on_surfaces = function(growdelay, grownames, surfaces)
for _, surface in ipairs(surfaces) do
minetest.register_abm({
nodenames = { surface.name },
interval = growdelay,
chance = 30,
action = function(pos, node, active_object_count, active_object_count_wider)
local p_top = {
x = pos.x,
y = pos.y + 1,
z = pos.z
}
local n_top = minetest.env:get_node(p_top)
local rnd = math.random(1, MAX_RATIO)
for _, surface in ipairs(surfaces) do
minetest.register_abm({
nodenames = { surface.name },
interval = growdelay,
chance = 30,
action = function(pos, node, active_object_count, active_object_count_wider)
local p_top = {
x = pos.x,
y = pos.y + 1,
z = pos.z
}
local n_top = minetest.env:get_node(p_top)
local rnd = math.random(1, MAX_RATIO)
if (MAX_RATIO - surface.chance < rnd) then
local flower_in_range = is_node_in_cube(grownames, p_top, surface.spacing)
if (n_top.name == "air") and (flower_in_range == false) then
local nnode = grownames[math.random(1, #grownames)]
minetest.env:add_node(p_top, { name = nnode })
end
end
end
})
end
if (MAX_RATIO - surface.chance < rnd) then
local flower_in_range = is_node_in_cube(grownames, p_top, surface.spacing)
if (n_top.name == "air") and (flower_in_range == false) then
local nnode = grownames[math.random(1, #grownames)]
minetest.env:add_node(p_top, { name = nnode })
end
end
end
})
end
end
-- Nodes
for _, color in ipairs(FLOWERS) do
local fname = 'flower_' .. color
local fname = 'flower_' .. color
minetest.register_node('flowers:' .. fname, {
description = "Flower: " .. color,
drawtype = 'plantlike',
visual_scale = FLOWERS_VISUAL_SCALE,
tile_images = { fname .. '.png' },
inventory_image = fname .. '.png',
sunlight_propagates = true,
paramtype = 'light',
walkable = false,
material = minetest.digprop_constanttime(0.0),
furnace_burntime = 1,
minetest.register_node('flowers:' .. fname, {
description = "Flower: " .. color,
drawtype = 'plantlike',
visual_scale = FLOWERS_VISUAL_SCALE,
tile_images = { fname .. '.png' },
inventory_image = fname .. '.png',
sunlight_propagates = true,
paramtype = 'light',
walkable = false,
material = minetest.digprop_constanttime(0.0),
furnace_burntime = 1,
selection_box = {
type = "fixed",
fixed = {-1/5-0.1, -1/2, -1/5-0.1, 1/5+0.1, 1/5+0.1, 1/5+0.1},
},
})
type = "fixed",
fixed = {-1/5-0.1, -1/2, -1/5-0.1, 1/5+0.1, 1/5+0.1, 1/5+0.1},
},
})
end
minetest.register_node('flowers:flower_waterlily', {
description = "Flower: waterlily",
drawtype = 'raillike',
tile_images = { 'flower_waterlily.png', },
inventory_image = 'flower_waterlily.png',
sunlight_propagates = true,
paramtype = 'light',
walkable = false,
material = minetest.digprop_constanttime(0.0),
description = "Flower: waterlily",
drawtype = 'raillike',
tile_images = { 'flower_waterlily.png', },
inventory_image = 'flower_waterlily.png',
sunlight_propagates = true,
paramtype = 'light',
walkable = false,
material = minetest.digprop_constanttime(0.0),
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, -0.52, 1/2},
},
type = "fixed",
fixed = {-1/2, -1/2, -1/2, 1/2, -0.52, 1/2},
},
})
-- Items
minetest.register_craftitem('flowers:flower_pot', {
description = "Flower pot",
drawtype = 'plantlike',
image = 'flower_pot.png',
stack_max = 1,
visual_scale = 1.0,
sunlight_propagates = true,
paramtype = 'light',
walkable = true,
material = minetest.digprop_constanttime(0.5),
description = "Flower pot",
drawtype = 'plantlike',
image = 'flower_pot.png',
stack_max = 1,
visual_scale = 1.0,
sunlight_propagates = true,
paramtype = 'light',
walkable = true,
material = minetest.digprop_constanttime(0.5),
})
minetest.register_craftitem('flowers:cotton', {
description = "Cotton",
image = 'cotton.png',
description = "Cotton",
image = 'cotton.png',
furnace_burntime = 15;
on_place_on_ground = minetest.craftitem_place_item,
})
for _, color in ipairs(FLOWERS) do
local fname = 'flower_' .. color
local pname = fname .. '_pot'
local fname = 'flower_' .. color
local pname = fname .. '_pot'
minetest.register_craftitem('flowers:' .. pname, {
description = "Flower pot: " .. color,
drawtype = 'plantlike',
image = pname .. '.png',
stack_max = 1,
visual_scale = 1.2,
sunlight_propagates = true,
paramtype = 'light',
walkable = true,
material = minetest.digprop_constanttime(1.0),
})
minetest.register_craftitem('flowers:' .. pname, {
description = "Flower pot: " .. color,
drawtype = 'plantlike',
image = pname .. '.png',
stack_max = 1,
visual_scale = 1.2,
sunlight_propagates = true,
paramtype = 'light',
walkable = true,
material = minetest.digprop_constanttime(1.0),
})
end
-- Crafts
@ -154,49 +154,49 @@ minetest.register_craft({
})
for _, color in ipairs(FLOWERS) do
local fname = 'flowers:flower_' .. color
local pname = fname .. '_pot'
local fname = 'flowers:flower_' .. color
local pname = fname .. '_pot'
minetest.register_craft({
output = pname .. ' 1',
recipe = {
{fname},
{'flowers:flower_pot'},
}
})
minetest.register_craft({
output = pname .. ' 1',
recipe = {
{fname},
{'flowers:flower_pot'},
}
})
end
minetest.register_craft({
output = 'flowers:cotton 1',
recipe = {
{'flowers:flower_cotton 1'},
}
output = 'flowers:cotton 1',
recipe = {
{'flowers:flower_cotton 1'},
}
})
-- Make it grow !
grow_blocks_on_surfaces(GROWING_DELAY * 2, {
"flowers:flower_rose",
"flowers:flower_dandelion_white",
"flowers:flower_viola",
}, {
{name = "dirt_with_grass", chance = 4, spacing = 15},
"flowers:flower_rose",
"flowers:flower_dandelion_white",
"flowers:flower_viola",
}, {
{name = "dirt_with_grass", chance = 4, spacing = 15},
})
grow_blocks_on_surfaces(GROWING_DELAY, {
"flowers:flower_dandelion_yellow",
"flowers:flower_tulip",
}, {
{name = "dirt_with_grass", chance = 2, spacing = 10},
"flowers:flower_dandelion_yellow",
"flowers:flower_tulip",
}, {
{name = "dirt_with_grass", chance = 2, spacing = 10},
})
grow_blocks_on_surfaces(GROWING_DELAY*3, {
"flowers:flower_cotton",
}, {
{name = "dirt_with_grass", chance = 3, spacing = 12},
"flowers:flower_cotton",
}, {
{name = "dirt_with_grass", chance = 3, spacing = 12},
})
grow_blocks_on_surfaces(GROWING_DELAY / 2, {
"flowers:flower_waterlily",
}, {
{name = "water_source", chance = 1, spacing = 15},
"flowers:flower_waterlily",
}, {
{name = "water_source", chance = 1, spacing = 15},
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 B

View File

@ -2,6 +2,7 @@
-- modifed by rtmmp-team
minetest.register_node("obsidian_rtmmp:obsidian_block", {
description="Obsidian",
tile_images = {"obsidian_rtmmp_block.png"},
inventory_image = minetest.inventorycube("obsidian_rtmmp_block.png"),
is_ground_content = true,

View File

@ -17,3 +17,13 @@ local CB_NAMES_COLORS = {
"pink" = "Pink cotton block",
"brown" = "Brown cotton block",
}
for color, name in ipairs(CB_NAMES_COLORS) do
minetest.register_node("cotton_blocks:" .. color, {
description = name,
tile_images = {"cb_" .. color .. ".png"},
inventory_image = minetest.inventorycube("cb_" .. color .. ".png"),
is_ground_content = true,
material = minetest.digprop_stonelike(0.3), -- WTF???????? FUCK!!!!!!!!!1111111!!!!!!!!!111
})
end