Lets assume you are writing a mod for a furnace the uses oil instead of electricity or coal. Right now there is no easy way to do this. But if objects were defined in XML instead of being hard coded there would be.
Lets assume the XML definition for a furnace looks like this
Code: Select all
<item name="stone_furnace" icon="__base__/graphics/icons/stone-furnace.png" order=1>
<recipe>
<ingredient type="stone" amount=5>
</recipe>
<flags>
goes-to-quickbar
</flags>
<subgroup name="smelting-machine" />
<stack size=64 />
<place-result>
<flags>
placeable-neutral,
placeable-player,
player-creation
</flags>
<minable time=1 result="stone-furnace" />
<health max=150 />
<corpse type="medium-remnants" />
<repair-sound filename = "__base__/sound/manual-repair-simple.wav" />
<mined-sound filename = "__base__/sound/deconstruct-bricks.wav" />
<resistances>
<fire percent=80 />
<explosion percent=30 />
</resistances>
<colluision-box upper-left="-0.7, -0.7" bottom-right="0.7, 0.7" />
<selection-box upper-left="-0.8, -1" bottom-right="0.8, 1" />
<inventory type="source" size=1 />
<smelting speed=1 energy-consumption="180kW">
<item name="iron-ore" amount=1 energy-required=3.5>
<result name="iron-plate" amount=1 />
</item>
<item name="copper-ore" amount=1 energy-required=3.5>
<result name="copper-plate" amount=1 />
</item>
</smelting>
<energy-source type="burner" effectivity = 1>
<inventory size=1 />
<emission type="pollution" amount=0.01 />
</energy-source>
<smoke deviation="0.1, 0.1" frequency=0.5 position="0, 0" vertical-speed=0.05 />
<on-animation filename="__base__/graphics/entity/stone-furnace/stone-furnace.png" priority=10>
<frame width=81 height=64 count=1 shift="0.5, 0.5" />
</on-animation>
<off-animation filename="__base__/graphics/entity/stone-furnace/stone-furnace.png" priority=10>
<frame width=81 height=64 count=1 shift="0.5, 0.5" />
</off-animation>
<fire-animation filename="__base__/graphics/entity/stone-furnace/stone-furnace-fire.png" priority=10>
<frame width=23 height=27 count=12 shift="0.078125, 0.5234375" />
</fire-animation>
<fast-replace group="furnace" />
</place-result>
<control-script filename="" />
</item>
Now writing an oil furnace would be very simple.
First you would need to create the fuel type.
Code: Select all
<energy-source name="fluid">
<fuel type="oil" value="100MJ" />
</energy-source>
Now you have a furnace that accepts oil as fuel, but what about the input? That's just as easy as adding one XML tag to the furnace definition.
Just add:
Code: Select all
<pipe-connection type="input" position="1, 1" />