Compare commits
2 Commits
62246bf91b
...
63960f3de1
Author | SHA1 | Date | |
---|---|---|---|
63960f3de1 | |||
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"),
|
||||||
@ -871,23 +802,3 @@ industrialtest.api.registerCompressorRecipe({
|
|||||||
recipe="industrialtest:plantball",
|
recipe="industrialtest:plantball",
|
||||||
time=5
|
time=5
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_tool("industrialtest:fuel_can",{
|
|
||||||
description=S("Fuel Can"),
|
|
||||||
inventory_image="industrialtest_fuel_can.png",
|
|
||||||
groups={
|
|
||||||
_industrialtest_fueled=1,
|
|
||||||
_industrialtest_fuel=1,
|
|
||||||
_industrialtest_fluidStorage=1
|
|
||||||
},
|
|
||||||
_industrialtest_fluidCapacity=10000
|
|
||||||
})
|
|
||||||
minetest.register_craft({
|
|
||||||
type="shaped",
|
|
||||||
output="industrialtest:fuel_can",
|
|
||||||
recipe={
|
|
||||||
{"","industrialtest:tin_plate","industrialtest:tin_plate"},
|
|
||||||
{"industrialtest:tin_plate","","industrialtest:tin_plate"},
|
|
||||||
{"industrialtest:tin_plate","industrialtest:tin_plate","industrialtest:tin_plate"}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
2
init.lua
2
init.lua
@ -78,9 +78,11 @@ dofile(modpath.."/tools/electric_chainsaw.lua")
|
|||||||
dofile(modpath.."/tools/electric_drill.lua")
|
dofile(modpath.."/tools/electric_drill.lua")
|
||||||
dofile(modpath.."/tools/electric_hoe.lua")
|
dofile(modpath.."/tools/electric_hoe.lua")
|
||||||
dofile(modpath.."/tools/electric_saber.lua")
|
dofile(modpath.."/tools/electric_saber.lua")
|
||||||
|
dofile(modpath.."/tools/fluid_storage.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")
|
||||||
|
@ -188,7 +188,7 @@ function industrialtest.CanningMachine.shouldDeactivate(self,pos)
|
|||||||
return fuelSlot:is_empty() or targetSlot:is_empty() or meta:get_int("industrialtest.powerAmount")<self._opPower or
|
return fuelSlot:is_empty() or targetSlot:is_empty() or meta:get_int("industrialtest.powerAmount")<self._opPower or
|
||||||
(industrialtest.api.itemHasFluidStorage(fuelSlot) and industrialtest.api.isItemFluidStorageEmpty(fuelSlot)) or
|
(industrialtest.api.itemHasFluidStorage(fuelSlot) and industrialtest.api.isItemFluidStorageEmpty(fuelSlot)) or
|
||||||
industrialtest.api.isItemFluidStorageFull(targetSlot) or
|
industrialtest.api.isItemFluidStorageFull(targetSlot) or
|
||||||
targetMeta:get_int("industrialtest.fluidCapacity")-targetMeta:get_int("industrialtest.fluidAmount")<fuelDef._industrialtest_fuelAmount or
|
targetMeta:get_int("industrialtest.fluidCapacity")-targetMeta:get_int("industrialtest.fluidAmount")<(fuelDef._industrialtest_fuelAmount or 0) or
|
||||||
(fuelDef._industrialtest_emptyVariant and not leftoverSlot:item_fits(ItemStack(fuelDef._industrialtest_emptyVariant)))
|
(fuelDef._industrialtest_emptyVariant and not leftoverSlot:item_fits(ItemStack(fuelDef._industrialtest_emptyVariant)))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
45
tools/fluid_storage.lua
Normal file
45
tools/fluid_storage.lua
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
-- 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.FuelCan=table.copy(industrialtest.FluidContainerItem)
|
||||||
|
industrialtest.internal.unpackTableInto(industrialtest.FuelCan,{
|
||||||
|
name="industrialtest:fuel_can",
|
||||||
|
description=S("Fuel Can"),
|
||||||
|
inventoryImage="industrialtest_fuel_can.png",
|
||||||
|
capacity=10000
|
||||||
|
})
|
||||||
|
|
||||||
|
function industrialtest.FuelCan.createDefinitionTable(self)
|
||||||
|
local def=industrialtest.FluidContainerItem.createDefinitionTable(self)
|
||||||
|
def.groups._industrialtest_fueled=1
|
||||||
|
def.groups._industrialtest_fuel=1
|
||||||
|
return def
|
||||||
|
end
|
||||||
|
|
||||||
|
industrialtest.FuelCan:register()
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:fuel_can",
|
||||||
|
recipe={
|
||||||
|
{"","industrialtest:tin_plate","industrialtest:tin_plate"},
|
||||||
|
{"industrialtest:tin_plate","","industrialtest:tin_plate"},
|
||||||
|
{"industrialtest:tin_plate","industrialtest:tin_plate","industrialtest:tin_plate"}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
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