Remove old 'default' mod
@ -1,226 +0,0 @@
|
||||
Minetest Game 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>
|
||||
|
||||
Cisoun's WTFPL texture pack:
|
||||
default_jungletree.png
|
||||
default_lava.png
|
||||
default_leaves.png
|
||||
default_sapling.png
|
||||
default_stone.png
|
||||
default_tree.png
|
||||
default_tree_top.png
|
||||
default_water.png
|
||||
|
||||
Cisoun's conifers mod (WTFPL):
|
||||
default_pine_needles.png
|
||||
|
||||
Originating from G4JC's Almost MC Texture Pack:
|
||||
default_torch.png
|
||||
default_torch_on_ceiling.png
|
||||
default_torch_on_floor.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_desert_sand.png
|
||||
default_desert_stone.png
|
||||
default_sand.png
|
||||
|
||||
Calinou (CC BY-SA):
|
||||
default_brick.png
|
||||
default_papyrus.png
|
||||
default_mineral_copper.png
|
||||
default_glass_detail.png
|
||||
|
||||
MirceaKitsune (WTFPL):
|
||||
character.x
|
||||
|
||||
Jordach (CC BY-SA 3.0):
|
||||
character.png
|
||||
|
||||
PilzAdam (WTFPL):
|
||||
default_jungleleaves.png
|
||||
default_junglesapling.png
|
||||
default_obsidian_glass.png
|
||||
default_obsidian_shard.png
|
||||
default_mineral_gold.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_pine_sapling.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
|
||||
|
||||
paramat (CC BY-SA 3.0):
|
||||
wieldhand.png -- Copied from character.png by Jordach (CC BY-SA 3.0)
|
||||
default_pinetree.png
|
||||
default_pinetree_top.png
|
||||
default_pinewood.png
|
||||
default_acacia_leaves.png
|
||||
default_acacia_sapling.png
|
||||
default_acacia_tree.png
|
||||
default_acacia_tree_top.png
|
||||
default_acacia_wood.png
|
||||
default_junglewood.png
|
||||
default_jungletree_top.png
|
||||
default_sandstone_brick.png
|
||||
default_obsidian_brick.png
|
||||
default_stone_brick.png
|
||||
default_desert_stone_brick.png
|
||||
default_river_water.png
|
||||
default_river_water_source_animated.png
|
||||
default_river_water_flowing_animated.png
|
||||
default_dry_grass.png
|
||||
default_dry_grass_side.png
|
||||
default_dry_grass_*.png
|
||||
default_grass.png
|
||||
default_grass_side.png
|
||||
default_snow_side.png
|
||||
|
||||
brunob.santos (CC BY-SA 4.0):
|
||||
default_desert_cobble.png
|
||||
|
||||
BlockMen (CC BY-SA 3.0):
|
||||
default_wood.png
|
||||
default_clay_brick.png
|
||||
default_iron_ingot.png
|
||||
default_gold_ingot.png
|
||||
default_tool_steelsword.png
|
||||
default_diamond.png
|
||||
default_book.png
|
||||
default_tool_*.png
|
||||
default_lava_source_animated.png
|
||||
default_lava_flowing_animated.png
|
||||
default_stick.png
|
||||
default_chest_front.png
|
||||
default_chest_lock.png
|
||||
default_chest_side.png
|
||||
default_chest_top.png
|
||||
default_mineral_mese.png
|
||||
default_meselamp.png
|
||||
bubble.png
|
||||
gui_*.png
|
||||
|
||||
sofar (CC BY-SA 3.0):
|
||||
default_book_written.png, based on default_book.png
|
||||
default_aspen_sapling
|
||||
default_aspen_leaves
|
||||
default_aspen_tree
|
||||
default_aspen_tree_top, derived from default_pine_tree_top (by paramat)
|
||||
default_aspen_wood, derived from default_pine_wood (by paramat)
|
||||
|
||||
sofar (WTFPL):
|
||||
default_gravel.png -- Derived from Gambit's PixelBOX texture pack light gravel
|
||||
|
||||
Neuromancer (CC BY-SA 2.0):
|
||||
default_cobble.png, based on texture by Brane praefect
|
||||
default_mossycobble.png, based on texture by Brane praefect
|
||||
Neuromancer (CC BY-SA 3.0):
|
||||
default_dirt.png
|
||||
default_furnace_*.png
|
||||
|
||||
Gambit (WTFPL):
|
||||
default_bronze_ingot.png
|
||||
default_copper_ingot.png
|
||||
default_copper_lump.png
|
||||
default_iron_lump.png
|
||||
default_gold_lump.png
|
||||
default_clay_lump.png
|
||||
default_coal.png
|
||||
default_grass_*.png
|
||||
default_paper.png
|
||||
default_diamond_block.png
|
||||
default_ladder_steel.png
|
||||
default_sign_wall_wood.png
|
||||
default_flint.png
|
||||
|
||||
asl97 (WTFPL):
|
||||
default_ice.png
|
||||
|
||||
KevDoy (CC BY-SA 3.0)
|
||||
heart.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/
|
||||
|
||||
Mito551 (sounds) (CC BY-SA):
|
||||
default_dig_choppy.ogg
|
||||
default_dig_cracky.ogg
|
||||
default_dig_crumbly.1.ogg
|
||||
default_dig_crumbly.2.ogg
|
||||
default_dig_dig_immediate.ogg
|
||||
default_dig_oddly_breakable_by_hand.ogg
|
||||
default_dug_node.1.ogg
|
||||
default_dug_node.2.ogg
|
||||
default_grass_footstep.1.ogg
|
||||
default_grass_footstep.2.ogg
|
||||
default_grass_footstep.3.ogg
|
||||
default_gravel_footstep.1.ogg
|
||||
default_gravel_footstep.2.ogg
|
||||
default_gravel_footstep.3.ogg
|
||||
default_gravel_footstep.4.ogg
|
||||
default_grass_footstep.1.ogg
|
||||
default_place_node.1.ogg
|
||||
default_place_node.2.ogg
|
||||
default_place_node.3.ogg
|
||||
default_place_node_hard.1.ogg
|
||||
default_place_node_hard.2.ogg
|
||||
default_snow_footstep.1.ogg
|
||||
default_snow_footstep.2.ogg
|
||||
default_hard_footstep.1.ogg
|
||||
default_hard_footstep.2.ogg
|
||||
default_hard_footstep.3.ogg
|
||||
default_sand_footstep.1.ogg
|
||||
default_sand_footstep.2.ogg
|
||||
default_wood_footstep.1.ogg
|
||||
default_wood_footstep.2.ogg
|
||||
default_dirt_footstep.1.ogg
|
||||
default_dirt_footstep.2.ogg
|
||||
default_glass_footstep.ogg
|
@ -1,80 +0,0 @@
|
||||
-- mods/default/aliases.lua
|
||||
|
||||
-- Aliases to support loading worlds using nodes following the old naming convention
|
||||
-- These can also be helpful when using chat commands, for example /giveme
|
||||
minetest.register_alias("stone", "default:stone")
|
||||
minetest.register_alias("stone_with_coal", "default:stone_with_coal")
|
||||
minetest.register_alias("stone_with_iron", "default:stone_with_iron")
|
||||
minetest.register_alias("dirt_with_grass", "default:dirt_with_grass")
|
||||
minetest.register_alias("dirt_with_grass_footsteps", "default:dirt_with_grass_footsteps")
|
||||
minetest.register_alias("dirt", "default:dirt")
|
||||
minetest.register_alias("sand", "default:sand")
|
||||
minetest.register_alias("gravel", "default:gravel")
|
||||
minetest.register_alias("sandstone", "default:sandstone")
|
||||
minetest.register_alias("clay", "default:clay")
|
||||
minetest.register_alias("brick", "default:brick")
|
||||
minetest.register_alias("tree", "default:tree")
|
||||
minetest.register_alias("jungletree", "default:jungletree")
|
||||
minetest.register_alias("junglegrass", "default:junglegrass")
|
||||
minetest.register_alias("leaves", "default:leaves")
|
||||
minetest.register_alias("cactus", "default:cactus")
|
||||
minetest.register_alias("papyrus", "default:papyrus")
|
||||
minetest.register_alias("bookshelf", "default:bookshelf")
|
||||
minetest.register_alias("glass", "default:glass")
|
||||
minetest.register_alias("wooden_fence", "default:fence_wood")
|
||||
minetest.register_alias("rail", "default:rail")
|
||||
minetest.register_alias("ladder", "default:ladder_wood")
|
||||
minetest.register_alias("wood", "default:wood")
|
||||
minetest.register_alias("mese", "default:mese")
|
||||
minetest.register_alias("cloud", "default:cloud")
|
||||
minetest.register_alias("water_flowing", "default:water_flowing")
|
||||
minetest.register_alias("water_source", "default:water_source")
|
||||
minetest.register_alias("lava_flowing", "default:lava_flowing")
|
||||
minetest.register_alias("lava_source", "default:lava_source")
|
||||
minetest.register_alias("torch", "default:torch")
|
||||
minetest.register_alias("sign_wall", "default:sign_wall_wood")
|
||||
minetest.register_alias("furnace", "default:furnace")
|
||||
minetest.register_alias("chest", "default:chest")
|
||||
minetest.register_alias("locked_chest", "default:chest_locked")
|
||||
minetest.register_alias("cobble", "default:cobble")
|
||||
minetest.register_alias("mossycobble", "default:mossycobble")
|
||||
minetest.register_alias("steelblock", "default:steelblock")
|
||||
minetest.register_alias("nyancat", "default:nyancat")
|
||||
minetest.register_alias("nyancat_rainbow", "default:nyancat_rainbow")
|
||||
minetest.register_alias("sapling", "default:sapling")
|
||||
minetest.register_alias("apple", "default:apple")
|
||||
|
||||
minetest.register_alias("WPick", "default:pick_wood")
|
||||
minetest.register_alias("STPick", "default:pick_stone")
|
||||
minetest.register_alias("SteelPick", "default:pick_steel")
|
||||
minetest.register_alias("MesePick", "default:pick_mese")
|
||||
minetest.register_alias("WShovel", "default:shovel_wood")
|
||||
minetest.register_alias("STShovel", "default:shovel_stone")
|
||||
minetest.register_alias("SteelShovel", "default:shovel_steel")
|
||||
minetest.register_alias("WAxe", "default:axe_wood")
|
||||
minetest.register_alias("STAxe", "default:axe_stone")
|
||||
minetest.register_alias("SteelAxe", "default:axe_steel")
|
||||
minetest.register_alias("WSword", "default:sword_wood")
|
||||
minetest.register_alias("STSword", "default:sword_stone")
|
||||
minetest.register_alias("SteelSword", "default:sword_steel")
|
||||
|
||||
minetest.register_alias("Stick", "default:stick")
|
||||
minetest.register_alias("paper", "default:paper")
|
||||
minetest.register_alias("book", "default:book")
|
||||
minetest.register_alias("lump_of_coal", "default:coal_lump")
|
||||
minetest.register_alias("lump_of_iron", "default:iron_lump")
|
||||
minetest.register_alias("lump_of_clay", "default:clay_lump")
|
||||
minetest.register_alias("steel_ingot", "default:steel_ingot")
|
||||
minetest.register_alias("clay_brick", "default:clay_brick")
|
||||
minetest.register_alias("snow", "default:snow")
|
||||
|
||||
-- 'mese_block' was used for a while for the block form of mese
|
||||
minetest.register_alias("default:mese_block", "default:mese")
|
||||
|
||||
-- Aliases for corrected pine node names
|
||||
minetest.register_alias("default:pinetree", "default:pine_tree")
|
||||
minetest.register_alias("default:pinewood", "default:pine_wood")
|
||||
|
||||
minetest.register_alias("default:ladder", "default:ladder_wood")
|
||||
minetest.register_alias("default:sign_wall", "default:sign_wall_wood")
|
||||
|
@ -1,887 +0,0 @@
|
||||
-- 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:pine_wood 4',
|
||||
recipe = {
|
||||
{'default:pine_tree'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:acacia_wood 4',
|
||||
recipe = {
|
||||
{'default:acacia_tree'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:aspen_wood 4',
|
||||
recipe = {
|
||||
{'default:aspen_tree'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:stick 4',
|
||||
recipe = {
|
||||
{'group:wood'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sign_wall_steel 3',
|
||||
recipe = {
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sign_wall_wood 3',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:torch 4',
|
||||
recipe = {
|
||||
{'default:coal_lump'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pick_wood',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood', 'group:wood'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pick_stone',
|
||||
recipe = {
|
||||
{'group:stone', 'group:stone', 'group:stone'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pick_steel',
|
||||
recipe = {
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pick_bronze',
|
||||
recipe = {
|
||||
{'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pick_mese',
|
||||
recipe = {
|
||||
{'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:pick_diamond',
|
||||
recipe = {
|
||||
{'default:diamond', 'default:diamond', 'default:diamond'},
|
||||
{'', 'group:stick', ''},
|
||||
{'', 'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:shovel_wood',
|
||||
recipe = {
|
||||
{'group:wood'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:shovel_stone',
|
||||
recipe = {
|
||||
{'group:stone'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:shovel_steel',
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:shovel_bronze',
|
||||
recipe = {
|
||||
{'default:bronze_ingot'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:shovel_mese',
|
||||
recipe = {
|
||||
{'default:mese_crystal'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:shovel_diamond',
|
||||
recipe = {
|
||||
{'default:diamond'},
|
||||
{'group:stick'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_wood',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood'},
|
||||
{'group:wood', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_stone',
|
||||
recipe = {
|
||||
{'group:stone', 'group:stone'},
|
||||
{'group:stone', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_steel',
|
||||
recipe = {
|
||||
{'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_bronze',
|
||||
recipe = {
|
||||
{'default:bronze_ingot', 'default:bronze_ingot'},
|
||||
{'default:bronze_ingot', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_mese',
|
||||
recipe = {
|
||||
{'default:mese_crystal', 'default:mese_crystal'},
|
||||
{'default:mese_crystal', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_diamond',
|
||||
recipe = {
|
||||
{'default:diamond', 'default:diamond'},
|
||||
{'default:diamond', 'group:stick'},
|
||||
{'', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_wood',
|
||||
recipe = {
|
||||
{'group:wood', 'group:wood'},
|
||||
{'group:stick', 'group:wood'},
|
||||
{'group:stick',''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_stone',
|
||||
recipe = {
|
||||
{'group:stone', 'group:stone'},
|
||||
{'group:stick', 'group:stone'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_steel',
|
||||
recipe = {
|
||||
{'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'group:stick', 'default:steel_ingot'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_bronze',
|
||||
recipe = {
|
||||
{'default:bronze_ingot', 'default:bronze_ingot'},
|
||||
{'group:stick', 'default:bronze_ingot'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_mese',
|
||||
recipe = {
|
||||
{'default:mese_crystal', 'default:mese_crystal'},
|
||||
{'group:stick', 'default:mese_crystal'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:axe_diamond',
|
||||
recipe = {
|
||||
{'default:diamond', 'default:diamond'},
|
||||
{'group:stick', 'default:diamond'},
|
||||
{'group:stick', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sword_wood',
|
||||
recipe = {
|
||||
{'group:wood'},
|
||||
{'group:wood'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sword_stone',
|
||||
recipe = {
|
||||
{'group:stone'},
|
||||
{'group:stone'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sword_steel',
|
||||
recipe = {
|
||||
{'default:steel_ingot'},
|
||||
{'default:steel_ingot'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sword_bronze',
|
||||
recipe = {
|
||||
{'default:bronze_ingot'},
|
||||
{'default:bronze_ingot'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sword_mese',
|
||||
recipe = {
|
||||
{'default:mese_crystal'},
|
||||
{'default:mese_crystal'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:sword_diamond',
|
||||
recipe = {
|
||||
{'default:diamond'},
|
||||
{'default:diamond'},
|
||||
{'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:rail 24',
|
||||
recipe = {
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'group: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 4',
|
||||
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:clay_lump 4',
|
||||
recipe = {
|
||||
{'default:clay'},
|
||||
}
|
||||
})
|
||||
|
||||
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_wood 3',
|
||||
recipe = {
|
||||
{'group:stick', '', 'group:stick'},
|
||||
{'group:stick', 'group:stick', 'group:stick'},
|
||||
{'group:stick', '', 'group:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:ladder_steel 15',
|
||||
recipe = {
|
||||
{'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: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:meselamp 1',
|
||||
recipe = {
|
||||
{'', 'default:mese_crystal',''},
|
||||
{'default:mese_crystal', 'default:glass', '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:obsidianbrick 4',
|
||||
recipe = {
|
||||
{'default:obsidian', 'default:obsidian'},
|
||||
{'default:obsidian', 'default:obsidian'}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:stonebrick 4',
|
||||
recipe = {
|
||||
{'default:stone', 'default:stone'},
|
||||
{'default:stone', 'default:stone'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:desert_stonebrick 4',
|
||||
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:stone",
|
||||
recipe = "default:mossycobble",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "default:desert_stone",
|
||||
recipe = "default:desert_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:fence_acacia_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:fence_junglewood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:fence_pine_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:fence_aspen_wood",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:ladder_wood",
|
||||
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_wood",
|
||||
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 = "group: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:grass_1",
|
||||
burntime = 2,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "default:dry_grass_1",
|
||||
burntime = 2,
|
||||
})
|
||||
|
@ -1,249 +0,0 @@
|
||||
-- mods/default/craftitems.lua
|
||||
|
||||
minetest.register_craftitem("default:stick", {
|
||||
description = "Stick",
|
||||
inventory_image = "default_stick.png",
|
||||
groups = {stick = 1},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:paper", {
|
||||
description = "Paper",
|
||||
inventory_image = "default_paper.png",
|
||||
})
|
||||
|
||||
local lpp = 14 -- Lines per book's page
|
||||
local function book_on_use(itemstack, user)
|
||||
local player_name = user:get_player_name()
|
||||
local data = minetest.deserialize(itemstack:get_metadata())
|
||||
local formspec, title, text, owner = "", "", "", player_name
|
||||
local page, page_max, lines, string = 1, 1, {}, ""
|
||||
|
||||
if data then
|
||||
title = data.title
|
||||
text = data.text
|
||||
owner = data.owner
|
||||
|
||||
for str in (text .. "\n"):gmatch("([^\n]*)[\n]") do
|
||||
lines[#lines+1] = str
|
||||
end
|
||||
|
||||
if data.page then
|
||||
page = data.page
|
||||
page_max = data.page_max
|
||||
|
||||
for i = ((lpp * page) - lpp) + 1, lpp * page do
|
||||
if not lines[i] then break end
|
||||
string = string .. lines[i] .. "\n"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if owner == player_name then
|
||||
formspec = "size[8,8]" .. default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
"field[0.5,1;7.5,0;title;Title:;" ..
|
||||
minetest.formspec_escape(title) .. "]" ..
|
||||
"textarea[0.5,1.5;7.5,7;text;Contents:;" ..
|
||||
minetest.formspec_escape(text) .. "]" ..
|
||||
"button_exit[2.5,7.5;3,1;save;Save]"
|
||||
else
|
||||
formspec = "size[8,8]" .. default.gui_bg ..
|
||||
default.gui_bg_img ..
|
||||
"label[0.5,0.5;by " .. owner .. "]" ..
|
||||
"tablecolumns[color;text]" ..
|
||||
"tableoptions[background=#00000000;highlight=#00000000;border=false]" ..
|
||||
"table[0.4,0;7,0.5;title;#FFFF00," .. minetest.formspec_escape(title) .. "]" ..
|
||||
"textarea[0.5,1.5;7.5,7;;" ..
|
||||
minetest.formspec_escape(string ~= "" and string or text) .. ";]" ..
|
||||
"button[2.4,7.6;0.8,0.8;book_prev;<]" ..
|
||||
"label[3.2,7.7;Page " .. page .. " of " .. page_max .. "]" ..
|
||||
"button[4.9,7.6;0.8,0.8;book_next;>]"
|
||||
end
|
||||
|
||||
minetest.show_formspec(player_name, "default:book", formspec)
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "default:book" then return end
|
||||
local inv = player:get_inventory()
|
||||
local stack = player:get_wielded_item()
|
||||
|
||||
if fields.save and fields.title ~= "" and fields.text ~= "" then
|
||||
local new_stack, data
|
||||
if stack:get_name() ~= "default:book_written" then
|
||||
local count = stack:get_count()
|
||||
if count == 1 then
|
||||
stack:set_name("default:book_written")
|
||||
else
|
||||
stack:set_count(count - 1)
|
||||
new_stack = ItemStack("default:book_written")
|
||||
end
|
||||
else
|
||||
data = minetest.deserialize(stack:get_metadata())
|
||||
end
|
||||
|
||||
if not data then data = {} end
|
||||
data.title = fields.title
|
||||
data.text = fields.text
|
||||
data.text_len = #data.text
|
||||
data.page = 1
|
||||
data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp)
|
||||
data.owner = player:get_player_name()
|
||||
local data_str = minetest.serialize(data)
|
||||
|
||||
if new_stack then
|
||||
new_stack:set_metadata(data_str)
|
||||
if inv:room_for_item("main", new_stack) then
|
||||
inv:add_item("main", new_stack)
|
||||
else
|
||||
minetest.add_item(player:getpos(), new_stack)
|
||||
end
|
||||
else
|
||||
stack:set_metadata(data_str)
|
||||
end
|
||||
|
||||
elseif fields.book_next or fields.book_prev then
|
||||
local data = minetest.deserialize(stack:get_metadata())
|
||||
if not data.page then return end
|
||||
|
||||
if fields.book_next then
|
||||
data.page = data.page + 1
|
||||
if data.page > data.page_max then
|
||||
data.page = 1
|
||||
end
|
||||
else
|
||||
data.page = data.page - 1
|
||||
if data.page == 0 then
|
||||
data.page = data.page_max
|
||||
end
|
||||
end
|
||||
|
||||
local data_str = minetest.serialize(data)
|
||||
stack:set_metadata(data_str)
|
||||
book_on_use(stack, player)
|
||||
end
|
||||
|
||||
player:set_wielded_item(stack)
|
||||
end)
|
||||
|
||||
minetest.register_craftitem("default:book", {
|
||||
description = "Book",
|
||||
inventory_image = "default_book.png",
|
||||
groups = {book = 1},
|
||||
on_use = book_on_use,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:book_written", {
|
||||
description = "Book With Text",
|
||||
inventory_image = "default_book_written.png",
|
||||
groups = {book = 1, not_in_creative_inventory = 1},
|
||||
stack_max = 1,
|
||||
on_use = book_on_use,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "default:book_written",
|
||||
recipe = {"default:book", "default:book_written"}
|
||||
})
|
||||
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
if itemstack:get_name() ~= "default:book_written" then
|
||||
return
|
||||
end
|
||||
|
||||
local copy = ItemStack("default:book_written")
|
||||
local original
|
||||
local index
|
||||
for i = 1, player:get_inventory():get_size("craft") do
|
||||
if old_craft_grid[i]:get_name() == "default:book_written" then
|
||||
original = old_craft_grid[i]
|
||||
index = i
|
||||
end
|
||||
end
|
||||
if not original then
|
||||
return
|
||||
end
|
||||
local copymeta = original:get_metadata()
|
||||
-- copy of the book held by player's mouse cursor
|
||||
itemstack:set_metadata(copymeta)
|
||||
-- put the book with metadata back in the craft grid
|
||||
craft_inv:set_stack("craft", index, original)
|
||||
end)
|
||||
|
||||
minetest.register_craftitem("default:coal_lump", {
|
||||
description = "Coal Lump",
|
||||
inventory_image = "default_coal_lump.png",
|
||||
groups = {coal = 1}
|
||||
})
|
||||
|
||||
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:obsidian_shard", {
|
||||
description = "Obsidian Shard",
|
||||
inventory_image = "default_obsidian_shard.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("default:flint", {
|
||||
description = "Flint",
|
||||
inventory_image = "default_flint.png"
|
||||
})
|
||||
|
@ -1 +0,0 @@
|
||||
craft_guide?
|
@ -1,477 +0,0 @@
|
||||
-- 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 = 0.25}
|
||||
table.place = table.place or
|
||||
{name = "default_place_node_hard", gain = 1.0}
|
||||
return table
|
||||
end
|
||||
|
||||
function default.node_sound_stone_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_hard_footstep", gain = 0.5}
|
||||
table.dug = table.dug or
|
||||
{name = "default_hard_footstep", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
||||
function default.node_sound_dirt_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_dirt_footstep", gain = 1.0}
|
||||
table.dug = table.dug or
|
||||
{name = "default_dirt_footstep", gain = 1.5}
|
||||
table.place = table.place or
|
||||
{name = "default_place_node", gain = 1.0}
|
||||
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_sand_footstep", gain = 0.12}
|
||||
table.dug = table.dug or
|
||||
{name = "default_sand_footstep", gain = 0.24}
|
||||
table.place = table.place or
|
||||
{name = "default_place_node", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
||||
function default.node_sound_gravel_defaults(table)
|
||||
table = table or {}
|
||||
table.footstep = table.footstep or
|
||||
{name = "default_gravel_footstep", gain = 0.5}
|
||||
table.dug = table.dug or
|
||||
{name = "default_gravel_footstep", gain = 1.0}
|
||||
table.place = table.place or
|
||||
{name = "default_place_node", gain = 1.0}
|
||||
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_wood_footstep", gain = 0.5}
|
||||
table.dug = table.dug or
|
||||
{name = "default_wood_footstep", gain = 1.0}
|
||||
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.35}
|
||||
table.dug = table.dug or
|
||||
{name = "default_grass_footstep", gain = 0.7}
|
||||
table.dig = table.dig or
|
||||
{name = "default_dig_crumbly", gain = 0.4}
|
||||
table.place = table.place or
|
||||
{name = "default_place_node", 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_glass_footstep", gain = 0.5}
|
||||
table.dug = table.dug or
|
||||
{name = "default_break_glass", gain = 1.0}
|
||||
default.node_sound_defaults(table)
|
||||
return table
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Lavacooling
|
||||
--
|
||||
|
||||
default.cool_lava = function(pos, node)
|
||||
if node.name == "default:lava_source" then
|
||||
minetest.set_node(pos, {name = "default:obsidian"})
|
||||
else -- Lava flowing
|
||||
minetest.set_node(pos, {name = "default:stone"})
|
||||
end
|
||||
minetest.sound_play("default_cool_lava",
|
||||
{pos = pos, max_hear_distance = 16, gain = 0.25})
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:lava_source", "default:lava_flowing"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 1,
|
||||
chance = 1,
|
||||
catch_up = false,
|
||||
action = function(...)
|
||||
default.cool_lava(...)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- optimized helper to put all items in an inventory into a drops list
|
||||
--
|
||||
function default.get_inventory_drops(pos, inventory, drops)
|
||||
local inv = minetest.get_meta(pos):get_inventory()
|
||||
local n = #drops
|
||||
for i = 1, inv:get_size(inventory) do
|
||||
local stack = inv:get_stack(inventory, i)
|
||||
if stack:get_count() > 0 then
|
||||
drops[n+1] = stack:to_table()
|
||||
n = n + 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Papyrus and cactus growing
|
||||
--
|
||||
|
||||
-- wrapping the functions in abm action is necessary to make overriding them possible
|
||||
|
||||
function default.grow_cactus(pos, node)
|
||||
if node.param2 >= 4 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y - 1
|
||||
if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y + 1
|
||||
local height = 0
|
||||
while node.name == "default:cactus" and height < 4 do
|
||||
height = height + 1
|
||||
pos.y = pos.y + 1
|
||||
node = minetest.get_node(pos)
|
||||
end
|
||||
if height == 4 or node.name ~= "air" then
|
||||
return
|
||||
end
|
||||
minetest.set_node(pos, {name = "default:cactus"})
|
||||
return true
|
||||
end
|
||||
|
||||
function default.grow_papyrus(pos, node)
|
||||
pos.y = pos.y - 1
|
||||
local name = minetest.get_node(pos).name
|
||||
if name ~= "default:dirt_with_grass" and name ~= "default:dirt" then
|
||||
return
|
||||
end
|
||||
if not minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y + 1
|
||||
local height = 0
|
||||
while node.name == "default:papyrus" and height < 4 do
|
||||
height = height + 1
|
||||
pos.y = pos.y + 1
|
||||
node = minetest.get_node(pos)
|
||||
end
|
||||
if height == 4 or node.name ~= "air" then
|
||||
return
|
||||
end
|
||||
minetest.set_node(pos, {name = "default:papyrus"})
|
||||
return true
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:cactus"},
|
||||
neighbors = {"group:sand"},
|
||||
interval = 12,
|
||||
chance = 83,
|
||||
action = function(...)
|
||||
default.grow_cactus(...)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:papyrus"},
|
||||
neighbors = {"default:dirt", "default:dirt_with_grass"},
|
||||
interval = 14,
|
||||
chance = 71,
|
||||
action = function(...)
|
||||
default.grow_papyrus(...)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- dig upwards
|
||||
--
|
||||
|
||||
function default.dig_up(pos, node, digger)
|
||||
if digger == nil then return end
|
||||
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local nn = minetest.get_node(np)
|
||||
if nn.name == node.name then
|
||||
minetest.node_dig(np, nn, digger)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Fence registration helper
|
||||
--
|
||||
function default.register_fence(name, def)
|
||||
minetest.register_craft({
|
||||
output = name .. " 4",
|
||||
recipe = {
|
||||
{ def.material, 'group:stick', def.material },
|
||||
{ def.material, 'group:stick', def.material },
|
||||
}
|
||||
})
|
||||
|
||||
local fence_texture = "default_fence_overlay.png^" .. def.texture ..
|
||||
"^default_fence_overlay.png^[makealpha:255,126,126"
|
||||
-- Allow almost everything to be overridden
|
||||
local default_fields = {
|
||||
paramtype = "light",
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "connected",
|
||||
fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}},
|
||||
-- connect_top =
|
||||
-- connect_bottom =
|
||||
connect_front = {{-1/16,3/16,-1/2,1/16,5/16,-1/8},
|
||||
{-1/16,-5/16,-1/2,1/16,-3/16,-1/8}},
|
||||
connect_left = {{-1/2,3/16,-1/16,-1/8,5/16,1/16},
|
||||
{-1/2,-5/16,-1/16,-1/8,-3/16,1/16}},
|
||||
connect_back = {{-1/16,3/16,1/8,1/16,5/16,1/2},
|
||||
{-1/16,-5/16,1/8,1/16,-3/16,1/2}},
|
||||
connect_right = {{1/8,3/16,-1/16,1/2,5/16,1/16},
|
||||
{1/8,-5/16,-1/16,1/2,-3/16,1/16}},
|
||||
},
|
||||
connects_to = {"group:fence", "group:wood", "group:tree"},
|
||||
inventory_image = fence_texture,
|
||||
wield_image = fence_texture,
|
||||
tiles = {def.texture},
|
||||
sunlight_propagates = true,
|
||||
is_ground_content = false,
|
||||
groups = {},
|
||||
}
|
||||
for k, v in pairs(default_fields) do
|
||||
if not def[k] then
|
||||
def[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
-- Always add to the fence group, even if no group provided
|
||||
def.groups.fence = 1
|
||||
|
||||
def.texture = nil
|
||||
def.material = nil
|
||||
|
||||
minetest.register_node(name, def)
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Leafdecay
|
||||
--
|
||||
|
||||
default.leafdecay_trunk_cache = {}
|
||||
default.leafdecay_enable_cache = true
|
||||
-- Spread the load of finding trunks
|
||||
default.leafdecay_trunk_find_allow_accumulator = 0
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
local finds_per_second = 5000
|
||||
default.leafdecay_trunk_find_allow_accumulator =
|
||||
math.floor(dtime * finds_per_second)
|
||||
end)
|
||||
|
||||
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
|
||||
if placer and not placer:get_player_control().sneak then
|
||||
local node = minetest.get_node(pos)
|
||||
node.param2 = 1
|
||||
minetest.set_node(pos, node)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:leafdecay"},
|
||||
neighbors = {"air", "group:liquid"},
|
||||
-- A low interval and a high inverse chance spreads the load
|
||||
interval = 2,
|
||||
chance = 5,
|
||||
|
||||
action = function(p0, node, _, _)
|
||||
--print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")")
|
||||
local do_preserve = false
|
||||
local d = minetest.registered_nodes[node.name].groups.leafdecay
|
||||
if not d or d == 0 then
|
||||
--print("not groups.leafdecay")
|
||||
return
|
||||
end
|
||||
local n0 = minetest.get_node(p0)
|
||||
if n0.param2 ~= 0 then
|
||||
--print("param2 ~= 0")
|
||||
return
|
||||
end
|
||||
local p0_hash = nil
|
||||
if default.leafdecay_enable_cache then
|
||||
p0_hash = minetest.hash_node_position(p0)
|
||||
local trunkp = default.leafdecay_trunk_cache[p0_hash]
|
||||
if trunkp then
|
||||
local n = minetest.get_node(trunkp)
|
||||
local reg = minetest.registered_nodes[n.name]
|
||||
-- Assume ignore is a trunk, to make the thing
|
||||
-- work at the border of the active area
|
||||
if n.name == "ignore" or (reg and reg.groups.tree and
|
||||
reg.groups.tree ~= 0) then
|
||||
--print("cached trunk still exists")
|
||||
return
|
||||
end
|
||||
--print("cached trunk is invalid")
|
||||
-- Cache is invalid
|
||||
table.remove(default.leafdecay_trunk_cache, p0_hash)
|
||||
end
|
||||
end
|
||||
if default.leafdecay_trunk_find_allow_accumulator <= 0 then
|
||||
return
|
||||
end
|
||||
default.leafdecay_trunk_find_allow_accumulator =
|
||||
default.leafdecay_trunk_find_allow_accumulator - 1
|
||||
-- Assume ignore is a trunk, to make the thing
|
||||
-- work at the border of the active area
|
||||
local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"})
|
||||
if p1 then
|
||||
do_preserve = true
|
||||
if default.leafdecay_enable_cache then
|
||||
--print("caching trunk")
|
||||
-- Cache the trunk
|
||||
default.leafdecay_trunk_cache[p0_hash] = p1
|
||||
end
|
||||
end
|
||||
if not do_preserve then
|
||||
-- Drop stuff other than the node itself
|
||||
local itemstacks = minetest.get_node_drops(n0.name)
|
||||
for _, itemname in ipairs(itemstacks) do
|
||||
if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0 or
|
||||
itemname ~= n0.name then
|
||||
local p_drop = {
|
||||
x = p0.x - 0.5 + math.random(),
|
||||
y = p0.y - 0.5 + math.random(),
|
||||
z = p0.z - 0.5 + math.random(),
|
||||
}
|
||||
minetest.add_item(p_drop, itemname)
|
||||
end
|
||||
end
|
||||
-- Remove node
|
||||
minetest.remove_node(p0)
|
||||
nodeupdate(p0)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- Convert dirt to something that fits the environment
|
||||
--
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:dirt"},
|
||||
neighbors = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dirt_with_snow",
|
||||
"group:grass",
|
||||
"group:dry_grass",
|
||||
"default:snow",
|
||||
},
|
||||
interval = 6,
|
||||
chance = 67,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
-- Most likely case, half the time it's too dark for this.
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node_light(above) or 0) < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
-- Look for likely neighbors.
|
||||
local p2 = minetest.find_node_near(pos, 1, {"default:dirt_with_grass",
|
||||
"default:dirt_with_dry_grass", "default:dirt_with_snow"})
|
||||
if p2 then
|
||||
-- But the node needs to be under air in this case.
|
||||
local n2 = minetest.get_node(above)
|
||||
if n2 and n2.name == "air" then
|
||||
local n3 = minetest.get_node(p2)
|
||||
minetest.set_node(pos, {name = n3.name})
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Anything on top?
|
||||
local n2 = minetest.get_node(above)
|
||||
if not n2 then
|
||||
return
|
||||
end
|
||||
|
||||
local name = n2.name
|
||||
-- Snow check is cheapest, so comes first.
|
||||
if name == "default:snow" then
|
||||
minetest.set_node(pos, {name = "default:dirt_with_snow"})
|
||||
-- Most likely case first.
|
||||
elseif minetest.get_item_group(name, "grass") ~= 0 then
|
||||
minetest.set_node(pos, {name = "default:dirt_with_grass"})
|
||||
elseif minetest.get_item_group(name, "dry_grass") ~= 0 then
|
||||
minetest.set_node(pos, {name = "default:dirt_with_dry_grass"})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
--
|
||||
-- Grass and dry grass removed in darkness
|
||||
--
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dirt_with_snow",
|
||||
},
|
||||
interval = 8,
|
||||
chance = 50,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
local above = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local name = minetest.get_node(above).name
|
||||
local nodedef = minetest.registered_nodes[name]
|
||||
if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or
|
||||
nodedef.paramtype == "light") and
|
||||
nodedef.liquidtype == "none") then
|
||||
minetest.set_node(pos, {name = "default:dirt"})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
--
|
||||
-- Moss growth on cobble near water
|
||||
--
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:cobble"},
|
||||
neighbors = {"group:water"},
|
||||
interval = 16,
|
||||
chance = 200,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
minetest.set_node(pos, {name = "default:mossycobble"})
|
||||
end
|
||||
})
|
@ -1,310 +0,0 @@
|
||||
|
||||
--
|
||||
-- Formspecs
|
||||
--
|
||||
|
||||
local function active_formspec(fuel_percent, item_percent)
|
||||
local formspec =
|
||||
"size[8,8.5]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
|
||||
(100-fuel_percent)..":default_furnace_fire_fg.png]"..
|
||||
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
|
||||
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
|
||||
"list[current_name;dst;4.75,0.96;2,2;]"..
|
||||
"list[current_player;main;0,4.25;8,1;]"..
|
||||
"list[current_player;main;0,5.5;8,3;8]"..
|
||||
"listring[current_name;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;src]"..
|
||||
"listring[current_player;main]"..
|
||||
default.get_hotbar_bg(0, 4.25)
|
||||
return formspec
|
||||
end
|
||||
|
||||
local inactive_formspec =
|
||||
"size[8,8.5]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"list[current_name;src;2.75,0.5;1,1;]"..
|
||||
"list[current_name;fuel;2.75,2.5;1,1;]"..
|
||||
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
|
||||
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||
"list[current_name;dst;4.75,0.96;2,2;]"..
|
||||
"list[current_player;main;0,4.25;8,1;]"..
|
||||
"list[current_player;main;0,5.5;8,3;8]"..
|
||||
"listring[current_name;dst]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_name;src]"..
|
||||
"listring[current_player;main]"..
|
||||
default.get_hotbar_bg(0, 4.25)
|
||||
|
||||
--
|
||||
-- Node callback functions that are the same for active and inactive furnace
|
||||
--
|
||||
|
||||
local function can_dig(pos, player)
|
||||
local meta = minetest.get_meta(pos);
|
||||
local inv = meta:get_inventory()
|
||||
return inv:is_empty("fuel") and inv:is_empty("dst") and inv:is_empty("src")
|
||||
end
|
||||
|
||||
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return 0
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
if listname == "fuel" then
|
||||
if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
|
||||
if inv:is_empty("src") then
|
||||
meta:set_string("infotext", "Furnace is empty")
|
||||
end
|
||||
return stack:get_count()
|
||||
else
|
||||
return 0
|
||||
end
|
||||
elseif listname == "src" then
|
||||
return stack:get_count()
|
||||
elseif listname == "dst" then
|
||||
return 0
|
||||
end
|
||||
end
|
||||
|
||||
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
local stack = inv:get_stack(from_list, from_index)
|
||||
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
|
||||
end
|
||||
|
||||
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
|
||||
if minetest.is_protected(pos, player:get_player_name()) then
|
||||
return 0
|
||||
end
|
||||
return stack:get_count()
|
||||
end
|
||||
|
||||
local function swap_node(pos, name)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == name then
|
||||
return
|
||||
end
|
||||
node.name = name
|
||||
minetest.swap_node(pos, node)
|
||||
end
|
||||
|
||||
local function furnace_node_timer(pos, elapsed)
|
||||
--
|
||||
-- Inizialize metadata
|
||||
--
|
||||
local meta = minetest.get_meta(pos)
|
||||
local fuel_time = meta:get_float("fuel_time") or 0
|
||||
local src_time = meta:get_float("src_time") or 0
|
||||
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
|
||||
|
||||
local inv = meta:get_inventory()
|
||||
local srclist = inv:get_list("src")
|
||||
local fuellist = inv:get_list("fuel")
|
||||
local dstlist = inv:get_list("dst")
|
||||
|
||||
--
|
||||
-- Cooking
|
||||
--
|
||||
|
||||
-- Check if we have cookable content
|
||||
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
|
||||
local cookable = true
|
||||
|
||||
if cooked.time == 0 then
|
||||
cookable = false
|
||||
end
|
||||
|
||||
-- Check if we have enough fuel to burn
|
||||
if fuel_time < fuel_totaltime then
|
||||
-- The furnace is currently active and has enough fuel
|
||||
fuel_time = fuel_time + 1
|
||||
|
||||
-- If there is a cookable item then check if it is ready yet
|
||||
if cookable then
|
||||
src_time = src_time + 1
|
||||
if src_time >= cooked.time then
|
||||
-- Place result in dst list if possible
|
||||
if inv:room_for_item("dst", cooked.item) then
|
||||
inv:add_item("dst", cooked.item)
|
||||
inv:set_stack("src", 1, aftercooked.items[1])
|
||||
src_time = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
-- Furnace ran out of fuel
|
||||
if cookable then
|
||||
-- We need to get new fuel
|
||||
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
|
||||
|
||||
if fuel.time == 0 then
|
||||
-- No valid fuel in fuel list
|
||||
fuel_totaltime = 0
|
||||
fuel_time = 0
|
||||
src_time = 0
|
||||
else
|
||||
-- Take fuel from fuel list
|
||||
inv:set_stack("fuel", 1, afterfuel.items[1])
|
||||
|
||||
fuel_totaltime = fuel.time
|
||||
fuel_time = 0
|
||||
end
|
||||
else
|
||||
-- We don't need to get new fuel since there is no cookable item
|
||||
fuel_totaltime = 0
|
||||
fuel_time = 0
|
||||
src_time = 0
|
||||
end
|
||||
end
|
||||
|
||||
--
|
||||
-- Update formspec, infotext and node
|
||||
--
|
||||
local formspec = inactive_formspec
|
||||
local item_state = ""
|
||||
local item_percent = 0
|
||||
if cookable then
|
||||
item_percent = math.floor(src_time / cooked.time * 100)
|
||||
item_state = item_percent .. "%"
|
||||
else
|
||||
if srclist[1]:is_empty() then
|
||||
item_state = "Empty"
|
||||
else
|
||||
item_state = "Not cookable"
|
||||
end
|
||||
end
|
||||
|
||||
local fuel_state = "Empty"
|
||||
local active = "inactive "
|
||||
local result = false
|
||||
|
||||
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
|
||||
active = "active "
|
||||
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
|
||||
fuel_state = fuel_percent .. "%"
|
||||
formspec = active_formspec(fuel_percent, item_percent)
|
||||
swap_node(pos, "default:furnace_active")
|
||||
-- make sure timer restarts automatically
|
||||
result = true
|
||||
else
|
||||
if not fuellist[1]:is_empty() then
|
||||
fuel_state = "0%"
|
||||
end
|
||||
swap_node(pos, "default:furnace")
|
||||
-- stop timer on the inactive furnace
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:stop()
|
||||
end
|
||||
|
||||
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
|
||||
|
||||
--
|
||||
-- Set meta values
|
||||
--
|
||||
meta:set_float("fuel_totaltime", fuel_totaltime)
|
||||
meta:set_float("fuel_time", fuel_time)
|
||||
meta:set_float("src_time", src_time)
|
||||
meta:set_string("formspec", formspec)
|
||||
meta:set_string("infotext", infotext)
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Node definitions
|
||||
--
|
||||
|
||||
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",
|
||||
groups = {cracky=2},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
||||
can_dig = can_dig,
|
||||
|
||||
on_timer = furnace_node_timer,
|
||||
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", inactive_formspec)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_size('src', 1)
|
||||
inv:set_size('fuel', 1)
|
||||
inv:set_size('dst', 4)
|
||||
end,
|
||||
|
||||
on_metadata_inventory_move = function(pos)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(1.0)
|
||||
end,
|
||||
on_metadata_inventory_put = function(pos)
|
||||
-- start timer function, it will sort out whether furnace can burn or not.
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
timer:start(1.0)
|
||||
end,
|
||||
on_blast = function(pos)
|
||||
local drops = {}
|
||||
default.get_inventory_drops(pos, "src", drops)
|
||||
default.get_inventory_drops(pos, "fuel", drops)
|
||||
default.get_inventory_drops(pos, "dst", drops)
|
||||
drops[#drops+1] = "default:furnace"
|
||||
minetest.remove_node(pos)
|
||||
return drops
|
||||
end,
|
||||
|
||||
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||
})
|
||||
|
||||
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",
|
||||
{
|
||||
image = "default_furnace_front_active.png",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 1.5
|
||||
},
|
||||
}
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
light_source = 8,
|
||||
drop = "default:furnace",
|
||||
groups = {cracky=2, not_in_creative_inventory=1},
|
||||
legacy_facedir_simple = true,
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
on_timer = furnace_node_timer,
|
||||
|
||||
can_dig = can_dig,
|
||||
|
||||
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||
})
|
||||
|
@ -1,48 +0,0 @@
|
||||
-- Minetest 0.4 mod: default
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
-- The API documentation in here was moved into game_api.txt
|
||||
|
||||
-- Definitions made by this mod that other mods can use too
|
||||
default = {}
|
||||
|
||||
default.LIGHT_MAX = 14
|
||||
|
||||
-- GUI related stuff
|
||||
default.gui_bg = "bgcolor[#080808BB;true]"
|
||||
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
|
||||
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
||||
|
||||
function default.get_hotbar_bg(x,y)
|
||||
local out = ""
|
||||
for i=0,7,1 do
|
||||
out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
default.gui_survival_form = "size[8,8.5]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"list[current_player;main;0,4.25;8,1;]"..
|
||||
"list[current_player;main;0,5.5;8,3;8]"..
|
||||
"list[current_player;craft;1.75,0.5;3,3;]"..
|
||||
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
|
||||
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
||||
"listring[current_player;main]"..
|
||||
"listring[current_player;craft]"..
|
||||
default.get_hotbar_bg(0,4.25)
|
||||
|
||||
-- Load files
|
||||
dofile(minetest.get_modpath("default").."/functions.lua")
|
||||
dofile(minetest.get_modpath("default").."/nodes.lua")
|
||||
dofile(minetest.get_modpath("default").."/furnace.lua")
|
||||
dofile(minetest.get_modpath("default").."/tools.lua")
|
||||
dofile(minetest.get_modpath("default").."/craftitems.lua")
|
||||
dofile(minetest.get_modpath("default").."/crafting.lua")
|
||||
dofile(minetest.get_modpath("default").."/mapgen.lua")
|
||||
dofile(minetest.get_modpath("default").."/player.lua")
|
||||
dofile(minetest.get_modpath("default").."/trees.lua")
|
||||
dofile(minetest.get_modpath("default").."/aliases.lua")
|
||||
dofile(minetest.get_modpath("default").."/legacy.lua")
|
@ -1,25 +0,0 @@
|
||||
-- mods/default/legacy.lua
|
||||
|
||||
-- Horrible crap to support old code registering falling nodes
|
||||
-- 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
|
||||
|
||||
function default.spawn_falling_node(p, nodename)
|
||||
spawn_falling_node(p, nodename)
|
||||
end
|
||||
|
||||
-- Liquids
|
||||
WATER_ALPHA = minetest.registered_nodes["default:water_source"].alpha
|
||||
WATER_VISC = minetest.registered_nodes["default:water_source"].liquid_viscosity
|
||||
LAVA_VISC = minetest.registered_nodes["default:lava_source"].liquid_viscosity
|
||||
LIGHT_MAX = default.LIGHT_MAX
|
||||
|
||||
-- Formspecs
|
||||
default.gui_suvival_form = default.gui_survival_form
|
Before Width: | Height: | Size: 2.7 KiB |
@ -1,159 +0,0 @@
|
||||
-- Minetest 0.4 mod: player
|
||||
-- See README.txt for licensing and other information.
|
||||
|
||||
-- Player animation blending
|
||||
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
|
||||
local animation_blend = 0
|
||||
|
||||
default.registered_player_models = { }
|
||||
|
||||
-- Local for speed.
|
||||
local models = default.registered_player_models
|
||||
|
||||
function default.player_register_model(name, def)
|
||||
models[name] = def
|
||||
end
|
||||
|
||||
-- Default player appearance
|
||||
default.player_register_model("character.b3d", {
|
||||
animation_speed = 30,
|
||||
textures = {"character.png", },
|
||||
animations = {
|
||||
-- Standard animations.
|
||||
stand = { x= 0, y= 79, },
|
||||
lay = { x=162, y=166, },
|
||||
walk = { x=168, y=187, },
|
||||
mine = { x=189, y=198, },
|
||||
walk_mine = { x=200, y=219, },
|
||||
-- Extra animations (not currently used by the game).
|
||||
sit = { x= 81, y=160, },
|
||||
},
|
||||
})
|
||||
|
||||
-- Player stats and animations
|
||||
local player_model = {}
|
||||
local player_textures = {}
|
||||
local player_anim = {}
|
||||
local player_sneak = {}
|
||||
default.player_attached = {}
|
||||
|
||||
function default.player_get_animation(player)
|
||||
local name = player:get_player_name()
|
||||
return {
|
||||
model = player_model[name],
|
||||
textures = player_textures[name],
|
||||
animation = player_anim[name],
|
||||
}
|
||||
end
|
||||
|
||||
-- Called when a player's appearance needs to be updated
|
||||
function default.player_set_model(player, model_name)
|
||||
local name = player:get_player_name()
|
||||
local model = models[model_name]
|
||||
if model then
|
||||
if player_model[name] == model_name then
|
||||
return
|
||||
end
|
||||
player:set_properties({
|
||||
mesh = model_name,
|
||||
textures = player_textures[name] or model.textures,
|
||||
visual = "mesh",
|
||||
visual_size = model.visual_size or {x=1, y=1},
|
||||
})
|
||||
default.player_set_animation(player, "stand")
|
||||
else
|
||||
player:set_properties({
|
||||
textures = { "player.png", "player_back.png", },
|
||||
visual = "upright_sprite",
|
||||
})
|
||||
end
|
||||
player_model[name] = model_name
|
||||
end
|
||||
|
||||
function default.player_set_textures(player, textures)
|
||||
local name = player:get_player_name()
|
||||
player_textures[name] = textures
|
||||
player:set_properties({textures = textures,})
|
||||
end
|
||||
|
||||
function default.player_set_animation(player, anim_name, speed)
|
||||
local name = player:get_player_name()
|
||||
if player_anim[name] == anim_name then
|
||||
return
|
||||
end
|
||||
local model = player_model[name] and models[player_model[name]]
|
||||
if not (model and model.animations[anim_name]) then
|
||||
return
|
||||
end
|
||||
local anim = model.animations[anim_name]
|
||||
player_anim[name] = anim_name
|
||||
player:set_animation(anim, speed or model.animation_speed, animation_blend)
|
||||
end
|
||||
|
||||
-- Update appearance when the player joins
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
default.player_attached[player:get_player_name()] = false
|
||||
default.player_set_model(player, "character.b3d")
|
||||
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
|
||||
|
||||
-- set GUI
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
player:set_inventory_formspec(default.gui_survival_form)
|
||||
end
|
||||
player:hud_set_hotbar_image("gui_hotbar.png")
|
||||
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
player_model[name] = nil
|
||||
player_anim[name] = nil
|
||||
player_textures[name] = nil
|
||||
end)
|
||||
|
||||
-- Localize for better performance.
|
||||
local player_set_animation = default.player_set_animation
|
||||
local player_attached = default.player_attached
|
||||
|
||||
-- Check each player and apply animations
|
||||
minetest.register_globalstep(function(dtime)
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
local name = player:get_player_name()
|
||||
local model_name = player_model[name]
|
||||
local model = model_name and models[model_name]
|
||||
if model and not player_attached[name] then
|
||||
local controls = player:get_player_control()
|
||||
local walking = false
|
||||
local animation_speed_mod = model.animation_speed or 30
|
||||
|
||||
-- Determine if the player is walking
|
||||
if controls.up or controls.down or controls.left or controls.right then
|
||||
walking = true
|
||||
end
|
||||
|
||||
-- Determine if the player is sneaking, and reduce animation speed if so
|
||||
if controls.sneak then
|
||||
animation_speed_mod = animation_speed_mod / 2
|
||||
end
|
||||
|
||||
-- Apply animations based on what the player is doing
|
||||
if player:get_hp() == 0 then
|
||||
player_set_animation(player, "lay")
|
||||
elseif walking then
|
||||
if player_sneak[name] ~= controls.sneak then
|
||||
player_anim[name] = nil
|
||||
player_sneak[name] = controls.sneak
|
||||
end
|
||||
if controls.LMB then
|
||||
player_set_animation(player, "walk_mine", animation_speed_mod)
|
||||
else
|
||||
player_set_animation(player, "walk", animation_speed_mod)
|
||||
end
|
||||
elseif controls.LMB then
|
||||
player_set_animation(player, "mine")
|
||||
else
|
||||
player_set_animation(player, "stand", animation_speed_mod)
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
Before Width: | Height: | Size: 459 B |
Before Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 444 B |
Before Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 682 B |
Before Width: | Height: | Size: 731 B |
Before Width: | Height: | Size: 261 B |
Before Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 761 B |
Before Width: | Height: | Size: 320 B |
Before Width: | Height: | Size: 695 B |
Before Width: | Height: | Size: 656 B |
Before Width: | Height: | Size: 373 B |
Before Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 471 B |
Before Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 356 B |
Before Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 267 B |
Before Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 469 B |
Before Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 272 B |
Before Width: | Height: | Size: 158 B |
Before Width: | Height: | Size: 167 B |
Before Width: | Height: | Size: 83 B |
Before Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 157 B |
Before Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 225 B |