bzzirconium2/control.lua
2025-01-07 04:45:50 -08:00

25 lines
1.3 KiB
Lua

local util = require("control-util")
script.on_configuration_changed(util.ore_fix)
util.add_regenerate_command_handler()
script.on_event( defines.events.on_console_chat, function(event)
-- refresh recipes, in case of settings change
if event.message and event.message == "ZirconiumRecipes" and (not event.player_index or not game.players[event.player_index] or game.players[event.player_index].admin) then
if game.players[event.player_index].force.recipes["zirconia"] then
game.players[event.player_index].force.recipes["zirconia"].enabled=true
end
if game.players[event.player_index].force.recipes["zirconium-plate"] then
game.players[event.player_index].force.recipes["zirconium-plate"].enabled=true
end
if game.players[event.player_index].force.recipes["zircaloy-4"] then
game.players[event.player_index].force.recipes["zircaloy-4"].enabled=true
end
if game.players[event.player_index].force.recipes["cermet"] then
game.players[event.player_index].force.recipes["cermet"].enabled=true
end
if game.players[event.player_index].force.recipes["zirconium-tungstate"] then
game.players[event.player_index].force.recipes["zirconium-tungstate"].enabled=true
end
end
end)