default = {}
-- Load other files
+dofile(minetest.get_modpath("default").."/player.lua")
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/leafdecay.lua")
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
- full_punch_interval = 1.0,
+ full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
- fleshy = {times={[2]=2.00, [3]=1.00}, uses=0, maxlevel=1},
+ fleshy = {times={[2]=0.75, [3]=0.6}, uses=0, maxlevel=1},
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
- oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3},
+ oddly_breakable_by_hand = {times={[1]=7.00,[2]=4.00,[3]=1.40}, uses=0, maxlevel=3}
}
}
})
description = "Wooden Pickaxe",
inventory_image = "default_tool_woodpick.png",
tool_capabilities = {
+ full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
- cracky={times={[2]=2.00, [3]=1.20}, uses=10, maxlevel=1}
+ cracky = {times={[2]=2.00, [3]=1.20}, uses=10, maxlevel=1},
+ fleshy = {times={[2]=0.95, [3]=0.6}, uses=15, maxlevel=1}
}
},
})
description = "Stone Pickaxe",
inventory_image = "default_tool_stonepick.png",
tool_capabilities = {
+ full_punch_interval = 1.3,
max_drop_level=0,
groupcaps={
- cracky={times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1}
+ cracky = {times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1},
+ fleshy = {times={[2]=0.7, [3]=0.5}, uses=25, maxlevel=1}
}
},
})
description = "Steel Pickaxe",
inventory_image = "default_tool_steelpick.png",
tool_capabilities = {
+ full_punch_interval = 1.0,
max_drop_level=1,
groupcaps={
- cracky={times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2}
+ cracky = {times={[1]=4.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
+ fleshy = {times={[2]=0.6, [3]=0.35}, uses=35, maxlevel=1}
}
},
})
description = "Mese Pickaxe",
inventory_image = "default_tool_mesepick.png",
tool_capabilities = {
- full_punch_interval = 1.0,
+ full_punch_interval = 0.65,
max_drop_level=3,
groupcaps={
- cracky={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
- crumbly={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
- snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}
+ cracky = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
+ crumbly = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
+ snappy = {times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3},
+ fleshy = {times={[2]=0.6, [3]=0.5}, uses=80, maxlevel=1}
}
},
})
minetest.register_tool("default:shovel_wood", {
description = "Wooden Shovel",
inventory_image = "default_tool_woodshovel.png",
+ wield_image = "default_tool_woodshovel.png^[transformR90",
tool_capabilities = {
+ full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
- crumbly={times={[1]=3.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1}
+ crumbly = {times={[1]=3.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1},
+ fleshy = {times={[2]=1.05, [3]=0.70}, uses=25, maxlevel=1}
}
},
})
minetest.register_tool("default:shovel_stone", {
description = "Stone Shovel",
inventory_image = "default_tool_stoneshovel.png",
+ wield_image = "default_tool_stoneshovel.png^[transformR90",
tool_capabilities = {
+ full_punch_interval = 1.4,
max_drop_level=0,
groupcaps={
- crumbly={times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1}
+ crumbly = {times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1},
+ fleshy = {times={[2]=0.75, [3]=0.50}, uses=40, maxlevel=1}
}
},
})
minetest.register_tool("default:shovel_steel", {
description = "Steel Shovel",
inventory_image = "default_tool_steelshovel.png",
+ wield_image = "default_tool_steelshovel.png^[transformR90",
tool_capabilities = {
+ full_punch_interval = 1.1,
max_drop_level=1,
groupcaps={
- crumbly={times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=30, maxlevel=2}
+ crumbly = {times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=30, maxlevel=2},
+ fleshy = {times={[2]=0.45, [3]=0.30}, uses=50, maxlevel=1}
}
},
})
description = "Wooden Axe",
inventory_image = "default_tool_woodaxe.png",
tool_capabilities = {
+ full_punch_interval = 1.0,
max_drop_level=0,
groupcaps={
- choppy={times={[2]=1.40, [3]=0.80}, uses=10, maxlevel=1},
- fleshy={times={[2]=1.50, [3]=0.80}, uses=10, maxlevel=1}
+ choppy = {times={[2]=1.60, [3]=1.20}, uses=10, maxlevel=1},
+ fleshy = {times={[2]=0.70, [3]=0.50}, uses=5, maxlevel=1}
}
},
})
description = "Stone Axe",
inventory_image = "default_tool_stoneaxe.png",
tool_capabilities = {
+ full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
- choppy={times={[1]=3.00, [2]=1.00, [3]=0.60}, uses=20, maxlevel=1},
- fleshy={times={[2]=1.30, [3]=0.70}, uses=20, maxlevel=1}
+ choppy={times={[1]=3.00, [2]=1.40, [3]=1.00}, uses=20, maxlevel=1},
+ fleshy={times={[2]=0.60, [3]=0.40}, uses=15, maxlevel=1}
}
},
})
description = "Steel Axe",
inventory_image = "default_tool_steelaxe.png",
tool_capabilities = {
+ full_punch_interval = 0.9,
max_drop_level=1,
groupcaps={
- choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=30, maxlevel=2},
- fleshy={times={[2]=1.10, [3]=0.60}, uses=40, maxlevel=1}
+ choppy={times={[1]=2.60, [2]=1.00, [3]=0.60}, uses=30, maxlevel=2},
+ fleshy={times={[2]=0.40, [3]=0.25}, uses=25, maxlevel=1}
}
},
})
description = "Wooden Sword",
inventory_image = "default_tool_woodsword.png",
tool_capabilities = {
- full_punch_interval = 1.0,
+ full_punch_interval = 0.9,
max_drop_level=0,
groupcaps={
fleshy={times={[2]=1.10, [3]=0.60}, uses=10, maxlevel=1},
- snappy={times={[2]=1.00, [3]=0.50}, uses=10, maxlevel=1},
- choppy={times={[3]=1.00}, uses=20, maxlevel=0}
+ snappy={times={[2]=0.9, [3]=0.45}, uses=10, maxlevel=1},
+ choppy={times={[3]=0.90}, uses=20, maxlevel=0}
}
}
})
description = "Stone Sword",
inventory_image = "default_tool_stonesword.png",
tool_capabilities = {
- full_punch_interval = 1.0,
+ full_punch_interval = 1.1,
max_drop_level=0,
groupcaps={
fleshy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
- snappy={times={[2]=0.80, [3]=0.40}, uses=20, maxlevel=1},
- choppy={times={[3]=0.90}, uses=20, maxlevel=0}
+ snappy={times={[2]=0.75, [3]=0.35}, uses=20, maxlevel=1},
+ choppy={times={[3]=0.70}, uses=20, maxlevel=0}
}
}
})
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
tool_capabilities = {
- full_punch_interval = 1.0,
+ full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
fleshy={times={[1]=2.00, [2]=0.80, [3]=0.40}, uses=10, maxlevel=2},
snappy={times={[2]=0.70, [3]=0.30}, uses=40, maxlevel=1},
- choppy={times={[3]=0.70}, uses=40, maxlevel=0}
+ choppy={times={[3]=0.65}, uses=40, maxlevel=0}
}
}
})
}
})
+minetest.register_craft({
+ output = 'default:junglewood 4',
+ recipe = {
+ {'default:jungletree'},
+ }
+})
+
minetest.register_craft({
output = 'default:stick 4',
recipe = {
- {'default:wood'},
+ {'group:wood'},
}
})
minetest.register_craft({
output = 'default:sign_wall',
recipe = {
- {'default:wood', 'default:wood', 'default:wood'},
- {'default:wood', 'default:wood', 'default:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_wood',
recipe = {
- {'default:wood', 'default:wood', 'default:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
minetest.register_craft({
output = 'default:pick_stone',
recipe = {
- {'default:cobble', 'default:cobble', 'default:cobble'},
+ {'group:stone', 'group:stone', 'group:stone'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
minetest.register_craft({
output = 'default:pick_mese',
recipe = {
- {'default:mese', 'default:mese', 'default:mese'},
+ {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
minetest.register_craft({
output = 'default:shovel_wood',
recipe = {
- {'default:wood'},
+ {'group:wood'},
{'default:stick'},
{'default:stick'},
}
minetest.register_craft({
output = 'default:shovel_stone',
recipe = {
- {'default:cobble'},
+ {'group:stone'},
{'default:stick'},
{'default:stick'},
}
minetest.register_craft({
output = 'default:axe_wood',
recipe = {
- {'default:wood', 'default:wood'},
- {'default:wood', 'default:stick'},
+ {'group:wood', 'group:wood'},
+ {'group:wood', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_stone',
recipe = {
- {'default:cobble', 'default:cobble'},
- {'default:cobble', 'default:stick'},
+ {'group:stone', 'group:stone'},
+ {'group:stone', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_wood',
recipe = {
- {'default:wood'},
- {'default:wood'},
+ {'group:wood'},
+ {'group:wood'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_stone',
recipe = {
- {'default:cobble'},
- {'default:cobble'},
+ {'group:stone'},
+ {'group:stone'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:chest',
recipe = {
- {'default:wood', 'default:wood', 'default:wood'},
- {'default:wood', '', 'default:wood'},
- {'default:wood', 'default:wood', 'default:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
+ {'group:wood', '', 'group:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:chest_locked',
recipe = {
- {'default:wood', 'default:wood', 'default:wood'},
- {'default:wood', 'default:steel_ingot', 'default:wood'},
- {'default:wood', 'default:wood', 'default:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
+ {'group:wood', 'default:steel_ingot', 'group:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:furnace',
recipe = {
- {'default:cobble', 'default:cobble', 'default:cobble'},
- {'default:cobble', '', 'default:cobble'},
- {'default:cobble', 'default:cobble', 'default:cobble'},
+ {'group:stone', 'group:stone', 'group:stone'},
+ {'group:stone', '', 'group:stone'},
+ {'group:stone', 'group:stone', 'group:stone'},
}
})
}
})
+minetest.register_craft({
+ output = 'default:steel_ingot 9',
+ recipe = {
+ {'default:steelblock'},
+ }
+})
+
minetest.register_craft({
output = 'default:sandstone',
recipe = {
- {'default:sand', 'default:sand'},
- {'default:sand', 'default:sand'},
+ {'group:sand', 'group:sand'},
+ {'group:sand', 'group:sand'},
+ }
+})
+
+minetest.register_craft({
+ output = 'default:sand 4',
+ recipe = {
+ {'default:sandstone'},
}
})
}
})
+minetest.register_craft({
+ output = 'default:clay_brick 4',
+ recipe = {
+ {'default:brick'},
+ }
+})
+
minetest.register_craft({
output = 'default:paper',
recipe = {
minetest.register_craft({
output = 'default:bookshelf',
recipe = {
- {'default:wood', 'default:wood', 'default:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
{'default:book', 'default:book', 'default:book'},
- {'default:wood', 'default:wood', 'default:wood'},
+ {'group:wood', 'group:wood', 'group:wood'},
}
})
}
})
+minetest.register_craft({
+ output = 'default:mese',
+ recipe = {
+ {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
+ {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
+ {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
+ }
+})
+
+minetest.register_craft({
+ output = 'default:mese_crystal 9',
+ recipe = {
+ {'default:mese'},
+ }
+})
+
+minetest.register_craft({
+ output = 'default:mese_crystal_fragment 9',
+ recipe = {
+ {'default:mese_crystal'},
+ }
+})
+
--
-- Crafting (tool repair)
--
minetest.register_craft({
type = "cooking",
output = "default:glass",
- recipe = "default:sand",
-})
-
-minetest.register_craft({
- type = "cooking",
- output = "default:glass",
- recipe = "default:desert_sand",
+ recipe = "group:sand",
})
minetest.register_craft({
minetest.register_craft({
type = "fuel",
- recipe = "default:tree",
- burntime = 30,
-})
-
-minetest.register_craft({
- type = "fuel",
- recipe = "default:jungletree",
+ recipe = "group:tree",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
- recipe = "default:leaves",
+ recipe = "group:leaves",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
- recipe = "default:wood",
+ recipe = "group:wood",
burntime = 7,
})
-minetest.register_craft({
- type = "fuel",
- recipe = "default:mese",
- burntime = 30,
-})
-
minetest.register_craft({
type = "fuel",
recipe = "default:lava_source",
burntime = 40,
})
+minetest.register_craft({
+ type = "fuel",
+ recipe = "default:junglesapling",
+ burntime = 10,
+})
+
--
-- Node definitions
--
function default.node_sound_glass_defaults(table)
table = table or {}
table.footstep = table.footstep or
- {name="default_stone_footstep", gain=0.25}
+ {name="default_hard_footstep", gain=0.25}
table.dug = table.dug or
{name="default_break_glass", gain=1.0}
default.node_sound_defaults(table)
description = "Stone",
tiles = {"default_stone.png"},
is_ground_content = true,
- groups = {cracky=3},
+ groups = {cracky=3, stone=1},
drop = 'default:cobble',
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
description = "Desert Stone",
tiles = {"default_desert_stone.png"},
is_ground_content = true,
- groups = {cracky=3},
+ groups = {cracky=3, stone=1},
drop = 'default:desert_stone',
legacy_mineral = true,
sounds = default.node_sound_stone_defaults(),
sounds = default.node_sound_stone_defaults(),
})
+minetest.register_node("default:stone_with_mese", {
+ description = "Mese Crystals in Stone",
+ tiles = {"default_stone.png^default_mineral_mese.png"},
+ is_ground_content = true,
+ groups = {cracky=1},
+ drop = "default:mese_crystal",
+ sounds = default.node_sound_stone_defaults(),
+})
+
minetest.register_node("default:dirt_with_grass", {
description = "Dirt with Grass",
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
description = "Dirt with Grass and Footsteps",
tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
is_ground_content = true,
- groups = {crumbly=3},
+ groups = {crumbly=3, not_in_creative_inventory=1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4},
description = "Sand",
tiles = {"default_sand.png"},
is_ground_content = true,
- groups = {crumbly=3, falling_node=1},
+ groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
description = "Desert Sand",
tiles = {"default_desert_sand.png"},
is_ground_content = true,
- groups = {sand=1, crumbly=3, falling_node=1},
+ groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
tiles = {"default_sandstone.png"},
is_ground_content = true,
groups = {crumbly=2,cracky=2},
- drop = 'default:sand',
sounds = default.node_sound_stone_defaults(),
})
tiles = {"default_brick.png"},
is_ground_content = true,
groups = {cracky=3},
- drop = 'default:clay_brick 4',
sounds = default.node_sound_stone_defaults(),
})
sounds = default.node_sound_wood_defaults(),
})
+minetest.register_node("default:junglewood", {
+ description = "Junglewood Planks",
+ tiles = {"default_junglewood.png"},
+ is_ground_content = true,
+ groups = {snappy=1,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",
+ groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
+ drop = {
+ max_items = 1,
+ items = {
+ {
+ -- player will get sapling with 1/20 chance
+ items = {'default:junglesapling'},
+ rarity = 20,
+ },
+ {
+ -- player will get leaves only if he get no saplings,
+ -- this is because max_items is 1
+ items = {'default:jungleleaves'},
+ }
+ }
+ },
+ 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}
+ },
+ groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
+ sounds = default.node_sound_defaults(),
+})
+-- alias for tree growing abm in content_abm.cpp
+minetest.register_alias("junglesapling", "default:junglesapling")
+
minetest.register_node("default:junglegrass", {
description = "Jungle Grass",
drawtype = "plantlike",
wield_image = "default_junglegrass.png",
paramtype = "light",
walkable = false,
- groups = {snappy=3,flammable=2},
+ groups = {snappy=3,flammable=2,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
})
visual_scale = 1.3,
tiles = {"default_leaves.png"},
paramtype = "light",
- groups = {snappy=3, leafdecay=3, flammable=2},
+ groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
drop = {
max_items = 1,
items = {
paramtype = "light",
is_ground_content = true,
walkable = false,
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
+ },
groups = {snappy=3,flammable=2},
sounds = default.node_sound_leaves_defaults(),
})
-- 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},
},
- groups = {bendy=2,snappy=1,dig_immediate=2},
+ groups = {bendy=2,snappy=1,dig_immediate=2,attached_node=1},
})
minetest.register_node("default:ladder", {
description = "Wooden Planks",
tiles = {"default_wood.png"},
is_ground_content = true,
- groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
+ groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(),
})
-minetest.register_node("default:mese", {
- description = "Mese",
- tiles = {"default_mese.png"},
- is_ground_content = true,
- groups = {cracky=1},
- sounds = default.node_sound_defaults(),
-})
-
minetest.register_node("default:cloud", {
description = "Cloud",
tiles = {"default_cloud.png"},
is_ground_content = true,
sounds = default.node_sound_defaults(),
+ groups = {not_in_creative_inventory=1},
})
minetest.register_node("default:water_flowing", {
drawtype = "flowingliquid",
tiles = {"default_water.png"},
special_tiles = {
- {name="default_water.png", backface_culling=false},
- {name="default_water.png", backface_culling=true},
+ {
+ image="default_water_flowing_animated.png",
+ backface_culling=false,
+ animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
+ },
+ {
+ image="default_water_flowing_animated.png",
+ backface_culling=true,
+ animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.8}
+ },
},
alpha = WATER_ALPHA,
paramtype = "light",
pointable = false,
diggable = false,
buildable_to = true,
+ drop = "",
liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = WATER_VISC,
post_effect_color = {a=64, r=100, g=100, b=200},
- groups = {water=3, liquid=3, puts_out_fire=1},
+ groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
})
minetest.register_node("default:water_source", {
description = "Water Source",
inventory_image = minetest.inventorycube("default_water.png"),
drawtype = "liquid",
- tiles = {"default_water.png"},
+ tiles = {
+ {name="default_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}}
+ },
special_tiles = {
-- New-style water source material (mostly unused)
- {name="default_water.png", backface_culling=false},
+ {
+ name="default_water_source_animated.png",
+ animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0},
+ backface_culling = false,
+ }
},
alpha = WATER_ALPHA,
paramtype = "light",
pointable = false,
diggable = false,
buildable_to = true,
+ drop = "",
liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
pointable = false,
diggable = false,
buildable_to = true,
+ drop = "",
liquidtype = "flowing",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
liquid_viscosity = LAVA_VISC,
damage_per_second = 4*2,
post_effect_color = {a=192, r=255, g=64, b=0},
- groups = {lava=3, liquid=2, hot=3, igniter=1},
+ groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1},
})
minetest.register_node("default:lava_source", {
},
special_tiles = {
-- New-style lava source material (mostly unused)
- {name="default_lava.png", backface_culling=false},
+ {
+ name="default_lava_source_animated.png",
+ animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0},
+ backface_culling = false,
+ }
},
paramtype = "light",
light_source = LIGHT_MAX - 1,
pointable = false,
diggable = false,
buildable_to = true,
+ drop = "",
liquidtype = "source",
liquid_alternative_flowing = "default:lava_flowing",
liquid_alternative_source = "default:lava_source",
minetest.register_node("default:torch", {
description = "Torch",
drawtype = "torchlike",
- tiles = {"default_torch_on_floor.png", "default_torch_on_ceiling.png", "default_torch.png"},
+ --tiles = {"default_torch_on_floor.png", "default_torch_on_ceiling.png", "default_torch.png"},
+ tiles = {
+ {name="default_torch_on_floor_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
+ {name="default_torch_on_ceiling_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
+ {name="default_torch_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}}
+ },
inventory_image = "default_torch_on_floor.png",
wield_image = "default_torch_on_floor.png",
paramtype = "light",
wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1},
wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1},
},
- groups = {choppy=2,dig_immediate=3,flammable=1},
+ groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1},
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
})
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
- metadata_name = "sign",
selection_box = {
type = "wallmounted",
--wall_top = <default>
--wall_bottom = <default>
--wall_side = <default>
},
- groups = {choppy=2,dig_immediate=2},
+ groups = {choppy=2,dig_immediate=2,attached_node=1},
legacy_wallmounted = true,
sounds = default.node_sound_defaults(),
on_construct = function(pos)
--local n = minetest.env:get_node(pos)
local meta = minetest.env:get_meta(pos)
- meta:set_string("formspec", "hack:sign_text_input")
+ meta:set_string("formspec", "field[text;;${text}]")
meta:set_string("infotext", "\"\"")
end,
on_receive_fields = function(pos, formname, fields, sender)
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
meta:set_string("formspec",
- "invsize[8,9;]"..
+ "size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Chest")
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
- on_metadata_inventory_move = function(pos, from_list, from_index,
- to_list, to_index, count, player)
+ 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))
- return minetest.node_metadata_inventory_move_allow_all(
- pos, from_list, from_index, to_list, to_index, count, player)
end,
- on_metadata_inventory_offer = function(pos, listname, index, stack, player)
+ 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))
- return minetest.node_metadata_inventory_offer_allow_all(
- pos, listname, index, stack, player)
end,
- on_metadata_inventory_take = function(pos, listname, index, count, player)
+ 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))
- return minetest.node_metadata_inventory_take_allow_all(
- pos, listname, index, count, player)
end,
})
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
- meta:set_string("formspec",
- "invsize[8,9;]"..
- "list[current_name;main;0,0;8,4;]"..
- "list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Locked Chest")
meta:set_string("owner", "")
local inv = meta:get_inventory()
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
- on_metadata_inventory_move = function(pos, from_list, from_index,
- to_list, to_index, count, player)
+ allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.env:get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
- return
+ return 0
end
- minetest.log("action", player:get_player_name()..
- " moves stuff in locked chest at "..minetest.pos_to_string(pos))
- return minetest.node_metadata_inventory_move_allow_all(
- pos, from_list, from_index, to_list, to_index, count, player)
+ return count
end,
- on_metadata_inventory_offer = function(pos, listname, index, stack, player)
+ allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.env:get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
- return stack
+ return 0
end
- minetest.log("action", player:get_player_name()..
- " moves stuff to locked chest at "..minetest.pos_to_string(pos))
- return minetest.node_metadata_inventory_offer_allow_all(
- pos, listname, index, stack, player)
+ return stack:get_count()
end,
- on_metadata_inventory_take = function(pos, listname, index, count, player)
+ allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.env:get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
" tried to access a locked chest belonging to "..
meta:get_string("owner").." at "..
minetest.pos_to_string(pos))
- return
+ return 0
end
+ return stack:get_count()
+ 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 locked 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 locked 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 locked chest at "..minetest.pos_to_string(pos))
- return minetest.node_metadata_inventory_take_allow_all(
- pos, listname, index, count, player)
+ end,
+ on_rightclick = function(pos, node, clicker)
+ local meta = minetest.env:get_meta(pos)
+ if has_locked_chest_privilege(meta, clicker) then
+ local pos = pos.x .. "," .. pos.y .. "," ..pos.z
+ minetest.show_formspec(clicker:get_player_name(), "default:chest_locked",
+ "size[8,9]"..
+ "list[nodemeta:".. pos .. ";main;0,0;8,4;]"..
+ "list[current_player;main;0,5;8,4;]")
+ end
end,
})
default.furnace_inactive_formspec =
- "invsize[8,9;]"..
+ "size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
"list[current_name;src;2,1;1,1;]"..
paramtype2 = "facedir",
light_source = 8,
drop = "default:furnace",
- groups = {cracky=2},
+ groups = {cracky=2, not_in_creative_inventory=1},
legacy_facedir_simple = true,
sounds = default.node_sound_stone_defaults(),
on_construct = function(pos)
srcstack:take_item()
inv:set_stack("src", 1, srcstack)
else
- print("Could not insert '"..cooked.item.."'")
+ print("Could not insert '"..cooked.item:to_string().."'")
end
meta:set_string("src_time", 0)
end
meta:set_string("infotext","Furnace active: "..percent.."%")
hacky_swap_node(pos,"default:furnace_active")
meta:set_string("formspec",
- "invsize[8,9;]"..
+ "size[8,9]"..
"image[2,2;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-percent)..":default_furnace_fire_fg.png]"..
"list[current_name;fuel;2,3;1,1;]"..
description = "Cobblestone",
tiles = {"default_cobble.png"},
is_ground_content = true,
- groups = {cracky=3},
+ groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
})
sounds = default.node_sound_stone_defaults(),
})
+minetest.register_node("default:mese", {
+ description = "Mese Block",
+ tiles = {"default_mese_block.png"},
+ is_ground_content = true,
+ groups = {cracky=1},
+ sounds = default.node_sound_stone_defaults(),
+})
+minetest.register_alias("default:mese_block", "default:mese")
+
minetest.register_node("default:nyancat", {
description = "Nyan Cat",
tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png",
"default_nc_side.png", "default_nc_back.png", "default_nc_front.png"},
- inventory_image = "default_nc_front.png",
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
minetest.register_node("default:nyancat_rainbow", {
description = "Nyan Cat Rainbow",
tiles = {"default_nc_rb.png"},
- inventory_image = "default_nc_rb.png",
groups = {cracky=2},
sounds = default.node_sound_defaults(),
})
wield_image = "default_sapling.png",
paramtype = "light",
walkable = false,
- groups = {snappy=2,dig_immediate=3,flammable=2},
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
+ },
+ groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1},
sounds = default.node_sound_defaults(),
})
paramtype = "light",
sunlight_propagates = true,
walkable = false,
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
+ },
groups = {fleshy=3,dig_immediate=3,flammable=2},
on_use = minetest.item_eat(4),
sounds = default.node_sound_defaults(),
wield_image = "default_dry_shrub.png",
paramtype = "light",
walkable = false,
- groups = {snappy=3,flammable=3},
+ groups = {snappy=3,flammable=3,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
inventory_image = "default_iron_lump.png",
})
+minetest.register_craftitem("default:mese_crystal", {
+ description = "Mese Crystal",
+ inventory_image = "default_mese_crystal.png",
+})
+
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
inventory_image = "default_clay_lump.png",
inventory_image = "default_steel_ingot.png",
})
+minetest.register_craftitem("default:mese_crystal_fragment", {
+ description = "Mese Crystal Fragment",
+ inventory_image = "default_mese_crystal_fragment.png",
+})
+
minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
- inventory_image = "default_steel_ingot.png",
inventory_image = "default_clay_brick.png",
})
inventory_image = "default_scorched_stuff.png",
})
---
--- Creative inventory
---
-
-minetest.add_to_creative_inventory('default:pick_mese')
-minetest.add_to_creative_inventory('default:pick_steel')
-minetest.add_to_creative_inventory('default:axe_steel')
-minetest.add_to_creative_inventory('default:shovel_steel')
-
-minetest.add_to_creative_inventory('default:torch')
-minetest.add_to_creative_inventory('default:cobble')
-minetest.add_to_creative_inventory('default:dirt')
-minetest.add_to_creative_inventory('default:stone')
-minetest.add_to_creative_inventory('default:sand')
-minetest.add_to_creative_inventory('default:sandstone')
-minetest.add_to_creative_inventory('default:clay')
-minetest.add_to_creative_inventory('default:brick')
-minetest.add_to_creative_inventory('default:tree')
-minetest.add_to_creative_inventory('default:wood')
-minetest.add_to_creative_inventory('default:leaves')
-minetest.add_to_creative_inventory('default:cactus')
-minetest.add_to_creative_inventory('default:papyrus')
-minetest.add_to_creative_inventory('default:bookshelf')
-minetest.add_to_creative_inventory('default:glass')
-minetest.add_to_creative_inventory('default:fence_wood')
-minetest.add_to_creative_inventory('default:rail')
-minetest.add_to_creative_inventory('default:mese')
-minetest.add_to_creative_inventory('default:chest')
-minetest.add_to_creative_inventory('default:furnace')
-minetest.add_to_creative_inventory('default:sign_wall')
-minetest.add_to_creative_inventory('default:water_source')
-minetest.add_to_creative_inventory('default:lava_source')
-minetest.add_to_creative_inventory('default:ladder')
-
---
--- Falling stuff
---
-
-minetest.register_entity("default:falling_node", {
- initial_properties = {
- physical = true,
- collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
- visual = "wielditem",
- textures = {},
- visual_size = {x=0.667, y=0.667},
- },
-
- nodename = "",
-
- set_node = function(self, nodename)
- self.nodename = nodename
- local stack = ItemStack(nodename)
- local itemtable = stack:to_table()
- local itemname = nil
- if itemtable then
- itemname = stack:to_table().name
- end
- local item_texture = nil
- local item_type = ""
- if minetest.registered_items[itemname] then
- item_texture = minetest.registered_items[itemname].inventory_image
- item_type = minetest.registered_items[itemname].type
- end
- prop = {
- is_visible = true,
- textures = {nodename},
- }
- self.object:set_properties(prop)
- end,
-
- get_staticdata = function(self)
- return self.nodename
- end,
-
- on_activate = function(self, staticdata)
- self.nodename = staticdata
- self.object:set_armor_groups({immortal=1})
- --self.object:setacceleration({x=0, y=-10, z=0})
- self:set_node(self.nodename)
- end,
-
- on_step = function(self, dtime)
- -- Set gravity
- self.object:setacceleration({x=0, y=-10, z=0})
- -- Turn to actual sand when collides to ground or just move
- local pos = self.object:getpos()
- local bcp = {x=pos.x, y=pos.y-0.7, z=pos.z} -- Position of bottom center point
- local bcn = minetest.env:get_node(bcp)
- -- Note: walkable is in the node definition, not in item groups
- if minetest.registered_nodes[bcn.name] and
- minetest.registered_nodes[bcn.name].walkable then
- local np = {x=bcp.x, y=bcp.y+1, z=bcp.z}
- -- Check what's here
- local n2 = minetest.env:get_node(np)
- -- If it's not air or liquid, remove node and replace it with
- -- it's drops
- if n2.name ~= "air" and (not minetest.registered_nodes[n2.name] or
- minetest.registered_nodes[n2.name].liquidtype == "none") then
- local drops = minetest.get_node_drops(n2.name, "")
- minetest.env:remove_node(np)
- -- Add dropped items
- local _, dropped_item
- for _, dropped_item in ipairs(drops) do
- minetest.env:add_item(np, dropped_item)
- end
- -- Run script hook
- local _, callback
- for _, callback in ipairs(minetest.registered_on_dignodes) do
- callback(np, n2, nil)
- end
- end
- -- Create node and remove entity
- minetest.env:add_node(np, {name=self.nodename})
- self.object:remove()
- else
- -- Do nothing
- end
- end
-})
-
+-- Support old code
function default.spawn_falling_node(p, nodename)
- obj = minetest.env:add_entity(p, "default:falling_node")
- obj:get_luaentity():set_node(nodename)
+ spawn_falling_node(p, nodename)
end
-- Horrible crap to support old code
end
end
---
--- Some common functions
---
-
-function nodeupdate_single(p)
- n = minetest.env:get_node(p)
- if minetest.get_node_group(n.name, "falling_node") ~= 0 then
- p_bottom = {x=p.x, y=p.y-1, z=p.z}
- n_bottom = minetest.env:get_node(p_bottom)
- -- Note: walkable is in the node definition, not in item groups
- if minetest.registered_nodes[n_bottom.name] and
- not minetest.registered_nodes[n_bottom.name].walkable then
- minetest.env:remove_node(p)
- default.spawn_falling_node(p, n.name)
- nodeupdate(p)
- end
- end
-end
-
-function nodeupdate(p)
- for x = -1,1 do
- for y = -1,1 do
- for z = -1,1 do
- p2 = {x=p.x+x, y=p.y+y, z=p.z+z}
- nodeupdate_single(p2)
- end
- end
- end
-end
-
--
-- Global callbacks
--
function on_placenode(p, node)
--print("on_placenode")
- nodeupdate(p)
end
minetest.register_on_placenode(on_placenode)
function on_dignode(p, node)
--print("on_dignode")
- nodeupdate(p)
end
minetest.register_on_dignode(on_dignode)
end
minetest.register_on_punchnode(on_punchnode)
-local function handle_give_command(cmd, giver, receiver, stackstring)
- if not minetest.get_player_privs(giver)["give"] then
- minetest.chat_send_player(giver, "error: you don't have permission to give")
- return
- end
- minetest.debug("DEBUG: "..cmd..' invoked, stackstring="'..stackstring..'"')
- minetest.log(cmd..' invoked, stackstring="'..stackstring..'"')
- local itemstack = ItemStack(stackstring)
- if itemstack:is_empty() then
- minetest.chat_send_player(giver, 'error: cannot give an empty item')
- return
- elseif not itemstack:is_known() then
- minetest.chat_send_player(giver, 'error: cannot give an unknown item')
- return
- end
- local receiverref = minetest.env:get_player_by_name(receiver)
- if receiverref == nil then
- minetest.chat_send_player(giver, receiver..' is not a known player')
- return
- end
- local leftover = receiverref:get_inventory():add_item("main", itemstack)
- if leftover:is_empty() then
- partiality = ""
- elseif leftover:get_count() == itemstack:get_count() then
- partiality = "could not be "
- else
- partiality = "partially "
- end
- -- The actual item stack string may be different from what the "giver"
- -- entered (e.g. big numbers are always interpreted as 2^16-1).
- stackstring = itemstack:to_string()
- if giver == receiver then
- minetest.chat_send_player(giver, '"'..stackstring
- ..'" '..partiality..'added to inventory.');
- else
- minetest.chat_send_player(giver, '"'..stackstring
- ..'" '..partiality..'added to '..receiver..'\'s inventory.');
- minetest.chat_send_player(receiver, '"'..stackstring
- ..'" '..partiality..'added to inventory.');
- end
+--
+-- Lavacooling
+--
+
+default.cool_lava_source = function(pos)
+ minetest.env:set_node(pos, {name="default:stone"})
end
-minetest.register_on_chat_message(function(name, message)
- --print("default on_chat_message: name="..dump(name).." message="..dump(message))
- local cmd = "/giveme"
- if message:sub(0, #cmd) == cmd then
- local stackstring = string.match(message, cmd.." (.*)")
- if stackstring == nil then
- minetest.chat_send_player(name, 'usage: '..cmd..' stackstring')
- return true -- Handled chat message
- end
- handle_give_command(cmd, name, name, stackstring)
- return true
- end
- local cmd = "/give"
- if message:sub(0, #cmd) == cmd then
- local receiver, stackstring = string.match(message, cmd.." ([%a%d_-]+) (.*)")
- if receiver == nil or stackstring == nil then
- minetest.chat_send_player(name, 'usage: '..cmd..' name stackstring')
- return true -- Handled chat message
- end
- handle_give_command(cmd, name, receiver, stackstring)
- return true
- end
- local cmd = "/spawnentity"
- if message:sub(0, #cmd) == cmd then
- if not minetest.get_player_privs(name)["give"] then
- minetest.chat_send_player(name, "you don't have permission to spawn (give)")
- return true -- Handled chat message
- end
- if not minetest.get_player_privs(name)["interact"] then
- minetest.chat_send_player(name, "you don't have permission to interact")
- return true -- Handled chat message
- end
- local entityname = string.match(message, cmd.." (.*)")
- if entityname == nil then
- minetest.chat_send_player(name, 'usage: '..cmd..' entityname')
- return true -- Handled chat message
- end
- print(cmd..' invoked, entityname="'..entityname..'"')
- local player = minetest.env:get_player_by_name(name)
- if player == nil then
- print("Unable to spawn entity, player is nil")
- return true -- Handled chat message
- end
- local p = player:getpos()
- p.y = p.y + 1
- minetest.env:add_entity(p, entityname)
- minetest.chat_send_player(name, '"'..entityname
- ..'" spawned.');
- return true -- Handled chat message
- end
- local cmd = "/pulverize"
- if message:sub(0, #cmd) == cmd then
- local player = minetest.env:get_player_by_name(name)
- if player == nil then
- print("Unable to pulverize, player is nil")
- return true -- Handled chat message
- end
- if player:get_wielded_item():is_empty() then
- minetest.chat_send_player(name, 'Unable to pulverize, no item in hand.')
- else
- player:set_wielded_item(nil)
- minetest.chat_send_player(name, 'An item was pulverized.')
- end
- return true
- end
-end)
+default.cool_lava_flowing = function(pos)
+ minetest.env:set_node(pos, {name="default:cobble"})
+end
+
+minetest.register_abm({
+ nodenames = {"default:lava_flowing"},
+ neighbors = {"group:water"},
+ interval = 1,
+ chance = 1,
+ action = default.cool_lava_flowing,
+})
+
+minetest.register_abm({
+ nodenames = {"default:lava_source"},
+ neighbors = {"group:water"},
+ interval = 1,
+ chance = 1,
+ action = default.cool_lava_source,
+})
-- END