Refactor Cable Former
This commit is contained in:
parent
c379b133dc
commit
5ddeeed36f
@ -15,18 +15,57 @@
|
|||||||
-- 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")
|
||||||
|
industrialtest.CableFormer=table.copy(industrialtest.SimpleElectricItemProcessor)
|
||||||
industrialtest.internal.registerSimpleElectricItemProcessor({
|
industrialtest.internal.unpackTableInto(industrialtest.CableFormer,{
|
||||||
name="cable_former",
|
name="industrialtest:cable_former",
|
||||||
displayName=S("Cable Former"),
|
description=S("Cable Former"),
|
||||||
customFrontTexture=true,
|
tiles={
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png^industrialtest_cable_former_front.png",
|
||||||
|
"industrialtest_machine_block.png"
|
||||||
|
},
|
||||||
requiresWrench=true,
|
requiresWrench=true,
|
||||||
|
active={
|
||||||
|
tiles={
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png",
|
||||||
|
"industrialtest_machine_block.png^industrialtest_cable_former_front_active.png",
|
||||||
|
"industrialtest_machine_block.png"
|
||||||
|
}
|
||||||
|
},
|
||||||
capacity=1400,
|
capacity=1400,
|
||||||
flow=industrialtest.api.lvPowerFlow,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=80,
|
opPower=80,
|
||||||
method="industrialtest.cable_forming",
|
|
||||||
efficiency=1
|
efficiency=1
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function industrialtest.CableFormer.getCraftResult(self,itemstack)
|
||||||
|
local output=industrialtest.api.getCableFormerRecipeResult(itemstack:get_name())
|
||||||
|
if not output then
|
||||||
|
return {
|
||||||
|
item=ItemStack(),
|
||||||
|
time=0,
|
||||||
|
src=item
|
||||||
|
}
|
||||||
|
end
|
||||||
|
local srcAfter=ItemStack(itemstack:get_name())
|
||||||
|
srcAfter:set_count(itemstack:get_count()-1)
|
||||||
|
return {
|
||||||
|
item=ItemStack(output.output),
|
||||||
|
time=output.time,
|
||||||
|
src=srcAfter
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
industrialtest.CableFormer:register()
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
output="industrialtest:cable_former",
|
output="industrialtest:cable_former",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user