blob: 3bd4140a71fa9f5fc691bdf17bccb405bf5edaee [file] [log] [blame] [raw]
package li.cil.oc.integration.fmp
import java.util
import codechicken.lib.vec.BlockCoord
import codechicken.multipart.MultiPartRegistry
import codechicken.multipart.MultiPartRegistry.IPartConverter
import li.cil.oc.api.Items
import li.cil.oc.common.tileentity.Cable
import net.minecraft.world.World
object MultipartConverter extends IPartConverter {
def init() {
MultiPartRegistry.registerConverter(this)
}
override def blockTypes = util.Arrays.asList(Items.get("cable").block)
override def convert(world: World, pos: BlockCoord) = {
world.getTileEntity(pos.x, pos.y, pos.z) match {
case cable: Cable => new CablePart(Some(cable))
case _ => null
}
}
}