diff --git a/new_api/bucket/README.txt b/new_api/bucket/README.txt new file mode 100644 index 0000000..bb898c6 --- /dev/null +++ b/new_api/bucket/README.txt @@ -0,0 +1,26 @@ +Minetest 0.4 mod: bucket +========================= + +License of source code: +----------------------- +Copyright (C) 2011-2012 Kahrl +Copyright (C) 2011-2012 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/gpl-2.0.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 + + diff --git a/new_api/bucket/init.lua b/new_api/bucket/init.lua index 8ed9da5..2bd45d3 100644 --- a/new_api/bucket/init.lua +++ b/new_api/bucket/init.lua @@ -1,5 +1,5 @@ --- bucket (Minetest 0.4 mod) --- A bucket, which can pick up water and lava +-- Minetest 0.4 mod: bucket +-- See README.txt for licensing and other information. minetest.register_alias("bucket", "bucket:bucket_empty") minetest.register_alias("bucket_water", "bucket:bucket_water") diff --git a/new_api/default/README.txt b/new_api/default/README.txt new file mode 100644 index 0000000..f891bd3 --- /dev/null +++ b/new_api/default/README.txt @@ -0,0 +1,64 @@ +Minetest 0.4 mod: default +========================== + +License of source code: +----------------------- +Copyright (C) 2011-2012 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/gpl-2.0.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 + +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_cobble.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_mossycobble.png + default_sand.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_steelsword.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 + diff --git a/new_api/default/init.lua b/new_api/default/init.lua index 97ca450..37bd4c8 100644 --- a/new_api/default/init.lua +++ b/new_api/default/init.lua @@ -1,5 +1,5 @@ --- default (Minetest 0.4 mod) --- Most default stuff +-- Minetest 0.4 mod: default +-- See README.txt for licensing and other information. -- The API documentation in here was moved into doc/lua_api.txt @@ -11,6 +11,10 @@ LIGHT_MAX = 14 -- Definitions made by this mod that other mods can use too default = {} +-- Load other files +dofile(minetest.get_modpath("default").."/mapgen.lua") +dofile(minetest.get_modpath("default").."/leafdecay.lua") + -- -- Tool definition -- @@ -48,7 +52,7 @@ minetest.register_tool("default:pick_stone", { tool_capabilities = { max_drop_level=0, groupcaps={ - cracky={times={[1]=2.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1} + cracky={times={[1]=3.00, [2]=1.20, [3]=0.80}, uses=20, maxlevel=1} } }, }) @@ -72,7 +76,7 @@ minetest.register_tool("default:pick_mese", { cracky={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}, crumbly={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}, snappy={times={[1]=2.0, [2]=1.0, [3]=0.5}, uses=20, maxlevel=3}, - fastness={times={[1]=25.0, [2]=19.0, [3]=13}, uses=10, maxlevel=3} -- fastness group for obsidian + snappy={fastness={[1]=25.0, [2]=19.0, [3]=13.5}, uses=10, maxlevel=3} } }, }) @@ -82,7 +86,7 @@ minetest.register_tool("default:shovel_wood", { tool_capabilities = { max_drop_level=0, groupcaps={ - crumbly={times={[1]=2.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1} + crumbly={times={[1]=3.00, [2]=0.80, [3]=0.50}, uses=10, maxlevel=1} } }, }) @@ -92,7 +96,7 @@ minetest.register_tool("default:shovel_stone", { tool_capabilities = { max_drop_level=0, groupcaps={ - crumbly={times={[1]=1.20, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1} + crumbly={times={[1]=1.50, [2]=0.50, [3]=0.30}, uses=20, maxlevel=1} } }, }) @@ -102,7 +106,7 @@ minetest.register_tool("default:shovel_steel", { tool_capabilities = { max_drop_level=1, groupcaps={ - crumbly={times={[1]=1.00, [2]=0.70, [3]=0.60}, uses=10, maxlevel=2} + crumbly={times={[1]=1.50, [2]=0.70, [3]=0.60}, uses=10, maxlevel=2} } }, }) @@ -123,7 +127,7 @@ minetest.register_tool("default:axe_stone", { tool_capabilities = { max_drop_level=0, groupcaps={ - choppy={times={[1]=1.50, [2]=1.00, [3]=0.60}, uses=20, maxlevel=1}, + choppy={times={[1]=3.00, [2]=1.00, [3]=0.60}, uses=20, maxlevel=1}, fleshy={times={[2]=1.30, [3]=0.70}, uses=20, maxlevel=1} } }, @@ -134,7 +138,7 @@ minetest.register_tool("default:axe_steel", { tool_capabilities = { max_drop_level=1, groupcaps={ - choppy={times={[1]=2.00, [2]=1.60, [3]=1.00}, uses=10, maxlevel=2}, + choppy={times={[1]=3.00, [2]=1.60, [3]=1.00}, uses=10, maxlevel=2}, fleshy={times={[2]=1.10, [3]=0.60}, uses=40, maxlevel=1} } }, @@ -460,18 +464,6 @@ minetest.register_craft({ recipe = "default:sand", }) -minetest.register_craft({ - type = "cooking", - output = "default:coal_lump", - recipe = "default:tree", -}) - -minetest.register_craft({ - type = "cooking", - output = "default:coal_lump", - recipe = "default:jungletree", -}) - minetest.register_craft({ type = "cooking", output = "default:stone", @@ -806,7 +798,7 @@ minetest.register_node("default:tree", { description = "Tree", tile_images = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, is_ground_content = true, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=1}, + groups = {tree=1,snappy=2,choppy=2,oddly_breakable_by_hand=1}, sounds = default.node_sound_wood_defaults(), }) @@ -814,7 +806,7 @@ minetest.register_node("default:jungletree", { description = "Jungle Tree", tile_images = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, is_ground_content = true, - groups = {snappy=2,choppy=2,oddly_breakable_by_hand=1}, + groups = {tree=1,snappy=2,choppy=2,oddly_breakable_by_hand=1}, sounds = default.node_sound_wood_defaults(), }) @@ -837,7 +829,7 @@ minetest.register_node("default:leaves", { visual_scale = 1.3, tile_images = {"default_leaves.png"}, paramtype = "light", - groups = {snappy=3}, + groups = {snappy=3, leafdecay=3}, drop = { max_items = 1, items = { @@ -963,7 +955,7 @@ minetest.register_node("default:mese", { description = "Mese", tile_images = {"default_mese.png"}, is_ground_content = true, - groups = {cracky=1,level=2}, + groups = {cracky=1}, sounds = default.node_sound_defaults(), }) @@ -1300,7 +1292,8 @@ minetest.add_to_creative_inventory('default:lava_source') minetest.add_to_creative_inventory('default:ladder') -- --- Aliases for the current map generator outputs +-- Aliases for map generator outputs +-- (required at least by an in-development branch) -- minetest.register_alias("mapgen_air", "air") @@ -1524,11 +1517,4 @@ minetest.register_on_chat_message(function(name, message) end end) --- --- Done, print some random stuff --- - ---print("minetest.registered_entities:") ---dump2(minetest.registered_entities) - -- END diff --git a/new_api/default/leafdecay.lua b/new_api/default/leafdecay.lua new file mode 100644 index 0000000..36b6df8 --- /dev/null +++ b/new_api/default/leafdecay.lua @@ -0,0 +1,104 @@ +-- minetest/default/leafdecay.lua + +-- 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" +-- the node can be without decaying. +-- +-- If param2 of the node is ~= 0, the node will always be preserved. Thus, if +-- the player places a node of that kind, you will want to set param2=1 or so. + +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) + +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.env: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.env: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.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 + for dx = -d, d do if do_preserve then break end + for dy = -d, d do if do_preserve then break end + for dz = -d, d do if do_preserve then break end + local p = { + x = p0.x + dx, + y = p0.y + dy, + z = p0.z + dz, + } + local n = minetest.env:get_node(p) + 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.groups.tree and reg.groups.tree ~= 0) then + do_preserve = true + if default.leafdecay_enable_cache then + --print("caching trunk") + -- Cache the trunk + default.leafdecay_trunk_cache[p0_hash] = p + end + end + end + end + end + if not do_preserve then + -- Drop stuff other than the node itself + itemstacks = minetest.get_node_drops(n0.name) + for _, itemname in ipairs(itemstacks) do + if 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.env:add_item(p_drop, itemname) + end + end + -- Remove node + minetest.env:remove_node(p0) + end + end +}) + diff --git a/new_api/default/mapgen.lua b/new_api/default/mapgen.lua new file mode 100644 index 0000000..d01f051 --- /dev/null +++ b/new_api/default/mapgen.lua @@ -0,0 +1,87 @@ +-- minetest/default/mapgen.lua + +local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, ore_per_chunk, height_min, height_max) + if maxp.y < height_min or minp.y > height_max then + return + end + local y_min = math.max(minp.y, height_min) + local y_max = math.min(maxp.y, height_max) + local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1) + local pr = PseudoRandom(seed) + local num_chunks = math.floor(chunks_per_volume * volume) + local chunk_size = 3 + if ore_per_chunk <= 4 then + chunk_size = 2 + end + local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk) + --print("generate_ore num_chunks: "..dump(num_chunks)) + for i=1,num_chunks do + local y0 = pr:next(y_min, y_max-chunk_size+1) + if y0 >= height_min and y0 <= height_max then + local x0 = pr:next(minp.x, maxp.x-chunk_size+1) + local z0 = pr:next(minp.z, maxp.z-chunk_size+1) + local p0 = {x=x0, y=y0, z=z0} + for x1=0,chunk_size-1 do + for y1=0,chunk_size-1 do + for z1=0,chunk_size-1 do + if pr:next(1,inverse_chance) == 1 then + local x2 = x0+x1 + local y2 = y0+y1 + local z2 = z0+z1 + local p2 = {x=x2, y=y2, z=z2} + if minetest.env:get_node(p2).name == wherein then + minetest.env:set_node(p2, {name=name}) + end + end + end + end + end + end + end + --print("generate_ore done") +end + +minetest.register_on_generated(function(minp, maxp, seed) + generate_ore("default:stone_with_coal", "default:stone", minp, maxp, seed, 1/8/8/8, 5, -64, 64) + generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+1, 1/16/16/16, 5, 3, 7) + generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+2, 1/12/12/12, 5, -16, 2) + generate_ore("default:stone_with_iron", "default:stone", minp, maxp, seed+3, 1/9/9/9, 5, -64, -17) + -- Generate clay + if maxp.y >= 2 and minp.y <= 0 then + -- Assume X and Z lengths are equal + local divlen = 4 + local divs = (maxp.x-minp.x)/divlen+1; + for divx=0+1,divs-1-1 do + for divz=0+1,divs-1-1 do + local cx = minp.x + math.floor((divx+0.5)*divlen) + local cz = minp.z + math.floor((divz+0.5)*divlen) + if minetest.env:get_node({x=cx,y=1,z=cz}).name == "default:water_source" and + minetest.env:get_node({x=cx,y=0,z=cz}).name == "default:sand" then + local is_shallow = true + local num_water_around = 0 + if minetest.env:get_node({x=cx-divlen*2,y=1,z=cz+0}).name == "default:water_source" then + num_water_around = num_water_around + 1 end + if minetest.env:get_node({x=cx+divlen*2,y=1,z=cz+0}).name == "default:water_source" then + num_water_around = num_water_around + 1 end + if minetest.env:get_node({x=cx+0,y=1,z=cz-divlen*2}).name == "default:water_source" then + num_water_around = num_water_around + 1 end + if minetest.env:get_node({x=cx+0,y=1,z=cz+divlen*2}).name == "default:water_source" then + num_water_around = num_water_around + 1 end + if num_water_around >= 2 then + is_shallow = false + end + if is_shallow then + for x1=-divlen,divlen do + for z1=-divlen,divlen do + if minetest.env:get_node({x=cx+x1,y=0,z=cz+z1}).name == "default:sand" then + minetest.env:set_node({x=cx+x1,y=0,z=cz+z1}, {name="default:clay"}) + end + end + end + end + end + end + end + end +end) + diff --git a/new_api/default/sounds/default_dig_choppy.ogg b/new_api/default/sounds/default_dig_choppy.ogg new file mode 100644 index 0000000..d605145 Binary files /dev/null and b/new_api/default/sounds/default_dig_choppy.ogg differ diff --git a/new_api/default/sounds/default_dig_cracky.ogg b/new_api/default/sounds/default_dig_cracky.ogg new file mode 100644 index 0000000..53d45c1 Binary files /dev/null and b/new_api/default/sounds/default_dig_cracky.ogg differ diff --git a/new_api/default/sounds/default_dig_crumbly.1.ogg b/new_api/default/sounds/default_dig_crumbly.1.ogg new file mode 100644 index 0000000..ea5830a Binary files /dev/null and b/new_api/default/sounds/default_dig_crumbly.1.ogg differ diff --git a/new_api/default/sounds/default_dig_crumbly.2.ogg b/new_api/default/sounds/default_dig_crumbly.2.ogg new file mode 100644 index 0000000..f1a9248 Binary files /dev/null and b/new_api/default/sounds/default_dig_crumbly.2.ogg differ diff --git a/new_api/default/sounds/default_dig_dig_immediate.ogg b/new_api/default/sounds/default_dig_dig_immediate.ogg new file mode 100644 index 0000000..526629b Binary files /dev/null and b/new_api/default/sounds/default_dig_dig_immediate.ogg differ diff --git a/new_api/default/sounds/default_dig_oddly_breakable_by_hand.ogg b/new_api/default/sounds/default_dig_oddly_breakable_by_hand.ogg new file mode 100644 index 0000000..d605145 Binary files /dev/null and b/new_api/default/sounds/default_dig_oddly_breakable_by_hand.ogg differ diff --git a/new_api/default/sounds/default_dug_node.1.ogg b/new_api/default/sounds/default_dug_node.1.ogg new file mode 100644 index 0000000..9d56bb8 Binary files /dev/null and b/new_api/default/sounds/default_dug_node.1.ogg differ diff --git a/new_api/default/sounds/default_grass_footstep.2.ogg b/new_api/default/sounds/default_grass_footstep.2.ogg new file mode 100644 index 0000000..330ca47 Binary files /dev/null and b/new_api/default/sounds/default_grass_footstep.2.ogg differ diff --git a/new_api/default/sounds/default_grass_footstep.3.ogg b/new_api/default/sounds/default_grass_footstep.3.ogg new file mode 100644 index 0000000..07acc1e Binary files /dev/null and b/new_api/default/sounds/default_grass_footstep.3.ogg differ diff --git a/new_api/default/sounds/default_gravel_footstep.1.ogg b/new_api/default/sounds/default_gravel_footstep.1.ogg new file mode 100644 index 0000000..68758b2 Binary files /dev/null and b/new_api/default/sounds/default_gravel_footstep.1.ogg differ diff --git a/new_api/default/sounds/default_gravel_footstep.2.ogg b/new_api/default/sounds/default_gravel_footstep.2.ogg new file mode 100644 index 0000000..128ae57 Binary files /dev/null and b/new_api/default/sounds/default_gravel_footstep.2.ogg differ diff --git a/new_api/default/sounds/default_gravel_footstep.3.ogg b/new_api/default/sounds/default_gravel_footstep.3.ogg new file mode 100644 index 0000000..7a5863f Binary files /dev/null and b/new_api/default/sounds/default_gravel_footstep.3.ogg differ diff --git a/new_api/default/sounds/default_gravel_footstep.4.ogg b/new_api/default/sounds/default_gravel_footstep.4.ogg new file mode 100644 index 0000000..8cdadb1 Binary files /dev/null and b/new_api/default/sounds/default_gravel_footstep.4.ogg differ diff --git a/new_api/default/sounds/default_hard_footstep.1.ogg b/new_api/default/sounds/default_hard_footstep.1.ogg new file mode 100644 index 0000000..6b351ff Binary files /dev/null and b/new_api/default/sounds/default_hard_footstep.1.ogg differ diff --git a/new_api/default/sounds/default_hard_footstep.2.ogg b/new_api/default/sounds/default_hard_footstep.2.ogg new file mode 100644 index 0000000..2ce721e Binary files /dev/null and b/new_api/default/sounds/default_hard_footstep.2.ogg differ diff --git a/new_api/default/sounds/default_place_node.1.ogg b/new_api/default/sounds/default_place_node.1.ogg new file mode 100644 index 0000000..526629b Binary files /dev/null and b/new_api/default/sounds/default_place_node.1.ogg differ diff --git a/new_api/default/sounds/default_place_node.2.ogg b/new_api/default/sounds/default_place_node.2.ogg new file mode 100644 index 0000000..012c667 Binary files /dev/null and b/new_api/default/sounds/default_place_node.2.ogg differ diff --git a/new_api/default/sounds/default_place_node.3.ogg b/new_api/default/sounds/default_place_node.3.ogg new file mode 100644 index 0000000..eaf9719 Binary files /dev/null and b/new_api/default/sounds/default_place_node.3.ogg differ diff --git a/new_api/default/textures/default_apple.png b/new_api/default/textures/default_apple.png index e6854ed..9593f28 100644 Binary files a/new_api/default/textures/default_apple.png and b/new_api/default/textures/default_apple.png differ diff --git a/new_api/default/textures/default_bookshelf.png b/new_api/default/textures/default_bookshelf.png index 5666f5a..5ecc50f 100644 Binary files a/new_api/default/textures/default_bookshelf.png and b/new_api/default/textures/default_bookshelf.png differ diff --git a/new_api/default/textures/default_brick.png b/new_api/default/textures/default_brick.png index 83209ca..32d77f3 100644 Binary files a/new_api/default/textures/default_brick.png and b/new_api/default/textures/default_brick.png differ diff --git a/new_api/default/textures/default_cactus_side.png b/new_api/default/textures/default_cactus_side.png index a33f688..fc479fd 100644 Binary files a/new_api/default/textures/default_cactus_side.png and b/new_api/default/textures/default_cactus_side.png differ diff --git a/new_api/default/textures/default_cactus_top.png b/new_api/default/textures/default_cactus_top.png index 11711d5..f9e68df 100644 Binary files a/new_api/default/textures/default_cactus_top.png and b/new_api/default/textures/default_cactus_top.png differ diff --git a/new_api/default/textures/default_chest_front.png b/new_api/default/textures/default_chest_front.png index e7d8f25..47b7771 100644 Binary files a/new_api/default/textures/default_chest_front.png and b/new_api/default/textures/default_chest_front.png differ diff --git a/new_api/default/textures/default_chest_lock.png b/new_api/default/textures/default_chest_lock.png index 4b59301..f5346f4 100644 Binary files a/new_api/default/textures/default_chest_lock.png and b/new_api/default/textures/default_chest_lock.png differ diff --git a/new_api/default/textures/default_chest_side.png b/new_api/default/textures/default_chest_side.png index 0002d87..5665168 100644 Binary files a/new_api/default/textures/default_chest_side.png and b/new_api/default/textures/default_chest_side.png differ diff --git a/new_api/default/textures/default_chest_top.png b/new_api/default/textures/default_chest_top.png index 8871d41..b4e8a12 100644 Binary files a/new_api/default/textures/default_chest_top.png and b/new_api/default/textures/default_chest_top.png differ diff --git a/new_api/default/textures/default_clay_brick.png b/new_api/default/textures/default_clay_brick.png index 447d8aa..e36648e 100644 Binary files a/new_api/default/textures/default_clay_brick.png and b/new_api/default/textures/default_clay_brick.png differ diff --git a/new_api/default/textures/default_coal_lump.png b/new_api/default/textures/default_coal_lump.png index 2949f0f..bad901e 100644 Binary files a/new_api/default/textures/default_coal_lump.png and b/new_api/default/textures/default_coal_lump.png differ diff --git a/new_api/default/textures/default_cobble.png b/new_api/default/textures/default_cobble.png index d68503c..bc79696 100644 Binary files a/new_api/default/textures/default_cobble.png and b/new_api/default/textures/default_cobble.png differ diff --git a/new_api/default/textures/default_dirt.png b/new_api/default/textures/default_dirt.png index aa750da..30cd4bf 100644 Binary files a/new_api/default/textures/default_dirt.png and b/new_api/default/textures/default_dirt.png differ diff --git a/new_api/default/textures/default_fence.png b/new_api/default/textures/default_fence.png index e3c8176..0b99f0e 100644 Binary files a/new_api/default/textures/default_fence.png and b/new_api/default/textures/default_fence.png differ diff --git a/new_api/default/textures/default_glass.png b/new_api/default/textures/default_glass.png index e24ca80..ade0196 100644 Binary files a/new_api/default/textures/default_glass.png and b/new_api/default/textures/default_glass.png differ diff --git a/new_api/default/textures/default_grass.png b/new_api/default/textures/default_grass.png index 02fbc75..4e1f0f1 100644 Binary files a/new_api/default/textures/default_grass.png and b/new_api/default/textures/default_grass.png differ diff --git a/new_api/default/textures/default_grass_footsteps.png b/new_api/default/textures/default_grass_footsteps.png index c8aaeea..57e063d 100644 Binary files a/new_api/default/textures/default_grass_footsteps.png and b/new_api/default/textures/default_grass_footsteps.png differ diff --git a/new_api/default/textures/default_grass_side.png b/new_api/default/textures/default_grass_side.png index 2fd3324..6ca1a6f 100644 Binary files a/new_api/default/textures/default_grass_side.png and b/new_api/default/textures/default_grass_side.png differ diff --git a/new_api/default/textures/default_gravel.png b/new_api/default/textures/default_gravel.png index 4837d52..f08666a 100644 Binary files a/new_api/default/textures/default_gravel.png and b/new_api/default/textures/default_gravel.png differ diff --git a/new_api/default/textures/default_iron_lump.png b/new_api/default/textures/default_iron_lump.png index 53ce9af..edb9310 100644 Binary files a/new_api/default/textures/default_iron_lump.png and b/new_api/default/textures/default_iron_lump.png differ diff --git a/new_api/default/textures/default_jungletree.png b/new_api/default/textures/default_jungletree.png index aadaac0..d8c2635 100644 Binary files a/new_api/default/textures/default_jungletree.png and b/new_api/default/textures/default_jungletree.png differ diff --git a/new_api/default/textures/default_jungletree_top.png b/new_api/default/textures/default_jungletree_top.png index 58baa63..805272a 100644 Binary files a/new_api/default/textures/default_jungletree_top.png and b/new_api/default/textures/default_jungletree_top.png differ diff --git a/new_api/default/textures/default_lava.png b/new_api/default/textures/default_lava.png index 630bc2a..2c7d9ad 100644 Binary files a/new_api/default/textures/default_lava.png and b/new_api/default/textures/default_lava.png differ diff --git a/new_api/default/textures/default_leaves.png b/new_api/default/textures/default_leaves.png index 3d14db2..d0258ed 100644 Binary files a/new_api/default/textures/default_leaves.png and b/new_api/default/textures/default_leaves.png differ diff --git a/new_api/default/textures/default_mese.png b/new_api/default/textures/default_mese.png index ff371ea..18d3bcf 100644 Binary files a/new_api/default/textures/default_mese.png and b/new_api/default/textures/default_mese.png differ diff --git a/new_api/default/textures/default_mossycobble.png b/new_api/default/textures/default_mossycobble.png index 644303b..ca72717 100644 Binary files a/new_api/default/textures/default_mossycobble.png and b/new_api/default/textures/default_mossycobble.png differ diff --git a/new_api/default/textures/default_sand.png b/new_api/default/textures/default_sand.png index 62d8422..2a48456 100644 Binary files a/new_api/default/textures/default_sand.png and b/new_api/default/textures/default_sand.png differ diff --git a/new_api/default/textures/default_sandstone.png b/new_api/default/textures/default_sandstone.png index 95e9252..c4759b4 100644 Binary files a/new_api/default/textures/default_sandstone.png and b/new_api/default/textures/default_sandstone.png differ diff --git a/new_api/default/textures/default_sapling.png b/new_api/default/textures/default_sapling.png index 05496f6..d03c3e4 100644 Binary files a/new_api/default/textures/default_sapling.png and b/new_api/default/textures/default_sapling.png differ diff --git a/new_api/default/textures/default_sign_wall.png b/new_api/default/textures/default_sign_wall.png index 2acde70..d5c6dcd 100644 Binary files a/new_api/default/textures/default_sign_wall.png and b/new_api/default/textures/default_sign_wall.png differ diff --git a/new_api/default/textures/default_stone.png b/new_api/default/textures/default_stone.png index bfa3f1c..17c3f56 100644 Binary files a/new_api/default/textures/default_stone.png and b/new_api/default/textures/default_stone.png differ diff --git a/new_api/default/textures/default_tool_mesepick.png b/new_api/default/textures/default_tool_mesepick.png index 95619a0..4828f0f 100644 Binary files a/new_api/default/textures/default_tool_mesepick.png and b/new_api/default/textures/default_tool_mesepick.png differ diff --git a/new_api/default/textures/default_tool_steelaxe.png b/new_api/default/textures/default_tool_steelaxe.png index f85fdea..0ad23c9 100644 Binary files a/new_api/default/textures/default_tool_steelaxe.png and b/new_api/default/textures/default_tool_steelaxe.png differ diff --git a/new_api/default/textures/default_tool_steelpick.png b/new_api/default/textures/default_tool_steelpick.png index 2215cea..1d5a2d1 100644 Binary files a/new_api/default/textures/default_tool_steelpick.png and b/new_api/default/textures/default_tool_steelpick.png differ diff --git a/new_api/default/textures/default_tool_steelshovel.png b/new_api/default/textures/default_tool_steelshovel.png index 95e66fe..ed84138 100644 Binary files a/new_api/default/textures/default_tool_steelshovel.png and b/new_api/default/textures/default_tool_steelshovel.png differ diff --git a/new_api/default/textures/default_tool_steelsword.png b/new_api/default/textures/default_tool_steelsword.png index b0a7678..036b03f 100644 Binary files a/new_api/default/textures/default_tool_steelsword.png and b/new_api/default/textures/default_tool_steelsword.png differ diff --git a/new_api/default/textures/default_tool_stoneaxe.png b/new_api/default/textures/default_tool_stoneaxe.png index 7f084f0..698ac91 100644 Binary files a/new_api/default/textures/default_tool_stoneaxe.png and b/new_api/default/textures/default_tool_stoneaxe.png differ diff --git a/new_api/default/textures/default_tool_stonepick.png b/new_api/default/textures/default_tool_stonepick.png index e344dc2..71ff0b5 100644 Binary files a/new_api/default/textures/default_tool_stonepick.png and b/new_api/default/textures/default_tool_stonepick.png differ diff --git a/new_api/default/textures/default_tool_stoneshovel.png b/new_api/default/textures/default_tool_stoneshovel.png index b3f9df3..ba52431 100644 Binary files a/new_api/default/textures/default_tool_stoneshovel.png and b/new_api/default/textures/default_tool_stoneshovel.png differ diff --git a/new_api/default/textures/default_tool_stonesword.png b/new_api/default/textures/default_tool_stonesword.png index b5420a7..8f8191f 100644 Binary files a/new_api/default/textures/default_tool_stonesword.png and b/new_api/default/textures/default_tool_stonesword.png differ diff --git a/new_api/default/textures/default_tool_woodaxe.png b/new_api/default/textures/default_tool_woodaxe.png index 330b64c..3daa4af 100644 Binary files a/new_api/default/textures/default_tool_woodaxe.png and b/new_api/default/textures/default_tool_woodaxe.png differ diff --git a/new_api/default/textures/default_tool_woodpick.png b/new_api/default/textures/default_tool_woodpick.png index f4cdad3..7346630 100644 Binary files a/new_api/default/textures/default_tool_woodpick.png and b/new_api/default/textures/default_tool_woodpick.png differ diff --git a/new_api/default/textures/default_tool_woodshovel.png b/new_api/default/textures/default_tool_woodshovel.png index c169ca8..649ab4c 100644 Binary files a/new_api/default/textures/default_tool_woodshovel.png and b/new_api/default/textures/default_tool_woodshovel.png differ diff --git a/new_api/default/textures/default_tool_woodsword.png b/new_api/default/textures/default_tool_woodsword.png index 1f57e38..d6c6be3 100644 Binary files a/new_api/default/textures/default_tool_woodsword.png and b/new_api/default/textures/default_tool_woodsword.png differ diff --git a/new_api/default/textures/default_torch.png b/new_api/default/textures/default_torch.png index fcb883d..b9444af 100644 Binary files a/new_api/default/textures/default_torch.png and b/new_api/default/textures/default_torch.png differ diff --git a/new_api/default/textures/default_tree.png b/new_api/default/textures/default_tree.png index 9abb0cc..ab12501 100644 Binary files a/new_api/default/textures/default_tree.png and b/new_api/default/textures/default_tree.png differ diff --git a/new_api/default/textures/default_tree_top.png b/new_api/default/textures/default_tree_top.png index 1792f52..6d62006 100644 Binary files a/new_api/default/textures/default_tree_top.png and b/new_api/default/textures/default_tree_top.png differ diff --git a/new_api/default/textures/default_water.png b/new_api/default/textures/default_water.png index e5f8cdc..eb506f1 100644 Binary files a/new_api/default/textures/default_water.png and b/new_api/default/textures/default_water.png differ diff --git a/new_api/default/textures/default_wood.png b/new_api/default/textures/default_wood.png index f1050ec..66f2b72 100644 Binary files a/new_api/default/textures/default_wood.png and b/new_api/default/textures/default_wood.png differ diff --git a/new_api/default/textures/heart.png b/new_api/default/textures/heart.png index 7161035..6bc183e 100644 Binary files a/new_api/default/textures/heart.png and b/new_api/default/textures/heart.png differ diff --git a/new_api/default/textures/player.png b/new_api/default/textures/player.png index fa57b48..90adf97 100644 Binary files a/new_api/default/textures/player.png and b/new_api/default/textures/player.png differ diff --git a/new_api/default/textures/player_back.png b/new_api/default/textures/player_back.png index 01fe737..530aa75 100644 Binary files a/new_api/default/textures/player_back.png and b/new_api/default/textures/player_back.png differ diff --git a/new_api/default/textures/treeprop.png b/new_api/default/textures/treeprop.png index 6599d93..77ea4d6 100644 Binary files a/new_api/default/textures/treeprop.png and b/new_api/default/textures/treeprop.png differ diff --git a/new_api/default/textures/wieldhand.png b/new_api/default/textures/wieldhand.png index b312af1..c4549e5 100644 Binary files a/new_api/default/textures/wieldhand.png and b/new_api/default/textures/wieldhand.png differ diff --git a/new_api/doors/README.txt b/new_api/doors/README.txt new file mode 100644 index 0000000..7655e86 --- /dev/null +++ b/new_api/doors/README.txt @@ -0,0 +1,43 @@ +Minetest 0.4 mod: doors +======================== + +License of source code: +----------------------- +Original license text: +-- (c) 2011 Fernando Zapata +-- Code licensed under GNU GPLv3 +-- Content licensed under CC BY-SA 3.0 +-- 2012-01-08 11:03:57 + +There has been unsuccesful attempts to contact the original author. Thus, +based on the intentions of the author, it is assumed that this code is +distributable and modifiable under GPLv2+later, under which Minetest is +distributed. + +Modifications: + Copyright (C) 2012 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/gpl-2.0.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 + +From the original zlpdoors mod by Fernando Zapata: + door_wood_a.png + door_wood_a_r.png + door_wood_b.png + door_wood_b_r.png + door_wood.png + diff --git a/new_api/doors/depends.txt b/new_api/doors/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/new_api/doors/depends.txt @@ -0,0 +1 @@ +default diff --git a/new_api/doors/init.lua b/new_api/doors/init.lua new file mode 100644 index 0000000..3264b27 --- /dev/null +++ b/new_api/doors/init.lua @@ -0,0 +1,205 @@ +-- Minetest 0.4 mod: doors +-- See README.txt for licensing and other information. +-------------------------------------------------------------------------------- + +local WALLMX = 3 +local WALLMZ = 5 +local WALLPX = 2 +local WALLPZ = 4 + +-------------------------------------------------------------------------------- + +minetest.register_alias('door', 'doors:door_wood') +minetest.register_alias('door_wood', 'doors:door_wood') + +minetest.register_node( 'doors:door_wood', { + description = 'Wooden Door', + drawtype = 'signlike', + tile_images = { 'door_wood.png' }, + inventory_image = 'door_wood.png', + wield_image = 'door_wood.png', + paramtype2 = 'wallmounted', + selection_box = { type = 'wallmounted' }, + groups = { choppy=2, dig_immediate=2 }, +}) + +minetest.register_craft( { + output = 'doors:door_wood', + recipe = { + { 'default:wood', 'default:wood' }, + { 'default:wood', 'default:wood' }, + { 'default:wood', 'default:wood' }, + }, +}) + +minetest.register_craft({ + type = 'fuel', + recipe = 'doors:door_wood', + burntime = 30, +}) + +minetest.register_node( 'doors:door_wood_a_c', { + Description = 'Top Closed Door', + drawtype = 'signlike', + tile_images = { 'door_wood_a.png' }, + inventory_image = 'door_wood_a.png', + paramtype = 'light', + paramtype2 = 'wallmounted', + walkable = true, + selection_box = { type = "wallmounted", }, + groups = { choppy=2, dig_immediate=2 }, + legacy_wallmounted = true, + drop = 'doors:door_wood', +}) + +minetest.register_node( 'doors:door_wood_b_c', { + Description = 'Bottom Closed Door', + drawtype = 'signlike', + tile_images = { 'door_wood_b.png' }, + inventory_image = 'door_wood_b.png', + paramtype = 'light', + paramtype2 = 'wallmounted', + walkable = true, + selection_box = { type = "wallmounted", }, + groups = { choppy=2, dig_immediate=2 }, + legacy_wallmounted = true, + drop = 'doors:door_wood', +}) + +minetest.register_node( 'doors:door_wood_a_o', { + Description = 'Top Open Door', + drawtype = 'signlike', + tile_images = { 'door_wood_a_r.png' }, + inventory_image = 'door_wood_a_r.png', + paramtype = 'light', + paramtype2 = 'wallmounted', + walkable = false, + selection_box = { type = "wallmounted", }, + groups = { choppy=2, dig_immediate=2 }, + legacy_wallmounted = true, + drop = 'doors:door_wood', +}) + +minetest.register_node( 'doors:door_wood_b_o', { + Description = 'Bottom Open Door', + drawtype = 'signlike', + tile_images = { 'door_wood_b_r.png' }, + inventory_image = 'door_wood_b_r.png', + paramtype = 'light', + paramtype2 = 'wallmounted', + walkable = false, + selection_box = { type = "wallmounted", }, + groups = { choppy=2, dig_immediate=2 }, + legacy_wallmounted = true, + drop = 'doors:door_wood', +}) + +-------------------------------------------------------------------------------- + +local round = function( n ) + if n >= 0 then + return math.floor( n + 0.5 ) + else + return math.ceil( n - 0.5 ) + end +end + +local on_door_placed = function( pos, node, placer ) + if node.name ~= 'doors:door_wood' then return end + + upos = { x = pos.x, y = pos.y - 1, z = pos.z } + apos = { x = pos.x, y = pos.y + 1, z = pos.z } + und = minetest.env:get_node( upos ) + abv = minetest.env:get_node( apos ) + + dir = placer:get_look_dir() + + if round( dir.x ) == 1 then + newparam = WALLMX + elseif round( dir.x ) == -1 then + newparam = WALLPX + elseif round( dir.z ) == 1 then + newparam = WALLMZ + elseif round( dir.z ) == -1 then + newparam = WALLPZ + end + + if und.name == 'air' then + minetest.env:add_node( pos, { name = 'doors:door_wood_a_c', param2 = newparam } ) + minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } ) + elseif abv.name == 'air' then + minetest.env:add_node( pos, { name = 'doors:door_wood_b_c', param2 = newparam } ) + minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } ) + else + minetest.env:remove_node( pos ) + placer:get_inventory():add_item( "main", 'doors:door_wood' ) + minetest.chat_send_player( placer:get_player_name(), 'not enough space' ) + end +end + +local on_door_punched = function( pos, node, puncher ) + if string.find( node.name, 'doors:door_wood' ) == nil then return end + + upos = { x = pos.x, y = pos.y - 1, z = pos.z } + apos = { x = pos.x, y = pos.y + 1, z = pos.z } + + if string.find( node.name, '_c', -2 ) ~= nil then + if node.param2 == WALLPX then + newparam = WALLMZ + elseif node.param2 == WALLMZ then + newparam = WALLMX + elseif node.param2 == WALLMX then + newparam = WALLPZ + elseif node.param2 == WALLPZ then + newparam = WALLPX + end + elseif string.find( node.name, '_o', -2 ) ~= nil then + if node.param2 == WALLMZ then + newparam = WALLPX + elseif node.param2 == WALLMX then + newparam = WALLMZ + elseif node.param2 == WALLPZ then + newparam = WALLMX + elseif node.param2 == WALLPX then + newparam = WALLPZ + end + end + + if ( node.name == 'doors:door_wood_a_c' ) then + minetest.env:add_node( pos, { name = 'doors:door_wood_a_o', param2 = newparam } ) + minetest.env:add_node( upos, { name = 'doors:door_wood_b_o', param2 = newparam } ) + + elseif ( node.name == 'doors:door_wood_b_c' ) then + minetest.env:add_node( pos, { name = 'doors:door_wood_b_o', param2 = newparam } ) + minetest.env:add_node( apos, { name = 'doors:door_wood_a_o', param2 = newparam } ) + + elseif ( node.name == 'doors:door_wood_a_o' ) then + minetest.env:add_node( pos, { name = 'doors:door_wood_a_c', param2 = newparam } ) + minetest.env:add_node( upos, { name = 'doors:door_wood_b_c', param2 = newparam } ) + + elseif ( node.name == 'doors:door_wood_b_o' ) then + minetest.env:add_node( pos, { name = 'doors:door_wood_b_c', param2 = newparam } ) + minetest.env:add_node( apos, { name = 'doors:door_wood_a_c', param2 = newparam } ) + + end +end + +local on_door_digged = function( pos, node, digger ) + upos = { x = pos.x, y = pos.y - 1, z = pos.z } + apos = { x = pos.x, y = pos.y + 1, z = pos.z } + + if ( node.name == 'doors:door_wood_a_c' ) or ( node.name == 'doors:door_wood_a_o' ) then + minetest.env:remove_node( upos ) + elseif ( node.name == 'doors:door_wood_b_c' ) or ( node.name == 'doors:door_wood_b_o' ) then + minetest.env:remove_node( apos ) + end +end + +-------------------------------------------------------------------------------- + +minetest.register_on_placenode( on_door_placed ) +minetest.register_on_punchnode( on_door_punched ) +minetest.register_on_dignode( on_door_digged ) + +-------------------------------------------------------------------------------- + diff --git a/new_api/doors/textures/door_wood.png b/new_api/doors/textures/door_wood.png new file mode 100644 index 0000000..120fc98 Binary files /dev/null and b/new_api/doors/textures/door_wood.png differ diff --git a/new_api/doors/textures/door_wood_a.png b/new_api/doors/textures/door_wood_a.png new file mode 100644 index 0000000..1617b65 Binary files /dev/null and b/new_api/doors/textures/door_wood_a.png differ diff --git a/new_api/doors/textures/door_wood_a_r.png b/new_api/doors/textures/door_wood_a_r.png new file mode 100644 index 0000000..9315b75 Binary files /dev/null and b/new_api/doors/textures/door_wood_a_r.png differ diff --git a/new_api/doors/textures/door_wood_b.png b/new_api/doors/textures/door_wood_b.png new file mode 100644 index 0000000..80d4315 Binary files /dev/null and b/new_api/doors/textures/door_wood_b.png differ diff --git a/new_api/doors/textures/door_wood_b_r.png b/new_api/doors/textures/door_wood_b_r.png new file mode 100644 index 0000000..9c53aa4 Binary files /dev/null and b/new_api/doors/textures/door_wood_b_r.png differ diff --git a/new_api/give_initial_stuff/init.lua b/new_api/give_initial_stuff/init.lua index fef23c3..9cf6b51 100644 --- a/new_api/give_initial_stuff/init.lua +++ b/new_api/give_initial_stuff/init.lua @@ -1,15 +1,12 @@ minetest.register_on_newplayer(function(player) - print("[minimal] giving initial stuff to player") - player:get_inventory():add_item('main', 'default:pick_stone') - player:get_inventory():add_item('main', 'default:torch 99') - player:get_inventory():add_item('main', 'default:cobble 99') - player:get_inventory():add_item('main', 'default:wood 99') - player:get_inventory():add_item('main', 'default:axe_steel') - player:get_inventory():add_item('main', 'default:shovel_steel') - player:get_inventory():add_item('main', 'default:pick_wood') - player:get_inventory():add_item('main', 'default:pick_steel') - player:get_inventory():add_item('main', 'default:pick_mese') - player:get_inventory():add_item('main', 'default:mese 99') - player:get_inventory():add_item('main', 'default:water_source 99') + print("on_newplayer") + if minetest.setting_getbool("give_initial_stuff") then + print("giving give_initial_stuff to player") + player:get_inventory():add_item('main', 'default:pick_steel') + player:get_inventory():add_item('main', 'default:torch 99') + player:get_inventory():add_item('main', 'default:axe_steel') + player:get_inventory():add_item('main', 'default:shovel_steel') + player:get_inventory():add_item('main', 'default:cobble 99') + end end)