Refactor item power storage
This commit is contained in:
parent
62246bf91b
commit
84ff508056
@ -41,75 +41,6 @@ local colors={
|
|||||||
coolant="#188676ff"
|
coolant="#188676ff"
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Power storage items
|
|
||||||
minetest.register_tool("industrialtest:re_battery",{
|
|
||||||
description=S("RE-Battery"),
|
|
||||||
inventory_image="industrialtest_re_battery.png",
|
|
||||||
_industrialtest_powerStorage=true,
|
|
||||||
_industrialtest_powerCapacity=7000,
|
|
||||||
_industrialtest_powerFlow=industrialtest.api.lvPowerFlow
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
|
||||||
type="shaped",
|
|
||||||
output="industrialtest:re_battery",
|
|
||||||
recipe={
|
|
||||||
{"","industrialtest:insulated_tin_cable",""},
|
|
||||||
{industrialtest.elementKeys.tinIngot,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.tinIngot},
|
|
||||||
{industrialtest.elementKeys.tinIngot,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.tinIngot}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("industrialtest:advanced_re_battery",{
|
|
||||||
description=S("Advanced RE-Battery"),
|
|
||||||
inventory_image="industrialtest_advanced_re_battery.png",
|
|
||||||
_industrialtest_powerStorage=true,
|
|
||||||
_industrialtest_powerCapacity=100000,
|
|
||||||
_industrialtest_powerFlow=industrialtest.api.mvPowerFlow
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
|
||||||
type="shaped",
|
|
||||||
output="industrialtest:advanced_re_battery",
|
|
||||||
recipe={
|
|
||||||
{"industrialtest:insulated_copper_cable",industrialtest.elementKeys.bronzeIngot,"industrialtest:insulated_copper_cable"},
|
|
||||||
{industrialtest.elementKeys.bronzeIngot,"industrialtest:sulfur_dust",industrialtest.elementKeys.bronzeIngot},
|
|
||||||
{industrialtest.elementKeys.bronzeIngot,"industrialtest:lead_dust",industrialtest.elementKeys.bronzeIngot}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("industrialtest:energy_crystal",{
|
|
||||||
description=S("Energy Crystal"),
|
|
||||||
inventory_image="industrialtest_energy_crystal.png",
|
|
||||||
_industrialtest_powerStorage=true,
|
|
||||||
_industrialtest_powerCapacity=100000,
|
|
||||||
_industrialtest_powerFlow=industrialtest.api.hvPowerFlow
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
|
||||||
type="shaped",
|
|
||||||
output="industrialtest:energy_crystal",
|
|
||||||
recipe={
|
|
||||||
{industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier},
|
|
||||||
{industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.diamond,industrialtest.elementKeys.powerCarrier},
|
|
||||||
{industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_tool("industrialtest:lapotron_crystal",{
|
|
||||||
description=S("Lapotron Crystal"),
|
|
||||||
inventory_image="industrialtest_lapotron_crystal.png",
|
|
||||||
_industrialtest_powerStorage=true,
|
|
||||||
_industrialtest_powerCapacity=1000000,
|
|
||||||
_industrialtest_powerFlow=industrialtest.api.evPowerFlow
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
|
||||||
type="shaped",
|
|
||||||
output="industrialtest:lapotron_crystal",
|
|
||||||
recipe={
|
|
||||||
{industrialtest.elementKeys.blueDye,"industrialtest:electronic_circuit",industrialtest.elementKeys.blueDye},
|
|
||||||
{industrialtest.elementKeys.blueDye,"industrialtest:energy_crystal",industrialtest.elementKeys.blueDye},
|
|
||||||
{industrialtest.elementKeys.blueDye,"industrialtest:electronic_circuit",industrialtest.elementKeys.blueDye}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Other resources
|
-- Other resources
|
||||||
minetest.register_craftitem("industrialtest:refined_iron_ingot",{
|
minetest.register_craftitem("industrialtest:refined_iron_ingot",{
|
||||||
description=S("Refined Iron Ingot"),
|
description=S("Refined Iron Ingot"),
|
||||||
|
1
init.lua
1
init.lua
@ -81,6 +81,7 @@ dofile(modpath.."/tools/electric_saber.lua")
|
|||||||
dofile(modpath.."/tools/jetpack.lua")
|
dofile(modpath.."/tools/jetpack.lua")
|
||||||
dofile(modpath.."/tools/mining_laser.lua")
|
dofile(modpath.."/tools/mining_laser.lua")
|
||||||
dofile(modpath.."/tools/nano_suit.lua")
|
dofile(modpath.."/tools/nano_suit.lua")
|
||||||
|
dofile(modpath.."/tools/power_storage.lua")
|
||||||
dofile(modpath.."/tools/solar_helmet.lua")
|
dofile(modpath.."/tools/solar_helmet.lua")
|
||||||
dofile(modpath.."/tools/static_boots.lua")
|
dofile(modpath.."/tools/static_boots.lua")
|
||||||
dofile(modpath.."/tools/treetap.lua")
|
dofile(modpath.."/tools/treetap.lua")
|
||||||
|
101
tools/power_storage.lua
Normal file
101
tools/power_storage.lua
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
-- IndustrialTest
|
||||||
|
-- Copyright (C) 2025 mrkubax10
|
||||||
|
|
||||||
|
-- This program is free software: you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation, either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
local S=minetest.get_translator("industrialtest")
|
||||||
|
|
||||||
|
industrialtest.REBattery=table.copy(industrialtest.ElectricItem)
|
||||||
|
industrialtest.internal.unpackTableInto(industrialtest.REBattery,{
|
||||||
|
name="industrialtest:re_battery",
|
||||||
|
description=S("RE-Battery"),
|
||||||
|
inventoryImage="industrialtest_re_battery.png",
|
||||||
|
capacity=7000,
|
||||||
|
flow=industrialtest.api.lvPowerFlow
|
||||||
|
})
|
||||||
|
|
||||||
|
industrialtest.REBattery:register()
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:re_battery",
|
||||||
|
recipe={
|
||||||
|
{"","industrialtest:insulated_tin_cable",""},
|
||||||
|
{industrialtest.elementKeys.tinIngot,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.tinIngot},
|
||||||
|
{industrialtest.elementKeys.tinIngot,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.tinIngot}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
industrialtest.AdvancedREBattery=table.copy(industrialtest.ElectricItem)
|
||||||
|
industrialtest.internal.unpackTableInto(industrialtest.AdvancedREBattery,{
|
||||||
|
name="industrialtest:advanced_re_battery",
|
||||||
|
description=S("Advanced RE-Battery"),
|
||||||
|
inventoryImage="industrialtest_advanced_re_battery.png",
|
||||||
|
capacity=100000,
|
||||||
|
flow=industrialtest.api.mvPowerFlow
|
||||||
|
})
|
||||||
|
|
||||||
|
industrialtest.AdvancedREBattery:register()
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:advanced_re_battery",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:insulated_copper_cable",industrialtest.elementKeys.bronzeIngot,"industrialtest:insulated_copper_cable"},
|
||||||
|
{industrialtest.elementKeys.bronzeIngot,"industrialtest:sulfur_dust",industrialtest.elementKeys.bronzeIngot},
|
||||||
|
{industrialtest.elementKeys.bronzeIngot,"industrialtest:lead_dust",industrialtest.elementKeys.bronzeIngot}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
industrialtest.EnergyCrystal=table.copy(industrialtest.ElectricItem)
|
||||||
|
industrialtest.internal.unpackTableInto(industrialtest.EnergyCrystal,{
|
||||||
|
name="industrialtest:energy_crystal",
|
||||||
|
description=S("Energy Crystal"),
|
||||||
|
inventoryImage="industrialtest_energy_crystal.png",
|
||||||
|
capacity=1000000,
|
||||||
|
flow=industrialtest.api.hvPowerFlow
|
||||||
|
})
|
||||||
|
|
||||||
|
industrialtest.EnergyCrystal:register()
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:energy_crystal",
|
||||||
|
recipe={
|
||||||
|
{industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier},
|
||||||
|
{industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.diamond,industrialtest.elementKeys.powerCarrier},
|
||||||
|
{industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier,industrialtest.elementKeys.powerCarrier}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
industrialtest.LapotronCrystal=table.copy(industrialtest.ElectricItem)
|
||||||
|
industrialtest.internal.unpackTableInto(industrialtest.LapotronCrystal,{
|
||||||
|
name="industrialtest:lapotron_crystal",
|
||||||
|
description=S("Lapotron Crystal"),
|
||||||
|
inventoryImage="industrialtest_lapotron_crystal.png",
|
||||||
|
capacity=10000000,
|
||||||
|
flow=industrialtest.api.evPowerFlow
|
||||||
|
})
|
||||||
|
|
||||||
|
industrialtest.LapotronCrystal:register()
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:lapotron_crystal",
|
||||||
|
recipe={
|
||||||
|
{industrialtest.elementKeys.blueDye,"industrialtest:electronic_circuit",industrialtest.elementKeys.blueDye},
|
||||||
|
{industrialtest.elementKeys.blueDye,"industrialtest:energy_crystal",industrialtest.elementKeys.blueDye},
|
||||||
|
{industrialtest.elementKeys.blueDye,"industrialtest:electronic_circuit",industrialtest.elementKeys.blueDye}
|
||||||
|
}
|
||||||
|
})
|
Loading…
x
Reference in New Issue
Block a user