10 Commits

18 changed files with 36 additions and 35 deletions

View File

@@ -197,13 +197,13 @@ if industrialtest.mclAvailable then
count=2
})
end
industrialtest.api.registerResourceDust("coal","Coal",resources,"#101010ff",true)
industrialtest.api.registerResourceDust("coal","Coal",resources,"#262523ff",true)
industrialtest.api.registerResourceDust("clay","Clay",{
{
resource=industrialtest.elementKeys.clayBlock,
count=2
}
},"#9090a0ff",true)
},"#707070ff",true)
resources={
{
resource=industrialtest.elementKeys.diamondBlock,
@@ -221,7 +221,7 @@ if industrialtest.mclAvailable then
count=2
})
end
industrialtest.api.registerResourceDust("diamond","Diamond",resources,"#90e2c9ff",true)
industrialtest.api.registerResourceDust("diamond","Diamond",resources,"#77cefbff",true)
minetest.register_craft({
type="cooking",
output=industrialtest.elementKeys.diamond,
@@ -248,7 +248,7 @@ if industrialtest.mclAvailable then
count=2
})
end
industrialtest.api.registerResourceDust("iron","Iron",resources,"#b5b5b5ff",true)
industrialtest.api.registerResourceDust("iron","Iron",resources,"#afaca5ff",true)
minetest.register_craft({
type="cooking",
output=industrialtest.elementKeys.ironIngot,
@@ -269,7 +269,7 @@ if industrialtest.mclAvailable then
count=9
},
{resource="mcl_core:lapis_lazuli"}
},"#292d76ff",true)
},"#3a4cceff",true)
end
industrialtest.api.registerResourceDust("obsidian","Obsidian",{{resource=industrialtest.elementKeys.obsidian}},"#292843ff",true)
resources={
@@ -293,7 +293,7 @@ if industrialtest.mclAvailable then
count=2
})
end
industrialtest.api.registerResourceDust("gold","Gold",resources,"#e4e526ff",true)
industrialtest.api.registerResourceDust("gold","Gold",resources,"#eac162ff",true)
minetest.register_craft({
type="cooking",
output=industrialtest.elementKeys.goldIngot,
@@ -320,7 +320,7 @@ if industrialtest.mclAvailable then
count=2
})
end
industrialtest.api.registerResourceDust("copper","Copper",resources,"#a45e25ff",true)
industrialtest.api.registerResourceDust("copper","Copper",resources,"#bf644aff",true)
minetest.register_craft({
type="cooking",
output=industrialtest.elementKeys.copperIngot,
@@ -347,7 +347,7 @@ if industrialtest.mclAvailable then
count=2
})
end
industrialtest.api.registerResourceDust("tin","Tin",resources,"#f1f1f1ff",true)
industrialtest.api.registerResourceDust("tin","Tin",resources,"#ebd182ff",true)
minetest.register_craft({
type="cooking",
output=industrialtest.elementKeys.tinIngot,
@@ -404,7 +404,7 @@ industrialtest.api.registerResourceDust("bronze","Bronze",{
count=9
},
{resource=industrialtest.elementKeys.bronzeIngot}
},"#e48e88ff",true)
},"#be4325ff",true)
minetest.register_craft({
type="shaped",
output="industrialtest:bronze_dust 9",
@@ -431,7 +431,7 @@ industrialtest.api.registerRotaryMaceratorModifier({
output="industrialtest:bronze_dust",
uses=4
})
industrialtest.api.registerResourceDust("sulfur","Sulfur",{},"#e3ff33ff",false)
industrialtest.api.registerResourceDust("sulfur","Sulfur",{},"#b88805ff",false)
industrialtest.api.registerExtractorRecipe({
output="industrialtest:sulfur_dust",
recipe=industrialtest.elementKeys.gunpowder
@@ -450,7 +450,7 @@ industrialtest.api.registerResourceDust("lead","Lead",{
count=2
},
{resource="industrialtest:lead_ingot"}
},"#eafef8ff",true)
},"#6d6393ff",true)
minetest.register_craft({
type="cooking",
output="industrialtest:lead_ingot",
@@ -461,7 +461,7 @@ industrialtest.api.registerResourceDust("refined_iron","Refined Iron",{
resource="industrialtest:refined_iron_ingot",
count=1
}
},"#7c8588ff",true)
},"#94bab9ff",true)
industrialtest.api.registerRotaryMaceratorModifier({
name=industrialtest.elementKeys.ironLump,
modifier=industrialtest.elementKeys.coal,

View File

@@ -155,11 +155,6 @@ ironFurnace.activeOnTimer=function(pos,elapsed)
meta:set_float("maxSrcTime",output.time*0.7)
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("fuelTime")>0 then
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)
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
local output,after=minetest.get_craft_result({
method="cooking",
@@ -223,6 +223,23 @@ ironFurnace.allowMetadataInventoryPut=function(pos,listname,index,stack)
return stack:get_count()
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)
local meta=minetest.get_meta(pos)
local inv=meta:get_inventory()
@@ -243,22 +260,6 @@ ironFurnace.onMetadataInventoryPut=function(pos,listname,index,stack)
minetest.get_node_timer(pos):start(industrialtest.updateDelay)
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={
description=S("Iron Furnace"),
tiles={
@@ -276,9 +277,9 @@ local definition={
on_timer=ironFurnace.onTimer,
allow_metadata_inventory_move=ironFurnace.allowMetadataInventoryMove,
allow_metadata_inventory_put=ironFurnace.allowMetadataInventoryPut,
allow_metadata_inventory_take=ironFurnace.allowMetadataInventoryTake,
on_metadata_inventory_move=ironFurnace.onMetadataInventoryMove,
on_metadata_inventory_put=ironFurnace.onMetadataInventoryPut,
on_metadata_inventory_take=ironFurnace.onMetadataInventoryTake
on_metadata_inventory_put=ironFurnace.onMetadataInventoryPut
}
if industrialtest.mtgAvailable then
definition.groups={

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 499 B

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

After

Width:  |  Height:  |  Size: 402 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

After

Width:  |  Height:  |  Size: 790 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 776 B

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 977 B

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 953 B

After

Width:  |  Height:  |  Size: 748 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 527 B