Refactor Mass Fabricator
This commit is contained in:
parent
d247060c2e
commit
8e30412515
@ -52,7 +52,7 @@ function industrialtest.CableFormer.getCraftResult(self,itemstack)
|
|||||||
return {
|
return {
|
||||||
item=ItemStack(),
|
item=ItemStack(),
|
||||||
time=0,
|
time=0,
|
||||||
src=item
|
src=itemstack
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local srcAfter=ItemStack(itemstack:get_name())
|
local srcAfter=ItemStack(itemstack:get_name())
|
||||||
|
@ -52,7 +52,7 @@ function industrialtest.Compressor.getCraftResult(self,itemstack)
|
|||||||
return {
|
return {
|
||||||
item=ItemStack(),
|
item=ItemStack(),
|
||||||
time=0,
|
time=0,
|
||||||
src=item
|
src=itemstack
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local srcAfter=ItemStack(itemstack:get_name())
|
local srcAfter=ItemStack(itemstack:get_name())
|
||||||
|
@ -52,7 +52,7 @@ function industrialtest.Extractor.getCraftResult(self,itemstack)
|
|||||||
return {
|
return {
|
||||||
item=ItemStack(),
|
item=ItemStack(),
|
||||||
time=0,
|
time=0,
|
||||||
src=item
|
src=itemstack
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local srcAfter=ItemStack(itemstack:get_name())
|
local srcAfter=ItemStack(itemstack:get_name())
|
||||||
|
@ -52,7 +52,7 @@ function industrialtest.Macerator.getCraftResult(self,itemstack)
|
|||||||
return {
|
return {
|
||||||
item=ItemStack(),
|
item=ItemStack(),
|
||||||
time=0,
|
time=0,
|
||||||
src=item
|
src=itemstack
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
local srcAfter=ItemStack(itemstack:get_name())
|
local srcAfter=ItemStack(itemstack:get_name())
|
||||||
|
@ -15,20 +15,56 @@
|
|||||||
-- 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 massFabricator={}
|
industrialtest.MassFabricator=table.copy(industrialtest.SimpleElectricItemProcessor)
|
||||||
|
industrialtest.internal.unpackTableInto(industrialtest.MassFabricator,{
|
||||||
industrialtest.internal.registerSimpleElectricItemProcessor({
|
name="industrialtest:mass_fabricator",
|
||||||
name="mass_fabricator",
|
description=S("Mass Fabricator"),
|
||||||
displayName=S("Mass Fabricator"),
|
tiles={
|
||||||
capacity=100000,
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png^industrialtest_mass_fabricator_front.png",
|
||||||
|
"industrialtest_advanced_machine_block.png"
|
||||||
|
},
|
||||||
requiresWrench=true,
|
requiresWrench=true,
|
||||||
|
active={
|
||||||
|
tiles={
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png",
|
||||||
|
"industrialtest_advanced_machine_block.png^industrialtest_mass_fabricator_front_active.png",
|
||||||
|
"industrialtest_advanced_machine_block.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
capacity=100000,
|
||||||
flow=industrialtest.api.evPowerFlow,
|
flow=industrialtest.api.evPowerFlow,
|
||||||
opPower=10000,
|
opPower=10000,
|
||||||
machineBlockTexture="industrialtest_advanced_machine_block.png",
|
|
||||||
customFrontTexture=true,
|
|
||||||
method="industrialtest.mass_fabricating",
|
|
||||||
efficiency=1
|
efficiency=1
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function industrialtest.MassFabricator.getCraftResult(self,itemstack)
|
||||||
|
if itemstack:get_count()<34 or itemstack:get_name()~="industrialtest:scrap" then
|
||||||
|
return {
|
||||||
|
item=ItemStack(),
|
||||||
|
time=0,
|
||||||
|
src=itemstack
|
||||||
|
}
|
||||||
|
end
|
||||||
|
local srcAfter=ItemStack(itemstack:get_name())
|
||||||
|
srcAfter:set_count(itemstack:get_count()-34)
|
||||||
|
return {
|
||||||
|
item=ItemStack("industrialtest:uu_matter"),
|
||||||
|
time=15,
|
||||||
|
src=srcAfter
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
industrialtest.MassFabricator:register()
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
output="industrialtest:mass_fabricator",
|
output="industrialtest:mass_fabricator",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user