From 479357ed077720c21cf970639d7d6fd38165d49a Mon Sep 17 00:00:00 2001 From: "Tai @ Flex" Date: Wed, 18 Jan 2017 15:36:28 +0000 Subject: [PATCH] make leather backpack conditional on mobs --- init.lua | 86 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/init.lua b/init.lua index da79187..9f7e94c 100644 --- a/init.lua +++ b/init.lua @@ -103,46 +103,48 @@ minetest.register_craft({ } }) --- 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}, +if 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 = { + {"mobs:leather", "mobs:leather", "mobs:leather"}, + {"mobs:leather", "", "mobs:leather"}, + {"mobs:leather", "mobs:leather", "mobs:leather"}, } - }, - 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 = { - {"mobs:leather", "mobs:leather", "mobs:leather"}, - {"mobs:leather", "", "mobs:leather"}, - {"mobs:leather", "mobs:leather", "mobs:leather"}, - } -}) + }) +end