From db586e85a1a40b948603a3f170198fb0b839c5f9 Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Thu, 9 Feb 2017 23:30:27 +0000 Subject: [PATCH] make only the recipe conditional --- init.lua | 70 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/init.lua b/init.lua index 140b0b9..ac592ef 100644 --- a/init.lua +++ b/init.lua @@ -133,42 +133,42 @@ for _,colourdesc in pairs(wooldyes) do end minetest.register_alias("backpacks:backpack_wool", "backpacks:backpack_wool_white") +-- Leather backpack +minetest.register_node("backpacks:backpack_leather", { + description = "Leather Backpack", + tiles = { + "backpacks_leather.png^backpacks_backpack_topbottom.png", -- Top + "backpacks_leather.png^backpacks_backpack_topbottom.png", -- Bottom + "backpacks_leather.png^backpacks_backpack_sides.png", -- Right Side + "backpacks_leather.png^backpacks_backpack_sides.png", -- Left Side + "backpacks_leather.png^backpacks_backpack_back.png", -- Back + "backpacks_leather.png^backpacks_backpack_front.png" -- Front + }, + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + node_box = { + type = "fixed", + fixed = { + {-0.4375, -0.5, -0.375, 0.4375, 0.5, 0.375}, + {0.125, -0.375, 0.4375, 0.375, 0.3125, 0.5}, + {-0.375, -0.375, 0.4375, -0.125, 0.3125, 0.5}, + {0.125, 0.1875, 0.375, 0.375, 0.375, 0.4375}, + {-0.375, 0.1875, 0.375, -0.125, 0.375, 0.4375}, + {0.125, -0.375, 0.375, 0.375, -0.25, 0.4375}, + {-0.375, -0.375, 0.375, -0.125, -0.25, 0.4375}, + {-0.3125, -0.375, -0.4375, 0.3125, 0.1875, -0.375}, + {-0.25, -0.3125, -0.5, 0.25, 0.125, -0.4375}, + } + }, + groups = {dig_immediate = 3, oddly_diggable_by_hand = 3}, + stack_max = 1, + on_construct = backpacks.on_construct, + after_place_node = backpacks.after_place_node, + on_dig = backpacks.on_dig, + allow_metadata_inventory_put = backpacks.allow_metadata_inventory_put, +}) if minetest.get_modpath("mobs") and mobs and mobs.redo then - -- Leather backpack - minetest.register_node("backpacks:backpack_leather", { - description = "Leather Backpack", - tiles = { - "backpacks_leather.png^backpacks_backpack_topbottom.png", -- Top - "backpacks_leather.png^backpacks_backpack_topbottom.png", -- Bottom - "backpacks_leather.png^backpacks_backpack_sides.png", -- Right Side - "backpacks_leather.png^backpacks_backpack_sides.png", -- Left Side - "backpacks_leather.png^backpacks_backpack_back.png", -- Back - "backpacks_leather.png^backpacks_backpack_front.png" -- Front - }, - drawtype = "nodebox", - paramtype = "light", - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = { - {-0.4375, -0.5, -0.375, 0.4375, 0.5, 0.375}, - {0.125, -0.375, 0.4375, 0.375, 0.3125, 0.5}, - {-0.375, -0.375, 0.4375, -0.125, 0.3125, 0.5}, - {0.125, 0.1875, 0.375, 0.375, 0.375, 0.4375}, - {-0.375, 0.1875, 0.375, -0.125, 0.375, 0.4375}, - {0.125, -0.375, 0.375, 0.375, -0.25, 0.4375}, - {-0.375, -0.375, 0.375, -0.125, -0.25, 0.4375}, - {-0.3125, -0.375, -0.4375, 0.3125, 0.1875, -0.375}, - {-0.25, -0.3125, -0.5, 0.25, 0.125, -0.4375}, - } - }, - groups = {dig_immediate = 3, oddly_diggable_by_hand = 3}, - stack_max = 1, - on_construct = backpacks.on_construct, - after_place_node = backpacks.after_place_node, - on_dig = backpacks.on_dig, - allow_metadata_inventory_put = backpacks.allow_metadata_inventory_put, - }) minetest.register_craft({ output = "backpacks:backpack_leather", recipe = {