Initial commit

master
PilzAdam 9 years ago
commit d113b0a166
  1. 6
      README.txt
  2. 1
      game.conf
  3. 8
      mods/crafting/README.txt
  4. 193
      mods/crafting/init.lua
  5. BIN
      mods/crafting/textures/workbench_side.png
  6. BIN
      mods/crafting/textures/workbench_top.png
  7. 147
      mods/default/README.txt
  8. 743
      mods/default/crafting.lua
  9. 91
      mods/default/craftitems.lua
  10. 1
      mods/default/depends.txt
  11. 305
      mods/default/functions.lua
  12. 21
      mods/default/init.lua
  13. 537
      mods/default/mapgen.lua
  14. BIN
      mods/default/models/character.blend
  15. BIN
      mods/default/models/character.png
  16. 6557
      mods/default/models/character.x
  17. 1298
      mods/default/nodes.lua
  18. 132
      mods/default/player.lua
  19. BIN
      mods/default/sounds/default_break_glass.1.ogg
  20. BIN
      mods/default/sounds/default_break_glass.2.ogg
  21. BIN
      mods/default/sounds/default_break_glass.3.ogg
  22. BIN
      mods/default/sounds/default_dig_choppy.ogg
  23. BIN
      mods/default/sounds/default_dig_cracky.ogg
  24. BIN
      mods/default/sounds/default_dig_crumbly.1.ogg
  25. BIN
      mods/default/sounds/default_dig_crumbly.2.ogg
  26. BIN
      mods/default/sounds/default_dig_dig_immediate.ogg
  27. BIN
      mods/default/sounds/default_dig_oddly_breakable_by_hand.ogg
  28. BIN
      mods/default/sounds/default_dug_node.1.ogg
  29. BIN
      mods/default/sounds/default_grass_footstep.1.ogg
  30. BIN
      mods/default/sounds/default_grass_footstep.2.ogg
  31. BIN
      mods/default/sounds/default_grass_footstep.3.ogg
  32. BIN
      mods/default/sounds/default_gravel_footstep.1.ogg
  33. BIN
      mods/default/sounds/default_gravel_footstep.2.ogg
  34. BIN
      mods/default/sounds/default_gravel_footstep.3.ogg
  35. BIN
      mods/default/sounds/default_gravel_footstep.4.ogg
  36. BIN
      mods/default/sounds/default_hard_footstep.1.ogg
  37. BIN
      mods/default/sounds/default_hard_footstep.2.ogg
  38. BIN
      mods/default/sounds/default_place_node.1.ogg
  39. BIN
      mods/default/sounds/default_place_node.2.ogg
  40. BIN
      mods/default/sounds/default_place_node.3.ogg
  41. BIN
      mods/default/textures/crack_anylength.png
  42. BIN
      mods/default/textures/default_apple.png
  43. BIN
      mods/default/textures/default_book.png
  44. BIN
      mods/default/textures/default_bookshelf.png
  45. BIN
      mods/default/textures/default_brick.png
  46. BIN
      mods/default/textures/default_bronze_block.png
  47. BIN
      mods/default/textures/default_bronze_ingot.png
  48. BIN
      mods/default/textures/default_cactus_side.png
  49. BIN
      mods/default/textures/default_cactus_top.png
  50. BIN
      mods/default/textures/default_chest_front.png
  51. BIN
      mods/default/textures/default_chest_lock.png
  52. BIN
      mods/default/textures/default_chest_side.png
  53. BIN
      mods/default/textures/default_chest_top.png
  54. BIN
      mods/default/textures/default_clay.png
  55. BIN
      mods/default/textures/default_clay_brick.png
  56. BIN
      mods/default/textures/default_clay_lump.png
  57. BIN
      mods/default/textures/default_cloud.png
  58. BIN
      mods/default/textures/default_coal_block.png
  59. BIN
      mods/default/textures/default_coal_lump.png
  60. BIN
      mods/default/textures/default_cobble.png
  61. BIN
      mods/default/textures/default_copper_block.png
  62. BIN
      mods/default/textures/default_copper_ingot.png
  63. BIN
      mods/default/textures/default_copper_lump.png
  64. BIN
      mods/default/textures/default_desert_sand.png
  65. BIN
      mods/default/textures/default_desert_stone.png
  66. BIN
      mods/default/textures/default_desert_stone_brick.png
  67. BIN
      mods/default/textures/default_diamond.png
  68. BIN
      mods/default/textures/default_diamond_block.png
  69. BIN
      mods/default/textures/default_dirt.png
  70. BIN
      mods/default/textures/default_dry_shrub.png
  71. BIN
      mods/default/textures/default_fence.png
  72. BIN
      mods/default/textures/default_furnace_bottom.png
  73. BIN
      mods/default/textures/default_furnace_fire_bg.png
  74. BIN
      mods/default/textures/default_furnace_fire_fg.png
  75. BIN
      mods/default/textures/default_furnace_front.png
  76. BIN
      mods/default/textures/default_furnace_front_active.png
  77. BIN
      mods/default/textures/default_furnace_side.png
  78. BIN
      mods/default/textures/default_furnace_top.png
  79. BIN
      mods/default/textures/default_glass.png
  80. BIN
      mods/default/textures/default_gold_block.png
  81. BIN
      mods/default/textures/default_gold_ingot.png
  82. BIN
      mods/default/textures/default_gold_lump.png
  83. BIN
      mods/default/textures/default_grass.png
  84. BIN
      mods/default/textures/default_grass_1.png
  85. BIN
      mods/default/textures/default_grass_2.png
  86. BIN
      mods/default/textures/default_grass_3.png
  87. BIN
      mods/default/textures/default_grass_4.png
  88. BIN
      mods/default/textures/default_grass_5.png
  89. BIN
      mods/default/textures/default_grass_footsteps.png
  90. BIN
      mods/default/textures/default_grass_side.png
  91. BIN
      mods/default/textures/default_gravel.png
  92. BIN
      mods/default/textures/default_ice.png
  93. BIN
      mods/default/textures/default_iron_lump.png
  94. BIN
      mods/default/textures/default_junglegrass.png
  95. BIN
      mods/default/textures/default_jungleleaves.png
  96. BIN
      mods/default/textures/default_junglesapling.png
  97. BIN
      mods/default/textures/default_jungletree.png
  98. BIN
      mods/default/textures/default_jungletree_top.png
  99. BIN
      mods/default/textures/default_junglewood.png
  100. BIN
      mods/default/textures/default_ladder.png
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,6 @@
Economy game for the Minetest engine
====================================
License
-------
See README.txt of each mod for License information.

@ -0,0 +1 @@
name = economy

@ -0,0 +1,8 @@
Crafting mod
=============
License
-------
Copyright (C) 2013 PilzAdam WTFPL
Textures: Created by darkrose, WTFPL

@ -0,0 +1,193 @@
playerlevels = {
-- example_user = {stone=1, tool=2},
singleplayer = {wood=1},
}
local crafting = {
normal = {},
cooking = {},
fuel = {},
}
local old_register_craft = minetest.register_craft
local old_get_craft_result = minetest.get_craft_result
minetest.register_craft = function(def)
if def.type == nil or def.type == "shapeless" then
old_register_craft(def)
crafting.normal[ItemStack(def.output):get_name()] = {
level = def.level or {},
}
elseif def.type == "cooking" then
crafting.cooking[def.recipe] = {
time = def.burntime or 1,
output = def.output,
}
elseif def.type == "fuel" then
crafting.fuel[def.recipe] = {
time = def.burntime,
replacement = def.replacement,
}
end
end
minetest.get_craft_result = function(input)
if input.method == "normal" then
local result, test = old_get_craft_result(input)
local def = crafting.normal[result.item:get_name()]
if not def then
return result
end
print(dump(input.level))
print(dump(def.level))
for name,rating in pairs(def.level) do
if not input.level[name] or input.level[name] < rating then
return
end
end
return result
elseif input.method == "cooking" then
local ret = {time=-1, item=ItemStack("")}
local ret2 = {items={}}
local def = crafting.cooking[input.items[1]:get_name()]
if not def then
return ret, ret2
end
ret.time = def.time
ret.item = ItemStack(def.output)
ret2.items[1] = input.items[1]:peek_item(input.items[1]:get_count()-1)
if def.replacement then
for _,rep in ipairs(def.replacement) do
if rep[1] == input.items[1]:get_name() then
ret2.items[1] = rep[2]
end
end
end
return ret, ret2
elseif input.method == "fuel" then
local ret = {time=-1}
local ret2 = {items={}}
for i,stack in ipairs(input.items) do
local def = crafting.fuel[stack:get_name()]
if def then
ret.time = ret.time + def.time
ret2.items[i] = stack:peek_item(stack:get_count()-1)
if def.replacement then
for _,rep in ipairs(def.replacement) do
if rep[1] == stack:get_name() then
ret2.items[i] = rep[2]
end
end
end
end
end
return ret, ret2
end
end
minetest.get_craft_recipe = nil
minetest.get_all_craft_recipes = nil
local function update_workbench(pos, playername)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
local result = minetest.get_craft_result({
method = "normal",
width = 3,
items = inv:get_list("craft"),
level = playerlevels[playername],
})
if not result then
return
end
inv:set_stack("result", 1, result.item)
end
minetest.register_node("crafting:workbench", {
description = "Workbench",
tiles = {"workbench_top.png", "workbench_side.png"},
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3},
sounds = {
dug = {
name = "default_dug_node",
gain = 1,
},
footstep = {
name = "default_hard_footstep",
gain = 0.3,
},
place = {
name = "default_place_node",
gain = 0.5,
},
},
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
inv:set_size("craft", 9)
inv:set_size("result", 1)
meta:set_string("formspec",
"size[8,7.5;]"..
"list[current_player;main;0,3.5;8,4;]"..
"list[current_name;craft;3,0;3,3;]"..
"list[current_name;result;6.5,1;1,1;]"
)
end,
allow_metadata_inventory_move = function(pos, from_list, from_index,to_list, to_index, count, player)
if to_list == "result" then
print("Nope")
return 0
end
return count
end,
allow_metadata_inventory_put = function(pos, listname, index, stack, player)
if listname == "result" then
print("Nope")
return 0
end
return stack:get_count()
end,
allow_metadata_inventory_take = function(pos, listname, index, stack, player)
return stack:get_count()
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
update_workbench(pos, player:get_player_name())
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local inv = minetest.env:get_meta(pos):get_inventory()
if from_list == "result" then
for i,stack in ipairs(inv:get_list("craft")) do
stack:take_item()
inv:set_stack("craft", i, stack)
end
end
update_workbench(pos, player:get_player_name())
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
local inv = minetest.env:get_meta(pos):get_inventory()
if listname == "result" then
for i,stack in ipairs(inv:get_list("craft")) do
stack:take_item()
inv:set_stack("craft", i, stack)
end
end
update_workbench(pos, player:get_player_name())
end,
can_dig = function(pos)
local inv = minetest.env:get_meta(pos):get_inventory()
return inv:is_empty("craft") and inv:is_empty("result")
end,
})
minetest.register_on_joinplayer(function(player)
player:set_inventory_formspec(
"size[8,5;]"..
"list[current_player;main;0,0.5;8,4;]"
)
if not playerlevels[player:get_player_name()] then
playerlevels[player:get_player_name()] = {}
end
end)

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 823 B

@ -0,0 +1,147 @@
Minetest 0.4 mod: default
==========================
License of source code:
-----------------------
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
-----------------------
Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
Originating from work by kddekadenz/Dogers:
default_grass_footstep.{1,2,3}.ogg
default_dig_crumbly.{1,2}.ogg
Cisoun's WTFPL texture pack:
default_chest_front.png
default_chest_lock.png
default_chest_side.png
default_chest_top.png
default_stone_brick.png
default_dirt.png
default_grass.png
default_grass_side.png
default_jungletree.png
default_jungletree_top.png
default_lava.png
default_leaves.png
default_sapling.png
default_sign_wall.png
default_stone.png
default_tool_mesepick.png
default_tool_steelpick.png
default_tool_steelshovel.png
default_tool_stonepick.png
default_tool_stoneshovel.png
default_tool_woodpick.png
default_tool_woodshovel.png
default_tree.png
default_tree_top.png
default_water.png
Originating from G4JC's Almost MC Texture Pack:
default_wood.png
default_torch.png
default_torch_on_ceiling.png
default_torch_on_floor.png
default_cobble.png
VanessaE's animated torches (WTFPL):
default_torch_animated.png
default_torch_on_ceiling_animated.png
default_torch_on_floor_animated.png
default_torch_on_floor.png
RealBadAngel's animated water (WTFPL):
default_water_source_animated.png
default_water_flowing_animated.png
VanessaE (WTFPL):
default_nc_back.png
default_nc_front.png
default_nc_rb.png
default_nc_side.png
default_grass_*.png
default_desert_sand.png
default_desert_stone.png
default_desert_stone_brick.png
default_sand.png
default_sandstone_brick.png
Calinou (CC BY-SA):
default_brick.png
default_clay_brick.png
default_papyrus.png
default_tool_steelsword.png
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
default_mineral_copper.png
MirceaKitsune (WTFPL):
character.x
Jordach (CC BY-SA 3.0):
character.png
PilzAdam (WTFPL):
default_jungleleaves.png
default_junglesapling.png
default_junglewood.png
default_obsidian_glass.png
default_obsidian_shard.png
default_mossycobble.png
default_gold_ingot.png
default_gold_lump.png
default_mineral_gold.png
default_diamond.png
default_tool_diamondpick.png
default_tool_diamondsword.png
default_tool_diamondshovel.png
default_tool_diamondaxe.png
default_tool_meseaxe.png
default_tool_meseshovel.png
default_tool_mesesword.png
default_tool_bronzeaxe.png
default_tool_bronzepick.png
default_tool_bronzeshovel.png
default_tool_bronzesword.png
default_snowball.png
jojoa1997 (WTFPL):
default_obsidian.png
InfinityProject (WTFPL):
default_mineral_diamond.png
Splizard (CC BY-SA 3.0):
default_snow.png
default_snow_side.png
default_ice.png
Zeg9 (CC BY-SA 3.0):
default_coal_block.png
default_steel_block.png
default_copper_block.png
default_bronze_block.png
default_gold_block.png
default_diamond_block.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
2: http://www.freesound.org/people/Tomlija/sounds/97669/
3: http://www.freesound.org/people/lsprice/sounds/88808/

@ -0,0 +1,743 @@
-- mods/default/crafting.lua
minetest.register_craft({
output = 'default:wood 4',
recipe = {
{'default:tree'},
}
})
minetest.register_craft({
output = 'default:junglewood 4',
recipe = {
{'default:jungletree'},
}
})
minetest.register_craft({
output = 'default:stick 4',
recipe = {
{'group:wood'},
},
level = {wood=1},
})
minetest.register_craft({
output = 'default:fence_wood 2',
recipe = {
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:sign_wall',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:torch 4',
recipe = {
{'default:coal_lump'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:pick_wood',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_stone',
recipe = {
{'group:stone', 'group:stone', 'group:stone'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_steel',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_bronze',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:pick_diamond',
recipe = {
{'default:diamond', 'default:diamond', 'default:diamond'},
{'', 'default:stick', ''},
{'', 'default:stick', ''},
}
})
minetest.register_craft({
output = 'default:shovel_wood',
recipe = {
{'group:wood'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_stone',
recipe = {
{'group:stone'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_steel',
recipe = {
{'default:steel_ingot'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_bronze',
recipe = {
{'default:bronze_ingot'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_mese',
recipe = {
{'default:mese_crystal'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:shovel_diamond',
recipe = {
{'default:diamond'},
{'default:stick'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_wood',
recipe = {
{'group:wood', 'group:wood'},
{'group:wood', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_stone',
recipe = {
{'group:stone', 'group:stone'},
{'group:stone', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_steel',
recipe = {
{'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_bronze',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal'},
{'default:mese_crystal', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:axe_diamond',
recipe = {
{'default:diamond', 'default:diamond'},
{'default:diamond', 'default:stick'},
{'', 'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_wood',
recipe = {
{'group:wood'},
{'group:wood'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_stone',
recipe = {
{'group:stone'},
{'group:stone'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_steel',
recipe = {
{'default:steel_ingot'},
{'default:steel_ingot'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_bronze',
recipe = {
{'default:bronze_ingot'},
{'default:bronze_ingot'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_mese',
recipe = {
{'default:mese_crystal'},
{'default:mese_crystal'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:sword_diamond',
recipe = {
{'default:diamond'},
{'default:diamond'},
{'default:stick'},
}
})
minetest.register_craft({
output = 'default:rail 15',
recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'},
{'default:steel_ingot', 'default:stick', 'default:steel_ingot'},
{'default:steel_ingot', '', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'default:chest',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'group:wood', '', 'group:wood'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:chest_locked',
recipe = {
{'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 = {
{'group:stone', 'group:stone', 'group:stone'},
{'group:stone', '', 'group:stone'},
{'group:stone', 'group:stone', 'group:stone'},
}
})
minetest.register_craft({
type = "shapeless",
output = "default:bronze_ingot",
recipe = {"default:steel_ingot", "default:copper_ingot"},
})
minetest.register_craft({
output = 'default:coalblock',
recipe = {
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
{'default:coal_lump', 'default:coal_lump', 'default:coal_lump'},
}
})
minetest.register_craft({
output = 'default:coal_lump 9',
recipe = {
{'default:coalblock'},
}
})
minetest.register_craft({
output = 'default:steelblock',
recipe = {
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
}
})
minetest.register_craft({
output = 'default:steel_ingot 9',
recipe = {
{'default:steelblock'},
}
})
minetest.register_craft({
output = 'default:copperblock',
recipe = {
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
{'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'},
}
})
minetest.register_craft({
output = 'default:copper_ingot 9',
recipe = {
{'default:copperblock'},
}
})
minetest.register_craft({
output = 'default:bronzeblock',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
}
})
minetest.register_craft({
output = 'default:bronze_ingot 9',
recipe = {
{'default:bronzeblock'},
}
})
minetest.register_craft({
output = 'default:goldblock',
recipe = {
{'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
{'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
{'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'},
}
})
minetest.register_craft({
output = 'default:gold_ingot 9',
recipe = {
{'default:goldblock'},
}
})
minetest.register_craft({
output = 'default:diamondblock',
recipe = {
{'default:diamond', 'default:diamond', 'default:diamond'},
{'default:diamond', 'default:diamond', 'default:diamond'},
{'default:diamond', 'default:diamond', 'default:diamond'},
}
})
minetest.register_craft({
output = 'default:diamond 9',
recipe = {
{'default:diamondblock'},
}
})
minetest.register_craft({
output = 'default:sandstone',
recipe = {
{'group:sand', 'group:sand'},
{'group:sand', 'group:sand'},
}
})
minetest.register_craft({
output = 'default:sand 4',
recipe = {
{'default:sandstone'},
}
})
minetest.register_craft({
output = 'default:sandstonebrick',
recipe = {
{'default:sandstone', 'default:sandstone'},
{'default:sandstone', 'default:sandstone'},
}
})
minetest.register_craft({
output = 'default:clay',
recipe = {
{'default:clay_lump', 'default:clay_lump'},
{'default:clay_lump', 'default:clay_lump'},
}
})
minetest.register_craft({
output = 'default:brick',
recipe = {
{'default:clay_brick', 'default:clay_brick'},
{'default:clay_brick', 'default:clay_brick'},
}
})
minetest.register_craft({
output = 'default:clay_brick 4',
recipe = {
{'default:brick'},
}
})
minetest.register_craft({
output = 'default:paper',
recipe = {
{'default:papyrus', 'default:papyrus', 'default:papyrus'},
}
})
minetest.register_craft({
output = 'default:book',
recipe = {
{'default:paper'},
{'default:paper'},
{'default:paper'},
}
})
minetest.register_craft({
output = 'default:bookshelf',
recipe = {
{'group:wood', 'group:wood', 'group:wood'},
{'default:book', 'default:book', 'default:book'},
{'group:wood', 'group:wood', 'group:wood'},
}
})
minetest.register_craft({
output = 'default:ladder',
recipe = {
{'default:stick', '', 'default:stick'},
{'default:stick', 'default:stick', 'default:stick'},
{'default:stick', '', 'default:stick'},
}
})
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'},
}
})
minetest.register_craft({
output = 'default:obsidian_shard 9',
recipe = {
{'default:obsidian'}
}
})
minetest.register_craft({
output = 'default:obsidian',
recipe = {
{'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
{'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
{'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'},
}
})
minetest.register_craft({
output = 'default:stonebrick',
recipe = {
{'default:stone', 'default:stone'},
{'default:stone', 'default:stone'},
}
})
minetest.register_craft({
output = 'default:desert_stonebrick',
recipe = {
{'default:desert_stone', 'default:desert_stone'},
{'default:desert_stone', 'default:desert_stone'},
}
})
minetest.register_craft({
output = 'default:snowblock',
recipe = {
{'default:snow', 'default:snow', 'default:snow'},
{'default:snow', 'default:snow', 'default:snow'},
{'default:snow', 'default:snow', 'default:snow'},
}
})
minetest.register_craft({
output = 'default:snow 9',
recipe = {
{'default:snowblock'},
}
})
--
-- Crafting (tool repair)
--
minetest.register_craft({
type = "toolrepair",
additional_wear = -0.02,
})
--
-- Cooking recipes
--
minetest.register_craft({
type = "cooking",
output = "default:glass",
recipe = "group:sand",
})
minetest.register_craft({
type = "cooking",
output = "default:obsidian_glass",
recipe = "default:obsidian_shard",
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "default:cobble",
})
minetest.register_craft({
type = "cooking",
output = "default:steel_ingot",
recipe = "default:iron_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:copper_ingot",
recipe = "default:copper_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:gold_ingot",
recipe = "default:gold_lump",
})
minetest.register_craft({
type = "cooking",
output = "default:clay_brick",
recipe = "default:clay_lump",
})
--
-- Fuels
--
minetest.register_craft({
type = "fuel",
recipe = "group:tree",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglegrass",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "group:leaves",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:cactus",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:papyrus",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:bookshelf",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:fence_wood",
burntime = 15,
})
minetest.register_craft({
type = "fuel",
recipe = "default:ladder",
burntime = 5,
})
minetest.register_craft({
type = "fuel",
recipe = "group:wood",
burntime = 7,
})
minetest.register_craft({
type = "fuel",
recipe = "default:lava_source",
burntime = 60,
})
minetest.register_craft({
type = "fuel",
recipe = "default:torch",
burntime = 4,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sign_wall",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:chest",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:chest_locked",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "default:nyancat",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:nyancat_rainbow",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "default:sapling",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:apple",
burntime = 3,
})
minetest.register_craft({
type = "fuel",
recipe = "default:coal_lump",
burntime = 40,
})
minetest.register_craft({
type = "fuel",
recipe = "default:coalblock",
burntime = 370,
})
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 10,
})
minetest.register_craft({
type = "fuel",
recipe = "default:grass_1",
burntime = 2,
})

@ -0,0 +1,91 @@
-- mods/default/craftitems.lua
minetest.register_craftitem("default:stick", {
description = "Stick",
inventory_image = "default_stick.png",
})
minetest.register_craftitem("default:paper", {
description = "Paper",
inventory_image = "default_paper.png",
})
minetest.register_craftitem("default:book", {
description = "Book",
inventory_image = "default_book.png",
})
minetest.register_craftitem("default:coal_lump", {
description = "Coal Lump",
inventory_image = "default_coal_lump.png",
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:copper_lump", {
description = "Copper Lump",
inventory_image = "default_copper_lump.png",
})
minetest.register_craftitem("default:mese_crystal", {
description = "Mese Crystal",
inventory_image = "default_mese_crystal.png",
})
minetest.register_craftitem("default:gold_lump", {
description = "Gold Lump",
inventory_image = "default_gold_lump.png",
})
minetest.register_craftitem("default:diamond", {
description = "Diamond",
inventory_image = "default_diamond.png",
})
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
inventory_image = "default_clay_lump.png",
})
minetest.register_craftitem("default:steel_ingot", {
description = "Steel Ingot",
inventory_image = "default_steel_ingot.png",
})
minetest.register_craftitem("default:copper_ingot", {
description = "Copper Ingot",
inventory_image = "default_copper_ingot.png",
})
minetest.register_craftitem("default:bronze_ingot", {
description = "Bronze Ingot",
inventory_image = "default_bronze_ingot.png",
})
minetest.register_craftitem("default:gold_ingot", {
description = "Gold Ingot",
inventory_image = "default_gold_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_clay_brick.png",
})
minetest.register_craftitem("default:scorched_stuff", {
description = "Scorched Stuff",
inventory_image = "default_scorched_stuff.png",
})
minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",
})

@ -0,0 +1,305 @@
-- mods/default/functions.lua
--
-- Sounds
--
function default.node_sound_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="", gain=1.0}
table.dug = table.dug or
{name="default_dug_node", gain=1.0}
table.place = table.place or
{name="default_place_node", gain=0.5}
return table
end
function default.node_sound_stone_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.2}
default.node_sound_defaults(table)
return table
end
function default.node_sound_dirt_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="", gain=0.5}
--table.dug = table.dug or
-- {name="default_dirt_break", gain=0.5}
default.node_sound_defaults(table)
return table
end
function default.node_sound_sand_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.25}
--table.dug = table.dug or
-- {name="default_dirt_break", gain=0.25}
table.dug = table.dug or
{name="", gain=0.25}
default.node_sound_defaults(table)
return table
end
function default.node_sound_wood_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.3}
default.node_sound_defaults(table)
return table
end
function default.node_sound_leaves_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.25}
table.dig = table.dig or
{name="default_dig_crumbly", gain=0.4}
table.dug = table.dug or
{name="", gain=1.0}
default.node_sound_defaults(table)
return table
end
function default.node_sound_glass_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_hard_footstep", gain=0.25}
table.dug = table.dug or
{name="default_break_glass", gain=1.0}
default.node_sound_defaults(table)
return table
end
--
-- Legacy
--
function default.spawn_falling_node(p, nodename)
spawn_falling_node(p, nodename)
end
-- Horrible crap to support old code
-- Don't use this and never do what this does, it's completely wrong!
-- (More specifically, the client and the C++ code doesn't get the group)
function default.register_falling_node(nodename, texture)
minetest.log("error", debug.traceback())
minetest.log('error', "WARNING: default.register_falling_node is deprecated")
if minetest.registered_nodes[nodename] then
minetest.registered_nodes[nodename].groups.falling_node = 1
end
end
--
-- Global callbacks
--
-- Global environment step function
function on_step(dtime)
-- print("on_step")
end
minetest.register_globalstep(on_step)
function on_placenode(p, node)
--print("on_placenode")
end
minetest.register_on_placenode(on_placenode)
function on_dignode(p, node)
--print("on_dignode")
end
minetest.register_on_dignode(on_dignode)
function on_punchnode(p, node)
end
minetest.register_on_punchnode(on_punchnode)
--
-- Lavacooling
--
default.cool_lava_source = function(pos)
minetest.set_node(pos, {name="default:obsidian"})
end
default.cool_lava_flowing = function(pos)
minetest.set_node(pos, {name="default:stone"})
end
minetest.register_abm({
nodenames = {"default:lava_flowing"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider)
end,
})
minetest.register_abm({
nodenames = {"default:lava_source"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider)
end,
})
--
-- Papyrus and cactus growing
--
minetest.register_abm({
nodenames = {"default:cactus"},
neighbors = {"group:sand"},
interval = 50,
chance = 20,
action = function(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if minetest.get_item_group(name, "sand") ~= 0 then
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "default:cactus" and height < 4 do
height = height+1
pos.y = pos.y+1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:cactus"})
end
end
end
end,
})
minetest.register_abm({
nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass"},
interval = 50,
chance = 20,
action = function(pos, node)
pos.y = pos.y-1
local name = minetest.get_node(pos).name
if name == "default:dirt" or name == "default:dirt_with_grass" then
if minetest.find_node_near(pos, 3, {"group:water"}) == nil then
return
end
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "default:papyrus" and height < 4 do
height = height+1
pos.y = pos.y+1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:papyrus"})
end
end
end
end,
})
--
-- Leafdecay
--
-- To enable leaf decay for a node, add it to the "leafdecay" group.
--
-- The rating of the group determines how far from a node in the group "tree"