1
0
Fork 0
MineClone2/mods/default/nodes.lua

2192 lines
65 KiB
Lua
Raw Normal View History

2015-06-29 17:55:56 +00:00
-- mods/default/nodes.lua
--
-- Node definitions
--
2017-01-04 08:57:20 +00:00
minetest.register_node("default:barrier", {
description = "Barrier",
drawtype = "airlike",
paramtype = "light",
inventory_image = "default_barrier.png",
wield_image = "default_barrier.png",
stack_max = 64,
sunlight_propagates = true,
is_ground_content = false,
2017-01-17 00:46:38 +00:00
groups = { not_in_creative_inventory = 1, oddly_breakable_by_hand = 5 },
2017-01-04 08:57:20 +00:00
on_blast = function() end,
})
2015-06-29 17:55:56 +00:00
minetest.register_node("default:stone", {
description = "Stone",
tiles = {"default_stone.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3, stone=1},
drop = 'default:cobble',
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_coal", {
description = "Coal Ore",
tiles = {"default_stone.png^default_mineral_coal.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3},
drop = 'default:coal_lump',
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_iron", {
description = "Iron Ore",
tiles = {"default_stone.png^default_mineral_iron.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=2},
drop = 'default:stone_with_iron',
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_gold", {
description = "Gold Ore",
tiles = {"default_stone.png^default_mineral_gold.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=2},
drop = "default:stone_with_gold",
sounds = default.node_sound_stone_defaults(),
})
2017-01-04 09:27:12 +00:00
local redstone_timer = 68.28
local redstone_ore_activate = function(pos)
minetest.swap_node(pos, {name="default:stone_with_redstone_lit"})
local t = minetest.get_node_timer(pos)
t:start(redstone_timer)
end
2015-06-29 17:55:56 +00:00
minetest.register_node("default:stone_with_redstone", {
description = "Redstone Ore",
tiles = {"default_stone.png^default_mineral_redstone.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=2},
2017-01-04 07:01:40 +00:00
drop = {
items = {
max_items = 1,
{
2017-01-09 17:45:34 +00:00
items = {"mesecons:redstone 4"},
2017-01-04 07:01:40 +00:00
rarity = 2,
},
{
2017-01-09 17:45:34 +00:00
items = {"mesecons:redstone 5"},
2017-01-04 07:01:40 +00:00
},
}
},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
on_punch = redstone_ore_activate,
on_walk_over = redstone_ore_activate, -- Uses walkover mod
2017-01-04 09:27:12 +00:00
})
local redstone_ore_reactivate = function(pos)
local t = minetest.get_node_timer(pos)
t:start(redstone_timer)
end
2017-01-04 09:27:12 +00:00
-- Light the redstone ore up when it has been touched
minetest.register_node("default:stone_with_redstone_lit", {
description = "Lit Redstone Ore",
tiles = {"default_stone.png^default_mineral_redstone.png"},
paramtype = "light",
light_source = 8,
is_ground_content = true,
stack_max = 64,
groups = {cracky=2, not_in_creative_inventory=1},
2017-01-04 09:27:12 +00:00
drop = {
items = {
max_items = 1,
{
2017-01-09 17:45:34 +00:00
items = {"mesecons:redstone 4"},
2017-01-04 09:27:12 +00:00
rarity = 2,
},
{
2017-01-09 17:45:34 +00:00
items = {"mesecons:redstone 5"},
2017-01-04 09:27:12 +00:00
},
}
},
sounds = default.node_sound_stone_defaults(),
-- Reset timer after re-punching or stepping on
on_punch = redstone_ore_reactivate,
on_walk_over = redstone_ore_reactivate, -- Uses walkover mod
2017-01-04 09:27:12 +00:00
-- Turn back to normal node after some time has passed
on_timer = function(pos, elapsed)
minetest.swap_node(pos, {name="default:stone_with_redstone"})
end,
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:stone_with_lapis", {
description = "Lapis Lazuli Ore",
tiles = {"default_stone.png^default_mineral_lapis.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=2},
drop = {
2017-01-04 07:01:40 +00:00
max_items = 1,
2015-06-29 17:55:56 +00:00
items = {
2017-01-04 07:01:40 +00:00
{items = {'dye:blue 8'},rarity = 5},
{items = {'dye:blue 7'},rarity = 5},
{items = {'dye:blue 6'},rarity = 5},
{items = {'dye:blue 5'},rarity = 5},
{items = {'dye:blue 4'}},
2015-06-29 17:55:56 +00:00
}
},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_emerald", {
description = "Emerald Ore",
tiles = {"default_stone.png^default_mineral_emerald.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=2},
drop = "default:emerald",
-- drop = {
-- max_items = 2,
-- items = {
-- {items="default:emerald",rarity = 5},
-- {items="default:emerald"},
-- },
-- },
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_diamond", {
description = "Diamond Ore",
2015-06-29 17:55:56 +00:00
tiles = {"default_stone.png^default_mineral_diamond.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=1},
drop = "default:diamond",
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stonebrick", {
description = "Stone Bricks",
2015-06-29 17:55:56 +00:00
tiles = {"default_stone_brick.png"},
stack_max = 64,
2017-01-07 02:38:48 +00:00
groups = {cracky=3, stone=1, stonebrick=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stonebrickcarved", {
description = "Chiseled Stone Bricks",
2015-06-29 17:55:56 +00:00
tiles = {"default_stonebrick_carved.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
2017-01-07 02:38:48 +00:00
groups = {cracky=3, stone=1, stonebrick=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stonebrickcracked", {
description = "Cracked Stone Bricks",
2015-06-29 17:55:56 +00:00
tiles = {"default_stonebrick_cracked.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
2017-01-07 02:38:48 +00:00
groups = {cracky=3, stone=1, stonebrick=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stonebrickmossy", {
description = "Mossy Stone Bricks",
2015-06-29 17:55:56 +00:00
tiles = {"default_stonebrick_mossy.png"},
stack_max = 64,
2017-01-07 02:38:48 +00:00
groups = {cracky=3, stone=1, stonebrick=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:granite", {
description = "Granite",
tiles = {"default_granite.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:granite_smooth", {
description = "Polished Granite",
tiles = {"default_granite_smooth.png"},
stack_max = 64,
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:andesite", {
description = "Andesite",
tiles = {"default_andesite.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:andesite_smooth", {
description = "Polished Andesite",
tiles = {"default_andesite_smooth.png"},
stack_max = 64,
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:diorite", {
description = "Diorite",
tiles = {"default_diorite.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:diorite_smooth", {
description = "Polished Diorite",
tiles = {"default_diorite_smooth.png"},
stack_max = 64,
groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(),
})
2015-06-29 17:55:56 +00:00
minetest.register_node("default:dirt_with_grass", {
description = "Grass Block",
2015-06-29 17:55:56 +00:00
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
is_ground_content = true,
stack_max = 64,
2017-01-12 06:07:30 +00:00
groups = {crumbly=3, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2},
2015-06-29 17:55:56 +00:00
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
2017-01-10 03:24:42 +00:00
-- TODO: Add particles
2017-01-10 02:54:15 +00:00
minetest.register_node("default:mycelium", {
description = "Mycelium",
tiles = {"default_mycelium_top.png", "default_dirt.png", "default_mycelium_side.png"},
is_ground_content = true,
stack_max = 64,
2017-01-10 03:07:51 +00:00
groups = {crumbly=3},
2017-01-10 02:54:15 +00:00
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
})
2017-01-10 03:24:42 +00:00
minetest.register_node("default:podzol", {
description = "Podzol",
tiles = {"default_dirt_podzol_top.png", "default_dirt.png", "default_dirt_podzol_side.png"},
is_ground_content = true,
stack_max = 64,
2017-01-12 06:07:30 +00:00
groups = {crumbly=3, soil=1, soil_sapling=2, soil_sugarcane=1},
2017-01-10 03:24:42 +00:00
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults(),
})
2015-06-29 17:55:56 +00:00
minetest.register_node("default:dirt", {
description = "Dirt",
tiles = {"default_dirt.png"},
is_ground_content = true,
stack_max = 64,
2017-01-12 06:07:30 +00:00
groups = {crumbly=3, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_dirt_defaults(),
})
2017-01-05 00:28:43 +00:00
minetest.register_node("default:coarse_dirt", {
description = "Coarse Dirt",
tiles = {"default_coarse_dirt.png"},
is_ground_content = true,
stack_max = 64,
2017-01-12 05:54:16 +00:00
groups = {crumbly=3, soil=1, soil_sugarcane=1, cultivatable=1},
2017-01-05 00:28:43 +00:00
sounds = default.node_sound_dirt_defaults(),
})
2015-06-29 17:55:56 +00:00
minetest.register_node("default:gravel", {
description = "Gravel",
tiles = {"default_gravel.png"},
is_ground_content = true,
stack_max = 64,
groups = {crumbly=2, falling_node=1},
drop = {
max_items = 1,
items = {
2017-01-04 07:01:40 +00:00
{items = {'default:flint'},rarity = 10},
2015-06-29 17:55:56 +00:00
{items = {'default:gravel'}}
}
},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45},
}),
})
-- sandstone --
minetest.register_node("default:sand", {
description = "Sand",
tiles = {"default_sand.png"},
is_ground_content = true,
stack_max = 64,
2017-01-12 05:54:16 +00:00
groups = {crumbly=3, falling_node=1, sand=1, soil_sugarcane=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("default:sandstone", {
description = "Sandstone",
tiles = {"default_sandstone_top.png", "default_sandstone_bottom.png", "default_sandstone_normal.png"},
is_ground_content = true,
stack_max = 64,
2017-01-10 01:46:20 +00:00
groups = {crumbly=2,cracky=2,sandstone=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:sandstonesmooth", {
description = "Smooth Sandstone",
2015-06-29 17:55:56 +00:00
tiles = {"default_sandstone_top.png", "default_sandstone_bottom.png", "default_sandstone_smooth.png"},
is_ground_content = true,
stack_max = 64,
2017-01-10 01:46:20 +00:00
groups = {crumbly=2,cracky=2,sandstone=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:sandstonecarved", {
description = "Chiseled Sandstone",
2015-06-29 17:55:56 +00:00
tiles = {"default_sandstone_top.png", "default_sandstone_bottom.png", "default_sandstone_carved.png"},
is_ground_content = true,
stack_max = 64,
2017-01-10 01:46:20 +00:00
groups = {crumbly=2,cracky=2,sandstone=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
-- red sandstone --
minetest.register_node("default:redsand", {
description = "Red Sand",
tiles = {"default_red_sand.png"},
is_ground_content = true,
stack_max = 64,
2017-01-12 05:54:16 +00:00
groups = {crumbly=3, falling_node=1, sand=1, soil_sugarcane=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("default:redsandstone", {
description = "Red Sandstone",
2015-06-29 17:55:56 +00:00
tiles = {"default_redsandstone_top.png", "default_redsandstone_bottom.png", "default_redsandstone_normal.png"},
is_ground_content = true,
stack_max = 64,
2017-01-10 01:46:20 +00:00
groups = {crumbly=2,cracky=2,redsandstone=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:redsandstonesmooth", {
description = "Smooth Red Sandstone",
2015-06-29 17:55:56 +00:00
tiles = {"default_redsandstone_top.png", "default_redsandstone_bottom.png", "default_redsandstone_smooth.png"},
is_ground_content = true,
stack_max = 64,
2017-01-10 01:46:20 +00:00
groups = {crumbly=2,cracky=2,redsandstone=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:redsandstonecarved", {
description = "Chiseled Red Sandstone",
2015-06-29 17:55:56 +00:00
tiles = {"default_redsandstone_top.png", "default_redsandstone_bottom.png", "default_redsandstone_carved.png"},
is_ground_content = true,
stack_max = 64,
2017-01-10 01:46:20 +00:00
groups = {crumbly=2,cracky=2,redsandstone=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
---
minetest.register_node("default:clay", {
2017-01-10 02:29:34 +00:00
-- Original name: Clay
description = "Block of Clay",
2015-06-29 17:55:56 +00:00
tiles = {"default_clay.png"},
is_ground_content = true,
stack_max = 64,
groups = {crumbly=3},
drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults({
footstep = "",
}),
})
minetest.register_node("default:brick", {
description = "Bricks",
2015-06-29 17:55:56 +00:00
tiles = {"default_brick.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:haybale", {
description = "Hay Bale",
tiles = {"default_hayblock_top.png", "default_hayblock_top.png", "default_hayblock_side.png"},
2017-01-10 03:49:18 +00:00
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
paramtype2 = "facedir",
is_ground_content = false,
on_place = minetest.rotate_node,
2017-01-10 03:33:45 +00:00
groups = {oddly_breakable_by_hand=3,flammable=2},
2017-01-10 03:57:55 +00:00
sounds = default.node_sound_leaves_defaults(),
2015-06-29 17:55:56 +00:00
})
2017-01-10 03:54:42 +00:00
--[[
2017-01-10 03:49:18 +00:00
minetest.register_node("default:bone_block", {
description = "Bone Block",
-- FIXME: Missing texutres
tiles = {"default_bone_block_top.png", "default_bone_block_top.png", "default_bone_block_side.png"},
is_ground_content = false,
paramtype2 = "facedir",
on_place = minetest.rotate_node,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
2017-01-10 03:54:42 +00:00
]]
2017-01-10 03:49:18 +00:00
2015-06-29 17:55:56 +00:00
minetest.register_node("default:sea_lantern", {
description = "Sea Lantern",
paramtype2 = "facedir",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
2017-01-04 09:11:35 +00:00
light_source = 14,
2015-06-29 17:55:56 +00:00
drop = {
max_items = 1,
items = {
2017-01-04 07:01:40 +00:00
{ items = {'default:prismarine_cry 3'}, rarity = 2 },
{ items = {'default:prismarine_cry 2'}}
2015-06-29 17:55:56 +00:00
}
},
tiles = {"default_sea_lantern.png"},
groups = {oddly_breakable_by_hand=3},
2017-01-07 03:27:00 +00:00
sounds = default.node_sound_glass_defaults(),
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:prismarine", {
description = "Prismarine",
stack_max = 64,
is_ground_content = false,
tiles = {{name="default_prismarine_anim.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=45.0}}},
groups = {cracky=3},
2017-01-07 03:27:00 +00:00
sounds = default.node_sound_stone_defaults(),
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:prismarine_brick", {
description = "Prismarine Bricks",
stack_max = 64,
is_ground_content = false,
tiles = {"default_prismarine_bricks.png"},
groups = {cracky=2},
2017-01-07 03:27:00 +00:00
sounds = default.node_sound_stone_defaults(),
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:prismarine_dark", {
description = "Dark Prismarine",
stack_max = 64,
is_ground_content = false,
tiles = {"default_prismarine_dark.png"},
groups = {cracky=2},
2017-01-07 03:27:00 +00:00
sounds = default.node_sound_stone_defaults(),
2015-06-29 17:55:56 +00:00
})
2017-01-09 03:44:07 +00:00
-- Oak tree --
2015-06-29 17:55:56 +00:00
minetest.register_node("default:tree", {
2017-01-07 03:17:08 +00:00
description = "Oak Wood",
2015-06-29 17:55:56 +00:00
tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
paramtype2 = "facedir",
on_place = minetest.rotate_node,
stack_max = 64,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:sapling", {
description = "Oak Sapling",
2015-06-29 17:55:56 +00:00
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_sapling.png"},
inventory_image = "default_sapling.png",
wield_image = "default_sapling.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
stack_max = 64,
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_defaults(),
})
minetest.register_node("default:leaves", {
description = "Oak Leaves",
2015-06-29 17:55:56 +00:00
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_leaves.png"},
paramtype = "light",
stack_max = 64,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:sapling'},
rarity = 20,
},
2017-01-09 03:54:46 +00:00
{
2017-01-04 07:01:40 +00:00
-- player will get apple with 1/200 chance
2015-06-29 17:55:56 +00:00
items = {'default:apple'},
rarity = 200,
},
}
},
sounds = default.node_sound_leaves_defaults(),
})
2017-01-09 03:44:07 +00:00
-- Dark oak tree --
2017-01-10 00:59:21 +00:00
minetest.register_node("default:darktree", {
2017-01-09 03:44:07 +00:00
description = "Dark Oak Wood",
tiles = {"default_log_big_oak_top.png", "default_log_big_oak_top.png", "default_log_big_oak.png"},
paramtype2 = "facedir",
on_place = minetest.rotate_node,
stack_max = 64,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:darksapling", {
description = "Dark Oak Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_sapling_big_oak.png"},
inventory_image = "default_sapling_big_oak.png",
wield_image = "default_sapling_big_oak.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
stack_max = 64,
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1},
sounds = default.node_sound_defaults(),
})
minetest.register_node("default:darkleaves", {
description = "Dark Oak Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_leaves_big_oak.png"},
paramtype = "light",
stack_max = 64,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:darksapling'},
rarity = 20,
},
2017-01-09 03:54:46 +00:00
{
-- player will get apple with 1/200 chance
items = {'default:apple'},
rarity = 200,
},
2017-01-09 03:44:07 +00:00
}
},
sounds = default.node_sound_leaves_defaults(),
})
2015-06-29 17:55:56 +00:00
-- Jungle Tree --
minetest.register_node("default:jungletree", {
description = "Jungle Wood",
2015-06-29 17:55:56 +00:00
tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
stack_max = 64,
paramtype2 = "facedir",
on_place = minetest.rotate_node,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:junglewood", {
description = "Jungle Wood Planks",
2015-06-29 17:55:56 +00:00
tiles = {"default_junglewood.png"},
stack_max = 64,
is_ground_content = false,
2015-06-29 17:55:56 +00:00
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:jungleleaves", {
description = "Jungle Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_jungleleaves.png"},
paramtype = "light",
stack_max = 64,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{
items = {'default:junglesapling'},
2017-01-04 07:01:40 +00:00
rarity = 40,
2015-06-29 17:55:56 +00:00
},
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:junglesapling", {
description = "Jungle Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_junglesapling.png"},
inventory_image = "default_junglesapling.png",
wield_image = "default_junglesapling.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
stack_max = 64,
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_defaults(),
})
-- Accacia Tree --
minetest.register_node("default:acaciatree", {
description = "Acacia Wood",
2015-06-29 17:55:56 +00:00
tiles = {"default_acaciatree_top.png", "default_acaciatree_top.png", "default_acaciatree.png"},
stack_max = 64,
paramtype2 = "facedir",
on_place = minetest.rotate_node,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:acaciawood", {
description = "Acacia Wood Planks",
2015-06-29 17:55:56 +00:00
tiles = {"default_acaciawood.png"},
stack_max = 64,
is_ground_content = false,
2015-06-29 17:55:56 +00:00
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:acacialeaves", {
description = "Acacia Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_acacialeaves.png"},
paramtype = "light",
stack_max = 64,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{
items = {'default:acaciasapling'},
rarity = 20,
},
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:acaciasapling", {
description = "Acacia Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_acaciasapling.png"},
inventory_image = "default_acaciasapling.png",
wield_image = "default_acaciasapling.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
stack_max = 64,
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_defaults(),
})
-- Spruce Tree --
minetest.register_node("default:sprucetree", {
description = "Spruce Wood",
2015-06-29 17:55:56 +00:00
tiles = {"default_sprucetree_top.png", "default_sprucetree_top.png", "default_sprucetree.png"},
stack_max = 64,
paramtype2 = "facedir",
on_place = minetest.rotate_node,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:sprucewood", {
description = "Spruce Wood Planks",
2015-06-29 17:55:56 +00:00
tiles = {"default_sprucewood.png"},
stack_max = 64,
is_ground_content = false,
2015-06-29 17:55:56 +00:00
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:spruceleaves", {
description = "Spruce Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_spruceleaves.png"},
paramtype = "light",
stack_max = 64,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:sprucesapling'},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {''},
}
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:sprucesapling", {
description = "Spruce Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_sprucesapling.png"},
inventory_image = "default_sprucesapling.png",
wield_image = "default_sprucesapling.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
stack_max = 64,
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_defaults(),
})
2017-01-10 01:38:08 +00:00
minetest.register_node("default:birchtree", {
description = "Birch Wood",
tiles = {"default_log_birch_top.png", "default_log_birch_top.png", "default_log_birch.png"},
stack_max = 64,
paramtype2 = "facedir",
on_place = minetest.rotate_node,
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
2015-06-29 17:55:56 +00:00
2017-01-10 01:38:08 +00:00
minetest.register_node("default:birchwood", {
description = "Birch Wood Planks",
tiles = {"default_planks_birch.png"},
stack_max = 64,
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:birchleaves", {
description = "Birch Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_leaves_birch.png"},
paramtype = "light",
stack_max = 64,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
{
-- player will get sapling with 1/20 chance
items = {'default:birchsapling'},
rarity = 20,
},
}
},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:birchsapling", {
description = "Birch Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_sapling_birch.png"},
inventory_image = "default_sapling_birch.png",
wield_image = "default_sapling_birch.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
stack_max = 64,
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1},
sounds = default.node_sound_defaults(),
})
2015-06-29 17:55:56 +00:00
minetest.register_node("default:junglegrass", {
2017-01-05 03:48:48 +00:00
description = "Double Tallgrass",
2015-06-29 17:55:56 +00:00
drawtype = "plantlike",
visual_scale = 1.3,
tiles = {"default_junglegrass.png"},
inventory_image = "default_junglegrass.png",
wield_image = "default_junglegrass.png",
paramtype = "light",
walkable = false,
buildable_to = true,
is_ground_content = true,
stack_max = 64,
2017-01-07 03:59:31 +00:00
groups = {dig_immediate=3,flammable=2,attached_node=1,dig_by_water=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
2017-01-07 23:33:30 +00:00
drop = {
max_items = 1,
items = {
{
items = {'farming:wheat_seed'},
rarity = 24,
},
}
},
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:cactus", {
description = "Cactus",
drawtype = "nodebox",
tiles = {"default_cactus_top.png", "default_cactus_bottom.png", "default_cactus_side.png","default_cactus_side.png","default_cactus_side.png","default_cactus_side.png"},
is_ground_content = true,
stack_max = 64,
2017-01-12 06:13:58 +00:00
groups = {oddly_breakable_by_hand=2,},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
{-7/16, -8/16, -7/16, 7/16, 8/16, 7/16}, -- Main Body
{-8/16, -8/16, -7/16, 8/16, 8/16, -7/16}, -- Spikes
{-8/16, -8/16, 7/16, 8/16, 8/16, 7/16}, -- Spikes
{-7/16, -8/16, -8/16, -7/16, 8/16, 8/16}, -- Spikes
{7/16, -8/16, 8/16, 7/16, 8/16, -8/16}, -- Spikes
},
},
selection_box = {
type = "fixed",
fixed = {
{-7/16, -8/16, -7/16, 7/16, 8/16, 7/16},
},
},
})
minetest.register_node("default:reeds", {
description = "Sugar Canes",
2015-06-29 17:55:56 +00:00
drawtype = "plantlike",
tiles = {"default_papyrus.png"},
inventory_image = "default_sugar_cane.png",
wield_image = "default_sugar_cane.png",
paramtype = "light",
walkable = false,
is_ground_content = true,
node_box = {
type = "fixed",
fixed = {
{-7/16, -8/16, -7/16, 7/16, 8/16, 7/16}, -- Main Body
{-8/16, -8/16, -7/16, 8/16, 8/16, -7/16}, -- Spikes
{-8/16, -8/16, 7/16, 8/16, 8/16, 7/16}, -- Spikes
{-7/16, -8/16, -8/16, -7/16, 8/16, 8/16}, -- Spikes
{7/16, -8/16, 8/16, 7/16, 8/16, -8/16}, -- Spikes
},
},
selection_box = {
type = "fixed",
fixed = {
{-7/16, -8/16, -7/16, 7/16, 8/16, 7/16},
},
},
stack_max = 64,
2017-01-04 05:51:26 +00:00
groups = {dig_immediate=3,flammable=2},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:quartz_ore", {
description = "Nether Quartz Ore",
2015-06-29 17:55:56 +00:00
stack_max = 64,
tiles = {"default_quartz_ore.png"},
is_ground_content = false,
2017-01-04 05:51:26 +00:00
groups = {cracky=3,},
2015-06-29 17:55:56 +00:00
drop = 'default:quartz_crystal',
sounds = default.node_sound_stone_defaults(),
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:quartz_block", {
description = "Block of Quartz",
2015-06-29 17:55:56 +00:00
stack_max = 64,
tiles = {"default_quartz_block_top.png", "default_quartz_block_bottom.png", "default_quartz_block_side.png"},
groups = {snappy=1,cracky=1,level=2,quartz_block=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:quartz_chiseled", {
2017-01-05 03:39:36 +00:00
description = "Chiseled Quartz Block",
2015-06-29 17:55:56 +00:00
stack_max = 64,
is_ground_content = false,
2015-06-29 17:55:56 +00:00
tiles = {"default_quartz_chiseled_top.png", "default_quartz_chiseled_top.png", "default_quartz_chiseled_side.png"},
groups = {snappy=1,cracky=1,level=2,quartz_block=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:quartz_pillar", {
description = "Pillar Quartz Block",
2015-06-29 17:55:56 +00:00
stack_max = 64,
paramtype2 = "facedir",
is_ground_content = true,
2015-06-29 17:55:56 +00:00
on_place = minetest.rotate_node,
tiles = {"default_quartz_pillar_top.png", "default_quartz_pillar_top.png", "default_quartz_pillar_side.png"},
groups = {snappy=1,cracky=1,level=2,quartz_block=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:bedrock", {
description = "Bedrock",
tiles = {"default_bedrock.png"},
stack_max = 64,
groups = {oddly_breakable_by_hand=5},
sounds = default.node_sound_stone_defaults(),
2017-01-04 08:42:25 +00:00
is_ground_content = false,
on_blast = function() end,
2017-01-05 00:00:43 +00:00
drop = '',
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:bookshelf", {
description = "Bookshelf",
tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
stack_max = 64,
is_ground_content = false,
2015-06-29 17:55:56 +00:00
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
2017-01-04 12:03:41 +00:00
drop = "default:book 3",
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:slimeblock", {
description = "Slime Block",
drawtype = "nodebox",
paramtype = "light",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
node_box = {
type = "fixed",
fixed = {
{-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
}
},
tiles = {"default_slimeblock.png"},
paramtype = "light",
use_texture_alpha = true,
sunlight_propagates = true,
stack_max = 64,
2017-01-04 06:19:15 +00:00
-- According to Minecraft Wiki, bouncing off a slime block from a height off 255 blocks should result in a bounce height of 50 blocks
-- bouncy=44 makes the player bounce up to 49.6. This value was chosen by experiment.
groups = {oddly_breakable_by_hand=3,dig_immediate=2,bouncy=44,fall_damage_add_percent=-100},
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:glass", {
description = "Glass",
drawtype = "glasslike",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
tiles = {"default_glass.png"},
paramtype = "light",
sunlight_propagates = true,
stack_max = 64,
groups = {cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults(),
drop = "",
})
---- colored glass
2017-01-04 11:50:23 +00:00
AddGlass( "Red Stained Glass", "basecolor_red", "red")
AddGlass( "Green Stained Glass", "unicolor_dark_green", "green")
AddGlass( "Blue Stained Glass", "basecolor_blue", "blue")
2017-01-04 21:55:39 +00:00
AddGlass( "Light Blue Stained Glass", "unicolor_light_blue", "light_blue")
2017-01-04 11:50:23 +00:00
AddGlass( "Black Stained Glass", "basecolor_black", "black")
AddGlass( "White Stained Glass", "basecolor_white", "white")
AddGlass( "Yellow Stained Glass", "basecolor_yellow", "yellow")
AddGlass( "Brown Stained Glass", "unicolor_dark_orange", "brown")
AddGlass( "Orange Stained Glass", "excolor_orange", "orange")
AddGlass( "Pink Stained Glass", "unicolor_light_red", "pink")
AddGlass( "Gray Stained Glass", "unicolor_darkgrey", "gray")
AddGlass( "Lime Stained Glass", "basecolor_green", "lime")
AddGlass( "Light Gray Stained Glass", "basecolor_grey", "silver")
AddGlass( "Magenta Stained Glass", "basecolor_magenta", "magenta")
AddGlass( "Purple Stained Glass", "excolor_violet", "purple")
AddGlass( "Cyan Stained Glass", "basecolor_cyan", "cyan")
2015-06-29 17:55:56 +00:00
minetest.register_node("default:rail", {
description = "Rail",
drawtype = "raillike",
tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
inventory_image = "default_rail.png",
wield_image = "default_rail.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
stack_max = 64,
2017-01-05 14:33:26 +00:00
groups = {dig_immediate=2,attached_node=1,rail=1,connect_to_raillike=1,dig_by_water=1},
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:ladder", {
description = "Ladder",
drawtype = "signlike",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
tiles = {"default_ladder.png"},
inventory_image = "default_ladder.png",
wield_image = "default_ladder.png",
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
--wall_top = = <default>
--wall_bottom = = <default>
--wall_side = = <default>
},
stack_max = 64,
groups = {choppy=2,oddly_breakable_by_hand=3,flammable=2},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:vine", {
description = "Vines",
2015-06-29 17:55:56 +00:00
drawtype = "signlike",
tiles = {"default_vine.png"},
inventory_image = "default_vine.png",
wield_image = "default_vine.png",
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
climbable = true,
selection_box = {
type = "wallmounted",
},
stack_max = 64,
groups = {choppy=2,oddly_breakable_by_hand=3,flammable=2},
sounds = default.node_sound_leaves_defaults(),
drop = "",
after_dig_node = function(pos, oldnode, oldmetadata, user)
local item = user:get_wielded_item()
if item:get_name() == "default:shears" then
user:get_inventory():add_item("main", ItemStack(oldnode.name))
end
local next_find = true
local ptr = 1
while next_find == true do
local pos2 = {x=pos.x, y=pos.y-ptr, z=pos.z}
local node = minetest.get_node(pos2)
2015-06-29 17:55:56 +00:00
if node.name == "default:vine" and check_attached_node(pos2, node) == false then
drop_attached_node(pos2)
nodeupdate(pos2)
ptr = ptr + 1
else
next_find = false
end
end
end
})
minetest.register_node("default:wood", {
2017-01-07 03:17:08 +00:00
description = "Oak Wood Planks",
2015-06-29 17:55:56 +00:00
tiles = {"default_wood.png"},
stack_max = 64,
is_ground_content = false,
2015-06-29 17:55:56 +00:00
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
2017-01-09 03:44:07 +00:00
minetest.register_node("default:darkwood", {
description = "Dark Oak Wood Planks",
tiles = {"default_planks_big_oak.png"},
stack_max = 64,
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
2015-06-29 17:55:56 +00:00
minetest.register_node("default:water_flowing", {
description = "Flowing Water",
inventory_image = minetest.inventorycube("default_water.png"),
drawtype = "flowingliquid",
2017-01-05 03:53:52 +00:00
tiles = {name="default_water_flowing_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=2.0}},
2015-06-29 17:55:56 +00:00
special_tiles = {
{
image="default_water_flowing_animated.png",
backface_culling=false,
2017-01-05 03:53:52 +00:00
animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=2.0}
2015-06-29 17:55:56 +00:00
},
{
image="default_water_flowing_animated.png",
backface_culling=true,
2017-01-05 03:53:52 +00:00
animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=2.0}
2015-06-29 17:55:56 +00:00
},
},
alpha = WATER_ALPHA,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
2017-01-11 23:59:56 +00:00
drowning = 4,
2015-06-29 17:55:56 +00:00
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
freezemelt = "default:snow",
post_effect_color = {a=64, r=100, g=100, b=200},
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1, freezes=1, melt_around=1},
})
minetest.register_node("default:water_source", {
2017-01-12 00:41:40 +00:00
description = "Still Water",
2015-06-29 17:55:56 +00:00
inventory_image = minetest.inventorycube("default_water.png"),
drawtype = "liquid",
tiles = {
{name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=5.0}}
},
special_tiles = {
-- New-style water source material (mostly unused)
{
name="default_water_source_animated.png",
animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=5.0},
backface_culling = false,
}
},
alpha = WATER_ALPHA,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
2017-01-11 23:59:56 +00:00
drowning = 4,
2015-06-29 17:55:56 +00:00
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = WATER_VISC,
liquid_range = 7,
freezemelt = "default:ice",
post_effect_color = {a=64, r=100, g=100, b=200},
stack_max = 64,
groups = {water=3, liquid=3, puts_out_fire=1, freezes=1},
})
minetest.register_node("default:lava_flowing", {
description = "Flowing Lava",
inventory_image = minetest.inventorycube("default_lava.png"),
drawtype = "flowingliquid",
tiles = {"default_lava.png"},
special_tiles = {
{
image="default_lava_flowing_animated.png",
backface_culling=false,
animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=3.3}
},
{
image="default_lava_flowing_animated.png",
backface_culling=true,
animation={type="vertical_frames", aspect_w=64, aspect_h=64, length=3.3}
},
},
paramtype = "light",
paramtype2 = "flowingliquid",
2017-01-04 09:11:35 +00:00
light_source = 14,
2015-06-29 17:55:56 +00:00
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
2017-01-11 23:59:56 +00:00
--[[ Drowning in Minecraft deals 2 damage per second.
In Minetest, drowning damage is dealt every 2 seconds so this
translates to 4 drowning damage ]]
drowning = 4,
2015-06-29 17:55:56 +00:00
liquidtype = "flowing",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
liquid_viscosity = LAVA_VISC,
liquid_renewable = false,
2017-01-04 06:02:51 +00:00
liquid_range = 4,
2015-06-29 17:55:56 +00:00
damage_per_second = 4*2,
post_effect_color = {a=192, r=255, g=64, b=0},
2017-01-05 01:23:26 +00:00
groups = {lava=3, liquid=2, igniter=3, not_in_creative_inventory=1},
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:lava_source", {
2017-01-12 00:41:40 +00:00
description = "Still Lava",
2015-06-29 17:55:56 +00:00
inventory_image = minetest.inventorycube("default_lava.png"),
drawtype = "liquid",
tiles = {
{name="default_lava_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
},
special_tiles = {
-- New-style lava source material (mostly unused)
{
name="default_lava_source_animated.png",
animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=3.0},
backface_culling = false,
}
},
paramtype = "light",
2017-01-04 09:11:35 +00:00
light_source = 14,
2015-06-29 17:55:56 +00:00
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
drop = "",
2017-01-11 23:59:56 +00:00
drowning = 4,
2015-06-29 17:55:56 +00:00
liquidtype = "source",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
liquid_viscosity = LAVA_VISC,
liquid_renewable = false,
2017-01-04 06:02:51 +00:00
liquid_range = 4,
2015-06-29 17:55:56 +00:00
damage_per_second = 4*2,
post_effect_color = {a=192, r=255, g=64, b=0},
stack_max = 64,
2017-01-05 01:23:26 +00:00
groups = {lava=3, liquid=2, igniter=3},
2015-06-29 17:55:56 +00:00
})
local function get_chest_neighborpos(pos, param2, side)
if side == "right" then
if param2 == 0 then
return {x=pos.x-1, y=pos.y, z=pos.z}
elseif param2 == 1 then
return {x=pos.x, y=pos.y, z=pos.z+1}
elseif param2 == 2 then
return {x=pos.x+1, y=pos.y, z=pos.z}
elseif param2 == 3 then
return {x=pos.x, y=pos.y, z=pos.z-1}
end
else
if param2 == 0 then
return {x=pos.x+1, y=pos.y, z=pos.z}
elseif param2 == 1 then
return {x=pos.x, y=pos.y, z=pos.z-1}
elseif param2 == 2 then
return {x=pos.x-1, y=pos.y, z=pos.z}
elseif param2 == 3 then
return {x=pos.x, y=pos.y, z=pos.z+1}
end
end
end
minetest.register_node("default:chest", {
description = "Chest",
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
paramtype2 = "facedir",
stack_max = 64,
groups = {choppy=2,oddly_breakable_by_hand=2},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local param2 = minetest.get_node(pos).param2
local meta = minetest.get_meta(pos)
if minetest.get_node(get_chest_neighborpos(pos, param2, "right")).name == "default:chest" then
minetest.set_node(pos, {name="default:chest_right",param2=param2})
2015-06-29 17:55:56 +00:00
local p = get_chest_neighborpos(pos, param2, "right")
meta:set_string("formspec",
"size[9,11.5]"..
2017-01-17 18:42:59 +00:00
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header..
"list[nodemeta:"..p.x..","..p.y..","..p.z..";main;0,0.5;9,3;]"..
"list[current_name;main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]"..
"list[current_player;main;0,10.75;9,1;]"..
2017-01-05 05:26:10 +00:00
"listring[current_player;main]"..
"listring[nodemeta:"..p.x..","..p.y..","..p.z..";main]"..
"listring[current_player;main]"..
"listring[current_name;main]")
2017-01-12 21:34:34 +00:00
minetest.swap_node(p, { name = "default:chest_left", param2 = param2 })
local m = minetest.get_meta(p)
2015-06-29 17:55:56 +00:00
m:set_string("formspec",
"size[9,11.5]"..
2017-01-17 18:42:59 +00:00
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header..
"list[current_name;main;0,0.5;9,3;]"..
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]"..
"list[current_player;main;0,10.75;9,1;]"..
2017-01-05 05:26:10 +00:00
"listring[current_player;main]"..
"listring[current_name;main]"..
"listring[current_player;main]"..
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]")
elseif minetest.get_node(get_chest_neighborpos(pos, param2, "left")).name == "default:chest" then
minetest.set_node(pos, {name="default:chest_left",param2=param2})
2015-06-29 17:55:56 +00:00
local p = get_chest_neighborpos(pos, param2, "left")
meta:set_string("formspec",
"size[9,11.5]"..
2017-01-17 18:42:59 +00:00
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header..
"list[current_name;main;0,0.5;9,3;]"..
"list[nodemeta:"..p.x..","..p.y..","..p.z..";main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]"..
"list[current_player;main;0,10.75;9,1;]"..
2017-01-05 05:26:10 +00:00
"listring[current_player;main]"..
"listring[current_name;main]"..
"listring[current_player;main]"..
"listring[nodemeta:"..p.x..","..p.y..","..p.z..";main]")
2017-01-12 21:34:34 +00:00
minetest.swap_node(p, { name = "default:chest_right", param2 = param2 })
local m = minetest.get_meta(p)
2015-06-29 17:55:56 +00:00
m:set_string("formspec",
"size[9,11.5]"..
2017-01-17 18:42:59 +00:00
"background[-0.19,-0.25;9.41,12.5;crafting_inventory_chest_large.png]"..
default.inventory_header..
"list[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main;0,0.5;9,3;]"..
"list[current_name;main;0,3.5;9,3;]"..
"list[current_player;main;0,7.5;9,3;9]"..
"list[current_player;main;0,10.75;9,1;]"..
2017-01-05 05:26:10 +00:00
"listring[current_player;main]"..
"listring[nodemeta:"..pos.x..","..pos.y..","..pos.z..";main]"..
"listring[current_player;main]"..
"listring[current_name;main]")
2015-06-29 17:55:56 +00:00
else
meta:set_string("formspec",
2017-01-05 23:24:50 +00:00
"size[9,8.75]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
2017-01-05 05:26:10 +00:00
default.inventory_header..
2017-01-05 23:24:50 +00:00
"list[current_name;main;0,0.5;9,3;]"..
"list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]"..
2017-01-05 05:26:10 +00:00
"listring[current_name;main]"..
"listring[current_player;main]")
2015-06-29 17:55:56 +00:00
end
local inv = meta:get_inventory()
inv:set_size("main", 9*3)
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
local meta2 = meta
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for i=1,inv:get_size("main") do
local stack = inv:get_stack("main", i)
if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5}
minetest.add_item(p, stack)
2015-06-29 17:55:56 +00:00
end
end
meta:from_table(meta2:to_table())
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from chest at "..minetest.pos_to_string(pos))
end,
})
minetest.register_node("default:chest_left", {
tiles = {"default_chest_top_big.png", "default_chest_top_big.png", "default_chest_side.png",
"default_chest_side.png", "default_chest_side_big.png^[transformFX", "default_chest_front_big.png"},
paramtype2 = "facedir",
groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
drop = "default:chest",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_wood_defaults(),
on_destruct = function(pos)
2017-01-12 21:14:32 +00:00
local n = minetest.get_node(pos)
2017-01-12 21:35:51 +00:00
if n.name == "default:chest" then
2015-06-29 17:55:56 +00:00
return
end
2017-01-12 21:14:32 +00:00
local param2 = n.param2
2015-06-29 17:55:56 +00:00
local p = get_chest_neighborpos(pos, param2, "left")
2017-01-12 21:40:02 +00:00
if not p or minetest.get_node(p).name ~= "default:chest_right" then
2015-06-29 17:55:56 +00:00
return
end
local meta = minetest.get_meta(p)
2015-06-29 17:55:56 +00:00
meta:set_string("formspec",
2017-01-05 23:24:50 +00:00
"size[9,8.75]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
2017-01-05 05:26:10 +00:00
default.inventory_header..
2017-01-05 23:24:50 +00:00
"list[current_name;main;0,0.5;9,3;]"..
"list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]"..
2017-01-05 05:26:10 +00:00
"listring[current_name;main]"..
"listring[current_player;main]")
2017-01-12 21:40:02 +00:00
minetest.swap_node(p, { name = "default:chest", param2 = param2 })
2015-06-29 17:55:56 +00:00
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
local meta2 = meta
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for i=1,inv:get_size("main") do
local stack = inv:get_stack("main", i)
if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5}
minetest.add_item(p, stack)
2015-06-29 17:55:56 +00:00
end
end
meta:from_table(meta2:to_table())
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from chest at "..minetest.pos_to_string(pos))
end,
})
minetest.register_node("default:chest_right", {
tiles = {"default_chest_top_big.png^[transformFX", "default_chest_top_big.png^[transformFX", "default_chest_side.png",
"default_chest_side.png", "default_chest_side_big.png", "default_chest_front_big.png^[transformFX"},
paramtype2 = "facedir",
groups = {choppy=2,oddly_breakable_by_hand=2,not_in_creative_inventory=1},
drop = "default:chest",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_wood_defaults(),
on_destruct = function(pos)
2017-01-12 21:14:32 +00:00
local n = minetest.get_node(pos)
if n.name == "default:chest" then
2015-06-29 17:55:56 +00:00
return
end
2017-01-12 21:14:32 +00:00
local param2 = n.param2
2015-06-29 17:55:56 +00:00
local p = get_chest_neighborpos(pos, param2, "right")
2017-01-12 21:40:02 +00:00
if not p or minetest.get_node(p).name ~= "default:chest_left" then
2015-06-29 17:55:56 +00:00
return
end
local meta = minetest.get_meta(p)
2015-06-29 17:55:56 +00:00
meta:set_string("formspec",
2017-01-05 23:24:50 +00:00
"size[9,8.75]"..
"background[-0.19,-0.25;9.41,10.48;crafting_inventory_chest.png]"..
2017-01-05 05:26:10 +00:00
default.inventory_header..
2017-01-05 23:24:50 +00:00
"list[current_name;main;0,0.5;9,3;]"..
"list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]"..
2017-01-05 05:26:10 +00:00
"listring[current_name;main]"..
"listring[current_player;main]")
2017-01-12 21:40:02 +00:00
minetest.swap_node(p, { name = "default:chest", param2 = param2 })
2015-06-29 17:55:56 +00:00
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
local meta2 = meta
meta:from_table(oldmetadata)
local inv = meta:get_inventory()
for i=1,inv:get_size("main") do
local stack = inv:get_stack("main", i)
if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5}
minetest.add_item(p, stack)
2015-06-29 17:55:56 +00:00
end
end
meta:from_table(meta2:to_table())
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from chest at "..minetest.pos_to_string(pos))
end,
})
default.furnace_inactive_formspec =
2017-01-05 23:03:57 +00:00
"size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_furnace.png]"..
2017-01-05 05:12:50 +00:00
default.inventory_header..
2017-01-05 23:03:57 +00:00
"list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]"..
"list[current_name;src;2.75,0.5;1,1;]"..
"list[current_name;fuel;2.75,2.5;1,1;]"..
"list[current_name;dst;5.75,1.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
2017-01-05 05:12:50 +00:00
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
"listring[current_name;fuel]"..
"listring[current_player;main]"
2015-06-29 17:55:56 +00:00
minetest.register_node("default:furnace", {
description = "Furnace",
tiles = {"default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_front.png"},
paramtype2 = "facedir",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
meta:set_string("formspec", default.furnace_inactive_formspec)
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
2017-01-17 00:57:54 +00:00
inv:set_size("dst", 1)
2015-06-29 17:55:56 +00:00
end,
2017-01-17 00:57:22 +00:00
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
local meta2 = meta
meta:from_table(oldmetadata)
2015-06-29 17:55:56 +00:00
local inv = meta:get_inventory()
2017-01-17 00:57:22 +00:00
for _, listname in ipairs({"src", "dst", "fuel"}) do
local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5}
minetest.add_item(p, stack)
end
2015-06-29 17:55:56 +00:00
end
2017-01-17 00:57:22 +00:00
meta:from_table(meta2:to_table())
2015-06-29 17:55:56 +00:00
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
local inv = meta:get_inventory()
if listname == "fuel" then
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
return stack:get_count()
else
return 0
end
elseif listname == "src" then
return stack:get_count()
elseif listname == "dst" then
return 0
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
if to_list == "fuel" then
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
return count
else
return 0
end
elseif to_list == "src" then
return count
elseif to_list == "dst" then
return 0
end
end,
})
minetest.register_node("default:furnace_active", {
description = "Furnace",
tiles = {"default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_front_active.png"},
paramtype2 = "facedir",
is_ground_content = false,
2017-01-04 09:11:35 +00:00
light_source = 12,
2015-06-29 17:55:56 +00:00
drop = "default:furnace",
groups = {cracky=2, not_in_creative_inventory=1},
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
meta:set_string("formspec", default.furnace_inactive_formspec)
local inv = meta:get_inventory()
inv:set_size("fuel", 1)
inv:set_size("src", 1)
2017-01-17 00:57:54 +00:00
inv:set_size("dst", 1)
2015-06-29 17:55:56 +00:00
end,
2017-01-17 00:57:22 +00:00
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local meta = minetest.get_meta(pos)
local meta2 = meta
meta:from_table(oldmetadata)
2015-06-29 17:55:56 +00:00
local inv = meta:get_inventory()
2017-01-17 00:57:22 +00:00
for _, listname in ipairs({"src", "dst", "fuel"}) do
local stack = inv:get_stack(listname, 1)
if not stack:is_empty() then
local p = {x=pos.x+math.random(0, 10)/10-0.5, y=pos.y, z=pos.z+math.random(0, 10)/10-0.5}
minetest.add_item(p, stack)
end
2015-06-29 17:55:56 +00:00
end
2017-01-17 00:57:22 +00:00
meta:from_table(meta2:to_table())
2015-06-29 17:55:56 +00:00
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
local inv = meta:get_inventory()
if listname == "fuel" then
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
return stack:get_count()
else
return 0
end
elseif listname == "src" then
return stack:get_count()
elseif listname == "dst" then
return 0
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
if to_list == "fuel" then
if minetest.get_craft_result({method="fuel",width=1,items={stack}}).time ~= 0 then
return count
else
return 0
end
elseif to_list == "src" then
return count
elseif to_list == "dst" then
return 0
end
end,
})
minetest.register_abm({
nodenames = {"default:furnace","default:furnace_active"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local meta = minetest.get_meta(pos)
2015-06-29 17:55:56 +00:00
for i, name in ipairs({
"fuel_totaltime",
"fuel_time",
"src_totaltime",
"src_time"
}) do
if meta:get_string(name) == "" then
meta:set_float(name, 0.0)
end
end
local inv = meta:get_inventory()
local srclist = inv:get_list("src")
local cooked = nil
local aftercooked
if srclist then
cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
local was_active = false
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
was_active = true
meta:set_float("fuel_time", meta:get_float("fuel_time") + 1)
meta:set_float("src_time", meta:get_float("src_time") + 1)
if cooked and cooked.item and meta:get_float("src_time") >= cooked.time then
-- check if there's room for output in "dst" list
if inv:room_for_item("dst",cooked.item) then
-- Put result in "dst" list
inv:add_item("dst", cooked.item)
-- take stuff from "src" list
inv:set_stack("src", 1, aftercooked.items[1])
else
print("Could not insert '"..cooked.item:to_string().."'")
end
meta:set_string("src_time", 0)
end
end
if meta:get_float("fuel_time") < meta:get_float("fuel_totaltime") then
local percent = math.floor(meta:get_float("fuel_time") /
meta:get_float("fuel_totaltime") * 100)
2017-01-12 21:34:34 +00:00
minetest.swap_node(pos, { name = "default:furnace_active" })
2015-06-29 17:55:56 +00:00
meta:set_string("formspec",
2017-01-05 23:03:57 +00:00
"size[9,8.75]"..
"background[-0.19,-0.25;9.41,9.49;crafting_formspec_bg.png^crafting_inventory_furnace.png]"..
2017-01-05 05:12:50 +00:00
default.inventory_header..
2017-01-05 23:03:57 +00:00
"list[current_player;main;0,4.5;9,3;9]"..
"list[current_player;main;0,7.74;9,1;]"..
"list[current_name;src;2.75,0.5;1,1;]"..
"list[current_name;fuel;2.75,2.5;1,1;]"..
"list[current_name;dst;5.75,1.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
2017-01-05 05:12:50 +00:00
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
"listring[current_name;fuel]"..
"listring[current_player;main]")
2015-06-29 17:55:56 +00:00
return
end
local fuel = nil
local afterfuel
local cooked = nil
local fuellist = inv:get_list("fuel")
local srclist = inv:get_list("src")
if srclist then
cooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
end
if fuellist then
fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
end
if fuel.time <= 0 then
2017-01-12 21:34:34 +00:00
minetest.swap_node(pos, { name = "default:furnace" })
2015-06-29 17:55:56 +00:00
meta:set_string("formspec", default.furnace_inactive_formspec)
return
end
if cooked.item:is_empty() then
if was_active then
2017-01-12 21:34:34 +00:00
minetest.swap_node(pos, { name = "default:furnace" })
2015-06-29 17:55:56 +00:00
meta:set_string("formspec", default.furnace_inactive_formspec)
end
return
end
meta:set_string("fuel_totaltime", fuel.time)
meta:set_string("fuel_time", 0)
inv:set_stack("fuel", 1, afterfuel.items[1])
end,
})
minetest.register_node("default:cobble", {
description = "Cobblestone",
tiles = {"default_cobble.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:mossycobble", {
description = "Moss Stone",
2015-06-29 17:55:56 +00:00
tiles = {"default_mossycobble.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
2017-01-04 10:44:55 +00:00
minetest.register_node("default:coalblock", {
description = "Block of Coal",
tiles = {"default_coal_block.png"},
is_ground_content = false,
2017-01-04 10:44:55 +00:00
stack_max = 64,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
})
2015-06-29 17:55:56 +00:00
minetest.register_node("default:steelblock", {
2017-01-04 04:29:55 +00:00
description = "Block of Iron",
2015-06-29 17:55:56 +00:00
tiles = {"default_steel_block.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
groups = {cracky=1,level=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:goldblock", {
description = "Block of Gold",
2015-06-29 17:55:56 +00:00
tiles = {"default_gold_block.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:diamondblock", {
description = "Block of Diamond",
2015-06-29 17:55:56 +00:00
tiles = {"default_diamond_block.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
groups = {cracky=1,level=3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:lapisblock", {
description = "Lapis Lazul Block",
tiles = {"default_lapis_block.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:emeraldblock", {
description = "Block of Emerald",
2015-06-29 17:55:56 +00:00
tiles = {"default_emerald_block.png"},
is_ground_content = false,
2015-06-29 17:55:56 +00:00
stack_max = 64,
groups = {cracky=1},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:obsidian", {
description = "Obsidian",
tiles = {"default_obsidian.png"},
is_ground_content = true,
sounds = default.node_sound_stone_defaults(),
stack_max = 64,
groups = {cracky=4,level=2,oddly_breakable_by_hand=4},
})
minetest.register_node("default:dry_shrub", {
2017-01-04 07:01:40 +00:00
description = "Dead Bush",
2015-06-29 17:55:56 +00:00
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_dry_shrub.png"},
inventory_image = "default_dry_shrub.png",
wield_image = "default_dry_shrub.png",
paramtype = "light",
walkable = false,
stack_max = 64,
2017-01-07 03:59:31 +00:00
groups = {dig_immediate=3,flammable=3,attached_node=1,dig_by_water=1},
2017-01-04 07:01:40 +00:00
drop = {
max_items = 1,
items = {
{
items = {"default:stick 2"},
rarity = 2,
},
{
items = {"default:stick 1"},
rarity = 2,
},
}
},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-1/3, -1/2, -1/3, 1/3, 1/6, 1/3},
},
})
minetest.register_node("default:grass", {
2017-01-04 07:01:40 +00:00
description = "Tall Grass",
2015-06-29 17:55:56 +00:00
drawtype = "plantlike",
tiles = {"default_tallgrass.png"},
inventory_image = "default_tallgrass.png",
wield_image = "default_tallgrass.png",
drop = {
max_items = 1,
items = {
{
items = {'farming:wheat_seed'},
2017-01-07 23:33:30 +00:00
rarity = 24,
2015-06-29 17:55:56 +00:00
},
}
},
paramtype = "light",
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = {snappy=3,flammable=3,attached_node=1,dig_immediate=3,dig_by_water=1},
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_leaves_defaults(),
after_dig_node = function(pos, oldnode, oldmetadata, user)
local item = user:get_wielded_item()
if item:get_name() == "default:shears" then
user:get_inventory():add_item("main", ItemStack(oldnode.name))
end
end
})
minetest.register_node("default:glowstone", {
description = "Glowstone",
tiles = {"default_glowstone.png"},
is_ground_content = true,
stack_max = 64,
groups = {cracky=3},
drop = {
max_items = 1,
items = {
{items = {'default:glowdust 4'},rarity = 3},
2017-01-04 07:01:40 +00:00
{items = {'default:glowdust 3'},rarity = 3},
2015-06-29 17:55:56 +00:00
{items = {'default:glowdust 2'}},
}
},
light_source = 12,
2017-01-07 23:12:12 +00:00
sounds = default.node_sound_stone_defaults(),
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:sponge", {
description = "Sponge",
drawtype = "normal",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
tiles = {"default_sponge.png"},
paramtype = 'light',
walkable = true,
pointable = true,
diggable = true,
buildable_to = false,
stack_max = 64,
2017-01-07 23:16:32 +00:00
sounds = default.node_sound_dirt_defaults(),
2015-06-29 17:55:56 +00:00
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3},
on_place = function(itemstack, placer, pointed_thing)
local pn = placer:get_player_name()
if pointed_thing.type ~= "node" then
return itemstack
end
if minetest.is_protected(pointed_thing.above, pn) then
return itemstack
end
local change = false
local on_water = false
local pos = pointed_thing.above
-- verifier si il est dans l'eau ou a cotée
if string.find(minetest.get_node(pointed_thing.above).name, "water_source")
or string.find(minetest.get_node(pointed_thing.above).name, "water_flowing") then
2015-06-29 17:55:56 +00:00
on_water = true
end
for i=-1,1 do
local p = {x=pos.x+i, y=pos.y, z=pos.z}
local n = minetest.get_node(p)
2015-06-29 17:55:56 +00:00
-- On verifie si il y a de l'eau
if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
on_water = true
end
end
for i=-1,1 do
local p = {x=pos.x, y=pos.y+i, z=pos.z}
local n = minetest.get_node(p)
2015-06-29 17:55:56 +00:00
-- On verifie si il y a de l'eau
if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
on_water = true
end
end
for i=-1,1 do
local p = {x=pos.x, y=pos.y, z=pos.z+i}
local n = minetest.get_node(p)
2015-06-29 17:55:56 +00:00
-- On verifie si il y a de l'eau
if (n.name=="default:water_flowing") or (n.name == "default:water_source") then
on_water = true
end
end
if on_water == true then
for i=-3,3 do
for j=-3,3 do
for k=-3,3 do
p = {x=pos.x+i, y=pos.y+j, z=pos.z+k}
n = minetest.get_node(p)
2015-06-29 17:55:56 +00:00
-- On Supprime l'eau
if (n.name=="default:water_flowing") or (n.name == "default:water_source")then
minetest.add_node(p, {name="air"})
2015-06-29 17:55:56 +00:00
change = true
end
end
end
end
end
local p = {x=pos.x, y=pos.y, z=pos.z}
local n = minetest.get_node(p)
2015-06-29 17:55:56 +00:00
if change == true then
minetest.add_node(pointed_thing.above, {name = "default:sponge_wet"})
2015-06-29 17:55:56 +00:00
else
minetest.add_node(pointed_thing.above, {name = "default:sponge"})
2015-06-29 17:55:56 +00:00
end
return itemstack
end
})
minetest.register_node("default:sponge_wet", {
description = "Wet Sponge",
drawtype = "normal",
is_ground_content = false,
2015-06-29 17:55:56 +00:00
tiles = {"default_sponge_wet.png"},
paramtype = 'light',
walkable = true,
pointable = true,
diggable = true,
buildable_to = false,
stack_max = 64,
2017-01-07 23:16:32 +00:00
sounds = default.node_sound_dirt_defaults(),
2015-06-29 17:55:56 +00:00
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3},
})
minetest.register_node("default:ice", {
description = "Ice",
drawtype = "glasslike",
tiles = {"default_ice.png"},
is_ground_content = true,
paramtype = "light",
use_texture_alpha = true,
stack_max = 64,
groups = {cracky=3,oddly_breakable_by_hand=2},
2017-01-04 07:01:40 +00:00
drop = "",
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_glass_defaults(),
})
2017-01-08 01:49:07 +00:00
minetest.register_node("default:packed_ice", {
2015-06-29 17:55:56 +00:00
description = "Packed Ice",
drawtype = "glasslike",
tiles = {"default_ice_packed.png"},
is_ground_content = true,
paramtype = "light",
use_texture_alpha = true,
stack_max = 64,
2017-01-08 01:51:02 +00:00
groups = {cracky=3,oddly_breakable_by_hand=2},
2017-01-04 07:01:40 +00:00
drop = "",
2015-06-29 17:55:56 +00:00
sounds = default.node_sound_glass_defaults(),
})
2017-01-08 01:49:07 +00:00
-- Frosted Ice (4 nodes)
for i=0,3 do
local ice = {}
ice.increase_age = function(pos, ice_near, first_melt)
-- Increase age of frosted age or turn to water source if too old
local nn = minetest.get_node(pos).name
local age = tonumber(string.sub(nn, -1))
if age == nil then return end
local nextnode
if age < 3 then
nextnode = "default:frosted_ice_"..(age+1)
else
nextnode = "default:water_source"
end
minetest.swap_node(pos, { name = nextnode })
-- Spread aging to neighbor blocks, but not recursively
if first_melt and i == 3 then
for j=1, #ice_near do
ice.increase_age(ice_near[j], false)
end
end
end
local creative = 1
if i == 0 then
creative = 0
end
2017-01-08 01:49:07 +00:00
minetest.register_node("default:frosted_ice_"..i, {
description = "Frosted Ice",
drawtype = "glasslike",
tiles = {"default_frosted_ice_"..i..".png"},
is_ground_content = false,
paramtype = "light",
use_texture_alpha = true,
stack_max = 64,
groups = {cracky=2, frosted_ice=1, not_in_creative_inventory=creative},
2017-01-08 01:49:07 +00:00
drop = "",
sounds = default.node_sound_glass_defaults(),
on_construct = function(pos)
local timer = minetest.get_node_timer(pos)
timer:start(1.5)
end,
on_timer = function(pos, elapsed)
local ice_near = minetest.find_nodes_in_area(
{ x = pos.x - 1, y = pos.y - 1, z = pos.z - 1 },
{ x = pos.x + 1, y = pos.y + 1, z = pos.z + 1 },
{ "group:frosted_ice" }
)
-- Check condition to increase age
if (#ice_near < 4 and minetest.get_node_light(pos) > (11 - i)) or math.random(1, 3) == 1 then
ice.increase_age(pos, ice_near, true)
end
local timer = minetest.get_node_timer(pos)
timer:start(1.5)
end,
})
end
2015-06-29 17:55:56 +00:00
minetest.register_node("default:snow", {
2017-01-04 10:26:35 +00:00
description = "Top Snow",
2015-06-29 17:55:56 +00:00
tiles = {"default_snow.png"},
is_ground_content = true,
paramtype = "light",
buildable_to = true,
drawtype = "nodebox",
stack_max = 16,
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5},
},
},
groups = {crumbly=3,falling_node=1},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
2017-01-16 22:11:04 +00:00
drop = "mcl_throwing:snowball 2",
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:snowblock", {
description = "Snow",
2015-06-29 17:55:56 +00:00
tiles = {"default_snow.png"},
is_ground_content = true,
stack_max = 64,
groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
}),
2017-01-16 22:11:04 +00:00
drop = "mcl_throwing:snowball 4",
2015-06-29 17:55:56 +00:00
})
minetest.register_node("default:cobweb", {
description = "Cobweb",
drawtype = "plantlike",
visual_scale = 1.1,
stack_max = 64,
tiles = {"web.png"},
inventory_image = "web.png",
paramtype = "light",
sunlight_propagates = true,
liquid_viscosity = 14,
liquidtype = "source",
liquid_alternative_flowing = "default:cobweb",
liquid_alternative_source = "default:cobweb",
liquid_renewable = false,
liquid_range = 0,
walkable = false,
groups = {snappy=1,liquid=3,flammable=2},
2017-01-13 04:25:02 +00:00
drop = "default:string",
2015-06-29 17:55:56 +00:00
})