2020-07-15 22:24:51 +02:00
|
|
|
--------------------------
|
|
|
|
-- Advanced Lightsabers --
|
|
|
|
--------------------------
|
|
|
|
------- Ver 1.1 ----------
|
|
|
|
|
2020-07-16 16:56:35 +02:00
|
|
|
local colors={"green","blue","yellow","purple","red","white","black"}
|
2020-07-15 22:24:51 +02:00
|
|
|
|
|
|
|
local hilts={"single","cross","double"}
|
|
|
|
|
|
|
|
minetest.register_craftitem("adv_lightsabers:lightsaber_internals", { -- Lightsaber Internals
|
|
|
|
description = "Lightsaber Internals",
|
|
|
|
inventory_image = "adv_lightsabers_lightsaber_internals.png"
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("adv_lightsabers:kyber_crystal", { -- Uncolored Lightsaber Crystal
|
|
|
|
description = "Kyber Crystal",
|
|
|
|
inventory_image = "adv_lightsabers_kyber_crystal.png",
|
|
|
|
stack_max = 1,
|
|
|
|
})
|
|
|
|
|
|
|
|
for _,color in ipairs(colors) do
|
|
|
|
for _,hilt in ipairs(hilts) do
|
|
|
|
minetest.register_craftitem("adv_lightsabers:kyber_crystal_"..color, { -- Colored Kyber Crystal
|
|
|
|
description = "Kyber Crystal",
|
|
|
|
inventory_image = "adv_lightsabers_kyber_crystal_"..color..".png"
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craftitem("adv_lightsabers:lightsaber_hilt_"..hilt, { -- Lightsaber Hilt
|
|
|
|
description = "Lightsaber Hilt",
|
|
|
|
inventory_image = "adv_lightsabers_hilt_"..hilt.."_inv.png"
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({ -- Lightsaber Crafting Recipe
|
|
|
|
output = "adv_lightsabers:lightsaber_"..hilt.."_"..color.."_off",
|
|
|
|
recipe = {
|
2020-07-15 22:27:15 +02:00
|
|
|
{"adv_lightsabers:lightsaber_hilt_"..hilt,""},
|
2020-07-15 22:24:51 +02:00
|
|
|
{"adv_lightsabers:lightsaber_internals","adv_lightsabers:kyber_crystal_"..color}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-07-16 16:56:35 +02:00
|
|
|
minetest.override_item("adv_lightsabers:kyber_crystal_black", {
|
|
|
|
description = "Dark Kyber Crystal"
|
|
|
|
})
|
|
|
|
|
2020-07-15 22:24:51 +02:00
|
|
|
minetest.register_craft({ -- Lightsaber Internals Crafting Recipe
|
|
|
|
output = "adv_lightsabers:lightsaber_internals",
|
|
|
|
recipe = {
|
|
|
|
{"default:durasteel_block","default:durasteel_ingot","default:durasteel_ingot"},
|
2020-07-16 16:19:47 +02:00
|
|
|
{"default:bronze_block","default:gold_ingot","default:durasteel_ingot"},
|
2020-07-15 22:24:51 +02:00
|
|
|
{"default:durasteel_block","default:durasteel_ingot","default:durasteel_ingot"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({ -- Lightsaber Hilt (Single) Crafting Recipe
|
|
|
|
output = "adv_lightsabers:lightsaber_hilt_single",
|
|
|
|
recipe = {
|
|
|
|
{"default:durasteel_ingot"},
|
2020-07-16 16:19:47 +02:00
|
|
|
{"default:bronze_ingot"},
|
2020-07-15 22:24:51 +02:00
|
|
|
{"default:durasteel_ingot"}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({ -- Lightsaber Hilt (Cross) Crafting Recipe
|
|
|
|
output = "adv_lightsabers:lightsaber_hilt_cross",
|
|
|
|
recipe = {
|
|
|
|
{"default:bronze_ingot","default:durasteel_ingot","default:bronze_ingot"},
|
2020-07-16 16:19:47 +02:00
|
|
|
{"","default:bronze_ingot",""},
|
2020-07-15 22:24:51 +02:00
|
|
|
{"","default:durasteel_ingot",""}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({ -- Lightsaber Hilt (Double) Crafting Recipe
|
|
|
|
output = "adv_lightsabers:lightsaber_hilt_double",
|
|
|
|
recipe = {
|
|
|
|
{"default:durasteel_block"},
|
2020-07-16 16:19:47 +02:00
|
|
|
{"default:bronze_block"},
|
2020-07-15 22:24:51 +02:00
|
|
|
{"default:durasteel_block"}
|
|
|
|
}
|
2020-07-15 22:06:57 +02:00
|
|
|
})
|