diff --git a/games/default/files/default/aliases.lua b/games/default/files/default/aliases.lua index 9df324a38..aa781a8c9 100644 --- a/games/default/files/default/aliases.lua +++ b/games/default/files/default/aliases.lua @@ -90,3 +90,21 @@ minetest.register_alias("default:ladder", "default:ladder_wood") -- Ladder minetest.register_alias("default:reeds", "default:sugarcane") minetest.register_alias("default:papyrus", "default:sugarcane") + +-- Fences +minetest.register_alias("fences:fence_wood", "default:fence_wood") +minetest.register_alias("fences:fence_wood_1", "default:fence_wood") +minetest.register_alias("fences:fence_wood_2", "default:fence_wood") +minetest.register_alias("fences:fence_wood_3", "default:fence_wood") +minetest.register_alias("fences:fence_wood_11", "default:fence_wood") +minetest.register_alias("fences:fence_wood_12", "default:fence_wood") +minetest.register_alias("fences:fence_wood_13", "default:fence_wood") +minetest.register_alias("fences:fence_wood_14", "default:fence_wood") +minetest.register_alias("fences:fence_wood_21", "default:fence_wood") +minetest.register_alias("fences:fence_wood_22", "default:fence_wood") +minetest.register_alias("fences:fence_wood_23", "default:fence_wood") +minetest.register_alias("fences:fence_wood_24", "default:fence_wood") +minetest.register_alias("fences:fence_wood_32", "default:fence_wood") +minetest.register_alias("fences:fence_wood_33", "default:fence_wood") +minetest.register_alias("fences:fence_wood_34", "default:fence_wood") +minetest.register_alias("fences:fence_wood_35", "default:fence_wood") diff --git a/games/default/files/default/functions.lua b/games/default/files/default/functions.lua index dd18dbc4d..afa9c0350 100644 --- a/games/default/files/default/functions.lua +++ b/games/default/files/default/functions.lua @@ -295,8 +295,8 @@ function default.register_fence(name, def) } }) - local fence_texture = "default_fence_overlay.png^" .. def.texture .. - "^default_fence_overlay.png^[makealpha:255,126,126" +-- 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", @@ -304,85 +304,18 @@ function default.register_fence(name, def) 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}}, + connect_front = {{-1/16,4/16,-1/2,1/16,7/16,-1/8}, + {-1/16,-2/16,-1/2,1/16,1/16,-1/8}}, + connect_left = {{-1/2,4/16,-1/16,-1/8,7/16,1/16}, + {-1/2,-2/16,-1/16,-1/8,1/16,1/16}}, + connect_back = {{-1/16,4/16,1/8,1/16,7/16,1/2}, + {-1/16,-2/16,1/8,1/16,1/16,1/2}}, + connect_right = {{1/8,4/16,-1/16,1/2,7/16,1/16}, + {1/8,-2/16,-1/16,1/2,1/16,1/16}}, }, connects_to = {"group:fence", "group:wood", "group:tree", "group:wall"}, - 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 def[k] == nil 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 - - --- --- Fence rail registration helper --- - -function default.register_fence_rail(name, def) - minetest.register_craft({ - output = name .. " 16", - recipe = { - { def.material, def.material }, - { "", ""}, - { def.material, def.material }, - } - }) - - local fence_rail_texture = "default_fence_rail_overlay.png^" .. def.texture .. - "^default_fence_rail_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/16, 3/16, -1/16, 1/16, 5/16, 1/16}, - {-1/16, -3/16, -1/16, 1/16, -5/16, 1/16} - }, - -- connect_top = - -- connect_bottom = - connect_front = { - {-1/16, 3/16, -1/2, 1/16, 5/16, -1/16}, - {-1/16, -5/16, -1/2, 1/16, -3/16, -1/16}}, - connect_left = { - {-1/2, 3/16, -1/16, -1/16, 5/16, 1/16}, - {-1/2, -5/16, -1/16, -1/16, -3/16, 1/16}}, - connect_back = { - {-1/16, 3/16, 1/16, 1/16, 5/16, 1/2}, - {-1/16, -5/16, 1/16, 1/16, -3/16, 1/2}}, - connect_right = { - {1/16, 3/16, -1/16, 1/2, 5/16, 1/16}, - {1/16, -5/16, -1/16, 1/2, -3/16, 1/16}}, - }, - connects_to = {"group:fence", "group:wall"}, - inventory_image = fence_rail_texture, - wield_image = fence_rail_texture, + -- inventory_image = fence_texture, + -- wield_image = fence_texture, tiles = {def.texture}, sunlight_propagates = true, is_ground_content = false, diff --git a/games/default/files/default/nodes.lua b/games/default/files/default/nodes.lua index 8665a58dd..ab11094ae 100644 --- a/games/default/files/default/nodes.lua +++ b/games/default/files/default/nodes.lua @@ -1191,7 +1191,7 @@ minetest.register_node("default:lava_source", { groups = {lava = 3, liquid = 2, igniter = 1, not_in_creative_inventory = 1}, on_construct = function(pos) if minetest.is_singleplayer() ~= true then - if pos.y >= 1 then + if pos.y >= 1 then minetest.env:remove_node(pos) end end @@ -1367,6 +1367,17 @@ minetest.register_node("default:ladder_wood", { sounds = default.node_sound_wood_defaults(), }) + +default.register_fence("default:fence_wood", { + description = "Apple Wood Fence", + texture = "default_wood.png", + inventory_image = "default_wood_fence.png", + material = "default:wood", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + sounds = default.node_sound_wood_defaults() +}) + + minetest.register_node("default:vine", { description = "Vine", drawtype = "signlike", diff --git a/games/default/files/fences/textures/fences_fence.png b/games/default/files/default/textures/default_wood_fence.png similarity index 100% rename from games/default/files/fences/textures/fences_fence.png rename to games/default/files/default/textures/default_wood_fence.png diff --git a/games/default/files/fences/textures/fences_fencegate.png b/games/default/files/default/textures/default_wood_fencegate.png similarity index 100% rename from games/default/files/fences/textures/fences_fencegate.png rename to games/default/files/default/textures/default_wood_fencegate.png diff --git a/games/default/files/doors/README.txt b/games/default/files/doors/README.txt index acc38b859..db40dbcbc 100644 --- a/games/default/files/doors/README.txt +++ b/games/default/files/doors/README.txt @@ -1,11 +1,11 @@ -multicraft 0.4 mod: doors +MultiCraft Game mod: doors ======================= -version: 1.2.2 License of source code: ----------------------- Copyright (C) 2012 PilzAdam -modified by BlockMen (added sounds, glassdoor, trapdoor) +modified by BlockMen (added sounds, glassdoors, trapdoor) +Copyright (C) 2016 sofar@foo-projects.org This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it @@ -14,9 +14,14 @@ To Public License, Version 2, as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more details. -License of sounds --------------------------------------- +Authors of media (sounds) +------------------------- Opening-Sound created by CGEffex (CC BY 3.0), modified by BlockMen door_open.ogg Closing-Sound created by bennstir (CC BY 3.0) door_close.ogg +fencegate_open.ogg: + http://www.freesound.org/people/mhtaylor67/sounds/126041/ - (CC0 1.0) +fencegate_close.ogg: + http://www.freesound.org/people/BarkersPinhead/sounds/274807/ - (CC-BY-3.0) + http://www.freesound.org/people/rivernile7/sounds/249573/ - (CC-BY-3.0) diff --git a/games/default/files/doors/init.lua b/games/default/files/doors/init.lua index a9cbc689b..94392573a 100644 --- a/games/default/files/doors/init.lua +++ b/games/default/files/doors/init.lua @@ -619,4 +619,126 @@ minetest.register_craft({ {'group:iron', 'group:iron', ''}, {'', '', ''}, } -}) \ No newline at end of file +}) + + +---- Fence Gate ---- + +function doors.register_fencegate(name, def) + local fence = { + description = def.description, + drawtype = "nodebox", + tiles = {}, + inventory_image = def.inventory_image, + wield_image = def.wield_image, + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + is_ground_content = false, + drop = name .. "_closed", + connect_sides = {"left", "right"}, + groups = def.groups, + sounds = def.sounds, + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + local node_def = minetest.registered_nodes[node.name] + minetest.swap_node(pos, {name = node_def.gate, param2 = node.param2}) + minetest.sound_play(node_def.sound, {pos = pos, gain = 0.3, + max_hear_distance = 8}) + return itemstack + end, + } + + + if type(def.texture) == "string" then + fence.tiles[1] = {name = def.texture, backface_culling = true} + elseif def.texture.backface_culling == nil then + fence.tiles[1] = table.copy(def.texture) + fence.tiles[1].backface_culling = true + else + fence.tiles[1] = def.texture + end + + if not fence.sounds then + fence.sounds = default.node_sound_wood_defaults() + end + + fence.groups.fence = 1 + + local fence_closed = table.copy(fence) + fence_closed.node_box = { + type = "fixed", + fixed = { + {-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/16}, -- Left completion + {1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, -- Right completion + {-2/16, -1/2+6/16, -1/16, 0, 1/2-1/16, 1/16}, -- Center Left + {0, -1/2+6/16, -1/16, 2/16, 1/2-1/16, 1/16}, -- Center Right + {-2/16, 1/2-4/16, 1/16, -1/2, 1/2-1/16, -1/16}, -- Above (cross) -z + {-2/16, -1/2+6/16, 1/16, -1/2, -1/2+9/16, -1/16}, -- Bottom (cross) -z + {2/16, 1/2-4/16, -1/16, 1/2, 1/2-1/16, 1/16}, -- Above (transverse) z + {2/16, -1/2+6/16, -1/16, 1/2, -1/2+9/16, 1/16}, -- Below (across) z + {-2/16, 1/2, -2/16, -2/16, 1/2+8/16, -2/16}, + {-2/16, 1/2, 2/16, -2/16, 1/2+8/16, 2/16}, + {2/16, 1/2, -2/16, 2/16, 1/2+8/16, -2/16}, + {2/16, 1/2, 2/16, 2/16, 1/2+8/16, 2/16}, + {-6/16, 1/2-1/16, 1/16, -6/16, 1/2+8/16, 1/16}, -- Top block (cross) -x 1 side + {-6/16, 1/2-1/16, -1/16, -6/16, 1/2+8/16, -1/16}, -- Top block (cross) -x 2 side + {5/16, 1/2-1/16, 1/16, 5/16, 1/2+8/16, 1/16}, -- Top block (cross) x 1 side + {5/16, 1/2-1/16, -1/16, 5/16, 1/2+8/16, -1/16}, -- Top block (cross) x 2 side + } + } + fence_closed.gate = name .. "_open" + fence_closed.sound = "doors_fencegate_open" + fence_closed.selection_box = { + type = "fixed", + fixed = { + {-1/2, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, -- Gate + } + } + local fence_open = table.copy(fence) + fence_open.node_box = { + type = "fixed", + fixed = { + {-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/16}, -- Left completion + {1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, -- Right completion + {-1/2, 1/2-4/16, 1/16, -1/2+2/16, 1/2-1/16, 1/2-2/16}, -- Top-left (transverse) x + {-1/2, -1/2+6/16, 1/16, -1/2+2/16, -1/2+9/16, 1/2-2/16}, -- Bottom-left (transverse) x + {1/2-2/16, 1/2-4/16, 1/16, 1/2, 1/2-1/16, 1/2}, -- Top-right (transverse) x + {1/2-2/16, -1/2+6/16, 1/16, 1/2, -1/2+9/16, 1/2}, -- Bottom-right (transverse) x + {-1/2, -1/2+6/16, 6/16, -1/2+2/16, 1/2-1/16, 1/2}, -- Center Left + {1/2-2/16, 1/2-4/16, 1/2, 1/2, -1/2+9/16, 6/16}, -- Center Right + }, + } + fence_open.gate = name .. "_closed" + fence_open.sound = "doors_fencegate_close" + fence_open.groups.not_in_creative_inventory = 1 + fence_open.selection_box = { + type = "fixed", + fixed = { + {-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/2}, -- Left + {1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/2}, -- Right + } + } + + minetest.register_node(":" .. name .. "_closed", fence_closed) + minetest.register_node(":" .. name .. "_open", fence_open) + + minetest.register_craft({ + output = name .. "_closed", + recipe = { + {"group:stick", def.material, "group:stick"}, + {"group:stick", def.material, "group:stick"} + } + }) +end + +doors.register_fencegate("doors:gate_wood", { + description = "Apple Wood Fence Gate", + texture = "default_wood.png", + inventory_image = "default_wood_fencegate.png", + wield_image = "default_wood_fencegate.png", + material = "default:wood", + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} +}) + +minetest.register_alias("fences:fencegate_open", "doors:gate_wood") +minetest.register_alias("fences:fencegate", "doors:gate_wood_closed") diff --git a/games/default/files/doors/sounds/doors_fencegate_close.ogg b/games/default/files/doors/sounds/doors_fencegate_close.ogg new file mode 100644 index 000000000..d42590ffb Binary files /dev/null and b/games/default/files/doors/sounds/doors_fencegate_close.ogg differ diff --git a/games/default/files/doors/sounds/doors_fencegate_open.ogg b/games/default/files/doors/sounds/doors_fencegate_open.ogg new file mode 100644 index 000000000..f6dfd1d97 Binary files /dev/null and b/games/default/files/doors/sounds/doors_fencegate_open.ogg differ diff --git a/games/default/files/fences/README.txt b/games/default/files/fences/README.txt deleted file mode 100644 index 0e93b97d6..000000000 --- a/games/default/files/fences/README.txt +++ /dev/null @@ -1,27 +0,0 @@ -multicraft mod "Fences" -======================= -version: 1.0 - -License of source code and textures: ------------------------------------- -Written 2013 by BlockMen - -This program is free software. It comes without any warranty, to -the extent permitted by applicable law. You can redistribute it -and/or modify it under the terms of the Do What The Fuck You Want -To Public License, Version 2, as published by Sam Hocevar. See -http://sam.zoy.org/wtfpl/COPYING for more details. - - - - - ---USING the mod-- - -This mod "overrides" the recipe for the default fence, so if you want craft a fance, it crafts THIS fence. - -If you want replace already placed default fences open the "init.lua" (in this directory) and change -the first line to "local override_original = true". Then all placed default fences will be replaced with -this fence. - -It is not possible to jump over the Fence or the closed Fencegate. Only exception is when you "sneak" and "jump". \ No newline at end of file diff --git a/games/default/files/fences/depends.txt b/games/default/files/fences/depends.txt deleted file mode 100644 index 4ad96d515..000000000 --- a/games/default/files/fences/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default diff --git a/games/default/files/fences/init.lua b/games/default/files/fences/init.lua deleted file mode 100644 index 1410fdb4a..000000000 --- a/games/default/files/fences/init.lua +++ /dev/null @@ -1,702 +0,0 @@ -local function dockable(nodename) - if nodename == "default:wood" or string.find(nodename, "wallet:wall") or nodename == "default:brick" or nodename == "default:cobble" or nodename == "default:dirt" or nodename == "default:sandstone" or nodename == "default:stone" or string.find(nodename, "fences:fence_wood") or string.find(nodename, "fences:fencegate") then - return true - end -end - - -local function find_dock(pos, second) - if pos == nil then - return false - end - - local h1 = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z}) - local v1 = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z}) - local r1 = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) - local l1 = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) - local code = 0 - if dockable(l1.name) then - code = code+1 - if second < 2 then - minetest.punch_node({x=pos.x, y=pos.y, z=pos.z-1}) - end - end - if dockable(r1.name) then - code = code+2 - if second < 2 then - minetest.punch_node({x=pos.x, y=pos.y, z=pos.z+1}) - end - end - if dockable(v1.name) then - code = code+11 - if second < 2 then - minetest.punch_node({x=pos.x-1, y=pos.y, z=pos.z}) - end - end - if dockable(h1.name) then - code = code+21 - if second < 2 then - minetest.punch_node({x=pos.x+1, y=pos.y, z=pos.z}) - end - end - local me = minetest.get_node(pos) - if code > 0 then - local tmp_name = "fences:fence_wood_"..code - local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} - if second > 0 then - local tmp_node = {name=tmp_name, param1=me.param1, param2=me.param2} - minetest.set_node(pos, tmp_node) - end - elseif code == 0 then - if second == 2 then - local tmp_node = {name="fences:fence_wood", param1=me.param1, param2=me.param2} - minetest.set_node(pos, tmp_node) - end - end - -end - -local function punch(pos, puncher) - if not puncher ~= '' then - find_dock(pos, 2) - elseif not puncher:is_player() then - find_dock(pos, 2) - end -end - - -local p0 = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16} -local p1 = {-2/16, 1/2, -2/16, -2/16, 1/2+8/16, -2/16} -local p2 = {-2/16, 1/2, 2/16, -2/16, 1/2+8/16, 2/16} -local p4 = {2/16, 1/2, -2/16, 2/16, 1/2+8/16, -2/16} -local p5 = {2/16, 1/2, 2/16, 2/16, 1/2+8/16, 2/16} - -local x1 = {-2/16, 1/2-4/16, 1/16, -1/2, 1/2-1/16, -1/16} --oben(quer) -x -local x12 = {-2/16, -1/2+6/16, 1/16, -1/2, -1/2+9/16, -1/16} --unten(quer) -x -local x2 = {2/16, 1/2-4/16, -1/16, 1/2, 1/2-1/16, 1/16} --oben(quer) x -local x22 = {2/16, -1/2+6/16, -1/16, 1/2, -1/2+9/16, 1/16} --unten(quer) x -local z1 = {1/16, 1/2-4/16, -2/16, -1/16, 1/2-1/16, -1/2} --oben(quer) -z -local z12 = {1/16, -1/2+6/16, -2/16, -1/16, -1/2+9/16, -1/2} --unten(quer) -z -local z2 = {-1/16, 1/2-4/16, 2/16, 1/16, 1/2-1/16, 1/2} --oben(quer) z -local z22 = {-1/16, -1/2+6/16, 2/16, 1/16, -1/2+9/16, 1/2} --unten(quer) z - -local bz1 = {1/16, 1/2-1/16, -6/16, 1/16, 1/2+8/16, -6/16} --oben_block(quer) -z 1seite -local bz11 = {-1/16, 1/2-1/16, -6/16, -1/16, 1/2+8/16, -6/16} --oben_block(quer) -z 2seite -local bz2 = {1/16, 1/2-1/16, 5/16, 1/16, 1/2+8/16, 5/16} --oben_block(quer) z 1seite -local bz21 = {-1/16, 1/2-1/16, 5/16, -1/16, 1/2+8/16, 5/16} --oben_block(quer) z 2seite - -local bx1 = {-6/16, 1/2-1/16, 1/16, -6/16, 1/2+8/16, 1/16} --oben_block(quer) -x 1seite -local bx11 = {-6/16, 1/2-1/16, -1/16, -6/16, 1/2+8/16, -1/16} --oben_block(quer) -x 2seite -local bx2 = {5/16, 1/2-1/16, 1/16, 5/16, 1/2+8/16, 1/16} --oben_block(quer) x 1seite -local bx21 = {5/16, 1/2-1/16, -1/16, 5/16, 1/2+8/16, -1/16} --oben_block(quer) x 2seite - - -minetest.register_node("fences:fence_wood", { - description = "Wooden Fence", - tiles = {"default_wood.png"}, - inventory_image = "fences_fence.png", - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences = 1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = {p0,p1,p2,p4,p5,} - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_construct = function(pos) - find_dock(pos, 1) - end, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - - - ---different fence types- (1=left,2=right,3=top,4=bottom) - -minetest.register_node("fences:fence_wood_1", { - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z1,z12, - bz1,bz11, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_2", { - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z2,z22, - bz2,bz21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_3", { --left+right(3) - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z1,z12,z2,z22, - bz1,bz11,bz2,bz21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_11", { --top - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - x1,x12, - bx1,bx11, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_21", { --bottom - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - x2,x22, - bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - - -minetest.register_node("fences:fence_wood_32", { --top+bottom(32) - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - x1,x12,x2,x22, - bx1,bx11,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_14", { --left+right(3)+ top(11) =14 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z1,z12,z2,z22,x1,x12, - bz1,bz11,bz2,bz21,bx1,bx11, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_24", { --left+right(3)+ bottom(21) =24 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z1,z12,z2,z22,x2,x22, - bz1,bz11,bz2,bz21,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_35", { --left+right(3)+top+bottom(32) = 35 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - x1,x12,x2,x22,z1,z12,z2,z22, - bz1,bz11,bz2,bz21,bx1,bx11,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_12", { --left(1)+top(11)=12 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z1,z12,x1,x12, - bz1,bz11,bx1,bx11, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_22", { --left(1)+bottom(21)=22 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z1,z12,x2,x22, - bz1,bz11,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_33", { --left(1)+top+bottom(32)=33 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2,fences=1,not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z1,z12,x1,x12,x2, - bz1,bz11,bx1,bx11,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_34", { --right(2)+top+bottom(32)=34 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z2,z22,x1,x12,x2,x22, - bz2,bz21,bx1,bx11,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_23", { --right(2)+bottom(21)=23 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z2,z22,x2,x22, - bz2,bz21,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fence_wood_13", { --right(2)+top(11)=13 - tiles = {"default_wood.png"}, - paramtype = "light", - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1}, - drop = 'fences:fence_wood', - sunlight_propagates = true, - sounds = default.node_sound_wood_defaults(), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - p0,p1,p2,p4,p5, - z2,z22,x1,x12, - bz1,bz11,bx1,bx11, - } - }, - selection_box = { - type = "fixed", - fixed = {-2/16, -1/2, -2/16, 2/16, 1/2, 2/16}, - }, - on_punch = function(pos, puncher) - punch(pos, puncher) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - - -minetest.register_craft({ - output = 'fences:fence_wood 2', - recipe = { - {'default:stick', 'default:stick', 'default:stick'}, - {'default:stick', 'default:stick', 'default:stick'}, - } -}) - -minetest.register_craft({ - output = 'fences:fencegate', - recipe = { - {'default:stick', 'default:wood', 'default:stick'}, - {'default:stick', 'default:wood', 'default:stick'}, - } -}) - - - - -local meta2 -local state2 = 0 - -local function update_gate(pos, node) - minetest.set_node(pos, node) -end - -local function punch_gate(pos, node) - meta2 = minetest.get_meta(pos) - state2 = meta2:get_int("state") - local tmp_node2 - if state2 == 1 then - state2 = 0 - minetest.sound_play("doors_door_close", {pos = pos, gain = 0.3, max_hear_distance = 10}) - tmp_node2 = {name="fences:fencegate", param1=node.param1, param2=node.param2} - else - state2 = 1 - minetest.sound_play("doors_door_open", {pos = pos, gain = 0.3, max_hear_distance = 10}) - tmp_node2 = {name="fences:fencegate_open", param1=node.param1, param2=node.param2} - end - update_gate(pos, tmp_node2) - meta2:set_int("state", state2) -end - -minetest.register_node("fences:fencegate_open", { - tiles = {"default_wood.png"}, - paramtype = "light", - paramtype2 = "facedir", - sunlight_propagates = true, - walkable = true, - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, fences=1, not_in_inventory=1, mesecon_effector_on=1}, - drop = 'fences:fencegate', - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/16}, --links abschluss - {1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, --rechts abschluss - {-1/2, 1/2-4/16, 1/16, -1/2+2/16, 1/2-1/16, 1/2-2/16}, --oben-links(quer) x - {-1/2, -1/2+6/16, 1/16, -1/2+2/16, -1/2+9/16, 1/2-2/16}, --unten-links(quer) x - {1/2-2/16, 1/2-4/16, 1/16, 1/2, 1/2-1/16, 1/2}, --oben-rechts(quer) x - {1/2-2/16, -1/2+6/16, 1/16, 1/2, -1/2+9/16, 1/2}, --unten-rechts(quer) x - {-1/2, -1/2+6/16, 6/16, -1/2+2/16, 1/2-1/16, 1/2}, --mitte links - {1/2-2/16, 1/2-4/16, 1/2, 1/2, -1/2+9/16, 6/16}, --mitte rechts - } - }, - selection_box = { - type = "fixed", - fixed = { - {-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/2}, --links - {1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/2}, --rechts - } - }, - --on_punch = function(pos, node, puncher) - on_rightclick = function(pos, node, clicker) - punch_gate(pos, node) - end, - mesecons = {effector = { - action_on = (function(pos, node) - punch_gate(pos, node) - end), - }}, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_node("fences:fencegate", { - description = "Wooden Fancegate", - tiles = {"default_wood.png"}, - inventory_image = "fences_fencegate.png", - wield_image = "fences_fencegate.png", - paramtype = "light", - stack_max = 16, - paramtype2 = "facedir", - sunlight_propagates = true, - walkable = true, - groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, mesecon_effector_on = 1, fences = 1}, - drop = 'fences:fencegate', - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = { - {-1/2, -1/2+5/16, -1/16, -1/2+2/16, 1/2, 1/16}, --links abschluss - {1/2-2/16, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, --rechts abschluss - {-2/16, -1/2+6/16, -1/16, 0, 1/2-1/16, 1/16}, --mitte links - {0, -1/2+6/16, -1/16, 2/16, 1/2-1/16, 1/16}, --mitte rechts - {-2/16, 1/2-4/16, 1/16, -1/2, 1/2-1/16, -1/16}, --oben(quer) -z - {-2/16, -1/2+6/16, 1/16, -1/2, -1/2+9/16, -1/16}, --unten(quer) -z - {2/16, 1/2-4/16, -1/16, 1/2, 1/2-1/16, 1/16}, --oben(quer) z - {2/16, -1/2+6/16, -1/16, 1/2, -1/2+9/16, 1/16}, --unten(quer) z - p1,p2,p4,p5, - bx1,bx11,bx2,bx21, - } - }, - selection_box = { - type = "fixed", - fixed = { - {-1/2, -1/2+5/16, -1/16, 1/2, 1/2, 1/16}, --gate - } - }, - on_construct = function(pos) - local me2 = minetest.get_node(pos) - meta2 = minetest.get_meta(pos) - meta2:set_int("state", 0) - state2 = 0 - find_dock(pos, -1) - end, - mesecons = {effector = { - action_on = (function(pos, node) - punch_gate(pos, node) - end), - }}, - on_rightclick = function(pos, node, clicker) - punch_gate(pos, node) - end, - after_dig_node = function(pos, oldnode, oldmetadata, digger) - find_dock(pos, -1) - end -}) - -minetest.register_craft({ - output = 'fences:fence_wood 2', - recipe = { - {'default:stick', 'default:stick', 'default:stick'}, - {'default:stick', 'default:stick', 'default:stick'}, - } -}) - -minetest.register_craft({ - type = "fuel", - recipe = "fences:fence_wood", - burntime = 15, -}) - -minetest.register_alias("default:fence_wood", "fences:fence_wood") diff --git a/games/default/files/mobs_animal/bunny.lua b/games/default/files/mobs_animal/bunny.lua index b0207e7a4..70f3b35fb 100644 --- a/games/default/files/mobs_animal/bunny.lua +++ b/games/default/files/mobs_animal/bunny.lua @@ -25,7 +25,8 @@ mobs:register_mob("mobs_animal:bunny", { jump = true, jump_height = 5, drops = { - {name = "mobs:meat_raw", chance = 1, min = 1, max = 1}, + {name = "mobs:rabbit_raw", chance = 1, min = 1, max = 1}, + {name = "mobs:rabbit_hide", chance = 1, min = 0, max = 1}, }, water_damage = 1, lava_damage = 4, diff --git a/games/default/files/mobs_animal/cow.lua b/games/default/files/mobs_animal/cow.lua index 6957bd2c9..d5f4f4bb8 100644 --- a/games/default/files/mobs_animal/cow.lua +++ b/games/default/files/mobs_animal/cow.lua @@ -115,16 +115,16 @@ mobs:register_mob("mobs_animal:cow", { end end, - after_activate = function(self, staticdata, def, dtime) - -- replace cow using the old directx model - if self.mesh == "mobs_cow.x" then - local pos = self.object:get_pos() - if pos then - minetest.add_entity(pos, self.name) - self.object:remove() - end + after_activate = function(self, staticdata, def, dtime) + -- replace cow using the old directx model + if self.mesh == "mobs_cow.x" then + local pos = self.object:get_pos() + if pos then + minetest.add_entity(pos, self.name) + self.object:remove() end - end, + end + end, }) mobs:spawn({ diff --git a/games/default/files/mobs_redo/crafts.lua b/games/default/files/mobs_redo/crafts.lua index 8d82b8528..890c48384 100644 --- a/games/default/files/mobs_redo/crafts.lua +++ b/games/default/files/mobs_redo/crafts.lua @@ -65,6 +65,51 @@ minetest.register_craft({ cooktime = 5, }) +-- raw rabbit +minetest.register_craftitem("mobs:rabbit_raw", { + description = "Raw Rabbit", + inventory_image = "mobs_rabbit_raw.png", + on_use = minetest.item_eat(3), + groups = {food_meat_raw = 1, food_rabbit_raw = 1, flammable = 2}, +}) + +-- cooked rabbit +minetest.register_craftitem("mobs:rabbit_cooked", { + description = "Cooked Rabbit", + inventory_image = "mobs_rabbit_cooked.png", + on_use = minetest.item_eat(5), + groups = {food_meat = 1, food_rabbit = 1, flammable = 2}, +}) + +minetest.register_craft({ + type = "cooking", + output = "mobs:rabbit_cooked", + recipe = "mobs:rabbit_raw", + cooktime = 5, +}) + +-- rabbit hide +minetest.register_craftitem("mobs:rabbit_hide", { + description = "Rabbit Hide", + inventory_image = "mobs_rabbit_hide.png", + groups = {flammable = 2}, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "mobs:rabbit_hide", + burntime = 2, +}) + +minetest.register_craft({ + output = "mobs:leather", + type = "shapeless", + recipe = { + "mobs:rabbit_hide", "mobs:rabbit_hide", + "mobs:rabbit_hide", "mobs:rabbit_hide" + } +}) + minetest.register_alias("mobs:magic_lasso", "farming:string") minetest.register_alias("mobs:lasso", "farming:string") diff --git a/games/default/files/mobs_redo/textures/mobs_nametag.png b/games/default/files/mobs_redo/textures/mobs_nametag.png index eb61d8f63..cfe2e9765 100644 Binary files a/games/default/files/mobs_redo/textures/mobs_nametag.png and b/games/default/files/mobs_redo/textures/mobs_nametag.png differ diff --git a/games/default/files/mobs_redo/textures/mobs_protector.png b/games/default/files/mobs_redo/textures/mobs_protector.png index 5888da006..ab2302906 100644 Binary files a/games/default/files/mobs_redo/textures/mobs_protector.png and b/games/default/files/mobs_redo/textures/mobs_protector.png differ diff --git a/games/default/files/mobs_redo/textures/mobs_rabbit_cooked.png b/games/default/files/mobs_redo/textures/mobs_rabbit_cooked.png new file mode 100644 index 000000000..b9e947eaa Binary files /dev/null and b/games/default/files/mobs_redo/textures/mobs_rabbit_cooked.png differ diff --git a/games/default/files/mobs_redo/textures/mobs_rabbit_hide.png b/games/default/files/mobs_redo/textures/mobs_rabbit_hide.png new file mode 100644 index 000000000..36df959df Binary files /dev/null and b/games/default/files/mobs_redo/textures/mobs_rabbit_hide.png differ diff --git a/games/default/files/mobs_redo/textures/mobs_rabbit_raw.png b/games/default/files/mobs_redo/textures/mobs_rabbit_raw.png new file mode 100644 index 000000000..da14e9153 Binary files /dev/null and b/games/default/files/mobs_redo/textures/mobs_rabbit_raw.png differ