make leather backpack conditional on mobs

master
Tai @ Flex 2017-01-18 15:36:28 +00:00
parent bbb7241605
commit 479357ed07
1 changed files with 44 additions and 42 deletions

View File

@ -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