add setting to disable craftitems

master
JamesTobin 2022-05-08 19:55:46 -04:00
parent d758c2957d
commit d25117430a
2 changed files with 24 additions and 22 deletions

View File

@ -1,15 +1,16 @@
-- wing
minetest.register_craftitem("pa28:wings",{
description = "PA28 wings",
inventory_image = "pa28_wings.png",
})
if not minetest.settings:get_bool('pa28.disable_craftitems') then
-- wing
minetest.register_craftitem("pa28:wings",{
description = "PA28 wings",
inventory_image = "pa28_wings.png",
})
-- fuselage
minetest.register_craftitem("pa28:fuselage",{
description = "PA28 fuselage",
inventory_image = "pa28_fuselage.png",
})
minetest.register_craftitem("pa28:fuselage",{
description = "PA28 fuselage",
inventory_image = "pa28_fuselage.png",
})
end
-- pa28
minetest.register_craftitem("pa28:pa28", {
description = pa28.plane_text,
@ -44,7 +45,7 @@ minetest.register_craftitem("pa28:pa28", {
-- crafting
--
if minetest.get_modpath("default") then
if not minetest.settings:get_bool('pa28.disable_craftitems') and minetest.get_modpath("default") then
minetest.register_craft({
output = "pa28:wings",
recipe = {

View File

@ -228,20 +228,21 @@ function pa28.destroy(self)
airutils.destroy_inventory(self)
self.object:remove()
if not minetest.settings:get_bool('pa28.disable_craftitems') then
pos.y=pos.y+2
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'pa28:wings')
pos.y=pos.y+2
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'pa28:wings')
for i=1,2 do
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:tin_ingot')
end
for i=1,2 do
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:tin_ingot')
for i=1,6 do
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:mese_crystal')
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:diamond')
end
else
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'pa28:pa28')
end
for i=1,6 do
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:mese_crystal')
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'default:diamond')
end
--minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'hidroplane:hidro')
end
function pa28.testDamage(self, velocity, position)