Compare commits
28 Commits
1.0.0
...
feat/encha
| Author | SHA1 | Date | |
|---|---|---|---|
| 67f503758f | |||
| b2df6edeaf | |||
| 37e0662640 | |||
| bd40cea113 | |||
| c1728ec7ec | |||
| 6a705dbb01 | |||
| 36c5b3c8ac | |||
| 961e08647f | |||
| 8801ef515b | |||
| a844b4f982 | |||
| 1f048d5226 | |||
| 82071bf480 | |||
| 2d4fa3b68b | |||
| d12529ab2f | |||
| 9c0668b996 | |||
| 05bb4303b8 | |||
| d01d03c3a3 | |||
| 2669b7bc27 | |||
| 9781ce9ff1 | |||
| a9b3beecc6 | |||
| 7a0784d144 | |||
| 9c75570d64 | |||
| 868d01b008 | |||
| 4445d8a7b4 | |||
| 2fce391b9a | |||
| d176e89ab4 | |||
| e41d21b179 | |||
| ce8121caf1 |
@@ -19,5 +19,6 @@ Currently IndustrialTest supports following games:
|
|||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
- mrkubax10 <mrkubax10@onet.pl or mrkubax10 at irc.libera.chat> [programming, some graphics]
|
- mrkubax10 <mrkubax10@onet.pl or mrkubax10 at irc.libera.chat> [programming, some graphics]
|
||||||
|
- HandfulOfFrogs <<handfuloffrogs@gmail.com>> [some programming, graphics]
|
||||||
- LuanHawk <Discord: LuanHawk#8733> [lead graphics]
|
- LuanHawk <Discord: LuanHawk#8733> [lead graphics]
|
||||||
- Migdyn <<temp1@cubesoftware.xyz>> [graphics]
|
- Migdyn <<temp1@cubesoftware.xyz>> [graphics]
|
||||||
|
|||||||
8
api.lua
@@ -672,6 +672,7 @@ industrialtest.api.registerPlate=function(name,displayName,resources,color,regis
|
|||||||
minetest.register_craftitem("industrialtest:"..name,{
|
minetest.register_craftitem("industrialtest:"..name,{
|
||||||
description=displayName,
|
description=displayName,
|
||||||
inventory_image="industrialtest_plate.png",
|
inventory_image="industrialtest_plate.png",
|
||||||
|
inventory_overlay="industrialtest_plate_overlay.png",
|
||||||
color=color
|
color=color
|
||||||
})
|
})
|
||||||
if registerCompressorRecipe then
|
if registerCompressorRecipe then
|
||||||
@@ -688,13 +689,16 @@ end
|
|||||||
-- \param displayName Display name of cell
|
-- \param displayName Display name of cell
|
||||||
-- \param node Node which can be picked up with this cell
|
-- \param node Node which can be picked up with this cell
|
||||||
-- \returns nil
|
-- \returns nil
|
||||||
industrialtest.api.registerStorageCell=function(name,displayName,node,modname)
|
industrialtest.api.registerStorageCell=function(name,displayName,node,modname,color)
|
||||||
|
color = color or "#ffffffff"
|
||||||
if not modname then
|
if not modname then
|
||||||
modname="industrialtest"
|
modname="industrialtest"
|
||||||
end
|
end
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_cell",{
|
minetest.register_craftitem("industrialtest:"..name.."_cell",{
|
||||||
description=S(displayName.." Cell"),
|
description=S(displayName.." Cell"),
|
||||||
inventory_image=modname.."_"..name.."_cell.png",
|
inventory_image="industrialtest_cell_fluid.png",
|
||||||
|
inventory_overlay="industrialtest_cell_casing.png",
|
||||||
|
color=color,
|
||||||
on_place=function(itemstack,user,pointed)
|
on_place=function(itemstack,user,pointed)
|
||||||
if pointed.type~="node" or not user or not user:is_player() then
|
if pointed.type~="node" or not user or not user:is_player() then
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -33,12 +33,6 @@ for _,mod in ipairs(requiredMclModules) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
industrialtest.stackMax=99
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
industrialtest.stackMax=64
|
|
||||||
end
|
|
||||||
|
|
||||||
industrialtest.mods={}
|
industrialtest.mods={}
|
||||||
if industrialtest.mtgAvailable then
|
if industrialtest.mtgAvailable then
|
||||||
industrialtest.mods._3dArmor=minetest.get_modpath("3d_armor")
|
industrialtest.mods._3dArmor=minetest.get_modpath("3d_armor")
|
||||||
@@ -53,10 +47,11 @@ if industrialtest.mtgAvailable and not industrialtest.mods._3dArmor then
|
|||||||
end
|
end
|
||||||
|
|
||||||
industrialtest.elementKeys={}
|
industrialtest.elementKeys={}
|
||||||
|
|
||||||
industrialtest.internal={}
|
industrialtest.internal={}
|
||||||
|
|
||||||
if industrialtest.mclAvailable then
|
if industrialtest.mclAvailable then
|
||||||
|
industrialtest.stackMax=64
|
||||||
|
|
||||||
industrialtest.internal.mclMakeStrippedTrunk=function(itemstack,placer,pointedThing,electricTool)
|
industrialtest.internal.mclMakeStrippedTrunk=function(itemstack,placer,pointedThing,electricTool)
|
||||||
-- Taken from https://git.minetest.land/MineClone2/MineClone2/src/branch/master/mods/ITEMS/mcl_tools/init.lua#L360
|
-- Taken from https://git.minetest.land/MineClone2/MineClone2/src/branch/master/mods/ITEMS/mcl_tools/init.lua#L360
|
||||||
if pointedThing.type ~= "node" then return end
|
if pointedThing.type ~= "node" then return end
|
||||||
@@ -85,9 +80,22 @@ if industrialtest.mclAvailable then
|
|||||||
end
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
industrialtest.internal.explode=function(pos,radius,dropChance)
|
industrialtest.internal.explode=function(pos,radius,dropChance)
|
||||||
mcl_explosions.explode(pos,radius,{drop_chance=dropChance})
|
mcl_explosions.explode(pos,radius,{drop_chance=dropChance})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
industrialtest.internal.getItemSlotBg=mcl_formspec.get_itemslot_bg
|
||||||
|
elseif industrialtest.mtgAvailable then
|
||||||
|
industrialtest.stackMax=99
|
||||||
|
|
||||||
|
industrialtest.internal.explode=function(pos,radius)
|
||||||
|
tnt.boom(pos,{radius=radius})
|
||||||
|
end
|
||||||
|
|
||||||
|
industrialtest.internal.getItemSlotBg=function()
|
||||||
|
return ""
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- compatibilty that adds not existing elements
|
-- compatibilty that adds not existing elements
|
||||||
@@ -194,7 +202,7 @@ if industrialtest.mclAvailable then
|
|||||||
minetest.register_tool("industrialtest:"..material.."_pickaxe",{
|
minetest.register_tool("industrialtest:"..material.."_pickaxe",{
|
||||||
description=S(materialDisplayName.." Pickaxe"),
|
description=S(materialDisplayName.." Pickaxe"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_pickaxe.png",
|
inventory_image="industrialtest_mcl_"..material.."_pickaxe.png",
|
||||||
groups={tool=1,pickaxe=1,dig_speed_class=config.digSpeedClass},
|
groups={tool=1,pickaxe=1,dig_speed_class=config.digSpeedClass,enchantability=config.enchantability},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
full_punch_interval=1,
|
full_punch_interval=1,
|
||||||
max_drop_level=config.dropLevel,
|
max_drop_level=config.dropLevel,
|
||||||
@@ -210,7 +218,7 @@ if industrialtest.mclAvailable then
|
|||||||
minetest.register_tool("industrialtest:"..material.."_shovel",{
|
minetest.register_tool("industrialtest:"..material.."_shovel",{
|
||||||
description=S(materialDisplayName.." Shovel"),
|
description=S(materialDisplayName.." Shovel"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_shovel.png",
|
inventory_image="industrialtest_mcl_"..material.."_shovel.png",
|
||||||
groups={tool=1,shovel=1,dig_speed_class=config.digSpeedClass},
|
groups={tool=1,shovel=1,dig_speed_class=config.digSpeedClass,enchantability=config.enchantability},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
full_punch_interval=1,
|
full_punch_interval=1,
|
||||||
max_drop_level=config.dropLevel,
|
max_drop_level=config.dropLevel,
|
||||||
@@ -262,7 +270,7 @@ if industrialtest.mclAvailable then
|
|||||||
minetest.register_tool("industrialtest:"..material.."_axe",{
|
minetest.register_tool("industrialtest:"..material.."_axe",{
|
||||||
description=S(materialDisplayName.." Axe"),
|
description=S(materialDisplayName.." Axe"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_axe.png",
|
inventory_image="industrialtest_mcl_"..material.."_axe.png",
|
||||||
groups={tool=1,axe=1,dig_speed_class=config.digSpeedClass},
|
groups={tool=1,axe=1,dig_speed_class=config.digSpeedClass,enchantability=config.enchantability},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
full_punch_interval=1,
|
full_punch_interval=1,
|
||||||
max_level_drop=config.levelDrop,
|
max_level_drop=config.levelDrop,
|
||||||
@@ -279,7 +287,7 @@ if industrialtest.mclAvailable then
|
|||||||
minetest.register_tool("industrialtest:"..material.."_sword",{
|
minetest.register_tool("industrialtest:"..material.."_sword",{
|
||||||
description=S(materialDisplayName.." Sword"),
|
description=S(materialDisplayName.." Sword"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_sword.png",
|
inventory_image="industrialtest_mcl_"..material.."_sword.png",
|
||||||
groups={weapon=1,sword=1,dig_speed_class=config.digSpeedClass},
|
groups={weapon=1,sword=1,dig_speed_class=config.digSpeedClass,enchantability=config.enchantability},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
full_punch_interval=0.625,
|
full_punch_interval=0.625,
|
||||||
max_drop_level=config.maxDropLevel,
|
max_drop_level=config.maxDropLevel,
|
||||||
@@ -296,7 +304,7 @@ if industrialtest.mclAvailable then
|
|||||||
minetest.register_tool("industrialtest:"..material.."_hoe",{
|
minetest.register_tool("industrialtest:"..material.."_hoe",{
|
||||||
description=S(materialDisplayName.." Hoe"),
|
description=S(materialDisplayName.." Hoe"),
|
||||||
inventory_image="industrialtest_mcl_"..material.."_hoe.png",
|
inventory_image="industrialtest_mcl_"..material.."_hoe.png",
|
||||||
groups={tool=1,hoe=1},
|
groups={tool=1,hoe=1,enchantability=config.enchantability},
|
||||||
tool_capabilities={
|
tool_capabilities={
|
||||||
full_punch_interval=1,
|
full_punch_interval=1,
|
||||||
damage_groups={fleshy=1}
|
damage_groups={fleshy=1}
|
||||||
@@ -364,6 +372,7 @@ if industrialtest.mclAvailable then
|
|||||||
cook_material=config.armorCookMaterial,
|
cook_material=config.armorCookMaterial,
|
||||||
sound_equip=config.armorEquipSound,
|
sound_equip=config.armorEquipSound,
|
||||||
sound_unequip=config.armorUnequipSound,
|
sound_unequip=config.armorUnequipSound,
|
||||||
|
enchantability=config.enchantability,
|
||||||
textures={
|
textures={
|
||||||
head="industrialtest_mcl_"..material.."_helmet.png",
|
head="industrialtest_mcl_"..material.."_helmet.png",
|
||||||
torso="industrialtest_mcl_"..material.."_chestplate.png",
|
torso="industrialtest_mcl_"..material.."_chestplate.png",
|
||||||
@@ -567,7 +576,8 @@ if industrialtest.mclAvailable then
|
|||||||
},
|
},
|
||||||
armorCookMaterial="industrialtest:bronze_nugget",
|
armorCookMaterial="industrialtest:bronze_nugget",
|
||||||
armorEquipSound="mcl_armor_equip_iron",
|
armorEquipSound="mcl_armor_equip_iron",
|
||||||
armorUnequipSound="mcl_armor_unequip_iron"
|
armorUnequipSound="mcl_armor_unequip_iron",
|
||||||
|
enchantability=15,
|
||||||
})
|
})
|
||||||
|
|
||||||
--register other blocks that are not availabe in MCL
|
--register other blocks that are not availabe in MCL
|
||||||
@@ -611,10 +621,6 @@ if industrialtest.mclAvailable then
|
|||||||
y_min=mcl_vars.mg_overworld_min
|
y_min=mcl_vars.mg_overworld_min
|
||||||
})
|
})
|
||||||
elseif industrialtest.mtgAvailable then
|
elseif industrialtest.mtgAvailable then
|
||||||
industrialtest.internal.explode=function(pos,radius)
|
|
||||||
tnt.boom(pos,{radius=radius})
|
|
||||||
end
|
|
||||||
|
|
||||||
industrialtest.internal.registerMetal=function(name,displayName,hardness)
|
industrialtest.internal.registerMetal=function(name,displayName,hardness)
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
||||||
description=S(displayName.." Lump"),
|
description=S(displayName.." Lump"),
|
||||||
|
|||||||
@@ -15,6 +15,31 @@
|
|||||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
local S=minetest.get_translator("industrialtest")
|
local S=minetest.get_translator("industrialtest")
|
||||||
|
local colors={
|
||||||
|
bronze="#be4325ff",
|
||||||
|
clay="#707070ff",
|
||||||
|
coal="#262523ff",
|
||||||
|
copper="#bf644aff",
|
||||||
|
diamond="#77cefbff",
|
||||||
|
gold="#eac162ff",
|
||||||
|
iron="#afaca5ff",
|
||||||
|
lapis_lazuli="#3a4cceff",
|
||||||
|
lead="#6d6393ff",
|
||||||
|
mese="#909000ff",
|
||||||
|
obsidian="#292843ff",
|
||||||
|
refined_iron="#94bab9ff",
|
||||||
|
sulfur="#b88805ff",
|
||||||
|
tin="#ebd182ff",
|
||||||
|
uranium="#3b8c09ff",
|
||||||
|
-- fluid colors
|
||||||
|
lava="#ff5712ff",
|
||||||
|
water="#277bbcff",
|
||||||
|
river_water="#0ebfc2ff",
|
||||||
|
biomass="#2a8626ff",
|
||||||
|
biofuel="#4eba49ff",
|
||||||
|
coalfuel="#462228ff",
|
||||||
|
coolant="#188676ff"
|
||||||
|
}
|
||||||
|
|
||||||
-- Power storage items
|
-- Power storage items
|
||||||
minetest.register_tool("industrialtest:re_battery",{
|
minetest.register_tool("industrialtest:re_battery",{
|
||||||
@@ -197,13 +222,13 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("coal","Coal",resources,"#101010ff",true)
|
industrialtest.api.registerResourceDust("coal","Coal",resources,colors.coal,true)
|
||||||
industrialtest.api.registerResourceDust("clay","Clay",{
|
industrialtest.api.registerResourceDust("clay","Clay",{
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.clayBlock,
|
resource=industrialtest.elementKeys.clayBlock,
|
||||||
count=2
|
count=2
|
||||||
}
|
}
|
||||||
},"#9090a0ff",true)
|
},colors.clay,true)
|
||||||
resources={
|
resources={
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.diamondBlock,
|
resource=industrialtest.elementKeys.diamondBlock,
|
||||||
@@ -221,7 +246,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("diamond","Diamond",resources,"#90e2c9ff",true)
|
industrialtest.api.registerResourceDust("diamond","Diamond",resources,colors.diamond,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.diamond,
|
output=industrialtest.elementKeys.diamond,
|
||||||
@@ -248,7 +273,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("iron","Iron",resources,"#b5b5b5ff",true)
|
industrialtest.api.registerResourceDust("iron","Iron",resources,colors.iron,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.ironIngot,
|
output=industrialtest.elementKeys.ironIngot,
|
||||||
@@ -269,9 +294,9 @@ if industrialtest.mclAvailable then
|
|||||||
count=9
|
count=9
|
||||||
},
|
},
|
||||||
{resource="mcl_core:lapis_lazuli"}
|
{resource="mcl_core:lapis_lazuli"}
|
||||||
},"#292d76ff",true)
|
},colors.lapis_lazuli,true)
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("obsidian","Obsidian",{{resource=industrialtest.elementKeys.obsidian}},"#292843ff",true)
|
industrialtest.api.registerResourceDust("obsidian","Obsidian",{{resource=industrialtest.elementKeys.obsidian}},colors.obsidian,true)
|
||||||
resources={
|
resources={
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.goldBlock,
|
resource=industrialtest.elementKeys.goldBlock,
|
||||||
@@ -293,7 +318,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("gold","Gold",resources,"#e4e526ff",true)
|
industrialtest.api.registerResourceDust("gold","Gold",resources,colors.gold,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.goldIngot,
|
output=industrialtest.elementKeys.goldIngot,
|
||||||
@@ -320,7 +345,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("copper","Copper",resources,"#a45e25ff",true)
|
industrialtest.api.registerResourceDust("copper","Copper",resources,colors.copper,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.copperIngot,
|
output=industrialtest.elementKeys.copperIngot,
|
||||||
@@ -347,7 +372,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("tin","Tin",resources,"#f1f1f1ff",true)
|
industrialtest.api.registerResourceDust("tin","Tin",resources,colors.tin,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.tinIngot,
|
output=industrialtest.elementKeys.tinIngot,
|
||||||
@@ -374,7 +399,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("uranium","Uranium",resources,"#3b8c09ff",true)
|
industrialtest.api.registerResourceDust("uranium","Uranium",resources,colors.uranium,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output="industrialtest:uranium_ingot",
|
output="industrialtest:uranium_ingot",
|
||||||
@@ -391,7 +416,7 @@ if industrialtest.mtgAvailable then
|
|||||||
count=2
|
count=2
|
||||||
},
|
},
|
||||||
{resource="default:mese_crystal"}
|
{resource="default:mese_crystal"}
|
||||||
},"#909000ff",true)
|
},colors.mese,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output="default:mese_crystal",
|
output="default:mese_crystal",
|
||||||
@@ -404,7 +429,7 @@ industrialtest.api.registerResourceDust("bronze","Bronze",{
|
|||||||
count=9
|
count=9
|
||||||
},
|
},
|
||||||
{resource=industrialtest.elementKeys.bronzeIngot}
|
{resource=industrialtest.elementKeys.bronzeIngot}
|
||||||
},"#e48e88ff",true)
|
},colors.bronze,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
output="industrialtest:bronze_dust 9",
|
output="industrialtest:bronze_dust 9",
|
||||||
@@ -431,7 +456,7 @@ industrialtest.api.registerRotaryMaceratorModifier({
|
|||||||
output="industrialtest:bronze_dust",
|
output="industrialtest:bronze_dust",
|
||||||
uses=4
|
uses=4
|
||||||
})
|
})
|
||||||
industrialtest.api.registerResourceDust("sulfur","Sulfur",{},"#e3ff33ff",false)
|
industrialtest.api.registerResourceDust("sulfur","Sulfur",{},colors.sulfur,false)
|
||||||
industrialtest.api.registerExtractorRecipe({
|
industrialtest.api.registerExtractorRecipe({
|
||||||
output="industrialtest:sulfur_dust",
|
output="industrialtest:sulfur_dust",
|
||||||
recipe=industrialtest.elementKeys.gunpowder
|
recipe=industrialtest.elementKeys.gunpowder
|
||||||
@@ -450,7 +475,7 @@ industrialtest.api.registerResourceDust("lead","Lead",{
|
|||||||
count=2
|
count=2
|
||||||
},
|
},
|
||||||
{resource="industrialtest:lead_ingot"}
|
{resource="industrialtest:lead_ingot"}
|
||||||
},"#eafef8ff",true)
|
},colors.lead,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output="industrialtest:lead_ingot",
|
output="industrialtest:lead_ingot",
|
||||||
@@ -461,7 +486,7 @@ industrialtest.api.registerResourceDust("refined_iron","Refined Iron",{
|
|||||||
resource="industrialtest:refined_iron_ingot",
|
resource="industrialtest:refined_iron_ingot",
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#7c8588ff",true)
|
},colors.refined_iron,true)
|
||||||
industrialtest.api.registerRotaryMaceratorModifier({
|
industrialtest.api.registerRotaryMaceratorModifier({
|
||||||
name=industrialtest.elementKeys.ironLump,
|
name=industrialtest.elementKeys.ironLump,
|
||||||
modifier=industrialtest.elementKeys.coal,
|
modifier=industrialtest.elementKeys.coal,
|
||||||
@@ -524,14 +549,14 @@ industrialtest.api.registerPlate("bronze_plate",S("Bronze Plate"),{
|
|||||||
resource=industrialtest.elementKeys.bronzeIngot,
|
resource=industrialtest.elementKeys.bronzeIngot,
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#e48e88ff",true)
|
},colors.bronze,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("copper_plate",S("Copper Plate"),{
|
industrialtest.api.registerPlate("copper_plate",S("Copper Plate"),{
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.copperIngot,
|
resource=industrialtest.elementKeys.copperIngot,
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#f48e44ff",true)
|
},colors.copper,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("advanced_alloy",S("Advanced Alloy"),{
|
industrialtest.api.registerPlate("advanced_alloy",S("Advanced Alloy"),{
|
||||||
{
|
{
|
||||||
@@ -552,14 +577,14 @@ industrialtest.api.registerPlate("tin_plate",S("Tin Plate"),{
|
|||||||
resource=industrialtest.elementKeys.tinIngot,
|
resource=industrialtest.elementKeys.tinIngot,
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#e0e0e0ff",true)
|
},colors.tin,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("lead_plate",S("Lead Plate"),{
|
industrialtest.api.registerPlate("lead_plate",S("Lead Plate"),{
|
||||||
{
|
{
|
||||||
resource="industrialtest:lead_ingot",
|
resource="industrialtest:lead_ingot",
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#eafef8ff",true)
|
},colors.lead,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("iridium_plate",S("Iridium Plate"),{},false,"#ffffffff")
|
industrialtest.api.registerPlate("iridium_plate",S("Iridium Plate"),{},false,"#ffffffff")
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@@ -609,12 +634,12 @@ minetest.register_craft({
|
|||||||
{"",industrialtest.elementKeys.tinIngot,""}
|
{"",industrialtest.elementKeys.tinIngot,""}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
industrialtest.api.registerStorageCell("water","Water",industrialtest.elementKeys.waterSource)
|
industrialtest.api.registerStorageCell("water","Water",industrialtest.elementKeys.waterSource,nil,colors.water)
|
||||||
if industrialtest.mtgAvailable then
|
if industrialtest.mtgAvailable then
|
||||||
industrialtest.api.registerStorageCell("river_water","River Water","default:river_water_source")
|
industrialtest.api.registerStorageCell("river_water","River Water","default:river_water_source",nil,colors.river_water)
|
||||||
end
|
end
|
||||||
|
|
||||||
industrialtest.api.registerStorageCell("lava","Lava",industrialtest.elementKeys.lavaSource)
|
industrialtest.api.registerStorageCell("lava","Lava",industrialtest.elementKeys.lavaSource,nil,colors.lava)
|
||||||
|
|
||||||
minetest.register_tool("industrialtest:uranium_cell",{
|
minetest.register_tool("industrialtest:uranium_cell",{
|
||||||
description=S("Uranium Cell"),
|
description=S("Uranium Cell"),
|
||||||
@@ -622,7 +647,9 @@ minetest.register_tool("industrialtest:uranium_cell",{
|
|||||||
_industrialtest_placedInNuclearReactor=1,
|
_industrialtest_placedInNuclearReactor=1,
|
||||||
_industrialtest_nuclearReactorFuel=1
|
_industrialtest_nuclearReactorFuel=1
|
||||||
},
|
},
|
||||||
inventory_image="industrialtest_uranium_cell.png",
|
inventory_image="industrialtest_cell_fluid.png",
|
||||||
|
inventory_overlay="industrialtest_cell_casing.png",
|
||||||
|
color=colors.uranium,
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shapeless",
|
type="shapeless",
|
||||||
@@ -639,7 +666,9 @@ minetest.register_tool("industrialtest:coolant_cell",{
|
|||||||
_industrialtest_placedInNuclearReactor=1,
|
_industrialtest_placedInNuclearReactor=1,
|
||||||
_industrialtest_nuclearReactorCoolant=1
|
_industrialtest_nuclearReactorCoolant=1
|
||||||
},
|
},
|
||||||
inventory_image="industrialtest_coolant_cell.png",
|
inventory_image="industrialtest_cell_fluid.png",
|
||||||
|
inventory_overlay="industrialtest_cell_casing.png",
|
||||||
|
color=colors.coolant,
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
@@ -664,7 +693,9 @@ end
|
|||||||
|
|
||||||
minetest.register_craftitem("industrialtest:bio_cell",{
|
minetest.register_craftitem("industrialtest:bio_cell",{
|
||||||
description=S("Bio Cell"),
|
description=S("Bio Cell"),
|
||||||
inventory_image="industrialtest_bio_cell.png"
|
inventory_image="industrialtest_cell_fluid.png",
|
||||||
|
inventory_overlay="industrialtest_cell_casing.png",
|
||||||
|
color=colors.biomass,
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shapeless",
|
type="shapeless",
|
||||||
@@ -677,7 +708,9 @@ minetest.register_craft({
|
|||||||
|
|
||||||
minetest.register_craftitem("industrialtest:biofuel_cell",{
|
minetest.register_craftitem("industrialtest:biofuel_cell",{
|
||||||
description=S("Biofuel Cell"),
|
description=S("Biofuel Cell"),
|
||||||
inventory_image="industrialtest_bio_cell.png",
|
inventory_image="industrialtest_cell_fluid.png",
|
||||||
|
inventory_overlay="industrialtest_cell_casing.png",
|
||||||
|
color=colors.biofuel,
|
||||||
groups={
|
groups={
|
||||||
_industrialtest_fuel=1
|
_industrialtest_fuel=1
|
||||||
},
|
},
|
||||||
@@ -692,7 +725,9 @@ industrialtest.api.registerExtractorRecipe({
|
|||||||
|
|
||||||
minetest.register_craftitem("industrialtest:hydrated_coal_cell",{
|
minetest.register_craftitem("industrialtest:hydrated_coal_cell",{
|
||||||
description=S("Hydrated Coal Cell"),
|
description=S("Hydrated Coal Cell"),
|
||||||
inventory_image="industrialtest_hydrated_coal_cell.png"
|
inventory_image="industrialtest_cell_fluid.png",
|
||||||
|
inventory_overlay="industrialtest_cell_casing.png",
|
||||||
|
color=colors.coal,
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shapeless",
|
type="shapeless",
|
||||||
@@ -705,7 +740,9 @@ minetest.register_craft({
|
|||||||
|
|
||||||
minetest.register_craftitem("industrialtest:coalfuel_cell",{
|
minetest.register_craftitem("industrialtest:coalfuel_cell",{
|
||||||
description=S("Coalfuel Cell"),
|
description=S("Coalfuel Cell"),
|
||||||
inventory_image="industrialtest_coalfuel_cell.png",
|
inventory_image="industrialtest_cell_fluid.png",
|
||||||
|
inventory_overlay="industrialtest_cell_casing.png",
|
||||||
|
color=colors.coalfuel,
|
||||||
groups={
|
groups={
|
||||||
_industrialtest_fuel=1
|
_industrialtest_fuel=1
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -24,52 +24,30 @@ canningMachine.getFormspec=function(pos)
|
|||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
||||||
local srcPercent=meta:get_float("srcTime")/canningMachine.canningTime*100
|
local srcPercent=meta:get_float("srcTime")/canningMachine.canningTime*100
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(3.4,1.8,1,1),
|
||||||
"list[context;fuel;3.4,1.8;1,1]",
|
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
"list[context;powerStorage;3.4,3.9;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(3.4,3.9,1,1),
|
||||||
(srcPercent>0 and "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;target;6.4,1.8;1,1]",
|
"list[context;dst;6.4,1.8;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(6.4,1.8,1,1),
|
||||||
"list[context;leftover;6.4,2.8;1,1]",
|
"list[context;leftover;6.4,2.8;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(6.4,2.8,1,1),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
"listring[context;fuel]",
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"listring[context;powerStorage]",
|
"listring[context;src]",
|
||||||
"listring[context;target]",
|
"listring[context;dst]"
|
||||||
"listring[context;leftover]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;fuel;3.4,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
|
||||||
(srcPercent>0 and "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;target;6.4,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6.4,1.8,1,1),
|
|
||||||
"list[context;leftover;6.4,2.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"listring[context;fuel]",
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
"listring[context;target]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
canningMachine.onConstruct=function(pos,meta,inv)
|
canningMachine.onConstruct=function(pos,meta,inv)
|
||||||
inv:set_size("fuel",1)
|
inv:set_size("src",1)
|
||||||
inv:set_size("target",1)
|
inv:set_size("dst",1)
|
||||||
inv:set_size("leftover",1)
|
inv:set_size("leftover",1)
|
||||||
inv:set_size("powerStorage",1)
|
inv:set_size("powerStorage",1)
|
||||||
inv:set_size("upgrades",4)
|
inv:set_size("upgrades",4)
|
||||||
@@ -79,8 +57,8 @@ end
|
|||||||
canningMachine.onTimer=function(pos,elapsed,meta,inv)
|
canningMachine.onTimer=function(pos,elapsed,meta,inv)
|
||||||
local shouldRerunTimer=false
|
local shouldRerunTimer=false
|
||||||
local shouldUpdateFormspec=false
|
local shouldUpdateFormspec=false
|
||||||
local fuelSlot=inv:get_stack("fuel",1)
|
local fuelSlot=inv:get_stack("src",1)
|
||||||
local targetSlot=inv:get_stack("target",1)
|
local targetSlot=inv:get_stack("dst",1)
|
||||||
local leftoverSlot=inv:get_stack("leftover",1)
|
local leftoverSlot=inv:get_stack("leftover",1)
|
||||||
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
||||||
local targetMeta=targetSlot:get_meta()
|
local targetMeta=targetSlot:get_meta()
|
||||||
@@ -102,13 +80,13 @@ canningMachine.onTimer=function(pos,elapsed,meta,inv)
|
|||||||
end
|
end
|
||||||
|
|
||||||
canningMachine.allowMetadataInventoryMove=function(pos,fromList,fromIndex,toList,count)
|
canningMachine.allowMetadataInventoryMove=function(pos,fromList,fromIndex,toList,count)
|
||||||
if toList=="fuel" then
|
if toList=="src" then
|
||||||
local inv=minetest.get_meta(pos):get_inventory()
|
local inv=minetest.get_meta(pos):get_inventory()
|
||||||
local itemstack=inv:get_stack(fromList,fromIndex)
|
local itemstack=inv:get_stack(fromList,fromIndex)
|
||||||
local def=itemstack:get_definition()
|
local def=itemstack:get_definition()
|
||||||
return (def.groups and def.groups._industrialtest_fuel) and count or 0
|
return (def.groups and def.groups._industrialtest_fuel) and count or 0
|
||||||
end
|
end
|
||||||
if toList=="target" then
|
if toList=="dst" then
|
||||||
local inv=minetest.get_meta(pos):get_inventory()
|
local inv=minetest.get_meta(pos):get_inventory()
|
||||||
local itemstack=inv:get_stack(fromList,fromIndex)
|
local itemstack=inv:get_stack(fromList,fromIndex)
|
||||||
local def=itemstack:get_definition()
|
local def=itemstack:get_definition()
|
||||||
@@ -118,11 +96,11 @@ canningMachine.allowMetadataInventoryMove=function(pos,fromList,fromIndex,toList
|
|||||||
end
|
end
|
||||||
|
|
||||||
canningMachine.allowMetadataInventoryPut=function(pos,listname,index,stack)
|
canningMachine.allowMetadataInventoryPut=function(pos,listname,index,stack)
|
||||||
if listname=="fuel" then
|
if listname=="src" then
|
||||||
local def=stack:get_definition()
|
local def=stack:get_definition()
|
||||||
return (def.groups and def.groups._industrialtest_fuel) and stack:get_count() or 0
|
return (def.groups and def.groups._industrialtest_fuel) and stack:get_count() or 0
|
||||||
end
|
end
|
||||||
if listname=="target" then
|
if listname=="dst" then
|
||||||
local def=stack:get_definition()
|
local def=stack:get_definition()
|
||||||
return (def.groups and def.groups._industrialtest_fueled) and stack:get_count() or 0
|
return (def.groups and def.groups._industrialtest_fueled) and stack:get_count() or 0
|
||||||
end
|
end
|
||||||
@@ -132,9 +110,9 @@ end
|
|||||||
canningMachine.allowMetadataInventoryTake=function(pos,listname,index,stack)
|
canningMachine.allowMetadataInventoryTake=function(pos,listname,index,stack)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local inv=meta:get_inventory()
|
local inv=meta:get_inventory()
|
||||||
local fuelSlot=inv:get_stack("fuel",1)
|
local fuelSlot=inv:get_stack("src",1)
|
||||||
local targetSlot=inv:get_stack("target",1)
|
local targetSlot=inv:get_stack("dst",1)
|
||||||
if ((listname=="fuel" and stack:get_count()==fuelSlot:get_count()) or (listname=="target" and stack:get_count()==targetSlot:get_count())) and meta:get_float("srcTime")>0 then
|
if ((listname=="src" and stack:get_count()==fuelSlot:get_count()) or (listname=="dst" and stack:get_count()==targetSlot:get_count())) and meta:get_float("srcTime")>0 then
|
||||||
meta:set_float("srcTime",0)
|
meta:set_float("srcTime",0)
|
||||||
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
end
|
end
|
||||||
@@ -148,9 +126,9 @@ end
|
|||||||
canningMachine.onMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,count)
|
canningMachine.onMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,count)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local inv=meta:get_inventory()
|
local inv=meta:get_inventory()
|
||||||
local fuelSlot=inv:get_stack("fuel",1)
|
local fuelSlot=inv:get_stack("src",1)
|
||||||
local targetSlot=inv:get_stack("target",1)
|
local targetSlot=inv:get_stack("dst",1)
|
||||||
if ((fromList=="fuel" and count==fuelSlot:get_count()) or (fromList=="target" and count==targetSlot:get_count())) and meta:get_float("srcTime")>0 then
|
if ((fromList=="src" and count==fuelSlot:get_count()) or (fromList=="dst" and count==targetSlot:get_count())) and meta:get_float("srcTime")>0 then
|
||||||
meta:set_float("srcTime",0)
|
meta:set_float("srcTime",0)
|
||||||
meta:set_string("formspec",canningMachine.getFormspec(pos))
|
meta:set_string("formspec",canningMachine.getFormspec(pos))
|
||||||
end
|
end
|
||||||
@@ -158,8 +136,8 @@ end
|
|||||||
|
|
||||||
canningMachine.activeOnTimer=function(pos,elapsed,meta,inv)
|
canningMachine.activeOnTimer=function(pos,elapsed,meta,inv)
|
||||||
local shouldUpdateFormspec=false
|
local shouldUpdateFormspec=false
|
||||||
local fuelSlot=inv:get_stack("fuel",1)
|
local fuelSlot=inv:get_stack("src",1)
|
||||||
local targetSlot=inv:get_stack("target",1)
|
local targetSlot=inv:get_stack("dst",1)
|
||||||
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
||||||
|
|
||||||
shouldRerunTimer,shouldUpdateFormspec=industrialtest.internal.chargeFromPowerStorageItem(meta,inv)
|
shouldRerunTimer,shouldUpdateFormspec=industrialtest.internal.chargeFromPowerStorageItem(meta,inv)
|
||||||
@@ -193,8 +171,8 @@ canningMachine.activeOnTimer=function(pos,elapsed,meta,inv)
|
|||||||
if srcTime>=canningMachine.canningTime then
|
if srcTime>=canningMachine.canningTime then
|
||||||
if industrialtest.api.itemHasFluidStorage(fuelSlot) then
|
if industrialtest.api.itemHasFluidStorage(fuelSlot) then
|
||||||
industrialtest.api.transferFluidToItem(fuelSlot,targetSlot,fuelMeta:get_int("industrialtest.fluidAmount"))
|
industrialtest.api.transferFluidToItem(fuelSlot,targetSlot,fuelMeta:get_int("industrialtest.fluidAmount"))
|
||||||
inv:set_stack("fuel",1,fuelSlot)
|
inv:set_stack("src",1,fuelSlot)
|
||||||
inv:set_stack("target",1,targetSlot)
|
inv:set_stack("dst",1,targetSlot)
|
||||||
else
|
else
|
||||||
local def=fuelSlot:get_definition()
|
local def=fuelSlot:get_definition()
|
||||||
local leftoverSlot=inv:get_stack("leftover",1)
|
local leftoverSlot=inv:get_stack("leftover",1)
|
||||||
@@ -207,9 +185,9 @@ canningMachine.activeOnTimer=function(pos,elapsed,meta,inv)
|
|||||||
return false,shouldUpdateFormspec
|
return false,shouldUpdateFormspec
|
||||||
end
|
end
|
||||||
industrialtest.api.addFluidToItem(targetSlot,def._industrialtest_fuelAmount)
|
industrialtest.api.addFluidToItem(targetSlot,def._industrialtest_fuelAmount)
|
||||||
inv:set_stack("target",1,targetSlot)
|
inv:set_stack("dst",1,targetSlot)
|
||||||
fuelSlot:take_item(1)
|
fuelSlot:take_item(1)
|
||||||
inv:set_stack("fuel",1,fuelSlot)
|
inv:set_stack("src",1,fuelSlot)
|
||||||
leftoverSlot:add_item(ItemStack(def._industrialtest_emptyVariant))
|
leftoverSlot:add_item(ItemStack(def._industrialtest_emptyVariant))
|
||||||
inv:set_stack("leftover",1,leftoverSlot)
|
inv:set_stack("leftover",1,leftoverSlot)
|
||||||
end
|
end
|
||||||
@@ -233,7 +211,7 @@ industrialtest.internal.registerMachine({
|
|||||||
registerActiveVariant=true,
|
registerActiveVariant=true,
|
||||||
sounds="metal",
|
sounds="metal",
|
||||||
powerSlots={"powerStorage"},
|
powerSlots={"powerStorage"},
|
||||||
storageSlots={"fuel","target","powerStorage","upgrades"},
|
storageSlots={"src","dst","powerStorage","upgrades"},
|
||||||
groups={
|
groups={
|
||||||
_industrialtest_hasPowerInput=1
|
_industrialtest_hasPowerInput=1
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -71,32 +71,18 @@ end
|
|||||||
chargepad.getFormspec=function(pos)
|
chargepad.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;1,2.5;1,1]",
|
"list[context;charged;1,2.5;1,1]",
|
||||||
"listring[context;charged]",
|
industrialtest.internal.getItemSlotBg(1,2.5,1,1),
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
"label[0.9,3.9;"..S("Charge").."]",
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
"list[context;discharged;3,2.5;1,1]",
|
||||||
"listring[context;discharged]",
|
industrialtest.internal.getItemSlotBg(3,2.5,1,1),
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
"label[2.7,3.9;"..S("Discharge").."]",
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;1,2.5;1,1]",
|
|
||||||
"listring[context;charged]",
|
"listring[context;charged]",
|
||||||
mcl_formspec.get_itemslot_bg(1,2.5,1,1),
|
"listring[context;discharged]"
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
|
||||||
"listring[context;discharged]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3,2.5,1,1),
|
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
}
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -72,19 +72,21 @@ machine.getFormspec=function(pos,config)
|
|||||||
"formspec_version[4]",
|
"formspec_version[4]",
|
||||||
"size[10.8,12]",
|
"size[10.8,12]",
|
||||||
"label[0.5,0.5;"..config.displayName.."]",
|
"label[0.5,0.5;"..config.displayName.."]",
|
||||||
(config.getFormspec and config.getFormspec(pos) or ""),
|
|
||||||
"list[current_player;main;0.5,6.25;8,1]",
|
"list[current_player;main;0.5,6.25;8,1]",
|
||||||
"list[current_player;main;0.5,7.5;8,3;8]"
|
"list[current_player;main;0.5,7.5;8,3;8]",
|
||||||
|
"listring[current_player;main]",
|
||||||
|
(config.getFormspec and config.getFormspec(pos) or "")
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
elseif industrialtest.mclAvailable then
|
||||||
formspec={
|
formspec={
|
||||||
"size[10.04,12]",
|
"size[10.04,12]",
|
||||||
"label[0.25,0.25;"..config.displayName.."]",
|
"label[0.25,0.25;"..config.displayName.."]",
|
||||||
(config.getFormspec and config.getFormspec(pos) or ""),
|
|
||||||
"list[current_player;main;0.5,7;9,3;9]",
|
"list[current_player;main;0.5,7;9,3;9]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
||||||
"list[current_player;main;0.5,10.24;9,1]",
|
"list[current_player;main;0.5,10.24;9,1]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1)
|
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1),
|
||||||
|
"listring[current_player;main]",
|
||||||
|
(config.getFormspec and config.getFormspec(pos) or "")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
@@ -357,9 +359,29 @@ function industrialtest.internal.registerMachine(config)
|
|||||||
if config.sounds=="metal" then
|
if config.sounds=="metal" then
|
||||||
definition.sounds=mcl_sounds.node_sound_metal_defaults()
|
definition.sounds=mcl_sounds.node_sound_metal_defaults()
|
||||||
end
|
end
|
||||||
definition.groups={pickaxey=1}
|
definition.groups={
|
||||||
|
pickaxey=1,
|
||||||
|
container=2
|
||||||
|
}
|
||||||
definition._mcl_blast_resistance=3.5
|
definition._mcl_blast_resistance=3.5
|
||||||
definition._mcl_hardness=3.9
|
definition._mcl_hardness=3.9
|
||||||
|
definition._mcl_hoppers_on_try_pull=function(pos, hop_pos, hop_inv, hop_list)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
local stack = inv:get_stack("dst", 1)
|
||||||
|
if not stack:is_empty() and hop_inv:room_for_item(hop_list, stack) then
|
||||||
|
return inv, "dst", 1
|
||||||
|
end
|
||||||
|
return nil, nil, nil
|
||||||
|
end
|
||||||
|
definition._mcl_hoppers_on_try_push=function(pos, hop_pos, hop_inv, hop_list)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
local inv = meta:get_inventory()
|
||||||
|
return inv, "src", mcl_util.select_stack(hop_inv, hop_list, inv, "src")
|
||||||
|
end
|
||||||
|
definition._mcl_hoppers_on_after_push=function(pos)
|
||||||
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
definition.groups._industrialtest_wrenchUnmountable=1
|
definition.groups._industrialtest_wrenchUnmountable=1
|
||||||
if config.requiresWrench then
|
if config.requiresWrench then
|
||||||
@@ -528,42 +550,22 @@ simpleElectricItemProcessor.getFormspec=function(pos)
|
|||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
||||||
local srcPercent=meta:get_float("srcTime")/meta:get_float("maxSrcTime")*100
|
local srcPercent=meta:get_float("srcTime")/meta:get_float("maxSrcTime")*100
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
"listring[context;src]",
|
industrialtest.internal.getItemSlotBg(3.4,1.8,1,1),
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
"list[context;powerStorage;3.4,3.9;1,1]",
|
||||||
"listring[context;powerStorage]",
|
industrialtest.internal.getItemSlotBg(3.4,3.9,1,1),
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
"list[context;dst;6.4,2.8;1,1]",
|
||||||
"listring[context;dst]",
|
industrialtest.internal.getItemSlotBg(6.4,2.8,1,1),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
"listring[context;upgrades]"
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
|
||||||
"listring[context;src]",
|
"listring[context;src]",
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
"listring[context;dst]"
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
|
||||||
"listring[context;dst]",
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
}
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -22,50 +22,34 @@ fluidGenerator.getFormspec=function(pos,config)
|
|||||||
local fluidPercent=meta:get_float("fluidAmount")/100
|
local fluidPercent=meta:get_float("fluidAmount")/100
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local fluid=meta:get_string("fluid")
|
local fluid=meta:get_string("fluid")
|
||||||
local formspec
|
|
||||||
local fuel=config.getFuel(fluid)
|
local fuel=config.getFuel(fluid)
|
||||||
local tile=(fuel and fuel.texture or "industrialtest_gui_fluid_bg.png")
|
local tile=(fuel and fuel.texture or "industrialtest_gui_fluid_bg.png")
|
||||||
if industrialtest.mtgAvailable then
|
local formspec={
|
||||||
formspec={
|
"list[context;src;2,1.8;1,1]",
|
||||||
"list[context;fluid;2,1.8;1,1]",
|
industrialtest.internal.getItemSlotBg(2,1.8,1,1),
|
||||||
"listring[context;fluid]",
|
|
||||||
(fluidPercent>0 and "image[2,3;1,1;industrialtest_gui_fluid_bg.png^[lowpart:"..fluidPercent..":"..tile.."]" or "image[2,3;1,1;industrialtest_gui_fluid_bg.png]"),
|
(fluidPercent>0 and "image[2,3;1,1;industrialtest_gui_fluid_bg.png^[lowpart:"..fluidPercent..":"..tile.."]" or "image[2,3;1,1;industrialtest_gui_fluid_bg.png]"),
|
||||||
"list[context;leftover;2,4.2;1,1]",
|
"list[context;dst;2,4.2;1,1]",
|
||||||
"listring[context;leftover]",
|
industrialtest.internal.getItemSlotBg(2,4.2,1,1),
|
||||||
"list[context;charged;6,3;1,1]",
|
"list[context;charged;6,3;1,1]",
|
||||||
"listring[context;charged]",
|
industrialtest.internal.getItemSlotBg(6,3,1,1),
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
(powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or "")
|
(powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or ""),
|
||||||
|
"listring[context;src]",
|
||||||
|
"listring[context;dst]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;fluid;2,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(2,1.8,1,1),
|
|
||||||
"listring[context;fluid]",
|
|
||||||
(fluidPercent>0 and "image[2,3;1,1;industrialtest_gui_fluid_bg.png^[lowpart:"..fluidPercent..":"..tile.."]" or "image[2,3;1,1;industrialtest_gui_fluid_bg.png]"),
|
|
||||||
"list[context;leftover;2,4.2;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(2,4.2,1,1),
|
|
||||||
"listring[context;leftover]",
|
|
||||||
"list[context;charged;6,3;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6,3,1,1),
|
|
||||||
"listring[context;charged]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
fluidGenerator.onConstruct=function(pos,meta,inv)
|
fluidGenerator.onConstruct=function(pos,meta,inv)
|
||||||
inv:set_size("charged",1)
|
inv:set_size("charged",1)
|
||||||
inv:set_size("fluid",1)
|
inv:set_size("src",1)
|
||||||
inv:set_size("leftover",1)
|
inv:set_size("dst",1)
|
||||||
meta:set_float("fluidAmount",0)
|
meta:set_float("fluidAmount",0)
|
||||||
meta:set_string("fluid","")
|
meta:set_string("fluid","")
|
||||||
end
|
end
|
||||||
|
|
||||||
fluidGenerator.onTimer=function(pos,elapsed,meta,inv,config)
|
fluidGenerator.onTimer=function(pos,elapsed,meta,inv,config)
|
||||||
local fluidSlot=inv:get_stack("fluid",1)
|
local fluidSlot=inv:get_stack("src",1)
|
||||||
local chargedSlot=inv:get_stack("charged",1)
|
local chargedSlot=inv:get_stack("charged",1)
|
||||||
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
||||||
local shouldUpdateFormspec=false
|
local shouldUpdateFormspec=false
|
||||||
@@ -77,8 +61,8 @@ fluidGenerator.onTimer=function(pos,elapsed,meta,inv,config)
|
|||||||
local leftoverAddingSucceeded=false
|
local leftoverAddingSucceeded=false
|
||||||
for _,item in ipairs(fuel.storageItems) do
|
for _,item in ipairs(fuel.storageItems) do
|
||||||
if item.name==fluidSlot:get_name() and item.leftover then
|
if item.name==fluidSlot:get_name() and item.leftover then
|
||||||
if inv:room_for_item("leftover",ItemStack(item.leftover)) then
|
if inv:room_for_item("dst",ItemStack(item.leftover)) then
|
||||||
inv:add_item("leftover",ItemStack(item.leftover))
|
inv:add_item("dst",ItemStack(item.leftover))
|
||||||
leftoverAddingSucceeded=true
|
leftoverAddingSucceeded=true
|
||||||
end
|
end
|
||||||
leftover=true
|
leftover=true
|
||||||
@@ -86,7 +70,7 @@ fluidGenerator.onTimer=function(pos,elapsed,meta,inv,config)
|
|||||||
end
|
end
|
||||||
if not leftover or leftoverAddingSucceeded then
|
if not leftover or leftoverAddingSucceeded then
|
||||||
fluidSlot:take_item()
|
fluidSlot:take_item()
|
||||||
inv:set_stack("fluid",1,fluidSlot)
|
inv:set_stack("src",1,fluidSlot)
|
||||||
meta:set_string("fluid",fuel.name)
|
meta:set_string("fluid",fuel.name)
|
||||||
meta:set_float("fluidAmount",meta:get_float("fluidAmount")+1000)
|
meta:set_float("fluidAmount",meta:get_float("fluidAmount")+1000)
|
||||||
shouldUpdateFormspec=true
|
shouldUpdateFormspec=true
|
||||||
@@ -127,7 +111,7 @@ fluidGenerator.metadataChange=function(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
fluidGenerator.activeOnTimer=function(pos,elapsed,meta,inv,config)
|
fluidGenerator.activeOnTimer=function(pos,elapsed,meta,inv,config)
|
||||||
local fluidSlot=inv:get_stack("fluid",1)
|
local fluidSlot=inv:get_stack("src",1)
|
||||||
local chargedSlot=inv:get_stack("charged",1)
|
local chargedSlot=inv:get_stack("charged",1)
|
||||||
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
||||||
local shouldUpdateFormspec=false
|
local shouldUpdateFormspec=false
|
||||||
@@ -140,8 +124,8 @@ fluidGenerator.activeOnTimer=function(pos,elapsed,meta,inv,config)
|
|||||||
local leftoverAddingSucceeded=false
|
local leftoverAddingSucceeded=false
|
||||||
for _,item in ipairs(fuel.storageItems) do
|
for _,item in ipairs(fuel.storageItems) do
|
||||||
if item.name==fluidSlot:get_name() and item.leftover then
|
if item.name==fluidSlot:get_name() and item.leftover then
|
||||||
if inv:room_for_item("leftover",ItemStack(item.leftover)) then
|
if inv:room_for_item("dst",ItemStack(item.leftover)) then
|
||||||
inv:add_item("leftover",ItemStack(item.leftover))
|
inv:add_item("dst",ItemStack(item.leftover))
|
||||||
leftoverAddingSucceeded=true
|
leftoverAddingSucceeded=true
|
||||||
end
|
end
|
||||||
leftover=true
|
leftover=true
|
||||||
@@ -149,7 +133,7 @@ fluidGenerator.activeOnTimer=function(pos,elapsed,meta,inv,config)
|
|||||||
end
|
end
|
||||||
if not leftover or leftoverAddingSucceeded then
|
if not leftover or leftoverAddingSucceeded then
|
||||||
fluidSlot:take_item()
|
fluidSlot:take_item()
|
||||||
inv:set_stack("fluid",1,fluidSlot)
|
inv:set_stack("src",1,fluidSlot)
|
||||||
meta:set_string("fluid",fuel.name)
|
meta:set_string("fluid",fuel.name)
|
||||||
meta:set_float("fluidAmount",meta:get_float("fluidAmount")+1000)
|
meta:set_float("fluidAmount",meta:get_float("fluidAmount")+1000)
|
||||||
shouldUpdateFormspec=true
|
shouldUpdateFormspec=true
|
||||||
@@ -196,7 +180,7 @@ local function registerFluidGenerator(config)
|
|||||||
requiresWrench=true,
|
requiresWrench=true,
|
||||||
registerActiveVariant=config.registerActiveVariant,
|
registerActiveVariant=config.registerActiveVariant,
|
||||||
powerSlots={"charged"},
|
powerSlots={"charged"},
|
||||||
storageSlots={"fluid","fluidLeftover"},
|
storageSlots={"src","dst"},
|
||||||
sounds="metal",
|
sounds="metal",
|
||||||
groups={
|
groups={
|
||||||
_industrialtest_hasPowerOutput=1
|
_industrialtest_hasPowerOutput=1
|
||||||
|
|||||||
@@ -21,38 +21,23 @@ generator.getFormspec=function(pos)
|
|||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local fuelPercent=meta:get_int("fuelTime")/meta:get_int("maxFuelTime")*100
|
local fuelPercent=meta:get_int("fuelTime")/meta:get_int("maxFuelTime")*100
|
||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.9,1.8;1,1]",
|
|
||||||
"listring[context;charged]",
|
|
||||||
(fuelPercent>0 and "image[4.9,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
|
||||||
or "image[4.9,2.8;1,1;default_furnace_fire_bg.png]"),
|
|
||||||
"list[context;fuel;4.9,3.9;1,1]",
|
|
||||||
"listring[context;fuel]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.7,1.8;1,1]",
|
"list[context;charged;4.7,1.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(4.7,1.8,1,1),
|
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1),
|
||||||
"listring[context;charged]",
|
|
||||||
(fuelPercent>0 and "image[4.7,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
(fuelPercent>0 and "image[4.7,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
||||||
or "image[4.7,2.8;1,1;default_furnace_fire_bg.png]"),
|
or "image[4.7,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||||
"list[context;fuel;4.7,3.9;1,1]",
|
"list[context;src;4.7,3.9;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(4.7,3.9,1,1),
|
industrialtest.internal.getItemSlotBg(4.7,3.9,1,1),
|
||||||
"listring[context;fuel]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
|
"listring[context;src]"
|
||||||
}
|
}
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
generator.onConstruct=function(pos,meta,inv)
|
generator.onConstruct=function(pos,meta,inv)
|
||||||
inv:set_size("charged",1)
|
inv:set_size("charged",1)
|
||||||
inv:set_size("fuel",1)
|
inv:set_size("src",1)
|
||||||
meta:set_int("fuelTime",0)
|
meta:set_int("fuelTime",0)
|
||||||
meta:set_int("maxFuelTime",1)
|
meta:set_int("maxFuelTime",1)
|
||||||
end
|
end
|
||||||
@@ -60,7 +45,7 @@ end
|
|||||||
generator.onTimer=function(pos,elapsed,meta,inv)
|
generator.onTimer=function(pos,elapsed,meta,inv)
|
||||||
local powerFlow=meta:get_int("industrialtest.powerFlow")
|
local powerFlow=meta:get_int("industrialtest.powerFlow")
|
||||||
local chargedSlot=inv:get_stack("charged",1)
|
local chargedSlot=inv:get_stack("charged",1)
|
||||||
local fuelSlot=inv:get_stack("fuel",1)
|
local fuelSlot=inv:get_stack("src",1)
|
||||||
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
||||||
local shouldUpdateFormspec=flowTransferred
|
local shouldUpdateFormspec=flowTransferred
|
||||||
local shouldRerunTimer=(afterFlow and meta:get_int("industrialtest.powerAmount")>0)
|
local shouldRerunTimer=(afterFlow and meta:get_int("industrialtest.powerAmount")>0)
|
||||||
@@ -79,7 +64,7 @@ generator.onTimer=function(pos,elapsed,meta,inv)
|
|||||||
if output.time>0 then
|
if output.time>0 then
|
||||||
meta:set_int("fuelTime",output.time)
|
meta:set_int("fuelTime",output.time)
|
||||||
meta:set_int("maxFuelTime",output.time)
|
meta:set_int("maxFuelTime",output.time)
|
||||||
inv:set_stack("fuel",1,after.items[1])
|
inv:set_stack("src",1,after.items[1])
|
||||||
minetest.swap_node(pos,{
|
minetest.swap_node(pos,{
|
||||||
name="industrialtest:generator_active",
|
name="industrialtest:generator_active",
|
||||||
param2=minetest.get_node(pos).param2
|
param2=minetest.get_node(pos).param2
|
||||||
@@ -92,7 +77,7 @@ end
|
|||||||
|
|
||||||
generator.activeOnTimer=function(pos,elapsed,meta,inv)
|
generator.activeOnTimer=function(pos,elapsed,meta,inv)
|
||||||
local chargedSlot=inv:get_stack("charged",1)
|
local chargedSlot=inv:get_stack("charged",1)
|
||||||
local fuelSlot=inv:get_stack("fuel",1)
|
local fuelSlot=inv:get_stack("src",1)
|
||||||
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
local afterFlow,flowTransferred=industrialtest.api.powerFlow(pos)
|
||||||
local shouldUpdateFormspec=flowTransferred
|
local shouldUpdateFormspec=flowTransferred
|
||||||
local shouldRerunTimer=(afterFlow and meta:get_int("industrialtest.powerAmount")>0)
|
local shouldRerunTimer=(afterFlow and meta:get_int("industrialtest.powerAmount")>0)
|
||||||
@@ -111,7 +96,7 @@ generator.activeOnTimer=function(pos,elapsed,meta,inv)
|
|||||||
if output.time>0 then
|
if output.time>0 then
|
||||||
meta:set_int("fuelTime",output.time)
|
meta:set_int("fuelTime",output.time)
|
||||||
meta:set_int("maxFuelTime",output.time)
|
meta:set_int("maxFuelTime",output.time)
|
||||||
inv:set_stack("fuel",1,after.items[1])
|
inv:set_stack("src",1,after.items[1])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if meta:get_int("fuelTime")>0 then
|
if meta:get_int("fuelTime")>0 then
|
||||||
@@ -141,7 +126,7 @@ industrialtest.internal.registerMachine({
|
|||||||
ioConfig="oooooo",
|
ioConfig="oooooo",
|
||||||
registerActiveVariant=true,
|
registerActiveVariant=true,
|
||||||
powerSlots={"charged"},
|
powerSlots={"charged"},
|
||||||
storageSlots={"charged","fuel"},
|
storageSlots={"charged","src"},
|
||||||
sounds="metal",
|
sounds="metal",
|
||||||
groups={
|
groups={
|
||||||
_industrialtest_hasPowerOutput=1
|
_industrialtest_hasPowerOutput=1
|
||||||
|
|||||||
@@ -43,44 +43,23 @@ inductionFurnace.getFormspec=function(pos)
|
|||||||
local maxSrcTime=meta:get_float("maxSrcTime")
|
local maxSrcTime=meta:get_float("maxSrcTime")
|
||||||
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
||||||
local heat=meta:get_int("heat")
|
local heat=meta:get_int("heat")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.7,1.8;2,1]",
|
"list[context;src;3.7,1.8;2,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(3.7,1.8,2,1),
|
||||||
(powerPercent>0 and "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;powerStorage;3.7,3.9;1,1]",
|
"list[context;powerStorage;3.7,3.9;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(3.7,3.9,1,1),
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6,2.8;2,1;]",
|
"list[context;dst;6,2.8;2,1;]",
|
||||||
|
industrialtest.internal.getItemSlotBg(6,2.8,2,1),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Heat: @1 %",heat)).."]",
|
"label[0.5,2.8;"..minetest.formspec_escape(S("Heat: @1 %",heat)).."]",
|
||||||
"listring[context;src]",
|
"listring[context;src]",
|
||||||
"listring[context;powerStorage]",
|
"listring[context;dst]"
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.7,1.8;2,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.7,1.8,2,1),
|
|
||||||
(powerPercent>0 and "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.7,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.7,3.9,1,1),
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;dst;6,2.8;2,1;]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6,2.8,2,1),
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Heat: @1 %",heat)).."]",
|
|
||||||
"listring[context;src]",
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -25,17 +25,17 @@ ironFurnace.getFormspec=function(fuelPercent,srcPercent)
|
|||||||
"size[10.8,12]",
|
"size[10.8,12]",
|
||||||
"label[0.5,0.5;"..S("Iron Furnace").."]",
|
"label[0.5,0.5;"..S("Iron Furnace").."]",
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
"listring[context;src]",
|
|
||||||
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
||||||
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||||
"list[context;fuel;3.4,3.9;1,1]",
|
"list[context;fuel;3.4,3.9;1,1]",
|
||||||
"listring[context;fuel]",
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
"list[context;dst;6.4,2.8;1,1]",
|
||||||
"listring[context;dst]",
|
|
||||||
"list[current_player;main;0.5,6.25;8,1]",
|
"list[current_player;main;0.5,6.25;8,1]",
|
||||||
"list[current_player;main;0.5,7.5;8,3;8]"
|
"list[current_player;main;0.5,7.5;8,3;8]",
|
||||||
|
"listring[current_player;main]",
|
||||||
|
"listring[context;src]",
|
||||||
|
"listring[context;dst]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
elseif industrialtest.mclAvailable then
|
||||||
formspec={
|
formspec={
|
||||||
@@ -43,21 +43,21 @@ ironFurnace.getFormspec=function(fuelPercent,srcPercent)
|
|||||||
"label[0.25,0.25;"..S("Iron Furnace").."]",
|
"label[0.25,0.25;"..S("Iron Furnace").."]",
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
||||||
"listring[context;src]",
|
|
||||||
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
||||||
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||||
"list[context;fuel;3.4,3.9;1,1]",
|
"list[context;fuel;3.4,3.9;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
||||||
"listring[context;fuel]",
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
"list[context;dst;6.4,2.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
||||||
"listring[context;dst]",
|
|
||||||
"list[current_player;main;0.5,7;9,3;9]",
|
"list[current_player;main;0.5,7;9,3;9]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
||||||
"list[current_player;main;0.5,10.24;9,1]",
|
"list[current_player;main;0.5,10.24;9,1]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1)
|
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1),
|
||||||
|
"listring[current_player;main]",
|
||||||
|
"listring[context;src]",
|
||||||
|
"listring[context;dst]"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
@@ -155,11 +155,6 @@ ironFurnace.activeOnTimer=function(pos,elapsed)
|
|||||||
meta:set_float("maxSrcTime",output.time*0.7)
|
meta:set_float("maxSrcTime",output.time*0.7)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if meta:get_float("fuelTime")>0 then
|
|
||||||
meta:set_float("fuelTime",meta:get_float("fuelTime")-elapsed)
|
|
||||||
shouldUpdateFormspec=true
|
|
||||||
shouldRerunTimer=true
|
|
||||||
end
|
|
||||||
if meta:get_float("maxSrcTime")>0 then
|
if meta:get_float("maxSrcTime")>0 then
|
||||||
if meta:get_float("fuelTime")>0 then
|
if meta:get_float("fuelTime")>0 then
|
||||||
meta:set_float("srcTime",meta:get_float("srcTime")+elapsed)
|
meta:set_float("srcTime",meta:get_float("srcTime")+elapsed)
|
||||||
@@ -180,6 +175,11 @@ ironFurnace.activeOnTimer=function(pos,elapsed)
|
|||||||
})
|
})
|
||||||
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
end
|
end
|
||||||
|
if meta:get_float("fuelTime")>0 then
|
||||||
|
meta:set_float("fuelTime",meta:get_float("fuelTime")-elapsed)
|
||||||
|
shouldUpdateFormspec=true
|
||||||
|
shouldRerunTimer=true
|
||||||
|
end
|
||||||
if meta:get_float("srcTime")>=meta:get_float("maxSrcTime") then
|
if meta:get_float("srcTime")>=meta:get_float("maxSrcTime") then
|
||||||
local output,after=minetest.get_craft_result({
|
local output,after=minetest.get_craft_result({
|
||||||
method="cooking",
|
method="cooking",
|
||||||
@@ -223,6 +223,23 @@ ironFurnace.allowMetadataInventoryPut=function(pos,listname,index,stack)
|
|||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ironFurnace.allowMetadataInventoryTake=function(pos,listname,index,stack)
|
||||||
|
local meta=minetest.get_meta(pos)
|
||||||
|
local inv=meta:get_inventory()
|
||||||
|
local srcSlot=inv:get_stack("src",1)
|
||||||
|
local dstSlot=inv:get_stack("dst",1)
|
||||||
|
if listname=="src" and stack:get_count()==srcSlot:get_count() then
|
||||||
|
meta:set_float("srcTime",-1)
|
||||||
|
meta:set_float("maxSrcTime",0)
|
||||||
|
if meta:get_float("maxFuelTime")>0 then
|
||||||
|
meta:set_string("formspec",ironFurnace.getFormspec(meta:get_float("fuelTime")/meta:get_float("maxFuelTime")*100,0))
|
||||||
|
end
|
||||||
|
elseif listname=="dst" and dstSlot:get_free_space()==0 then
|
||||||
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
|
end
|
||||||
|
return stack:get_count()
|
||||||
|
end
|
||||||
|
|
||||||
ironFurnace.onMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,count)
|
ironFurnace.onMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,count)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local inv=meta:get_inventory()
|
local inv=meta:get_inventory()
|
||||||
@@ -243,22 +260,6 @@ ironFurnace.onMetadataInventoryPut=function(pos,listname,index,stack)
|
|||||||
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
end
|
end
|
||||||
|
|
||||||
ironFurnace.onMetadataInventoryTake=function(pos,listname,index,stack)
|
|
||||||
local meta=minetest.get_meta(pos)
|
|
||||||
local inv=meta:get_inventory()
|
|
||||||
local srcSlot=inv:get_stack("src",1)
|
|
||||||
local dstSlot=inv:get_stack("dst",1)
|
|
||||||
if listname=="src" and stack:get_count()==srcSlot:get_count() then
|
|
||||||
meta:set_float("srcTime",-1)
|
|
||||||
meta:set_float("maxSrcTime",0)
|
|
||||||
if meta:get_float("maxFuelTime")>0 then
|
|
||||||
meta:set_string("formspec",ironFurnace.getFormspec(meta:get_float("fuelTime")/meta:get_float("maxFuelTime")*100,0))
|
|
||||||
end
|
|
||||||
elseif listname=="dst" and dstSlot:get_free_space()==0 then
|
|
||||||
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local definition={
|
local definition={
|
||||||
description=S("Iron Furnace"),
|
description=S("Iron Furnace"),
|
||||||
tiles={
|
tiles={
|
||||||
@@ -276,9 +277,9 @@ local definition={
|
|||||||
on_timer=ironFurnace.onTimer,
|
on_timer=ironFurnace.onTimer,
|
||||||
allow_metadata_inventory_move=ironFurnace.allowMetadataInventoryMove,
|
allow_metadata_inventory_move=ironFurnace.allowMetadataInventoryMove,
|
||||||
allow_metadata_inventory_put=ironFurnace.allowMetadataInventoryPut,
|
allow_metadata_inventory_put=ironFurnace.allowMetadataInventoryPut,
|
||||||
|
allow_metadata_inventory_take=ironFurnace.allowMetadataInventoryTake,
|
||||||
on_metadata_inventory_move=ironFurnace.onMetadataInventoryMove,
|
on_metadata_inventory_move=ironFurnace.onMetadataInventoryMove,
|
||||||
on_metadata_inventory_put=ironFurnace.onMetadataInventoryPut,
|
on_metadata_inventory_put=ironFurnace.onMetadataInventoryPut
|
||||||
on_metadata_inventory_take=ironFurnace.onMetadataInventoryTake
|
|
||||||
}
|
}
|
||||||
if industrialtest.mtgAvailable then
|
if industrialtest.mtgAvailable then
|
||||||
definition.groups={
|
definition.groups={
|
||||||
@@ -292,12 +293,21 @@ if industrialtest.mtgAvailable then
|
|||||||
return not (inv:get_list("src")[1]:get_count()>0 or inv:get_list("fuel")[1]:get_count()>0 or inv:get_list("dst")[1]:get_count()>0)
|
return not (inv:get_list("src")[1]:get_count()>0 or inv:get_list("fuel")[1]:get_count()>0 or inv:get_list("dst")[1]:get_count()>0)
|
||||||
end
|
end
|
||||||
elseif industrialtest.mclAvailable then
|
elseif industrialtest.mclAvailable then
|
||||||
|
definition.groups={
|
||||||
|
pickaxey=1,
|
||||||
|
container=2
|
||||||
|
}
|
||||||
definition.after_dig_node=function(pos,oldnode,oldmeta)
|
definition.after_dig_node=function(pos,oldnode,oldmeta)
|
||||||
industrialtest.internal.mclAfterDigNode(pos,oldmeta,{"src","fuel","dst"})
|
industrialtest.internal.mclAfterDigNode(pos,oldmeta,{"src","fuel","dst"})
|
||||||
end
|
end
|
||||||
definition.sounds=mcl_sounds.node_sound_metal_defaults()
|
definition.sounds=mcl_sounds.node_sound_metal_defaults()
|
||||||
definition._mcl_blast_resistance=3
|
definition._mcl_blast_resistance=3
|
||||||
definition._mcl_hardness=3.5
|
definition._mcl_hardness=3.5
|
||||||
|
definition._mcl_hoppers_on_try_pull = mcl_furnaces.hoppers_on_try_pull
|
||||||
|
definition._mcl_hoppers_on_try_push = mcl_furnaces.hoppers_on_try_push
|
||||||
|
definition._mcl_hoppers_on_after_push = function(pos)
|
||||||
|
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
minetest.register_node("industrialtest:iron_furnace",definition)
|
minetest.register_node("industrialtest:iron_furnace",definition)
|
||||||
definition=table.copy(definition)
|
definition=table.copy(definition)
|
||||||
@@ -316,7 +326,9 @@ definition.drop="industrialtest:iron_furnace"
|
|||||||
definition.on_timer=ironFurnace.activeOnTimer
|
definition.on_timer=ironFurnace.activeOnTimer
|
||||||
if industrialtest.mclAvailable then
|
if industrialtest.mclAvailable then
|
||||||
definition.groups={
|
definition.groups={
|
||||||
not_in_creative_inventory=1
|
not_in_creative_inventory=1,
|
||||||
|
pickaxey=1,
|
||||||
|
container=2
|
||||||
}
|
}
|
||||||
definition._doc_items_create_entry=false
|
definition._doc_items_create_entry=false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,30 +23,16 @@ reactor.getFormspec=function(pos)
|
|||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local size=math.floor(meta:get_int("size")/3)
|
local size=math.floor(meta:get_int("size")/3)
|
||||||
local switchText=(meta:get_int("enabled")==0 and S("Start") or S("Stop"))
|
local switchText=(meta:get_int("enabled")==0 and S("Start") or S("Stop"))
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;fuel;1,1;"..size..","..size.."]",
|
"list[context;fuel;1,1;"..size..","..size.."]",
|
||||||
"listring[context;fuel]",
|
industrialtest.internal.getItemSlotBg(1,1,size,size),
|
||||||
"list[context;charged;7.7,2.8;1,1]",
|
"list[context;charged;7,2.8;1,1]",
|
||||||
"listring[context;charged]",
|
industrialtest.internal.getItemSlotBg(7.7,2.8,1,1),
|
||||||
"button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]",
|
"button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]",
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
|
"listring[context;fuel]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;fuel;1,1;"..size..","..size.."]",
|
|
||||||
mcl_formspec.get_itemslot_bg(1,1,size,size),
|
|
||||||
"listring[context;fuel]",
|
|
||||||
"list[context;charged;7,2.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(7.7,2.8,1,1),
|
|
||||||
"listring[context;charged]",
|
|
||||||
"button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,32 +20,18 @@ local powerStorage={}
|
|||||||
powerStorage.getFormspec=function(pos)
|
powerStorage.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;1,2.5;1,1]",
|
"list[context;charged;1,2.5;1,1]",
|
||||||
"listring[context;charged]",
|
industrialtest.internal.getItemSlotBg(1,2.5,1,1),
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
"label[0.9,3.9;"..S("Charge").."]",
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
"list[context;discharged;3,2.5;1,1]",
|
||||||
"listring[context;discharged]",
|
industrialtest.internal.getItemSlotBg(3,2.5,1,1),
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
"label[2.7,3.9;"..S("Discharge").."]",
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;1,2.5;1,1]",
|
|
||||||
"listring[context;charged]",
|
"listring[context;charged]",
|
||||||
mcl_formspec.get_itemslot_bg(1,2.5,1,1),
|
"listring[context;discharged]"
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
|
||||||
"listring[context;discharged]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3,2.5,1,1),
|
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
}
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -27,51 +27,26 @@ rotaryMacerator.getFormspec=function(pos)
|
|||||||
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
||||||
local rpm=meta:get_int("rpm")
|
local rpm=meta:get_int("rpm")
|
||||||
local buttonMaintainSpeedText=meta:get_int("maintainSpeed")==1 and S("Don't maintain speed") or S("Maintain speed")
|
local buttonMaintainSpeedText=meta:get_int("maintainSpeed")==1 and S("Don't maintain speed") or S("Maintain speed")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.8,1.8;1,1]",
|
"list[context;src;3.8,1.8;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(3.8,1.8,1,1),
|
||||||
"list[context;modifier;4.9,1.8;1,1]",
|
"list[context;modifier;4.9,1.8;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(4.9,1.8,1,1),
|
||||||
(powerPercent>0 and "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;powerStorage;3.8,3.9;1,1]",
|
"list[context;powerStorage;3.8,3.9;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(3.8,3.9,1,1),
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6,2.8;1,1;]",
|
"list[context;dst;6,2.8;1,1;]",
|
||||||
|
industrialtest.internal.getItemSlotBg(6,2.8,1,1),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]",
|
"label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]",
|
||||||
"button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]",
|
"button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]",
|
||||||
"listring[context;src]",
|
"listring[context;src]",
|
||||||
"listring[context;modifier]",
|
"listring[context;dst]"
|
||||||
"listring[context;powerStorage]",
|
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.8,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.8,1.8,1,1),
|
|
||||||
"list[context;modifier;4.9,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(4.9,1.8,1,1),
|
|
||||||
(powerPercent>0 and "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.8,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.8,3.9,1,1),
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;dst;6,2.8;1,1;]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6,2.8,1,1),
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]",
|
|
||||||
"button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]",
|
|
||||||
"listring[context;src]",
|
|
||||||
"listring[context;modifier]",
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,23 +20,13 @@ local solarPanel={}
|
|||||||
solarPanel.getFormspec=function(pos)
|
solarPanel.getFormspec=function(pos)
|
||||||
local amount=minetest.get_natural_light(vector.offset(pos,0,1,0))/15.0
|
local amount=minetest.get_natural_light(vector.offset(pos,0,1,0))/15.0
|
||||||
local charging=amount>0.5
|
local charging=amount>0.5
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.9,1.8;1,1]",
|
|
||||||
"listring[context;charged]",
|
|
||||||
(charging and "image[4.9,2.8;1,1;industrialtest_gui_sun_fg.png]"
|
|
||||||
or "image[4.9,2.8;1,1;industrialtest_gui_sun_bg.png]")
|
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.7,1.8;1,1]",
|
"list[context;charged;4.7,1.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(4.7,1.8,1,1),
|
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1),
|
||||||
"listring[context;charged]",
|
|
||||||
(charging and "image[4.7,2.8;1,1;industrialtest_gui_sun_fg.png]"
|
(charging and "image[4.7,2.8;1,1;industrialtest_gui_sun_fg.png]"
|
||||||
or "image[4.7,2.8;1,1;industrialtest_gui_sun_bg.png]")
|
or "image[4.7,2.8;1,1;industrialtest_gui_sun_bg.png]"),
|
||||||
|
"listring[context;charged]"
|
||||||
}
|
}
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -20,45 +20,29 @@ local toolWorkshop={}
|
|||||||
toolWorkshop.getFormspec=function(pos)
|
toolWorkshop.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;powerStorage;3.7,3.7;1,1;0]",
|
"list[context;powerStorage;3.7,3.7;1,1;0]",
|
||||||
"listring[context;powerStorage]",
|
industrialtest.internal.getItemSlotBg(3.7,3.7,1,1),
|
||||||
(powerPercent>0 and "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;tool;5.9,3.2;1,1;0]",
|
"list[context;src;5.9,3.2;1,1;0]",
|
||||||
"listring[context;tool]",
|
industrialtest.internal.getItemSlotBg(5.9,3.2,1,1),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
"listring[context;upgrades]"
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
|
"listring[context;src]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;powerStorage;3.7,3.7;1,1;0]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.7,3.7,1,1),
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
(powerPercent>0 and "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;tool;5.9,3.2;1,1;0]",
|
|
||||||
mcl_formspec.get_itemslot_bg(5.9,3.2,1,1),
|
|
||||||
"listring[context;tool]",
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
toolWorkshop.onConstruct=function(pos,meta,inv)
|
toolWorkshop.onConstruct=function(pos,meta,inv)
|
||||||
inv:set_size("powerStorage",1)
|
inv:set_size("powerStorage",1)
|
||||||
inv:set_size("tool",1)
|
inv:set_size("src",1)
|
||||||
inv:set_size("upgrades",4)
|
inv:set_size("upgrades",4)
|
||||||
end
|
end
|
||||||
|
|
||||||
toolWorkshop.onTimer=function(pos,elapsed,meta,inv)
|
toolWorkshop.onTimer=function(pos,elapsed,meta,inv)
|
||||||
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
||||||
local toolSlot=inv:get_stack("tool",1)
|
local toolSlot=inv:get_stack("src",1)
|
||||||
local requiredPower=industrialtest.api.getMachineSpeed(meta)*10000
|
local requiredPower=industrialtest.api.getMachineSpeed(meta)*10000
|
||||||
local shouldRerunTimer=false
|
local shouldRerunTimer=false
|
||||||
local shouldUpdateFormspec=false
|
local shouldUpdateFormspec=false
|
||||||
@@ -86,7 +70,7 @@ end
|
|||||||
|
|
||||||
toolWorkshop.activeOnTimer=function(pos,elapsed,meta,inv)
|
toolWorkshop.activeOnTimer=function(pos,elapsed,meta,inv)
|
||||||
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
local powerStorageSlot=inv:get_stack("powerStorage",1)
|
||||||
local toolSlot=inv:get_stack("tool",1)
|
local toolSlot=inv:get_stack("src",1)
|
||||||
local speed=industrialtest.api.getMachineSpeed(meta)
|
local speed=industrialtest.api.getMachineSpeed(meta)
|
||||||
local requiredPower=speed*10000
|
local requiredPower=speed*10000
|
||||||
local shouldRerunTimer=false
|
local shouldRerunTimer=false
|
||||||
@@ -105,7 +89,7 @@ toolWorkshop.activeOnTimer=function(pos,elapsed,meta,inv)
|
|||||||
if toolSlot:get_count()>0 and toolSlot:get_wear()>0 and meta:get_int("industrialtest.powerAmount")>=requiredPower then
|
if toolSlot:get_count()>0 and toolSlot:get_wear()>0 and meta:get_int("industrialtest.powerAmount")>=requiredPower then
|
||||||
local removed=math.min(toolSlot:get_wear(),speed*200)
|
local removed=math.min(toolSlot:get_wear(),speed*200)
|
||||||
toolSlot:set_wear(toolSlot:get_wear()-removed)
|
toolSlot:set_wear(toolSlot:get_wear()-removed)
|
||||||
inv:set_stack("tool",1,toolSlot)
|
inv:set_stack("src",1,toolSlot)
|
||||||
industrialtest.api.addPower(meta,-requiredPower)
|
industrialtest.api.addPower(meta,-requiredPower)
|
||||||
shouldRerunTimer=true
|
shouldRerunTimer=true
|
||||||
shouldUpdateFormspec=true
|
shouldUpdateFormspec=true
|
||||||
@@ -128,7 +112,7 @@ local function isTool(stack)
|
|||||||
end
|
end
|
||||||
|
|
||||||
toolWorkshop.allowMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,count)
|
toolWorkshop.allowMetadataInventoryMove=function(pos,fromList,fromIndex,toList,toIndex,count)
|
||||||
if toList=="tool" then
|
if toList=="src" then
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local inv=meta:get_inventory()
|
local inv=meta:get_inventory()
|
||||||
local movedItemStack=inv:get_stack(fromList,fromIndex)
|
local movedItemStack=inv:get_stack(fromList,fromIndex)
|
||||||
@@ -160,7 +144,7 @@ industrialtest.internal.registerMachine({
|
|||||||
requiresWrench=true,
|
requiresWrench=true,
|
||||||
registerActiveVariant=true,
|
registerActiveVariant=true,
|
||||||
powerSlots={"powerStorage"},
|
powerSlots={"powerStorage"},
|
||||||
storageSlots={"tool"},
|
storageSlots={"src"},
|
||||||
sounds="metal",
|
sounds="metal",
|
||||||
groups={
|
groups={
|
||||||
_industrialtest_hasPowerInput=1
|
_industrialtest_hasPowerInput=1
|
||||||
|
|||||||
@@ -20,23 +20,13 @@ local windMill={}
|
|||||||
windMill.getFormspec=function(pos)
|
windMill.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local charging=meta:get_int("charging")
|
local charging=meta:get_int("charging")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.9,1.8;1,1]",
|
|
||||||
"listring[context;charged]",
|
|
||||||
(charging>0 and "image[4.9,3;1,1;industrialtest_gui_wind_bg.png^[lowpart:"..charging..":industrialtest_gui_wind_fg.png]"
|
|
||||||
or "image[4.9,3;1,1;industrialtest_gui_wind_bg.png]")
|
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.7,1.8;1,1]",
|
"list[context;charged;4.7,1.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(4.7,1.8,1,1),
|
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1),
|
||||||
"listring[context;charged]",
|
|
||||||
(charging>0 and "image[4.7,3;1,1;industrialtest_gui_wind_bg.png^[lowpart:"..charging..":industrialtest_gui_wind_fg.png]"
|
(charging>0 and "image[4.7,3;1,1;industrialtest_gui_wind_bg.png^[lowpart:"..charging..":industrialtest_gui_wind_fg.png]"
|
||||||
or "image[4.7,3;1,1;industrialtest_gui_wind_bg.png]")
|
or "image[4.7,3;1,1;industrialtest_gui_wind_bg.png]"),
|
||||||
|
"listring[context;charged]"
|
||||||
}
|
}
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 332 B |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 405 B |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
BIN
textures/industrialtest_cell_casing.png
Normal file
|
After Width: | Height: | Size: 290 B |
BIN
textures/industrialtest_cell_fluid.png
Normal file
|
After Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 863 B |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 302 B |
|
Before Width: | Height: | Size: 880 B After Width: | Height: | Size: 321 B |
|
Before Width: | Height: | Size: 815 B After Width: | Height: | Size: 282 B |
|
Before Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 867 B |
|
Before Width: | Height: | Size: 499 B After Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 402 B |
|
Before Width: | Height: | Size: 571 B After Width: | Height: | Size: 589 B |
|
Before Width: | Height: | Size: 571 B After Width: | Height: | Size: 790 B |
|
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 490 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 732 B |
|
Before Width: | Height: | Size: 977 B After Width: | Height: | Size: 471 B |
|
Before Width: | Height: | Size: 953 B After Width: | Height: | Size: 748 B |
|
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 414 B |
|
Before Width: | Height: | Size: 582 B After Width: | Height: | Size: 420 B |
|
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 229 B |
BIN
textures/industrialtest_plate_overlay.png
Normal file
|
After Width: | Height: | Size: 144 B |
|
Before Width: | Height: | Size: 658 B After Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 878 B |
|
Before Width: | Height: | Size: 834 B After Width: | Height: | Size: 527 B |
|
Before Width: | Height: | Size: 859 B |
|
Before Width: | Height: | Size: 862 B |